• Resolved nihalkumar

    (@nihalkumar)


    Hello. I’m using “WooCommerce” & “WooCommerce PayPal Payments” plugins.

    When someone selects a product variation and clicks on the PayPal button, this error is shown:
    “Something went wrong. Please try again or choose another payment source.”

    I have enabled logging. So, in the WooCommerce > Status > Logs section, this error is shown:
    “ERROR Cart updating failed: Could not validate nonce.”

    Please help me. I need to fix it quickly.

    Thanks in advance ??
    Nihal.

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @nihalkumar,

    Nonce validation issues could be caused by various things, including potential plugin conflicts.
    You may want to perform a full conflict test to rule out eventual issues with the theme or a different plugin. We recommend temporarily activating the default theme Storefront and disabling all other plugins except for?WooCommerce and?PayPal Payments to see if the behavior persists.

    Here’s a guide that explains the steps in more detail:
    How to test for conflicts
    Please let us know how it works for you in the minimum configuration.
    Thanks!

    Kind regards,
    Niklas

    Thread Starter nihalkumar

    (@nihalkumar)

    Hi Niklas.

    This is what I did:
    1. I first created a backup of the whole website.
    2. Deactivated all themes & plugins (installed Storefront theme).
    3. Problem resolved.
    4. I started activating the theme & plugins one by one (to find the culprit).
    5. I activated all of them, but the error didn’t show again.
    6. I restored the website from the backup (to restore the error).
    7. But, to my surprise, the error didn’t show again.

    NOTE: This error always appears & disappears by itself. Whenever the error appears, I do something to remove the error & the error vanishes. But, it appears again after a day or two.

    Thank you.

    Best regards,
    Nihal.

    Thread Starter nihalkumar

    (@nihalkumar)

    Any update on the problem?

    One additional observation:
    1. It again started to show the error.
    2. When I purged the cache of the WordPress website, the error stopped again.

    Why?

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @nihalkumar,

    Thanks for testing.

    This issue could potentially be related to caching or other site optimization measures.
    Usually, caching is disabled on the Cart and Checkout pages by default, and on these pages, the button appears to be working correctly.
    The single-product pages may need to be manually excluded from caching. You could try to exclude the button script from eventual on-site optimizations, but I’m not sure if that would be enough as the cache can affect more than just the button JS: https://woocommerce.com/document/woocommerce-paypal-payments/#faq-paypal-smart-buttons-not-loading

    Ideally, there should be no caching at all on pages where the dynamic smart buttons are loaded. So another possible way to work around it would be to disable the caching on the single product page.
    I hope this helps!

    Kind regards,
    Niklas

    Plugin Support Femi

    (@femiyb)

    Hi

    We have not heard back from you in a while, so I’m marking this thread as resolved.
    Hopefully, you were able to proceed as advised above.
    If you have any further questions, please feel free to reopen this topic or create a new one.

    Cheers! ??

    Thread Starter nihalkumar

    (@nihalkumar)

    Hi. The PayPal button is working perfectly on the cart page. So, I have disabled the button from the individual product page. I have no problem removing the button from the individual product page.

    Is this solution perfect? Will the button work perfectly in the future (on the cart page)?

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @nihalkumar,

    If the button doesn’t work correctly on your single product page, then disabling it there would be one way to prevent potential errors. But I think the better solution is to find out what’s causing the problem so we can find and resolve the issue for you. At least if you are interested in using the buttons.

    It sound quite like the error is caching related. Have you tried disabling the cache on all pages where the smart buttons would be loaded like the start page and also the single-product pages? Or alternatively, is there a way for you to whitelist the button scripts as mentioned here?
    Thanks!

    Kind regards,
    Niklas

    Thread Starter nihalkumar

    (@nihalkumar)

    You: Or alternatively, is there a way for you to whitelist the button scripts as mentioned here?

    Me: It didn’t work.

    You: Have you tried disabling the cache on all pages where the smart buttons would be loaded like the start page and also the single-product pages?

    Me: I think this is the only option left now. Right? Is there any other solution?

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @nihalkumar,

    Caching can impact the functionality of dynamic payment buttons (that is part of why caching is generally disabled by default on Cart and Checkout pages), so it is recommended to avoid caching on any pages where the smart buttons would be loaded.
    If whitelisting the button scripts does not help resolve the error, then I’m afraid the only remaining option is to choose between caching the start and single product pages and displaying the buttons.

    Kind regards,
    Niklas

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Beyond the recommendation above, there is not much more we could do for the time being.
    Since we haven’t heard back in a while, I’ll mark this thread resolved.
    If you have any further questions, please feel free to reopen this topic or create a new one.

    Thank you! ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘WooCommerce PayPal Payments is not working!’ is closed to new replies.