This is a simple Sinatra webapp that you can use to run the Stripe Terminal example apps. To get started, you can choose from the following options:
- Run it on a free Render account
- Run it on Heroku
- Run it locally on your machine
- Run it locally via Docker CLI
ℹ️ You also need to obtain your Stripe secret, test mode API Key, available in the Dashboard. Note that you must use your secret key, not your publishable key, to set up the backend. For more information on the differences between secret and publishable keys, see API Keys. For more information on test mode, see Test and live modes.
- Set up a free render account.
- Click the button below to deploy the example backend. You'll be prompted to enter a name for the Render service group as well as your Stripe API key.
- Go to the next steps in this README for how to use this app
- Set up a Heroku account.
- Click the button below to deploy the example backend. You'll be prompted to enter a name for the Heroku application as well as your Stripe API key.
- Go to the next steps in this README for how to use this app
If you prefer running the backend locally, ensure you have the required Ruby runtime version installed as per the latest Gemfile in this repo.
You'll also need the correct Bundler version, outlined in the Gemfile.lock under the BUNDLED_WITH
directive.
Clone down this repo to your computer, and then follow the steps below:
- Create a file named
.env
within the newly cloned repo directory and add the following line:
STRIPE_TEST_SECRET_KEY={YOUR_API_KEY}
- In your terminal, run
bundle install
- Run
ruby web.rb
- The example backend should now be running at
http://localhost:4567
- Go to the next steps in this README for how to use this app
We have a pre-built Docker image you can run locally if you're into the convenience of containers.
Install Docker Desktop if you don't already have it. Then follow the steps below:
- In your terminal, run
docker run -e STRIPE_TEST_SECRET_KEY={YOUR_API_KEY} -p 4567:4567 stripe/example-terminal-backend
(replace{YOUR_API_KEY}
with your own test key) - The example backend should now be running at
http://localhost:4567
- Go to the next steps in this README for how to use this app
Next, navigate to one of our example apps. Follow the instructions in the README to set up and run the app. You'll provide the URL of the example backend you just deployed.
SDK | Example App |
---|---|
iOS | https://github.com/stripe/stripe-terminal-ios |
JavaScript | https://github.com/stripe/stripe-terminal-js-demo |
Android | https://github.com/stripe/stripe-terminal-android |