From 3680da7e48386bb6c5ea3d53d7173189b8779c25 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Tue, 9 Jun 2026 17:56:25 +0530 Subject: [PATCH] fix(billing): switch default plan immediately to active sub in new currency --- .../services/enterprise/billing/switch_currency_service.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/enterprise/app/services/enterprise/billing/switch_currency_service.rb b/enterprise/app/services/enterprise/billing/switch_currency_service.rb index 52fbc0f66..fa7ca38e1 100644 --- a/enterprise/app/services/enterprise/billing/switch_currency_service.rb +++ b/enterprise/app/services/enterprise/billing/switch_currency_service.rb @@ -64,7 +64,9 @@ class Enterprise::Billing::SwitchCurrencyService new_price_id: resolve_new_price_id(plan), original_price_id: subscription['plan']['id'], quantity: subscription['quantity'], - paid_through: subscription_period_end(subscription), + # Paid plans preserve paid-through (new sub trials until then); the free default plan switches + # immediately to an active sub, so a default-plan account can switch again any time. + paid_through: default_price?(subscription) ? nil : subscription_period_end(subscription), key: subscription.id } end