Feb 6th, 2010, 2:43 PM
Hi Jaace,
Welcome back!
Yeah, those approaches you mentioned wouldn't work. They rely on sessions already being set up; since the ipn.php page is just called when PayPal submits info of the successful transaction it won't have access to the form values.
Instead, you'll need to be a bit sneaky...
The POST request that PayPal sends to ipn.php will contain a $_POST["custom"] key containing the unique submission ID. You'll need to use that info to query the database and get the submission info by that route.
What you could do is use a function from the Core that retrieves the submission info:
You'll need to pass your form ID and submission ID. It returns a hash (associative array) or database column names => form field values.
If you haven't already done so, go to the Edit Form -> Database tab and click "Smart Fill" for the database column names. This will rename all the database column names to make them the same as your form field names. It makes things a lot less complicated, let me tell you.
Good luck!
- Ben
Welcome back!
Yeah, those approaches you mentioned wouldn't work. They rely on sessions already being set up; since the ipn.php page is just called when PayPal submits info of the successful transaction it won't have access to the form values.
Instead, you'll need to be a bit sneaky...
The POST request that PayPal sends to ipn.php will contain a $_POST["custom"] key containing the unique submission ID. You'll need to use that info to query the database and get the submission info by that route.
What you could do is use a function from the Core that retrieves the submission info:
PHP Code:
$submission_info = ft_get_submission_info($form_id, $submission_id);
You'll need to pass your form ID and submission ID. It returns a hash (associative array) or database column names => form field values.
If you haven't already done so, go to the Edit Form -> Database tab and click "Smart Fill" for the database column names. This will rename all the database column names to make them the same as your form field names. It makes things a lot less complicated, let me tell you.
Good luck!
- Ben