Add independent payment-service (port 8012, payment_db) with foundation licensing, BYO-PSP, merchant accounts, idempotent requests, callbacks, and immutable ledger. Co-authored-by: Cursor <cursoragent@cursor.com>
1.7 KiB
Phase 14.5 — Transaction Ledger
| Field | Value |
|---|---|
| Identifier | payment-14.5 |
| Implementation Priority | HIGH |
| Status | Complete |
| Service | payment |
| Depends On | payment-14.4 |
Full specification: payment-roadmap.md
Purpose
Immutable append-only payment transaction ledger as system of record for captured payments — distinct from Accounting journals.
Business Scope
Record paid transactions with PSP refs, fees, net amounts; query for admin and service-to-service status; completes HIGH priority MVP (14.0–14.5).
Technical Scope
Aggregates: PaymentTransaction, PaymentTransactionFeeLine, PaymentLedgerEntry. No monetary UPDATE post-insert.
Dependencies
payment-14.4
Out of Scope
Refunds (14.6), splits (14.7), Accounting journals.
Capabilities
payment.ledger, payment.transactions
Permissions
payment.transactions.view|export|manage
Events
payment.transaction.recorded, payment.ledger.entry_appended
API Contracts
GET /api/v1/payment-transactions, GET by source ref, GET ledger entries
Data Ownership
Payment owns payment ledger; Accounting owns GL.
Provider Ownership
PSP transaction ids as refs.
Integration Rules
Ledger write only after verified paid. Verticals query Payment for status.
Quality Gates
Immutability, append-only, tenant isolation, traceability.
Definition of Done
Paid flow produces ledger; queries work; HIGH priority path complete.
Future Compatibility
Multi-currency partitions; facilitator settlement batch ids.