Analyzing the payment result
To process the payment result the merchant website must have a separate page with a script (e.g. analyze_payment.php).
This page will be called automatically after each payment (whether it has been accepted or declined): the parameters linked to the payment result are sent in POST mode by the payment gateway.
- URL of the page that analyzes the payment result must be specified in the Back Office (see chapter Setting up notifications).
- The merchant has to make sure that this URL is available from the payment gateway without redirection.
Using redirection leads to losing data presented in POST.
- In case some restrictions are set up by the merchant, the 18.104.22.168/24 IP address range must be authorized.
- HTML should not be visible on the page.
Access to images or CSS may slow down the exchange between the payment gateway and the merchant website.
Furthermore, the payment gateway systematically reads the 512 first characters returned by the merchant website.These characters can be viewed in the transaction history.
- Avoid integrating time-consuming tasks, such as invoice generation or sending
e-mails in the script.
The processing time has a direct influence on how long it takes to display the payment summary page. The longer the processing of the notification, the greater the delay for displaying the page.
After 35s the payment gateway will consider that the call has failed (timeout).
Failed notification (IPN)
In case the call to IPN fails, a notification e-mail is sent to the address specified in the Back Office (see chapter Setting up notifications).
In case the call to IPN fails, a notification e-mail is sent to the address specified in the Back Office (see chapter Setting up notifications of the Payment Form Integration guide).
The e-mail contains:
- the HTTP code of the encountered error,
- analysis parts depending on the error,
- instructions for resending the notification from the Back Office.
Writing the processing script
The processing script must include at least the following steps:
- retrieve the field list sent with the response in POST mode,
- compute the signature,
- compare the computed signature with the received signature,
- analyze the nature of the notification,
- retrieve the payment result.
The script may check the order status (or any information of your choice) to see if it has not been already updated.
Once these steps are completed, the script can update the database (new order status, stock update, registration of payment information, etc.).