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
]
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.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
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
File details
Details for the file django-askell-0.1.7.tar.gz
.
File metadata
- Download URL: django-askell-0.1.7.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c196bb4b437a12ddb24e0567c61222c7979d814115411be8563879c98280e28 |
|
MD5 | 81b9a7a757bff52a8133bc92ef2b15bd |
|
BLAKE2b-256 | d0f73f0fccd17f7a352e266d17e0333062ee2649f679d550f077ed6d90d0de64 |
File details
Details for the file django_askell-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: django_askell-0.1.7-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5959a3b76dd2d0b972531bbc6ea77c8cc53099ab6c7273ec9a4304638940d367 |
|
MD5 | ecce711c2b173474a4870b44688f0663 |
|
BLAKE2b-256 | 808cddf3d5f8e564924ba10abf928d6304cb62ccaa183ff97763066f5e88ed0b |