diff --git a/.changeset/green-dolphins-discount.md b/.changeset/green-dolphins-discount.md new file mode 100644 index 00000000000..10c44232cdc --- /dev/null +++ b/.changeset/green-dolphins-discount.md @@ -0,0 +1,8 @@ +--- +'@clerk/clerk-js': patch +'@clerk/localizations': patch +'@clerk/shared': patch +'@clerk/ui': patch +--- + +Show applied discounts in the subscription overview. diff --git a/packages/clerk-js/bundlewatch.config.json b/packages/clerk-js/bundlewatch.config.json index 95614c3de45..a9bf078f735 100644 --- a/packages/clerk-js/bundlewatch.config.json +++ b/packages/clerk-js/bundlewatch.config.json @@ -4,7 +4,7 @@ { "path": "./dist/clerk.browser.js", "maxSize": "75KB" }, { "path": "./dist/clerk.legacy.browser.js", "maxSize": "117KB" }, { "path": "./dist/clerk.no-rhc.js", "maxSize": "316KB" }, - { "path": "./dist/clerk.native.js", "maxSize": "74KB" }, + { "path": "./dist/clerk.native.js", "maxSize": "76KB" }, { "path": "./dist/vendors*.js", "maxSize": "7KB" }, { "path": "./dist/coinbase*.js", "maxSize": "36KB" }, { "path": "./dist/base-account-sdk*.js", "maxSize": "207KB" }, diff --git a/packages/clerk-js/src/core/resources/BillingSubscription.ts b/packages/clerk-js/src/core/resources/BillingSubscription.ts index 3ba88bfe442..9e15cb6b639 100644 --- a/packages/clerk-js/src/core/resources/BillingSubscription.ts +++ b/packages/clerk-js/src/core/resources/BillingSubscription.ts @@ -1,5 +1,6 @@ import type { BillingCredits, + BillingDiscountRedemption, BillingMoneyAmount, BillingSubscriptionItemJSON, BillingSubscriptionItemNextPayment, @@ -18,6 +19,7 @@ import { unixEpochToDate } from '@/utils/date'; import { billingCreditsFromJSON, + billingDiscountRedemptionFromJSON, billingMoneyAmountFromJSON, billingPerUnitTotalTierFromJSON, billingSubscriptionItemNextPaymentFromJSON, @@ -85,6 +87,7 @@ export class BillingSubscriptionItem extends BaseResource implements BillingSubs }; seats?: BillingSubscriptionItemSeats; credits?: BillingCredits; + appliedDiscount?: BillingDiscountRedemption; nextPayment?: BillingSubscriptionItemNextPayment | null; isFreeTrial!: boolean; @@ -122,6 +125,7 @@ export class BillingSubscriptionItem extends BaseResource implements BillingSubs : undefined; this.credits = data.credits ? billingCreditsFromJSON(data.credits) : undefined; + this.appliedDiscount = data.applied_discount ? billingDiscountRedemptionFromJSON(data.applied_discount) : undefined; this.nextPayment = data.next_payment === undefined ? undefined diff --git a/packages/clerk-js/src/utils/__tests__/billing.test.ts b/packages/clerk-js/src/utils/__tests__/billing.test.ts index 702c7a0cc2e..727ca360ca5 100644 --- a/packages/clerk-js/src/utils/__tests__/billing.test.ts +++ b/packages/clerk-js/src/utils/__tests__/billing.test.ts @@ -8,6 +8,7 @@ import type { import { describe, expect, it } from 'vitest'; import { + billingDiscountRedemptionFromJSON, billingPaymentTotalsFromJSON, billingSubscriptionItemNextPaymentFromJSON, billingSubscriptionNextPaymentFromJSON, @@ -40,6 +41,15 @@ const nextPaymentTotalsJSON = (): BillingTotalsJSON => ({ cycle_days_total: 30, cycle_passed_percent: 50, }, + discount: { + amount: moneyJSON(1000), + discount_id: 'discount_123', + name: 'Welcome', + effect: 'percentage', + percent_off: 20, + promo_code: 'WELCOME20', + cycles_remaining: 2, + }, total: moneyJSON(500), }, total_due_after_free_trial: null, @@ -109,6 +119,14 @@ describe('billingPaymentTotalsFromJSON', () => { cycle_days_total: 30, cycle_passed_percent: 3, }, + discount: { + amount: moneyJSON(100), + discount_id: 'discount_123', + name: 'Fixed discount', + effect: 'fixed_amount', + amount_off: moneyJSON(100), + cycles_remaining: null, + }, total: moneyJSON(16), }, }; @@ -117,6 +135,14 @@ describe('billingPaymentTotalsFromJSON', () => { expect(totals.discounts?.proration?.amount.amount).toBe(16); expect(totals.discounts?.proration?.cycleDaysPassed).toBe(1); + expect(totals.discounts?.discount).toMatchObject({ + amount: { amount: 100 }, + discountId: 'discount_123', + name: 'Fixed discount', + effect: 'fixed_amount', + amountOff: { amount: 100, amountFormatted: '1.00', currency: 'USD', currencySymbol: '$' }, + cyclesRemaining: null, + }); expect(totals.discounts?.total.amount).toBe(16); }); @@ -209,6 +235,15 @@ describe('billingSubscriptionNextPaymentFromJSON', () => { cycleDaysTotal: 30, cyclePassedPercent: 50, }, + discount: { + amount: { amount: 1000 }, + discountId: 'discount_123', + name: 'Welcome', + effect: 'percentage', + percentOff: 20, + promoCode: 'WELCOME20', + cyclesRemaining: 2, + }, total: { amount: 500 }, }, perUnitTotals: [{ name: 'seats', blockSize: 1 }], @@ -223,6 +258,55 @@ describe('billingSubscriptionNextPaymentFromJSON', () => { }); }); +describe('billingDiscountRedemptionFromJSON', () => { + it('maps an applied subscription item discount', () => { + const discount = billingDiscountRedemptionFromJSON({ + object: 'commerce_discount_redemption', + id: 'redemption_123', + subscription_item_id: 'sub_item_123', + discount_id: 'discount_123', + name: 'Welcome', + source: 'promo_code', + promo_code: 'WELCOME20', + effect: 'fixed_amount', + amount_off: moneyJSON(500), + amount: moneyJSON(400), + cycles_remaining: 2, + cycles_applied: 1, + status: 'active', + redeemed_at: 1_609_459_200_000, + redeemed_by: 'user_123', + }); + + expect(discount).toMatchObject({ + id: 'redemption_123', + subscriptionItemId: 'sub_item_123', + discountId: 'discount_123', + name: 'Welcome', + source: 'promo_code', + promoCode: 'WELCOME20', + effect: 'fixed_amount', + amountOff: { + amount: 500, + amountFormatted: '5.00', + currency: 'USD', + currencySymbol: '$', + }, + amount: { + amount: 400, + amountFormatted: '4.00', + currency: 'USD', + currencySymbol: '$', + }, + cyclesRemaining: 2, + cyclesApplied: 1, + status: 'active', + redeemedAt: new Date('2021-01-01T00:00:00.000Z'), + redeemedBy: 'user_123', + }); + }); +}); + describe('billingSubscriptionItemNextPaymentFromJSON', () => { it('maps amount, date, and per_unit_totals', () => { const data: BillingSubscriptionItemNextPaymentJSON = { diff --git a/packages/clerk-js/src/utils/billing.ts b/packages/clerk-js/src/utils/billing.ts index 796141c2751..40303e7d825 100644 --- a/packages/clerk-js/src/utils/billing.ts +++ b/packages/clerk-js/src/utils/billing.ts @@ -1,8 +1,12 @@ import type { + BillingAppliedDiscount, + BillingAppliedDiscountJSON, BillingCheckoutTotals, BillingCheckoutTotalsJSON, BillingCredits, BillingCreditsJSON, + BillingDiscountRedemption, + BillingDiscountRedemptionJSON, BillingDiscounts, BillingDiscountsJSON, BillingMoneyAmount, @@ -105,10 +109,40 @@ const billingDiscountsFromJSON = (data: BillingDiscountsJSON): BillingDiscounts cyclePassedPercent: data.proration.cycle_passed_percent, } : null, + discount: data.discount ? billingAppliedDiscountFromJSON(data.discount) : undefined, total: billingMoneyAmountFromJSON(data.total), }; }; +const billingAppliedDiscountFromJSON = (data: BillingAppliedDiscountJSON): BillingAppliedDiscount => ({ + amount: billingMoneyAmountFromJSON(data.amount), + discountId: data.discount_id, + name: data.name, + effect: data.effect, + percentOff: data.percent_off, + amountOff: data.amount_off ? billingMoneyAmountFromJSON(data.amount_off) : undefined, + promoCode: data.promo_code, + cyclesRemaining: data.cycles_remaining, +}); + +export const billingDiscountRedemptionFromJSON = (data: BillingDiscountRedemptionJSON): BillingDiscountRedemption => ({ + id: data.id, + subscriptionItemId: data.subscription_item_id, + discountId: data.discount_id, + name: data.name, + source: data.source, + promoCode: data.promo_code, + effect: data.effect, + percentOff: data.percent_off, + amountOff: data.amount_off ? billingMoneyAmountFromJSON(data.amount_off) : undefined, + amount: data.amount ? billingMoneyAmountFromJSON(data.amount) : undefined, + cyclesRemaining: data.cycles_remaining, + cyclesApplied: data.cycles_applied, + status: data.status, + redeemedAt: unixEpochToDate(data.redeemed_at), + redeemedBy: data.redeemed_by, +}); + const billingPeriodTotalsFromJSON = (data: BillingPeriodTotalsJSON): BillingPeriodTotals => { return { subtotal: billingMoneyAmountFromJSON(data.subtotal), diff --git a/packages/localizations/src/ar-SA.ts b/packages/localizations/src/ar-SA.ts index 40994083186..ad94bd88054 100644 --- a/packages/localizations/src/ar-SA.ts +++ b/packages/localizations/src/ar-SA.ts @@ -126,6 +126,9 @@ export const arSA: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const arSA: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const arSA: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/be-BY.ts b/packages/localizations/src/be-BY.ts index 83232a15181..dd73d9f1a9c 100644 --- a/packages/localizations/src/be-BY.ts +++ b/packages/localizations/src/be-BY.ts @@ -126,6 +126,9 @@ export const beBY: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const beBY: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const beBY: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/bg-BG.ts b/packages/localizations/src/bg-BG.ts index d3ac2d80177..c348a8224c6 100644 --- a/packages/localizations/src/bg-BG.ts +++ b/packages/localizations/src/bg-BG.ts @@ -127,6 +127,9 @@ export const bgBG: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -138,6 +141,7 @@ export const bgBG: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -216,6 +220,7 @@ export const bgBG: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/bn-IN.ts b/packages/localizations/src/bn-IN.ts index e4b855441f3..9596f73df26 100644 --- a/packages/localizations/src/bn-IN.ts +++ b/packages/localizations/src/bn-IN.ts @@ -132,6 +132,9 @@ export const bnIN: LocalizationResource = { credit: 'ক্রেডিট', creditRemainder: 'আপনার বর্তমান সাবস্ক্রিপশনের অবশিষ্ট সময়ের জন্য ক্রেডিট।', defaultFreePlanActive: 'আপনি বর্তমানে বিনামূল্যের প্ল্যানে আছেন', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'বিনামূল্যে', getStarted: 'শুরু করুন', highlightedPlanBadge: 'জনপ্রিয়', @@ -143,6 +146,7 @@ export const bnIN: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'মাসিক', + months: undefined, pastDue: 'বকেয়া', pay: '{{amount}} পরিশোধ করুন', payerCreditRemainder: undefined, @@ -221,6 +225,7 @@ export const bnIN: LocalizationResource = { year: 'বছর', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/ca-ES.ts b/packages/localizations/src/ca-ES.ts index 5609cfa4b72..6f47330351f 100644 --- a/packages/localizations/src/ca-ES.ts +++ b/packages/localizations/src/ca-ES.ts @@ -133,6 +133,9 @@ export const caES: LocalizationResource = { credit: 'Crèdit', creditRemainder: 'Crèdit pel temps restant de la teva subscripció actual.', defaultFreePlanActive: 'Estàs al pla gratuït', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Gratuït', getStarted: 'Comença', highlightedPlanBadge: 'Popular', @@ -144,6 +147,7 @@ export const caES: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Mensual', + months: undefined, pastDue: 'Pagament pendent', pay: 'Paga {{amount}}', payerCreditRemainder: undefined, @@ -222,6 +226,7 @@ export const caES: LocalizationResource = { year: 'Any', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/cs-CZ.ts b/packages/localizations/src/cs-CZ.ts index 4518dcb268d..e0b0c3c8247 100644 --- a/packages/localizations/src/cs-CZ.ts +++ b/packages/localizations/src/cs-CZ.ts @@ -130,6 +130,9 @@ export const csCZ: LocalizationResource = { credit: 'Kredit', creditRemainder: 'Kredit za zbytek vašeho současného předplatného.', defaultFreePlanActive: 'Aktuálně používáte bezplatný plán', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Zdarma', getStarted: 'Začít', highlightedPlanBadge: 'Populární', @@ -141,6 +144,7 @@ export const csCZ: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Měsíčně', + months: undefined, pastDue: 'Po splatnosti', pay: 'Zaplatit {{amount}}', payerCreditRemainder: undefined, @@ -219,6 +223,7 @@ export const csCZ: LocalizationResource = { year: 'Rok', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/da-DK.ts b/packages/localizations/src/da-DK.ts index a0c308472a5..e8cd7f18495 100644 --- a/packages/localizations/src/da-DK.ts +++ b/packages/localizations/src/da-DK.ts @@ -126,6 +126,9 @@ export const daDK: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const daDK: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const daDK: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/de-DE.ts b/packages/localizations/src/de-DE.ts index 748ec81cd65..06f45ade815 100644 --- a/packages/localizations/src/de-DE.ts +++ b/packages/localizations/src/de-DE.ts @@ -132,6 +132,9 @@ export const deDE: LocalizationResource = { credit: 'Guthaben', creditRemainder: 'Verbleibendes Guthaben für den restlichen Abrechnungszeitraum.', defaultFreePlanActive: 'Sie nutzen aktuell den kostenlosen Plan.', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Kostenlos', getStarted: 'Jetzt starten', highlightedPlanBadge: 'Beliebt', @@ -143,6 +146,7 @@ export const deDE: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Monatlich', + months: undefined, pastDue: 'Überfällig', pay: '{{amount}} bezahlen', payerCreditRemainder: undefined, @@ -221,6 +225,7 @@ export const deDE: LocalizationResource = { year: 'Jahr', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/el-GR.ts b/packages/localizations/src/el-GR.ts index 3605d6956b7..2ff45eb1db8 100644 --- a/packages/localizations/src/el-GR.ts +++ b/packages/localizations/src/el-GR.ts @@ -126,6 +126,9 @@ export const elGR: LocalizationResource = { credit: 'Πίστωση', creditRemainder: 'Υπόλοιπο πίστωσης', defaultFreePlanActive: 'Το προεπιλεγμένο δωρεάν πλάνο είναι ενεργό', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Δωρεάν', getStarted: 'Ξεκινήστε', highlightedPlanBadge: 'Δημοφιλές', @@ -137,6 +140,7 @@ export const elGR: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Μηνιαία', + months: undefined, pastDue: 'Ληξιπρόθεσμο', pay: 'Πληρωμή', payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const elGR: LocalizationResource = { year: 'έτος', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/en-GB.ts b/packages/localizations/src/en-GB.ts index 65ae7776b4e..938861fc9e2 100644 --- a/packages/localizations/src/en-GB.ts +++ b/packages/localizations/src/en-GB.ts @@ -126,6 +126,9 @@ export const enGB: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const enGB: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const enGB: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/en-US.ts b/packages/localizations/src/en-US.ts index 7e8450b354b..e96f30a67b0 100644 --- a/packages/localizations/src/en-US.ts +++ b/packages/localizations/src/en-US.ts @@ -121,6 +121,9 @@ export const enUS: LocalizationResource = { credit: 'Credit', creditRemainder: 'Credit for the remainder of your current subscription.', defaultFreePlanActive: "You're currently on the Free plan", + discountAmount: '({{amount}} off)', + discountCyclesRemaining: '{{cycles}} {{period}} remaining', + discountDuration: '({{amount}} off first {{cycles}} {{period}})', free: 'Free', getStarted: 'Get started', highlightedPlanBadge: 'Popular', @@ -132,6 +135,7 @@ export const enUS: LocalizationResource = { monthAbbreviation: 'mo', monthPerUnit: 'Month per {{unitName}}', monthly: 'Monthly', + months: 'Months', pastDue: 'Past due', pay: 'Pay {{amount}}', payerCreditRemainder: 'Credit from account balance.', @@ -210,6 +214,7 @@ export const enUS: LocalizationResource = { year: 'Year', yearAbbreviation: 'yr', yearPerUnit: 'Year per {{unitName}}', + years: 'Years', }, configureSSO: { activate: { diff --git a/packages/localizations/src/es-CR.ts b/packages/localizations/src/es-CR.ts index 763951e89ce..3bac63ac4fe 100644 --- a/packages/localizations/src/es-CR.ts +++ b/packages/localizations/src/es-CR.ts @@ -126,6 +126,9 @@ export const esCR: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Gratis', getStarted: 'Empezar', highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const esCR: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const esCR: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/es-ES.ts b/packages/localizations/src/es-ES.ts index 50145eb44c7..b060b775a09 100644 --- a/packages/localizations/src/es-ES.ts +++ b/packages/localizations/src/es-ES.ts @@ -132,6 +132,9 @@ export const esES: LocalizationResource = { credit: 'Crédito', creditRemainder: 'Crédito por el tiempo restante de tu suscripción actual.', defaultFreePlanActive: 'Actualmente estás en el plan gratuito', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Gratis', getStarted: 'Empezar', highlightedPlanBadge: 'Popular', @@ -143,6 +146,7 @@ export const esES: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Mensual', + months: undefined, pastDue: 'Pago pendiente', pay: 'Pagar {{amount}}', payerCreditRemainder: undefined, @@ -221,6 +225,7 @@ export const esES: LocalizationResource = { year: 'Año', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/es-MX.ts b/packages/localizations/src/es-MX.ts index 1bc4a32c7fd..911941b5081 100644 --- a/packages/localizations/src/es-MX.ts +++ b/packages/localizations/src/es-MX.ts @@ -127,6 +127,9 @@ export const esMX: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Gratis', getStarted: 'Empezar', highlightedPlanBadge: undefined, @@ -138,6 +141,7 @@ export const esMX: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -216,6 +220,7 @@ export const esMX: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/es-UY.ts b/packages/localizations/src/es-UY.ts index e4a4f3cff3e..6583f771eb9 100644 --- a/packages/localizations/src/es-UY.ts +++ b/packages/localizations/src/es-UY.ts @@ -126,6 +126,9 @@ export const esUY: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const esUY: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const esUY: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/fa-IR.ts b/packages/localizations/src/fa-IR.ts index 418bf489df2..38383917e72 100644 --- a/packages/localizations/src/fa-IR.ts +++ b/packages/localizations/src/fa-IR.ts @@ -131,6 +131,9 @@ export const faIR: LocalizationResource = { credit: 'اعتبار', creditRemainder: 'اعتبار برای باقیمانده اشتراک فعلی شما.', defaultFreePlanActive: 'شما در حال حاضر در طرح رایگان هستید', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'رایگان', getStarted: 'شروع کنید', highlightedPlanBadge: 'محبوب', @@ -142,6 +145,7 @@ export const faIR: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'ماهانه', + months: undefined, pastDue: 'سررسید گذشته', pay: 'پرداخت {{amount}}', payerCreditRemainder: undefined, @@ -220,6 +224,7 @@ export const faIR: LocalizationResource = { year: 'سال', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/fi-FI.ts b/packages/localizations/src/fi-FI.ts index 6c5e925e4ee..68ffe8d3b95 100644 --- a/packages/localizations/src/fi-FI.ts +++ b/packages/localizations/src/fi-FI.ts @@ -132,6 +132,9 @@ export const fiFI: LocalizationResource = { credit: 'Hyvitys', creditRemainder: 'Hyvitys nykyisen tilauksesi jäljellä olevalta ajalta.', defaultFreePlanActive: 'Olet tällä hetkellä ilmaisella tilauksella.', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Ilmainen', getStarted: 'Aloita', highlightedPlanBadge: 'Suosittu', @@ -143,6 +146,7 @@ export const fiFI: LocalizationResource = { monthAbbreviation: 'kk', monthPerUnit: 'Kuukausi per {{unitName}}', monthly: 'Kuukausittain', + months: undefined, pastDue: 'Erääntynyt', pay: 'Maksa {{amount}}', payerCreditRemainder: 'Hyvitys tilin saldosta.', @@ -221,6 +225,7 @@ export const fiFI: LocalizationResource = { year: 'Vuosi', yearAbbreviation: 'v', yearPerUnit: 'Vuosi per {{unitName}}', + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/fr-FR.ts b/packages/localizations/src/fr-FR.ts index 84777acd790..5a9b6436a94 100644 --- a/packages/localizations/src/fr-FR.ts +++ b/packages/localizations/src/fr-FR.ts @@ -134,6 +134,9 @@ export const frFR: LocalizationResource = { credit: 'Crédit', creditRemainder: 'Crédit restant', defaultFreePlanActive: 'Vous êtes actuellement sur le plan gratuit', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Gratuit', getStarted: 'Commencer', highlightedPlanBadge: 'Populaire', @@ -145,6 +148,7 @@ export const frFR: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Mensuel', + months: undefined, pastDue: 'En retard', pay: 'Payer {{amount}}', payerCreditRemainder: undefined, @@ -223,6 +227,7 @@ export const frFR: LocalizationResource = { year: 'An', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/he-IL.ts b/packages/localizations/src/he-IL.ts index c53bed8d69e..c89c770cc62 100644 --- a/packages/localizations/src/he-IL.ts +++ b/packages/localizations/src/he-IL.ts @@ -126,6 +126,9 @@ export const heIL: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const heIL: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const heIL: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/hi-IN.ts b/packages/localizations/src/hi-IN.ts index 0d429f2d76d..3048153c0d4 100644 --- a/packages/localizations/src/hi-IN.ts +++ b/packages/localizations/src/hi-IN.ts @@ -132,6 +132,9 @@ export const hiIN: LocalizationResource = { credit: 'क्रेडिट', creditRemainder: 'आपकी मौजूदा सदस्यता की शेष अवधि के लिए क्रेडिट।', defaultFreePlanActive: 'आप वर्तमान में निःशुल्क योजना पर हैं', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'मुफ्त', getStarted: 'शुरू करें', highlightedPlanBadge: 'लोकप्रिय', @@ -143,6 +146,7 @@ export const hiIN: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'मासिक', + months: undefined, pastDue: 'बकाया', pay: '{{amount}} भुगतान करें', payerCreditRemainder: undefined, @@ -221,6 +225,7 @@ export const hiIN: LocalizationResource = { year: 'वर्ष', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/hr-HR.ts b/packages/localizations/src/hr-HR.ts index 57d138a1021..f99ce530e50 100644 --- a/packages/localizations/src/hr-HR.ts +++ b/packages/localizations/src/hr-HR.ts @@ -133,6 +133,9 @@ export const hrHR: LocalizationResource = { credit: 'Kredit', creditRemainder: 'Kredit za preostalo razdoblje vaše trenutne pretplate.', defaultFreePlanActive: 'Trenutno ste na besplatnom planu', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Besplatno', getStarted: 'Započnite', highlightedPlanBadge: 'Popularno', @@ -144,6 +147,7 @@ export const hrHR: LocalizationResource = { monthAbbreviation: 'mj', monthPerUnit: 'Mjesec po {{unitName}}', monthly: 'Mjesečno', + months: undefined, pastDue: 'Dospjelo', pay: 'Plati {{amount}}', payerCreditRemainder: 'Kredit sa stanja računa.', @@ -222,6 +226,7 @@ export const hrHR: LocalizationResource = { year: 'Godina', yearAbbreviation: 'god', yearPerUnit: 'Godina po {{unitName}}', + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/hu-HU.ts b/packages/localizations/src/hu-HU.ts index 4fbdcd278bf..40dcff5994f 100644 --- a/packages/localizations/src/hu-HU.ts +++ b/packages/localizations/src/hu-HU.ts @@ -133,6 +133,9 @@ export const huHU: LocalizationResource = { credit: 'Jóváírás', creditRemainder: 'Jóváírás a jelenlegi előfizetésed hátralévő idejére.', defaultFreePlanActive: 'Jelenleg az Ingyenes csomagot használod', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Ingyenes', getStarted: 'Kezdés', highlightedPlanBadge: 'Népszerű', @@ -144,6 +147,7 @@ export const huHU: LocalizationResource = { monthAbbreviation: 'hó', monthPerUnit: 'Hónap / {{unitName}}', monthly: 'Havi', + months: undefined, pastDue: 'Lejárt', pay: '{{amount}} fizetése', payerCreditRemainder: 'Jóváírás a fiók egyenlegből.', @@ -222,6 +226,7 @@ export const huHU: LocalizationResource = { year: 'Év', yearAbbreviation: 'év', yearPerUnit: 'Év / {{unitName}}', + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/id-ID.ts b/packages/localizations/src/id-ID.ts index e865afeb3b5..19014ad3304 100644 --- a/packages/localizations/src/id-ID.ts +++ b/packages/localizations/src/id-ID.ts @@ -126,6 +126,9 @@ export const idID: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const idID: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const idID: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/is-IS.ts b/packages/localizations/src/is-IS.ts index f6a9725bbb5..3f1138b4e42 100644 --- a/packages/localizations/src/is-IS.ts +++ b/packages/localizations/src/is-IS.ts @@ -132,6 +132,9 @@ export const isIS: LocalizationResource = { credit: 'Inneign', creditRemainder: 'Inneign fyrir eftirstöðvar núverandi áskriftar.', defaultFreePlanActive: 'Þú ert á ókeypis áskrift', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Ókeypis', getStarted: 'Byrja', highlightedPlanBadge: 'Vinsælt', @@ -143,6 +146,7 @@ export const isIS: LocalizationResource = { monthAbbreviation: 'mán.', monthPerUnit: 'Mánuður á {{unitName}}', monthly: 'Mánaðarlega', + months: undefined, pastDue: 'Gjaldfallið', pay: 'Greiða {{amount}}', payerCreditRemainder: 'Inneign frá reikningsstöðu.', @@ -221,6 +225,7 @@ export const isIS: LocalizationResource = { year: 'Ár', yearAbbreviation: 'ár', yearPerUnit: 'Ár á {{unitName}}', + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/it-IT.ts b/packages/localizations/src/it-IT.ts index 33bb54cb212..017636e5384 100644 --- a/packages/localizations/src/it-IT.ts +++ b/packages/localizations/src/it-IT.ts @@ -132,6 +132,9 @@ export const itIT: LocalizationResource = { credit: 'Credito', creditRemainder: 'Credito per il resto del tuo abbonamento attuale.', defaultFreePlanActive: 'Attualmente sei sul piano Gratuito', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Gratuito', getStarted: 'Inizia', highlightedPlanBadge: 'Popolare', @@ -143,6 +146,7 @@ export const itIT: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Mensile', + months: undefined, pastDue: 'Scaduto', pay: 'Paga {{amount}}', payerCreditRemainder: undefined, @@ -221,6 +225,7 @@ export const itIT: LocalizationResource = { year: 'Anno', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/ja-JP.ts b/packages/localizations/src/ja-JP.ts index 79040d358be..08c04e4d682 100644 --- a/packages/localizations/src/ja-JP.ts +++ b/packages/localizations/src/ja-JP.ts @@ -133,6 +133,9 @@ export const jaJP: LocalizationResource = { credit: 'クレジット', creditRemainder: '現在のサブスクリプションの残り期間に対するクレジット。', defaultFreePlanActive: '現在は無料プランをご利用中です', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: '無料', getStarted: 'はじめる', highlightedPlanBadge: '人気', @@ -144,6 +147,7 @@ export const jaJP: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: '月払い', + months: undefined, pastDue: '支払い遅延', pay: '{{amount}}を支払う', payerCreditRemainder: 'アカウント残高からのクレジット。', @@ -222,6 +226,7 @@ export const jaJP: LocalizationResource = { year: '年', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/kk-KZ.ts b/packages/localizations/src/kk-KZ.ts index 0d1ac09634a..98fc3995ae6 100644 --- a/packages/localizations/src/kk-KZ.ts +++ b/packages/localizations/src/kk-KZ.ts @@ -126,6 +126,9 @@ export const kkKZ: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Тегін', getStarted: 'Бастау', highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const kkKZ: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const kkKZ: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/ko-KR.ts b/packages/localizations/src/ko-KR.ts index c1abc4a3deb..225447c1606 100644 --- a/packages/localizations/src/ko-KR.ts +++ b/packages/localizations/src/ko-KR.ts @@ -130,6 +130,9 @@ export const koKR: LocalizationResource = { credit: '크레딧', creditRemainder: '현재 구독 남은 기간에 대한 크레딧', defaultFreePlanActive: '현재 무료 플랜을 사용 중이에요', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: '무료', getStarted: '시작하기', highlightedPlanBadge: '인기', @@ -141,6 +144,7 @@ export const koKR: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: '월간', + months: undefined, pastDue: '연체', pay: '{{amount}} 결제', payerCreditRemainder: undefined, @@ -219,6 +223,7 @@ export const koKR: LocalizationResource = { year: '년', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/mn-MN.ts b/packages/localizations/src/mn-MN.ts index 16af9e40f59..4f8eb4d97a6 100644 --- a/packages/localizations/src/mn-MN.ts +++ b/packages/localizations/src/mn-MN.ts @@ -126,6 +126,9 @@ export const mnMN: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const mnMN: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const mnMN: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/ms-MY.ts b/packages/localizations/src/ms-MY.ts index a5080bba09c..626e24ab643 100644 --- a/packages/localizations/src/ms-MY.ts +++ b/packages/localizations/src/ms-MY.ts @@ -134,6 +134,9 @@ export const msMY: LocalizationResource = { credit: 'Kredit', creditRemainder: 'Kredit untuk baki langganan semasa anda.', defaultFreePlanActive: 'Anda kini menggunakan pelan Percuma', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Percuma', getStarted: 'Mulakan', highlightedPlanBadge: 'Popular', @@ -145,6 +148,7 @@ export const msMY: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Bulanan', + months: undefined, pastDue: 'Tertunggak', pay: 'Bayar {{amount}}', payerCreditRemainder: undefined, @@ -223,6 +227,7 @@ export const msMY: LocalizationResource = { year: 'Tahun', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/nb-NO.ts b/packages/localizations/src/nb-NO.ts index f6ca9bd2a0d..46413372071 100644 --- a/packages/localizations/src/nb-NO.ts +++ b/packages/localizations/src/nb-NO.ts @@ -133,6 +133,9 @@ export const nbNO: LocalizationResource = { credit: 'Kreditt', creditRemainder: 'Kreditt for gjenstående del av ditt nåværende abonnement.', defaultFreePlanActive: 'Du er på gratis-planen', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Gratis', getStarted: 'Kom i gang', highlightedPlanBadge: 'Populær', @@ -144,6 +147,7 @@ export const nbNO: LocalizationResource = { monthAbbreviation: 'mnd', monthPerUnit: 'Måned per {{unitName}}', monthly: 'Månedlig', + months: undefined, pastDue: 'Forfalt', pay: 'Betal {{amount}}', payerCreditRemainder: 'Kreditt fra kontosaldo.', @@ -222,6 +226,7 @@ export const nbNO: LocalizationResource = { year: 'År', yearAbbreviation: 'år', yearPerUnit: 'År per {{unitName}}', + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/nl-BE.ts b/packages/localizations/src/nl-BE.ts index 679be3735fe..a35e5359142 100644 --- a/packages/localizations/src/nl-BE.ts +++ b/packages/localizations/src/nl-BE.ts @@ -126,6 +126,9 @@ export const nlBE: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const nlBE: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const nlBE: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/nl-NL.ts b/packages/localizations/src/nl-NL.ts index 7475561c530..5ea2e917927 100644 --- a/packages/localizations/src/nl-NL.ts +++ b/packages/localizations/src/nl-NL.ts @@ -126,6 +126,9 @@ export const nlNL: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const nlNL: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const nlNL: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/pl-PL.ts b/packages/localizations/src/pl-PL.ts index c752dae2933..93c22d427ad 100644 --- a/packages/localizations/src/pl-PL.ts +++ b/packages/localizations/src/pl-PL.ts @@ -126,6 +126,9 @@ export const plPL: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const plPL: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const plPL: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/pt-BR.ts b/packages/localizations/src/pt-BR.ts index ee6e3fb2846..53870c5ad83 100644 --- a/packages/localizations/src/pt-BR.ts +++ b/packages/localizations/src/pt-BR.ts @@ -132,6 +132,9 @@ export const ptBR: LocalizationResource = { credit: 'Crédito', creditRemainder: 'Crédito para o restante da sua assinatura atual.', defaultFreePlanActive: 'Você está atualmente no plano Gratuito', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Gratuito', getStarted: 'Começar', highlightedPlanBadge: 'Popular', @@ -143,6 +146,7 @@ export const ptBR: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Mensal', + months: undefined, pastDue: 'Atrasado', pay: 'Pagar {{amount}}', payerCreditRemainder: undefined, @@ -221,6 +225,7 @@ export const ptBR: LocalizationResource = { year: 'Ano', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/pt-PT.ts b/packages/localizations/src/pt-PT.ts index d0398db77a2..00308760d28 100644 --- a/packages/localizations/src/pt-PT.ts +++ b/packages/localizations/src/pt-PT.ts @@ -134,6 +134,9 @@ export const ptPT: LocalizationResource = { credit: 'Crédito', creditRemainder: 'Crédito relativo ao período restante da sua subscrição atual.', defaultFreePlanActive: 'Está atualmente no plano Gratuito', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Gratuito', getStarted: 'Começar', highlightedPlanBadge: 'Popular', @@ -145,6 +148,7 @@ export const ptPT: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Mensal', + months: undefined, pastDue: 'Em atraso', pay: 'Pagar {{amount}}', payerCreditRemainder: undefined, @@ -223,6 +227,7 @@ export const ptPT: LocalizationResource = { year: 'Ano', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/ro-RO.ts b/packages/localizations/src/ro-RO.ts index f04ca27fc6c..6273a2ec78a 100644 --- a/packages/localizations/src/ro-RO.ts +++ b/packages/localizations/src/ro-RO.ts @@ -132,6 +132,9 @@ export const roRO: LocalizationResource = { credit: 'Credit', creditRemainder: 'Credit pentru restul abonamentului curent.', defaultFreePlanActive: 'În prezent ești pe planul Gratuit', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Gratuit', getStarted: 'Începe', highlightedPlanBadge: 'Popular', @@ -143,6 +146,7 @@ export const roRO: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Lunar', + months: undefined, pastDue: 'Restanță', pay: 'Plătește {{amount}}', payerCreditRemainder: undefined, @@ -221,6 +225,7 @@ export const roRO: LocalizationResource = { year: 'An', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/ru-RU.ts b/packages/localizations/src/ru-RU.ts index 97005a6fbb0..87e0d665bce 100644 --- a/packages/localizations/src/ru-RU.ts +++ b/packages/localizations/src/ru-RU.ts @@ -126,6 +126,9 @@ export const ruRU: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const ruRU: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const ruRU: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/sk-SK.ts b/packages/localizations/src/sk-SK.ts index 36814980eca..358026c4539 100644 --- a/packages/localizations/src/sk-SK.ts +++ b/packages/localizations/src/sk-SK.ts @@ -126,6 +126,9 @@ export const skSK: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Bezplatne', getStarted: 'Začať', highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const skSK: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const skSK: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/sr-RS.ts b/packages/localizations/src/sr-RS.ts index c1b209b00f7..ac2fdcbc291 100644 --- a/packages/localizations/src/sr-RS.ts +++ b/packages/localizations/src/sr-RS.ts @@ -126,6 +126,9 @@ export const srRS: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const srRS: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const srRS: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/sv-SE.ts b/packages/localizations/src/sv-SE.ts index a94c14b64d4..244ad22951e 100644 --- a/packages/localizations/src/sv-SE.ts +++ b/packages/localizations/src/sv-SE.ts @@ -126,6 +126,9 @@ export const svSE: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const svSE: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const svSE: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/ta-IN.ts b/packages/localizations/src/ta-IN.ts index e7025ec6989..172dbeacac2 100644 --- a/packages/localizations/src/ta-IN.ts +++ b/packages/localizations/src/ta-IN.ts @@ -134,6 +134,9 @@ export const taIN: LocalizationResource = { credit: 'கடன்', creditRemainder: 'உங்கள் தற்போதைய சந்தாவின் மீதமுள்ள காலத்திற்கான கடன்.', defaultFreePlanActive: 'நீங்கள் தற்போது இலவச திட்டத்தில் உள்ளீர்கள்', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'இலவசம்', getStarted: 'தொடங்குங்கள்', highlightedPlanBadge: 'பிரபலமான', @@ -145,6 +148,7 @@ export const taIN: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'மாதந்தோறும்', + months: undefined, pastDue: 'நிலுவை', pay: '{{amount}} செலுத்து', payerCreditRemainder: undefined, @@ -223,6 +227,7 @@ export const taIN: LocalizationResource = { year: 'ஆண்டு', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/te-IN.ts b/packages/localizations/src/te-IN.ts index b7761190f76..e6e816dba2c 100644 --- a/packages/localizations/src/te-IN.ts +++ b/packages/localizations/src/te-IN.ts @@ -133,6 +133,9 @@ export const teIN: LocalizationResource = { credit: 'క్రెడిట్', creditRemainder: 'మీ ప్రస్తుత సబ్‌స్క్రిప్షన్ యొక్క మిగిలిన కాలానికి క్రెడిట్.', defaultFreePlanActive: 'మీరు ప్రస్తుతం ఉచిత ప్లాన్‌లో ఉన్నారు', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'ఉచితం', getStarted: 'ప్రారంభించండి', highlightedPlanBadge: 'ప్రసిద్ధ', @@ -144,6 +147,7 @@ export const teIN: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'నెలవారీ', + months: undefined, pastDue: 'బకాయి', pay: '{{amount}} చెల్లించు', payerCreditRemainder: undefined, @@ -222,6 +226,7 @@ export const teIN: LocalizationResource = { year: 'సంవత్సరం', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/th-TH.ts b/packages/localizations/src/th-TH.ts index d65b08fc356..fd47888c061 100644 --- a/packages/localizations/src/th-TH.ts +++ b/packages/localizations/src/th-TH.ts @@ -130,6 +130,9 @@ export const thTH: LocalizationResource = { credit: 'เครดิต', creditRemainder: 'เครดิตสำหรับส่วนที่เหลือของการสมัครสมาชิกปัจจุบันของคุณ', defaultFreePlanActive: 'คุณกำลังใช้แผนฟรีอยู่', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'ฟรี', getStarted: 'เริ่มต้นใช้งาน', highlightedPlanBadge: 'ยอดนิยม', @@ -141,6 +144,7 @@ export const thTH: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'รายเดือน', + months: undefined, pastDue: 'เกินกำหนด', pay: 'ชำระ {{amount}}', payerCreditRemainder: undefined, @@ -219,6 +223,7 @@ export const thTH: LocalizationResource = { year: 'ปี', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/tr-TR.ts b/packages/localizations/src/tr-TR.ts index ad2223c7909..8c0fd35716d 100644 --- a/packages/localizations/src/tr-TR.ts +++ b/packages/localizations/src/tr-TR.ts @@ -126,6 +126,9 @@ export const trTR: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const trTR: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const trTR: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/uk-UA.ts b/packages/localizations/src/uk-UA.ts index f9fd91af731..b25d0ef6d20 100644 --- a/packages/localizations/src/uk-UA.ts +++ b/packages/localizations/src/uk-UA.ts @@ -126,6 +126,9 @@ export const ukUA: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const ukUA: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const ukUA: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/vi-VN.ts b/packages/localizations/src/vi-VN.ts index c21e80d0184..7f49cf8f11f 100644 --- a/packages/localizations/src/vi-VN.ts +++ b/packages/localizations/src/vi-VN.ts @@ -132,6 +132,9 @@ export const viVN: LocalizationResource = { credit: 'Tín dụng', creditRemainder: 'Tín dụng cho phần còn lại của đăng ký hiện tại.', defaultFreePlanActive: 'Bạn hiện đang trên gói Miễn phí', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: 'Miễn phí', getStarted: 'Bắt đầu', highlightedPlanBadge: 'Phổ biến', @@ -143,6 +146,7 @@ export const viVN: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: 'Hàng tháng', + months: undefined, pastDue: 'Quá hạn', pay: 'Thanh toán {{amount}}', payerCreditRemainder: undefined, @@ -221,6 +225,7 @@ export const viVN: LocalizationResource = { year: 'Năm', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/zh-CN.ts b/packages/localizations/src/zh-CN.ts index 5d02a382dd5..4b27c6773a1 100644 --- a/packages/localizations/src/zh-CN.ts +++ b/packages/localizations/src/zh-CN.ts @@ -126,6 +126,9 @@ export const zhCN: LocalizationResource = { credit: undefined, creditRemainder: undefined, defaultFreePlanActive: undefined, + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: undefined, getStarted: undefined, highlightedPlanBadge: undefined, @@ -137,6 +140,7 @@ export const zhCN: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: undefined, + months: undefined, pastDue: undefined, pay: undefined, payerCreditRemainder: undefined, @@ -215,6 +219,7 @@ export const zhCN: LocalizationResource = { year: undefined, yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/localizations/src/zh-TW.ts b/packages/localizations/src/zh-TW.ts index 713b1080c45..0fb6fbda203 100644 --- a/packages/localizations/src/zh-TW.ts +++ b/packages/localizations/src/zh-TW.ts @@ -129,6 +129,9 @@ export const zhTW: LocalizationResource = { credit: '餘額', creditRemainder: '您目前訂閱的剩餘期間的餘額。', defaultFreePlanActive: '您目前正在免費計劃中', + discountAmount: undefined, + discountCyclesRemaining: undefined, + discountDuration: undefined, free: '免費', getStarted: '開始', highlightedPlanBadge: '熱門', @@ -140,6 +143,7 @@ export const zhTW: LocalizationResource = { monthAbbreviation: undefined, monthPerUnit: undefined, monthly: '每月', + months: undefined, pastDue: '逾期', pay: '支付 {{amount}}', payerCreditRemainder: '來自帳戶餘額的折抵。', @@ -218,6 +222,7 @@ export const zhTW: LocalizationResource = { year: '年', yearAbbreviation: undefined, yearPerUnit: undefined, + years: undefined, }, configureSSO: { activate: { diff --git a/packages/shared/src/types/billing.ts b/packages/shared/src/types/billing.ts index 73de14061d9..65615681856 100644 --- a/packages/shared/src/types/billing.ts +++ b/packages/shared/src/types/billing.ts @@ -845,6 +845,10 @@ export interface BillingSubscriptionItemResource extends ClerkResource { amount: BillingMoneyAmount; }; credits?: BillingCredits; + /** + * The active discount applied to this subscription item. + */ + appliedDiscount?: BillingDiscountRedemption; /** * Seat entitlement details for this subscription item. Only set for organization subscription items with * seat-based billing. @@ -1025,6 +1029,45 @@ export interface BillingProrationDiscount { cyclePassedPercent: number; } +/** + * A catalog discount applied to a checkout or payment. + * + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingAppliedDiscount { + amount: BillingMoneyAmount; + discountId: string; + name: string; + effect: 'percentage' | 'fixed_amount'; + percentOff?: number; + amountOff?: BillingMoneyAmount; + promoCode?: string; + cyclesRemaining: number | null; +} + +/** + * A discount redemption applied to a subscription item. + * + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingDiscountRedemption { + id: string; + subscriptionItemId: string; + discountId: string; + name: string; + source: 'promotion' | 'manual' | 'promo_code'; + promoCode?: string; + effect?: 'percentage' | 'fixed_amount'; + percentOff?: number; + amountOff?: BillingMoneyAmount; + amount?: BillingMoneyAmount; + cyclesRemaining: number | null; + cyclesApplied: number; + status?: 'active' | 'exhausted' | 'removed'; + redeemedAt: Date; + redeemedBy: string | null; +} + /** * Discounts applied to the checkout, such as prorated discounts for mid-cycle seat additions. * @@ -1037,6 +1080,10 @@ export interface BillingDiscounts { * means you are not charged for the portion of the new seat's cycle that has already elapsed. */ proration: BillingProrationDiscount | null; + /** + * The catalog discount applied to the transaction. This field is omitted when no catalog discount applies. + */ + discount?: BillingAppliedDiscount; /** * The total of all discounts applied to the checkout. */ diff --git a/packages/shared/src/types/json.ts b/packages/shared/src/types/json.ts index 0a7f57efe6d..8ce3e6fe3d1 100644 --- a/packages/shared/src/types/json.ts +++ b/packages/shared/src/types/json.ts @@ -899,6 +899,7 @@ export interface BillingSubscriptionItemJSON extends ClerkResourceJSON { */ seats?: BillingSubscriptionItemSeatsJSON; credits?: BillingCreditsJSON; + applied_discount?: BillingDiscountRedemptionJSON; plan: BillingPlanJSON; plan_period: BillingSubscriptionPlanPeriod; price_id: string; @@ -1012,6 +1013,36 @@ export interface BillingProrationDiscountJSON { cycle_passed_percent: number; } +export interface BillingAppliedDiscountJSON { + amount: BillingMoneyAmountJSON; + discount_id: string; + name: string; + effect: 'percentage' | 'fixed_amount'; + percent_off?: number; + amount_off?: BillingMoneyAmountJSON; + promo_code?: string; + cycles_remaining: number | null; +} + +export interface BillingDiscountRedemptionJSON extends ClerkResourceJSON { + object: 'commerce_discount_redemption'; + id: string; + subscription_item_id: string; + discount_id: string; + name: string; + source: 'promotion' | 'manual' | 'promo_code'; + promo_code?: string; + effect?: 'percentage' | 'fixed_amount'; + percent_off?: number; + amount_off?: BillingMoneyAmountJSON; + amount?: BillingMoneyAmountJSON; + cycles_remaining: number | null; + cycles_applied: number; + status?: 'active' | 'exhausted' | 'removed'; + redeemed_at: number; + redeemed_by: string | null; +} + /** * Discounts applied to the checkout, such as prorated discounts for mid-cycle seat additions. * @@ -1024,6 +1055,10 @@ export interface BillingDiscountsJSON { * means you are not charged for the portion of the new seat's cycle that has already elapsed. */ proration: BillingProrationDiscountJSON | null; + /** + * The catalog discount applied to the transaction. This field is omitted when no catalog discount applies. + */ + discount?: BillingAppliedDiscountJSON; /** * The total of all discounts applied to the checkout. */ diff --git a/packages/shared/src/types/localization.ts b/packages/shared/src/types/localization.ts index d73ed179a04..655613823cc 100644 --- a/packages/shared/src/types/localization.ts +++ b/packages/shared/src/types/localization.ts @@ -186,9 +186,11 @@ export type __internal_LocalizationResource = { membershipRole__guestMember: LocalizationValue; billing: { month: LocalizationValue; + months: LocalizationValue; monthAbbreviation: LocalizationValue; monthPerUnit: LocalizationValue<'unitName'>; year: LocalizationValue; + years: LocalizationValue; yearAbbreviation: LocalizationValue; yearPerUnit: LocalizationValue<'unitName'>; free: LocalizationValue; @@ -223,6 +225,9 @@ export type __internal_LocalizationResource = { alwaysFree: LocalizationValue; accountFunds: LocalizationValue; defaultFreePlanActive: LocalizationValue; + discountAmount: LocalizationValue<'amount'>; + discountCyclesRemaining: LocalizationValue<'cycles' | 'period'>; + discountDuration: LocalizationValue<'amount' | 'cycles' | 'period'>; viewFeatures: LocalizationValue; seeAllFeatures: LocalizationValue; viewPayment: LocalizationValue; diff --git a/packages/ui/src/components/Subscriptions/SubscriptionsList.tsx b/packages/ui/src/components/Subscriptions/SubscriptionsList.tsx index bf512a9b447..874012906c3 100644 --- a/packages/ui/src/components/Subscriptions/SubscriptionsList.tsx +++ b/packages/ui/src/components/Subscriptions/SubscriptionsList.tsx @@ -5,6 +5,7 @@ import { useProtect } from '@/ui/common/Gate'; import { FullHeightLoader } from '@/ui/elements/FullHeightLoader'; import { ProfileSection } from '@/ui/elements/Section'; import { common } from '@/ui/styledSystem'; +import { toNegativeAmount } from '@/ui/utils/billing'; import { getSeatLimitAndIncludedSeatsLocalizationKey } from '@/ui/utils/billingPlanSeats'; import { isManageableSubscriptionItem } from '@/ui/utils/billingSubscription'; @@ -246,6 +247,68 @@ function SubscriptionOverviewRow({ ); } +function SubscriptionDiscountRow({ subscriptionItem }: { subscriptionItem: BillingSubscriptionItemResource }) { + const { $, t } = useLocalizations(); + const appliedDiscount = subscriptionItem.appliedDiscount; + + if (!appliedDiscount || appliedDiscount.status !== 'active') { + return null; + } + + const totalCycles = + appliedDiscount.cyclesRemaining === null ? null : appliedDiscount.cyclesApplied + appliedDiscount.cyclesRemaining; + const period = t( + subscriptionItem.planPeriod === 'annual' ? localizationKeys('billing.years') : localizationKeys('billing.months'), + ).toLocaleLowerCase(); + + const discountAmount = + appliedDiscount.effect === 'percentage' && appliedDiscount.percentOff !== undefined + ? `${appliedDiscount.percentOff}%` + : appliedDiscount.amountOff + ? $(appliedDiscount.amountOff) + : ''; + const discountTitle = `${appliedDiscount.name} ${t( + totalCycles === null + ? localizationKeys('billing.discountAmount', { amount: discountAmount }) + : localizationKeys('billing.discountDuration', { + amount: discountAmount, + cycles: totalCycles, + period, + }), + )}`; + + return ( + + subscriptionItem.status === 'upcoming' + ? { + background: common.mutedBackground(t), + } + : {} + } + > + + + {discountTitle} + {appliedDiscount.cyclesRemaining !== null ? ( + + ) : null} + + + + {appliedDiscount.amount ? $(toNegativeAmount(appliedDiscount.amount)) : null} + + + ); +} + function SubscriptionItemRow({ subscriptionItem, length, @@ -405,6 +468,7 @@ function SubscriptionItemRow({ ) : null} + ); }