From 426b9bc541b231b9a1ccd1937f7cf36174b080b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Costa?= Date: Thu, 12 Dec 2024 18:35:54 -0300 Subject: [PATCH 1/3] Make sure login confirmation dialog is shown for ECE in Blocks --- .../express-checkout/blocks/hooks/use-express-checkout.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/express-checkout/blocks/hooks/use-express-checkout.js b/client/express-checkout/blocks/hooks/use-express-checkout.js index 962f74e5876..e2d68bc6bce 100644 --- a/client/express-checkout/blocks/hooks/use-express-checkout.js +++ b/client/express-checkout/blocks/hooks/use-express-checkout.js @@ -8,6 +8,7 @@ import { useStripe, useElements } from '@stripe/react-stripe-js'; * Internal dependencies */ import { + displayLoginConfirmation, getExpressCheckoutButtonStyleSettings, getExpressCheckoutData, normalizeLineItems, @@ -52,6 +53,12 @@ export const useExpressCheckout = ( { const onButtonClick = useCallback( ( event ) => { + // If login is required for checkout, display redirect confirmation dialog. + if ( getExpressCheckoutData( 'login_confirmation' ) ) { + displayLoginConfirmation( event.expressPaymentType ); + return; + } + const options = { lineItems: normalizeLineItems( billing?.cartTotalItems ), emailRequired: true, From 053adc767721db5f14bd1506d7781e43d5a163de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Costa?= Date: Thu, 12 Dec 2024 18:36:24 -0300 Subject: [PATCH 2/3] Make sure login confirmation dialog is shown for tokenized ECE in Blocks --- .../blocks/hooks/use-express-checkout.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/tokenized-express-checkout/blocks/hooks/use-express-checkout.js b/client/tokenized-express-checkout/blocks/hooks/use-express-checkout.js index f33604354f7..afdcca3f6d2 100644 --- a/client/tokenized-express-checkout/blocks/hooks/use-express-checkout.js +++ b/client/tokenized-express-checkout/blocks/hooks/use-express-checkout.js @@ -8,6 +8,7 @@ import { useStripe, useElements } from '@stripe/react-stripe-js'; * Internal dependencies */ import { + displayLoginConfirmation, getExpressCheckoutButtonStyleSettings, getExpressCheckoutData, normalizeLineItems, @@ -52,6 +53,12 @@ export const useExpressCheckout = ( { const onButtonClick = useCallback( ( event ) => { + // If login is required for checkout, display redirect confirmation dialog. + if ( getExpressCheckoutData( 'login_confirmation' ) ) { + displayLoginConfirmation( event.expressPaymentType ); + return; + } + const options = { lineItems: normalizeLineItems( billing?.cartTotalItems ), emailRequired: true, From 85e7b16b9479dc03566d18b01c641ba1e4c192f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Costa?= Date: Thu, 12 Dec 2024 18:39:36 -0300 Subject: [PATCH 3/3] Add changelog entry --- changelog/fix-9806-ECE-subscription-checkout-signed-out | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/fix-9806-ECE-subscription-checkout-signed-out diff --git a/changelog/fix-9806-ECE-subscription-checkout-signed-out b/changelog/fix-9806-ECE-subscription-checkout-signed-out new file mode 100644 index 00000000000..fa25afd1f10 --- /dev/null +++ b/changelog/fix-9806-ECE-subscription-checkout-signed-out @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Ensure ECE login confirmation dialog is shown on Blocks.