Reputation: 2356
My Paypal IPN payement is working (buy now button) but now I have to add some variables, like the discount name, the user ID, etc... in my database for each transaction. In the past I used the custom hidden field as I just need the user ID. But now I don't know how to pass this new custom variables and have them POST back form Paypal if the payement succeed ?
Thanks for your help !
Upvotes: 3
Views: 8558
Reputation: 6025
You've got three main options:
Use the standard custom
hidden field to store all the data you need in one string. You could use JSON format or some equivalent. The variable size is limited to 256 characters, which sounds like it might be enough.
Store a unique id in the custom
field, and use this id to look up the other data that you've stored in your database.
There are also additional option
fields you can use as suggested here and explained by PayPal here:
You could possibly also use some of the standard PayPal fields for purposes other than that for which they were intended (i.e., to hide your data), but this is highly dubious and entirely unnecessary, I would imagine.
See this answer.
Upvotes: 13