Skip to content

Commit

Permalink
Merge pull request #80 from magento-cia/AC-3501
Browse files Browse the repository at this point in the history
Bugfixes
  • Loading branch information
dvoskoboinikov authored Jun 23, 2022
2 parents 0be532e + 9b90658 commit f4f658a
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,20 @@ define(
headers['X-ReCaptcha'] = xRecaptchaValue;
});

if (self.getIsInvisibleRecaptcha()) {
grecaptcha.execute(widgetId);
self.validateReCaptcha(true);
}
//Refresh reCaptcha after failed request.
setCouponCodeAction.registerFailCallback(function () {
self.validateReCaptcha(false);
grecaptcha.reset(widgetId);
$('#' + captchaId).show();
if (self.getIsInvisibleRecaptcha()) {
grecaptcha.execute(widgetId);
self.validateReCaptcha(true);
} else {
self.validateReCaptcha(false);
grecaptcha.reset(widgetId);
$('#' + captchaId).show();
}
});
//Hide captcha when a coupon has been applied.
setCouponCodeAction.registerSuccessCallback(function () {
Expand Down

0 comments on commit f4f658a

Please sign in to comment.