PayPal Express - fatal error
ZC 2.0.1
php 8.3
Code:
[30-Aug-2024 13:20:04 UTC] Request URI: /ipn_main_handler.php?type=ec&token=EC-XXXXXXXXXX577631T&PayerID=XXXXXXXXXXWTE, IP address: 172.XXX.XXX.XXX, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 /home/XXXXXXX/public_html/includes/classes/db/mysql/query_factory.php(714): trigger_error()
#2 /home/XXXXXXX/public_html/includes/classes/db/mysql/query_factory.php(659): queryFactory->show_error()
#3 /home/XXXXXXX/public_html/includes/classes/db/mysql/query_factory.php(299): queryFactory->set_error()
#4 /home/XXXXXXX/public_html/includes/functions/database.php(134): queryFactory->Execute()
#5 /home/XXXXXXX/public_html/includes/modules/payment/paypalwpp.php(2266): zen_db_perform()
#6 /home/XXXXXXX/public_html/includes/modules/payment/paypalwpp.php(2010): paypalwpp->ec_step2_finish()
#7 /home/XXXXXXX/public_html/ipn_main_handler.php(85): paypalwpp->ec_step2()
--> PHP Fatal error: MySQL error 1364: Field 'registration_ip' doesn't have a default value :: INSERT INTO customers (customers_firstname, customers_lastname, customers_email_address, customers_email_format, customers_telephone, customers_fax, customers_gender, customers_newsletter, customers_password, customers_paypal_payerid) VALUES ('XXXXXX', 'XXXXXX', 'XXXXXX######################', 'HTML', '', '', '', '0', '$2y$10$1BQifrEBcXInWmwlLHs4Geuje.FkG22qNJBgkf1s31WFr7hHy4X3m', 'XXXXXXXXXXWTE') ==> (as called by) /home/XXXXXXX/public_html/includes/functions/database.php on line 134 <== in /home/XXXXXXX/public_html/includes/classes/db/mysql/query_factory.php on line 714.
Seems to be happening with all orders that go through PayPal Express checkout using the shortcut button on the shopping_cart page. Any ideas?
Re: PayPal Express - fatal error
Ugh. Of course it took me a few hours of looking at it, posted the question and a minute after posting I figure it out...
The issue was the customers table was upgraded from an older version and the upgrade process doesn't automatically add 'registration_ip' so I added it manually, but set the default value of the field as "None" instead of "As defined:" and without a value... :frusty:
Re: PayPal Express - fatal error
The upgrade process *does* automatically add registration_ip. See zc_install/sql/updates/mysql_upgrade_zencart_158.sql.
But it's possible that this operation failed if you have some custom dates in your customers table. See
https://docs.zen-cart.com/user/upgra...nknown_column/