Starts a local HTTP server demonstrating the full MPP 402 payment flow.
No real payment credentials needed — a magic "demo-token" payload succeeds.
mix mpp.demo
mix mpp.demo --port 8080Options
--port— port to listen on (default: 4402)
What It Does
- Starts a Bandit server with
MPP.Demo.Router GET /resourcereturns a 402 challenge withWWW-Authenticate: Payment- Retry with
Authorization: Payment <credential>to get a 200 withPayment-Receipt - The startup banner includes copy-paste curl commands
Requirements
Bandit must be available (it's a :dev dependency of mpp). If you're using
mpp as a library dependency, add {:bandit, "~> 1.10", only: :dev} to your deps.