Coder Social home page Coder Social logo

kbourgoin / hiicart Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 5.0 458 KB

Please note the official branch for HiiCart has been moved to the Hiidef organization account

Home Page: https://github.com/hiidef/hiicart

License: MIT License

Python 100.00%

hiicart's Introduction

HiiCart - Django Shopping Cart

A simple shopping cart implementation with support for PayPal, Google Checkout, and Amazon Payments.

Installation and Setup

Installation is as easy as installing with easy_install or pip and adding the appropriate settings for the gateways you want to use. Please see the documentation in hiicart/settings.py for more details about the settings available.

Once set up, create LineItem and HiiCart objects to submit payments:

def foo():
    cart = HiiCart.objects.create() 
    LineItem.objects.create(
        cart=cart, description="foo", name="bar",
        quantity=1, sku="12345", thankyou="thanks!",
        unit_price=9.99)
    return cart.submit("google")

This returns an object containing the redirect URL for you user.

Example App

An example app is included that shows very generally how to get everything set up and working. Right now it really needs a lot of work, but is functional for the most basic case.

hiicart's People

Contributors

bhagany avatar kbourgoin avatar rays avatar jmoiron avatar

Stargazers

 avatar  avatar  avatar Philippe O. Wagner avatar

Watchers

 avatar  avatar  avatar

hiicart's Issues

CART_COMPLETE setting is incomplete

This remains a largely incomplete idea. The goal was to have all return pages go to HiiCart, which would then redirect based on this setting. This would obviate the need for each gateway to have a setting for the return url.

Google Checkout subscriptions aren't cancellable

The Problem

Google Checkout can't cancel subscriptions programmatically. This is similar to #1, but a bit more complex. For this, we an either change how subscriptions are handled by HiiCart or add a new lineitem to all Checkout carts.

Change Subscription Handling

Google offers merchant handled subscriptions which seem a good method. This would follow the same model that Amazon does right now, which would be great. The principle drawback is that there's still no clear way to cancel a subscription. We'd just stop billing the subscription, which would be a de facto cancel, but it'd still be technically 'active'.

Adding LineItem to all Carts

The second method is to add a non-recurring LineItem to all carts going out. Why this works isn't immediately obvious:

The mechanism that Google provides to programmatically cancel a subscription is to on the recurring item. The problem that arises is that it must be refunded before it can be cancelled. If we add the lineitem, we can cancel the subscription without having to issue the refund.

This table illustrates the options when creating a subscription. The proposed solution corresponds to the third row of that table.

It isn't currently known if this 'refund first' policy affects subscriptions with recurring payments made (e.g. cancelling a subscription two years out).

Combined Approach

Ultimately, it may be a good idea to move to merchant handled subscriptions AND some method of being able to cancel subscriptions properly. If nothing else, it would be very nice to have the control over billing times and move it to a similar system as Amazon.

Wiki pages for gateways

Need setup information, with screenshots, for all supported gateways. Settings comments are already in markdown, so should be able to copypasta part of the doc.

Credit Card support in paypal2

We should be able to accept credit card numbers directly in the paypal2 gateway. Need to investigate what we need to be regulatory compliant, however.

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.