hi,
i'm in the process of integrating ipn with my site and am now faced with the problem of trying to commit pre-transaction data to a db prior to submitting the form to the paypal server, so as i can compare the data returned by ipn with that held locally on my db before updating my inventory tables. needless to say i'm finding it a nightmare!
the current process is as follows...
- customer fills in order_form.php
- order_form.php POSTs data to paypal site
- customer completes transaction on paypal servers
- paypal POSTs transaction data to ipn_script.php
4i. ipn_script.php submits POSTed transaction data back to paypal
4ii. paypal verifies transaction and POSTs 'VERIFIED || INVALID' header back to ipn_script.php
4iii. ipn_script.php processes header value and updates inventory
- customer directed to order_confirmed.php page and presented with invoice
...but as mentioned, i want to insert the initial order details into a temp table inbetween steps 1 & 2. can this be done?
my only thought is to direct order_form.php to let's say process_form.php using the <form action='...'> property. on submitting the form, the script interacts with the db. it's then pretty straight forward POSTing the details to paypal, but this is a background process and the user is still faced with the process_form.php page, but needs to interact with the paypal page. my question is how do i get from the form_process.php page to the paypal page without
i. using javascript, and
ii. inconveniencing the customer by requiring them to resubmit a form/follow a link etc?
is there a way of using the header ('location: ...') function to submit POSTed data along with it?
can anyone shed any light please? thanx