• Hi there.
    Our customers are having issues with this plugin, when their transactions fail or they make a mistake in the form. After checkout form submit -> fail, the reCaptcha does not reset itself and on next checkout attempt it fails because reCaptcha can’t use the same validation twice.

    Is there a workaround for this issue? Maybe a javascript error listener to reset reCaptcha?

    We’re running latest version Woocommerce and reCaptcha Version 1.2.1

    Hope you can help! ??
    Kind regards, Jacob Thue.

Viewing 1 replies (of 1 total)
  • grecaptcha.reset(widget_id); will reset the captcha

    The widget_id value is optional, but recaptcha adds multiple into the source, so you need to grab the correct ID.

    Add this to your child theme’s javascript file:

    $( document.body ).on( 'checkout_error', function() {
    			var recaptcha_widget_id = $('.place-order #g-recaptcha-0').data("widget-id");
    		    grecaptcha.reset(recaptcha_widget_id);
    		});

    Hope this helps you out

    • This reply was modified 5 years, 1 month ago by spentpat.
Viewing 1 replies (of 1 total)
  • The topic ‘Reset solution on checkout fail/error?’ is closed to new replies.