Skip to main content

A django port of pesapal payment gateway

Project description

=============================
django-pesapal
=============================

.. image:: https://badge.fury.io/py/django-pesapal.png
:target: https://badge.fury.io/py/django-pesapal

.. image:: https://travis-ci.org/odero/django-pesapal.png?branch=master
:target: https://travis-ci.org/odero/django-pesapal

.. image:: https://coveralls.io/repos/odero/django-pesapal/badge.png?branch=master
:target: https://coveralls.io/r/odero/django-pesapal?branch=master

A django port of pesapal payment gateway

Documentation
-------------

The full documentation is at https://django-pesapal.readthedocs.org.

Quickstart
----------

Install django-pesapal::

pip install django-pesapal

Then use it in a project::

import django_pesapal


Note: You'll need to install this fork of `django-uuidfield` first::

pip install git+git://github.com/odero/django-uuidfield.git#egg=django-uuidfield

For some reason, adding dependncy_links in `setup.py` just isn't working out for me.
If you can get that working send me a pull request.

#. Add `django_pesapal` to your `INSTALLED_APPS` setting like this::

INSTALLED_APPS = (
...
'django_pesapal',
)

#. Include the `django_pesapal` URLconf in your project urls.py like this::

url(r'^payments/', include('django_pesapal.urls')),

This is optional. You can set your own return url by adding this to `settings.py`::

PESAPAL_OAUTH_CALLBACK_URL = 'app_name:url_name' # this needs to be a reversible

#. Run `python manage.py syncdb` to create the polls models.

#. Create a method that receives payment details and returns the pesapal iframe url::

from django_pesapal import get_payment_url

def get_pesapal_payment_iframe():
'''
Authenticates with pesapal to get the payment iframe src
'''

order_info = {
'amount': 100,
'description': 'Payment for X',
'reference': 2, # some object id
'email': 'user@example.com'
}

iframe_src_url = get_payment_url(**order_info)
return iframe_src_url


**NB:** `get_payment_url` is defined as::

def get_payment_url(**kwargs):
'''
Use the computed order information to generate a url for the Pesapal iframe.

Params should include the following keys:
Required params: `amount`, `description`, `reference`, `email`
Optional params: `first_name`, `last_name`
'''




History
-------
0.1.3 (2014-07-18)
++++++++++++++++++
- Packaging for PyPi

0.1.2 (2014-06-30)
++++++++++++++++++
- Fix import bug in urls.py
- Fix how callback url is constructed
- Fix: Live URL uses https

0.1.1 (2014-06-30)
++++++++++++++++++
- Refactor handling of redirect urls. Model validation of transaction and merchant reference
- Rename settings to conf. Set default oauth redirect url
- Add django-uuidfield to dependencies

0.1.0 (2014-06-30)
++++++++++++++++++

* First release on PyPI.

Project details


Release history Release notifications

History Node

1.2.0

History Node

1.1.0

History Node

1.0.1

History Node

1.0.0

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3

History Node

0.2.1

History Node

0.2

History Node

0.1.5

History Node

0.1.4

This version
History Node

0.1.3

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
django-pesapal-0.1.3.tar.gz (8.0 kB) Copy SHA256 hash SHA256 Source None Aug 19, 2014

Supported by

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