From 8e0b3479d7dd85ef46de548d17def5e8dfe25393 Mon Sep 17 00:00:00 2001 From: bj-anas <93322743+bj-anas@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:21:19 +0100 Subject: [PATCH] catch express checkout errors --- themes/aura/assets/express-checkout.js | 3 +++ themes/harmony/assets/express-checkout.js | 3 +++ themes/meraki/assets/express-checkout.js | 3 +++ 3 files changed, 9 insertions(+) diff --git a/themes/aura/assets/express-checkout.js b/themes/aura/assets/express-checkout.js index a2af7a7e..a208a157 100644 --- a/themes/aura/assets/express-checkout.js +++ b/themes/aura/assets/express-checkout.js @@ -54,6 +54,9 @@ async function placeOrder() { }) .onSkipPaymentStep((data, redirectToPaymentPage) => { redirectToPaymentPage(); + }) + .catch((data) => { + notify(data.detail, 'error'); }); } catch (e) { notify(e.message, 'error'); diff --git a/themes/harmony/assets/express-checkout.js b/themes/harmony/assets/express-checkout.js index a2af7a7e..a208a157 100644 --- a/themes/harmony/assets/express-checkout.js +++ b/themes/harmony/assets/express-checkout.js @@ -54,6 +54,9 @@ async function placeOrder() { }) .onSkipPaymentStep((data, redirectToPaymentPage) => { redirectToPaymentPage(); + }) + .catch((data) => { + notify(data.detail, 'error'); }); } catch (e) { notify(e.message, 'error'); diff --git a/themes/meraki/assets/express-checkout.js b/themes/meraki/assets/express-checkout.js index 3a0f1e17..c6ba424e 100644 --- a/themes/meraki/assets/express-checkout.js +++ b/themes/meraki/assets/express-checkout.js @@ -55,6 +55,9 @@ async function placeOrder() { }) .onSkipPaymentStep((data, redirectToPaymentPage) => { redirectToPaymentPage(); + }) + .catch((data) => { + notify(data.detail, 'error'); }); } catch (e) { notify(e.message, 'error');