I use Robokassa, all the logic according to the documentation.
I found a flaw in either Robokassa, or I use logic incorrectly, namely:

  1. The buyer chooses a table in the restaurant.
  2. My script puts the status in the database for this table - a reserve , while the table is in reserve, no one can put it in the reserve and therefore buy it.
  3. The buyer goes to the payment page Robokassa and pays.
  4. My script receives a confirmation via Result URL and changes its status - paid.

How can I withdraw from the reserve if the client does not pay? There are two scenarios:

  1. when the client refused in the interface of Robokassa and Robokassa sends it to the Fail page - in this case I get an answer from this page and change the status in the database to free
  2. The client stupidly closed the payment page, accordingly Robokassa does not send anything to the Fail page and the table hangs in reserve.

For some reason, Robokassa does not voice this moment at all, that is, get a Fail-answer on the Fail page and period. Temporarily, I am clearing orders through crown. who hang in the reserve for more than 5 minutes, that is, definitely the client should have time to pay, but not beautiful? And the client can keep the form of payment open for some time (10-minute beacon gives the payment) and still pay, some kind of duality arises.
Who as solved similar, share !!)))

  • one
    You have a normal solution, I do not think it is worth reworking. The only thing is to edit the time interval for the cancellation of the reserve. But it depends on the workload of your institution. - ArchDemon

1 answer 1

make a script in cron / daemon that releases tables if payment was not 10-15 minutes

  • well, it's almost the same thing that I voiced in the question ... - Sergey V.
  • one
    >> Someone like to solve this, share !! and so it was decided. There is simply nothing else. Robokassa can not return anything at all. I usually do 2 handlers - fail + cron (daemon). Fail frees faster and more often. Script from cron frees those that hang from payment system glitches - hardworm
  • hardworm - kronas with which period do you use? - Sergey V.
  • Depending on the project. For tickets to the concert 15 minutes. To reserve a place in the honey. the center is 25 minutes (people do everything very slowly and thoughtfully - do not disturb it). - hardworm