Possible problems with the payment gateway

In my application (paypal and datatrans) 2 payment gateways are implemented. In both gateways, payment takes place at the gateway, that is, the user is redirected to the site of the payment gateway, where he pays, and then redirected back to our website. I have identified some scenarios in which there is a problem in the entire flow of payments. For instance.

  • lost internet connection after payment and therefore the order is not placed, but the money was debited from the user account.
  • PayPal response sent, but the application received an exception and therefore the user did not receive a confirmation
  • Double payment due to the click of the refresh button during the transaction.

I would like to know what standard exceptions should be handled when integrating a payment gateway. Any example with PayPal will help me a lot, I am using asp.net mvc 3. thanks.

0
source share
1 answer

Double payment.

To avoid them, you need to create a unique identifier for each order, after the user moves from your site to PayPal or another site, this identifier should be read-only, and if the user returns to your site after a failure or other reason, and ask to reorder the same basket, you must create a new cart and a new order identifier.

For each order ID, paypal and other sites allow only one payment (or one failure).

Lost internet connection or donโ€™t receive confirmation

Paypal has 3 ways to contact your.

  • IPN
  • PDT
  • letters.

The only thing you get information about the user's return after payment, another method is that paypal contacts you and sends you payment information, and you receive the final email.

In the rare case when everything fails, the user will inform you in a few days that he has not received his order.

Virtually they do not fail everyone. In fact, they never tolerate any of them.

Exceptions and Errors

Well, sometimes you canโ€™t avoid mistakes, so keep an eye on your payments and record possible errors to fix this. After 7 years of payments with PayPal, I still track them for problems, fraud, problems, new ideas, etc., And still make small adjustments from time to time.

+3
source

Source: https://habr.com/ru/post/921625/


All Articles