Repository navigation
fix(core): show a Stripe subscription with paused collection as paused - #137
Merged
cavewebs merged 1 commit intoDec 3, 2026
Merged
Conversation
The admin's Pause sets `pause_collection` at Stripe, but Stripe keeps the subscription's status `active`. `upsertFromStripe` stored Stripe's status as it was, so the row stayed Active and Resume (offered only for paused rows) never appeared. An active or trialing subscription with `pause_collection` set is now stored as `paused`. Once collection resumes Stripe clears the field and the row goes back to its Stripe status. Other statuses, such as `past_due`, are kept so a payment problem isn't hidden. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Dec 5, 2026
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.
Bug
The admin's Pause sets
pause_collectionat Stripe, but Stripe keeps the subscription's statusactive.upsertFromStripestores Stripe's status as it is, so the row stays Active after thecustomer.subscription.updatedwebhook, and Resume, which the admin offers only forpausedrows, never appears. Found while testing a shop end to end: once paused, a subscription couldn't be resumed from the admin.Fix
An
activeortrialingsubscription withpause_collectionset is stored aspaused. When collection resumes, Stripe clearspause_collectionand the row goes back to Stripe's status. Other statuses (past_due,unpaid,canceled, …) are kept as Stripe sends them, so a payment problem isn't hidden behind "paused".Tests
New
packages/core/test/stripe-subscription-paused.test.ts, 4 tests, each through the real webhook route with a signedcustomer.subscription.updated:pause_collectionis stored aspaused;pause_collection: nullsets it back toactive;past_duewithpause_collectionstayspast_due.3 fail without the fix; the
past_duetest passes both ways, as intended. Full suite: core 364 pass (plus the 4 localrouting-response-adapterfailures noted in the other PRs), paystack 105, lite 144. Core typecheck and Biome lint clean.Compatibility
Only rows for paused Stripe subscriptions change.
pausedis already aSubscriptionStatusand the admin already offers Resume for it.Review points
pausedstatus (a trial that ended with no payment method) is unchanged and still comes through aspaused.lifecycle.ts, which feat(flutterwave): Flutterwave payment provider package #107 is changing, so it's left for later.Works on a real store once #127 merges: until
customers.stripeCustomerIdis indexed,customer.subscription.*webhooks fail before they reach this code. The code doesn't depend on #127 and merges on its own.