Skip to content

Hosted billing: a renewal notice states the price a pending price change sets - #1589

Merged
nedtwigg merged 1 commit into
mainfrom
renewal-notice-price
Nov 5, 2026
Merged

nedtwigg merged 1 commit into
mainfrom
renewal-notice-price

Conversation

@nedtwigg

@nedtwigg nedtwigg commented Nov 5, 2026

Copy link
Copy Markdown
Member

Found in the Stripe sandbox for #1074 (2026-11-05, test clock): a yearly subscriber renewing in 20 days, with a price change from $100 to $120, got the price-change notice ("from $100 to $120 … starting with your renewal") and, in the same cron run, the renewal notice saying "for another year at $100". The renewal charged $120 plus VAT.

  • sendNotices now prices a renewal notice or annual reminder at the change's new Price when that change has a notice for the same renewal that went at least 7 days ahead, or is unsent and can still go in time (more than 8 days ahead). Otherwise it keeps the subscription's current Price, so a change that will not apply never shows.
  • A renewal notice sent at 30 days, before a change's notice at 21, still states the old price; the later price-change notice says what changes.
  • docs/specs/hosted.md -> "Billing notices" states the rule.
  • hosted/README.md -> "Stripe setup" records the decision to keep Link on. Its instant bank payments ("Pay with Bank" at Checkout) cannot be switched off without turning Link off, and a refund to a bank account takes a few days to succeed.

The new test covers a renewal inside both windows, a change notice sent too late, and one that can no longer go in time. It fails without the fix, and each branch of the guard was mutation-checked. pnpm test:hosted: 374 passed. I'll rerun the sandbox scenario on this branch.

🤖 Generated with Claude Code

A yearly subscriber whose renewal was inside both the renewal notice's 30 days and a price change's 21 got both emails in one cron run, the renewal notice still giving the old price. It now states the change's new Price whenever that change's notice for the same renewal went, or can still go, early enough to apply.

The Stripe setup also records that Link stays on, with its instant bank payments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: b2607ca
Status: ✅  Deploy successful!
Preview URL: https://85b06662.mouseterm.pages.dev
Branch Preview URL: https://renewal-notice-price.mouseterm.pages.dev

View logs

@nedtwigg
nedtwigg merged commit 9198596 into main Nov 5, 2026
14 checks passed
@nedtwigg
nedtwigg deleted the renewal-notice-price branch November 5, 2026 23:50
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.

2 participants