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
]

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.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.5.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

django_askell-0.1.5-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file django-askell-0.1.5.tar.gz.

File metadata

  • Download URL: django-askell-0.1.5.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.15

File hashes

Hashes for django-askell-0.1.5.tar.gz
Algorithm Hash digest
SHA256 de854fa2d8d162a65a9c7b4eea22872d4bc5812c0d73001f0abba163bebf4f63
MD5 1f7d618e66afd3f5ab36d653f417f8ce
BLAKE2b-256 cfbeb36bd22e942de00fcea0b97a2d18546ec813a4ab70a90b10f76d292b390a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_askell-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 22131f19507373e59015fa34421593fffd2f1b1ebce1ae25adcf1cace60a029e
MD5 d98d561f26a3a3317481b81463c6d27e
BLAKE2b-256 345e06e8807806e8954d7955f20adad966dba76a5c10f724d447ed7e4e2f39ba

See more details on using hashes here.

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