I want to share a simple look at complex things.
I remember well my first encounter with on-line payments. Then I was morally strained by such a task: not only was the responsibility for someone else’s money on me, I still don’t even understand the usual banking system, let alone virtual.
The good news is that you don’t need to understand the internal kitchen of payment systems.
In the explanation, here is a simple example from our lives. Communal payments; fat is a piece of paper that falls into our mailbox every month. To pay the bill, it is enough to come to the Savings Bank branch, stretch this piece of paper and the necessary amount of money to the tortured girl in the window. Most people quite cope with this simple procedure, completely unaware of how their money gets from the branch of the Savings Bank to the account of their own housing department. And also imagine an aunt Glusha, who works in his own housing department. She regularly puts down the necessary numbers on the tablet, so that the same amount of fat from which we go to the bank comes to us. Do you think Aunt Glasha knows how this money will go to her housing service? But this does not prevent her from sending you to pay bills ...
So, in order to organize on-line payments on the site, we should do almost the same thing as Aunt Glasha, just need to automate it. Punching paper will be a POST or GET request of a certain format. The account will be replaced with the identifier of the recipient user (your customer, boss or yours) in the payment system, which he will receive during registration. The amount of money will remain a sum of money, whatever payment system you choose. Some other parameters will be added, such as the order number that the customer wants to pay. All parameters are very clearly spelled out in the documentation of the selected system, so they should not be afraid either. (By the way, be sure to save all the data on the order and at home)
The great news is that each payment system even cleared up how and what to do, and also posted code examples in the most popular programming languages.
')
And your customers clicked the “buy” button, you filled out the “receipt” with the purchase number, the payment amount and other necessary items, issued the “receipt” to the client, and in fact, simply redirected it in the right direction with the right parameters, and voila! He went to pay. Unless of course he really wants to buy what you offer him, otherwise he may change his mind on the way :).
But here everything is thought out. The payment system will let you know whether your client has reached it and whether it has paid the required amount. It will also be POST or GET requests, only from the payment system to you. And the parameters in them are also clearly defined in the documentation. As well as laid out code samples for processing these requests with all the checks.
If the answer from the payment system has not reached you, then your client probably has changed his mind :(. But you will never delete the information about this payment anyway. You never know what. Sometimes, but it happens. Then the client will contact the support, the support will find an entry in the order table, check with the transactions within the payment system, and figure out whether to put it manually “paid” or send a reasoned argument :).
In the
next part of the article about how to tie up on the site at once several payment systems with the least headache.