Code Monkey home page Code Monkey logo

stripe-flask's Introduction

Stripe Flask

A simple Python (Flask) app that interacts with the Stripe API (both Python and JavaScript) for accepting credit card payments. Users are identified by unique email addresses. New users are saved in a local MongoDB database and recurring charges can be made for saved users (only need to store the user email and Stripe ID for that customer).

How to Get Started

  1. Install all the necessary packages (best done inside of a virtual environment)

pip install -r requirements.txt

  1. Make sure 'mongod' is installed and running - http://docs.mongodb.org/manual/installation/

  2. Get your Stripe API keys (https://manage.stripe.com/account/apikeys) and add PUBLISHABLE_KEY and SECRET_KEY to your .bashrc file

export PUBLISHABLE_KEY=<your_publishable_key_from_stripe> 
export SECRET_KEY=<your_secret_key_from_stripe>

and reload

. ~/.bashrc

  1. Run the app

python runserver.py

If all goes well, you should see the example submission form at http://localhost:5000. Screenshot:

Alt text

Making Changes

  • Global configuration options like DEFAULT_CHARGE_AMOUNT and DB_NAME are in config.py.
  • Uncomment 'test_data.load()' in templates/index.html to disable loading test data.

Author(s)

Muneeb Ali - http://muneeb.org

Modified from examples at http://stripe.com/docs/

License

MIT License - see LICENSE

stripe-flask's People

Contributors

muneeb-ali avatar

Watchers

 avatar  avatar

Forkers

evansa

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.