File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
Payment/view/frontend/templates/transparent
PaypalCaptcha/view/frontend/web/js/view/payment Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ $params = $block->getParams();
40
40
$(parent).trigger('clearTimeout');
41
41
fullScreenLoader.stopLoader();
42
42
globalMessageList.addErrorMessage({
43
- message: $t(<?= /* @escapeNotVerified */ json_encode ($ params ['error_msg ' ])?> )
43
+ message: $t(<?= /* @noEscape */ json_encode ($ params ['error_msg ' ])?> )
44
44
});
45
45
}
46
46
);
Original file line number Diff line number Diff line change 3
3
* See COPYING.txt for license details.
4
4
*/
5
5
6
- define ( [ ] , function ( ) {
6
+ define ( [
7
+ 'jquery' ,
8
+ 'Magento_Captcha/js/model/captchaList'
9
+ ] , function ( $ , captchaList ) {
7
10
'use strict' ;
8
11
9
12
var mixin = {
13
+
14
+ formId : 'co-payment-form' ,
15
+
10
16
/**
11
17
* Sets custom template for Payflow Pro
12
18
*
@@ -17,11 +23,25 @@ define([], function () {
17
23
18
24
var component = this . _super ( payment ) ;
19
25
20
- if ( payment . method === 'payflowpro' ) {
26
+ if ( component . component === 'Magento_Paypal/js/view/payment/method-renderer/ payflowpro-method ' ) {
21
27
component . template = 'Magento_PaypalCaptcha/payment/payflowpro-form' ;
28
+ $ ( window ) . off ( 'clearTimeout' )
29
+ . on ( 'clearTimeout' , this . clearTimeout . bind ( this ) ) ;
22
30
}
23
31
24
32
return component ;
33
+ } ,
34
+
35
+ /**
36
+ * Overrides default window.clearTimeout() to catch errors from iframe and reload Captcha.
37
+ */
38
+ clearTimeout : function ( ) {
39
+ var captcha = captchaList . getCaptchaByFormId ( this . formId ) ;
40
+
41
+ if ( captcha !== null ) {
42
+ captcha . refresh ( ) ;
43
+ }
44
+ clearTimeout ( ) ;
25
45
}
26
46
} ;
27
47
You can’t perform that action at this time.
0 commit comments