File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
ReCaptchaCheckoutSalesRule/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -58,11 +58,20 @@ define(
5858 headers [ 'X-ReCaptcha' ] = xRecaptchaValue ;
5959 } ) ;
6060
61+ if ( self . getIsInvisibleRecaptcha ( ) ) {
62+ grecaptcha . execute ( widgetId ) ;
63+ self . validateReCaptcha ( true ) ;
64+ }
6165 //Refresh reCaptcha after failed request.
6266 setCouponCodeAction . registerFailCallback ( function ( ) {
63- self . validateReCaptcha ( false ) ;
64- grecaptcha . reset ( widgetId ) ;
65- $ ( '#' + captchaId ) . show ( ) ;
67+ if ( self . getIsInvisibleRecaptcha ( ) ) {
68+ grecaptcha . execute ( widgetId ) ;
69+ self . validateReCaptcha ( true ) ;
70+ } else {
71+ self . validateReCaptcha ( false ) ;
72+ grecaptcha . reset ( widgetId ) ;
73+ $ ( '#' + captchaId ) . show ( ) ;
74+ }
6675 } ) ;
6776 //Hide captcha when a coupon has been applied.
6877 setCouponCodeAction . registerSuccessCallback ( function ( ) {
You can’t perform that action at this time.
0 commit comments