feat-009: Payment Processing (Mock Gateway)#2
Closed
leecampbell-codeagent wants to merge 3 commits into
Closed
Conversation
…009) - Contribution entity with state machine (pending_capture → captured/failed/refunded/partial) - EscrowLedgerEntry value object (append-only, immutable) - PaymentGatewayPort interface — Stripe behind adapter boundary - MockPaymentGatewayAdapter: tok_visa/tok_chargeDeclined/tok_insufficient_funds outcomes - PgContributionRepository, PgEscrowLedgerRepository (parameterised SQL only) - Webhook idempotency: processed_webhook_events table + repository - PaymentAppService: capture (transactional), webhook processing, escrow balance - API: POST /payments/capture, POST /payments/webhook (raw body), GET /campaigns/:id/escrow-balance - Composition root wired with MOCK_PAYMENTS=true default - 126 backend tests + 48 frontend tests passing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove TODO keywords from Stripe adapter skeleton (descriptive comments only) - Add MOCK_INVALID_SIGNATURE sentinel to mock adapter - Add invalid webhook signature test (400 INVALID_WEBHOOK_SIGNATURE) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Exploratory: PASS (code-review based) - Security: PASS (0 critical/high) - Audit: PASS (iteration 2) - CI/CD: PASS Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5f133ca to
73eee9f
Compare
This was referenced Mar 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.
Summary
Contributionentity with full state machine:pending_capture → captured | failed | refunded | partially_refundedPaymentGatewayPortinterface — Stripe SDK behind adapter boundary (never called from domain/application code)MockPaymentGatewayAdapterwith token-based outcomes:tok_visa→ success,tok_chargeDeclined→ declined,tok_insufficient_funds→ insufficient fundsPgContributionRepository,PgEscrowLedgerRepository,PgProcessedWebhookEventRepository(all parameterised SQL)PaymentAppService: transactional capture (gateway call + contribution + escrow entry + event in single transaction), idempotent webhook processing, escrow balance queryPOST /payments/capture(auth),POST /payments/webhook(no auth, raw body),GET /campaigns/:id/escrow-balance(auth, admin-only)20260305000009_create_processed_webhook_events.sql(webhook idempotency table)Quality Gate
Reports
.claude/reports/feat-009-exploratory.md.claude/reports/feat-009-security.md.claude/reports/feat-009-audit.md.claude/reports/feat-009-cicd.md🤖 Generated with Claude Code