paystackpy
===============================
Overview
A Paystack ( https://paystack.com/ ) API wrapper with python
Documentation
Please see https://paystack.com/docs/api/ for the most up-to-date documentation for the Paystack API.
Installation
pip install paystackpy
Example
from paystackpy import Transaction, Customer, Plan, Transfer, Verification
""" All Response objects are formatted as dictionary containing status_code, status, message and data """
#Instantiate the transaction object to handle transactions. #Pass in your authorization key - if not set as environment variable PAYSTACK_AUTHORIZATION_KEY
transaction = Transaction(authorization_key="sk_mypaystackauthorizationkey")
response = transaction.charge("customer@domain.com", "CustomerAUTHcode", 10000) #Charge a customer in Kobo.
response = transaction.verify("refcode") #Verify a transaction given a reference code "refcode".
#Instantiate the customer class to manage customers
customer = Customer(authorization_key="sk_mypaystackauthorizationkey")
response = customer.create("customer2@gmail.com", "John", "Doe", phone="080*********") #Add new customer
response = customer.getone(1234) #Get customer with id of 1234
response = customer.getall() #Get all customers
#Instantiate the plan class to manage plans
plan = Plan(authorization_key="sk_mypaystackauthorizationkey")
response = plan.create("Test Plan", 150000, 'Weekly') #Add new plan
response = plan.getone(240) #Get plan with id of 240
response = plan.getall() #Get all plans
#Instantiate the transaction class for transfer
transfer = Transfer(authorization_key="sk_mypaystackauthorizationkey")
response = transfer.create_transfer_recipient(receipt_type="nuban", name="Customer", metadata={}, account_number="092********", bank_code="058", currency="NGN", description="SOME TEXT", authorization_code="code")
#Verify BVN match
verify = Verification(authorization_key="sk_mypaystackauthorizationkey")
response = verify.verify_bvn_match("bvn", "account_number", "bank_code", "first_name", "last_name")
#Resolve BVN standard
verify = Verification(authorization_key="sk_mypaystackauthorizationkey")
response = verify.resolve_bvn_standard("bvn")
#Resolve BVN premium
verify = Verification(authorization_key="sk_mypaystackauthorizationkey")
response = verify.resolve_bvn_premium("bvn")
#Resolve Account number
verify = Verification(authorization_key="sk_mypaystackauthorizationkey")
response = verify.resolve_account_number("account_number", "bank_code")
#Resolve Card BIN
verify = Verification(authorization_key="sk_mypaystackauthorizationkey")
response = verify.resolve_card_bin("bin")
Metadata
Release files for paystackpy 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| paystackpy-0.0.6.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| paystackpy-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.9 kB
Release files / paystackpy-0.0.6.tar.gz
| Download URL | paystackpy-0.0.6.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae53a20e91ed62403fe7e147ae3b1c632d543bf13aeda6732df752d349298f49
|
|
BLAKE2b-256 checksum How to use checksums |
56df4d74be1a9b58473f40447cfcd29844bcd846e7edb200bc462de715f4dc5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.2
|
Release files / paystackpy-0.0.6-py3-none-any.whl
| Download URL | paystackpy-0.0.6-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62869404c7ebe21fa1078564a9edb86d94acffec31cb473d1c891edb6ec2f177
|
|
BLAKE2b-256 checksum How to use checksums |
aa3c887afda9a4e17e33961e77c5b1017ffeb6a1fb50309409f728faa3adf6ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.2
|