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>
10 lines
398 B
Python
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))
|