Class BroadleafCheckoutController

java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.core.web.controller.checkout.AbstractCheckoutController
org.broadleafcommerce.core.web.controller.checkout.BroadleafCheckoutController

public class BroadleafCheckoutController extends AbstractCheckoutController
In charge of performing the various checkout operations
Author:
Andre Azzolini (apazzolini), Elbert Bautista (elbertbautista), Joshua Skorton (jskorton)
  • Field Details

    • baseConfirmationRedirect

      protected static String baseConfirmationRedirect
  • Constructor Details

    • BroadleafCheckoutController

      public BroadleafCheckoutController()
  • Method Details

    • checkout

      public String checkout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
      Renders the default checkout page and allows modules to add variables to the model.
      Parameters:
      request -
      response -
      model -
      model -
      Returns:
      the checkout view path
    • preValidateCartOperation

      protected void preValidateCartOperation(org.springframework.ui.Model model)
    • getCheckoutStagePartial

      public String getCheckoutStagePartial(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String stage, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
      Renders checkout stages partial at the requested stage
      Parameters:
      request -
      response -
      model -
      stage -
      Returns:
      the checkout stages partial path
    • saveGlobalOrderDetails

      public String saveGlobalOrderDetails(jakarta.servlet.http.HttpServletRequest request, org.springframework.ui.Model model, OrderInfoForm orderInfoForm, org.springframework.validation.BindingResult result) throws org.broadleafcommerce.common.exception.ServiceException
      Attempts to attach the user's email to the order so that they may proceed anonymously
      Parameters:
      request -
      model -
      orderInfoForm -
      result -
      Returns:
      Throws:
      org.broadleafcommerce.common.exception.ServiceException
    • processPassthroughCheckout

      public String processPassthroughCheckout(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, org.broadleafcommerce.common.payment.PaymentType paymentType) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException, org.broadleafcommerce.core.pricing.service.exception.PricingException
      Creates a pass-through payment of the PaymentType passed in with an amount equal to the order total after any non-final applied payments. (for example gift cards, customer credit, or third party accounts)

      This intended to be used in cases like COD and other Payment Types where implementations wish to just checkout without having to do any payment processing.

      This default implementations assumes that the pass-through payment is the only "final" payment, as this will remove any payments that are not PaymentTransactionType.UNCONFIRMED That means that it will look at all transactions on the order payment and see if it has unconfirmed transactions. If it does, it will not remove it.

      Make sure not to expose this method in your extended Controller if you do not wish to have this feature enabled.

      Parameters:
      redirectAttributes -
      paymentType -
      Returns:
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
      org.broadleafcommerce.core.pricing.service.exception.PricingException
    • processCompleteCheckoutOrderFinalized

      public String processCompleteCheckoutOrderFinalized(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      If the order has been finalized. i.e. all the payments have been applied to the order, then you can go ahead and call checkout using the passed in order id. This is usually called from a Review Page or if enough Payments have been applied to the Order to complete checkout. (e.g. Gift Cards cover the entire amount and there is no need to call an external Payment Gateway, or a Payment from a Hosted Gateway has already been applied to the order like Paypal Express Checkout)
      Returns:
      Throws:
      Exception
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • initiateCheckout

      public String initiateCheckout(Long orderId) throws Exception
      Throws:
      Exception
    • handleProcessingException

      public void handleProcessingException(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • getBaseConfirmationRedirect

      public String getBaseConfirmationRedirect()
    • getConfirmationViewRedirect

      protected String getConfirmationViewRedirect(String orderNumber)