• Gallagher Website Design

    (@gallagherwebsitedesign)


    Hi, we’re getting an error Payment nonce is missing” on checkout.

    I’ve had Square look into this and they said the issue is something on the plugin side.

    I’ve tried clearing cache, turning cache off, logged in, logged out, reconnecting square to Woo, disabled all other plugins, etc.

    I don’t see any fetal errors or square errors in WooCommerce → Status → Logs

    I also see in the browser console there are a few errors:

    pci-connect.squareup.com/v2/analytics/verifications:1
    Failed to load resource: the server responded with a status of 400 ()

    square.js?ver=5.4.0:3 Square
    Square Error: Error getting payment data
    Error: Error getting payment data(anonymous)@square.js?ver=5.4.0:3

    It may be related to our hosting and cache. We’re testing this on Rocket .net who uses Cloudflare.

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @gallagherwebsitedesign,

    Sorry to hear you’ve already gone through that much testing. The “Payment nonce is missing” error usually means the Square payment token isn’t being generated or passed back to WooCommerce during checkout.

    Since you’ve already tested with other plugins disabled and reconnected Square, the Cloudflare/Rocket.net caching layer is a good place to check next. Please make sure the checkout/cart/account pages and WooCommerce AJAX/API requests are fully excluded from caching, optimization, Rocket Loader, delay/defer JS, and any Cloudflare security rules.

    Could you also share your System Status Report? You can find it under WooCommerce → Status → Get system report, then paste it at https://pastebin.com and share the link here.

    Also, please confirm whether you’re using the classic shortcode checkout or the Checkout block. 🙂

    Thread Starter Gallagher Website Design

    (@gallagherwebsitedesign)

    Hi, thank you for the quick reply.

    I’m not sure we can change anything with cache or cloudflare settings with Rocket .net. Do you know?

    Here is the System Status Report:
    https://pastebin.com/st1NBgYg

    We’re using the classic shortcode.

    Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @gallagherwebsitedesign,

    Thanks for the update!

    I was able to replicate the issue on your checkout: https://share.zight.com/P8u4x8m0. Looking at the browser console, the error is coming from Square’s buyer verification endpoint. Square is returning a 400 Bad Request from pci-connect.squareup.com/v2/analytics/verifications before a payment nonce is ever returned, which is what causes the “Error getting payment data” message.

    This points to either a credentials mismatch in your Square plugin settings (Application ID or Location ID not matching your Square account environment) or Square’s verification request being blocked by a Content Security Policy on your site. There are several CSP violations visible in the console related to Square’s scripts and iframes.

    Before we dig further, could you please check your WooCommerce Square logs? Go to WooCommerce → Status → Logs, filter by woocommerce-square, and share the most recent entries here, paste them at pastebin.com and share the link. The log will show us the actual response Square is sending back and confirm whether this is a credentials issue or something else.

    Also worth confirming: are your Square Application ID and Location ID in WooCommerce → Settings → Payments → Square → Configure set to your live credentials (not sandbox)? A sandbox/live mismatch is a common cause of that 400 error.

    I’m not sure we can change anything with cache or cloudflare settings with Rocket .net. Do you know?

    You can’t control Cloudflare WAF rules directly on Rocket.net, but you can manage caching through their dashboard. Make sure your checkout page is excluded from caching. But I think we should focus on the smoking gun and not the cache for now.

    Looking forward to your response.

    Thread Starter Gallagher Website Design

    (@gallagherwebsitedesign)

    Ok, thank you for looking over that.

    Here is the log. I didn’t see much there as an issue, but let me know.
    https://pastebin.com/ef1BTmWY

    I’ve previously checked the credentials and reentered them multiple times. That doesn’t seem to be the issue.

    And we’re set to live in WooCommerce → Settings → Payments → Square → Configure.

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi @gallagherwebsitedesign !

    Thank you for sharing the error log. I have reviewed it and can see that the checkout process is successfully initiated, and the Square gateway is being triggered correctly via wc_ajax_square_checkout_handler.

    However, the log does not show a successful response from Square after this step, which suggests the issue is occurring during Square’s payment initialization or verification phase rather than within WooCommerce checkout itself.

    Upon further investigation, I can see in the network tab that the verification request is failing with the following error:

    verification_details.billing_contact.country: "" is not a valid enum value

    I can also see that during checkout the billing country field is not appearing, and after placing the test order the country value is being sent as empty, as shown in this screenshot:
    https://go.screenpal.com/watch/cO1oImnuAhC

    Could you please confirm whether the country field has been intentionally disabled in the checkout? Are you using any custom code or a plugin to hide or modify the country field?

    Once we have more information, we’ll be able to assist you further accordingly.

    Thread Starter Gallagher Website Design

    (@gallagherwebsitedesign)

    Hi, thank you for tracking that down.

    After reviewing, I found someone installed a plugin that was modifying the checkout page fields, which removed the country field. I’ve re-enabled the country field and it now seems to be working.

    Thank you for your help tracking this down!

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi @gallagherwebsitedesign!

    Great to hear everything’s working perfectly now! If you’re happy with the support you received, would you consider leaving us a quick review? It really helps us out: https://wordpress.org/support/plugin/woocommerce-square/reviews/#new-post

    Thank you for your cooperation.

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

You must be logged in to reply to this topic.