From 69b818896a30863f9af6a50646591a74ac1f4dc8 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Wed, 19 Nov 2025 20:01:49 +0530 Subject: [PATCH] update plan catalog display_name --- .../concerns/plan_provisioning_helper.rb | 21 +------------------ .../enterprise/billing/v2/plan_catalog.rb | 8 +++---- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/enterprise/app/services/enterprise/billing/concerns/plan_provisioning_helper.rb b/enterprise/app/services/enterprise/billing/concerns/plan_provisioning_helper.rb index 68c6b5850..18ad1f1b6 100644 --- a/enterprise/app/services/enterprise/billing/concerns/plan_provisioning_helper.rb +++ b/enterprise/app/services/enterprise/billing/concerns/plan_provisioning_helper.rb @@ -7,26 +7,7 @@ module Enterprise::Billing::Concerns::PlanProvisioningHelper plan_definition = Enterprise::Billing::V2::PlanCatalog.definition_for(new_pricing_plan_id) return unless plan_definition - plan_name = extract_plan_name(plan_definition) + plan_name = plan_definition[:display_name] enable_plan_specific_features(plan_name) if plan_name.present? end - - def extract_plan_name(plan_definition) - plan_definition[:display_name].split.find { |word| %w[Startups Business Enterprise].include?(word) } - end - - def update_account_plan(new_pricing_plan_id, quantity, next_billing_date) - attributes = { - 'stripe_pricing_plan_id' => new_pricing_plan_id, - 'pending_stripe_pricing_plan_id' => nil, - 'pending_subscription_quantity' => nil, - 'subscribed_quantity' => quantity, - 'next_billing_date' => next_billing_date - } - - plan_definition = Enterprise::Billing::V2::PlanCatalog.definition_for(new_pricing_plan_id) - attributes['plan_name'] = plan_definition[:display_name] if plan_definition - - update_custom_attributes(attributes) - end end diff --git a/enterprise/app/services/enterprise/billing/v2/plan_catalog.rb b/enterprise/app/services/enterprise/billing/v2/plan_catalog.rb index c45a79f38..8d9d3b0b4 100644 --- a/enterprise/app/services/enterprise/billing/v2/plan_catalog.rb +++ b/enterprise/app/services/enterprise/billing/v2/plan_catalog.rb @@ -5,7 +5,7 @@ module Enterprise::Billing::V2::PlanCatalog PLAN_DEFINITIONS = [ { key: :free, - display_name: 'Chatwoot Hacker', + display_name: 'Hacker', base_fee: 0.0, monthly_credits: 0, config_key: 'STRIPE_HACKER_PLAN_ID', @@ -13,7 +13,7 @@ module Enterprise::Billing::V2::PlanCatalog }, { key: :startup, - display_name: 'Chatwoot Startups', + display_name: 'Startups', base_fee: 19.0, monthly_credits: 300, config_key: 'STRIPE_STARTUP_PLAN_ID', @@ -21,7 +21,7 @@ module Enterprise::Billing::V2::PlanCatalog }, { key: :business, - display_name: 'Chatwoot Business', + display_name: 'Business', base_fee: 39.0, monthly_credits: 500, config_key: 'STRIPE_BUSINESS_PLAN_ID', @@ -29,7 +29,7 @@ module Enterprise::Billing::V2::PlanCatalog }, { key: :enterprise, - display_name: 'Chatwoot Enterprise', + display_name: 'Enterprise', base_fee: 99.0, monthly_credits: 800, config_key: 'STRIPE_ENTERPRISE_PLAN_ID',