public class ValidateAndConfirmPaymentActivity extends BaseActivity<ProcessContext<CheckoutSeed>>
Verifies that there is enough payment on the order via the successful amount on PaymentTransactionType.AUTHORIZE and
PaymentTransactionType.AUTHORIZE_AND_CAPTURE transactions. This will also confirm any PaymentTransactionType.UNCONFIRMED transactions
that exist on am OrderPayment.
If there is an exception (either in this activity or later downstream) the confirmed payments are rolled back via GenericConfirmPaymentsRollbackHandler
| Modifier and Type | Class and Description |
|---|---|
protected class |
ValidateAndConfirmPaymentActivity.ResponseTransactionPair |
| Modifier and Type | Field and Description |
|---|---|
static String |
FAILED_RESPONSES |
protected static org.apache.commons.logging.Log |
LOG |
protected OrderPaymentService |
orderPaymentService |
protected OrderToPaymentRequestDTOService |
orderToPaymentRequestService |
protected PaymentGatewayConfigurationServiceProvider |
paymentConfigurationServiceProvider |
protected PaymentGatewayCheckoutService |
paymentGatewayCheckoutService |
static String |
ROLLBACK_TRANSACTIONS
Used by the
GenericConfirmPaymentsRollbackHandler to roll back transactions that this activity confirms. |
protected SecureOrderPaymentService |
secureOrderPaymentService |
automaticallyRegisterRollbackHandler, beanName, errorHandler, order, rollbackHandler, rollbackRegion, stateConfiguration| Constructor and Description |
|---|
ValidateAndConfirmPaymentActivity() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
constructExpirationDate(Integer expMonth,
Integer expYear)
Default expiration date construction.
|
ProcessContext<CheckoutSeed> |
execute(ProcessContext<CheckoutSeed> context)
Called by the encompassing processor to activate
the execution of the Activity
|
protected String |
getGatewayExpirationDateFormat() |
protected void |
handleUnsuccessfulTransactions(List<ValidateAndConfirmPaymentActivity.ResponseTransactionPair> failedTransactions,
ProcessContext<CheckoutSeed> context)
Default implementation is to throw a generic CheckoutException which will be caught and displayed
on the Checkout Page where the Customer can try again.
|
protected void |
populateBillingAddressOnRequest(PaymentRequestDTO requestDTO,
OrderPayment payment) |
protected void |
populateCreditCardOnRequest(PaymentRequestDTO requestDTO,
OrderPayment payment) |
protected void |
populateCustomerOnRequest(PaymentRequestDTO requestDTO,
OrderPayment payment) |
protected void |
populateShippingAddressOnRequest(PaymentRequestDTO requestDTO,
OrderPayment payment) |
protected boolean |
shouldRollbackFailedTransaction(ValidateAndConfirmPaymentActivity.ResponseTransactionPair failedTransactionPair) |
getAutomaticallyRegisterRollbackHandler, getBeanName, getErrorHandler, getOrder, getRollbackHandler, getRollbackRegion, getStateConfiguration, setAutomaticallyRegisterRollbackHandler, setBeanName, setErrorHandler, setOrder, setRollbackHandler, setRollbackRegion, setStateConfiguration, shouldExecuteprotected static final org.apache.commons.logging.Log LOG
public static final String ROLLBACK_TRANSACTIONS
Used by the GenericConfirmPaymentsRollbackHandler to roll back transactions that this activity confirms.
This could also contain failed transactions that still need to be rolled back
public static final String FAILED_RESPONSES
@Autowired(required=false) @Qualifier(value="blPaymentGatewayConfigurationServiceProvider") protected PaymentGatewayConfigurationServiceProvider paymentConfigurationServiceProvider
protected OrderToPaymentRequestDTOService orderToPaymentRequestService
protected OrderPaymentService orderPaymentService
protected SecureOrderPaymentService secureOrderPaymentService
protected PaymentGatewayCheckoutService paymentGatewayCheckoutService
public ProcessContext<CheckoutSeed> execute(ProcessContext<CheckoutSeed> context) throws Exception
Activitycontext - - process context for this workflowExceptionprotected void handleUnsuccessfulTransactions(List<ValidateAndConfirmPaymentActivity.ResponseTransactionPair> failedTransactions, ProcessContext<CheckoutSeed> context) throws Exception
Default implementation is to throw a generic CheckoutException which will be caught and displayed on the Checkout Page where the Customer can try again. In many cases, this is sufficient as it is usually recommended to display a generic Error Message to prevent Credit Card fraud.
The configured payment gateway may return a more specific error. Each gateway is different and will often times return different error codes based on the acquiring bank as well. In that case, you may override this method to decipher these errors and handle it appropriately based on your business requirements.
responseDTOs - Exceptionprotected boolean shouldRollbackFailedTransaction(ValidateAndConfirmPaymentActivity.ResponseTransactionPair failedTransactionPair)
protected void populateCreditCardOnRequest(PaymentRequestDTO requestDTO, OrderPayment payment) throws WorkflowException
WorkflowExceptionprotected void populateBillingAddressOnRequest(PaymentRequestDTO requestDTO, OrderPayment payment)
protected void populateCustomerOnRequest(PaymentRequestDTO requestDTO, OrderPayment payment)
protected void populateShippingAddressOnRequest(PaymentRequestDTO requestDTO, OrderPayment payment)
protected String constructExpirationDate(Integer expMonth, Integer expYear)
expMonth - expYear - protected String getGatewayExpirationDateFormat()
Copyright © 2017. All rights reserved.