🔥Handling Exceptions

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

Exception 1: Order Status is Not Final

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

This process uses an exponential back off algorithm, increasing the waiting time between retries, starting at 30 seconds to a maximum of 600 seconds.

The diagram below depicts this scenario.

To handle this exception, merchants should also implement a listener that can receive the final order status event from Optty asynchronously, which will then trigger the action to update the status of the order in the merchant system, and email the customer with the final update of his payment of the order.

Exception 2: Communication of Status Update to Customer Fails

Another common exception that occurs during this process is when a merchant tries to let the customer know the outcome of his payment during the checkout session but this fails. Usually this occurs when the customer closes their browser before the process has completed or there are network issues between the merchant and the customer.

If the customer prematurely ends the checkout session before a final order status has been attained from the APM, the asynchronous process described in "exception 1" will be triggered.

To handle this exception, merchants should update the customer of the final payment status of their order using email or other asynchronous messaging tool.

Last updated