Repository navigation
Block Ultra checkout for users who already have a paid subscription - #607
Merged
Merged
Conversation
createCheckoutSession had no check for an existing subscription. An Ultra subscriber could log out, enter their own email in the purchase modal and get a fresh Stripe Checkout that accepts promotion codes. Paying would create a second subscription alongside the first. Now they're redirected to the dashboard (or login, if logged out) instead. Comped subscribers can still check out as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
MobilePricing::createCheckoutSessiondidn't check for an existing subscription. The pricing page hides the button from Ultra subscribers, but anyone could log out and enter their own email in the purchase modal. That opens a new Stripe Checkout with promotion codes enabled. If they paid, say with a Black Friday code, they'd end up with a seconddefaultsubscription billing alongside the first.The method now returns early when the user has an active subscription that isn't comped. It logs a warning and redirects to the dashboard, or to login if they came through the logged-out modal. Both pages already show
session('message').Things to check:
There are three new tests in
MobilePricingTest.🤖 Generated with Claude Code