Skip to content

feat(seller): support request-time pricing for x402 and MPP - #117

Merged
nkavian merged 1 commit into
inflowpayai:mainfrom
nkavian:feat/request-pricing
Nov 13, 2026
Merged

nkavian merged 1 commit into
inflowpayai:mainfrom
nkavian:feat/request-pricing

Conversation

@nkavian

@nkavian nkavian commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add synchronous and asynchronous request-time pricing to the x402 and MPP seller helpers, preserving fixed-price inputs.
  • Resolve concrete x402 route configurations per request so offer filtering, ordering, recipients, metadata, and sponsorship are preserved.
  • Delegate payment verification, settlement, and receipts to the upstream handlers, using the same resolved route throughout each request.
  • Preserve request-body availability and demonstrate request-dependent prices in the general-purpose Express, Fastify, Hono, and Next.js seller examples.

Validation

  • Full pnpm verify passed: formatting, source and test type checking, lint, tests, TAP conformance, changed-line coverage, API documentation, and builds.
  • Tests passed on Node 22 and 24. Changed-line coverage: 99.12%.
  • Export and publish-package checks passed; README integration snippets type-checked against the built packages.
  • Tests use the actual upstream payment handlers across Express, Fastify, Hono, and Next.js. Coverage includes concurrent prices, filtered and edited offers, paid retries, rejected payments, receipts, settlement order, currency selection, and sponsorship. Hono and Next.js cases also verify JSON-body pricing, body availability in the application handler, and custom settlement-failure responses.

Scope and limitations

  • Fastify retains its upstream middleware lifecycle. Pricing can use headers, paths, and query parameters; parsed request bodies are unavailable at its payment hook. The application handler still receives its parsed body.
  • MPP callbacks apply to charge composition helpers, not subscription plan configuration.
  • Dynamic route callbacks run before HTTP protected-request hooks receive the resolved route. Prices must remain stable for the same purchase across paid retries.
  • No payment dependency versions are changed.

@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.12281% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/x402-seller/src/http-resource-server.ts 98.33% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@nkavian
nkavian force-pushed the feat/request-pricing branch 7 times, most recently from b964df2 to 88e5c08 Compare November 13, 2026 02:05
@nkavian
nkavian force-pushed the feat/request-pricing branch from 88e5c08 to 34c55fd Compare November 13, 2026 04:00
@nkavian
nkavian merged commit 531fa53 into inflowpayai:main Nov 13, 2026
9 checks passed
@nkavian
nkavian deleted the feat/request-pricing branch November 13, 2026 04:16
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.

1 participant