Skip to main content

Module client

Module client 

Source
Available on crate feature client only.
Expand description

Client-side x402 payment handling for reqwest.

X402Client is a thin HTTP adapter over r402_core::PaymentClient: scheme registration, policies, selection, and lifecycle hooks live in core. This module maps signed payloads to Payment-Signature and dispatches on_payment_response after paid retries (including one corrective recovery).

Structs§

X402Client
HTTP middleware over a core PaymentClient.

Traits§

WithPayments
Extension trait for adding x402 payment handling to a reqwest Client.

Functions§

parse_payment_required
Parses a 402 Payment Required response into a wire::PaymentRequired.
payment_signature_headers
Builds the Payment-Signature header map from a created payment.