I've got a product page set up where you click a product (radio button) and click checkout with Paypal. What I'd like at this point is to create the purchase in the database (add the table row with purchase details, minus the Paypal receipt id), then send the user to Paypal to pay. When user returns to the site the receipt id will be added to the purchase.
The thing is, I need to send the user to Paypal and POST some data to the Paypal page.
Can all this be done in 1 click of the user?
My Thoughts: 1) I can't just submit the payment form the a PHP page on my server, because although I will be able to add the purchase to DB, I won't be able to redirect the user to Paypal and POST variables (from what I know). 2) I think AJAX would be the way to go, but I'm not sure if it's possible. Can I do some server side processing AND send the user to the Paypal site AND POST variables to the page?
Thanks for any help.