Return URL with IPN (Instant Payment Notification)
Last updated
Last updated
For normal payment flow, the buyer browser is being redirected to a hosted payment page, financial institution or channel page(if any), and then returned to the merchant website or system. Users might close the browser any time throughout the payment process, even if the payment is completed, successfully or failed. Another possible reason that rarely happens is the network connectivity issue. As a result, the payment gateway is unable to update the merchant system on the payment status. Therefore, merchants are recommended to implement IPN to acknowledge(ACK) upon the receiving of status from gateway. Otherwise the callback worker will resend the payment status within a time interval.
Step 1: Logon to merchant admin, choose “Yes” to “Enable Return URL with IPN”, as shown:-
Step 2: There are 2 approaches to ack on receiving payment status.
Simple front-end snippet: copy the Javascript (JS) code from merchant admin and paste it on the merchant receipt page (which shows payment success/failed), preferable in the HTML header, before </head> tag.
Advanced back-end scripting: merchant is to echo back all the POST variables with one additional variable, i.e. “treq” with value 1. PHP sample code is provided below.
URL: https://pg.e2pay.co.id/RMS/API/chkstat/returnipn.php
Step 3: Merchant to prepare a Notify URL and Callback URL script, which is similar to return URL script but serves at the backend, in order to receive consequent payment notification in case the merchant system misses the first notification attempt from the payment gateway.