Skip to content

ReCaptcha validation failed, please try again. How to reset ReCaptcha in checkout?

I’m working with magento 2.4.3-p3 and I want to know to reset reCaptcha in checkout?
In general reCaptcha is working fine but the problems comes when PayPal payment fails and customer wants to try again or customer simply cancel payment and try again without refreshing page – then I’m getting error from module-re-captcha-webapi-rest/Plugin/RestValidationPlugin.php that “ReCaptcha validation failed, please try again”.
I see that in module-re-captcha-webapi-ui/view/frontend/web/js/jquery-mixin.js there are set headers settings.headers['X-ReCaptcha'] = payload.xReCaptchaValue; but after payment fails/cancels the value in payload.xReCaptchaValue is not refreshed. Any idea how to fix it?
Changing from V2 to V3 doesn’t fix the problem.