A Python implementation of the Paystack API
Project description
paystack-lib-python
This library provides a Python implementation of the Paystack API.
Installation
pip3 install --upgrade paystacklib
Requirements
Python 3.5+
Usage
The Paystack secret key should be defined in the Environment as PAYSTACK_SK or assigned to paystacklib.secret_key
>>> import paystacklib
>>> paystacklib.secret_key = 'sk_your_paystack_secret_key'
>>> transaction = paystacklib.Transaction.initialize(500000, 'customer@customer.com')
>>> transaction
{'status': True, 'message': 'Authorization URL created',
'data': {'authorization_url': 'https://checkout.paystack.com/6rklpsq157c8bef',
'access_code': '6rklpsq157c8bef', 'reference': 'i1wdh5b2r3'}}
>>> transaction.status
True
>>> transaction.message
'Authorization URL created'
>>> transaction.data.authorization_url
'https://checkout.paystack.com/6rklpsq157c8bef'
>>> transaction.data.access_code
'6rklpsq157c8bef'
>>> transaction.data.reference
'i1wdh5b2r3'
>>> transaction['status'] #you can also access values this way
True
>>> transaction.whatever #accessing non-existent element will return a 'False' value
{}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
paystacklib-0.1.0.tar.gz
(7.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paystacklib-0.1.0.tar.gz.
File metadata
- Download URL: paystacklib-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36ea6f6006ef814309ca4638899274ea77b3bc6469dbbbd5a57f53c7295903f4
|
|
| MD5 |
e3e2c64b6e414181a551e130a0d4ccd6
|
|
| BLAKE2b-256 |
7b7e0635a1936e751a54ab6014b13eff4ef5673feae43a4f9e17a9af9eb8264f
|
File details
Details for the file paystacklib-0.1.0-py3-none-any.whl.
File metadata
- Download URL: paystacklib-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
380fe3ab998849923752d04a9f5aafabfab1b2864c4b8eeb73ad90c00cd5cce3
|
|
| MD5 |
45c1fe89d60d2f788fd9256fa8f9a575
|
|
| BLAKE2b-256 |
ff121ff3fd8e904beaeb447ec43078aad56bf66beddd1d2f1768be9973e923c7
|