Skip to main content

A Paystack API wrapper in Python

Project description

author: Bernard Ojengwa

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.

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)
    verify = client.verify()
    print(verify)
    print(client.charge())

Project details


Download files

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

Source Distribution

paystack-1.2.3.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paystack-1.2.3-py2.7.egg (23.4 kB view details)

Uploaded Egg

File details

Details for the file paystack-1.2.3.tar.gz.

File metadata

  • Download URL: paystack-1.2.3.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for paystack-1.2.3.tar.gz
Algorithm Hash digest
SHA256 1bba8d625e5aa83c7d0b1169b3c1e02136e4ed7c0b8049a4b5346c994d2c8d35
MD5 2d7d641d53d3fa2cad5ff8dd395b0df6
BLAKE2b-256 8d7170350541afb7f5865febb8fd527fbf27c041ba1501b43123305024ecd026

See more details on using hashes here.

File details

Details for the file paystack-1.2.3-py2.7.egg.

File metadata

  • Download URL: paystack-1.2.3-py2.7.egg
  • Upload date:
  • Size: 23.4 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for paystack-1.2.3-py2.7.egg
Algorithm Hash digest
SHA256 c1d48977518085d0c7fa0fb41a4d490d79e9e6dabfb4aa0e0814ee87f2a8883e
MD5 1bda75b02477937d1c9390c19a3f7d21
BLAKE2b-256 b024b888a01e15a015417bfaadd104310a2a4225bb618eb83a90262255b61a93

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page