Class PaymentService
java.lang.Object
de.bytestore.hostinger.ecommerce.service.PaymentService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthorize(jakarta.servlet.http.HttpServletRequest requestIO, jakarta.servlet.http.HttpServletResponse responseIO, String providerIO) Authorizes a payment request with the specified provider.createPayment(Invoice invoiceIO, String providerIO) Creates a payment based on the given invoice.getPayment(String idIO) Retrieves a list of Payment objects based on the specified token.list()Retrieves a list of PaymentExtensionPoint objects from the moduleService.refreshPayment(Payment paymentIO) Refreshes a payment by querying all available payment extension points for an updated payment object.voidwebhooks()
-
Constructor Details
-
PaymentService
public PaymentService()
-
-
Method Details
-
webhooks
public void webhooks() -
createPayment
Creates a payment based on the given invoice.- Parameters:
invoiceIO- the invoice for which the payment needs to be createdproviderIO-- Returns:
- the created payment object
-
authorize
public boolean authorize(jakarta.servlet.http.HttpServletRequest requestIO, jakarta.servlet.http.HttpServletResponse responseIO, String providerIO) throws Exception Authorizes a payment request with the specified provider.- Parameters:
requestIO- the HTTP servlet request objectresponseIO- the HTTP servlet response objectproviderIO- the name of the payment provider- Throws:
Exception- if an error occurs during authorization
-
refreshPayment
Refreshes a payment by querying all available payment extension points for an updated payment object.- Parameters:
paymentIO- the payment object to be refreshed- Returns:
- the refreshed payment object
-
getPayment
Retrieves a list of Payment objects based on the specified token.- Parameters:
idIO- the token used to filter the payments- Returns:
- a list of Payment objects that match the given token
-
list
Retrieves a list of PaymentExtensionPoint objects from the moduleService.- Returns:
- A List of PaymentExtensionPoint objects.
-