Skip to content

fix: forward x402 v2 extensions in payment payload#211

Open
ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
ygd58:fix/x402-v2-forward-extensions
Open

fix: forward x402 v2 extensions in payment payload#211
ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
ygd58:fix/x402-v2-forward-extensions

Conversation

@ygd58
Copy link
Copy Markdown

@ygd58 ygd58 commented Apr 19, 2026

Closes #196

Problem

When an x402 server returns a 402 response with extensions (e.g. Bazaar discovery metadata), OWS was silently dropping the field. X402Response had no extensions field so it was lost during deserialization, and PaymentPayloadV2 had no extensions field so it could never be included in the payment signature header sent back to the server.

This caused services using the Bazaar extension to never appear in CDP or PayAI Bazaar discovery when payments were made through OWS.

Fix

  • Add extensions: Option<serde_json::Value> to X402Response
  • Add extensions: Option<serde_json::Value> to PaymentPayloadV2
  • Thread extensions through parse_requirementsbuild_signed_paymentbuild_evm_exact so it is included in the v2 payment payload

Tests

Added two unit tests:

  • build_evm_exact_v2_forwards_extensions — verifies extensions are present in the v2 payload
  • build_evm_exact_v2_no_extensions_is_none — verifies None when not provided

All 67 existing tests continue to pass.

Closes open-wallet-standard#196

X402Response and PaymentPayloadV2 were missing the extensions field,
causing the bazaar discovery metadata to be dropped during
deserialization and never forwarded in the payment signature header.

Changes:
- Add extensions field to X402Response (deserialization)
- Add extensions field to PaymentPayloadV2 (serialization)
- Thread extensions through parse_requirements, build_signed_payment,
  and build_evm_exact so it is included in the v2 payment payload
- Add two unit tests: forwards extensions when present, None when absent
@ygd58 ygd58 requested a review from njdawn as a code owner April 19, 2026 13:19
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 19, 2026

@ygd58 is attempting to deploy a commit to the MoonPay Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x402 v2: Client doesn't forward extensions in payment payload, breaking Bazaar discovery

1 participant