PIN payments integration for mezzanine/cartridge
Python HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cartridge_pinpayments
.gitignore Initial commit Mar 9, 2015
LICENSE
MANIFEST.in
README.md Updating version number, requirements for latest mezzanine/cartridge/… Jan 5, 2017
requirements.txt
setup.py Updating version number, requirements for latest mezzanine/cartridge/… Jan 5, 2017

README.md

cartridge-pinpayments

PIN payments integration for mezzanine/cartridge

See http://pin.net.au for PIN Payments home page.

Requirements:

Installation:

Working in your project's virtual environment:

pip install -e git+https://github.com/molokov/cartridge-pinpayments.git#egg=cartridge_pinpayments

Add the following settings to your settings file:

INSTALLED_APPS = (

    "cartridge_pinpayments",
    "cartridge.shop",
    # ...

    "pinpayments",
)

SHOP_HANDLER_PAYMENT = "cartridge_pinpayments.payment_handler"

# set these variables up as per django-pinpayments instructions
PIN_ENVIRONMENTS = { ... }
PIN_DEFAULT_ENVIRONMENT = 'test'

In your urls.py, ensure the PinOrderForm class is used in place of OrderForm:

from cartridge.shop.views import checkout_steps
from cartridge_pinpayments.forms import PinOrderForm

# ...

urlpatterns += [

    # Use our special OrderForm class
    url("^shop/checkout/$", checkout_steps, name="shop_checkout", kwargs=dict(form_class=PinOrderForm)),

    # Cartridge URLs.
    url("^shop/", include("cartridge.shop.urls")),

    # ...
]

Migrate Existing Database

The django-pinpayments app needs to create two tables in the database, so be sure to run:

python manage.py migrate pinpayments

Templates

IMPORTANT

templates/shop/checkout.html has been overridden from the version in cartridge 0.12.0 to define some extra ids and names on form elements that are used by the javascript in the included pin_header.html template.

These are:

    <form method="post" class="checkout-form col-md-8" id="checkout-form" >

    <input type="submit" class="btn btn-lg btn-primary pull-right" name="next" value="{% trans "Next" %}">

Thus if you are planning to override checkout.html yourself, be sure to copy these modifications across to your version of the template.