Payabbhi Python Library
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Payabbhi Python library

Make sure you have signed up for your Payabbhi Account and downloaded the API keys from the Portal.


Python 2.6 and later.


The library can be installed via pip. Run the following command:

$ pip install payabbhi

Manual Installation

Download the library and install as below:

python install


The library requires the following extensions:

If installed via, the dependencies are handled automatically. In case of manual installation, make sure that the dependencies are resolved.


Please refer to:

Getting Started


import payabbhi
# Set your credentials
client = payabbhi.Client(access_id='<access_id>', secret_key='<secret_key>')

# Optionally set your app info.
# app_version and app_url are optional


# Create order
created_order = client.order.create(data={'amount':100,
                                  'merchant_order_id': '<merchant_order_id>',

# Retrieve a particular order object
order = client.order.retrieve('<order_id>')

# Retrieve a set of order objects based on given filter params
list_of_orders = client.order.all(data={'count': 5})

# Retrieve a set of payments for a given order
payments = retrieved_order.payments()


# Retrieve all payments
payments = client.payment.all(data={'count': 10})

# Retrieve a particular payment object
payment = client.payment.retrieve('<payment_id>')

# Capture a payment
payment = payment.capture()

# Refund a payment
refund = payment.refund(data={'amount':100,

# Retrieve a set of refund objects for a given payment with optional filter params
refunds = client.payment.refunds('<payment_id>', data={'count': 2})


# Create a refund
refund = client.refund.create('<payment_id>')

# Create a partial refund
refund = client.refund.create('<payment_id>', data={'amount':100})

# Retrieve a set of refunds with the given filter params
refunds = client.refund.all(data={'count': 2})

# Retrieve a particular refund object
refund = client.refund.retrieve('<refund_id>')

Verify a payment signature

        'order_id': '<order_id>',
        'payment_id': '<payment_id>',
        'payment_signature': '<payment_signature>'

Verify webhook signature

# replay_interval is optional. (default value is 300 seconds)


Install dependencies to run unittests

$ pip install unittest2 responses

or using easy_install

$ easy_install unittest2 responses

N.B: make sure version of six must be atleast 1.10.0

Now run the entire test suite using

$ python -m unittest2 discover

Or to run an individual test file:

$ python -m unittest2 discover -p

Testing for different versions of Python

Payabbhi Python Library is compatible with Python 2.6+, Python 3.3+ . We should run these tests for all the supported versions . For local testing, we use tox to handle testing against different Python versions.

Setting up tox

Install tox using pip install tox and then simply run tox from the project root. But to make tox work you will need an interpreter installed for each of the versions of python we test (see the envlist in tox.ini). You can find these releases on Python downloads page.

You may choose not to install interpreters for every Python version we support. In that case, test at least any one of Python 2.x versions and any one of Python 3.x versions.

You can test with a specific interpreter e.g. Python 2.7 using tox -e py27.