feat(x402): add MPP and Stripe compatibility#651
Open
bussyjd wants to merge 1 commit into
Open
Conversation
This was referenced Jun 17, 2026
[MPP 2/3] spike(x402): credit-card verifier seam — buildCardRequirement + Stripe cardSettleFunc
#606
Closed
Base automatically changed from
chore/hermes-agent-stripe-image
to
integration/v0.11.0
June 17, 2026 12:08
6b3be1f to
1cc3dd8
Compare
1cc3dd8 to
bb0da87
Compare
bb0da87 to
9a88f54
Compare
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
main.PAYMENT-REQUIRED,X-PAYMENT, andX-PAYMENT-RESPONSEclients.Stripe SPT Flow
sequenceDiagram participant Client as Hermes buyer participant Verifier as x402 verifier participant StripeCLI as Stripe Link CLI participant StripeAPI as Stripe API participant Upstream as Paid service Client->>Verifier: Request protected route Verifier-->>Client: 402 with PAYMENT-REQUIRED and WWW-Authenticate method=stripe Client->>StripeCLI: Create Shared Payment Token from challenge StripeCLI-->>Client: Shared Payment Token Client->>Verifier: Retry with Authorization Payment or X-PAYMENT Verifier->>StripeAPI: Authorize PaymentIntent with manual capture Verifier->>Upstream: Proxy request alt upstream success Verifier->>StripeAPI: Capture PaymentIntent Verifier-->>Client: Upstream response with payment receipt headers else upstream failure Verifier->>StripeAPI: Cancel authorization Verifier-->>Client: Upstream error endTempo MPP Flow
sequenceDiagram participant Client as Hermes buyer or mppx participant Verifier as x402 verifier participant TempoRPC as Tempo RPC participant Upstream as Paid service Client->>Verifier: Request protected route Verifier-->>Client: 402 with WWW-Authenticate method=tempo Client->>Verifier: Retry with Authorization Payment signed pull credential Verifier->>Verifier: Preflight challenge, request, signature, and replay guard Verifier->>Upstream: Proxy request alt upstream success Verifier->>TempoRPC: Broadcast signed transaction and wait receipt TempoRPC-->>Verifier: Verified receipt Verifier-->>Client: Upstream response with payment receipt headers else upstream failure Verifier->>Verifier: Release replay reservation without broadcast Verifier-->>Client: Upstream error endCompatibility Notes
WWW-Authenticate: Payment ...header per advertised rail usingHeader().Add.Authorization: Payment ...alongside legacyX-PAYMENT.profileId/STRIPE_PROFILE_ID; the unreleasedstripe-network-idcompatibility alias is intentionally not included.networkIdonly inside the MPP challenge payload where Stripe clients expect it, derived fromprofileId.Coverage Follow-Up
WWW-Authenticaterail headers,Authorization: Paymentmethod parsing, TempoHandleProxydispatch, settle-failure release, bad transaction credentials, and real gateway release/settle error branches.Validation
go test -coverprofile=/tmp/obol-mpp-coverage-after.out ./cmd/obol ./internal/monetizeapi ./internal/schemas ./internal/serviceoffercontroller ./internal/x402 -count=1go test -race ./cmd/obol ./internal/monetizeapi ./internal/schemas ./internal/serviceoffercontroller ./internal/x402 -count=1git diff --checkstripe-network-id,STRIPE_NETWORK_ID, orDeprecated alias.Coverage highlights after the follow-up:
internal/x402: 73.5%validateStripeCardMinimum: 90.9%addMPPAuthenticateHeaders: 88.9%mppAuthorizationMethod: 100.0%serveTempoMPPGated: 88.5%HandleProxy: 79.4%Supersedes