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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/seven-trees-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@clerk/clerk-js': minor
'@clerk/types': minor
---

[Billing Beta] Drop top level billing flags from environment. Instead, use the payer specific flags.
9 changes: 0 additions & 9 deletions packages/clerk-js/src/core/resources/CommerceSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import { BaseResource } from './internal';
export class CommerceSettings extends BaseResource implements CommerceSettingsResource {
billing: CommerceSettingsResource['billing'] = {
stripePublishableKey: '',
enabled: false,
hasPaidUserPlans: false,
hasPaidOrgPlans: false,
organization: {
enabled: false,
hasPaidPlans: false,
Expand All @@ -32,9 +29,6 @@ export class CommerceSettings extends BaseResource implements CommerceSettingsRe
}

this.billing.stripePublishableKey = data.billing.stripe_publishable_key || '';
this.billing.enabled = data.billing.enabled || false;
this.billing.hasPaidUserPlans = data.billing.has_paid_user_plans || false;
this.billing.hasPaidOrgPlans = data.billing.has_paid_org_plans || false;
this.billing.organization.enabled = data.billing.organization.enabled || false;
this.billing.organization.hasPaidPlans = data.billing.organization.has_paid_plans || false;
this.billing.user.enabled = data.billing.user.enabled || false;
Expand All @@ -47,9 +41,6 @@ export class CommerceSettings extends BaseResource implements CommerceSettingsRe
return {
billing: {
stripe_publishable_key: this.billing.stripePublishableKey,
enabled: this.billing.enabled,
has_paid_user_plans: this.billing.hasPaidUserPlans,
has_paid_org_plans: this.billing.hasPaidOrgPlans,
organization: {
enabled: this.billing.organization.enabled,
has_paid_plans: this.billing.organization.hasPaidPlans,
Expand Down
3 changes: 0 additions & 3 deletions packages/clerk-js/src/ui/utils/test/fixtureHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,10 @@ const createOrganizationSettingsFixtureHelpers = (environment: EnvironmentJSON)
const createBillingSettingsFixtureHelpers = (environment: EnvironmentJSON) => {
const os = environment.commerce_settings.billing;
const withBilling = () => {
os.enabled = true;
os.user.enabled = true;
os.user.has_paid_plans = true;
os.organization.enabled = true;
os.organization.has_paid_plans = true;
os.has_paid_org_plans = true;
os.has_paid_user_plans = true;
};

return { withBilling };
Expand Down
3 changes: 0 additions & 3 deletions packages/clerk-js/src/ui/utils/test/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ const createBaseCommerceSettings = (): CommerceSettingsJSON => {
object: 'commerce_settings',
id: 'commerce_settings_1',
billing: {
enabled: false,
user: {
enabled: false,
has_paid_plans: false,
Expand All @@ -222,8 +221,6 @@ const createBaseCommerceSettings = (): CommerceSettingsJSON => {
enabled: false,
has_paid_plans: false,
},
has_paid_org_plans: false,
has_paid_user_plans: false,
stripe_publishable_key: '',
},
};
Expand Down
6 changes: 0 additions & 6 deletions packages/types/src/commerceSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import type { CommerceSettingsJSONSnapshot } from './snapshots';

export interface CommerceSettingsJSON extends ClerkResourceJSON {
billing: {
enabled: boolean;
stripe_publishable_key: string;
has_paid_user_plans: boolean;
has_paid_org_plans: boolean;
organization: {
enabled: boolean;
has_paid_plans: boolean;
Expand All @@ -21,10 +18,7 @@ export interface CommerceSettingsJSON extends ClerkResourceJSON {

export interface CommerceSettingsResource extends ClerkResource {
billing: {
enabled: boolean;
stripePublishableKey: string;
hasPaidUserPlans: boolean;
hasPaidOrgPlans: boolean;
organization: {
enabled: boolean;
hasPaidPlans: boolean;
Expand Down
Loading