Skip to content

Block Ultra checkout for users who already have a paid subscription - #607

Merged
simonhamp merged 1 commit into
mainfrom
block-duplicate-subscription-checkout
Nov 12, 2026
Merged

simonhamp merged 1 commit into
mainfrom
block-duplicate-subscription-checkout

Conversation

@simonhamp

Copy link
Copy Markdown
Member

MobilePricing::createCheckoutSession didn'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 second default subscription 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:

  • Comped subscribers still go through checkout, and their comped sub is cancelled as before.
  • Subscriptions that are cancelled but still in their grace period count as active, so those users are blocked. They can resume from the dashboard.
  • The logged-out redirect tells whoever typed the email that the account has an active subscription. That's a small leak, so say if you'd prefer vaguer wording.
  • This doesn't cover the Stripe billing portal. Whether it accepts promotion codes on existing subscriptions depends on the portal settings in Stripe, which I haven't looked at.

There are three new tests in MobilePricingTest.

🤖 Generated with Claude Code

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]>
@simonhamp
simonhamp merged commit 447ddae into main Nov 12, 2026
3 checks passed
@simonhamp
simonhamp deleted the block-duplicate-subscription-checkout branch November 12, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant