Class CustomerPaymentGatewayAbstractController
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.
- Author:
- Elbert Bautista (elbertbautista)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CustomerPaymentGatewayServiceprotected static final org.apache.commons.logging.Logprotected PaymentGatewayWebResponsePrintService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyCustomerTokenToProfile(PaymentResponseDTO responseDTO) createCustomerPayment(org.springframework.ui.Model model, jakarta.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 PaymentGatewayConfigurationabstract Stringabstract StringgetCustomerPaymentViewRedirect(String customerPaymentId) abstract PaymentGatewayWebResponseServiceabstract voidhandleProcessingException(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) Methods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
addDeepLink, getContextPath, isAjaxRequest, jsonResponse
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
webResponsePrintService
-
customerPaymentGatewayService
@Autowired(required=false) @Qualifier("blCustomerPaymentGatewayService") protected CustomerPaymentGatewayService customerPaymentGatewayService
-
-
Constructor Details
-
CustomerPaymentGatewayAbstractController
public CustomerPaymentGatewayAbstractController()
-
-
Method Details
-
applyCustomerTokenToProfile
public Long applyCustomerTokenToProfile(PaymentResponseDTO responseDTO) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
createCustomerPayment
public String createCustomerPayment(org.springframework.ui.Model model, jakarta.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
PaymentGatewayWebResponseServiceknows how to parse an incomingHttpServletRequestinto aPaymentResponseDTOwhich will then be used by the customer profile engine to save a token to the user's account (e.g. wallet).- Parameters:
model- - Spring MVC modelrequest- - the HTTPServletRequest (originating either from a Payment Gateway or from the implementing checkout engine)redirectAttributes- - Spring MVC redirect attributes- Returns:
- the resulting view
- Throws:
PaymentException
-
getWebResponseService
-
getConfiguration
-
getCustomerPaymentViewRedirect
-
getCustomerPaymentErrorRedirect
-
handleProcessingException
public abstract void handleProcessingException(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws PaymentException - Throws:
PaymentException
-