Repository navigation
Billing: read a customer portal cancellation as not renewing - #87
Merged
Merged
Conversation
The Stripe customer portal schedules a period-end cancellation through `cancel_at` and leaves `cancel_at_period_end` false, so a subscriber who cancelled there still read as renewing. Store either form in the `cancel_at_period_end` column, and let StripeDev make the portal's form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A real Stripe sandbox shows the customer portal's "Cancel subscription" (mode
at_period_end) setscancel_atto the period's end and leavescancel_at_period_endfalse, at API version2026-08-26.dahlia.@pgstencil/stripecopied only the boolean, so a subscriber who cancelled in the portal stayedcancel_at_period_end = false, and an application reading that column treats them as renewing. Dormouse Hosted's billing page said "Renews automatically" after a cancel, and its renewal notices would have kept going out.cancel_at_period_endas true when the boolean is set, or whencancel_atfalls on or before the current period's end. Acancel_atfurther out still renews at this period's end, so it stays false.portal-canceltransition makes the portal's form, since the existingcancel-at-period-endtransition can't reproduce this.The new test goes red with the fixed line reverted.
tests/integration/billing.test.ts,pnpm typecheckandpnpm format:checkpass locally; I haven't run the fullpnpm check.🤖 Generated with Claude Code