Giter VIP home page Giter VIP logo

w2p-storefront's Introduction

w2p-storefront

A simple web2py/jQuery storefront using Stripe.js

Please refer to Stripe.js documentation to handle purchases properly:

  1. Follow this tutorial to get your setPublishableKey ready to talk to stripe (https://stripe.com/docs/tutorials/forms) -- this is implemented here, and you just need to change line 109 of storefront.html to your public key for Stripe.

  2. Next, create the server side call to stripe (https://stripe.com/docs/tutorials/charges) --not implemented on this project for security constraints with private key but this is project is a great boilerplate to start off

As always feel free to reach out to me if you have any questions.

Features:

Search - Live searching enables of products. Just type keywords and products appear/disappear (no need for form submission)

Shopping Cart - Added Plus and Minus to increase or decrease stock, also kept the universal trash for quick clearing.

Form Validation - All fields must be filled in, all financial information must be correct by Stripe.js (used their validation from their API).

AJAX Post - Posting the payment info to stripe, since stripe doesnt look at user information other than payment information. I pass the token, cart, and shipping details to be handled by server side code. Server side not implemented.

Processing - To allow for the mass demand, we created a simple wait to ensure our server isn't hit like crazy. I really just did this for looks. Also I didn't like the alerts messing up my nice pretty gif. Displaying some debug information under the processing image.

Clear Cart - The most requested feature. Once you submit your payment your cart is cleared and ready for more orders! :) So long as the user doesnt refresh the page, his/her payment information remains in the payment form just in case they wish to place another order. I know this is bad practice, but for testing purposes I left it on.

w2p-storefront's People

Contributors

jvasallo avatar

Stargazers

Pengfei Yu avatar

Watchers

James Cloos avatar  avatar  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.