Package src.controller
Class PaymentManager
Object
PaymentManager
Controller for handling all logic related to
Payment- Version:
- 1.0
- Author:
- Ci Hui
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecalculateHolidayWeekendPrice(DateTime showingTime) Method to calculate the Price Weight when the day is a special day ie.static doublecalculateMovieTicketPrice(MovieGoer movieGoer, String cinemaUUID, String movieUUID, String seatUUID, DateTime showingTime) Method to calculate the price of a Movie Ticketstatic PaymentcreateBankTransactioPayment(String transactionID, double movieTicketPrice) Method to create aPaymentinstance with Payment Type of Bank Transaction and save to databasestatic PaymentcreateCardPayment(String transactionID, double movieTicketPrice) Method to create aPaymentinstance with Payment Type of Card Payment and save to databasestatic PaymentcreateQRCodePayment(String transactionID, double movieTicketPrice) Method to create aPaymentinstance with Payment Type of QR Code and save to databasestatic StringgenerateTransactionId(String cinemaCode) Method to generate Transaction ID of the Payment Format of Transaction ID: XXXYYYYMMDDhhmm (XXX: Cinema Code in letters, YYYY: year, MM: month, DD: day, hh: hour, mm: minutes)static PaymentgetPaymentByUUID(String paymentUUID) Method to obtain a Payment by its UUID
-
Constructor Details
-
PaymentManager
public PaymentManager()Constructor
-
-
Method Details
-
createQRCodePayment
Method to create aPaymentinstance with Payment Type of QR Code and save to database- Parameters:
transactionID- is the transaction ID of Payment generated when payment is made by Movie GoermovieTicketPrice- is the total price of the Movie Tickets booked by Movie Goer- Returns:
- the created
Paymentinstance
-
createBankTransactioPayment
Method to create aPaymentinstance with Payment Type of Bank Transaction and save to database- Parameters:
transactionID- is the transaction ID of Payment generated when payment is made by Movie GoermovieTicketPrice- is the total price of the Movie Tickets booked by Movie Goer- Returns:
- the created
Paymentinstance
-
createCardPayment
Method to create aPaymentinstance with Payment Type of Card Payment and save to database- Parameters:
transactionID- is the transaction ID of Payment generated when payment is made by Movie GoermovieTicketPrice- is the total price of the Movie Tickets booked by Movie Goer- Returns:
- the created
Paymentinstance
-
calculateMovieTicketPrice
public static double calculateMovieTicketPrice(MovieGoer movieGoer, String cinemaUUID, String movieUUID, String seatUUID, DateTime showingTime) Method to calculate the price of a Movie Ticket- Parameters:
movieGoer- is theMovieGoerwho booked the Movie TicketcinemaUUID- is the unique ID of the Cinema chosen by the Movie GoermovieUUID- is the unique ID of the Movie chosen by the Movie GoerseatUUID- is the unique ID of the Seat chosen by the Movie GoershowingTime- is theDateTimeof Showing Time of the Movie chosen by the Movie Goer- Returns:
- the calculated price of the Movie Ticket
-
generateTransactionId
Method to generate Transaction ID of the Payment Format of Transaction ID: XXXYYYYMMDDhhmm (XXX: Cinema Code in letters, YYYY: year, MM: month, DD: day, hh: hour, mm: minutes)- Parameters:
cinemaCode- is the Cinema Code of the chosen Cinema, obtained from the last 3 characters of the Cinema UUID- Returns:
- the Transaction ID
-
getPaymentByUUID
Method to obtain a Payment by its UUID- Parameters:
paymentUUID- is the target Payment's UUID- Returns:
- the target
Payment
-
calculateHolidayWeekendPrice
Method to calculate the Price Weight when the day is a special day ie. Weekends or Holidays- Parameters:
showingTime- is theDateTimeof the Showing Time of the Movie chosen by the Movie Goer- Returns:
- the Price Weight of Special Day (Weekend or Holiday)
-