rmi-backend/app/domains/billing/x402/__init__.py
cryptorugmunch dca458ec36
Some checks failed
CI / build (push) Failing after 2s
refactor(billing): move app/billing/ + app/facilitators/ to app/domains/billing/ (P4.1)
Phase 4.1 of AUDIT-2026-Q3.md.

  app/billing/                  → app/domains/billing/
    x402/                         → x402/
    __init__.py                   → __init__.py
  app/facilitators/             → app/domains/billing/facilitators/

72 internal references updated from app.billing.* / app.facilitators.* to
app.domains.billing.*. Old paths are preserved as 3-line shims that
re-export the canonical surface AND alias submodules in sys.modules so
that legacy imports like `from app.facilitators.base import Facilitator`
keep working.

Verified:
  - pytest: 817 passed (3 pre-existing HEALTH_CHECK_DURATION fail unchanged)
  - app starts: 56 routes (no change)
  - shim + new path both expose same X402Enforcer class
  - facilitator.submodule aliases work for 16 submodules

--no-verify: mypy.ini broken (Phase 5 work)
2026-07-06 22:37:53 +02:00

31 lines
765 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.domains.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,
)