Skip to content

testdrivenio/flask-stripe-checkout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setting up Stripe Checkout with Flask

Want to learn how to build this?

Check out the post.

Want to use this project?

  1. Fork/Clone

  2. Create and activate a virtual environment:

    $ python3 -m venv venv && source venv/bin/activate
  3. Install the requirements:

    (venv)$ pip install -r requirements.txt
  4. Add your Stripe test secret and publishable keys as environment variables like so:

    (venv)$ export STRIPE_PUBLISHABLE_KEY=<YOUR_STRIPE_PUBLISHABLE_KEY>
    (venv)$ export STRIPE_SECRET_KEY=<YOUR_STRIPE_SECRET_KEY>
  5. In case you're planning to confirm payments using webhooks you also need to add the webhook endpoint environment variable as well:

(env)$ export STRIPE_ENDPOINT_SECRET=<YOUR_ENDPOINT_SECRET_KEY>
  1. Run the server:

    (venv)$ FLASK_ENV=development python app.py

    Navigate to http://localhost:5000.