The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
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(
  
"txn_id" => $_POST["txn_id"],
  
"payer_email" => $_POST["payer_email"]
    );
ft_update_submission_info($pp["form_id"], $_POST["custom"], $params); 

Hope this helps! :-)

- Ben