Rocket Rides: Stripe Connect Demo
You can try the web app live on rocketrides.io.
This repository contains two components:
- Web server in Node.js to onboard pilots on the web and get them paid
- iOS app in Swift for passengers to request and pay for rides
Web Onboarding for Pilots
Rocket Rides showcases how to sign up pilots and use Connect Express accounts for them to get paid. It uses pre-built UI components to be up and running quickly and customize the user experience.
This platform 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 to be paid immediately to a debit card.
To integrate Stripe Connect in your own app, check out these two files in particular:
server/routes/pilots/stripe.jsshows how to easily create Connect Express accounts and interact with the Stripe API.
server/routes/pilots/pilots.jsshows how to create payments going straight to pilots.
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, take note of your
client_id, and enter the following in the Redirect URIs field:
For instant payouts to work, you'll need to turn off automatic payouts in your settings.
Install dependencies using npm (or yarn):
cd server npm install
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:
Go to http://localhost:3000 in your browser to start using the app.
iOS App for Passengers
The Rocket Rides iOS app is written in Swift and is built using the Stripe iOS SDK to accept both card payments and Apple Pay.
This project is written in Swift and requires Xcode 8 to build and run, and CocoaPods to install the dependencies. The app is compatible with iOS 10.0+. You can use it both the iOS Simulator or on your iPhone.
To get started, install the dependencies using CocoaPods:
cd ios pod install
RocketRides.xcodeproj) in Xcode. Build and run the app!
To try out the full payment experience, run the server locally as described above, then follow these steps:
- Create a new pilot using the Rocket Rides web onboarding.
- Fill in the
AppDelegate.swift. You can find your publishable key in your Stripe Dashboard.
- Fill in the
AppDelegate.swift. This should be
http://localhost:3000if you haven't modified the server configuration.
- Relaunch the app! Tapping on "Payment" and "Price" should now work.
- Enter a destination, your payment option, and request a ride! You should see the payment in your Stripe Dashboard.