• Resolved Arjun Parab

    (@arjun1638)


    Throws “Cannot read properties of undefined (reading ‘trim’)” error. Steps to replicate:
    1. add subscription item to cart
    2. pay with paypal
    3. login to paypal and pay
    4. after returning to site it throws this error

    Works for onetime payment. Tried:
    1. Switched to wordpress default theme doesn’t work
    2. other PayPal plugin works, so I guess no issue from active theme code

    Plugin version: 1.1.7
    wordpress: 6.8.1
    WooCommerce Subscriptions: 7.6.0
    browser: chrome, mozilla
    operating system: Mac, windows
    server environment: linux

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Clayton R

    (@mrclayton)

    Hi @arjun1638

    Please provide a website link where this error can be replicated in Sandbox mode.

    Kind Regards

    Thread Starter Arjun Parab

    (@arjun1638)

    sure,
    1. visit https://testbe-25368.vasil-ams.servebolt.cloud/pouches/
    2. add product with subscription
    3. proceed to cart
    4. pay with PayPal

    Plugin Author Clayton R

    (@mrclayton)

    Hi @arjun1638

    The add to cart button does not work on the staging site. I observed the following JS error as well:

    Uncaught ReferenceError: us_to_eur_format is not defined
    at HTMLInputElement.<anonymous> (pouches/:2152:9)
    at ce.each (jquery.min.js?ver=3.7.1:2:3129)
    at e.<computed>.each (jquery.min.js?ver=3.7.1:2:1594)
    at String.<anonymous> (pouches/:2126:21)
    at ce.each (jquery.min.js?ver=3.7.1:2:3179)
    at section_data (pouches/:2120:11)
    at get_type_inter_rate (pouches/:1989:5)
    at init (pouches/:1839:3)
    at pouches/:2182:3
    at dispatch (jquery.min.js?ver=3.7.1:2:40035)

    Kind Regards

    Thread Starter Arjun Parab

    (@arjun1638)

    Ah yes. I switched to Twenty Twenty-Five theme and deactivated most of plugins.
    Can try it again ?

    https://testbe-25368.vasil-ams.servebolt.cloud/product/classic-bag-of-503g/?convert_to_sub_76835=6_week

    Plugin Author Clayton R

    (@mrclayton)

    Hi @arjun1638

    The reason that error is happening is because for some reason the shipping_address.recipient_name property is undefined when it should be. Can you enable the “Vault” option on the Advanced Settings page and test again?

    That should work for you.

    Kind Regards

    Plugin Author Clayton R

    (@mrclayton)

    @arjun1638 It seems like PayPal just recently changed the response structure of their billing agreement token so we will likely need to provide an update to account for that sudden change.

    I do recommend you use the new “Vault” feature however as that shouldn’t have this issue.

    Kind Regards,

    Thread Starter Arjun Parab

    (@arjun1638)

    Thanks for the suggestion, vault seem to resolve the issue for now. Looking forward to the update

    Plugin Author Clayton R

    (@mrclayton)

    Thanks for the suggestion, vault seem to resolve the issue for now.

    You should just use Vault going forward as that’s the preferred method. We only support the billing agreements feature for backwards compatibility but it’s been deprecated by PayPal.

    We’ve submitted a ticket to PayPal’s engineering team because up until today, the shipping_address.recipient_name property has always existed. Its absence is what’s causing the error you reported.

    Kind Regards

    • This reply was modified 11 months, 1 week ago by Clayton R.
    Thread Starter Arjun Parab

    (@arjun1638)

    Yes, we will enable it across other sites also, thanks

    Plugin Author Clayton R

    (@mrclayton)

    @arjun1638 We received a response from PayPal that this bug was introduced June 30th and they are working on a fix.

    Hi Payment Plugins,

    This is a known issue right now as PayPal made a change on June 30 that removed the recipient name from the response of several different APIs. It is also occurring in Production.

    I will get back to you with more information as it comes it. Thanks for your patience.

    Regards,

    So we will likely release something this evening to ensure the Javascript error does not occur until PayPal fixed the issue. In your case, since you have switched to using the Vault, you will be unaffected.

    Kind Regards,

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Error for the PayPal subscription’ is closed to new replies.