0

I have been scratching my head for days now and wonder if you can help.

I am busy developing a ticket booking system BUT don’t want to store data to the database UNTIL payment successful, or in other words the visitor is returned to my site after payment.

So what I have is a form that a post to a confirmation form. On the confirmation form I catch all the values via POST commands for visitor to review. I then POST this off to the payment provider and once the transaction is successful the visitor is routed back to my site with a confirmation page.

It’s THIS confirmation page that I want to use the store the values in the mysql database.

Now I can use sessions to keep the values in an array or I could write the values into a TEMP database table, but I don’t want to write to and back from the database to many times as I don’t have load balancing in place plus I want to it to be as lightweight as possible.

Any ideas?

4

2 回答 2

2

答案相当简单。重要数据必须存储在可靠的存储器中。会话不是设计的。
因此,不是出于心血来潮而是出于某种原因,您最终会将这些数据存储在数据库中,并将其与用户 ID 连接起来。

于 2013-09-13T11:44:45.070 回答
-1

正如您所说,解决方案是使用 SESSION。如果您希望数据更持久,还可以使用 cookie。

因此,在将数据发送到支付网关之前,您应该执行以下操作:

$_SESSION['posted_data'] = $_POST;
于 2013-09-13T11:42:43.823 回答