feat(paykit): pass customer details to subscription checkout#183
feat(paykit): pass customer details to subscription checkout#183almeidazs wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughCustomer email and name are now passed through the subscription checkout flow. The provider interface accepts optional customer details, the subscription service loads and forwards them, and Stripe and Polar implementations transmit customer email to their checkout endpoints. ChangesCustomer Details in Subscription Checkout
🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
Summary
This updates subscription checkout so providers can receive customer identity data when a checkout session is created.
Concretely:
createSubscriptionCheckout()now accepts an optionalcustomerobject withemailandnamecustomer_emailto CheckoutcustomerEmailandcustomerNameThis closes a gap for providers that need customer details to initialize checkout cleanly.
Closes #131
Example
New provider contract:
Example payload passed from the subscribe flow:
Breaking change
Yes, for custom provider adapters.
PaymentProvider.createSubscriptionCheckout()now accepts one additional optional field:customer?: { email?: string; name?: string }First-party providers in this repo have been updated. External adapters implementing the provider interface will need to update their method signature, even if they ignore the new field.
Tests
bun run typecheck --filter=paykitjs --filter=@paykitjs/stripe --filter=@paykitjs/polarnode ./node_modules/vitest/vitest.mjs run --config vitest.unit.config.ts packages/paykit/src/subscription/__tests__/subscription.service.test.ts packages/stripe/src/__tests__/stripe.test.tsSummary by CodeRabbit
New Features
Tests