Skip to content

spec: add Accept-Payment negotiation#231

Merged
brendanjryan merged 2 commits intomainfrom
brendan/accept-payment-header
Apr 13, 2026
Merged

spec: add Accept-Payment negotiation#231
brendanjryan merged 2 commits intomainfrom
brendan/accept-payment-header

Conversation

@brendanjryan
Copy link
Copy Markdown
Collaborator

@brendanjryan brendanjryan commented Apr 9, 2026

Summary

Many MPP servers support multiple methods/intents, which is good for increasing coverage of compatible clients, but can result in wasted computation on the server (generating details for methods that a client may never use) as well as unclear selection criteria in clients, which today use the first supported method returned by the server

We address this by adding an Accept-Payment header, which allows clients to declare which payment methods they support and their relative preference.

This is modeled after the Accept-Language header

https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Language

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Spec Preview

Spec Changed Artifacts
draft-card-charge-00 - HTML · TXT · XML · PDF
draft-httpauth-payment-00 Yes HTML · TXT · XML · PDF
draft-lightning-charge-00 - HTML · TXT · XML · PDF
draft-lightning-session-00 - HTML · TXT · XML · PDF
draft-payment-discovery-00 - HTML · TXT · XML · PDF
draft-payment-intent-charge-00 - HTML · TXT · XML · PDF
draft-payment-transport-mcp-00 - HTML · TXT · XML · PDF
draft-solana-charge-00 - HTML · TXT · XML · PDF
draft-stellar-charge-00 - HTML · TXT · XML · PDF
draft-stripe-charge-00 - HTML · TXT · XML · PDF
draft-tempo-charge-00 - HTML · TXT · XML · PDF
draft-tempo-session-00 - HTML · TXT · XML · PDF

Browse preview release assets

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e732c27d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +578 to +581
- Filter challenges to those matching at least one declared range with `q>0`
- Order matching challenges by descending client `q` value
- Preserve server preference order when multiple matches have the same `q`
- Prefer the most specific matching range when multiple ranges match the same challenge
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply specificity before q>0 filtering

The selection rules let a challenge pass as long as it matches any range with q>0, which means an explicit opt-out can be overridden by a broader wildcard. For example, Accept-Payment: tempo/*;q=1, tempo/charge;q=0 would still allow tempo/charge under the current bullets, even though the client explicitly disallowed it. This breaks the stated “same weighted-preference model” behavior and can cause servers to return challenges the client said not to use; compute the effective match from the most specific range first, then drop challenges whose effective q is 0.

Useful? React with 👍 / 👎.

Comment thread specs/core/draft-httpauth-payment-00.md Outdated
Examples:

~~~http
Accept-Payment: tempo/charge, tempo/session, stripe/charge;q=0.5
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@brendanjryan brendanjryan merged commit 96424a9 into main Apr 13, 2026
4 checks passed
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.

4 participants