Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Dec 11, 2025


PR-Codex overview

This PR focuses on updating how paymentData is retrieved in the payment processing flow, ensuring it can be sourced from request headers when necessary.

Detailed summary

  • Changed the assignment of paymentData to retrieve it from request.headers.get("x-payment") instead of using a direct variable.
  • Updated the example for retrieving paymentData to prioritize request headers if stored data is unavailable.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • Documentation
    • Updated payment data handling examples in X402 server documentation. Payment data is now sourced from request headers with fallback support, affecting settlement and verification flows.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Dec 11, 2025 2:03am
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
nebula Skipped Skipped Dec 11, 2025 2:03am
thirdweb_playground Skipped Skipped Dec 11, 2025 2:03am
thirdweb-www Skipped Skipped Dec 11, 2025 2:03am
wallet-ui Skipped Skipped Dec 11, 2025 2:03am

@vercel vercel bot temporarily deployed to Preview – nebula December 11, 2025 01:49 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground December 11, 2025 01:49 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 11, 2025 01:49 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www December 11, 2025 01:49 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Dec 11, 2025

⚠️ No Changeset found

Latest commit: ddde5b1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Walkthrough

Code examples in the server-side documentation are updated to retrieve paymentData from request headers using request.headers.get("x-payment") instead of local variables, with fallback logic for storage retrieval scenarios.

Changes

Cohort / File(s) Summary
Documentation - Payment Data Sourcing
apps/portal/src/app/x402/server/page.mdx
Updated code examples to source paymentData from request.headers.get("x-payment") with fallback mechanism when storage retrieval returns nothing; affects settlePayment and verify flow construction

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single file modification containing documentation and code examples only
  • No changes to actual application code logic or public APIs
  • Updates are cosmetic/illustrative in nature

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks key sections from the template (issue tag, 'Notes for the reviewer', 'How to test') and relies on auto-generated PR-Codex content rather than author-provided details. Add the issue tag (TEAM-0000 format), provide explicit reviewer notes, and include testing instructions or clarification on how to verify the changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: updating payment data retrieval examples in server documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch _X402_Update_payment_data_retrieval_example_in_server_documentation

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the Portal Involves changes to the Portal (docs) codebase. label Dec 11, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.66%. Comparing base (01dce0e) to head (ddde5b1).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8537   +/-   ##
=======================================
  Coverage   54.66%   54.66%           
=======================================
  Files         921      921           
  Lines       61163    61163           
  Branches     4151     4151           
=======================================
  Hits        33434    33434           
  Misses      27627    27627           
  Partials      102      102           
Flag Coverage Δ
packages 54.66% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joaquim-verges joaquim-verges marked this pull request as ready for review December 11, 2025 01:51
@joaquim-verges joaquim-verges requested review from a team as code owners December 11, 2025 01:51
@joaquim-verges joaquim-verges force-pushed the _X402_Update_payment_data_retrieval_example_in_server_documentation branch from d2d0060 to ddde5b1 Compare December 11, 2025 01:52
@vercel vercel bot temporarily deployed to Preview – nebula December 11, 2025 01:52 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground December 11, 2025 01:52 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www December 11, 2025 01:52 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 11, 2025 01:52 Inactive
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/portal/src/app/x402/server/page.mdx (1)

90-91: Consider clarifying when the storage fallback pattern should be used.

The section introduction could briefly mention that the storage fallback pattern (lines 138–139) is useful when reusing payment authorization across multiple requests within a session. This would help users understand which example pattern to apply in their use case.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 01dce0e and ddde5b1.

📒 Files selected for processing (1)
  • apps/portal/src/app/x402/server/page.mdx (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
apps/portal/src/app/x402/server/page.mdx (5)

54-69: Good pattern for direct header-based payment data retrieval.

The Exact Payment Scheme example correctly retrieves payment data directly from request headers, which aligns with the PR objective to prioritize header sources.


92-103: Upto Payment Scheme example correctly uses header retrieval.

The payment arguments object properly retrieves paymentData from the request headers, maintaining consistency with the Exact Scheme pattern.


135-159: Fallback pattern is well-demonstrated.

The commented example on lines 138–139 clearly shows the intended behavior: retrieve from storage first, then fall back to request headers. This properly demonstrates the PR's enhancement goal and provides a realistic pattern for scenarios where payment data may be cached or persisted.


221-376: Dedicated endpoint examples use framework-idiomatic header access consistently.

All three frameworks (Next.js, Express, Hono) correctly access the x-payment header using their respective APIs, and all examples properly extract payment data from request headers before passing to settlement functions.


378-560: Middleware examples maintain consistent header retrieval pattern.

All three middleware implementations (Next.js, Express, Hono) correctly retrieve payment data from headers, providing solid examples for users protecting multiple endpoints with shared payment verification logic.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

size-limit report 📦

Path Size
@thirdweb-dev/nexus (esm) 105.66 KB (0%)
@thirdweb-dev/nexus (cjs) 319.47 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Portal Involves changes to the Portal (docs) codebase.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants