fix(billing): reject currency changes after Stripe setup

This commit is contained in:
Tanmay Deep Sharma
2026-06-19 15:22:31 +05:30
parent e74d0c727a
commit 62e6c2b76e
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -165,6 +165,7 @@ en:
feature_unavailable: MFA feature is not available. Please configure encryption keys.
billing:
invalid_currency: Invalid billing currency
currency_locked: Billing currency cannot be changed after billing has been set up
topup:
credits_required: Credits amount is required
invalid_credits: Invalid credits amount
@@ -12,6 +12,8 @@ class Enterprise::Api::V1::AccountsController < Api::BaseController
end
def select_billing_currency
return render_could_not_create_error(I18n.t('errors.billing.currency_locked')) if stripe_customer_id.present?
currency = Enterprise::Billing::Currencies.normalize(params[:currency])
return render_could_not_create_error(I18n.t('errors.billing.invalid_currency')) unless Enterprise::Billing::Currencies.supported?(currency)