Developer Docs
  • 👋Get Started
  • Add Payment Methods in Optty
  • Custom API | Headless
    • 🖥️Direct API Integration
      • Environments
      • Order Flow
      • 1️⃣Create Access Token
      • 2️⃣Get APM Options
      • 3️⃣Create Order
      • 4️⃣Handle Payment Response
      • 5️⃣Refund Order
      • 🔥Handling Exceptions
  • Platforms
    • ◾BigCommerce
      • 🚀Activate Optty
      • ⚡Add Optty Widgets
        • 1️⃣Install the App
        • 2️⃣Create Widget Token
        • 3️⃣Edit Your Template
        • 4️⃣Widget Configuration
      • 💳Refunds
    • Magento 2
      • Install Optty Module
      • Configure the Optty Extension
      • One Step Checkout
    • Salesforce Commerce Cloud
      • Component Overview
      • Implementation Guide
      • Operation and Management
      • User Guide
    • 🟪WooCommerce
      • 🚀Install Optty
      • ⚡Setup Widgets
      • 💳Refunds
  • Widget
    • Widget Setup and Integration
    • Create Order Widget Integration
    • Handle Order Payment Widget Integration
  • API References
    • Create Order
      • Create Order Response
    • Refund Order
    • Void Order
    • Capture Order
    • Transaction Details
    • Create Customer Session
    • Best Practice
  • Go Live
  • Universal Payment Platform
    • Support Articles
Powered by GitBook
On this page
  • Exception 1: Order Status is Not Final
  • Exception 2: Communication of Status Update to Customer Fails
  1. Custom API | Headless
  2. Direct API Integration

Handling Exceptions

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

PreviousRefund OrderNextBigCommerce

Last updated 3 months ago

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.

🖥️
🔥