https://github.com/theolujay/paystack-api-wrapper
Modern, test-driven Python client for the Paystack API — built to save you time integrating into Python projects.
https://github.com/theolujay/paystack-api-wrapper
africa fintech payment payment-integration paystack python
Last synced: 13 days ago
JSON representation
Modern, test-driven Python client for the Paystack API — built to save you time integrating into Python projects.
- Host: GitHub
- URL: https://github.com/theolujay/paystack-api-wrapper
- Owner: theolujay
- License: mit
- Created: 2025-08-12T10:52:00.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-08-21T04:44:22.000Z (5 months ago)
- Last Synced: 2025-10-27T03:55:14.247Z (3 months ago)
- Topics: africa, fintech, payment, payment-integration, paystack, python
- Language: Python
- Homepage:
- Size: 547 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Paystack API Wrapper
[](https://pypi.org/project/paystack-api-wrapper/) [](https://pypi.org/project/paystack-api-wrapper/) [](https://github.com/theolujay/paystack-api-wrapper/actions) [](https://codecov.io/gh/theolujay/paystack-api-wrapper) [](https://github.com/theolujay/paystack-api-wrapper/blob/main/LICENSE)
A clean, intuitive, and reliable Python wrapper for the Paystack API.
This library was built to **eliminate repetitive boilerplate** when integrating Paystack into your Python projects, while emphasizing **modern design, robust error handling, and a test-driven foundation**. Covers the full API with clean abstractions, so you can focus on building features—not handling payments.
See the [Paystack API docs](https://paystack.com/docs/api/) for reference, and explore the [Usage Guide](./docs/USAGE.md) for practical examples.
---
## Installation
```bash
pip install paystack-api-wrapper
```
---
## Quick Start
1. **Initialize the client with your secret key**
(Best practice: store your secret key as an environment variable `PAYSTACK_SECRET_KEY`.)
```python
import os
from paystack import PaystackClient, APIError
secret_key = os.getenv("PAYSTACK_SECRET_KEY")
client = PaystackClient(secret_key=secret_key)
```
2. **Make an API call** (e.g., initialize a transaction):
```python
try:
data, meta = client.transactions.initialize(
email="customer@example.com",
amount=50000, # amount in kobo
currency="NGN"
)
print("Transaction initialized:", data)
# {'authorization_url': '...', 'access_code': '...', 'reference': '...'}
except APIError as e:
print(f"API error: {e.message}")
```
See the [**Full Usage Guide**](./docs/USAGE.md) for details on handling responses, pagination, and advanced error management.
---
## Available APIs
The client exposes all major Paystack API resources as properties:
* `apple_pay`
* `bulk_charges`
* `charge`
* `customers`
* `dedicated_virtual_accounts`
* `direct_debit`
* `disputes`
* `integration`
* `miscellaneous`
* `payment_pages`
* `payment_requests`
* `plans`
* `products`
* `refunds`
* `settlements`
* `subaccounts`
* `subscriptions`
* `terminal`
* `transactions`
* `transaction_splits`
* `transfers`
* `transfers_control`
* `transfer_recipients`
* `verification`
* `virtual_terminal`
---
## Contributing
Contributions are welcome! Check out the [contributing guide](./CONTRIBUTING.md) to get started.
---
## License
MIT © [Joseph Ezekiel](https://github.com/theolujay) – see [LICENSE](./LICENSE) for details.