From c8b1df21212e6665aaa698f4c1c139bed8d08adb Mon Sep 17 00:00:00 2001 From: Kara Armstrong Date: Wed, 20 Mar 2024 16:02:43 -0500 Subject: [PATCH] improved error handling when using paypal payment --- .../web/js/view/payment/method-renderer/bold-method.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/view/frontend/web/js/view/payment/method-renderer/bold-method.js b/view/frontend/web/js/view/payment/method-renderer/bold-method.js index 18b0af2..d2c7e6a 100644 --- a/view/frontend/web/js/view/payment/method-renderer/bold-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/bold-method.js @@ -102,9 +102,11 @@ if (!this.iframeWindow) { return false; } + + const clearAction = {actionType: 'PIGI_CLEAR_ERROR_MESSAGES'}; + this.iframeWindow.postMessage(clearAction, '*'); + if (!this.paymentType) { - const clearAction = {actionType: 'PIGI_CLEAR_ERROR_MESSAGES'}; - this.iframeWindow.postMessage(clearAction, '*'); this.refreshAndAddPayment(); return false; } @@ -189,7 +191,7 @@ break; case 'PIGI_ADD_PAYMENT': this.messageContainer.errorMessages([]); - loader.stopLoader(); + loader.stopLoader(true); if (!data.payload.success) { this.paymentType = null; return;