Skip to content

fix: forward x402 v2 extensions in payment payload for Bazaar discovery#197

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

fix: forward x402 v2 extensions in payment payload for Bazaar discovery#197
oceans404 wants to merge 1 commit intoopen-wallet-standard:mainfrom
oceans404:fix/x402-forward-extensions

Conversation

@oceans404
Copy link
Copy Markdown

Summary

Fixes #196

I was building Dermi (a skincare/makeup ingredient checker API) for the OWS hackathon and wanted to get it listed on the x402 Bazaar discovery layer. I had the v2 Bazaar extension configured correctly on the server side, and payments were going through the CDP facilitator successfully — but Dermi never appeared in the Bazaar.

After debugging, I found that OWS parses accepts and resource from the 402 PAYMENT-REQUIRED header but drops the extensions field. Since the facilitator reads extensions.bazaar from the payment payload during settle to catalog services, the discovery metadata was never reaching the facilitator.

Once I added extensions support to OWS, Dermi was indexed on both the CDP Bazaar and PayAI Bazaar immediately.

Changes

crates/ows-pay/src/types.rs

  • Add extensions: Option<serde_json::Value> to X402Response (so extensions are parsed from the 402 header)
  • Add extensions: Option<serde_json::Value> to PaymentPayloadV2 (so extensions are included in the payment sent back)

crates/ows-pay/src/x402.rs

  • parse_requirements now returns extensions as a 4th value
  • handle_x402 passes extensions through to build_signed_payment
  • build_signed_payment passes extensions to build_evm_exact
  • build_evm_exact includes extensions in the PaymentPayloadV2

Test plan

  • All 62 existing tests pass (cargo test -p ows-pay)
  • Tested against live Dermi endpoint on Base mainnet — payment succeeds and service appears in CDP Bazaar
  • Tested against PayAI facilitator — service appears with full inputSchema/outputSchema metadata
  • Backwards compatible — extensions is Option with serde(default), so 402 responses without extensions still work

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

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

A member of the Team first needs to authorize it.

@oceans404 oceans404 requested a review from njdawn as a code owner April 6, 2026 19:03
oceans404 added a commit to oceans404/core that referenced this pull request Apr 8, 2026
Same fix as the PR (open-wallet-standard#197), applied on top of the Stellar support
commits on main.

Fixes open-wallet-standard#196

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Same fix as the PR (open-wallet-standard#197), applied on top of the Stellar support
commits on main.

Fixes open-wallet-standard#196

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
oceans404 added a commit to oceans404/core that referenced this pull request Apr 8, 2026
Same fix as the PR (open-wallet-standard#197), applied on top of the Stellar support
commits on main.

Fixes open-wallet-standard#196

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@oceans404 oceans404 force-pushed the fix/x402-forward-extensions branch from 287bcfa to cf272c5 Compare April 8, 2026 16:37
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