Class X402::Middleware ¶
Inherits: Object
Pure Rack dispatcher for payment-gated HTTP.
The middleware has no blockchain knowledge — it matches routes, issues payment challenges by polling configured gateways, and dispatches proofs to the matching gateway for settlement.
- @see
X402::Configurationfor full configuration options
@example config.ru
Public Instance Methods¶
call(env) ¶
- @param
env[Hash] Rack environment - @return [Array(Integer, Hash, Array)] Rack response triple
initialize(app) ¶
- @param
app[#call] next Rack app in the middleware stack - @return [Middleware] a new instance of Middleware