Protocol-versioned verify request/response types with generic payloads, scheme routing helpers, and structured Valid/Invalid outcomes including extension side-channels.
// Source: https://github.com/qntx/r402 | License: Apache-2.0 | Copyright 2025 qntx
// Provided via justclaw.it.com; keep this notice with the code.
//! Facilitator `/verify` request and response.
use compact_str::CompactString;
use serde::{Deserialize, Serialize};
use super::{Extensions, Version};
use crate::error::{ErrorReason, FacilitatorError, VerificationError};
use crate::scheme::SchemeSlug;
/// Protocol-versioned verify request parameterized by payload and requirements.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TypedVerifyRequest<const V: u8, TPayload, TRequirements> {
/// Protocol version marker.
pub x402_version: Version<V>,
/// Signed payment authorization.
pub payment_payload: TPayload,
/// Payment terms
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key