Interface CheckoutService
- All Known Implementing Classes:
DefaultCheckoutService
- Author:
- Chad Harchar (charchar), Chris Kittrell (ckittrell)
-
Method Summary
Modifier and TypeMethodDescriptionfinalizeCheckout(CheckoutProcessDto processDto, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finalizes checkout for the givenCart.processCheckout(CheckoutProcessDto checkoutProcessDto, Map<String, String> securityCodes, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Process checkout against the providedCheckoutProcessDto.resendCartAwaitingPaymentResultsEvent(String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResendCartAwaitingPaymentResultsEventfor the given cart id.resendCartPendingPaymentFailedEvent(String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResendCartPendingPaymentFailedEventfor the given cart id.resendCheckoutCompletionEvent(String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResendCheckoutCompletionEventfor the given cart id.resendCheckoutRollbackEvent(String cartId, String requestId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResendCheckoutRollbackEventfor the given cart id.voidsendCartPendingPaymentFailedEvent(com.broadleafcommerce.cart.client.domain.Cart cart, 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.
-
Method Details
-
processCheckout
CheckoutResponse processCheckout(CheckoutProcessDto checkoutProcessDto, Map<String, String> securityCodes, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Process checkout against the providedCheckoutProcessDto.- Parameters:
checkoutProcessDto- TheCheckoutProcessDtofor processing checkoutsecurityCodes- Secure codes that are passed to the gateway for verification during authorization or capture transactionscontextInfo- Context information around sandbox and multitenant state- Returns:
- The
CheckoutResponsecontaining 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 givenCart.This is typically used for processes that need to finalize checkout outside the checkout workflow, such as
FinalizeCartAwaitingPaymentResultJobListener.- Parameters:
processDto- theCheckoutProcessDtocontaining the cart to finalizecontextInfo- 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) ResendCheckoutCompletionEventfor the given cart id.This is useful to manually recover from scenarios where the cart was finalized for checkout but the
CheckoutCompletionEventfailed to send.- Parameters:
cartId- the cart id to resend theCheckoutCompletionEventforcontextInfo- context information around sandbox and multitenant state- Returns:
- a
SendCheckoutEventResponsecontaining 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) ResendCheckoutRollbackEventfor the given cart id.This is useful to manually recover from scenarios where the cart was rolled back but the
CheckoutRollbackEventfailed to send.- Parameters:
cartId- the cart id to resend theCheckoutRollbackEventforrequestId- the checkout request id to resend theCheckoutRollbackEventforcontextInfo- context information around sandbox and multitenant state- Returns:
- a
SendCheckoutEventResponsecontaining 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) ResendCartPendingPaymentFailedEventfor the given cart id.This is useful to manually recover from scenarios where the cart status was updated to
DefaultCartStatuses.PENDING_PAYMENT_FAILEDbut theCartPendingPaymentFailedEventfailed to send.- Parameters:
cartId- the cart id to resend theCartPendingPaymentFailedEventforcontextInfo- context information around sandbox and multitenant state- Returns:
- a
SendCheckoutEventResponsecontaining the details for this request - Throws:
PendingPaymentFailedMessageException- if there was an exception thrown when sending the pending payment failed event.
-
resendCartAwaitingPaymentResultsEvent
SendCheckoutEventResponse resendCartAwaitingPaymentResultsEvent(String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResendCartAwaitingPaymentResultsEventfor the given cart id.This is useful to manually recover from scenarios where the cart was awaiting payment results but the
CartAwaitingPaymentResultsEventfailed to send.- Parameters:
cartId- the cart id to resend theCartAwaitingPaymentResultsEventforcontextInfo- context information around sandbox and multitenant state- Returns:
- a
SendCheckoutEventResponsecontaining the details for this request - Throws:
CartAwaitingPaymentResultsMessageException- if there was an exception thrown when sending the checkout completion event.
-