feat(billing): add support for Link payment methods#2722
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)
Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2722 +/- ##
==========================================
+ Coverage 51.77% 52.21% +0.43%
==========================================
Files 1045 1043 -2
Lines 27447 27483 +36
Branches 6340 6356 +16
==========================================
+ Hits 14211 14350 +139
+ Misses 12809 12660 -149
- Partials 427 473 +46
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
…nt method handling
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.
| describe("display mode (default)", () => { | ||
| it("renders card payment method with brand and last4", () => { |
There was a problem hiding this comment.
Rename nested describe blocks to start with “when …” (or a method name).
Line 13 and Line 77 don’t follow the required nested-suite naming convention.
🔧 Suggested rename
- describe("display mode (default)", () => {
+ describe("when display mode (default)", () => {
...
- describe("selection mode", () => {
+ describe("when selection mode", () => {Also applies to: 77-78
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@apps/deploy-web/src/components/shared/PaymentMethodCard/PaymentMethodCard.spec.tsx`
around lines 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.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary by CodeRabbit
New Features
Improvements
Tests