TorbatYar/docs/phases/Payment/phase-14-6-refunds-reversals.md
Mortezakoohjani 9fac160258 feat(payment): ship Torbat Pay MVP phases 14.0-14.5
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>
2026-07-27 17:57:04 +03:30

72 lines
1.4 KiB
Markdown

# Phase 14.6 — Refunds & Reversals
| Field | Value |
| --- | --- |
| Identifier | `payment-14.6` |
| Implementation Priority | **LATER** |
| Status | Planned |
| Service | `payment` |
| Depends On | `payment-14.5` |
> Full specification: [payment-roadmap.md](../../payment-roadmap.md#phase-14-6--refunds--reversals)
## Purpose
Full and partial refunds via PSP adapters with idempotency and ledger reversal entries.
## Business Scope
Merchant-initiated refunds; status tracking; payer notify via Communication.
## Technical Scope
RefundRequest, RefundStatusHistory, ledger reversal entries. Adapter `refund_payment()`.
## Dependencies
`payment-14.5`, Communication client
## Out of Scope
Chargeback disputes; Accounting credit notes (14.9 intents).
## Capabilities
`payment.refunds`
## Permissions
`payment.refunds.view|create|manage`
## Events
`payment.refund.requested|succeeded|failed`
## API Contracts
POST/GET `/api/v1/refund-requests`
## Data Ownership
Payment owns refunds; vertical owns RMA/return ref.
## Provider Ownership
PSP refund APIs via adapters.
## Integration Rules
Refund requires paid transaction; idempotent refund keys.
## Quality Gates
Partial refund math, failure handling, ledger integrity.
## Definition of Done
Mock refund with reversal and events.
## Future Compatibility
Multi-currency refund; facilitator fee reversal lines.