Zen Cart Logo
Forums / PayPal Express Checkout support / Debug logs Undefined index: txn_type, random API calls from Paypal 173.0.81.1

Debug logs Undefined index: txn_type, random API calls from Paypal 173.0.81.1

Views: 2,121

Results 1 to 4 of 4
23 Jun 2020, 6:37 PM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Debug logs Undefined index: txn_type, random API calls from Paypal 173.0.81.1

I have a mongrel 156-157 site.
I have Report All Errors on permanently (NoDups) and have no errors apart from these.

I get a block of these (like 9 over 45 minutes) with identical errors. The originating IP address is a Paypal site/appears to be legit.
There does not appear to be any relation to any orders: an order may occur in the midst of these, or not at all.

My query is if anyone else has Report All Errors enabled on a production site?
Unlikely on a 156 site as it is a pile of work to clear the inherent errors to zero, and unlikely that there is a ZC157 (which has most errors fixed) in production/being used for Paypal tests....although this issue appears to be unrelated to Paypal orders.

Is it possible Paypal is making these calls for its own purposes...but no-one has noticed, due to the above reasons?

In the following debug, the final error for Call to undefined function zen_update_orders_history
I don't get. As the function exists and other functions in the same file are used previously/so file is proven to have been loaded.

I have modified the debug to show more details, there is no-one logged in on this session.

Guest
Navigation: [0][not set] [1][not set] [2][not set]
Request URI: /tienda/ipn_main_handler.php
IP address: 173.0.81.1
--> PHP Notice: Undefined index: txn_type in /.../tienda/ipn_main_handler.php on line 226.

[23-Jun-2020 19:44:55 Europe/Madrid]
Guest
Navigation: [0][not set] [1][not set] [2][not set]
Request URI: /tienda/ipn_main_handler.php
IP address: 173.0.81.1
--> PHP Notice: Undefined index: txn_type in /.../tienda/ipn_main_handler.php on line 231.

[23-Jun-2020 19:44:55 Europe/Madrid]
Guest
Navigation: [0][not set] [1][not set] [2][not set]
Request URI: /tienda/ipn_main_handler.php
IP address: 173.0.81.1
--> PHP Notice: Undefined index: pending_reason in /.../tienda/ipn_main_handler.php on line 472.

[23-Jun-2020 19:44:55 Europe/Madrid] PHP Fatal error: Uncaught Error: Call to undefined function zen_update_orders_history() in /.../tienda/includes/modules/payment/paypal/paypal_functions.php:649
Stack trace:
#0 /.../tienda/ipn_main_handler.php(476): ipn_update_orders_status_and_history('20200345', '1', 'parent')
#1 {main}
thrown in /.../tienda/includes/modules/payment/paypal/paypal_functions.php on line 649

[23-Jun-2020 19:44:55 Europe/Madrid] Request URI: /tienda/ipn_main_handler.php, IP address: 173.0.81.1
--> PHP Fatal error: Uncaught Error: Call to undefined function zen_update_orders_history() in /.../tienda/includes/modules/payment/paypal/paypal_functions.php:649
Stack trace:
#0 /.../tienda/ipn_main_handler.php(476): ipn_update_orders_status_and_history('20200345', '1', 'parent')
#1 {main}
thrown in /.../tienda/includes/modules/payment/paypal/paypal_functions.php on line 649.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

23 Jun 2020, 6:50 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: Debug logs Undefined index: txn_type, random API calls from Paypal 173.0.81.1

torvista:

I have a mongrel 156-157 site.
I have Report All Errors on permanently (NoDups) and have no errors apart from these.

I get a block of these (like 9 over 45 minutes) with identical errors. The originating IP address is a Paypal site/appears to be legit.
There does not appear to be any relation to any orders: an order may occur in the midst of these, or not at all.

My query is if anyone else has Report All Errors enabled on a production site?
Unlikely on a 156 site as it is a pile of work to clear the inherent errors to zero, and unlikely that there is a ZC157 (which has most errors fixed) in production/being used for Paypal tests....although this issue appears to be unrelated to Paypal orders.

Is it possible Paypal is making these calls for its own purposes...but no-one has noticed, due to the above reasons?

In the following debug, the final error for Call to undefined function zen_update_orders_history
I don't get. As the function exists and other functions in the same file are used previously/so file is proven to have been loaded.

I have modified the debug to show more details, there is no-one logged in on this session.
While I haven't (yet) located when /includes/auto_loaders/paypal_ipn.core.php was updated for zc157, it sounds like you need to add the following line

  $autoLoadConfig[60][] = array('autoType' => 'require',
                                'loadFile' => DIR_WS_FUNCTIONS . 'functions_osh_update.php');

... just prior to the auto-load for DIR_WS_FUNCTIONS. 'functions_general.php'. Those are most likely PayPal IPNs coming back with status updates, maybe?

Noting that the zc157 version of the /ipn_main_handler.php was updated to use the zen_update_orders_history function; you've apparently pulled that version in without the above change to its auto-loader.

23 Jun 2020, 7:28 PM
#3
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Debug logs Undefined index: txn_type, random API calls from Paypal 173.0.81.1

Thanks!

I have had to add a few other checks in the ipn_handler for php notices...I would hope someone is doing nit-picking real transactions with ZC157 trap these notices...

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

23 Jun 2020, 9:31 PM
#4
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Debug logs Undefined index: txn_type, random API calls from Paypal 173.0.81.1

That fix did clear the fatal error.

The other notices remain...to be seen if they are squashed in ZC157!

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...