From 29e1eaed19e9a8ef7b1bda9f9efb5292e573a82c Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Tue, 9 Jun 2026 13:43:38 +0530 Subject: [PATCH] Revert "fix(billing): preserve fallback row currency in topup options" This reverts commit 3bbaacac406d930cd7c2b727ff7d81af4ade5aa1. --- .../services/enterprise/billing/topup_checkout_service.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/enterprise/app/services/enterprise/billing/topup_checkout_service.rb b/enterprise/app/services/enterprise/billing/topup_checkout_service.rb index 5588c0c71..c845a15e6 100644 --- a/enterprise/app/services/enterprise/billing/topup_checkout_service.rb +++ b/enterprise/app/services/enterprise/billing/topup_checkout_service.rb @@ -104,10 +104,8 @@ class Enterprise::Billing::TopupCheckoutService end def topup_options - # Label rows with the currency they were configured under, so a DEFAULT fallback can't relabel USD amounts and undercharge. - options = configured_options - currency = options[account.billing_currency].present? ? account.billing_currency : Enterprise::Billing::Currencies::DEFAULT - rows = options[currency].presence || [] + currency = account.billing_currency + rows = configured_options[currency].presence || configured_options[Enterprise::Billing::Currencies::DEFAULT].presence || [] rows.map { |opt| { credits: opt['credits'].to_i, amount: opt['amount'].to_f, currency: currency } } end