Jump to content

Payment Module Saving Data


Recommended Posts

Hi All,

I'm a newbie with Prestashop and I would like to ask you:
what is the best method to save a variabile related to the customer's cart during the payment process?

I have this scenario:

1) Within the controller of the module, before redirecting to the payment processor, I need to save the variabile 'payment_ID'.
2) Now the customer lands to the payment process page (with the credit card form, etc...)
3) Then, the customer returns to the prestashop platform in a specific controller of my payment module. Here I need to get the previous 'payment_ID' variabile.

Can anyone help me out?

Thanks in advance



Link to comment
Share on other sites

create a new database table (ps_yourmodulename_transaction, or something similar and unique)

The table should have two or three columns


Then before you redirect, you would insert or update a record into this table for the given cart.

Then when the customer returns, you can query this table for the given id_cart, and you can also update the id_order value after the order is created.

You could also try to use cookies to store the value, but I do not like this approach, as it can be hacked


  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...