This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

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
  1. Add django_pesapal to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = (
        ...
        'django_pesapal',
    )
    
  2. Include the django_pesapal URLconf in your project urls.py like this:

    url(r'^payments/', include('django_pesapal.urls')),
    
  3. You can set your own return url by adding this to settings.py:

    PESAPAL_TRANSACTION_DEFAULT_REDIRECT_URL = 'app_name:url_name'  # this needs to be a reversible
    
  4. Run python manage.py migrate to create the models.

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

    from django_pesapal.views import PaymentRequestMixin
    
    class PaymentView(PaymentRequestMixin):
    
        def get_pesapal_payment_iframe(self):
    
            '''
            Authenticates with pesapal to get the payment iframe src
            '''
            order_info = {
                'first_name': 'Some',
                'last_name': 'User',
                'amount': 100,
                'description': 'Payment for X',
                'reference': 2,  # some object id
                'email': 'user@example.com',
            }
    
            iframe_src_url = self.get_payment_url(**order_info)
            return iframe_src_url
    
  6. Once payment has been processed, you will be redirected to an intermediate screen where the user can finish ordering. Clicking the “Finish Ordering” button will check the payment status to ensure that the payment was successful and then redirects the user to PESAPAL_TRANSACTION_DEFAULT_REDIRECT_URL.

Configuration

Setting Default Value
PESAPAL_DEMO True
PESAPAL_CONSUMER_KEY
PESAPAL_CONSUMER_SECRET
PESAPAL_IFRAME_LINK (if PESAPAL_DEMO=True) http://demo.pesapal.com/api/PostPesapalDirectOrderV4
PESAPAL_IFRAME_LINK (if PESAPAL_DEMO=False) https://www.pesapal.com/api/PostPesapalDirectOrderV4
PESAPAL_QUERY_STATUS_LINK (Demo Mode=True) http://demo.pesapal.com/API/QueryPaymentDetails
PESAPAL_QUERY_STATUS_LINK (Demo Mode=False) https://www.pesapal.com/API/QueryPaymentDetails
PESAPAL_OAUTH_CALLBACK_URL ‘transaction_completed’
PESAPAL_OAUTH_SIGNATURE_METHOD ‘SignatureMethod_HMAC_SHA1’
PESAPAL_TRANSACTION_DEFAULT_REDIRECT_URL ‘/’
PESAPAL_TRANSACTION_FAILED_REDIRECT_URL
PESAPAL_REDIRECT_WITH_REFERENCE True
PESAPAL_TRANSACTION_MODEL ‘django_pesapal.Transaction’

History

1.1.0 (2016-05-03)

  • Support Django 1.9
  • Update payment_method field length from 16 to 24
  • Remove support for Py33. Support Py35

1.0.1 (2015-11-21)

  • Fix querydict bug

1.0.0 (2015-11-11)

  • Support Django 1.8
  • Support Py33 and Py34
  • Return proper IPN response

0.3.4 (2015-08-12)

  • Restructure flow to better support IPN processing

0.3.3 (2015-06-29)

  • Setup build had not packaged the templates

0.3.2 (2015-06-13)

  • Fix documentation formatting issues

0.3.1 (2015-06-13)

  • Allow specifying own transaction model
  • Pass all transaction info when redirecting
  • Update intermediate template

0.3 (2015-06-12)

  • Introduce intermediate payment processing screen
  • Update Django version to 1.7+
  • Add support to receive and process IPN
  • Save all details about the transaction and status

0.2.1 (2015-04-03)

  • Added test sandbox
  • Updated Django version
  • Updated django-uuidfield

0.2 (2015-03-17)

  • Support anonymous checkouts
  • Add support for getting payment status
  • Major structural refactoring. Use mixins
  • Use Mixins and XML Builder

0.1.5 (2014-09-25)

  • Pin dependencies to specific versions
  • Update how imports should be done
  • Remove imports from __init__.py

0.1.4 (2014-09-23)

  • Fix import bug. Tests for projects using this fail in Shippable
  • Set max Django version to 1.7

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.
Release History

Release History

1.1.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-pesapal-1.1.0.tar.gz (12.0 kB) Copy SHA256 Checksum SHA256 Source May 3, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting