fix(request): enforce payment caps and network selection - #135
Merged
Conversation
Validate the selected payment challenge before wallet access or credential creation so SDK observation hooks cannot bypass --max-spend. Reject capped recurring subscriptions because per-period limits cannot enforce a cumulative cap, and validate decoded dry-run quotes without paying. Normalize network aliases with explicit flags taking precedence over the environment, pin payment clients to that network, and validate options through the shared execution boundary. Preserve the effective method, body and URL after redirects when retrying with payment credentials.
mattsse
requested changes
Sep 8, 2026
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.
Validate payment offers before credential creation so
--max-spendcannot be bypassed. Normalize network aliases, honor explicit flags over environment defaults, and reject incompatible chains. Dry-run now returns a decoded, validated quote without wallet access.Preserve the effective request after redirects and reject capped subscriptions whose recurring authorization cannot enforce a cumulative limit.
Validation: 197 tests passed, plus typechecks, lint, formatting and changelog validation.
AI-assisted