Fix #1466 surface subscription cancellation reason in admin UI#1490
Open
chrisjsimpson wants to merge 1 commit into
Open
Fix #1466 surface subscription cancellation reason in admin UI#1490chrisjsimpson wants to merge 1 commit into
chrisjsimpson wants to merge 1 commit into
Conversation
Shop owners could see that a subscription had been cancelled, but not why. Persist Stripe's ``cancellation_details.reason`` on the local Subscription (new ``stripe_cancellation_reason`` column, populated from the ``customer.subscription.deleted`` webhook and the manual refresh path) and surface it on the subscribers list and subscriber detail pages alongside the existing cancellation metadata. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
Playwright verification artifactsRan the new spec
Local artifacts saved to Spec output: |
470443c to
e8f4c18
Compare
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.
Summary
Closes #1466.
Shop owners could previously see that a subscription had been cancelled, but the why (Stripe's
cancellation_details.reason) was only visible on the shop-wide "recent cancellations" report, not on the subscribers list where they naturally look.Subscription.stripe_cancellation_reasoncolumn (+ alembic migration) populated from:customer.subscription.deletedStripe webhook, and/admin/subscribers) and the per-subscriber detail page, with human-friendly labels + explainer popovers for the three reasons Stripe emits (payment_failed,cancellation_requested,payment_disputed).tests/test_webhook_subscription_cancellation_reason.py) verifying the webhook now persists the reason, and a Playwright spec (1466_subscription_cancellation_reason_visible.spec.js) that records a video and captures screenshots of the reason in the UI.Proof
(see attached
1466-subscribers-page.png,1466-subscriber-detail-page.png, andissue-1466-cancellation-reason.webmfor the Playwright video.)Test plan
pytest tests/ --ignore=tests/browser-automated-tests-playwright— 28 passed, 1 skippedflask db upgradesucceeds on existing SQLite DB (subscription.stripe_cancellation_reasoncolumn added)@1466_subscription_cancellation_reason_visiblerecords video + screenshots and asserts the reason is visible on the subscribers list and detail pagescustomer.subscription.deletedwebhook withcancellation_details.reason = payment_failedand confirm it renders as "Payment failed"🤖 Generated with Claude Code