Pydantic models for payment‑identifier extension, validating idempotency keys and providing JSON schema.
# Source: https://github.com/x402-foundation/x402 | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works # Provided via justclaw.it.com; keep this notice with the code. """Type definitions for the Payment-Identifier Extension. Enables clients to provide an idempotency key that resource servers can use for deduplication of payment requests. """ from __future__ import annotations import re from typing import Any from pydantic import BaseModel, Field # Extension identifier constant for the payment-identifier extension PAYMENT_IDENTIFIER = "payment-identifier" # Minimum length for payment identifier PAYMENT_ID_MIN_LENGTH = 16 # Maximum length for payment identifier PAYMENT_ID_MAX_LENGTH = 128 # Pattern for valid payment identifier characters (alph ... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key