fix: forward x402 v2 extensions in payment payload#211
Open
ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
Open
fix: forward x402 v2 extensions in payment payload#211ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
Conversation
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 is attempting to deploy a commit to the MoonPay Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #196
Problem
When an x402 server returns a 402 response with
extensions(e.g. Bazaar discovery metadata), OWS was silently dropping the field.X402Responsehad noextensionsfield so it was lost during deserialization, andPaymentPayloadV2had noextensionsfield 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
extensions: Option<serde_json::Value>toX402Responseextensions: Option<serde_json::Value>toPaymentPayloadV2extensionsthroughparse_requirements→build_signed_payment→build_evm_exactso it is included in the v2 payment payloadTests
Added two unit tests:
build_evm_exact_v2_forwards_extensions— verifies extensions are present in the v2 payloadbuild_evm_exact_v2_no_extensions_is_none— verifies None when not providedAll 67 existing tests continue to pass.