diff --git a/config/installation_config.yml b/config/installation_config.yml index fc045216e..68a823f3f 100644 --- a/config/installation_config.yml +++ b/config/installation_config.yml @@ -253,8 +253,8 @@ display_title: 'Cloud Plans' value: description: 'Config to store stripe plans for cloud' -- name: CHATWOOT_CLOUD_TOPUP_OPTIONS - display_title: 'Cloud Topup Options' +- name: CAPTAIN_TOPUP_OPTIONS + display_title: 'Captain Topup Options' value: {} description: 'Currency-keyed AI credit top-up packages, e.g. {"usd":[{"credits":1000,"amount":20.0}],"brl":[{"credits":1000,"amount":100.0}]}' type: code diff --git a/enterprise/app/services/enterprise/billing/topup_checkout_service.rb b/enterprise/app/services/enterprise/billing/topup_checkout_service.rb index 5588c0c71..58eac1b4d 100644 --- a/enterprise/app/services/enterprise/billing/topup_checkout_service.rb +++ b/enterprise/app/services/enterprise/billing/topup_checkout_service.rb @@ -3,7 +3,7 @@ class Enterprise::Billing::TopupCheckoutService class Error < StandardError; end - TOPUP_OPTIONS_CONFIG = 'CHATWOOT_CLOUD_TOPUP_OPTIONS'.freeze + TOPUP_OPTIONS_CONFIG = 'CAPTAIN_TOPUP_OPTIONS'.freeze pattr_initialize [:account!] diff --git a/spec/enterprise/controllers/enterprise/api/v1/accounts_controller_spec.rb b/spec/enterprise/controllers/enterprise/api/v1/accounts_controller_spec.rb index f840ddc11..cfabf6b7e 100644 --- a/spec/enterprise/controllers/enterprise/api/v1/accounts_controller_spec.rb +++ b/spec/enterprise/controllers/enterprise/api/v1/accounts_controller_spec.rb @@ -256,7 +256,7 @@ RSpec.describe 'Enterprise Billing APIs', type: :request do { 'name' => 'Hacker', 'product_id' => ['prod_hacker'], 'price_ids' => ['price_hacker'] }, { 'name' => 'Business', 'product_id' => ['prod_business'], 'price_ids' => ['price_business'] } ]) - create(:installation_config, name: 'CHATWOOT_CLOUD_TOPUP_OPTIONS', value: { + create(:installation_config, name: 'CAPTAIN_TOPUP_OPTIONS', value: { 'usd' => [ { 'credits' => 1000, 'amount' => 20.0 }, { 'credits' => 2500, 'amount' => 50.0 }, diff --git a/spec/enterprise/services/enterprise/billing/topup_checkout_service_spec.rb b/spec/enterprise/services/enterprise/billing/topup_checkout_service_spec.rb index 2629bdbd9..1836cb39d 100644 --- a/spec/enterprise/services/enterprise/billing/topup_checkout_service_spec.rb +++ b/spec/enterprise/services/enterprise/billing/topup_checkout_service_spec.rb @@ -15,7 +15,7 @@ describe Enterprise::Billing::TopupCheckoutService do { 'name' => 'Business', 'product_id' => ['prod_business'], 'price_ids' => ['price_business'] } ]) - create(:installation_config, name: 'CHATWOOT_CLOUD_TOPUP_OPTIONS', value: { + create(:installation_config, name: 'CAPTAIN_TOPUP_OPTIONS', value: { 'usd' => [ { 'credits' => 1000, 'amount' => 20.0 }, { 'credits' => 2500, 'amount' => 50.0 },