Managing the timeout

Processing a web service query revolves around a series of asynchronous events such as:

  • sending the query via the network of the merchant website,
  • transmitting information on the Internet,
  • payment processing by the payment gateway,
  • soliciting bank servers, etc.

An incident may occur at any of this steps which would slow down the processing (and, therefore, the delay for the buyer).

The response to a query may be slowed down for several reasons:

  • The response from the cardholder's card issuer is taking a long time (in case of foreign cards, periods of heavy workload, e.g. during sales, etc.).
  • The response from the acquirer when transmitting and receiving the authorization request is taking a long time.
  • The response from your application is taking a long time due to heavy workload.
  • The response from the payment gateway is taking a long time.
  • A peering problem on the Internet which may lead to losing messages, etc.

Depending on the configured timeouts, you may have to wait for an answer while the asynchronous processing is still performed by the payment gateway.

A long processing time should not be considered a declined payment.

For this reason, you must configure your code to handle potential problems that may occur when connecting to the SOAP API.

Advice

The average time for processing a payment request by the payment gateway is less than 5 seconds.

You must configure a timeout of 20 to 30 seconds for the buyer.

During the timeout, you can:

  • Inform the buyer that the payment is being processed. Meanwhile, you can check the status of the transaction on the payment gateway and return to the buyer when the final result is displayed.
  • Inform the buyer that the payment has been declined, after making sure that you do not have to manually validate the payment on the payment gateway.