Skip to content

feat(x402-seller): support explicit upfront payments - #30

Merged
nkavian merged 1 commit into
inflowpayai:mainfrom
nkavian:feat/x402-upfront-payments
Oct 27, 2026
Merged

nkavian merged 1 commit into
inflowpayai:mainfrom
nkavian:feat/x402-upfront-payments

Conversation

@nkavian

@nkavian nkavian commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add explicit AcceptsOptions.PaymentFlow configuration while preserving authorization as the default.
  • Enable upfront only for supported fixed-price exact EVM/Solana and InFlow balance/instrument offers. Reject unsupported combinations instead of silently downgrading them.
  • Use the upstream x402 HTTP middleware's settlement-before-handler lifecycle; no custom payment orchestration or MPP behavior changes.
  • Document both flows, handler failures after payment, receipts, and the difference between payment deduplication and application fulfillment deduplication. Extend the runnable seller example with X402_PAYMENT_FLOW.
  • Pin shared conformance to merged inflow-specs main commit c1b49718056739f43e92c34790ae8b58c1d3a382.

Verification

  • make verify on Go 1.26.1 and GOTOOLCHAIN=go1.27.0 make verify: passed, including race tests and the separate consumer build.
  • node --test scripts/conformance.test.mjs scripts/release-version.test.mjs: passed.
  • All seven shared conformance suites passed against the pinned merged contract.
  • Native tests use real upstream HTTP middleware and the InFlow facilitator client for execution order, held/rejected/pending/uncertain settlement, handler errors and panic receipts, matching, repeated/concurrent submissions, buyer forwarding, and MPP/x402 alternatives.

Platform HTTP responses in local tests are synthetic. These tests establish SDK execution order and forwarding, not blockchain settlement or server-side payment deduplication. No paid transactions were performed. The existing pinned Node interoperability matrix is exercised by CI.

Scope

No dependency upgrades, server changes, CLI changes, or MPP production changes. Go uses tag-based releases; this additive option is suitable for the next minor release. This PR does not publish a release.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@nkavian
nkavian merged commit fef77e6 into inflowpayai:main Oct 27, 2026
6 checks passed
@nkavian
nkavian deleted the feat/x402-upfront-payments branch October 27, 2026 20:41
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.

2 participants