Time Based Checkout

This section walk you through how to use the time based hosted checkout.

Airgate allows you to set a time limit for your hosted payment checkout. This ensures that a payment session automatically expires if the user does not complete the transaction within a specified time window. Below is how you can implement this feature

  1. Add the time_out field to the Payment Initiation Request When sending a payment initiation request to the /payment_initiate_hosted endpoint, make sure to include the time_out field in your payload. If you're unfamiliar with how to initiate a payment, please refer to the previous section for detailed instructions. By adding the time_out field, your final request payload should look like this

    {
        "amount": <AMOUNT>,
        "user": {
            "name": <CUSTOMER_NAME>,
            "phone": <CUSTOMER_PHONE>,
            "email": <CUSTOMER_EMAIL>
        },
        "callback_url": <YOUR_CALLBACK_URL>,
        "customer_transaction_ref": <YOUR_UNIQUE_REFERENCE>,// optional
        "time_out": <YOUR_TIME_OUT> // integer (represented in minute)
    }

  1. Handling Timeout Redirection Once the specified time_out duration elapses without the payment process reaching a completed state, Airgate will automatically redirect the customer back to your callback_url . The URL will include a query parameter indicating the status of the transaction as timeout. You can then handle the rest of your business logic accordingly. Refer to this section to view the complete list of statuses that may be returned as query parameters to your callback URL.

Last updated