Handle Payment Response
Step 1
Add Juspay Order Status function in your backend
Step 2
How to Handle Transaction Status
Step 3
Display Payment Status
After being redirected to return_url from bank page, it is mandatory to do a Server-to-Server Order Status API call to determine the payment status. Please ensure that you verify the order ID and transaction amount.
Sample return_url : https://merchant.shop.com/?status_id=21&status=CHARGED&order_id=guest-test-26&signature=wCFja5ZtDzm687LUxkqlw1NQYraC%2Bz540CitnlCouYI%3D&signature_algorithm=HMAC-SHA256
If you are listening to webhooks from SmartGateway, please refer to the Webhooks section.
Expose /handleJuspayResponse API endpoint on your backend that calls the Order Status function of PHP SDK. This API endpoint will be called from your frontend to fetch the payment status.
For ease of implementation, you can refer to orderStatus( ) function from ‘Program.php’ file.
Please refer to Transaction Status section to understand how to handle various order status scenarios. Based on the Transaction Status, create a landing page which shows the status to the customer.
The following figure is a workflow of how you can handle the order status:
Once the payment status is determined via the API, the final status should be displayed to the user. This screen needs to be handled by the merchant, it is not provided by the Hypercheckout SDK.