Skip to content

Commit 37028ca

Browse files
authored
chore(clerk-js, types): Drop top level billing flags from environment (#6882)
1 parent 6ca071d commit 37028ca

File tree

5 files changed

+6
-21
lines changed

5 files changed

+6
-21
lines changed

.changeset/seven-trees-double.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@clerk/clerk-js': minor
3+
'@clerk/types': minor
4+
---
5+
6+
[Billing Beta] Drop top level billing flags from environment. Instead, use the payer specific flags.

packages/clerk-js/src/core/resources/CommerceSettings.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import { BaseResource } from './internal';
88
export class CommerceSettings extends BaseResource implements CommerceSettingsResource {
99
billing: CommerceSettingsResource['billing'] = {
1010
stripePublishableKey: '',
11-
enabled: false,
12-
hasPaidUserPlans: false,
13-
hasPaidOrgPlans: false,
1411
organization: {
1512
enabled: false,
1613
hasPaidPlans: false,
@@ -32,9 +29,6 @@ export class CommerceSettings extends BaseResource implements CommerceSettingsRe
3229
}
3330

3431
this.billing.stripePublishableKey = data.billing.stripe_publishable_key || '';
35-
this.billing.enabled = data.billing.enabled || false;
36-
this.billing.hasPaidUserPlans = data.billing.has_paid_user_plans || false;
37-
this.billing.hasPaidOrgPlans = data.billing.has_paid_org_plans || false;
3832
this.billing.organization.enabled = data.billing.organization.enabled || false;
3933
this.billing.organization.hasPaidPlans = data.billing.organization.has_paid_plans || false;
4034
this.billing.user.enabled = data.billing.user.enabled || false;
@@ -47,9 +41,6 @@ export class CommerceSettings extends BaseResource implements CommerceSettingsRe
4741
return {
4842
billing: {
4943
stripe_publishable_key: this.billing.stripePublishableKey,
50-
enabled: this.billing.enabled,
51-
has_paid_user_plans: this.billing.hasPaidUserPlans,
52-
has_paid_org_plans: this.billing.hasPaidOrgPlans,
5344
organization: {
5445
enabled: this.billing.organization.enabled,
5546
has_paid_plans: this.billing.organization.hasPaidPlans,

packages/clerk-js/src/ui/utils/test/fixtureHelpers.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,10 @@ const createOrganizationSettingsFixtureHelpers = (environment: EnvironmentJSON)
353353
const createBillingSettingsFixtureHelpers = (environment: EnvironmentJSON) => {
354354
const os = environment.commerce_settings.billing;
355355
const withBilling = () => {
356-
os.enabled = true;
357356
os.user.enabled = true;
358357
os.user.has_paid_plans = true;
359358
os.organization.enabled = true;
360359
os.organization.has_paid_plans = true;
361-
os.has_paid_org_plans = true;
362-
os.has_paid_user_plans = true;
363360
};
364361

365362
return { withBilling };

packages/clerk-js/src/ui/utils/test/fixtures.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ const createBaseCommerceSettings = (): CommerceSettingsJSON => {
213213
object: 'commerce_settings',
214214
id: 'commerce_settings_1',
215215
billing: {
216-
enabled: false,
217216
user: {
218217
enabled: false,
219218
has_paid_plans: false,
@@ -222,8 +221,6 @@ const createBaseCommerceSettings = (): CommerceSettingsJSON => {
222221
enabled: false,
223222
has_paid_plans: false,
224223
},
225-
has_paid_org_plans: false,
226-
has_paid_user_plans: false,
227224
stripe_publishable_key: '',
228225
},
229226
};

packages/types/src/commerceSettings.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import type { CommerceSettingsJSONSnapshot } from './snapshots';
44

55
export interface CommerceSettingsJSON extends ClerkResourceJSON {
66
billing: {
7-
enabled: boolean;
87
stripe_publishable_key: string;
9-
has_paid_user_plans: boolean;
10-
has_paid_org_plans: boolean;
118
organization: {
129
enabled: boolean;
1310
has_paid_plans: boolean;
@@ -21,10 +18,7 @@ export interface CommerceSettingsJSON extends ClerkResourceJSON {
2118

2219
export interface CommerceSettingsResource extends ClerkResource {
2320
billing: {
24-
enabled: boolean;
2521
stripePublishableKey: string;
26-
hasPaidUserPlans: boolean;
27-
hasPaidOrgPlans: boolean;
2822
organization: {
2923
enabled: boolean;
3024
hasPaidPlans: boolean;

0 commit comments

Comments
 (0)