Skip to content

Automate onboarding Stripe Connect Express accounts using Puppeteer.

License

Notifications You must be signed in to change notification settings

sponsorkit/stripe-onboarder

 
 

Repository files navigation

About this fork

This fork resolves numerous issues with the original library (detailed here). It has way more unit/integration tests and bug-fixes to ensure stability, and will be kept up to date regularly.

Stripe Onboarder

npm version Test

Automate the onboarding of Stripe Express accounts using Puppeteer. This is intended to be used in Stripe's test mode to onboard verified Connect accounts without having to manually complete the onboarding process.

stripe-onboarder

Onboarding accounts with the card_payments and transfers capabilities are supported. Please open an issue if the onboarder is not working with your account's requested capabilities.

Captchas

Stripe started using captchas in their onboarding flow, which sometimes makes this program not work. Please contact their developer Discord and share your opinion on this. It is problematic that we can't programmatically test our Stripe Connect integration end-to-end, in their test environment.

Installation

Install the package with:

npm install stripe-onboarder
# or
yarn add stripe-onboarder

CLI Usage

Onboard an Express account using the following command:

stripe-onboarder onboard [url]

Arguments

Name Description
[url] Optional Account Link url or an OAuth link. If omitted, a new Express Account and Account Link can be created by providing your Stripe secret API key via the STRIPE_SECRET_KEY environment variable or when prompted by the CLI.

Options

Default values are provided for all options that will allow the Express account to pass verifications: https://stripe.com/docs/connect/testing

Name Default
--account_number "000123456789"
--address.line1 "address_full_match"
--address.line2
--address.city "Beverly Hills"
--address.state "CA"
--address.zip "90210"
--business_type "company"
--company_name Random company name
--company_phone "0000000000"
--company_tax_id "000000000"
--company_url Random URL
--country "US"
--date_of_birth "01011901"
--email Random email
--first_name Random first name
--headless true
--id_number "000000000"
--last_name Random last name
--phone "0000000000"
--routing_number "110000000"
--ssn_last_4 "0000"
--title Random job title

Programmatic Usage

import { onboard } from "stripe-onboarder";

const account = await stripe.accounts.create({ type: "express" });

const accountLink = await stripe.accountLinks.create({
  account: account.id,
  type: "account_onboarding",
});

await onboard({
  headless: false, // Boolean flag for Puppeteer to run browser in headless mode. Defaults to true.
  url: accountLink.url, // Account Link URL for onboarding
  values: {}, // Optional object of onboarding form values to override default values
});

Note Immediately after the promise returned by the onboard function is resolved, the Connect account's status will be "Pending" which means the account is still being verified by Stripe. This can take up to a few minutes to complete. You can poll retrieving the account to check if the account has charges_enabled and payouts_enabled.

Contributing

Please read CONTRIBUTING.md to learn about contributing to this project.

About

Automate onboarding Stripe Connect Express accounts using Puppeteer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 80.1%
  • JavaScript 19.9%