Files
myeasycms-v2/apps/web/config/billing.config.ts
giancarlo 248ab7ef72 Update translations and add trial eligibility in plan picker
Added translations in "plan-picker" for better localization support. Introduced a new functionality to check trial eligibility where existing customers can't start a trial. Removed unnecessary billing line items like 'per-seat' and 'metered'. Also, made significant changes in multiple files to align with the updated internationalization best practices. The changes aim to make application more user-friendly across different locales and provide accurate trial period conditions.
2024-03-31 17:46:39 +08:00

147 lines
3.5 KiB
TypeScript

import { BillingProviderSchema, createBillingSchema } from '@kit/billing';
const provider = BillingProviderSchema.parse(
process.env.NEXT_PUBLIC_BILLING_PROVIDER,
);
export default createBillingSchema({
provider,
products: [
{
id: 'starter',
name: 'Starter',
description: 'The perfect plan to get started',
currency: 'USD',
badge: `Value`,
plans: [
{
name: 'Starter Monthly',
id: 'starter-monthly',
trialPeriod: 7,
paymentType: 'recurring',
interval: 'month',
lineItems: [
{
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe',
name: 'Base',
description: 'Base plan',
cost: 9.99,
type: 'base',
},
],
},
{
name: 'Starter Yearly',
id: 'starter-yearly',
paymentType: 'recurring',
interval: 'year',
lineItems: [
{
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe1',
name: 'Base',
description: 'Base plan',
cost: 99.99,
type: 'base',
},
],
},
],
features: ['Feature 1', 'Feature 2', 'Feature 3'],
},
{
id: 'pro',
name: 'Pro',
badge: `Popular`,
highlighted: true,
description: 'The perfect plan for professionals',
currency: 'USD',
plans: [
{
name: 'Pro Monthly',
id: 'pro-monthly',
paymentType: 'recurring',
interval: 'month',
lineItems: [
{
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe2',
name: 'Base',
description: 'Base plan',
cost: 19.99,
type: 'base',
},
],
},
{
name: 'Pro Yearly',
id: 'pro-yearly',
paymentType: 'recurring',
interval: 'year',
lineItems: [
{
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe3',
name: 'Base',
description: 'Base plan',
cost: 199.99,
type: 'base',
},
],
},
],
features: [
'Feature 1',
'Feature 2',
'Feature 3',
'Feature 4',
'Feature 5',
],
},
{
id: 'enterprise',
name: 'Enterprise',
description: 'The perfect plan for enterprises',
currency: 'USD',
plans: [
{
name: 'Enterprise Monthly',
id: 'enterprise-monthly',
paymentType: 'recurring',
interval: 'month',
lineItems: [
{
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe4',
name: 'Base',
description: 'Base plan',
cost: 29.99,
type: 'base',
},
],
},
{
name: 'Enterprise Yearly',
id: 'enterprise-yearly',
paymentType: 'recurring',
interval: 'year',
lineItems: [
{
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe5',
name: 'Base',
description: 'Base plan',
cost: 299.99,
type: 'base',
},
],
},
],
features: [
'Feature 1',
'Feature 2',
'Feature 3',
'Feature 4',
'Feature 5',
'Feature 6',
'Feature 7',
],
},
],
});