0

For the (French) payment system PayFip, a URL is generated which opens a new window with different arguments. Exemple :

https://www.payfip.gouv.fr/tpa/paiement.web?numcli=000001&exer=2018&refdet=2018EA0001&objet=&montant=11256&mel=xxx@xxx.xx&urlcl=https://www.mysite.fr/payment_return_page.php&saisie=T

After payment (via this new window) a URL is generated with "urlcl" and is called when this window is closed.

Example :

https://www.mysite.fr/payment_return_page.php?numcli=######&exer=#####&refdet=######&objet=######&montant=##########&mel=#####@###. ##&saisie=T&resultrans=#&numauto=####&dattrans=########&heurtrans=####

My shared server logs prove that my "payment_return_page.php" page seems to be receiving a POST. But I don't know how I can display this page.

Logically the parent page should update, right? What is the best way to get and display the arguments (or the POST array) for this return URL?

I mainly use PHP, JS, AJAX, or JSON ... Is this possible?

Thank you for your help.

Manolo06
  • 11
  • 3
  • What's your exact problem? If your server receives a `POST` request, why not handle it? – Nico Haase Aug 17 '21 at 14:43
  • In PHP if you receive post data then it's available in the $_POST variable. What you've shown so far is request data which you would get from the $_REQUEST variable in PHP. In JavaScript see https://stackoverflow.com/questions/831030/how-to-get-get-request-parameters-in-javascript to get request parameters. – AaronJ Aug 17 '21 at 14:47
  • In my mind the parent window should update with this return url. Am I wrong ? But that is not what is happening. Is there a listener to set up? I would just like to display the returned arguments. – Manolo06 Aug 17 '21 at 14:50
  • Log the arguments into a file... – Honk der Hase Aug 17 '21 at 14:52
  • ok to log the arguments but how to trigger their display on the "payment_return_page.php" page and especially trigger the update of the parent page by the "payment_return_page.php" page? – Manolo06 Aug 17 '21 at 14:57
  • Why not write them to the session? – Nico Haase Aug 17 '21 at 15:03
  • Ok it's doable but I don't see how this write in session can be triggered and by what it could be. Excuse me if I seem ridiculous to you but it is surely that my logic is not ... logic ;-) – Manolo06 Aug 17 '21 at 15:12

1 Answers1

0

you could use a logic like this:

  • open the window and call the url of the payment system using javascript
  • register a close-handler for the window
  • let the payment_return_page.php write the data to the session
  • wait for the close-event of the window
  • reload (or relocate) the current page to a php-script that can now read the session...
Makkapitew
  • 11
  • 4
  • I'll try your plan. Your logic seems much more logical than mine ... ; -) I am testing all this and I will keep you posted ... Thank you guys very much. – Manolo06 Aug 17 '21 at 15:52