Skip to content

Commit

Permalink
Merge pull request #581 from FatchipRobert/MAG2-331-Error-Processor
Browse files Browse the repository at this point in the history
MAG2-331 - Converted error processor fix
  • Loading branch information
janteuber authored Jan 7, 2025
2 parents 1df5943 + 5cab991 commit 302d452
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions view/frontend/web/js/model/error-processor-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ define(
targetModule.process = wrapper.wrap(targetModule.process, function (originalAction, response, messageContainer) {
var origReturn = originalAction(response, messageContainer);

if (response.responseJSON.hasOwnProperty('parameters') && response.responseJSON.parameters.hasOwnProperty('paymentMethodWhitelist') && response.responseJSON.parameters.paymentMethodWhitelist.length > 0) {
if (response.responseJSON && response.responseJSON.hasOwnProperty('parameters') && response.responseJSON.parameters.hasOwnProperty('paymentMethodWhitelist') && response.responseJSON.parameters.paymentMethodWhitelist.length > 0) {
$.each(methodList(), function( key, value ) {
if (response.responseJSON.parameters.paymentMethodWhitelist.includes(value.method) === false) {
targetModule.disablePaymentType(value.method);
}
});
}
if (response.status != 401) {
if (response.status != 401 && response.responseJSON && quote.paymentMethod()) {
if(response.responseJSON.message.indexOf('307 -') !== -1 && quote.paymentMethod().method.indexOf('payone_ratepay') !== -1) {
targetModule.disablePaymentType(quote.paymentMethod().method);
}
Expand All @@ -75,7 +75,7 @@ define(
targetModule.process = wrapper.wrap(targetModule.process, function (originalAction, response, messageContainer) {
var origReturn = originalAction(response, messageContainer);

if (response.status != 401) {
if (response.status != 401 && response.responseJSON) {
if(response.responseJSON.message.indexOf('351 -') !== -1) {
targetModule.disablePaymentType('payone_safe_invoice');
}
Expand Down

0 comments on commit 302d452

Please sign in to comment.