From 09044a5469900769ba80be24bc53e20ee6af6344 Mon Sep 17 00:00:00 2001 From: Rish Date: Mon, 28 Sep 2020 12:20:41 +0530 Subject: [PATCH] Added stripe checkout cancel notification no issue - Adds notification for stripe checkout flow notification for free and new members --- ghost/portal/src/components/Notification.js | 14 ++++++++++++++ ghost/portal/src/utils/notifications.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ghost/portal/src/components/Notification.js b/ghost/portal/src/components/Notification.js index 0414919799..25ddc17c0b 100644 --- a/ghost/portal/src/components/Notification.js +++ b/ghost/portal/src/components/Notification.js @@ -64,6 +64,20 @@ const NotificationText = ({type, status, context}) => { Success! Check your email for magic link to sign-in.

); + } else if (type === 'stripe:checkout' && status === 'warning') { + // Stripe checkout flow was cancelled + if (context.member) { + return ( +

+ Plan upgrade was cancelled. +

+ ); + } + return ( +

+ Plan checkout was cancelled. +

+ ); } return ( <> diff --git a/ghost/portal/src/utils/notifications.js b/ghost/portal/src/utils/notifications.js index 042253a9ed..b112926b26 100644 --- a/ghost/portal/src/utils/notifications.js +++ b/ghost/portal/src/utils/notifications.js @@ -11,7 +11,7 @@ export const handleAuthActions = ({qsParams, action, status}) => { return {}; }; -export const handleStripeActions = ({qsParams, status, billingOnly}) => { +export const handleStripeActions = ({status, billingOnly}) => { if (!billingOnly && ['cancel', 'success'].includes(status)) { const statusVal = status === 'success' ? 'success' : 'warning'; return {