Skip to content

railpay-python v0.5.0

Latest

Choose a tag to compare

@github-actions github-actions released this 22 Nov 21:08
  • PaywallMiddleware: ASGI middleware that puts a Paywall in front of chosen paths of any ASGI app (Starlette, FastAPI…). Unpaid requests get the 402. Paid ones reach the app, with PAYMENT-RESPONSE added to its answer.
  • railpay.fastapi.require_payment(paywall): a FastAPI dependency that returns the Charge, with PaymentRequiredError and payment_required_handler for an exact x402 402 body. Install it with the [fastapi] extra.
  • Examples: examples/agent.py (pays https://dapp.railpay.app/x402/time) and examples/fastapi_seller.py.
  • scripts/smoke.py: a read-only check against the live RailPay API and Robinhood Chain. It spends nothing.
  • README: seller integrations, examples and the full API.