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
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
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
Form Submissions Not Finalizing - 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: Form Submissions Not Finalizing (/showthread.php?tid=1548)



Form Submissions Not Finalizing - just1ncase - Aug 19th, 2011

I'm testing the donation form with Paypal Integration in MAMP (Mac Apache MySQL and PHP). It works great, but for some reason, the submissions aren't being finalizing even though it has finished the whole the process successfully (signup > process > paypal > success).

What am doing wrong? I was looking around the forum and seems like I need to tweak or do some testing with the IPN.php. But, what would I need to tweak?

Please let me know. I love form tools and has been incredible asset to my client work. Thank you once again!


RE: Form Submissions Not Finalizing - Ben - Aug 21st, 2011

Hi just1ncase,

Thanks for the kind words! Smile Glad it's coming in handy.

Yes, the ipn.php file is where the submission should get finalized. This line should get called for all successful payments that get put through:

PHP Code:
ft_finalize_submission($pp["form_id"], $_POST['custom']); 

If the submissions aren't being finalized, either the values being passed to that function aren't making it there, or

What I often do for debugging the ipn.php script is just to add in extra lines to send myself emails at the different spots. For starters, right before the line I quoted above, add the following line:

PHP Code:
mail("your@email.com""debugging""Form ID: {$pp["form_id"]}, sub ID: {$_POST['custom']}"); 

If that part of the code is being called, it should send you an email containing the values being passed. That will tell you if the code IS in fact being called, and if the values are correct.

Failing that, try adding additional lines at the top of the file to confirm the ipn.php script is in fact being called.

Let me know how it goes!

- Ben


RE: Form Submissions Not Finalizing - just1ncase - Aug 21st, 2011

I'm not getting an email whatsoever. This is the code I'm currently using:

PHP Code:
<?php
/*
 * ipn.php
 *
 * PHP Toolkit for PayPal v0.51
 * http://www.paypal.com/pdn
 *
 * Copyright (c) 2004 PayPal Inc
 *
 * Released under Common Public License 1.0
 * http://opensource.org/licenses/cpl.php
 */

mail("justin@justingaspar.com""debugging""Form ID: {$pp["form_id"]}, sub ID: {$_POST['custom']}");

$base_folder dirname(__FILE__);
require_once(
"$base_folder/includes/library.php");
require_once(
"$base_folder/includes/config.inc.php"); 
require_once(
"$base_folder/includes/global_config.inc.php");


// decide which post method to use
switch ($pp["post_method"])
{
  
// php compiled with libCurl support
  
case "libCurl":
    
$result libCurlPost($pp["url"], $_POST); 
    break;

  
// cURL via command line
  
case "curl"
    
$result curlPost($pp["url"], $_POST); 
    break;

  
// php fsockopen();
  
case "fso":  
    
$result fsockPost($pp["url"], $_POST); 
    break;

  default:
    
$result fsockPost($pp["url"], $_POST);
    break;
    
  
mail("justin@justingaspar.com""debugging""Form ID: {$pp["form_id"]}, sub ID: {$_POST['custom']}");
  
}


// successful payment! finalize the submission in the database
if (eregi("VERIFIED"$result)) 
{
   
mail("justin@justingaspar.com""debugging""Form ID: {$pp["form_id"]}, sub ID: {$_POST['custom']}");
     
  
ft_finalize_submission($pp["form_id"], $_POST['custom']);
}

// oh-oh, something either went wrong, the payment didn't go through or someone's coming to this page 
// directly in their browser  
else 
{



?>

(Aug 21st, 2011, 3:49 PM)Ben Wrote: Hi just1ncase,

Thanks for the kind words! Smile Glad it's coming in handy.

Yes, the ipn.php file is where the submission should get finalized. This line should get called for all successful payments that get put through:

PHP Code:
ft_finalize_submission($pp["form_id"], $_POST['custom']); 

If the submissions aren't being finalized, either the values being passed to that function aren't making it there, or

What I often do for debugging the ipn.php script is just to add in extra lines to send myself emails at the different spots. For starters, right before the line I quoted above, add the following line:

PHP Code:
mail("your@email.com""debugging""Form ID: {$pp["form_id"]}, sub ID: {$_POST['custom']}"); 

If that part of the code is being called, it should send you an email containing the values being passed. That will tell you if the code IS in fact being called, and if the values are correct.

Failing that, try adding additional lines at the top of the file to confirm the ipn.php script is in fact being called.

Let me know how it goes!

- Ben




RE: Form Submissions Not Finalizing - Ben - Aug 21st, 2011

A-ha! In that case there are two possibilities:

1. you may not have configured things on PayPal's end. See this page:
http://docs.formtools.org/tutorials/paypal/?page=configure_paypal_account

2. There's a syntax error on the ipn.php page which prevents any of the code being executed. To eliminate that as the cause, temporarily delete everything except the mail() line.

- Ben




RE: Form Submissions Not Finalizing - just1ncase - Aug 23rd, 2011

So, I went ahead and place the URL of the IPN in the Paypal business test account. However, since the original IPN file was in my testing server via MAMP, it wouldn't allow me to place that URL.

Thus, I uploaded the IPN in my Dropbox account and pasted the public URL as an alternative. But, it still doesn't work. Is it just best to upload the demo "donation" files online in order to successfully test the IPN?

I'm stumped and have no clue. My next step is probably just testing these files on a live hosting site online in Godaddy, but I'm afraid that I might experience the same thing.

Any thoughts or advice would be great! Thanks again for your help.


RE: Form Submissions Not Finalizing - Ben - Aug 24th, 2011

Oh, I see - sorry I should have thought of that. No, you won't be able to use "localhost" to test IPN. PayPal won't know where to send the IPN message.

In order to test it on your local machine, you'll need to use your own IP address, as seen by the outside world. You'll also need to ensure that MAMP has been configured to permit people externally accessing your local site.

This opens up security issues though - even if you're doing it temporarily for testing. Any chance you could move the operation to a web server off your local box to test the IPN?

Again, sorry, I totally forgot you were working locally.

- Ben


RE: Form Submissions Not Finalizing - just1ncase - Aug 24th, 2011

No worries, I'll go ahead and try it out on my web server. I'll let you know how it goes. Thanks!