GithubHelp home page GithubHelp logo

isabella232 / example-terminal-backend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stripe/example-terminal-backend

0.0 0.0 0.0 74 KB

A simple, easy-to-deploy backend that you can use to run the Stripe Terminal example apps

Home Page: https://stripe.com/docs/terminal

License: MIT License

Ruby 90.09% HTML 4.22% Dockerfile 2.44% Shell 3.24%

example-terminal-backend's Introduction

Example Terminal Backend

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:

  1. Run it on a free Heroku account
  2. Run it locally on your machine
  3. 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.

Running the app

Running on Heroku

  1. Set up a free Heroku account.
  2. 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.
  3. Go to the next steps in this README for how to use this app

Deploy

Running locally on your machine

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:

  1. Create a file named .env within the newly cloned repo directory and add the following line:
STRIPE_TEST_SECRET_KEY={YOUR_API_KEY}
  1. In your terminal, run bundle install
  2. Run ruby web.rb
  3. The example backend should now be running at http://localhost:4567
  4. Go to the next steps in this README for how to use this app

Running locally with Docker

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:

  1. 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)
  2. The example backend should now be running at http://localhost:4567
  3. Go to the next steps in this README for how to use this app

Next steps

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

⚠️ Note that this backend is intended for example purposes only. Because endpoints are not authenticated, you should not use this backend in production.

example-terminal-backend's People

Contributors

bg-stripe avatar bibek-stripe avatar billsun-stripe avatar danj-stripe avatar dependabot[bot] avatar esandler-stripe avatar graj-stripe avatar jil-stripe avatar jingyu-stripe avatar mkrager-stripe avatar rfave-stripe avatar roshan-stripe avatar suz-stripe avatar tomas-stripe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.