Class PaymentTransactionExecutionActivity
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.service.checkout.workflow.activity.PaymentTransactionExecutionActivity
-
- All Implemented Interfaces:
CheckoutWorkflowActivity,RequiresSecurePaymentInformationActivity
public class PaymentTransactionExecutionActivity extends Object implements RequiresSecurePaymentInformationActivity
ThisCheckoutWorkflowActivityis responsible for executing payment transactions that are required to complete a successful checkout. This is where we strongly suggest that you execute payment transactions due to the amount of control & visibility that it provides. With that being said, if transactions were executed prior to entering theCheckoutWorkflow, then this activity doesn't have any work to do. Alternatively, if you wish to process the payment transactions at a later time, then it can be done by skipping the transaction execution in this activity. We strongly suggest that this is the last activity in yourCheckoutWorkflowto eliminate the need to reverse successful authorization transactions for carts with a single payment method. If the cart includes multiple payments that are to be authorized within the checkout workflow, then this activity ordering will not avoid the need to reverse an authorization. In that case, there's a chance that one of the payments will be successfully authorized & then must be reversed if one of the other payments fails authorization.- Author:
- Chris Kittrell (ckittrell)
-
-
Constructor Summary
Constructors Constructor Description PaymentTransactionExecutionActivity(PaymentTransactionExecutionService transactionExecutionService, org.springframework.context.MessageSource messageSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CheckoutProcessDtoexecute(@NonNull CheckoutProcessDto processDto, @NonNull Map<String,String> securityCodes, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Method responsible for executing some work against the cart that requires secure payment information in checkout.protected StringgetMessage(@NonNull String errorMessage, Object... args)protected org.springframework.context.MessageSourcegetMessageSource()protected PaymentTransactionExecutionServicegetTransactionExecutionService()CheckoutProcessDtorollback(@NonNull CheckoutProcessDto processDto, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Method responsible for rolling back any work that was done during the execution of theCheckoutWorkflowActivity.execute(CheckoutProcessDto, ContextInfo)method.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.broadleafcommerce.cartoperation.service.checkout.workflow.activity.RequiresSecurePaymentInformationActivity
execute
-
-
-
-
Constructor Detail
-
PaymentTransactionExecutionActivity
public PaymentTransactionExecutionActivity(PaymentTransactionExecutionService transactionExecutionService, org.springframework.context.MessageSource messageSource)
-
-
Method Detail
-
execute
public CheckoutProcessDto execute(@NonNull @NonNull CheckoutProcessDto processDto, @NonNull @NonNull Map<String,String> securityCodes, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:RequiresSecurePaymentInformationActivityMethod responsible for executing some work against the cart that requires secure payment information in checkout.- Specified by:
executein interfaceRequiresSecurePaymentInformationActivity- Parameters:
processDto- TheCheckoutProcessDtothat we're attempting to checkout with.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 final state of the
CheckoutProcessDtofollowing the execution of the activity.
-
rollback
public CheckoutProcessDto rollback(@NonNull @NonNull CheckoutProcessDto processDto, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CheckoutWorkflowActivityMethod responsible for rolling back any work that was done during the execution of theCheckoutWorkflowActivity.execute(CheckoutProcessDto, ContextInfo)method.- Specified by:
rollbackin interfaceCheckoutWorkflowActivity- Parameters:
processDto- TheCheckoutProcessDtothat we were attempting to checkout with, but ran into an exception/error.contextInfo- Context information around sandbox and multitenant state.- Returns:
- The final state of the
CheckoutProcessDtofollowing the rollback of the activity.
-
getMessage
protected String getMessage(@NonNull @NonNull String errorMessage, @Nullable Object... args)
-
getTransactionExecutionService
protected PaymentTransactionExecutionService getTransactionExecutionService()
-
getMessageSource
protected org.springframework.context.MessageSource getMessageSource()
-
-