Commit 6eca57b5 authored by Daniel Kazior's avatar Daniel Kazior 💰
Browse files

Merge branch 'bug/invalidToken' into 'master'

invalid token bugfix

See merge request !10
parents 9895a26f 32e46b20
......@@ -3,15 +3,16 @@
define([
'jquery',
'mage/utils/wrapper',
'Trilix_CrefoPay/js/view/payment/adapter'
], function ($, wrapper, adapter) {
'Trilix_CrefoPay/js/view/payment/adapter',
'Magento_Checkout/js/model/step-navigator'
], function($, wrapper, adapter, stepNavigator) {
'use strict';
return function (targetModule) {
return function(targetModule) {
var func = targetModule.setPaymentMethods;
var setPaymentMethodsWrapper = wrapper.wrap(func, function (original) {
var setPaymentMethodsWrapper = wrapper.wrap(func, function(original) {
// check if module is enabled
if (window.checkoutConfig.payment['crefopay_bill'].isActive) {
if (window.checkoutConfig.payment['crefopay_bill'].isActive && stepNavigator.isProcessed('shipping') === false) {
adapter.initialize();
}
original();
......@@ -20,4 +21,4 @@ define([
targetModule.setPaymentMethods = setPaymentMethodsWrapper;
return targetModule;
};
});
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment