Hello @markisu72
What you’re seeing is usually related to the checkout state being refreshed between the initial page load and the first click on “Buy”. For example, if WC triggers an AJAX update (like shipping recalculation or totals refresh), the card fields can get re-rendered in the background, which resets their internal state. On the first click, this can result in a “card data not valid” message, even though the data itself is fine. On the second click, everything is already stabilized, so it goes through.
To analyze this further, I would recommend:
- Checking if a Woo checkout update is firing before the first click (this can happen silently in the background)
- In the browser Network tab, look for requests like
ppcp-validate-checkout or create-order on the first click – if that request fails (for example, due to a validation issue like postcode or required field), it can trigger a checkout refresh and reset the card fields
- Open the browser console and check for errors on the first failed click – there should be a
console.error from the PayPal SDK (CardFieldsRenderer or HostedFieldsRenderer). This will indicate whether it’s a “not ready yet” state or an actual validation rejection
This behavior is typically timing/state-related.
Kind Regards,
Krystian