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(
58
58
headers [ 'X-ReCaptcha' ] = xRecaptchaValue ;
59
59
} ) ;
60
60
61
+ if ( self . getIsInvisibleRecaptcha ( ) ) {
62
+ grecaptcha . execute ( widgetId ) ;
63
+ self . validateReCaptcha ( true ) ;
64
+ }
61
65
//Refresh reCaptcha after failed request.
62
66
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
+ }
66
75
} ) ;
67
76
//Hide captcha when a coupon has been applied.
68
77
setCouponCodeAction . registerSuccessCallback ( function ( ) {
You can’t perform that action at this time.
0 commit comments