bastien34 / django-oscar-systempay

Systempay integration for django-oscar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use

This is fork of django-oscar-systempay, a payment solution intended to be used with django-oscar and Natixis Bank Systempay.

The current implementation is based on the document V2 available online.

SystemPay documentation

Install

Install from the github repository.

pip install git+https://github.com/bastien34/django-oscar-systempay.git

The configuration will consist in few steps:

  1. Add systempay to your INSTALLED_APPS settings
  2. Config your urls app project
  3. Migrate

Config

First to integrate systempay to your oscar project, you need to overwrite the root app in order to include the bench of urls used for systempay.

Override the root app

Settings `INSTALLED_APPS`

Start by adding systempay to your INSTALLED_APPS settings:

INSTALLED_APPS = (
    ...,
    'systempay',
)

Create an app file in your project as following:

This will link both dashboard systempay app and main systempay app to your project.

# myproject/app.py
from oscar.app import Shop as CoreShop
from oscar.core.loading import get_class


class Shop(CoreShop):

    systempay_app = get_class('systempay.app', 'application')

    def get_urls(self):
        urls = super().get_urls()

        urls += [
            url(r'^systempay/', include(self.systempay_app.urls)),
            url(r'^dashboard/systempay/', include(systempay_dashboard.urls)),
        ]
        return urls

application = Shop()

Link your root urls file to the new application

# config/urls.py
(...)
from materielfroid.app import application


urlpatterns = [
    ...
    url(r'', include(application.urls)),
    ]

Run migrations

./manage.py migrate

Configure `site`

Django-oscar-systempay uses Site to build its urls. So you must configure it correctly before testing.

from django.contrib.sites.models import Site
# we suppose you only have one site here
site = Site.objects.first()
site.domain = "your.domain.com"
site.save()

Add SystemPay to your Dashboard

Configure your urls.py to match the systempay app url as explained below.

in your settings:

# Dashboard navigation
OSCAR_DASHBOARD_NAVIGATION += [
    {
        'label': _('Transactions'),
        'icon': 'icon-book',
        'children': [
            {
                'label': 'SystemPay',
                'url_name': 'systempay-list',
                },
            ]
    },
    ]

Requirements

Django-oscar-systempay is compatible with Python 3 and Django 1.9. No test has been done on Python 2.7 for now.

About

Systempay integration for django-oscar.

License:MIT License


Languages

Language:Python 86.3%Language:HTML 13.7%