Add x402 HTTP payment protocol: client, spec, and registry integration#128
Add x402 HTTP payment protocol: client, spec, and registry integration#128
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📋 ContractSpec Impact AnalysisGenerated by ContractSpec CI |
Motivation
Description
payments.x402with configuration and secret schema insrc/integrations/providers/x402.tsand register it in the default provider registry viaregisterX402Integration.X402PaymentsClient(src/impls/x402-payments.ts) and shared parsing/utility code (src/impls/x402-payments.shared.ts) to parse challenge headers, create payment intents via an underlyingPaymentsProvider, and attach proof tokens to retried requests.X402PaymentRequirement,X402PaymentProof,X402FetchRequest, andX402HttpPaymentClientinpayments.tsto expose the new client API surface../impls/x402-paymentsto the package exports andexport * from './x402-payments'in the impls index, and add acreateX402PaymentsClienthelper toprovider-factory.tsfor constructing the client using an existing settlementPaymentsProvider.x402-payments.test.tsand add a registration test toproviders.test.ts; update packageexportsentries for the newly added modules.Testing
bun:testtargetingsrc/impls/x402-payments.test.ts, and the tests passed.providers.test.tsthat checks registration ofpayments.x402viabun:test, and the test passed.Codex Task