thomasWajs / cartridge-external-payment

A module for Mezzanine/Cartridge that allows payment on an external provider platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cartridge-external-payment

Integration of Cartridge/Mezzanine with payment providers that requires to redirect the buyer on a form on their platform.

Installation

Working in your project's virtualenv:

git clone https://github.com/thomasWajs/cartridge-external-payment.git
cd cartridge-external-payment
python setup.py install

Application

Add 'cartridge_external_payment' to your settings.INSTALLED_APPS, before 'cartridge.shop'

Order Form

Set the alternative OrderForm class for the checkout process (see cartridge documentation):

SHOP_CHECKOUT_FORM_CLASS = 'cartridge_external_payment.forms.ExternalPaymentOrderForm'

Order Form

Add an extra field to the Order, so we can follow which order has been payed succesfully

		(
            "cartridge.shop.models.Order.payment_done",
            "BooleanField",
            (u"Payment effectué",),
            {"default": False},
        ),

Urls

You must includes the cartridge_external_payment urls in your urls configuration file, before the cartridge inclusion :

urlpatterns = patterns("",
	("^shop/", include("cartridge_external_payment.urls")),
	("^shop/", include("cartridge.shop.urls")),
	[...]
)

Payment provider connector

You must define the connector that will allows to start the payment process and retrieve order datas when the buyer comes back. The connector should implements the providers.base.PaymentProvider interface.

SHOP_PAYMENT_PROVIDER = 'cartridge_external_payments.providers.be2bill.Be2BillProvider'

You can find an exemple implementation by looking at the providers directory.

About

A module for Mezzanine/Cartridge that allows payment on an external provider platform

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 100.0%