diff --git a/components/server/ee/src/billing/billing-mode.spec.db.ts b/components/server/ee/src/billing/billing-mode.spec.db.ts index e930aca31d87dc..e21378c96657cc 100644 --- a/components/server/ee/src/billing/billing-mode.spec.db.ts +++ b/components/server/ee/src/billing/billing-mode.spec.db.ts @@ -496,7 +496,6 @@ class BillingModeSpec { () => new ConfigCatClientMock({ isUsageBasedBillingEnabled: test.config.usageBasedPricingEnabled, - isBillingModeEnabled: true, }), ); }), diff --git a/components/server/ee/src/billing/billing-mode.ts b/components/server/ee/src/billing/billing-mode.ts index 0fa1a2e349708f..60715baafeb719 100644 --- a/components/server/ee/src/billing/billing-mode.ts +++ b/components/server/ee/src/billing/billing-mode.ts @@ -63,26 +63,11 @@ export class BillingModesImpl implements BillingModes { } } - protected async isBillingModeEnabled(subject: { user?: User; team?: Team }): Promise { - // This is a double safety-net to smoothen and de-risk the rollout of BillingMode, because it not only affects - // new behavior which is in focus and subject to test anyway (usage-based), but also old behavior (chargebee). - const teams = subject.user ? await this.teamDB.findTeamsByUser(subject.user.id) : undefined; - return await this.configCatClientFactory().getValueAsync("isBillingModeEnabled", false, { - user: subject.user, - teams, - teamId: subject.team?.id, - teamName: subject.team?.name, - }); - } - async getBillingModeForUser(user: User, now: Date): Promise { if (!this.config.enablePayment) { // Payment is not enabled. E.g. Self-Hosted. return { mode: "none" }; } - if (!(await this.isBillingModeEnabled({ user }))) { - return { mode: "chargebee" }; - } // Is Usage Based Billing enabled for this user or not? const teams = await this.teamDB.findTeamsByUser(user.id); @@ -167,9 +152,6 @@ export class BillingModesImpl implements BillingModes { // Payment is not enabled. E.g. Self-Hosted. return { mode: "none" }; } - if (!(await this.isBillingModeEnabled({ team }))) { - return { mode: "chargebee" }; - } const now = _now.toISOString(); // Is Usage Based Billing enabled for this team? diff --git a/components/server/ee/src/workspace/gitpod-server-impl.ts b/components/server/ee/src/workspace/gitpod-server-impl.ts index e88c817dae5486..b5601fdcf96491 100644 --- a/components/server/ee/src/workspace/gitpod-server-impl.ts +++ b/components/server/ee/src/workspace/gitpod-server-impl.ts @@ -114,7 +114,6 @@ import { AttributionId } from "@gitpod/gitpod-protocol/lib/attribution"; import { EntitlementService, MayStartWorkspaceResult } from "../../../src/billing/entitlement-service"; import { BillingMode } from "@gitpod/gitpod-protocol/lib/billing-mode"; import { BillingModes } from "../billing/billing-mode"; -import { getExperimentsClientForBackend } from "@gitpod/gitpod-protocol/lib/experiments/configcat-server"; import { BillingService } from "../billing/billing-service"; import Stripe from "stripe"; import { UsageServiceDefinition } from "@gitpod/usage-api/lib/usage/v1/usage.pb"; @@ -2012,14 +2011,6 @@ export class GitpodServerEEImpl extends GitpodServerImpl { return subscription; } - protected async isUsageBasedFeatureFlagEnabled(user: User): Promise { - const teams = await this.teamDB.findTeamsByUser(user.id); - return await getExperimentsClientForBackend().getValueAsync("isUsageBasedBillingEnabled", false, { - user, - teams: teams, - }); - } - protected async ensureChargebeeApiIsAllowed(sub: { user?: User; team?: Team }): Promise { await this.ensureBillingMode(sub, (m) => m.mode === "chargebee"); }