:orphan: .. module:: itemshop itemshop ======== ``itemshop`` provides a `Flask`_ (>=0.8) blueprint that you can mount in your app to get a simple purchase flow for a single item. Payments are handled using `stripe`_. The credit card information is processed in the browser using `stripe.js`_, so you don't need to handle sensitive info server-side. The server-side code takes the ``stripe_token`` obtained from ``stripe.js``, then uses the `stripe python API`_ to actually make the charge. .. _Flask: http://flask.pocoo.org/ .. _stripe: https://stripe.com/ .. _stripe.js: https://stripe.com/docs/stripe.js .. _stripe python API: http://pypi.python.org/pypi/stripe Philosophy ---------- .. toctree:: :maxdepth: 10 philosophy Guide ----- .. toctree:: :maxdepth: 10 quickstart Demo site --------- There is a demo site running here: * http://itemshopdemo.lost-theory.org/ The demo is running in stripe's test mode, which means only this test credit card info will work: * Credit card: ``4242-4242-4242-4242`` * CVC: any 4 digit number * Expiration date: any date in the future Demos ----- If you `clone the repository`_ you will see a ``demos`` directory with example uses of :class:`ItemBP`. Each demo is meant to be a standalone application, they do not depend on each other or any other libraries, except for some shared static files (JS and CSS). Here are the current demos: * `01-simplest`_: Very simple usage of :class:`ItemBP`. Creates a new :class:`ItemBP` then mounts it at the root of a flask app. * `02-two-items`_: Shows how multiple :class:`ItemBP` objects can be instantiated and mounted at different URLs on the app. Also shows how templates can be overridden for a specific item. * `03-secure-download`_: Shows how to inherit from :class:`ItemBP` to add new behaviors and new routes: 1. Adds a receipt code. 2. Uses that receipt code to make a download link for a PDF. The PDF can only be accessed with a valid receipt code. .. _clone the repository: https://bitbucket.org/lost_theory/flask-stripe-blueprint/src .. _01-simplest: https://bitbucket.org/lost_theory/flask-stripe-blueprint/src/tip/demos/01-simplest .. _02-two-items: https://bitbucket.org/lost_theory/flask-stripe-blueprint/src/tip/demos/02-two-items .. _03-secure-download: https://bitbucket.org/lost_theory/flask-stripe-blueprint/src/tip/demos/03-secure-download API documentation ----------------- .. toctree:: :maxdepth: 10 api