refactor(billing): rename topup options config to CAPTAIN_TOPUP_OPTIONS
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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!]
|
||||
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user