paystack-django: Django Paystack Payment Integration

paystack-django is a comprehensive Django integration for the Paystack Payment Gateway. It provides 26 API modules, Django models, webhook handling with signature verification, Django signals, and production-ready defaults — everything you need to accept payments in your Django application.

https://badge.fury.io/py/paystack-django.svg https://img.shields.io/badge/Django-3.2%2B-green https://img.shields.io/badge/Python-3.8%2B-blue https://img.shields.io/badge/License-MIT-yellow.svg

Highlights:

  • 26 API modules — Transactions, Customers, Charge, Plans, Subscriptions, Transfers, Refunds, Disputes, Dedicated Accounts, Direct Debit, Splits, Subaccounts, Products, Pages, Payment Requests, Settlements, Bulk Charges, Terminal, Virtual Terminal, Apple Pay, Verification, Integration, Miscellaneous, Transfer Recipients, Transfer Control

  • Django ModelsPaystackTransaction, PaystackCustomer, PaystackPlan, PaystackSubscription, PaystackTransfer, PaystackWebhookEvent

  • Webhook System — Signature-verified, IP-whitelisted, deduplicated event handling

  • Django Signals — 9 signals for payment lifecycle events

  • System Checks — Validates configuration at startup (E001, W001)

  • Context ManagerPaystackClient supports with statements

  • Type Hints — Fully typed with py.typed marker

Quick Example

from djpaystack import PaystackClient

with PaystackClient() as client:
    # Initialize a payment
    response = client.transactions.initialize(
        email='customer@example.com',
        amount=50000,  # 500 NGN in kobo
    )
    print(response['data']['authorization_url'])

    # Verify after payment
    result = client.transactions.verify(reference=response['data']['reference'])
    if result['data']['status'] == 'success':
        print('Payment confirmed!')

Supported Services

Category

API Modules

Payments

Transactions, Charge, Payment Requests, Pages

Customers

Customers, Direct Debit, Dedicated Accounts

Recurring

Plans, Subscriptions

Payouts

Transfers, Transfer Recipients, Transfer Control

Commerce

Products, Splits, Subaccounts

Operations

Refunds, Disputes, Settlements, Bulk Charges

Other

Verification, Terminal, Virtual Terminal, Apple Pay, Integration, Miscellaneous

Resources

License

MIT License — see the LICENSE file.

Indices and tables