Skip to main content

Recurring payments solution Askell integration for Django and Wagtail (optional)

Project description

django-askell

Áskell integration for Django and Wagtail (optional)

Build Status

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.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


Download files

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

Source Distribution

django_askell-0.1.19.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_askell-0.1.19-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file django_askell-0.1.19.tar.gz.

File metadata

  • Download URL: django_askell-0.1.19.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for django_askell-0.1.19.tar.gz
Algorithm Hash digest
SHA256 a3d149cb31dd1ac8821d8d7892ae9103e3a097ee5ee1caab92cc467090b4adb3
MD5 e017e0d3689010584e1d7895b0f472a2
BLAKE2b-256 110abb08af53d0e2c02d255c46b41f99b1442089b677eb1f61f13db5397d7043

See more details on using hashes here.

File details

Details for the file django_askell-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: django_askell-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for django_askell-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 387fce6dcafc493001f7cc29f778697a1b8ccf64d7b97a9c4e61c68b4c4b823f
MD5 f76c4fd9ea3f8cc3a70123223b021408
BLAKE2b-256 b6ec713f51fe1385e77c91713785efb65171510963329dcff3dfab71e99c4e32

See more details on using hashes here.

Supported by

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