Skip to content

feat: Add Stripe provider integration - #6

Merged
sancho1952007 merged 4 commits into
dodopayments:mainfrom
yashranaway:main
Sep 27, 2025
Merged

sancho1952007 merged 4 commits into
dodopayments:mainfrom
yashranaway:main

Conversation

@yashranaway

@yashranaway yashranaway commented Sep 26, 2025 •

Copy link
Copy Markdown
Contributor

fixes #5

  • Added Stripe migration support for products, coupons, and customers
  • Implemented interactive CLI with progress tracking
  • Added comprehensive documentation in /docs/stripe
  • Updated README with Stripe support status
# Test products migration
bun run start stripe --types=products

# Test customers migration
bun run start stripe --types=customers

# Test coupons migration
bun run start stripe --types=coupons

# Test all types (default)
bun run start stripe --types=products,customers,coupons

Summary by CodeRabbit

  • New Features

    • Added Stripe migration to the CLI with interactive and non‑interactive workflows; supports products (one‑time & subscriptions), discounts/coupons, and customers with previews, confirmations, and per‑item error handling.
  • Documentation

    • README updated to list Stripe as a supported provider; added provider-specific docs, examples (interactive/non‑interactive), Quick Start text updated to reference Stripe, and expanded CLI reference and troubleshooting.
  • Chores

    • Added Stripe SDK dependency.

@yashranaway

Copy link
Copy Markdown
Contributor Author

@sancho1952007 done with stripe, let me know if you'd like something changed!

@yashranaway

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Sep 27, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Sep 27, 2025 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@yashranaway has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 21 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7286916 and d7c86d8.

📒 Files selected for processing (1)
  • src/providers/lemonsqueezy/index.ts (2 hunks)

Walkthrough

Adds Stripe as a new provider: docs, README updates, a new docs/stripe guide, package dependency, and a CLI command implementing Stripe→Dodo Payments migrations for products, coupons, and customers with interactive and non-interactive modes.

Changes

Cohort / File(s) Summary
Documentation updates
README.md, docs/stripe/README.md
Adds Stripe as a supported provider, updates Quick Start and examples to reference Stripe, and introduces a dedicated Stripe migration guide describing usage (interactive/non-interactive), supported types, options, examples, prerequisites, and troubleshooting.
CLI wiring
src/index.ts
Imports and registers the Stripe migration command with yargs so the CLI exposes the Stripe migrator.
Stripe provider implementation
src/providers/stripe/index.ts
New provider command implementing Stripe→Dodo migrations: auth with provider and Dodo keys, optional interactive brand selection, migrate-types handling, and migration routines for products, coupons, and customers with data fetching, transformation, preview/confirmation, per-item creation, logging, and error handling. Exports the command and helper functions.
Dependency update
package.json
Adds stripe@^17.3.1 dependency.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User
    participant CLI as CLI (stripe command)
    participant STR as Stripe API
    participant Dodo as Dodo Payments API

    User->>CLI: run "migrate stripe" [flags/interactive]
    CLI->>STR: auth with provider-api-key
    CLI->>Dodo: auth with dodo-api-key
    alt Interactive flow
        CLI->>User: prompt for Dodo brand & migrate-types
        User-->>CLI: selects brand & types
    else Non-interactive flow
        CLI->>CLI: read brand & types from flags
    end

    par Products
        CLI->>STR: list products + prices
        STR-->>CLI: returns products/prices
        CLI->>CLI: map to Dodo product payloads
        CLI->>User: preview & confirm
        User-->>CLI: confirm
        CLI->>Dodo: create products/prices (per item)
        Dodo-->>CLI: success / error
    and Coupons
        CLI->>STR: list coupons
        STR-->>CLI: returns coupons
        CLI->>CLI: map to discounts
        CLI->>User: preview & confirm
        User-->>CLI: confirm
        CLI->>Dodo: create discounts (per item)
        Dodo-->>CLI: success / error
    and Customers
        CLI->>STR: list customers
        STR-->>CLI: returns customers
        CLI->>CLI: map to Dodo customers (preserve stripe_customer_id metadata)
        CLI->>User: preview & confirm
        User-->>CLI: confirm
        CLI->>Dodo: create customers (per item)
        Dodo-->>CLI: success / error
    end

    CLI-->>User: summary of created items and failures
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I thump my paws—new stripes in sight,
Products hop, coupons take flight,
Customers burrow toward Dodo’s light.
Flags in paw, I migrate right—
Preview, confirm, then tunnel bright. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: Add Stripe provider integration" concisely and accurately summarizes the primary change in this pull request, which is the introduction of Stripe migration support. It is a clear, single-sentence description without extraneous details or ambiguous phrasing, and it aligns with the project's commit style conventions. Reviewers scanning the history will immediately understand the feature being added.
Linked Issues Check ✅ Passed The implementation fulfills the objectives of issue #5 by adding migration routines for products, coupons, and customers from Stripe to Dodo Payments, registering the Stripe command in the CLI, and updating both root and provider-specific documentation. The interactive and non-interactive workflows with progress tracking address the requirement for a user-friendly migration experience. All linked issue requirements for Stripe support and entity migration are satisfied.
Out of Scope Changes Check ✅ Passed All modifications in this pull request are exclusively focused on introducing Stripe integration, including adding dependencies, updating documentation, registering the provider in the CLI, and implementing migration logic. There are no changes affecting unrelated providers, features, or files outside the Stripe scope. The updates align precisely with the objectives without introducing any out-of-scope alterations.

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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
docs/stripe/README.md (1)

4-43: Add languages to fenced code blocks

markdownlint is flagging the bare fences; adding bash (or another appropriate identifier) clears the lint errors and renders with proper syntax highlighting.

-```
+```bash
 dodo-migrate stripe

</blockquote></details>
<details>
<summary>README.md (1)</summary><blockquote>

`59-118`: **Annotate README code fences with languages**

The new fences are missing language hints, triggering `MD040`. Tag them with `bash` so markdownlint (and readers) stay happy.

```diff
-```
+```bash
 dodo-migrate lemonsqueezy

@@
- +bash
dodo-migrate stripe

@@
-```
+```bash
dodo-migrate lemonsqueezy \
  --provider-api-key=lsq_XXXXXXXXXXXXXXXX \
  --dodo-api-key=dp_XXXXXXXXXXXXXXXX \
  --mode=test_mode \
  --dodo-brand-id=brand_XXXXXX

@@
- +bash
dodo-migrate stripe
--provider-api-key=sk_test_XXXXXXXXXXXXXXXX
--dodo-api-key=dp_XXXXXXXXXXXXXXXX
--mode=test_mode
--dodo-brand-id=brand_XXXXXX
--migrate-types=products,coupons

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1bd8c9f and e03811e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • README.md (3 hunks)
  • docs/stripe/README.md (1 hunks)
  • package.json (1 hunks)
  • src/index.ts (2 hunks)
  • src/providers/stripe/index.ts (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
README.md

63-63: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


96-96: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


101-101: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


106-106: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

Comment thread src/providers/stripe/index.ts Resolved
Comment thread src/providers/stripe/index.ts Resolved
Comment thread src/providers/stripe/index.ts Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Stripe support

2 participants