How can I solve the problem of not being informed about successful payments by a third-party system used by my site?

I have a subscription based site that interacts with a third party system to process payments. The steps to handle a new subscriber registration are as follows:

  • The subscriber enters his data in the subscription form and clicks the send button.
  • Assuming the specified data is correct, a new record is created in the database to store these details.
  • The subscriber is then redirected to a third-party system website (similar to a payment system) to process the payment.
  • Once the payment is successful, the third party website will then redirect the subscriber to our website.
  • At this time, I know that the payment was successful, so the database entry is updated to indicate that the payment was successful.

The problem I have found quite often is that if the subscriber pays, but does not follow the process correctly (eg, uses a reverse browser, closes the window), his / her database record is not updated this. Accordingly, I do not know if he paid by simply viewing the entry and you need to wait for a report from a third-party system to find out.

How do you solve this problem?

PS. One of the main reasons for storing their details in the database until the payment process is complete is so they can go back to complete the payment without re-entering their details. For example, when their credit cards have been rejected by a third party system and they need to sort out with their financial institution, which can take a while.

+2


source to share


1 answer


The third party payment system must inform you of a successful transaction regardless of what the user does.

For example, in PayPal, an IPN (Immediate Payment Notification) is sent to your server as POST data to the URL you specified. Your server then verifies with Paypal that the transaction is genuine, and if so, updates the database record to indicate that the subscription is valid. Going forward in the future, PayPal may or may not be able to redirect the user back to your site. ("Might Not Happen" can occur in cases such as the user closing their browser, clicking Back, or navigating to a new URL)

Note that this "conversation" between Paypal and your server is independent of the user's session — it is a "private conversation" between you and PayPal about this custom transaction.



Obviously there can be network and server outages, so if Paypal does not receive a verification request from your server immediately, it will periodically send replays to your server to ensure the transaction is complete.

If your payment system does not have at least some basic mechanism to ensure the reliability of transactions, choose another provider. They most likely do this, but you will need to implement it correctly on your server to make sure the system is working correctly.

PS It is quite normal to require the user to log in (and therefore register in the database) before starting any financial transaction. You need to gather all the information you need before they come to purchase, as once purchased, you have no way to ensure that they come back to you to provide more information.

+3


source







All Articles