TorbatYar/backend/services/payment/README.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

50 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Torbat Pay — Enterprise Payment Platform
Independent, tenant-isolated payment microservice (**Torbat Pay**) implementing phases **14.014.5** (MVP).
| Field | Value |
| --- | --- |
| Service | `payment-service` |
| Version | **0.14.5.0** |
| Port | **8012** |
| Database | `payment_db` |
| API prefix | `/api/v1` |
| OpenAPI | `/docs` (FastAPI auto-generated) |
## Capabilities (14.5)
- Foundation: workspaces, L2 bundles, L3 toggles, provider assignments, audit, outbox
- BYO-PSP: connections, routing, mock adapter + health test
- Torbat Pay Merchant: merchant account lifecycle
- Payment requests: idempotency, mock redirect, credit ref fields (nullable)
- Callbacks: signature verify, replay protection, verify API
- Ledger: immutable transactions + append-only ledger entries
## Reserved (not implemented)
- `CREDIT_PROVIDER` payment source → Torbat Credit (422 until bundle + service exist)
- Refunds, splits, connectors, reconciliation (phases 14.6+)
## Local development
```bash
cd backend/services/payment
pip install -e ../../shared-lib
pip install -r requirements.txt
pytest app/tests -q
```
## Migrations
Alembic head: `0006_phase_145_ledger`
```bash
python scripts/ensure_db.py && alembic upgrade head
```
## Documentation
- [payment-roadmap.md](../../docs/payment-roadmap.md)
- [payment-contracts.md](../../docs/reference/payment-contracts.md)
- [phase-14-5 handover](../../docs/phase-handover/phase-14-5.md)