P
P
prrrrrrr2019-10-01 20:38:50
Payment systems
prrrrrrr, 2019-10-01 20:38:50

How to implement payment on the site?

Can you tell me how to make payments on the site? It is necessary that after payment a record is added to the user (plus the amount that he paid). The bottom line is:
There is a page - "Cart" . From here we send the user to the merchant.
There is a page - "Process" . Here the merchant sends a response about whether the user has paid or not, and redirects here. Accordingly, if it sends an error, we display the error. If he sends success, then the question is: 1. make a
getom? not option
2.make a post? ok, we make a form with a button to confirm the payment and with an encrypted hidden input, but then you can go back and click many, many more times.
I think it can do this: after visiting the Cart page, we create a one-time url, where we indicate to the merchant when requesting what he would return to this url (for example, process/id=eijf3ijedsf). We immediately write this url to a separate table with the value 0. After the merchant sent success and redirected to this url, we change the value to 1, and set the condition, if it is already 1, then redirect to the main one, if 0, then Let's submit the form.
The option is so-so. Does anyone have better options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Yudakov, 2019-10-01
@AlexanderYudakov

It's like that. Disposable address. Only we redirect in case of success not to the main page, but to the page of the paid order:
/order?id=123

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question