If this is your first visit, check our documentation. To post, register or login.
Forums / Built-in Shipping and Payment Modules / problem with ipn_main_handler...

problem with ipn_main_handler...

Started by carlwhat on 6 Jul 2022, 11:54 PM · Views: 964

Results 1 to 4 of 4
6 Jul 2022, 11:54 PM
#1
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

problem with ipn_main_handler...

i recently got the following log. it seems that we are not cleansing the data coming back from paypal? (i rarely use or support it.)

it seems that \xa0 is actually non-breaking space in Latin1 (ISO 8859-1).

is this a paypal setting that i have wrong? or do we need to make a coding change?

log (some elements changed to protect the innocent):

[06-Jul-2022 07:54:06] Request URI: /ipn_main_handler.php, IP address: 173.0.81.65
#1  trigger_error() called at [/myHome/includes/classes/db/mysql/query_factory.php:171]
#2  queryFactory->show_error() called at [/myHome/includes/classes/db/mysql/query_factory.php:143]
#3  queryFactory->set_error() called at [/myHome/includes/classes/db/mysql/query_factory.php:270]
#4  queryFactory->Execute() called at [/myHome/includes/functions/database.php:44]
#5  zen_db_perform() called at [/myHome/ipn_main_handler.php:419]
--> PHP Fatal error: 1366:Incorrect string value: '\xA0east ...' for column `mydatabase`.`paypal`.`address_state` at row 1 :: INSERT INTO paypal 
(order_id, txn_type, module_name, module_mode, reason_code, payment_type, payment_status, pending_reason, invoice, mc_currency, first_name, 
last_name, payer_business_name, address_name, address_street, address_city, address_state, address_zip, address_country, address_status, 
payer_email, payer_id, payer_status, payment_date, business, receiver_email, receiver_id, txn_id, parent_txn_id, num_cart_items, mc_gross, mc_fee, 
settle_amount, settle_currency, exchange_rate, notify_version, verify_sign, date_added, memo) VALUES ('236947', 'parent', 'paypal (ipn-handler)', 'IPN', 
'refund', 'instant', 'Refunded', '', '2588-1622644268-[mystore]', 'USD', 'kristen', 'smith', '', 'kris smith', '555 somewhere Drive', 'Eastbourne', '<A0>east 
sussex', 'BN208AR', 'United Kingdom', '', 'myemail######################', '8WQ3AK9PLLZK8', '', '2022-07-06 04:53:59', 
'myemail######################', 'myemail######################', '5AEL7BMZHK86N', '68422392U6908592X', 
'5E876138AL509150Y', '1', '-149.40', '0.00', '0', '', '1', '3.9', 'ATKG0W3.Sgjo.GzJn2YUDDvu5565Loi8lHe0SofBB2XQf7M02Hhp', now(), '{Record generated 
by IPN} [ProtectionEligibility:Eligible]') ==> 
(as called by) /myHome/includes/functions/database.php on line 44 <== in /myHome/includes/classes/db/mysql/query_factory.php on line 171.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

7 Jul 2022, 10:36 AM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: problem with ipn_main_handler...

I wonder if we need to sanitize the data that comes back from PayPal. Guilty until proven innocent!

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

7 Jul 2022, 1:49 PM
#3
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Re: problem with ipn_main_handler...

swguy:

I wonder if we need to sanitize the data that comes back from PayPal. Guilty until proven innocent!

clearly in this example, it is warranted...

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

7 Jul 2022, 3:01 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: problem with ipn_main_handler...

I reckon so. Please PR.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.