Class PaymentService

java.lang.Object
org.bookstore.payment.service.PaymentService

public class PaymentService extends Object
The class PaymentService defines a service to make payments for book orders.
  • Constructor Details

    • PaymentService

      public PaymentService()
  • Method Details

    • makePayment

      public Payment makePayment(Customer customer, BigDecimal amount) throws PaymentFailedException
      Makes a credit card payment for a book order.
      Parameters:
      customer - the customer of the order
      amount - 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