Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 469
chore(clerk-js,types): Switch to fees for plan prices#6490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
d7daf9653d1c866975c4969c583c0100be0360986c171100a0bb68726a0d739dbe18053dd40eb22841e65377039File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@clerk/clerk-js': minor | ||
| '@clerk/types': minor | ||
| --- | ||
| [Billing Beta] Replace usage of top level amounts in plan with fees for displaying prices. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||||||||||||||||
| import { __experimental_useCheckout as useCheckout, useOrganization } from '@clerk/shared/react'; | ||||||||||||||||||||
| import type { CommerceMoney, CommercePaymentSourceResource, ConfirmCheckoutParams } from '@clerk/types'; | ||||||||||||||||||||
| import type { CommerceMoneyAmount, CommercePaymentSourceResource, ConfirmCheckoutParams } from '@clerk/types'; | ||||||||||||||||||||
| import { useMemo, useState } from 'react'; | ||||||||||||||||||||
| import { Card } from '@/ui/elements/Card'; | ||||||||||||||||||||
| @@ -35,6 +35,8 @@ export const CheckoutForm = withCardStateProvider(() => { | ||||||||||||||||||||
| const showPastDue = !!totals.pastDue?.amount && totals.pastDue.amount > 0; | ||||||||||||||||||||
| const showDowngradeInfo = !isImmediatePlanChange; | ||||||||||||||||||||
| const fee = planPeriod === 'month' ? plan.fee : plan.annualMonthlyFee; | ||||||||||||||||||||
| return ( | ||||||||||||||||||||
| <Drawer.Body> | ||||||||||||||||||||
| <Box | ||||||||||||||||||||
| @@ -54,7 +56,7 @@ export const CheckoutForm = withCardStateProvider(() => { | ||||||||||||||||||||
| /> | ||||||||||||||||||||
| <LineItems.Description | ||||||||||||||||||||
| prefix={planPeriod === 'annual' ? 'x12' : undefined} | ||||||||||||||||||||
| text={`${plan.currencySymbol}${planPeriod === 'month' ? plan.amountFormatted : plan.annualMonthlyAmountFormatted}`} | ||||||||||||||||||||
| text={`${fee.currencySymbol}${fee.amountFormatted}`} | ||||||||||||||||||||
| suffix={localizationKeys('commerce.checkout.perMonth')} | ||||||||||||||||||||
| /> | ||||||||||||||||||||
Comment on lines
58
to
61
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Localize hard-coded 'x12' multiplier All user-facing strings must be localized. Replace - prefix={planPeriod === 'annual' ? 'x12' : undefined}+ prefix={planPeriod === 'annual' ? localizationKeys('commerce.checkout.x12') : undefined}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents | ||||||||||||||||||||
| </LineItems.Group> | ||||||||||||||||||||
| @@ -312,7 +314,7 @@ const ExistingPaymentSourceForm = withCardStateProvider( | ||||||||||||||||||||
| totalDueNow, | ||||||||||||||||||||
| paymentSources, | ||||||||||||||||||||
| }: { | ||||||||||||||||||||
| totalDueNow: CommerceMoney; | ||||||||||||||||||||
| totalDueNow: CommerceMoneyAmount; | ||||||||||||||||||||
| paymentSources: CommercePaymentSourceResource[]; | ||||||||||||||||||||
| }) => { | ||||||||||||||||||||
| const { checkout } = useCheckout(); | ||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.