Package api.mpba.rastvdmy.service
Interface PaymentService
- All Known Implementing Classes:
PaymentServiceImpl
public interface PaymentService
Service interface for managing payment operations within the application.
-
Method Summary
Modifier and TypeMethodDescriptioncreateBankTransfer
(jakarta.servlet.http.HttpServletRequest request, UUID accountId, String recipientNumber, BigDecimal amount, String description) Creates a bank transfer payment.createCardPayment
(jakarta.servlet.http.HttpServletRequest request, UUID accountId, UUID cardId) Creates a card payment.getAllPayments
(jakarta.servlet.http.HttpServletRequest request, String bankName, UUID accountId) Retrieves all payments associated with a specific bank account.getPaymentById
(jakarta.servlet.http.HttpServletRequest request, String bankName, UUID accountId, UUID paymentId) Retrieves a specific payment by its unique identifier.
-
Method Details
-
getAllPayments
List<Payment> getAllPayments(jakarta.servlet.http.HttpServletRequest request, String bankName, UUID accountId) Retrieves all payments associated with a specific bank account.- Parameters:
request
- the HTTP request containing context informationbankName
- the name of the bank associated with the paymentsaccountId
- the unique identifier of the bank account- Returns:
- a list of payments associated with the specified bank account
-
getPaymentById
Payment getPaymentById(jakarta.servlet.http.HttpServletRequest request, String bankName, UUID accountId, UUID paymentId) Retrieves a specific payment by its unique identifier.- Parameters:
request
- the HTTP request containing context informationbankName
- the name of the bank associated with the paymentaccountId
- the unique identifier of the bank accountpaymentId
- the unique identifier of the payment- Returns:
- the payment associated with the specified payment ID
-
createBankTransfer
Payment createBankTransfer(jakarta.servlet.http.HttpServletRequest request, UUID accountId, String recipientNumber, BigDecimal amount, String description) throws Exception Creates a bank transfer payment.- Parameters:
request
- the HTTP request containing context informationaccountId
- the unique identifier of the bank account initiating the transferrecipientNumber
- the account number of the payment recipientamount
- the amount to be transferreddescription
- a description of the payment- Returns:
- the created Payment object
- Throws:
Exception
- if there is an error while creating the bank transfer
-
createCardPayment
Payment createCardPayment(jakarta.servlet.http.HttpServletRequest request, UUID accountId, UUID cardId) throws Exception Creates a card payment.- Parameters:
request
- the HTTP request containing context informationaccountId
- the unique identifier of the bank account used for the card paymentcardId
- the unique identifier of the card being used for the payment- Returns:
- the created Payment object
- Throws:
Exception
- if there is an error while creating the card payment
-