Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

A Paystack API wrapper in Python

Project description

Installation / Usage

To install use pip:

$ pip install --upgrade paystack


$ easy_install --upgrade paystack


on installing pip. If you are on a system with easy_install but not
pip, you can use easy_install instead. If you’re not using virtualenv,
you may have to prefix those commands with sudo. You can learn more
about virtualenv at

To install from source, clone this repo and run:

$ git clone

$ python install


Please see for the most up-to-date documentation for the Paystack API.

API Anatomy

Please see for the most up-to-date documentation of the API Anatomy.


The package is compatible with Python 2.6+, Python 3.1+ and PyPy. We need to test against all of these environments to ensure compatibility. Travis CI will automatically run our tests on push. For local testing, we use nose to handle testing across environments.

To run the included test:

  1. Clone the repo:
$ git clone
  1. Enter project directory:
$ cd paystack
  1. Install dependencies using fabric:
$ fab install
  1. Run the includded test using fabric:
$ fab test


  1. Add Event hooks
  2. Create Consumer Resource
  3. Create Plan Resource


from paystack.resource import TransactionResource

import random
import string

def main():
    rand = ''.join(
            string.ascii_letters + string.digits) for n in range(16)])
    secret_key = 'YOUR_SECRET_KEY'
    random_ref = rand
    test_email = 'TEST_EMAIL'
    test_amount = 'TEST_AMOUNT'
    plan = 'Basic'
    client = TransactionResource(secret_key, random_ref)
    response = client.initialize(test_amount,
    client.authorize() # Will open a browser window for client to enter card details
    verify = client.verify() # Verify client credentials
    print(client.charge()) # Charge an already exsiting client

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
paystack-1.5.0-py2.7.egg (26.1 kB) Copy SHA256 hash SHA256 Egg 2.7
paystack-1.5.0.tar.gz (10.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page