Skip to content

Billing: a cancel within 3 days of a renewal is refunded; shorter cancel popups - #260

Merged
MeharPro merged 1 commit into
mainfrom
fix/cancel-refund-3-days
Nov 18, 2026
Merged

MeharPro merged 1 commit into
mainfrom
fix/cancel-refund-3-days

Conversation

@MeharPro

Copy link
Copy Markdown
Contributor

The owner, 2026-11-18: "If they cancel genclass within the first 3 days of it being renewed let them get a refund", and the popups' "not on . Nothing is refunded for the days left." is extra and goes.

  • POST /api/billing/cancel first gives the last payment back to the card, in full, when it was a renewal of the last 3 days, then ends the plan (src/stripe.ts refundableOnCancel, through the refund code plan switches already use: idempotent, never a balance credit). A renewal is the charge at the end of the trial and each month's after it; the charge that starts a subscription is not one, so subscribing again after a cancel is not a free plan. It answers { ok, ended: true, ends: null, refunded }.
  • A refund that fails never stops the cancel. The owner's plan_cancelled notice says what went back, or why nothing did.
  • GET /api/billing/cancel says refund (the amount, when a cancel now gives it back).
  • The popups: "Pro ends as soon as you cancel." and "This is the last step. Pro ends now.", with "Your last payment (50.00 USD) is refunded." only when there is one.

Checks: tsc clean; telemetry-worker vitest: test/cancel.test.ts 17 passed (3 new). The full suite passed 923 of 924 and then 920 of 924 on a Mac at load 30, different tests each time (timeouts); the files that failed pass on their own.

🤖 Generated with Claude Code

…cel popups

The owner, 2026-11-18: "If they cancel genclass within the first 3 days of it being renewed let them get a refund",
and the popups' "not on <date>. Nothing is refunded for the days left." is extra and goes.

POST /api/billing/cancel first gives the last payment back to the card, in full, when it was a renewal (the charge at
the end of the trial and each month's after it; never the charge that starts a subscription, so subscribing again
after a cancel is not a free plan) of the last 3 days, then ends the plan. A refund that fails never stops the
cancel; the owner's notice says what went back or why nothing did. The popups say the plan ends as soon as you
cancel, and name the refund only when there is one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@MeharPro
MeharPro merged commit f430ce0 into main Nov 18, 2026
4 checks passed
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