public interface PaymentGatewayCheckoutService
The default implementation of this interface is represented in the core Broadleaf framework at
oorg.broadleafcommerce.core.payment.service.DefaultPaymentGatewayCheckoutService
. This is designed as
a generic contract for allowing payment modules to add payments to an order represented in Broadleaf while still
staying decoupled from any of the Broadleaf core framework concepts.
These service methods are usually invoked from the controller that listens to the endpoint hit by the external payment
provider (which should be a subclass of PaymentGatewayAbstractController
).
PaymentGatewayAbstractController}
Modifier and Type | Method and Description |
---|---|
Long |
applyPaymentToOrder(PaymentResponseDTO responseDTO,
PaymentGatewayConfiguration config) |
String |
initiateCheckout(Long orderId)
Initiates the checkout process for a given orderId.
|
String |
lookupOrderNumberFromOrderId(PaymentResponseDTO responseDTO)
Looks up the order number for a particular order id from the
PaymentResponseDTO . |
void |
markPaymentAsInvalid(Long orderPaymentId)
Marks a given order payment as invalid.
|
Long applyPaymentToOrder(PaymentResponseDTO responseDTO, PaymentGatewayConfiguration config) throws IllegalArgumentException
responseDTO
- the response that came back from the gatewayconfig
- values for the payment gatewaymarkPaymentAsInvalid(Long)
IllegalArgumentException
- if the PaymentResponseDTO#getValid()
returns false or if the order that
the PaymentResponseDTO
is attempted to be applied to has already gone through checkoutvoid markPaymentAsInvalid(Long orderPaymentId)
applyPaymentToOrder(PaymentResponseDTO, PaymentGatewayConfiguration)
orderPaymentId
- the payment ID to mark as invalidString initiateCheckout(Long orderId) throws Exception
PaymentResponseDTO.getOrderId()
orderId
- the order to check outException
String lookupOrderNumberFromOrderId(PaymentResponseDTO responseDTO) throws IllegalArgumentException
PaymentResponseDTO
. This can be used to redirect
the user coming from the payment gateway to the order confirmation page.responseDTO
- the response from the gatewayIllegalArgumentException
- if the order cannot be found from the PaymentResponseDTO
Copyright © 2022. All rights reserved.