Skip to content

Keep checking the plan after Stripe sends the student back - #169

Merged
Programcode merged 1 commit into
mainfrom
cursor/checkout-return-tier-791b
Oct 22, 2026
Merged

Programcode merged 1 commit into
mainfrom
cursor/checkout-return-tier-791b

Conversation

@Programcode

Copy link
Copy Markdown
Owner

Stripe sends the student to Settings with ?checkout=success before the webhook has written Pro. Settings trusted the first subscription read, and that read stays fresh for a minute, so a successful payment could sit on Expired with an Upgrade button.

Settings now polls about every 2 seconds for about 20 seconds after a successful return, until the plan is Pro or Legacy Free. While it waits, the subscription card says "Confirming your Pro subscription…" instead of Expired. When the plan appears, a toast says the subscription is active and the Stripe query params are removed. If Stripe is still quiet after the window, a toast says a refresh will catch up. ?checkout=canceled toasts that no charge was made and clears the params. Copy is in English, Spanish, and Hungarian.

UI change for the preview: the confirming line and the three toasts on Settings. Please look at that card after a checkout return. I could not drive a real Stripe redirect here.

Verified locally (GitHub Actions is out of minutes, so this is not a CI pass):

  • npx vitest run src/test/billing/checkout-return.test.ts (5 passed)
  • npx eslint on the new helper, Settings, and the test
  • npm run typecheck
  • npm run docs:check

Not run: npm run verify and a browser pass through Stripe.

Open in Web Open in Cursor 

Settings trusted the first subscription read, which often arrives before the
webhook and then stays stale, so a successful payment looked expired. A
successful return now waits and refreshes until Pro shows up, and a canceled
return says no charge was made.

Co-authored-by: Gáborjáni-Szabó Ádám <Programcode@users.noreply.github.com>
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Oct 22, 2026 11:08am UTC
debatelab-staging Ready Ready Preview Oct 22, 2026 11:08am UTC

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 4f9e0a0 and ba9dd8c.

📒 Files selected for processing: 6
  • src/lib/billing/checkout-return.ts
  • src/locales/en.json
  • src/locales/es.json
  • src/locales/hu.json
  • src/pages/SettingsPage.tsx
  • src/test/billing/checkout-return.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Programcode
Programcode merged commit a69e96f into main Oct 22, 2026
7 of 14 checks passed

This branch was successfully deployed

2 active deployments
Preview – debate-navigator — ba9dd8cb Deployed Oct 22, 2026 by vercel[bot]
Preview – debatelab-staging — ba9dd8cb Deployed Oct 22, 2026 by vercel[bot]
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.

3 participants