Class BroadleafPayPalCheckoutController

java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
org.broadleafcommerce.vendor.paypal.web.controller.BroadleafPayPalCheckoutController

@Controller("blPayPalCheckoutController") @RequestMapping("/paypal-checkout") public class BroadleafPayPalCheckoutController extends org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
Author:
Elbert Bautista (elbertbautista)
  • Field Details

    • GATEWAY_CONTEXT_KEY

      protected static final String GATEWAY_CONTEXT_KEY
      See Also:
    • paymentGatewayWebResponseService

      protected org.broadleafcommerce.common.payment.service.PaymentGatewayWebResponseService paymentGatewayWebResponseService
    • paymentGatewayHostedService

      protected org.broadleafcommerce.common.payment.service.PaymentGatewayHostedService paymentGatewayHostedService
    • paymentGatewayConfiguration

      protected org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration paymentGatewayConfiguration
    • paymentService

      protected PayPalPaymentService paymentService
    • agreementTokenService

      protected PayPalAgreementTokenService agreementTokenService
  • Constructor Details

    • BroadleafPayPalCheckoutController

      public BroadleafPayPalCheckoutController()
  • Method Details

    • handleProcessingException

      public void handleProcessingException(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Specified by:
      handleProcessingException in class org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • handleUnsuccessfulTransaction

      public void handleUnsuccessfulTransaction(org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, org.broadleafcommerce.common.payment.dto.PaymentResponseDTO responseDTO) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Specified by:
      handleUnsuccessfulTransaction in class org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • getGatewayContextKey

      public String getGatewayContextKey()
      Specified by:
      getGatewayContextKey in class org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
    • getWebResponseService

      public org.broadleafcommerce.common.payment.service.PaymentGatewayWebResponseService getWebResponseService()
      Specified by:
      getWebResponseService in class org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
    • getConfiguration

      public org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration getConfiguration()
      Specified by:
      getConfiguration in class org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
    • returnEndpoint

      @RequestMapping(value="/return", method=GET) public String returnEndpoint(org.springframework.ui.Model model, jakarta.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, @PathVariable Map<String,String> pathVars) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Specified by:
      returnEndpoint in class org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • errorEndpoint

      @RequestMapping(value="/error", method=GET) public String errorEndpoint(org.springframework.ui.Model model, jakarta.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, @PathVariable Map<String,String> pathVars) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Specified by:
      errorEndpoint in class org.broadleafcommerce.common.web.payment.controller.PaymentGatewayAbstractController
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • cancelEndpoint

      @RequestMapping(value="/cancel", method=GET) public String cancelEndpoint(org.springframework.ui.Model model, jakarta.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, @PathVariable Map<String,String> pathVars) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • completeCheckout

      @RequestMapping(value="/checkout/complete", method=POST) public String completeCheckout() throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Completes checkout for a PayPal payment. If there's already a PayPal payment we go ahead and make sure the details of the payment are updated to all of the forms filled out by the customer since they could've updated shipping information, added a promotion, or other various things to the order.
      Returns:
      Redirect URL to either add the payment and checkout or just checkout
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • completeBillingAgreementTokenCheckout

      @RequestMapping(value="/billing-agreement-token/complete", method=POST) public String completeBillingAgreementTokenCheckout() throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • createPayment

      @RequestMapping(value="/create-payment", method=POST) @ResponseBody public Map<String,String> createPayment(@RequestParam("performCheckout") Boolean performCheckout) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • createBillingAgreementToken

      @RequestMapping(value="/create-billing-agreement-token", method=POST) @ResponseBody public Map<String,String> createBillingAgreementToken(@RequestParam("performCheckout") Boolean performCheckout) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException, URISyntaxException
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
      URISyntaxException
    • createPaymentHostedJson

      @RequestMapping(value="/hosted/create-payment", method=POST) public String createPaymentHostedJson(jakarta.servlet.http.HttpServletRequest request, @RequestParam("performCheckout") Boolean performCheckout) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • createBillingAgreementTokenHostedJson

      @RequestMapping(value="/hosted/create-billing-agreement-token", method=POST) public String createBillingAgreementTokenHostedJson(jakarta.servlet.http.HttpServletRequest request, @RequestParam("performCheckout") Boolean performCheckout) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • getApprovalLink

      protected String getApprovalLink(com.paypal.api.payments.Payment payment)
    • getApprovalLink

      protected String getApprovalLink(AgreementToken agreementToken)