According to the documentation Robokassa client notification page - payment was successful - implemented as a trivial echo "Операция прошла успешно"

Naturally, to show this to the Buyer is a white page without design and a line of text at the top is at least indecent. When making a response within the site template, the result looks better, but there are still two drawbacks:
1. In the personal account of Robokassa, the logs of the payments made are saved with all the source code of the page, I think, with large numbers of paid orders, Robokassa will start swearing.
2. The buyer after payment does not return to the page where he left, but to a certain page of a successful payment, is also not always logical.

The question is - what are the working decisions of the buyer’s return after a successful payment to the same page, from where the transition to the payment page of Robokassa was initiated?

So far I have been using redirection to the main page of the site, this is the code inside the file success.php header("Location:/"); , some buyers complain that they manage to see a white page with the very same line and then go to the main page, on mobile gadgets the transition is even more noticeable.

    1 answer 1

    The question is - what are the working decisions of the buyer’s return after a successful payment to the same page, from where the transition to the payment page of Robokassa was initiated?

    When you click the button "Pay via Robokassa" - put a cookie from JS (for example, pay_source_page ): on what page the user was before paying, and only then send the user to the robocassa.

    After payment, it goes to success.php - there you must make a header("Location:" . $_COOKIE['pay_source_page']);die(); , with what before this should not be displayed any content - then the user will see a white page except in IE6.

    • OK, instead of a cookie, you can pass a user variable, it will return in response, BUT as now on this page, where we returned it, show the buyer that the payment is successful? I tried to pass through get - complete nonsense, ugly. - Sergey V.
    • one
      @ Sergey V. transfer all payment data that the robocash office returned via the session, that is, before the Location something like $_SESSION['payData'] = ... And how to show is already outside the scope of this question) - Goncharov Alexander