• Resolved stevygee1987

    (@stevygee1987)


    Today, I got a report from a client that PayPal payment stopped working. The last successful payment using PayPal was 19 hours ago.

    The error notice: Cannot read properties of undefined (reading 'hasQueryArg')
    In the browser console on the product page, I’m getting Uncaught ReferenceError: paypal is not defined at l.value (class-product-gateway.js:71:26)

    WooCommerce version: 10.2.2
    Payment Plugin version: 1.1.14

    The page I need help with: [log in to see the link]

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

    (@mrclayton)

    Hi @stevygee1987

    Thank you for contacting Payment Plugins. You will notice that the last update of the plugin was released 3 weeks ago so you can rule the plugin out as being the cause of the issue.

    The error you’re describing is usually caused by a caching issue. The hasQueryArg function is a core WordPress function in the @wordpress/url library. I can see that the library is loading because it’s available at window.wp.url.hasQueryArg however it’s not available in your cached scripts.

    It appears that something in your cache settings has changed which is resulting in the observed behavior.

    Kind Regards

    Thread Starter stevygee1987

    (@stevygee1987)

    Thanks for taking a look!

    It was indeed a caching issue, or rather my WP Rocket settings. I’ve disabled “Delay JavaScript execution” completely and added the following lines to the exclusions for “Load JavaScript deferred”, which solved the issue:

    www.paypal.com
    wp-content/plugins/pymntpl-paypal-woocommerce/build/js/(.*).js
    wp-content/plugins/pymntpl-paypal-woocommerce/build/legacy/(.*).js

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

You must be logged in to reply to this topic.