Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/shaky-seas-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@clerk/localizations': patch
'@clerk/clerk-js': patch
'@clerk/types': patch
---

Add "Past Due" amount on checkout flow when applicable
2 changes: 1 addition & 1 deletion packages/clerk-js/bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{ "path": "./dist/waitlist*.js", "maxSize": "1.3KB" },
{ "path": "./dist/keylessPrompt*.js", "maxSize": "6.5KB" },
{ "path": "./dist/pricingTable*.js", "maxSize": "4.02KB" },
{ "path": "./dist/checkout*.js", "maxSize": "6.52KB" },
{ "path": "./dist/checkout*.js", "maxSize": "6.65KB" },
{ "path": "./dist/paymentSources*.js", "maxSize": "9.06KB" },
{ "path": "./dist/up-billing-page*.js", "maxSize": "3.0KB" },
{ "path": "./dist/op-billing-page*.js", "maxSize": "3.0KB" },
Expand Down
7 changes: 7 additions & 0 deletions packages/clerk-js/src/ui/components/Checkout/CheckoutForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const CheckoutForm = ({
}) => {
const { plan, planPeriod, totals, isImmediatePlanChange } = checkout;
const showCredits = !!totals.credit?.amount && totals.credit.amount > 0;
const showPastDue = !!totals.pastDue?.amount && totals.pastDue.amount > 0;
const showDowngradeInfo = !isImmediatePlanChange;

return (
Expand Down Expand Up @@ -69,6 +70,12 @@ export const CheckoutForm = ({
<LineItems.Description text={`- ${totals.credit?.currencySymbol}${totals.credit?.amountFormatted}`} />
</LineItems.Group>
)}
{showPastDue && (
<LineItems.Group variant='tertiary'>
<LineItems.Title title={localizationKeys('commerce.pastDue')} />
<LineItems.Description text={`${totals.pastDue?.currencySymbol}${totals.pastDue?.amountFormatted}`} />
</LineItems.Group>
)}
<LineItems.Group borderTop>
<LineItems.Title title={localizationKeys('commerce.totalDueToday')} />
<LineItems.Description text={`${totals.totalDueNow.currencySymbol}${totals.totalDueNow.amountFormatted}`} />
Expand Down
4 changes: 4 additions & 0 deletions packages/clerk-js/src/utils/commerce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export const commerceTotalsFromJSON = <T extends CommerceStatementTotalsJSON | C
// @ts-ignore
totals['credit'] = commerceMoneyFromJSON(data.credit);
}
if ('past_due' in data) {
// @ts-ignore
totals['pastDue'] = commerceMoneyFromJSON(data.past_due);
}

return totals as T extends { total_due_now: CommerceMoneyJSON } ? CommerceCheckoutTotals : CommerceStatementTotals;
};
2 changes: 2 additions & 0 deletions packages/localizations/src/ar-SA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const arSA: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const arSA: LocalizationResource = {
sameDay: "اليوم في {{ date | timeString('en-US') }}",
},
dividerText: 'أو',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'أختر طريقة أخرى',
footerPageLink__help: 'المساعدة',
footerPageLink__privacy: 'الخصوصية',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/be-BY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const beBY: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const beBY: LocalizationResource = {
sameDay: "Сёння ў {{ date | timeString('be-BY') }}",
},
dividerText: 'ці',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Выкарыстаць іншы метад',
footerPageLink__help: 'Дапамога',
footerPageLink__privacy: 'Приватнасць',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/bg-BG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const bgBG: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const bgBG: LocalizationResource = {
sameDay: "Днес в {{ date | timeString('bg-BG') }}",
},
dividerText: 'или',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Използвайте друг метод',
footerPageLink__help: 'Помощ',
footerPageLink__privacy: 'Поверителност',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/ca-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const caES: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const caES: LocalizationResource = {
sameDay: "Avui a les {{ date | timeString('en-US') }}",
},
dividerText: 'o',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Utilitza un altre mètode',
footerPageLink__help: 'Ajuda',
footerPageLink__privacy: 'Privacitat',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const csCZ: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const csCZ: LocalizationResource = {
sameDay: "Dnes v {{ date | timeString('cs-CZ') }}",
},
dividerText: 'nebo',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Použít jinou metodu',
footerPageLink__help: 'Nápověda',
footerPageLink__privacy: 'Ochrana soukromí',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/da-DK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const daDK: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const daDK: LocalizationResource = {
sameDay: "I dag: {{ date | timeString('en-US') }}",
},
dividerText: 'eller',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Brug en anden metode',
footerPageLink__help: 'Hjælp',
footerPageLink__privacy: 'Privatliv',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const deDE: LocalizationResource = {
manageSubscription: 'Mitgliedschaft verwalten',
month: 'Monat',
monthly: 'Monatlich',
pastDue: undefined,
pay: '{{amount}} bezahlen',
paymentMethods: 'Zahlungsmethoden',
paymentSource: {
Expand Down Expand Up @@ -122,6 +123,7 @@ export const deDE: LocalizationResource = {
sameDay: "Heute um {{ date | timeString('de-DE') }}",
},
dividerText: 'oder',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Verwenden Sie eine andere Methode',
footerPageLink__help: 'Hilfe',
footerPageLink__privacy: 'Privatsphäre',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/el-GR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const elGR: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const elGR: LocalizationResource = {
sameDay: "Σήμερα στις {{ date | timeString('el') }}",
},
dividerText: 'ή',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Χρησιμοποιήστε άλλη μέθοδο',
footerPageLink__help: 'Βοήθεια',
footerPageLink__privacy: 'Προστασία προσωπικών δεδομένων',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/en-GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const enGB: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const enGB: LocalizationResource = {
sameDay: "Today at {{ date | timeString('en-GB') }}",
},
dividerText: 'or',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Use another method',
footerPageLink__help: 'Help',
footerPageLink__privacy: 'Privacy',
Expand Down
3 changes: 2 additions & 1 deletion packages/localizations/src/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const enUS: LocalizationResource = {
manageSubscription: 'Manage subscription',
month: 'Month',
monthly: 'Monthly',
pastDue: 'Past due',
pay: 'Pay {{amount}}',
paymentMethods: 'Payment Methods',
paymentSource: {
Expand Down Expand Up @@ -110,8 +111,8 @@ export const enUS: LocalizationResource = {
sameDay: "Today at {{ date | timeString('en-US') }}",
},
dividerText: 'or',
footerActionLink__useAnotherMethod: 'Use another method',
footerActionLink__alternativePhoneCodeProvider: 'Send code via SMS instead',
footerActionLink__useAnotherMethod: 'Use another method',
footerPageLink__help: 'Help',
footerPageLink__privacy: 'Privacy',
footerPageLink__terms: 'Terms',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const esES: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const esES: LocalizationResource = {
sameDay: "Hoy a las {{ date | timeString('es-ES') }}",
},
dividerText: 'o',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Usar otro método',
footerPageLink__help: 'Ayuda',
footerPageLink__privacy: 'Privacidad',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/es-MX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const esMX: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const esMX: LocalizationResource = {
sameDay: "Hoy a las {{ date | timeString('es-ES') }}",
},
dividerText: 'o',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Usar otro método',
footerPageLink__help: 'Ayuda',
footerPageLink__privacy: 'Privacidad',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/fi-FI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const fiFI: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const fiFI: LocalizationResource = {
sameDay: "Tänään klo {{ date | timeString('fi-FI') }}",
},
dividerText: 'tai',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Käytä toista tapaa',
footerPageLink__help: 'Apua',
footerPageLink__privacy: 'Tietosuoja',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const frFR: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const frFR: LocalizationResource = {
sameDay: "Aujourd'hui à {{ date | timeString('fr-FR') }}",
},
dividerText: 'ou',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Utiliser une autre méthode',
footerPageLink__help: 'Aide',
footerPageLink__privacy: 'Vie privée',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/he-IL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const heIL: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const heIL: LocalizationResource = {
sameDay: "היום ב-{{ date | timeString('iw') }}",
},
dividerText: 'או',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'השתמש בשיטה אחרת',
footerPageLink__help: 'עזרה',
footerPageLink__privacy: 'פרטיות',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/hr-HR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const hrHR: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const hrHR: LocalizationResource = {
sameDay: "Danas u {{ date | timeString('hr-HR') }}",
},
dividerText: 'ili',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Koristite drugu metodu',
footerPageLink__help: 'Pomoć',
footerPageLink__privacy: 'Privatnost',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/hu-HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const huHU: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const huHU: LocalizationResource = {
sameDay: "Ma {{ date | timeString('hu-HU') }}-kor",
},
dividerText: 'vagy',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Másik módszer használata',
footerPageLink__help: 'Súgó',
footerPageLink__privacy: 'Adatvédelem',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/id-ID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const idID: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const idID: LocalizationResource = {
sameDay: "Hari ini pada {{ date | timeString('id-ID') }}",
},
dividerText: 'atau',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Gunakan metode lain',
footerPageLink__help: 'Bantuan',
footerPageLink__privacy: 'Privasi',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/is-IS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const isIS: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const isIS: LocalizationResource = {
sameDay: "Í dag kl {{ date | timeString('is-IS') }}",
},
dividerText: 'eða',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Nota aðra aðferð',
footerPageLink__help: 'Hjálp',
footerPageLink__privacy: 'Persónuvernd',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/it-IT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const itIT: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const itIT: LocalizationResource = {
sameDay: "Oggi alle {{ date | timeString('it-IT') }}",
},
dividerText: 'oppure',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: 'Utilizzo un altro metodo',
footerPageLink__help: 'Aiuto',
footerPageLink__privacy: 'Privacy',
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/src/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const jaJP: LocalizationResource = {
manageSubscription: undefined,
month: undefined,
monthly: undefined,
pastDue: undefined,
pay: undefined,
paymentMethods: undefined,
paymentSource: {
Expand Down Expand Up @@ -119,6 +120,7 @@ export const jaJP: LocalizationResource = {
sameDay: "今日の{{ date | timeString('ja-JP') }}に",
},
dividerText: 'または',
footerActionLink__alternativePhoneCodeProvider: undefined,
footerActionLink__useAnotherMethod: '別の方法を使用する',
footerPageLink__help: 'ヘルプ',
footerPageLink__privacy: 'プライバシー',
Expand Down
Loading
Loading