Skip to content

Commit 9f5241c

Browse files
AC-2338::Captcha refreshes when Payment Method is changed(when checkout Captcha is set to OFF)
1 parent 49bd706 commit 9f5241c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/checkout/placeOrderCaptcha.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ function (defaultCaptcha, captchaList, _, placeOrderHooks) {
2020

2121
this._super();
2222
currentCaptcha = captchaList.getCaptchaByFormId(this.formId);
23-
2423
if (currentCaptcha != null) {
2524
currentCaptcha.setIsVisible(true);
2625
this.setCurrentCaptcha(currentCaptcha);
@@ -29,9 +28,11 @@ function (defaultCaptcha, captchaList, _, placeOrderHooks) {
2928
headers['X-Captcha'] = self.captchaValue()();
3029
}
3130
});
32-
placeOrderHooks.afterRequestListeners.push(function () {
33-
self.refresh();
34-
});
31+
if (self.isRequired()) {
32+
placeOrderHooks.afterRequestListeners.push(function () {
33+
self.refresh();
34+
});
35+
}
3536
}
3637
}
3738
});

0 commit comments

Comments
 (0)