diff --git a/apps/payments/next/app/[locale]/[offeringId]/[interval]/checkout/[cartId]/success/page.tsx b/apps/payments/next/app/[locale]/[offeringId]/[interval]/checkout/[cartId]/success/page.tsx index 456c158da6c..763ac4098e1 100644 --- a/apps/payments/next/app/[locale]/[offeringId]/[interval]/checkout/[cartId]/success/page.tsx +++ b/apps/payments/next/app/[locale]/[offeringId]/[interval]/checkout/[cartId]/success/page.tsx @@ -6,6 +6,8 @@ import type { Metadata } from 'next'; import { headers } from 'next/headers'; import Image from 'next/image'; import { auth } from 'apps/payments/next/auth'; + +import { SubPlatPaymentMethodType } from '@fxa/payments/customer'; import { getCardIcon } from '@fxa/payments/ui'; import { fetchCMSData, @@ -140,47 +142,23 @@ export default async function CheckoutSuccess({ cart.latestInvoicePreview?.currency, locale )} - {cart.paymentInfo.walletType === 'apple_pay' ? ( + {cart.paymentInfo.walletType ? (
{l10n.getString('apple-pay-logo-alt-text',
- ) : cart.paymentInfo.walletType === 'google_pay' ? ( -
+ ) : cart.paymentInfo.type === SubPlatPaymentMethodType.Card && + cart.paymentInfo.brand ? ( + {l10n.getString('google-pay-logo-alt-text', -
- ) : cart.paymentInfo.type === 'external_paypal' ? ( - {l10n.getString('paypal-logo-alt-text', - ) : cart.paymentInfo.type === 'link' ? ( - {l10n.getString('link-logo-alt-text', - ) : ( - - {cart.paymentInfo.brand && ( - {getCardIcon(cart.paymentInfo.brand, - )} {l10n.getString( 'next-payment-confirmation-cc-card-ending-in', { @@ -189,6 +167,15 @@ export default async function CheckoutSuccess({ `Card ending in ${cart.paymentInfo.last4}` )} + ) : ( +
+ {getCardIcon(cart.paymentInfo.type, +
)} diff --git a/apps/payments/next/app/[locale]/[offeringId]/[interval]/upgrade/[cartId]/(mainLayout)/success/page.tsx b/apps/payments/next/app/[locale]/[offeringId]/[interval]/upgrade/[cartId]/(mainLayout)/success/page.tsx index a1b17116c63..bb9fdb4a6db 100644 --- a/apps/payments/next/app/[locale]/[offeringId]/[interval]/upgrade/[cartId]/(mainLayout)/success/page.tsx +++ b/apps/payments/next/app/[locale]/[offeringId]/[interval]/upgrade/[cartId]/(mainLayout)/success/page.tsx @@ -3,20 +3,22 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import { headers } from 'next/headers'; +import Image from 'next/image'; +import { Metadata } from 'next'; import { auth } from 'apps/payments/next/auth'; + +import { SubPlatPaymentMethodType } from '@fxa/payments/customer'; import { getCardIcon } from '@fxa/payments/ui'; import { + fetchCMSData, + getCartOrRedirectAction, +} from '@fxa/payments/ui/actions'; +import { + CheckoutParams, SupportedPages, getApp, buildPageMetadata, } from '@fxa/payments/ui/server'; -import { - fetchCMSData, - getCartOrRedirectAction, -} from '@fxa/payments/ui/actions'; -import { CheckoutParams } from '@fxa/payments/ui/server'; -import Image from 'next/image'; -import { Metadata } from 'next'; import { config } from 'apps/payments/next/config'; export const dynamic = 'force-dynamic'; @@ -141,39 +143,17 @@ export default async function UpgradeSuccess({ cart.latestInvoicePreview?.currency, locale )} - {cart.paymentInfo.walletType === 'apple_pay' ? ( -
- {l10n.getString('apple-pay-logo-alt-text', -
- ) : cart.paymentInfo.walletType === 'google_pay' ? ( + {cart.paymentInfo.walletType ? (
{l10n.getString('google-pay-logo-alt-text',
- ) : cart.paymentInfo.type === 'external_paypal' ? ( - {l10n.getString('paypal-logo-alt-text', - ) : cart.paymentInfo.type === 'link' ? ( - {l10n.getString('link-logo-alt-text', - ) : ( + ) : cart.paymentInfo.type === SubPlatPaymentMethodType.Card && + cart.paymentInfo.brand ? ( {cart.paymentInfo.brand && ( + ) : ( +
+ {getCardIcon(cart.paymentInfo.type, +
)} diff --git a/apps/payments/next/app/[locale]/[offeringId]/[interval]/upgrade/[cartId]/(startLayout)/start/page.tsx b/apps/payments/next/app/[locale]/[offeringId]/[interval]/upgrade/[cartId]/(startLayout)/start/page.tsx index 54aea3e717e..92cba2fba27 100644 --- a/apps/payments/next/app/[locale]/[offeringId]/[interval]/upgrade/[cartId]/(startLayout)/start/page.tsx +++ b/apps/payments/next/app/[locale]/[offeringId]/[interval]/upgrade/[cartId]/(startLayout)/start/page.tsx @@ -4,6 +4,8 @@ import { headers } from 'next/headers'; import Image from 'next/image'; + +import { SubPlatPaymentMethodType } from '@fxa/payments/customer'; import { getCardIcon, PaymentSection } from '@fxa/payments/ui'; import { fetchCMSData, @@ -90,39 +92,17 @@ export default async function Upgrade({ {cart.paymentInfo && (
- {cart.paymentInfo.walletType === 'apple_pay' ? ( -
- {l10n.getString('apple-pay-logo-alt-text', -
- ) : cart.paymentInfo.walletType === 'google_pay' ? ( + {cart.paymentInfo.walletType ? (
{l10n.getString('google-pay-logo-alt-text',
- ) : cart.paymentInfo.type === 'external_paypal' ? ( - {l10n.getString('paypal-logo-alt-text', - ) : cart.paymentInfo.type === 'link' ? ( - {l10n.getString('link-logo-alt-text', - ) : ( + ) : cart.paymentInfo.type === SubPlatPaymentMethodType.Card && + cart.paymentInfo.brand ? ( {cart.paymentInfo.brand && ( + ) : ( +
+ {getCardIcon(cart.paymentInfo.type, +
)}
)}