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:
ℹ️ 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 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 |