From 5cab9910a240ef8ba193806d66a87666bcce5102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Mon, 6 Jan 2025 16:45:52 +0100 Subject: [PATCH] MAG2-331 - Converted error processor fix #580 --- view/frontend/web/js/model/error-processor-mixin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/view/frontend/web/js/model/error-processor-mixin.js b/view/frontend/web/js/model/error-processor-mixin.js index ee0da8bf..5ccd8666 100644 --- a/view/frontend/web/js/model/error-processor-mixin.js +++ b/view/frontend/web/js/model/error-processor-mixin.js @@ -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); } @@ -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'); }