Recurring payments solution Askell integration for Django and Wagtail (optional)
Project description
django-askell
Áskell integration for Django and Wagtail (optional)
Installation
pip install django-askell
Add the app to your INSTALLED_APPS
INSTALLED_APPS = [
# ... other apps
'askell',
# ... other apps
]
Add the app urls to your project urls.py:
from django.urls import path, include
from askell.urls import urls as askell_urls
urlpatterns = [
# ... your other urls
path('askell/', include(askell_urls)),
# ... more urls
]
Then go to Áskell, create a public/private key pair and add these keys to your settings file or environment in your project:
ASKELL_PUBLIC_KEY = 'my-public-key'
ASKELL_SECRET_KEY = 'my-secret-key'
To complete your setup, it is recommended to set up a webhook in Áskell's dashboard pointing to your website's URL. If your website has the domain https://example.com and you have added the app urls to your project, then the view that receives the webhooks is located at https://example.com/askell/webhook/.
Create your webhook, and then obtain your webhook secret and put it in your settings file or environment in your project:
ASKELL_WEBHOOK_SECRET = 'my-secret'
Webhook handlers
You can register new webhook handlers if you want to implement custom logic when something happens in Áskell. These are the default webhook handlers:
askell.webhook_handlers.payment_created
askell.webhook_handlers.payment_changed
Registering a new handler is simple:
from askell.webhooks import register_webhook_handler
@register_webhook_handler
def payment_settled(request, event, data):
from .models import Payment
if event == 'payment.changed':
if data['state'] == 'settled':
# do something here
return True
TODO
- Document webhook handlers
- [ ] Document views
- Implement subscription handling
Release notes
Version 0.1.20
- Adding a setting to disable default webhook handlers. Also a new function to unregister webhook handlers.
Version 0.1.19
- Adding payment method import method
Version 0.1.7
- Fixed a bug in creating a customer
Version 0.1.6
- Added support for multiple states
Version 0.1.5
- Fixed a bug with imports
Version 0.1.4
- Fixed a bug in the Payment detail view
Version 0.1.3
- Fixed a bug in webhook handler
Version 0.1.2
- Added logging mechanism for debugging
Version 0.1.1
- Changed the way webhook handlers are imported and documented
Version 0.1
- Support for creating Payment objects
- Support for webhooks processing and verification
- Default webhook handlers for payment created, and changed
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_askell-0.1.20.tar.gz.
File metadata
- Download URL: django_askell-0.1.20.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e9018d996c1589d41f45b6731d7030f2bd4320c17497e55df14c0b4d6d7ec42
|
|
| MD5 |
d59eb5220db3451a43fb5f1d420be315
|
|
| BLAKE2b-256 |
0543135316236c2156e56b4c338f4e6a4443631648694029acdbaddf14f7ed8f
|
File details
Details for the file django_askell-0.1.20-py3-none-any.whl.
File metadata
- Download URL: django_askell-0.1.20-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cac85c42af5f9e98febeb6425cdfd04287c20dd2f60364a173897fa07635402
|
|
| MD5 |
2a0c22c3f067b2b94b7b06fbba264f09
|
|
| BLAKE2b-256 |
01615b8cb08772a1b276a936bd4111c191ef37353967deaefcd8985fa9aac8c8
|