Skip to content

Commit dabadac

Browse files
committed
MC-41572: Invalid Captcha when using Paypal PayflowPro
1 parent f104c89 commit dabadac

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed

app/code/Magento/PaypalCaptcha/view/frontend/requirejs-config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ var config = {
88
mixins: {
99
'Magento_Checkout/js/view/payment/list': {
1010
'Magento_PaypalCaptcha/js/view/payment/list-mixin': true
11+
},
12+
'Magento_Paypal/js/view/payment/method-renderer/payflowpro-method': {
13+
'Magento_PaypalCaptcha/js/view/payment/method-renderer/payflowpro-method-mixin': true
14+
},
15+
'Magento_Captcha/js/view/checkout/defaultCaptcha': {
16+
'Magento_PaypalCaptcha/js/view/checkout/defaultCaptcha-mixin': true
1117
}
1218
}
1319
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define(['ko'], function (ko) {
7+
'use strict';
8+
9+
return {
10+
skip: ko.observable(false)
11+
};
12+
});
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'Magento_PaypalCaptcha/js/model/skipRefreshCaptcha'
8+
], function (skipRefreshCaptcha) {
9+
'use strict';
10+
11+
var defaultCaptchaMixin = {
12+
/**
13+
* @override
14+
*/
15+
refresh: function () {
16+
if (!skipRefreshCaptcha.skip()) {
17+
this._super();
18+
} else {
19+
skipRefreshCaptcha.skip(false);
20+
}
21+
}
22+
};
23+
24+
return function (defaultCaptcha) {
25+
return defaultCaptcha.extend(defaultCaptchaMixin);
26+
};
27+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'Magento_PaypalCaptcha/js/model/skipRefreshCaptcha'
8+
], function (skipRefreshCaptcha) {
9+
'use strict';
10+
11+
var payflowProMethodMixin = {
12+
/**
13+
* @override
14+
*/
15+
placeOrder: function () {
16+
skipRefreshCaptcha.skip(true);
17+
this._super();
18+
},
19+
};
20+
21+
return function (payflowProMethod) {
22+
return payflowProMethod.extend(payflowProMethodMixin);
23+
};
24+
});

0 commit comments

Comments
 (0)