Last updated:
0 purchases
paystackapi 0.1.2
Paystack Python library
The Paystack Python library provides integration access to the Paystack Payments.
Dependencies
requests
The Paystack Python SDK is tested against Python version 3.8
The Python core development community has released End-of-Life branches for Python versions 2.7 - 3.4, and are no longer receiving security updates. As a result, Paystack may not supports these versions of Python.
Documentation
Official paystack documentation
Official paystack python documentation
Quick Start Example
import paystack
test_secret_key = "sk_test_<YOUR_SECRET_KEY>"
test_public_key = "pk_test_<YOUR_PUBLIC_KEY>"
gateway = paystack.paystack_gateway.PaystackGateway(
secret_key=test_secret_key,
public_key=test_public_key,
)
charge = gateway.Transaction.initiate({
"email": "[email protected]",
"amount": "200000",
})
# print the response to the terminal
print(charge)
# url to finalize the charge
url = charge.data.authorization_url
# verify a transaction with the response reference_key
gateway.Transaction.verify(charge.data.reference)
# check docs module for more intergration examples
Developing
using Virtualenv
Create a virtualenv called venv:
virtualenv venv
Start the virtualenv:
source venv/bin/activate
Install dependencies:
pip3 install -r dev_requirements.txt
Using pipenv
install pipenv:
pip3 install pipenv
create a folder:
mkdir <folder_name> && cd <folder_name>
activate pipenv environment in new folder:
pipenv -p python 3
activate the virtual environment:
pipenv shell
install dependencies:
pipenv install -r requirements.txt
See the LICENSE file for more info.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.