TorbatYar/backend/services/payment/app/api/deps.py
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

10 lines
398 B
Python

from uuid import UUID
from fastapi import Request
from shared.exceptions import TenantNotResolvedError
from shared.tenant import STATE_TENANT_ID
from app.core.database import get_db
def require_tenant(request: Request):
tenant_id=getattr(request.state,STATE_TENANT_ID,None)
if tenant_id is None: raise TenantNotResolvedError("X-Tenant-ID required")
return UUID(str(tenant_id))