feat(billing): add support for Link payment methods#2722
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds Link payment method support: schema/type additions for Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client (UI)
participant API as API Server
participant Stripe as Stripe SDK
participant DB as Database
Client->>API: Attach payment method (card or link{email})
API->>Stripe: Create/attach PaymentMethod
Stripe-->>API: Return PaymentMethod (card.fingerprint or link.email)
API->>API: extractFingerprint(paymentMethod)
API->>DB: Store payment method record with fingerprint
API-->>Client: Return sanitized PaymentMethod (link.email redacted)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2722 +/- ##
==========================================
+ Coverage 53.68% 53.84% +0.15%
==========================================
Files 1020 1020
Lines 23573 23604 +31
Branches 5751 5774 +23
==========================================
+ Hits 12655 12709 +54
+ Misses 9522 9501 -21
+ Partials 1396 1394 -2
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
cdda90e to
92e673c
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/http-sdk/src/stripe/stripe.types.ts`:
- Around line 43-45: The Link typing currently assumes link and link.email are
non-nullable; update the SDK types in stripe.types.ts so the link property
itself can be null and its email can be string or null (i.e., make link accept
null and make email nullable). Locate the declaration that defines "link?: {
email?: string; }" and change it so the link union allows null and email's type
includes null (preserving optionality where appropriate) to match the backend
schema.
apps/deploy-web/src/components/billing-usage/PaymentMethodsView/PaymentMethodsRow.tsx
Show resolved
Hide resolved
apps/deploy-web/src/components/billing-usage/PaymentMethodsView/PaymentMethodsRow.tsx
Outdated
Show resolved
Hide resolved
apps/deploy-web/src/components/shared/PaymentMethodCard/PaymentMethodCard.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/deploy-web/src/components/shared/PaymentMethodCard/PaymentMethodCard.spec.tsx`:
- Around line 13-14: The nested test-suite descriptions in
PaymentMethodCard.spec.tsx (e.g., describe("display mode (default)") and the
other nested describe around lines 77–78) should be renamed to start with "when"
or a method name; update those describe strings to something like describe("when
in display mode (default)") or describe("when rendering the display mode") (and
similarly rename the other nested describe to start with "when ...") so they
follow the project's nested-suite naming convention while leaving the test
bodies (it blocks) and test helpers unchanged.
apps/deploy-web/src/components/shared/PaymentMethodCard/PaymentMethodCard.spec.tsx
Outdated
Show resolved
Hide resolved
4fb8c94 to
1389803
Compare
…nt method handling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After rebasing to main, the test file still used jest globals. Replaced jest.fn/jest.Mock with vitest equivalents.
…eload scheduling Webhook handlers only extracted fingerprints from card payment methods, causing Link types to never get local DB records. This made setting Link as default fail with 403. Also fix auto-reload enable failing with 500 when a stale singleton job already existed in the queue.
0094b92 to
a1efc3a
Compare
Summary by CodeRabbit
New Features
Improvements
Tests