public interface CheckoutWorkflow
CheckoutWorkflowActivities
. The work done by those activities
should represent everything that MUST be done to complete checkout for the cart.
Suggestions:
1. If an activity can wait to be handled after checkout, then it should not be included in the
checkout workflow. Our primary reasoning for this is to avoid any unnecessary rollbacks of the
workflow. For instance, if you were to include a "SendConfirmationEmailActivity", then the
workflow could potentially rollback if your email service is unavailable. While sending the
confirmation email is important, it's not required to complete the checkout & it should not block
you from capturing the order.
2. If your checkout workflow includes an activity that interacts with a payment gateway, we
suggest that it makes use of DefaultTransactionTypes.AUTHORIZE
transactions instead of
DefaultTransactionTypes.AUTHORIZE_AND_CAPTURE
transactions. If you wish to immediately
capture the payment, we suggest that is done as a post-checkout activity - i.e. after this
workflow.Modifier and Type | Method and Description |
---|---|
com.broadleafcommerce.cart.client.domain.Cart |
execute(com.broadleafcommerce.cart.client.domain.Cart cart,
String requestId,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method used to coordinate the execution of
CheckoutWorkflowActivities . |
com.broadleafcommerce.cart.client.domain.Cart |
execute(com.broadleafcommerce.cart.client.domain.Cart cart,
String requestId,
Map<String,String> securityCodes,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method used to coordinate the execution of
CheckoutWorkflowActivities . |
com.broadleafcommerce.cart.client.domain.Cart |
rollback(com.broadleafcommerce.cart.client.domain.Cart cart,
String requestId,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method used to coordinate the rollback of work that has been done by the
CheckoutWorkflowActivities up to that point. |
com.broadleafcommerce.cart.client.domain.Cart execute(com.broadleafcommerce.cart.client.domain.Cart cart, String requestId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CheckoutWorkflowActivities
. If there is an exception/error during the execution of those
activities, then #rollback(Cart, String)
should be called to un-do the work that had
been done up to the point of the exception/error.cart
- The Cart
that we're attempting to checkout with.requestId
- The id used to identify changes tied to the specific execution requestcontextInfo
- Context information around sandbox and multitenant state.CheckoutWorkflowException
- If there was an exception thrown within the execution of
the workflow.com.broadleafcommerce.cart.client.domain.Cart execute(com.broadleafcommerce.cart.client.domain.Cart cart, String requestId, Map<String,String> securityCodes, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CheckoutWorkflowActivities
. If there is an exception/error during the execution of those
activities, then #rollback(Cart, String)
should be called to un-do the work that had
been done up to the point of the exception/error.cart
- The Cart
that we're attempting to checkout with.requestId
- The id used to identify changes tied to the specific execution requestsecurityCodes
- The map of card security codes keyed by payment id for processing saved
paymentscontextInfo
- Context information around sandbox and multitenant state.CheckoutWorkflowException
- If there was an exception thrown within the execution of
the workflow.com.broadleafcommerce.cart.client.domain.Cart rollback(com.broadleafcommerce.cart.client.domain.Cart cart, String requestId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CheckoutWorkflowActivities
up to that point.cart
- The Cart
that we were attempting to checkout with, but ran into an
exception/error.requestId
- The id used to identify changes tied to the specific execution requestcontextInfo
- Context information around sandbox and multitenant state.CheckoutWorkflowRollbackException
- If there was an exception thrown within the
execution of the rollback.Copyright © 2021. All rights reserved.