Analyzing the payment outcome

To process the payment outcomes 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 outcome are sent in POST mode by the payment gateway.

Prerequisites:

  • URL of the page that analyzes the payment outcome 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.

    Redirection leads to losing data presented in POST.

  • In case some restrictions are set up by the merchant, the 194.50.38.0/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 platform 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 platform 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).

It 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 notification
  • retrieve the payment outcome.

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.).