Giter VIP home page Giter VIP logo

dj-braintree's Introduction

dj-braintree

Django + Braintree Made Easy

Badges

https://img.shields.io/travis/mightbejosh/dj-braintree.svg?style=flat-square https://img.shields.io/codecov/c/github/mightbejosh/dj-braintree/master.svg?style=flat-square https://img.shields.io/requires/github/mightbejosh/dj-braintree.svg?style=flat-square https://img.shields.io/codacy/3c99e13eda1c4dea9f993b362e4ea816.svg?style=flat-square https://img.shields.io/pypi/v/dj-braintree.svg?style=flat-square https://img.shields.io/pypi/dw/dj-braintree.svg?style=flat-square https://img.shields.io/github/issues/mightbejosh/dj-braintree.svg?style=flat-square https://img.shields.io/github/license/mightbejosh/dj-braintree.svg?style=flat-square

Documentation

The full documentation is at http://dj-braintree.rtfd.org.

Features

  • Subscription management
  • Single-unit purchases
  • Works with Django ~=1.9.1, 1.8
  • Works with Python 3.5, 3.4, 2.7
  • Works with Bootstrap 3
  • Built-in migrations
  • Dead-Easy installation
  • djbraintree namespace so you can have more than one payments related app
  • Documented
  • Tested
  • Current API version (2012-11-07), in progress of being updated

Constraints

  1. For braintreepayments.com only
  2. Support the Braintree Marketplace API (for creating ecommerce platforms, vendors and submerchants)
  3. Only use or support well-maintained third-party libraries
  4. For modern Python and Django

Quickstart

Install dj-braintree:

pip install dj-braintree

Add djbraintree to your INSTALLED_APPS:

INSTALLED_APPS +=(
    "djbraintree",
)

Add your Braintree keys:

BRAINTREE_PUBLIC_KEY = os.environ.get("BRAINTREE_PUBLIC_KEY", "<your publishable key>")
BRAINTREE_PRIVATE_KEY = os.environ.get("BRAINTREE_PRIVATE_KEY", "<your secret key>")
BRAINTREE_MERCHANT_ID = os.environ.get("BRAINTREE_MERCHANT_ID", "<your merchant ID>")

Add to the urls.py:

url(r'^payments/', include('djbraintree.urls', namespace="djbraintree")),

Run the commands:

python manage.py migrate

python manage.py djbraintree_init_customers

python manage.py djbraintree_init_plans

If you haven't already, add JQuery and the Bootstrap 3.0.0+ JS and CSS to your base template:

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">

<!-- Latest JQuery (IE9+) -->
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="//netdna.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>

Also, if you don't have it already, add a javascript block to your base.html file:

{% block javascript %}{% endblock %}

Running the Tests

Assuming the tests are run against PostgreSQL:

createdb djbraintree
pip install -r requirements_test.txt
python runtests.py

Follows Best Practices

This project follows best practices as espoused in Two Scoops of Django: Best Practices for Django 1.8.

Similar Projects

dj-braintree's People

Stargazers

Mahmoud Hashemi avatar Lionel Chanson avatar

Watchers

Zach avatar

dj-braintree's Issues

Django 2.0 Support

Hi,
your package looks awesome ๐Ÿ‘ I was wondering if you are still maintaining it and if it's production ready?

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.