diff --git a/.gitignore b/.gitignore
index c8a9439..558440e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,4 +52,5 @@ docs/_build
webpack-stats.json
-*bundle.js*
\ No newline at end of file
+*bundle.js*
+.eggs/
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 30f66c8..0f436ee 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ language: python
python:
- "3.5"
-env:
+env:
- TOX_ENV=py35-django-18
- TOX_ENV=py34-django-18
- TOX_ENV=py33-django-18
@@ -13,12 +13,14 @@ env:
- TOX_ENV=py35-django-19
- TOX_ENV=py34-django-19
- TOX_ENV=py27-django-19
+ - TOX_ENV=py35-django-110
+ - TOX_ENV=py35-django-111
matrix:
fast_finish: true
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
-install:
+install:
- . $HOME/.nvm/nvm.sh
- nvm install stable
- nvm use stable
diff --git a/AUTHORS.rst b/AUTHORS.rst
index f00d039..529b47a 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -10,4 +10,5 @@ Development Lead
Contributors
------------
-None yet. Why not be the first?
+* Alex (https://github.com/alexfromvl)
+
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 9e2551f..0e6b95c 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,6 +6,16 @@ History
0.2.0 (In Development)
++++++++++++++++++++++
+* Added a template tag for easy 'Add To Basket' buttons
+* Added a template tag for shipping rates
+* Created a client side Javascript library for the REST API
+* We built basic views for Checkout and Basket
+* Added template tags to help simplify integration with payment backends
+* Basic checkout template in the project_template
+* Bug fixes around payment gateway integrations
+* Created a standard address form
+* Pushed test coverage past 80%
+
0.1.1 (2017-04-14)
+++++++++++++++++++
diff --git a/docs/usage/checkout.rst b/docs/usage/checkout.rst
index 7315708..37f00d7 100644
--- a/docs/usage/checkout.rst
+++ b/docs/usage/checkout.rst
@@ -3,18 +3,18 @@
Checkout
========
-Longclaw provides a simple, single checkout view.
+Longclaw provides a simple, single checkout view.
The URL for the checkout is ``'checkout/'``.
After a successful checkout, it is redirected to ``checkout/success/``.
To implement the checkout, simply provide ``'longclawcheckout/checkout.html'`` and
-``'longclawcheckout/success.html'`` templates. (Empty templates will have been created if
+``'longclawcheckout/success.html'`` templates. (Empty templates will have been created if
you ran the longclaw CLI to start your project)
There are three forms provided in the checkout view:
:checkout_form:
- Captures the email address and optionally the shipping option for the checkout.
+ Captures the email address and optionally the shipping option for the checkout.
Also captures a boolean indicating whether a different billing address should be used
:shipping_form:
@@ -24,13 +24,13 @@ There are three forms provided in the checkout view:
A second address form for capturing alternate billing information. If you do not submit this form
(e.g. by not rendering it on the template), the billing and shipping addresses are assumed to be the same.
-Generally, you may need to use a little javascript to optionally render the form if the user selects
+Generally, you may need to use a little javascript to optionally render the form if the user selects
'different billing address'.
Shipping Options and Javascript
--------------------------------
-The shipping option dropdown has no options by default - this is because it is dependent on the shipping country.
+The shipping option dropdown has no options by default - this is because it is dependent on the shipping country.
The checkout form includes the necessary javascript to do this - you just need to include it on the page.
You will typically also need to include your chosen payment gateways' client javascript:
@@ -46,7 +46,7 @@ You will typically also need to include your chosen payment gateways' client jav
-
+
The first half uses the ``gateway_client_js`` template tag to load all the payment gateway javascript. There may be one or more.
The second half has three parts to it:
@@ -68,8 +68,10 @@ It is up to you to render a payment form and then pass the token in the POST dat
Normally, the payment gateway chosen will have a javascript integration to render a form for you
and tokenize the payment method (e.g. braintrees 'hosted fields')
-Longclaws' payment gateways provide some helpful utilities to load client javascript and generate tokens.
+Longclaws' payment gateways provide some helpful utilities to load client javascript and generate tokens.
Loading ``longclawcheckout_tags`` in your template will allow you to retrieve the gateways' javascript libraries
as script tags (``{% gateway_client_js %}`` and generate a client token (``{% gateway_token %}``).
-A little javascript is then required to setup your form and ask the gateway to tokenize the payment method for you.
-You should then add this token to the request POST data (e.g. with a hidden input field).
+A little javascript is then required to setup your form and ask the gateway to tokenize the payment method for you.
+You should then add this token to the request POST data (e.g. with a hidden input field).
+
+For in-depth info on integration, see the walkthrough.
diff --git a/docs/walkthrough/checkout.rst b/docs/walkthrough/checkout.rst
index 5f9d6f8..9f12350 100644
--- a/docs/walkthrough/checkout.rst
+++ b/docs/walkthrough/checkout.rst
@@ -1,10 +1,10 @@
+.. checkout-walkthrough:
-
-Checkout with Paypal Express
+Checkout with Braintree
============================
Longclaw offers integration with a few payment gateways and it is also fairly easy to integrate your own.
-For this tutorial, we will use Paypal Express Checkout to process payments.
+For this tutorial, we will use Braintree to process payments.
Settings and Dependencies
-------------------------
@@ -13,10 +13,17 @@ The payment gateway to use must be set in the settings file:
.. code-block:: python
- PAYMENT_GATEWAY = 'longclaw.longclawcheckout.gateways.braintree.PaypalVZeroPayment'
+ PAYMENT_GATEWAY = 'longclaw.longclawcheckout.gateways.braintree.BraintreePayment'
-The ``PaypalVZeroPayment`` class will allow us to take payments using Paypal Express Checkout and is dependent on the
-braintree SDK.
+
+We also need to define settings for access tokens;
+
+.. code-block:: python
+
+ BRAINTREE_SANDBOX = False
+ BRAINTREE_MERCHANT_ID = os.environ['BRAINTREE_MERCHANT_ID']
+ BRAINTREE_PUBLIC_KEY = os.environ['BRAINTREE_PUBLIC_KEY']
+ BRAINTREE_PRIVATE_KEY = os.environ['BRAINTREE_PRIVATE_KEY']
We will need to install this SDK as it is not an explicit dependency of longclaw::
@@ -27,16 +34,182 @@ That is all we need to do to configure our backend!
Front end integration
---------------------
+We will first show how to setup a checkout page using the Checkout view provided by longclaw.
+The code shown here is very similar to the implementation of the checkout page here: `Ramshackle Audio`_
+
+First, we should load some templatetags which will help us:
+
+.. code-block:: django
+
+ {% load longclawcheckout_tags longclawcore_tags %}
+
+As an aside - you may wish to display the items in the basket on our checkout page. The basket items queryset is available as ``basket``
+in the views' context.
+
+Next, we need to setup the forms to gather customer information. There are 2 forms in the context. We will
+display and submit them as a single form. Here is an example layout:
+
+.. code-block:: django
+
+