Django app for integrating Estonian banklinks into your project.
| Bank | Protocol | Authentication | Payment |
|---|---|---|---|
| Swedbank | iPizza | ✔️ | ✔️ |
| SEB | iPizza | ✔️ | ✔️ |
| Danske | iPizza | ✔️ | ✔️ |
| LHV | iPizza | ✔️ | ✔️ |
| Krediidipank | iPizza | ✔️ | ✔️ |
| Nordea | iPizza | ✔️ | ✔️ |
Pip:
pip install django-thorbanksPipenv:
pipenv install django-thorbanksPoetry:
poetry add django-thorbanksINSTALLED_APPS = (
# Add the following apps:
"thorbanks",
"thorbanks_models",
)With MANUAL_MODELS:
- Remove
"thorbanks_models"fromINSTALLED_APPS - follow instructions from thorbanks.settings.get_model.
With default models:
Make django aware that thorbanks migrations are in your local apps folder via settings.MIGRATION_MODULES:
Note: Replace
shopwith 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.
For a working example see the definitions in example/settings.py.
Note: You will need a public and private key for each bank integration. In case you don't have the public key, you can generate one out of a certificate by:
openssl x509 -pubkey -noout -in cert.pem > pubkey.pem
Note: When using MANUAL_MODELS replace
thorbanks_modelswith your local app name
class Order(models.Model):
# ... other fields
transaction = models.OneToOneField(
"thorbanks_models.Transaction", null=True, on_delete=models.SET_NULL
)urlpatterns = [
# This is where the user will be redirected after returning from the banklink page
url(r"^banks/", include("thorbanks.urls")),
]See example.shop.models.banklink_success_callback and example.shop.models.banklink_failed_callback.
see example.shop.views and example.shop.forms.
