Move app/routers/x402_enforcement.py verbatim to app/billing/x402/enforcement.py with a thin X402Enforcer class wrapper exposing the public API. The legacy app/routers/x402_enforcement.py becomes a re-export shim. Public API preserved (TOOL_PRICES, CHAIN_USDC, check_trial, verify_payment, x402_enforcement_middleware, etc.). Routes unchanged (56). Phase 3B of AUDIT-2026-Q3.md.
31 lines
757 B
Python
31 lines
757 B
Python
"""x402 billing subsystem.
|
|
|
|
Phase 3B of AUDIT-2026-Q3.md.
|
|
|
|
Re-exports the canonical public API of the x402 payment enforcement
|
|
middleware. Implementation lives in app.billing.x402.enforcement
|
|
(moved verbatim from app.routers.x402_enforcement on 2026-07-07).
|
|
"""
|
|
from app.billing.x402.enforcement import ( # noqa: F401
|
|
CHAIN_USDC,
|
|
EVM_PAY_TO,
|
|
SECURITY_HEADERS,
|
|
SOL_PAY_TO,
|
|
TOOL_PRICES,
|
|
VERIFIER,
|
|
X402Enforcer,
|
|
build_402_response,
|
|
check_idempotency,
|
|
check_trial,
|
|
consume_trial,
|
|
get_redis_async,
|
|
get_revenue,
|
|
get_trial_status,
|
|
parse_x_pay_header,
|
|
request_refund,
|
|
self_verify_evm_usdc,
|
|
verify_payment,
|
|
verify_payment_via_router,
|
|
x402_discovery,
|
|
x402_enforcement_middleware,
|
|
)
|