Schedule the processing of pending payments
To process pending payments schedule the OrderPaymentSynchronize, ProcessDepositableAmount, and OrderClose commands on the WebSphere Commerce scheduler. If we are using the Paymentech plug-in schedule the PPCPaymentechBatchCtrlCmd and PPCPaymentechGetCtrlCmd as well.
Task info
The following example shows why a pending payment would be processed.
Suppose an order exists for $100 and the initial amount associated with the order items in stock was $100, but there are two releases of the order because the customer wants the items shipped to two different addresses. One release is for $40 and the other release is for $60. The Payment rules configuration calls for payment deposits to accumulate rather than occur with every release. The target states for the payment are: PrimePayment - Approve, ReservePayment - Approve, and FinalizePayment - Deposit.
During PrimePayment, $100 is approved. During ReservePayment, nothing happens because the order is already approved. During the first FinalizePayment, $40 should be deposited, but because the payment rule configuration is set up to accumulate deposits, no deposit is run. During the second FinalizePayment, $60 should be deposited. Since all $100 is ready for deposit, a deposit of $100 occurs.
If, after approval of $100 the order item for the second release ($60) becomes unavailable permanently, the deposit would never occur. In this case, a scheduled controller command, EDPDepositableAmountProcessCmd, must be run to process the deposit of $40 for the item that was available.
The EDPDepositableAmountProcessCmd controller command deposits amounts that have been approved and could have been deposited but were not yet deposited.
Procedure
- To schedule the processing of pending payments, follow the steps to schedule a site-level job, selecting the following commands from the Job command list.
Option Description OrderPaymentSynchronize Checks whether the order is totally authorized. If YES, the order status is changed to 'C', and an event with name 'PaymentAuthorizationComplete' is raised to business event bus; if NO, PrimePaymentCmd is called with initial amount being set to the order total amount to fully authorize the current order. ProcessDepositableAmount This scheduler job deposits amounts that have been approved and could have been deposited, but were not yet deposited. ProcessDepositableAmount will call the EDPDepositableAmountProcessCmd controller command. It has no associated job parameters. OrderClose This scheduler job checks whether the shipped order is totally deposited. If YES, the order status is changed to 'D'; if NO, ReservePaymentCmd and FinalizePaymentCmd are called to deposit total amount of the current order.
- If we are using the Paymentech plug-in schedule the following jobs at the site-level.