Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Python library for the PayPlug API

CI Status PyPi

This is the documentation of PayPlug's Python library. It is designed to help developers to use PayPlug as payment solution in a simple, yet robust way.

You can create a PayPlug account at


PayPlug's library relies on python-requests>=1.0.1 to perform HTTP requests and requires OpenSSL to secure transactions. You also need either a Python 2.6+ or a Python 3.3+. The library is known to work with these versions, pypy and pypy3. It may work on older versions or other Python implementations without warranty. If you use an implementation that is not listed above, do not hesitate to let us known if it worked for you or not, so that we can update this prerequisites. To ensure Python 2 and Python 3 compatibility, this library also depends on six>=1.4.0.


Please see for latest documentation.


Option 1 - Strongly preferred) via PyPI:

$ easy_install pip --upgrade
$ pip install payplug

or simply add payplug as a dependency of your project.

Option 2) download as a tarball:

  • Download the most recent stable tarball from the download page
  • Extract the tarball somewhere outside your project.
  • chdir into the folder you've just extracted.
  • Run the following commands:
$ pip install --upgrade setuptools
$ python install

To get started, add the following piece of code to the header of your Python project:

import payplug

If everything runs without errors, congratulations. You installed PayPlug python library! You're ready to create your first payment.


Here's how simple it is to create a payment request:


customer = {
    'email': '',
    'first_name': 'John',
    'last_name': 'Watson',
    'address1': '221B Baker Street',
    'postcode': 'NW16XE',
    'city': 'London',
    'country': 'GB',

payment_data = {
    'amount': 3300,
    'currency': 'EUR',
    'billing': customer,
    'shipping': customer,
    'hosted_payment': {
        'return_url': '',
        'cancel_url': '',
    'notification_url': '',
    'metadata': {
        'customer_id': 42710,

payment = payplug.Payment.create(**payment_data)

Go further:



To run the tests for your specific configuration, run the following commands:

$ easy_install pip --upgrade
$ pip install --upgrade setuptools pbr
$ python test

To run the tests under different configuration, you can use tox. It's recommended to use pyenv project to install different python versions on the same system.

$ pip install tox
$ tox

You can also use detox to make the process even faster.

$ pip install detox
$ detox