Skip to main content

PaymentHook

Type Alias PaymentHook 

Source
pub type PaymentHook = Box<dyn Fn(&Value) -> Result<HashMap<String, String>, Box<dyn Error>> + Send + Sync>;
Expand description

0.5.1 โ€” payment hook: called once with the 402 challenge body, returns headers to retry the request with (e.g. {"x-payment": "..."} for x402, {"tempo-payment": "..."} for tempo). Pair with Dispatch::wallet_hook(provider, credentials) for the built-in CDP / Privy / Bridge factories, or build a closure yourself for any custom wallet stack.

Aliased Typeยง

pub struct PaymentHook(/* private fields */);