feat: add context field to AuthorizeResult for settlement passthrough#154
Merged
feat: add context field to AuthorizeResult for settlement passthrough#154
Conversation
…sthrough Enable services like the LLM gateway to pass X402 paymentRequirements from the authorize step to the settle step without bundling them into the credential (which must remain the raw payment header for HTTP retry headers). - AuthorizeResult type: added optional `context` field - ATXPAccount.authorize(): passes through `context` from /authorize/auto response - ProtocolSettlement.buildRequestBody: clarified X402 paymentRequirements source Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ents - Add test for context passthrough (returns context when present) - Add test for context absence (undefined when not in response) - Simplify spread: always include context (undefined won't serialize) - Fix comment inconsistency: PAYMENT-SIGNATURE / X-PAYMENT (both valid) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
contextfield toAuthorizeResulttype for carrying settlement context (e.g., X402paymentRequirements) from the authorize response to the settle stepATXPAccount.authorize()to pass throughcontextfrom the/authorize/autoresponseProtocolSettlement.buildRequestBodythat X402paymentRequirementscome from context (MCP server: pricing config; LLM gateway: authorize response)This enables services like the LLM gateway to pass X402 paymentRequirements from authorize to settle without bundling them into the credential, which must remain the raw payment header for HTTP retry headers.
Test plan
🤖 Generated with Claude Code