We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 0a0532e1 authored by cyattilakiss's avatar cyattilakiss Committed by GitHub

Merge pull request #450 from Adyen/bug/PW-1330-log-on-error

[PW-1330] only log onError as onComplete will always be executed
parents bab015da 1f07206e
...@@ -37,10 +37,9 @@ define( ...@@ -37,10 +37,9 @@ define(
'Magento_Paypal/js/action/set-payment-method', 'Magento_Paypal/js/action/set-payment-method',
'Magento_Checkout/js/action/select-payment-method', 'Magento_Checkout/js/action/select-payment-method',
'Adyen_Payment/js/threeds2-js-utils', 'Adyen_Payment/js/threeds2-js-utils',
'Adyen_Payment/js/model/threeds2', 'Adyen_Payment/js/model/threeds2'
'mage/translate'
], ],
function ($, ko, Component, customer, creditCardData, additionalValidators, quote, installments, url, VaultEnabler, urlBuilder, storage, fullScreenLoader, setPaymentMethodAction, selectPaymentMethodAction, threeDS2Utils, threeds2, $t) { function ($, ko, Component, customer, creditCardData, additionalValidators, quote, installments, url, VaultEnabler, urlBuilder, storage, fullScreenLoader, setPaymentMethodAction, selectPaymentMethodAction, threeDS2Utils, threeds2) {
'use strict'; 'use strict';
...@@ -220,15 +219,12 @@ define( ...@@ -220,15 +219,12 @@ define(
threeds2.processThreeDS2(result.data).done(function (responseJSON) { threeds2.processThreeDS2(result.data).done(function (responseJSON) {
self.validateThreeDS2OrPlaceOrder(responseJSON) self.validateThreeDS2OrPlaceOrder(responseJSON)
}).error(function () { }).error(function () {
fullScreenLoader.stopLoader();
});
},
onError: function () {
self.isPlaceOrderActionAllowed(true); self.isPlaceOrderActionAllowed(true);
fullScreenLoader.stopLoader(); fullScreenLoader.stopLoader();
this.messageContainer.addErrorMessage({
message: $t('Something went wrong. Please try again.')
}); });
},
onError: function (error) {
console.log(JSON.stringify(error));
} }
}); });
...@@ -259,16 +255,12 @@ define( ...@@ -259,16 +255,12 @@ define(
self.validateThreeDS2OrPlaceOrder(responseJSON); self.validateThreeDS2OrPlaceOrder(responseJSON);
}).error(function () { }).error(function () {
popupModal.modal("closeModal"); popupModal.modal("closeModal");
self.isPlaceOrderActionAllowed(true);
fullScreenLoader.stopLoader(); fullScreenLoader.stopLoader();
}); });
}, },
onError: function () { onError: function (error) {
fullScreenLoader.stopLoader(); console.log(JSON.stringify(error));
self.isPlaceOrderActionAllowed(true);
this.messageContainer.addErrorMessage({
message: $t('Something went wrong. Please try again.')
});
} }
}); });
self.threeDS2ChallengeComponent.mount(threeDS2Node); self.threeDS2ChallengeComponent.mount(threeDS2Node);
......
...@@ -39,10 +39,9 @@ define( ...@@ -39,10 +39,9 @@ define(
'Magento_Checkout/js/model/url-builder', 'Magento_Checkout/js/model/url-builder',
'mage/storage', 'mage/storage',
'Magento_Checkout/js/action/place-order', 'Magento_Checkout/js/action/place-order',
'Adyen_Payment/js/model/threeds2', 'Adyen_Payment/js/model/threeds2'
'mage/translate'
], ],
function (ko, _, $, Component, selectPaymentMethodAction, additionalValidators, quote, checkoutData, redirectOnSuccessAction, layout, Messages, url, threeDS2Utils, fullScreenLoader, setPaymentMethodAction, urlBuilder, storage, placeOrderAction, threeds2, $t) { function (ko, _, $, Component, selectPaymentMethodAction, additionalValidators, quote, checkoutData, redirectOnSuccessAction, layout, Messages, url, threeDS2Utils, fullScreenLoader, setPaymentMethodAction, urlBuilder, storage, placeOrderAction, threeds2) {
'use strict'; 'use strict';
...@@ -358,15 +357,12 @@ define( ...@@ -358,15 +357,12 @@ define(
threeds2.processThreeDS2(result.data).done(function (responseJSON) { threeds2.processThreeDS2(result.data).done(function (responseJSON) {
self.validateThreeDS2OrPlaceOrder(responseJSON) self.validateThreeDS2OrPlaceOrder(responseJSON)
}).error(function () { }).error(function () {
self.isPlaceOrderActionAllowed(true);
fullScreenLoader.stopLoader(); fullScreenLoader.stopLoader();
}); });
}, },
onError: function () { onError: function (error) {
fullScreenLoader.stopLoader(); console.log(JSON.stringify(error));
self.isPlaceOrderActionAllowed(true);
self.getMessageContainer().addErrorMessage({
message: $t('Something went wrong. Please try again.')
});
} }
}); });
} else if (type == "ChallengeShopper") { } else if (type == "ChallengeShopper") {
...@@ -392,15 +388,12 @@ define( ...@@ -392,15 +388,12 @@ define(
threeds2.processThreeDS2(result.data).done(function (responseJSON) { threeds2.processThreeDS2(result.data).done(function (responseJSON) {
self.validateThreeDS2OrPlaceOrder(responseJSON) self.validateThreeDS2OrPlaceOrder(responseJSON)
}).error(function () { }).error(function () {
self.isPlaceOrderActionAllowed(true);
fullScreenLoader.stopLoader(); fullScreenLoader.stopLoader();
}); });
}, },
onError: function () { onError: function (error) {
fullScreenLoader.stopLoader(); console.log(JSON.stringify(error));
self.isPlaceOrderActionAllowed(true);
self.getMessageContainer().addErrorMessage({
message: $t('Something went wrong. Please try again.')
});
} }
}); });
} }
......
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