skip to navigation
skip to content

paystack 1.5.0

A Paystack API wrapper in Python

Package Documentation

Installation / Usage

To install use pip:

$ pip install --upgrade paystack

or

$ easy_install --upgrade paystack

Info

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 http://www.virtualenv.org/

To install from source, clone this repo and run:

$ git clone https://github.com/ojengwa/paystack.git

$ python setup.py install

Documentation

Please see https://developers.paystack.co/docs for the most up-to-date documentation for the Paystack API.

API Anatomy

Please see https://ojengwa.github.io/paystack/ for the most up-to-date documentation of the API Anatomy.

Testing

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 https://github.com/ojengwa/paystack.git
  1. Enter project directory:
$ cd paystack
  1. Install dependencies using fabric:
$ fab install
  1. Run the includded test using fabric:
$ fab test

TODO

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

Example

from paystack.resource import TransactionResource

import random
import string

def main():
    rand = ''.join(
        [random.choice(
            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,
                                 test_email,
                                 plan)
    print(response)
    client.authorize() # Will open a browser window for client to enter card details
    verify = client.verify() # Verify client credentials
    print(verify)
    print(client.charge()) # Charge an already exsiting client
 
File Type Py Version Uploaded on Size
paystack-1.5.0-py2.7.egg (md5) Python Egg 2.7 2016-02-25 25KB
paystack-1.5.0.tar.gz (md5) Source 2016-02-25 10KB