PG Pay Page has the following flow:
Initiating PAY API request
The merchant does a server-to-server call to initiate a payment request (PAY API). In the response to this PAY API call, a URL is returned for the PhonePe payment page for that particular transaction.
Redirecting user to PhonePe web page
The merchant does a client-side redirection to the URL returned in Step 1. This will take the customer to the PhonePe payment page.
Redirecting user to Merchant web page
Once the user has completed the payment, PhonePe will redirect to the redirectUrl passed in the request body to give the control back to the merchant.
Status verification post redirection to merchant website
The merchant should check with their server if the S2S response is received.
- If S2S is received, the checksum and amount have to be validated and the payment status has to be updated to the frontend.
- If S2S is not received, then the PG Check Status API should be called and in the response, the amount has to be validated. The order is then placed based on the transaction status provided by PhonePe.
In case of any cancellations or returns, a refund will be initiated by the merchant through PhonePe. This refund will be done against the originalTransactionId (The actual transaction id of the forward payment). Refer here for the Refund API
Updated 7 months ago