Exception Handling

This page explains some exceptions that could occur when handling the payment response.

1. Order Status is Not Final

If a final order status cannot be attained within the checkout session and the order status remains "PENDING," Optty employs an asynchronous process. This process will either continue to poll the APM's API or listen for order status updates from the APM until a final status (successful, canceled, or declined) is received.

To handle this exception, merchants should implement a listener that can asynchronously receive the final order status event from Optty. This listener will then trigger an action to update the order status in the merchant system and customer checkout, reflecting the final payment update for the order.

This exception can also occur for refunds, please refer to the REFUND_CALLBACK on Notification Handling

The diagram below illustrates this scenario.

2. Communication of Status Update to Customer Fails

This exception often arises when a merchant attempts to inform the customer of their payment outcome during the checkout session after a redirect, but this fails because the customer exits the journey after the payment is complete. This usually happens if the customer closes their browser before the process concludes or if there are network issues between the merchant and the customer.

Should the customer prematurely end the checkout session before a final order status is received from the APM, the asynchronous process detailed in "exception 1" should be used to communicate the final status.

To manage this exception, merchants ought to update the customer on the final payment status of their order via email or another asynchronous messaging tool.

Last updated