Skip to content

molokov/cartridge-pinpayments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cartridge-pinpayments

PIN payments integration for mezzanine/cartridge

See https://pinpayments.com/ 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 1.0.0a 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.

About

PIN payments integration for mezzanine/cartridge

Resources

License

Stars

Watchers

Forks

Packages

No packages published