Package org.bookstore.payment.service
Class PaymentService
java.lang.Object
org.bookstore.payment.service.PaymentService
The class PaymentService defines a service to make payments for book orders.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmakePayment(Customer customer, BigDecimal amount) Makes a credit card payment for a book order.
-
Constructor Details
-
PaymentService
public PaymentService()
-
-
Method Details
-
makePayment
Makes a credit card payment for a book order.- Parameters:
customer- the customer of the orderamount- the amount of the payment- Returns:
- the data of the made payment
- Throws:
PaymentFailedException- if the credit card is invalid or expired, or if the payment exceeds the limit
-