I have a credit card billing form which requires data to be posted securely to the payment gateway. Upon a successful payment transaction, the gateway forwards the user to a billing confirmation page.
That's fine, however, the billing confirmation page requires some data from the credit card billing form to create a transaction record.
i.e.
page 1: payment gateway information, website transaction number
page 2: -> off-site payment gateway ->
page 3: I need the website transaction number
What can I do to send the website transaction number from page 1 to page 3 to tell my script that the transaction has been successful?
I assume I can save the sessionhash (stored in a cookie) and the transaction number in a temporary table. When the user returns from the payment gateway after a successful transaction, I can look up the sessionhash table and retrieve the transaction number.
Losing POSTed data after return from payment gateway
Moderator: General Moderators
Thanks for the advice... I managed to get it working for the most part.
1. I save sessionhash and transaction information from billing page into a temphash table.
2. Info is posted to credit card gateway, which redirects to billing confirmation page upon successful payment.
3. At billing confirmation page, I look up the sessionhash stored in $_cookie against what I saved in the db and pick up the required info.
This seems to work -- most of the time
When I close the browser and reopen it, I print_r($_cookie['sessionhash'] to make sure it's there. It is, and it's is displayed in step 1.
I fill in details, send data to CC gateway, which works fine as well.
However, when I get to step 3, the print_r($_cookie) yields only "Object".
To make things more mysterious, when I try to register and pay again, this time without closing browser, steps 1 and 2 are fine again, and so is step 3!
1. I save sessionhash and transaction information from billing page into a temphash table.
2. Info is posted to credit card gateway, which redirects to billing confirmation page upon successful payment.
3. At billing confirmation page, I look up the sessionhash stored in $_cookie against what I saved in the db and pick up the required info.
This seems to work -- most of the time
When I close the browser and reopen it, I print_r($_cookie['sessionhash'] to make sure it's there. It is, and it's is displayed in step 1.
I fill in details, send data to CC gateway, which works fine as well.
However, when I get to step 3, the print_r($_cookie) yields only "Object".
To make things more mysterious, when I try to register and pay again, this time without closing browser, steps 1 and 2 are fine again, and so is step 3!