diff --git a/enterprise/app/services/enterprise/billing/topup_checkout_service.rb b/enterprise/app/services/enterprise/billing/topup_checkout_service.rb index c845a15e6..5588c0c71 100644 --- a/enterprise/app/services/enterprise/billing/topup_checkout_service.rb +++ b/enterprise/app/services/enterprise/billing/topup_checkout_service.rb @@ -104,8 +104,10 @@ class Enterprise::Billing::TopupCheckoutService end def topup_options - currency = account.billing_currency - rows = configured_options[currency].presence || configured_options[Enterprise::Billing::Currencies::DEFAULT].presence || [] + # 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 || [] rows.map { |opt| { credits: opt['credits'].to_i, amount: opt['amount'].to_f, currency: currency } } end