R
R
rinaz222019-08-04 16:25:30
PHP
rinaz22, 2019-08-04 16:25:30

How can I cancel a Yandex.Money payment in case of an error on my site?

Hello! I decided to connect the Yandex.Money payment system on the site. Everything works, except for the error output. Those. in case of any error, the payment still goes through and Yandex redirects to the good page.
How to make sure that in case of an error, the payment fails and the money remains on the user's wallet.
At the moment I just have exit('Error'). So the payment goes through.
What should be displayed in response to the POST request that comes to the handler from Yandex in order to stop the payment?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sanes, 2019-08-04
@Sanes

Just change the conditions.
99% of shop owners with online payment do not think about the refund mechanism.
Start with this.

D
Dmitry Derepko, 2019-08-04
@xEpozZ

https://kassa.yandex.ru/developers/payments/basics...

T
Timur Khudiyev, 2019-08-10
@t_khudiyev

If a framework or a self-written site, then you can first make an entry in the database about the service that you provide for payment, but marked "not paid". Then the next step is a request to Yandex. If everything is good, then change the status of the service to "paid" and give it to the client, if not, then no) That is, in the admin panel you will see that someone ordered something, but the payment did not go through. In such an algorithm, you won’t just take money because of an error and you won’t return the service if the payment fails

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question