[eluser]rideearthtom[/eluser]
I need to save certain text fields during a shopping-cart process I've built, and after a Paypal transaction, save this info to the database along with the transaction details.
Should be easy enough I thought, but Paypal's 'custom' var only accepts 256 characters, which isn't enough. There's no guarantee, either, that the user will return to the site after payment. The only thing I can rely on is that Paypal's IPN will come through asynchronously if the transactions is successful. Since it's async, I can't use the session to store the text fields.
I'm not really sure what to use. I could use a temporary db record, saved during the checkout but before the user leaves the site for Paypal, but since there's no transaction record in the database at that point, there's nothing to reference it to.
Would the best thing to do be to pass Paypal a custom token, e.g the PK of the saved record, which retrieves the data from the DB once the IPN passes it back and creates the relationship to the transaction when it's saved? Or is there a simpler way?
I think I just answered my own question... I just have a phobia now of Paypal and their impossible-to-debug-locally IPN system...