feat: handle Stripe customer portal webhook events (#25)#26
Merged
Conversation
Add webhook handlers for payment_method.attached, payment_method.detached, and customer.updated events. Fix command routing, add idempotency checks, and integration tests using Stripe CLI with fishForMessage probes. - DisablePaymentMethodFromWebhook routes via debitedAccount (customer ID from previous_attributes, since customer is null after detach) - RegisterPaymentMethodFromWebhook skips persistence if card already exists - UpdateCustomerFromWebhook extends PaymentAccountCommand (not PaymentMethodCommand), handler moved to PaymentBehavior - Add PaymentMethodNotFound error type for consistent error responses - Register webhook endpoint for customer.updated, payment_method.attached/detached - Integration tests for all 3 webhook events + recurring payment first invoice check Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
==========================================
- Coverage 41.24% 40.76% -0.49%
==========================================
Files 155 155
Lines 10405 10528 +123
Branches 1616 1589 -27
==========================================
Hits 4292 4292
- Misses 6113 6236 +123
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Add webhook handlers for payment_method.attached, payment_method.detached, and customer.updated events. Fix command routing, add idempotency checks, and integration tests using Stripe CLI with fishForMessage probes.