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.
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 Models —
PaystackTransaction,PaystackCustomer,PaystackPlan,PaystackSubscription,PaystackTransfer,PaystackWebhookEventWebhook 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 Manager —
PaystackClientsupportswithstatementsType Hints — Fully typed with
py.typedmarker
Getting Started
Usage Guide
API Reference
Advanced Topics
Project
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.