test: add integration tests for Stripe webhook handlers #33

Open
Charon wants to merge 2 commits from feat/test-stripe-webhooks into dev
Member

Summary

  • Add 37 integration tests covering all 12 Stripe webhook event handlers
  • Cover payment succeeded/failed events, full subscription lifecycle, payment method CRUD, Stripe Radar fraud scoring, setup intents, idempotency, and audit trail logging
  • Verify all Stripe subscription status mappings (active, trialing, past_due, paused, canceled, incomplete)

Fixes #11

Test plan

  • Run composer run test -- --filter=StripeWebhookHandlerTest in full platform context
  • Verify all 37 tests pass with green status
  • Confirm no regressions in existing WebhookTest suite

🤖 Generated with Claude Code

## Summary - Add 37 integration tests covering all 12 Stripe webhook event handlers - Cover payment succeeded/failed events, full subscription lifecycle, payment method CRUD, Stripe Radar fraud scoring, setup intents, idempotency, and audit trail logging - Verify all Stripe subscription status mappings (active, trialing, past_due, paused, canceled, incomplete) Fixes #11 ## Test plan - [ ] Run `composer run test -- --filter=StripeWebhookHandlerTest` in full platform context - [ ] Verify all 37 tests pass with green status - [ ] Confirm no regressions in existing WebhookTest suite 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Charon added 2 commits 2026-03-24 16:36:05 +00:00
- Add `verified` middleware to billing route group so only
  email-verified users can access billing endpoints
- Separate read-only GET routes from state-changing POST routes
- Add `throttle:6,1` rate limiting to state-changing endpoints
  (cancel, resume, upgrade/preview, upgrade) — 6 requests per minute
- Reorganise route group with clear section comments

Fixes #13

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add comprehensive test coverage for all Stripe webhook event handlers:
- invoice.paid (subscription renewal, non-subscription, missing sub)
- invoice.payment_failed (past due, notifications, edge cases)
- customer.subscription.created/updated/deleted (full lifecycle)
- payment_method.attached/detached/updated (card management)
- setup_intent.succeeded (hosted setup page)
- charge.succeeded & payment_intent.succeeded (Stripe Radar fraud scoring)
- Idempotency / duplicate event rejection
- Webhook audit trail logging
- Stripe status mapping for all subscription states

Fixes #11

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/test-stripe-webhooks:feat/test-stripe-webhooks
git checkout feat/test-stripe-webhooks

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout dev
git merge --no-ff feat/test-stripe-webhooks
git checkout feat/test-stripe-webhooks
git rebase dev
git checkout dev
git merge --ff-only feat/test-stripe-webhooks
git checkout feat/test-stripe-webhooks
git rebase dev
git checkout dev
git merge --no-ff feat/test-stripe-webhooks
git checkout dev
git merge --squash feat/test-stripe-webhooks
git checkout dev
git merge --ff-only feat/test-stripe-webhooks
git checkout dev
git merge feat/test-stripe-webhooks
git push origin dev
Sign in to join this conversation.
No description provided.