TorbatYar/backend/services/payment/app/tests/test_security.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

11 lines
673 B
Python

import pytest
from app.tests.conftest import headers
@pytest.mark.asyncio
async def test_tenant_required(client):
assert (await client.get("/api/v1/payment-workspaces")).status_code in (400,422)
@pytest.mark.asyncio
async def test_psp_secrets_redacted(client):
await client.post("/api/v1/tenant-bundles",headers=headers(),json={"bundle_code":"payment.byo_psp.basic","is_active":True})
r=await client.post("/api/v1/psp-connections",headers=headers(),json={"provider_code":"mock","credential_vault_ref":"vault://secret","secret_config":{"password":"x"}})
assert r.json()["credential_vault_ref"]=="***REDACTED***" and "secret_config" not in r.json()