Repository navigation
Fix TT-030: Abandoned checkout shows portal instead of Checkout - #883
Merged
Merged
Conversation
Regression from v1.22.18 where FREE org with abandoned checkout (Stripe customer but no subscription) incorrectly shows 'Change to Pro/Business' and opens Customer Portal with nothing to select. Fix: Organization settings page now computes hasStripeSubscription based on subscription status (active/trialing/past_due/incomplete/unpaid) instead of hasStripeCustomer. This matches the API guard logic from #879 and ensures: - Abandoned checkout orgs (customer, no sub) → 'Upgrade to' + Checkout ✓ - Active subscription orgs → 'Change to' + Portal ✓ Tests added: - Dashboard unit tests for OrganizationBillingActions with abandoned checkout - Verifies button text ('Upgrade to' vs 'Change to') - Verifies correct action (Checkout vs Portal) - Tests FREE no-sub, FREE with-sub, and PRO with-sub scenarios Refs #882 Co-authored-by: Sanja Malovic <[email protected]>
Co-authored-by: Sanja Malovic <[email protected]>
This was referenced Oct 27, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #882 (TT-030)
Problem
Regression from v1.22.18: A FREE org that once opened Stripe Checkout and abandoned it (has
stripe_customer_idbut NO subscription) incorrectly sees "Change to Pro/Business" buttons on Organization settings, which open the Customer Portal with nothing to select.Expected behavior (v1.22.17): Should show "Upgrade to Pro/Business" and open Checkout.
Root Cause
Organization settings page (
/dashboard/settings/organization/page.tsx) was still usinghasStripeCustomerinstead ofhasStripeSubscriptionbased on actual subscription status. This caused it to treat abandoned-checkout orgs as if they had active subscriptions.Fix
Updated organization settings page to compute
hasStripeSubscriptionusing the same logic as:Logic: Only treat as "has subscription" if
stripeSubscriptionStatusis one of:activetrialingpast_dueincompleteunpaidThis ensures:
Changes
Code
page.tsxline 123-135):hasStripeSubscriptionbased on subscription statusOrganizationUsageCard(maintainshasStripeCustomerprop name for component interface compatibility)OrganizationBillingActionscomponent (already uses the prop correctly)Tests
organization-billing-actions-abandoned-checkout.test.tsx):Testing
Local:
All pass ✅
Manual verification (once deployed):
Behavioral Changes
None for properly functioning orgs. Only fixes the broken abandoned-checkout case.
Security / Privacy
No security or privacy implications. Only affects button text and action routing based on subscription state.