• This repository has been archived on 04/May/2022
  • Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Demo app for Global Marketplace using Stripe Connect

This project is inactive and is no longer being maintained.

Global Marketplace using Stripe Connect

This sample shows how to build a home-rental themed marketplace using Stripe Payments and Stripe Connect where customers can sign up and become renters (buyer) and owners (seller) of the marketplace.

Below the surface the marketplacegeneric with the notion of buyers, sellers and transactions for sold goods and the basic workflows are provided showcase how to use Payments and Connect together.

Sellers are on-boarded using Stripe Connect Express which gives sellers a Stripe account connected to the marketplace. When funds are accepted by the marketplace via card payments, the funds are routed to the seller's Stripe accounts as a part of each marketplace transaction.

See a hosted version of the demo in test mode or fork on codesandbox.io

Preview of recipe

Features

  • Users can signup and optionally decide to become sellers by on-boarding to Stripe.
  • Listings can be listed, shown, added, edited and deleted.
  • Bookings can be viewed in detail as transactions.
  • Card payments are accepted by the marketplace and funds are routed to the sellers connected Stripe account.
  • Users can visit their dashboard to get an overview of their listings, transaction and account balances.
  • Simple admin page for housekeeping.

Architecture

The marketplace is implemented as as full-stack application powered by Next.js and contains a React front-end, and a Node.js REST API.

The app renders its React components as both the server and client-side using isomorphic rendering.

Technical features

  • Authentication system using JWT tokens with login and signup pages.
  • Storage using LowDB to provide a basic local JSON database.
  • REST API scaffolding with authentication endpoints for resources like listings, login, payouts, profile, signup, transactions, and users.
  • Card payments are accepted via Payment Intents API + Stripe Elements and is integrated via react-stripe-elements

Getting started

To run this sample locally all you need is checkout the repo and run the app.

You will need a Stripe account with its own set of API keys, and enable a few features for your Stripe Account.

Don't worry, just follow the steps in this guide.

1. Clone and configure the sample

git clone [email protected]:stripe/stripe-demo-connect-kavholm-marketplace.git

2. Configure Stripe

The first thing you need to do is to Create a Connect platform. You do that by going to https://dashboard.stripe.com/test/connect/overview.

Once you have registered your Connect platform, you can now generate a Connect User Id. You need this together with your Stripe API keys.

2. Get Stripe API keys and configure environment variables

Go to the Stripe developer dashboard to find your API keys (developer settings), and your Connect User Id (Connect setttings).

Copy the .env.example file into a file named .env in the folder of the server you want to use. For example:

cp .env.example .env

Now copy your Stripe API keys and Connect User id into your .env file:

STRIPE_PUBLIC_KEY=<replace-with-your-publishable-key>
STRIPE_SECRET_KEY=<replace-with-your-secret-key>
STRIPE_CLIENT_ID=<replace-with-your-connect-client-id>

Save the .env file and you should be good.

3. Set A Redirect URI for Stripe Onboarding

Go to your connect settings to add a redirect uri for Stripe to call back to after a seller onboards with Stripe.

The URI this app users is http://localhost:3000/stripe/callback

Using the sample app

  1. Run npm install
  2. Run npm run dev
  3. You are now ready to use the app running in http://localhost:3000.
  4. The marketplace should be available, and if you go to /login you should be able to login as both renters and owners using the demo buttons.
  5. You will need to onboard the owner onto your Stripe Connect Platform. If you log in using the owner demo and go to "Listings" you can enable payments. This will bring you through Stripe's hosted onboarding with Connect.
  6. Once onboarding is complete you can use the renter demo to see how payments work!
  7. 🎉

FAQ

Q: Why did you pick these frameworks?

A: We chose the most minimal framework to convey the key Stripe calls and concepts you need to understand. These demos are meant as an educational tool that helps you roadmap how to integrate Stripe within your own system independent of the framework.

Get support

If you found a bug or want to suggest a new [feature/use case/sample], please file an issue.

If you have questions, comments, or need help with code, we're here to help:

Sign up to stay updated with developer news.

Author(s)

@auchenberg-stripe

More Repositories

1

jquery.payment

[DEPRECATED] A general purpose library for building credit card forms, validating inputs and formatting numbers.
CoffeeScript
3,538
star
2

react-stripe-elements

Moved to stripe/react-stripe-js.
JavaScript
3,026
star
3

mosql

MongoDB → PostgreSQL streaming replication
Ruby
1,629
star
4

stripe-payments-demo

Sample store accepting universal payments on the web with Stripe Elements, Payment Request, Apple Pay, Google Pay, Microsoft Pay, and the PaymentIntents API. 💳🌍✨
JavaScript
1,471
star
5

shop

Single-page shop
CSS
1,126
star
6

flow-to-typescript-codemod

Codemod Stripe used to migrate 6.5m+ lines of code from Flow to TypeScript
TypeScript
675
star
7

safesql

Static analysis tool for Golang that protects against SQL injections
Go
563
star
8

PaymentKit

Easily accept payments on iOS
Objective-C
470
star
9

brushfire

Distributed decision tree ensemble learning in Scala
Scala
391
star
10

stripe-webhook-monitor

Stripe Webhook Monitor provides a real-time feed and graph of Stripe events received via webhooks. 📈✨
JavaScript
366
star
11

accept-a-card-payment

Learn how to accept a basic card payment on web, iOS, Android
Java
351
star
12

jquery.mobilePhoneNumber

[DEPRECATED] A general purpose library for validating and formatting mobile phone numbers.
CoffeeScript
331
star
13

nextjs-typescript-react-stripe-js

Full-stack TypeScript example using Next.js, react-stripe-js, and stripe-node.
TypeScript
329
star
14

topmodel

Standard evaluations for binary classifiers so you don't have to
Python
316
star
15

gaps

Easy management of your Google Groups subscriptions.
Ruby
284
star
16

developer-office-hours

A collection of Stripe Developer Office Hours demos 🎬
Ruby
245
star
17

ApplePayStubs

Test your Apple Pay integration without Apple Pay
Objective-C
193
star
18

timberlake

Timberlake is a Job Tracker for Hadoop.
Go
177
star
19

wilde-things

A tutorial integrating Stripe in PHP
PHP
175
star
20

sequins

A key/value store for serving static batch data
Go
174
star
21

checkout-subscription-and-add-on

Uses Stripe Checkout to create a payment page that starts a subscription for a new customer.
CSS
162
star
22

mongoriver

A library for writing MongoDB oplog tailers.
Ruby
153
star
23

herringbone

Tools for working with parquet, impala, and hive
Thrift
135
star
24

pd2pg

Import PagerDuty data into Postgres for analysis
Ruby
110
star
25

payment-form-modal

How to implement Stripe Elements within a modal dialog.
JavaScript
106
star
26

datadog-checks

Checks for the Datadog Agent that Stripe finds useful.
Python
99
star
27

set-up-subscriptions

Getting started with Stripe Elements and Stripe Billing to charge a customer for a monthly subscription.
CSS
96
star
28

macgyver

A Chrome extension which duct tapes an SSH agent to the platformKey API
Go
90
star
29

react-elements-card-payment

Learn how to build a checkout form with React
CSS
87
star
30

chalk-log

Chalk::Log adds a logger object to any class, which can be used for unstructured or semi-structured logging.
Ruby
72
star
31

agate

Scoring ONNX models on the JVM in scala
Scala
68
star
32

sbt-bazel

Easily convert SBT projects to Bazel workspaces
Scala
54
star
33

charging-for-multiple-plan-subscriptions

Getting started with Stripe Elements and Stripe Billing to charge a customer for a monthly subscription with multiple items.
JavaScript
54
star
34

checkout-remember-me-with-twilio-verify

Use Stripe Checkout to collect payment details for future payments and Twilio Verify to authenticate the customer via SMS code and charge their stored card.
JavaScript
50
star
35

firebase-mobile-payments

Firebase Cloud Functions to create payments in native Android and iOS applications.
Kotlin
49
star
36

identity-verification

Securely collect and verify identity documents
JavaScript
44
star
37

falconer

High throughout, unsampled tracing span buffer with streaming search
Go
40
star
38

web-elements-sepa-debit-payment

Collect SEPA Debit mandates and payments.
Objective-C
37
star
39

payment-tag

CoffeeScript
34
star
40

stripe-stdlib-demo

Sample store accepting universal payments built with @Stripe and @StdLib.
JavaScript
33
star
41

chalk-config

Maps on-disk config files into a loaded global configatron instance, taking into account your current environment.
Ruby
28
star
42

go-einhorn

Talk to einhorn from your Go worker
Go
25
star
43

sample-terminal-ios-app

Learn how to take in-person payments with a physical reader and Terminal in your iOS app
Swift
19
star
44

adding-sales-tax

Learn how to use PaymentIntents to build a simple checkout flow
CSS
18
star
45

javascript-style

Javascript linter with rules for Stripe projects
JavaScript
16
star
46

scrooge-shapes

Shapeless generic instances for Scrooge types
Scala
14
star
47

datadog-cli-tools

CLI tools we find useful for Datadog
Ruby
13
star
48

submigrate

Combine multiple subscriptions into a single subscription with multiple items
Go
12
star
49

web-elements-fpx-payment

Accept Malaysian online bank transfers with the Stripe FPX Element.
JavaScript
12
star
50

siv-go

A pure Go implementation of the SIV AEAD.
Go
11
star
51

au-becs-debit-payment

Collecting AU BECS Direct Debit mandates and payments.
Java
10
star
52

oxxo-payment

Learn how to accept OXXO and card payments
JavaScript
10
star
53

round-up-and-donate

Build a round up and donate feature with Connect
CSS
10
star
54

random

A collection of random utilities
Shell
9
star
55

web-elements-card-payment

Learn how to accept a basic card payment on the web
JavaScript
7
star
56

grabpay-payment

Accept GrabPay Payments with Stripe, a popular digital wallet in Southeast Asia.
CSS
5
star
57

yard-sorbet

Types are documentation
Ruby
5
star
58

terraform-provider-confidant

A terraform provider for confidant. See https://github.com/terraform-providers
Go
5
star
59

simple-powershell-dsc

Simple Powershell DSC pull server in Go
Go
4
star
60

stripe-magento1-releases

4
star
61

pb

Lint protocol buffers
Go
2
star
62

mobile-elements-card-payment

Learn how to accept a basic card payment on iOS & Android
Java
2
star
63

bazel-bloop-exporter

This proof of concept exports a bazel project to bloop. The motivation is to allow the use of any tooling that already has a bloop integration, such as the metals language server.
Starlark
2
star
64

sentry-restricted-github

Python
2
star
65

time-utils

Ruby
1
star