Undefined index and undefined variable errors in paypalwpp
Ever since January 3, 2022, every PayPal Express Checkout order has triggered the following errors:
- Undefined index: PAYMENTREQUEST_0_ADDRESSSTATUS in line 1847 of paypalwpp.php
- Undefined variable: country_code3 in paypalwpp.php lines 1983, 1997, and 2010
- Undefined index: countries_id in paypalwpp lines 2022 and 2075
A PayPal EC on January 2 did not trigger these notices. All orders were for virtual products. I transitioned to zc157c on the production server on January 1. Has anyone else experienced these errors, especially this year?
php 7.3.27
Re: Undefined index and undefined variable errors in paypalwpp
Was this transition to 1.5.7, 1.5.7c, or to the latest of the v157 branch in Github?
Re: Undefined index and undefined variable errors in paypalwpp
Quote:
Originally Posted by
mc12345678
Was this transition to 1.5.7, 1.5.7c, or to the latest of the v157 branch in Github?
The version is 1.5.7c.
Re: Undefined index and undefined variable errors in paypalwpp
I should have provided the PayPal settings. Here they are:
- Enable this payment module - true
- Sort order of display - 5
- Payment Zone - none
- Express Checkout Shortcut Button - on
- Set Order Status - Processing
- Set Unpaid Order Status - Pending
- Set Refund Order Status - Pending
- Express Checkout: Require Confirmed Address - no
- Express Checkout: Select Cheapest Shipping Automatically - Yes
- Express Checkout: Skip Payment Page - yes
- Express Checkout: Automatic Account Creation - Yes
- Payment Action - Final Sale
- Transaction Currency - Selected Currency
- Store (Brand) Name at PayPal - [nothing entered]
- Allow eCheck? - Instant Only
- Fraud Magmt Filters - FMF - No
- PayPal Page Style - Primary
- PayPal Mode - payPal
- Use InContext Checkout? - InContext
- Live or Sandbox - live
- Debug Mode - Log File
Re: Undefined index and undefined variable errors in paypalwpp
I forgot to add one other undefined variable notice to the list in my first post in this thread: address_book_id on line 2075 in paypalwpp.php
Re: Undefined index and undefined variable errors in paypalwpp
Initial review of code related to the above batista indicates that these issues may be previously unreported and seem to be yet unresolved. When say virtual product, could you 1, identify the product settings in the virtual section, the address required section and settings in that vicinity and 2, explain what makes this a virtual product and not simply a download?
Re: Undefined index and undefined variable errors in paypalwpp
The products are a membership (new or renewal) to our organization, and donation to the organization. The store does not ship or download anything to the customer for these two products. "Product is Virtual" is set to "yes". "Always free Shipping" for one product is set to "yes", the other is set to "no". I suppose both products should be set to "yes". The error appears for both products.
Additional info: I have reported this problem on Zen Cart Github as issue #4528. A possible fix that works for me is posted there, as well as other settings. Checkout is through the normal route, selecting PayPal on the payment method selection page. I do not display the PayPal express button.
Re: Undefined index and undefined variable errors in paypalwpp
I believe my statement made in the opening post that the error appeared suddenly after Jan 2 is in error. Examination of the logs for the PayPal transactions on Jan 2 and Jan 3 are identical for variables relevant to this issue. I can not explain the absence of the myDEBUG message for Jan 2. Maybe I deleted it.
I tested a PayPal transaction with version 1.5.5f on my development system and got the same errors (along with a bunch of others). I rarely test PayPal transactions on the development system and error logging was turned off in the v1.5.5f production system prior to Jan 1, but turned on in the production v1.5.7c system after Jan 1.
Re: Undefined index and undefined variable errors in paypalwpp
Quote:
Originally Posted by
mc12345678
Initial review of code related to the above batista indicates that these issues may be previously unreported and seem to be yet unresolved. When say virtual product, could you 1, identify the product settings in the virtual section, the address required section and settings in that vicinity and 2, explain what makes this a virtual product and not simply a download?
Quote:
Originally Posted by
Dave224
The products are a membership (new or renewal) to our organization, and donation to the organization. The store does not ship or download anything to the customer for these two products. "Product is Virtual" is set to "yes". "Always free Shipping" for one product is set to "yes", the other is set to "no". I suppose both products should be set to "yes". The error appears for both products.
Additional info: I have reported this problem on Zen Cart Github as issue
#4528. A possible fix that works for me is posted there, as well as other settings. Checkout is through the normal route, selecting PayPal on the payment method selection page. I do not display the PayPal express button.
Thanks for that additional information (especially for those that come across this thread). That said, the information of item 2 above does not appear to be provided. What is it about this product that necessitates it being marked as virtual? Are these downloadable product or is the product something like a subscription to a service? (FYI, knowing this may not directly resolve nor help resolve this specific issue, but incorrectly setting these product may cause other issues.)
Re: Undefined index and undefined variable errors in paypalwpp
Quote:
Originally Posted by
mc12345678
Thanks for that additional information (especially for those that come across this thread). That said, the information of item 2 above does not appear to be provided. What is it about this product that necessitates it being marked as virtual? Are these downloadable product or is the product something like a subscription to a service? (FYI, knowing this may not directly resolve nor help resolve this specific issue, but incorrectly setting these product may cause other issues.)
Nothing is shipped or downloaded to the customer for these products. One is to collect the annual fee for membership in our organization. The store sends order information for the membership product to the organization's membership office. The other product is to collect donations made to the organization. Again, order information is sent to the organization's fundraising treasurer. The customer gets the usual order confirmation and order status update emails from the store. If I set the product to not virtual, the customer will be forced to go through the shipping page if the only product in the order is a membership or donation (or both). And I would prefer the customers not have to do that. Are you saying the settings are not correct for these two products?