/stripe-connect-custom-rocketdeliveries

Sample on-demand platform built on Stripe Connect: Custom Accounts and Connect Onboarding for deliveries. https://rocketdeliveries.io

Primary LanguageJavaScriptMIT LicenseMIT

Rocket Deliveries: Stripe Connect Custom demo

Rocket Deliveries is a sample on-demand platform that offers passengers rides with pilots, built on top of Stripe Connect, Connect Custom, and Connect Onboarding for Custom Accounts.

You can try the web app live on rocketdeliveries.io.

This repository contains a web server in Node.js to onboard pilots and get them paid. Rocket Rides is a companion demo that uses Connect Express to provide simple onboarding, a hosted dashboard, verification, and payouts management.

Web onboarding for pilots

Rocket Deliveries showcases how to sign up pilots and use Connect Custom accounts to get them paid. Custom allows you to control every part of the user experience; accounts can be created directly via the Stripe API. This demo also uses Connect Onboarding to provide onboarding and identity verification for your platform, and we've customized Connect Onboarding with Rocket Deliveries branding.

This platform also uses the Stripe API to create payments for pilots, fetch their available and pending balance, and let them view transfers. It also creates Instant Payouts for pilots who use a debit card as their payout account.

To integrate Stripe Connect in your own app, check out these two files in particular:

  1. routes/pilots/stripe.js shows how to easily create Connect Custom accounts and interact with the Stripe API.
  2. routes/pilots/pilots.js shows how to create payments going straight to pilots.

Requirements

You'll need a Stripe account to manage pilot onboarding and payments. Sign up for free, then enable Connect by filling in your Platform Settings. In the Development section, enter the following in the Redirect URIs field: http://localhost:3000/pilots/stripe/token.

For Instant Payouts to work, you'll need to turn off automatic payouts in your settings.

You'll need to have Node.js >= 7.x and MongoDB installed to run this app.

Getting started

Install dependencies using npm (or yarn):

cd server
npm install

Copy the configuration file and add your own Stripe API keys and client ID:

cp config.default.js config.js

Make sure MongoDB is running. If you're using Homebrew on macOS:

brew services start mongodb

Run the app:

npm start

Go to http://localhost:3000 in your browser to start using the app.

Use the Stripe CLI to receive webhook events

Rocket Deliveries relies on webhook events to receive updates from Stripe on a pilot's verification. Webhook events require a public domain, but to quickly get started in a local development environment you can use the Stripe CLI.

Install the Stripe CLI. If you're using Homebrew on macOS:

brew install stripe/stripe-cli/stripe

Start the Rocket Deliveries server, then listen for webhook events and forward them to the server:

stripe listen --forward-to localhost:3000/pilots/stripe/webhooks

Rocket Rides

This project is a fork of Rocket Rides, our Connect Express demo that walks through how Express provides onboarding, account management, an account dashboard, and identity verification for platforms. To merge the latest changes from Rocket Rides:

# Add the upstream repository
git remote add upstream https://github.com/stripe/stripe-connect-rocketrides

# Merge upstream changes into this repository
git fetch upstream
git checkout master
git rebase -i upstream/master

Credits