https://github.com/ichinga-samuel/aiopaystack
Asynchronous Paystack Library for Python
https://github.com/ichinga-samuel/aiopaystack
asynchronous-programming asyncio paystack paystack-api paystack-library paystack-python python
Last synced: 8 months ago
JSON representation
Asynchronous Paystack Library for Python
- Host: GitHub
- URL: https://github.com/ichinga-samuel/aiopaystack
- Owner: Ichinga-Samuel
- License: mit
- Created: 2022-02-12T09:00:20.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-13T21:48:43.000Z (over 2 years ago)
- Last Synced: 2025-02-12T05:57:15.149Z (8 months ago)
- Topics: asynchronous-programming, asyncio, paystack, paystack-api, paystack-library, paystack-python, python
- Language: Python
- Homepage:
- Size: 101 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aiopaystack
Asynchronous Python library for [Paystack](https://paystack.com/)




## Installation
```bash
pip install aiopaystack
```## Usage
Add your paystack secret key as an environment variable as PAY_STACK_SECRET_KEY
```python
from paystack import Transactionstrans = Transactions()
# All parameters must be passed in as keywords. For both required and optional arguments.
res = await trans.initialize(email="sam@gmail.com", amount='5000')# Passing secret key as an argument
# This replaces any key set in the environment
from paystack import Paystack
paystack = Paystack(secret_key="paystack_secret_key")# to use one session for multiple request use the class as a context manager
async with Transactions() as trans:
res= await trans.verify(reference="ref")
# The response type for every request is a typed dict.
from typing import TypedDict, Any
Response = TypedDict('Response', {'status_code': int, 'status': bool, 'message': str, 'data': dict | Any})# Sample response
{'status': True,
'message': 'Authorization URL created',
'data':
{'authorization_url': 'https://checkout.paystack.com/3521i62zf1i0ljl',
'access_code': '3521i62zf1i0ljl', 'reference': '2q16btxglw'
},
'status_code': 200
}
## DOC Reference:
### Static Use
```
Don't forget to get your API key from [Paystack](https://paystack.com/) and assign to the variable `PAYSTACK_SECRET_KEY`
Please reference the **docs** folder for usage,