I have developed a module using SagePay Form integration method. It works fine until it returns from the Sagepay site and all of my local user session vars are destroyed for some reason.Thus i am unable to use my own created session vars and save information about a user regarding that specific order. The url's it returns to are success and failure urls. What might be the possible reason?

有帮助吗?

解决方案

Don't rely on the session variables to be available when you're returned to your site - for a variety of reasons, they may not be. Instead, save your transaction data prior to passing to SagePay (you should subsequently use a unique identifier generated here to identify your transaction, eg a database primary key entry). Flag this transaction as "pending payment" or similar.

When SagePay returns the customer to your site, you'll have the unique identifier to look up the saved transaction data accordingly. You can then mark the transaction as "paid" or "payment declined" etc, and you'll be able to display the user's transaction data as you wish.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top