The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Possible to save returned PayPal IPN data? (txn_id, payer_email, etc.)? - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Possible to save returned PayPal IPN data? (txn_id, payer_email, etc.)? (/showthread.php?tid=345) |
Possible to save returned PayPal IPN data? (txn_id, payer_email, etc.)? - Jaace - Oct 26th, 2009 I want to save these values returned from the PayPal IPN into my database; I created hidden fields for each one on the first page of my form so that they each have columns in the database...but they aren't saving there. How do I get these values to save? RE: Possible to save returned PayPal IPN data? (txn_id, payer_email, etc.)? - Ben - Oct 30th, 2009 Hi Jaace, Good question. You can certainly do it manually (extract the PayPal POST values and update the database in a custom query), but it's a bit of a hack. What I'm going to do is add a simple ft_api_update_submission function that can handle this. There's a similar function in the Core that does something very similar, but it's closely coupled to the page markup & won't work well in our case. I'll try and get something going tonight or tomorrow for this. - Ben RE: Possible to save returned PayPal IPN data? (txn_id, payer_email, etc.)? - Ben - Oct 30th, 2009 Hi Jaace, Here we go. I haven't tested this, but it *should* work...! First, upgrade your Form Tools core to the latest version 2.0.0-beta-20091030) and in your ipn.php file (I assume you're using the zipfile from the tutorial?) add in the following line, right after the ft_finalize_submission() line. PHP Code: ft_update_submission_info($pp["form_id"], $_POST["custom"], $_POST); Then, in Form Tools, create new fields for the PayPal fields you want to save. This is done through the Edit Form -> Database tab. Make sure that you make the form field name and database column name the same as the POST value (e.g. "txn_id", "payer_email" etc.). Then it should work... The new ft_update_submission_info function should just ignore all values in the $_POST variable, if they're not a valid form field name. But if there ARE problems, try creating a separate hash containing the new values you want stored, and pass that as the third parameter instead. e.g. PHP Code: $params = array( Hope this helps! :-) - Ben |