Plug-in exception handling and transaction roll-back

If a payment transaction fails, and that failure results in a WebSphere Commerce transaction roll back, then the payment transaction data is not in the WebSphere Commerce database. When transaction rolls back, there are two actions we can take. The transactionCompensationAction parameter in the PaymentMethodConfigurations.xml determines the action:

Consider the two following scenarios:


transactionCompensationAction set to reverse

A customer pays for an order using a gift card and Visa card. The gift card has higher priority than the Visa card.

The redemption against the gift card was successfully run and the third-party payment service provider tracked this transaction; however, WebSphere Commerce does not have information regarding this transaction since the transaction rolled back. The UndoPaymentActionsCmd runs the compensate payment or credit transactions for those successfully run transactions at the overall WebSphere Commerce transaction rolling back.

The corresponding implementation class runs reverseApproval transaction for a successful authorization transaction. For other transaction types, a tickler is created. With the ticklers created, Customer Service Representative can manually process the reversed transactions for all the transaction types including authorization transaction if reverseApproval fails.

UndoPaymentActionsCmd extension points:


transactionCompensationAction set to track

A customer pays for an order using a MasterCard card and a VISA card. VISA card has higher priority than the MasterCard.

Validation against VISA card succeeded. Payment Service Provider tracked this transaction. However, WebSphere Commerce does not have information regarding this transaction since the transaction rolled back. Sometimes, it is necessary that the payment data for successful transactions are recorded in the WebSphere Commerce database. The data in the WebSphere Commerce database is consistent with the data on the Payment Service Provider. Successful actions do not need to rerun. TrackPaymentActionsCmd retrieves all related payment data for successful payment transactions when the overall WebSphere Commerce transaction rolls back. The command also restores data to database when the overall transaction rolls back.

By default, an overall implementation is not provided in the implementation class, TrackPaymentActionsCmdImpl. The implementation class provides basic payment data retrieval and restoration logic implementation. For example, data is restored to these tables EDPPAYINST, PPCPAYINST, EDPATMPAY, PPCPAYMENT, PPCPAYTRAN. TrackPaymentActionsCmd extension points:


Related tasks
Adding a new payment or refund method
Customizing the business flow for payment processing
Use other payment protocol data to find orders
Creating a payment plug-in
Packaging a payment plug-in


Related reference
Payment plug-in specification