1.0.4 • Published 1 year ago

stripe-onboarder v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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.

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

NameDescription
[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

NameDefault
--account_number"000123456789"
--address.line1"address_full_match"
--address.line2
--address.city"Beverly Hills"
--address.state"CA"
--address.zip"90210"
--business_type"company"
--company_nameRandom company name
--company_phone"0000000000"
--company_tax_id"000000000"
--company_urlRandom URL
--countryUS
--date_of_birth"01011901"
--emailRandom email
--first_nameRandom first name
--headlesstrue
--id_number"000000000"
--last_nameRandom last name
--phone"0000000000"
--routing_number"110000000"
--ssn_last_4"0000"
--titleRandom 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.