Class CustomerPaymentGatewayAbstractController

java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.common.web.payment.controller.CustomerPaymentGatewayAbstractController

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.

Author:
Elbert Bautista (elbertbautista)
  • Field Details

    • LOG

      protected static final org.apache.commons.logging.Log LOG
    • webResponsePrintService

      protected PaymentGatewayWebResponsePrintService 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 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).

      Parameters:
      model - - Spring MVC model
      request - - 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

      public abstract PaymentGatewayWebResponseService getWebResponseService()
    • getConfiguration

      public abstract PaymentGatewayConfiguration getConfiguration()
    • getCustomerPaymentViewRedirect

      public abstract String getCustomerPaymentViewRedirect(String customerPaymentId)
    • getCustomerPaymentErrorRedirect

      public abstract String getCustomerPaymentErrorRedirect()
    • handleProcessingException

      public abstract void handleProcessingException(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws PaymentException
      Throws:
      PaymentException