N
N
NubasLol2022-02-14 13:12:07
Browsers
NubasLol, 2022-02-14 13:12:07

Double redirect when redirecting from a payment, in case of work being done. What can be wrong?

The project uses a payment system, which, according to the classical scheme, should be redirected to the backend. There is already a redirect from the backend to the frontend. But here's the problem. If some work is done before the redirect from the backend, then two requests occur after the payment.

In this case, after the redirect from the payment to the network, I see 2 requests to the backend, one with the canceled status, the second 302

sleep(1);
        return redirect()->to(Config::get('app.front_url') . '/orders/success?order_id=' . 1);


And in the version without delay, immediately 302 and everything works out as it should, the request after the payment is only 1
return redirect()->to(Config::get('app.front_url') . '/orders/success?order_id=' . 1);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question