Interface CheckoutService
- All Known Implementing Classes:
DefaultCheckoutService
public interface CheckoutService
- 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
.resendCartPendingPaymentFailedEvent
(String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResendCartPendingPaymentFailedEvent
for the given cart id.resendCheckoutCompletionEvent
(String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResendCheckoutCompletionEvent
for the given cart id.resendCheckoutRollbackEvent
(String cartId, String requestId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResendCheckoutRollbackEvent
for the given cart id.void
sendCartPendingPaymentFailedEvent
(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
- TheCheckoutProcessDto
for 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
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 givenCart
.This is typically used for processes that need to finalize checkout outside the checkout workflow, such as
FinalizeCartAwaitingPaymentResultJobListener
.- Parameters:
processDto
- theCheckoutProcessDto
containing 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) ResendCheckoutCompletionEvent
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 theCheckoutCompletionEvent
forcontextInfo
- 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) ResendCheckoutRollbackEvent
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 theCheckoutRollbackEvent
forrequestId
- the checkout request id to resend theCheckoutRollbackEvent
forcontextInfo
- 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) ResendCartPendingPaymentFailedEvent
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 theCartPendingPaymentFailedEvent
failed to send.- Parameters:
cartId
- the cart id to resend theCartPendingPaymentFailedEvent
forcontextInfo
- 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.
-