From eeca70e841890a0abf9460a83bd97b9659d29d02 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Tue, 9 Jun 2026 13:34:04 +0530 Subject: [PATCH] fix(billing): exclude past_due subscriptions from currency switch --- .../services/enterprise/billing/switch_currency_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enterprise/app/services/enterprise/billing/switch_currency_service.rb b/enterprise/app/services/enterprise/billing/switch_currency_service.rb index 791a34e71..4159e94eb 100644 --- a/enterprise/app/services/enterprise/billing/switch_currency_service.rb +++ b/enterprise/app/services/enterprise/billing/switch_currency_service.rb @@ -130,10 +130,10 @@ class Enterprise::Billing::SwitchCurrencyService ) end - # Includes trialing — a prior switch leaves the new sub trialing until its paid-through date. + # Includes trialing (a prior switch leaves the new sub trialing); excludes past_due so a delinquent account can't switch to restore access without paying. def live_subscriptions Stripe::Subscription.list(customer: stripe_customer_id, status: 'all', limit: 100).data - .select { |subscription| %w[active trialing past_due].include?(subscription.status) } + .select { |subscription| %w[active trialing].include?(subscription.status) } end def validate_payment_method!