Skip to main content

`django-thorbanks` provides a Django application for Estonian banklinks (iPizza protocol).

Project description

django-thorbanks

Build Status Coverage Status PyPI release

Django app for integrating Estonian banklinks into your project.

Features

Bank Protocol Authentication Payment
Swedbank iPizza :heavy_check_mark: :heavy_check_mark:
SEB iPizza :heavy_check_mark: :heavy_check_mark:
Danske iPizza :heavy_check_mark: :heavy_check_mark:
LHV iPizza :heavy_check_mark: :heavy_check_mark:
Krediidipank iPizza :heavy_check_mark: :heavy_check_mark:
Nordea iPizza :heavy_check_mark: :heavy_check_mark:

Usage

1. Install it:

Pip:

pip install django-thorbanks

Pipenv:

pipenv install django-thorbanks

Poetry:

poetry add django-thorbanks

2. Add to installed apps

INSTALLED_APPS = (
    # Add the following apps:
    "thorbanks",
    "thorbanks_models",
)

3. Configure and create migrations:

With MANUAL_MODELS:

With default models:

Make django aware that thorbanks migrations are in your local apps folder via settings.MIGRATION_MODULES:

Note: Replace shop with the name of an existing app in your project.

# Tell django that thorbanks_models migrations are in shop app (in thorbanks_migrations module)
MIGRATION_MODULES = {"thorbanks_models": "shop.thorbanks_migrations"}

Now run makemigrations thorbanks_models and migrate management commands to create and apply the migrations.

4. Add settings.BANKLINKS

For a working example see the definitions in example/settings.py.

5. Link Transaction to your Order model

Note: When using MANUAL_MODELS replace thorbanks_models with your local app name

class Order(models.Model):
    # ... other fields
    transaction = models.OneToOneField(
        "thorbanks_models.Transaction", null=True, on_delete=models.SET_NULL
    )

6. Include thorbanks urls

urlpatterns = [
    # This is where the user will be redirected after returning from the banklink page
    url(r"^banks/", include("thorbanks.urls")),
]

7. Add listeners to banklinks success & failure callbacks:

See example.shop.models.banklink_success_callback and example.shop.models.banklink_failed_callback.

8. Create views and forms for payments:

see example.shop.views and example.shop.forms.

iPizza protocol

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-thorbanks-0.6.0.tar.gz (41.8 kB view hashes)

Uploaded Source

Built Distribution

django_thorbanks-0.6.0-py3-none-any.whl (47.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page