Skip to content

Commit 68c888f

Browse files
committed
fix(clerk-js): Avoid using needsPaymentMethod in CheckoutComplete step
1 parent 61422b2 commit 68c888f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Bug fix for Checkout success screen to not mention payment if a payment was not made.

packages/clerk-js/src/ui/components/Checkout/CheckoutComplete.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export const CheckoutComplete = () => {
331331
localizationKey={
332332
freeTrialEndsAt
333333
? localizationKeys('billing.checkout.title__trialSuccess')
334-
: needsPaymentMethod
334+
: totals.totalDueNow.amount > 0
335335
? localizationKeys('billing.checkout.title__paymentSuccessful')
336336
: localizationKeys('billing.checkout.title__subscriptionSuccessful')
337337
}
@@ -386,7 +386,7 @@ export const CheckoutComplete = () => {
386386
}),
387387
})}
388388
localizationKey={
389-
needsPaymentMethod
389+
totals.totalDueNow.amount > 0
390390
? localizationKeys('billing.checkout.description__paymentSuccessful')
391391
: localizationKeys('billing.checkout.description__subscriptionSuccessful')
392392
}
@@ -430,14 +430,14 @@ export const CheckoutComplete = () => {
430430
<LineItems.Group variant='secondary'>
431431
<LineItems.Title
432432
title={
433-
needsPaymentMethod
433+
totals.totalDueNow.amount > 0 || freeTrialEndsAt !== null
434434
? localizationKeys('billing.checkout.lineItems.title__paymentMethod')
435435
: localizationKeys('billing.checkout.lineItems.title__subscriptionBegins')
436436
}
437437
/>
438438
<LineItems.Description
439439
text={
440-
needsPaymentMethod
440+
totals.totalDueNow.amount > 0 || freeTrialEndsAt !== null
441441
? paymentMethod
442442
? paymentMethod.paymentType !== 'card'
443443
? `${capitalize(paymentMethod.paymentType)}`

0 commit comments

Comments
 (0)