Interface CheckoutService

All Known Implementing Classes:
DefaultCheckoutService

public interface CheckoutService
Author:
Chad Harchar (charchar), Chris Kittrell (ckittrell)
  • Method Details

    • processCheckout

      CheckoutResponse processCheckout(CheckoutProcessDto checkoutProcessDto, Map<String,String> securityCodes, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Process checkout against the provided CheckoutProcessDto.
      Parameters:
      checkoutProcessDto - The CheckoutProcessDto for processing checkout
      securityCodes - Secure codes that are passed to the gateway for verification during authorization or capture transactions
      contextInfo - Context information around sandbox and multitenant state
      Returns:
      The CheckoutResponse containing the result of the checkout process
      Throws:
      CartValidationException - if the cart is not prepared for checkout
    • finalizeCheckout

      CheckoutProcessDto finalizeCheckout(CheckoutProcessDto processDto, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finalizes checkout for the given Cart.

      This is typically used for processes that need to finalize checkout outside the checkout workflow, such as FinalizeCartAwaitingPaymentResultJobListener.

      Parameters:
      processDto - the CheckoutProcessDto containing the cart to finalize
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      the finalized CheckoutProcessDto
      Throws:
      CartFinalizationException - if an exception is thrown while finalizing cart or cart payments
    • sendCartPendingPaymentFailedEvent

      void sendCartPendingPaymentFailedEvent(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Send a message to notify external services (and internal listeners) of the cart pending payment failed, so that they can react accordingly.
      Parameters:
      cart - The cart in which one or more of its pending payments failed.
      contextInfo - Context information around sandbox and multitenant state.
      Throws:
      PendingPaymentFailedMessageException - if there was an exception thrown when sending the pending payment failed event.
    • resendCheckoutCompletionEvent

      SendCheckoutEventResponse resendCheckoutCompletionEvent(String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Resend CheckoutCompletionEvent for the given cart id.

      This is useful to manually recover from scenarios where the cart was finalized for checkout but the CheckoutCompletionEvent failed to send.

      Parameters:
      cartId - the cart id to resend the CheckoutCompletionEvent for
      contextInfo - context information around sandbox and multitenant state
      Returns:
      a SendCheckoutEventResponse containing the details for this request
      Throws:
      CheckoutCompletionMessageException - if there was an exception thrown when sending the checkout completion event.
    • resendCheckoutRollbackEvent

      SendCheckoutEventResponse resendCheckoutRollbackEvent(String cartId, String requestId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Resend CheckoutRollbackEvent for the given cart id.

      This is useful to manually recover from scenarios where the cart was rolled back but the CheckoutRollbackEvent failed to send.

      Parameters:
      cartId - the cart id to resend the CheckoutRollbackEvent for
      requestId - the checkout request id to resend the CheckoutRollbackEvent for
      contextInfo - context information around sandbox and multitenant state
      Returns:
      a SendCheckoutEventResponse containing the details for this request
      Throws:
      CheckoutWorkflowRollbackMessageException - if there was an exception thrown when sending the checkout rollback event.
    • resendCartPendingPaymentFailedEvent

      SendCheckoutEventResponse resendCartPendingPaymentFailedEvent(String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Resend CartPendingPaymentFailedEvent for the given cart id.

      This is useful to manually recover from scenarios where the cart status was updated to DefaultCartStatuses.PENDING_PAYMENT_FAILED but the CartPendingPaymentFailedEvent failed to send.

      Parameters:
      cartId - the cart id to resend the CartPendingPaymentFailedEvent for
      contextInfo - context information around sandbox and multitenant state
      Returns:
      a SendCheckoutEventResponse containing the details for this request
      Throws:
      PendingPaymentFailedMessageException - if there was an exception thrown when sending the pending payment failed event.