public abstract class CustomerPaymentGatewayAbstractController extends BroadleafAbstractController
Abstract controller that provides convenience methods and resource declarations to facilitate payment gateway communication between the implementing module and the Spring injected customer profile engine. This class provides flows to enable Credit Card tokenization in a PCI-Compliant manner (e.g. through a mechanism like Transparent Redirect) with the ability to save it to a customer's profile.
If used in conjunction with the core framework, Broadleaf provides all the necessary spring resources, such as "blCustomerPaymentGatewayService" that are needed for this class. If you are using the common jars without the framework dependency, you will either have to implement the blCustomerPaymentGatewayService yourself in order to save the token to your implementing customer profile system.
Modifier and Type | Field and Description |
---|---|
protected CustomerPaymentGatewayService |
customerPaymentGatewayService |
protected static org.apache.commons.logging.Log |
LOG |
protected PaymentGatewayWebResponsePrintService |
webResponsePrintService |
Constructor and Description |
---|
CustomerPaymentGatewayAbstractController() |
Modifier and Type | Method and Description |
---|---|
Long |
applyCustomerTokenToProfile(PaymentResponseDTO responseDTO) |
String |
createCustomerPayment(org.springframework.ui.Model model,
javax.servlet.http.HttpServletRequest request,
org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
This method is intended to initiate the creation of a saved payment token.
|
abstract PaymentGatewayConfiguration |
getConfiguration() |
abstract String |
getCustomerPaymentErrorRedirect() |
abstract String |
getCustomerPaymentViewRedirect(String customerPaymentId) |
abstract PaymentGatewayWebResponseService |
getWebResponseService() |
abstract void |
handleProcessingException(Exception e,
org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) |
addDeepLink, getContextPath, isAjaxRequest, jsonResponse
protected static final org.apache.commons.logging.Log LOG
protected PaymentGatewayWebResponsePrintService webResponsePrintService
@Autowired(required=false) @Qualifier(value="blCustomerPaymentGatewayService") protected CustomerPaymentGatewayService customerPaymentGatewayService
public CustomerPaymentGatewayAbstractController()
public Long applyCustomerTokenToProfile(PaymentResponseDTO responseDTO) throws IllegalArgumentException
IllegalArgumentException
public String createCustomerPayment(org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws PaymentException
This method is intended to initiate the creation of a saved payment token.
This assumes that the implementing gateway's PaymentGatewayWebResponseService
knows how to parse an incoming HttpServletRequest
into a
PaymentResponseDTO
which will then be used by the
customer profile engine to save a token to the user's account (e.g. wallet).
model
- - Spring MVC modelrequest
- - the HTTPServletRequest (originating either from a Payment Gateway or from the implementing checkout engine)redirectAttributes
- - Spring MVC redirect attributesPaymentException
public abstract PaymentGatewayWebResponseService getWebResponseService()
public abstract PaymentGatewayConfiguration getConfiguration()
public abstract String getCustomerPaymentViewRedirect(String customerPaymentId)
public abstract String getCustomerPaymentErrorRedirect()
public abstract void handleProcessingException(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws PaymentException
PaymentException
Copyright © 2022. All rights reserved.