django-pesapal


Namedjango-pesapal JSON
Version 1.3.3 PyPI version JSON
download
home_pagehttps://github.com/odero/django-pesapal
SummaryA django port of pesapal payment gateway
upload_time2023-01-26 14:21:34
maintainerNone
docs_urlNone
authorBilly Odero
requires_pythonNone
licenseBSD
keywords django-pesapal payment pesapal
VCS
bugtrack_url
requirements Django wheel oauth2 requests
Travis-CI
coveralls test coverage No coveralls.
            ==============
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

.. image:: https://img.shields.io/pypi/status/django-pesapal.svg
   :target: https://pypi.python.org/pypi/django-pesapal/
   :alt: Development Status

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

#. 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')),

#. 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

#. Run `python manage.py migrate` to create the models.

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

    from django_pesapal.views import PaymentRequestMixin

    class PaymentView(PaymentRequestMixin, TemplateView):

        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

#. 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.3.3 (2023-01-26)
++++++++++++++++++
- Bug fix: Handling invalid data

1.3.2 (2022-01-21)
++++++++++++++++++
- Support for Django 3.9
- Update dependencies
- Support Py38, Py39
- Remove EOL py27

1.3.1 (2019-07-16)
++++++++++++++++++
- Update dependencies
- Support Py37
- Remove EOL py34

1.3.0 (2018-09-29)
++++++++++++++++++
- Support for Django 2.1
- Support Py36

1.2.0 (2016-12-11)
++++++++++++++++++
- Dropped support for Django 1.7
- Fixes and Upgrades to support Django 1.8 - 1.10
- Use Django's UUIDField

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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/odero/django-pesapal",
    "name": "django-pesapal",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "django-pesapal payment pesapal",
    "author": "Billy Odero",
    "author_email": "odero@xx.com",
    "download_url": "https://files.pythonhosted.org/packages/dc/2d/494cdbe66e333d3144ff5ee4433be840fc63d9eabe720809d5c415188aeb/django-pesapal-1.3.3.tar.gz",
    "platform": null,
    "description": "==============\ndjango-pesapal\n==============\n\n.. image:: https://badge.fury.io/py/django-pesapal.png\n   :target: https://badge.fury.io/py/django-pesapal\n\n.. image:: https://travis-ci.org/odero/django-pesapal.png?branch=master\n   :target: https://travis-ci.org/odero/django-pesapal\n\n.. image:: https://coveralls.io/repos/odero/django-pesapal/badge.png?branch=master\n   :target: https://coveralls.io/r/odero/django-pesapal?branch=master\n\n.. image:: https://img.shields.io/pypi/status/django-pesapal.svg\n   :target: https://pypi.python.org/pypi/django-pesapal/\n   :alt: Development Status\n\nA django port of pesapal payment gateway\n\nDocumentation\n-------------\n\nThe full documentation is at https://django-pesapal.readthedocs.org.\n\nQuickstart\n----------\n\nInstall django-pesapal::\n\n    pip install django-pesapal\n\nThen use it in a project::\n\n    import django_pesapal\n\n#. Add `django_pesapal` to your `INSTALLED_APPS` setting like this::\n\n    INSTALLED_APPS = (\n        ...\n        'django_pesapal',\n    )\n\n#. Include the `django_pesapal` URLconf in your project urls.py like this::\n\n    url(r'^payments/', include('django_pesapal.urls')),\n\n#. You can set your own return url by adding this to `settings.py`::\n\n    PESAPAL_TRANSACTION_DEFAULT_REDIRECT_URL = 'app_name:url_name'  # this needs to be a reversible\n\n#. Run `python manage.py migrate` to create the models.\n\n#. Create a method that receives payment details and returns the pesapal iframe url::\n\n    from django_pesapal.views import PaymentRequestMixin\n\n    class PaymentView(PaymentRequestMixin, TemplateView):\n\n        def get_pesapal_payment_iframe(self):\n\n            '''\n            Authenticates with pesapal to get the payment iframe src\n            '''\n            order_info = {\n                'first_name': 'Some',\n                'last_name': 'User',\n                'amount': 100,\n                'description': 'Payment for X',\n                'reference': 2,  # some object id\n                'email': 'user@example.com',\n            }\n\n            iframe_src_url = self.get_payment_url(**order_info)\n            return iframe_src_url\n\n#. 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`.\n\n\nConfiguration\n-------------\n\n+---------------------------------------------+--------------------------------------------------------+\n| Setting                                     | Default Value                                          |\n+=============================================+========================================================+\n| PESAPAL_DEMO                                | True                                                   |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_CONSUMER_KEY                        | ''                                                     |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_CONSUMER_SECRET                     | ''                                                     |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_IFRAME_LINK (if PESAPAL_DEMO=True)  | 'http://demo.pesapal.com/api/PostPesapalDirectOrderV4' |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_IFRAME_LINK (if PESAPAL_DEMO=False) | 'https://www.pesapal.com/api/PostPesapalDirectOrderV4' |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_QUERY_STATUS_LINK (Demo Mode=True)  | 'http://demo.pesapal.com/API/QueryPaymentDetails'      |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_QUERY_STATUS_LINK (Demo Mode=False) | 'https://www.pesapal.com/API/QueryPaymentDetails'      |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_OAUTH_CALLBACK_URL                  | 'transaction_completed'                                |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_OAUTH_SIGNATURE_METHOD              | 'SignatureMethod_HMAC_SHA1'                            |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_TRANSACTION_DEFAULT_REDIRECT_URL    | '/'                                                    |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_TRANSACTION_FAILED_REDIRECT_URL     | ''                                                     |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_REDIRECT_WITH_REFERENCE             | True                                                   |\n+---------------------------------------------+--------------------------------------------------------+\n| PESAPAL_TRANSACTION_MODEL                   | 'django_pesapal.Transaction'                           |\n+---------------------------------------------+--------------------------------------------------------+\n\n\n\n\nHistory\n-------\n1.3.3 (2023-01-26)\n++++++++++++++++++\n- Bug fix: Handling invalid data\n\n1.3.2 (2022-01-21)\n++++++++++++++++++\n- Support for Django 3.9\n- Update dependencies\n- Support Py38, Py39\n- Remove EOL py27\n\n1.3.1 (2019-07-16)\n++++++++++++++++++\n- Update dependencies\n- Support Py37\n- Remove EOL py34\n\n1.3.0 (2018-09-29)\n++++++++++++++++++\n- Support for Django 2.1\n- Support Py36\n\n1.2.0 (2016-12-11)\n++++++++++++++++++\n- Dropped support for Django 1.7\n- Fixes and Upgrades to support Django 1.8 - 1.10\n- Use Django's UUIDField\n\n1.1.0 (2016-05-03)\n++++++++++++++++++\n- Support Django 1.9\n- Update payment_method field length from 16 to 24\n- Remove support for Py33. Support Py35\n\n1.0.1 (2015-11-21)\n++++++++++++++++++\n- Fix querydict bug\n\n1.0.0 (2015-11-11)\n++++++++++++++++++\n- Support Django 1.8\n- Support Py33 and Py34\n- Return proper IPN response\n\n0.3.4 (2015-08-12)\n++++++++++++++++++\n- Restructure flow to better support IPN processing\n\n0.3.3 (2015-06-29)\n++++++++++++++++++\n- Setup build had not packaged the templates\n\n0.3.2 (2015-06-13)\n++++++++++++++++++\n- Fix documentation formatting issues\n\n0.3.1 (2015-06-13)\n++++++++++++++++++\n- Allow specifying own transaction model\n- Pass all transaction info when redirecting\n- Update intermediate template\n\n0.3 (2015-06-12)\n++++++++++++++++++\n- Introduce intermediate payment processing screen\n- Update Django version to 1.7+\n- Add support to receive and process IPN\n- Save all details about the transaction and status\n\n0.2.1 (2015-04-03)\n++++++++++++++++++\n- Added test sandbox\n- Updated Django version\n- Updated django-uuidfield\n\n0.2 (2015-03-17)\n++++++++++++++++++\n- Support anonymous checkouts\n- Add support for getting payment status\n- Major structural refactoring. Use mixins\n- Use Mixins and XML Builder\n\n0.1.5 (2014-09-25)\n++++++++++++++++++\n- Pin dependencies to specific versions\n- Update how imports should be done\n- Remove imports from __init__.py\n\n0.1.4 (2014-09-23)\n++++++++++++++++++\n- Fix import bug. Tests for projects using this fail in Shippable\n- Set max Django version to 1.7\n\n0.1.3 (2014-07-18)\n++++++++++++++++++\n- Packaging for PyPi\n\n0.1.2 (2014-06-30)\n++++++++++++++++++\n- Fix import bug in urls.py\n- Fix how callback url is constructed\n- Fix: Live URL uses https\n\n0.1.1 (2014-06-30)\n++++++++++++++++++\n- Refactor handling of redirect urls. Model validation of transaction and merchant reference\n- Rename settings to conf. Set default oauth redirect url\n- Add django-uuidfield to dependencies\n\n0.1.0 (2014-06-30)\n++++++++++++++++++\n\n* First release on PyPI.\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "A django port of pesapal payment gateway",
    "version": "1.3.3",
    "split_keywords": [
        "django-pesapal",
        "payment",
        "pesapal"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dc2d494cdbe66e333d3144ff5ee4433be840fc63d9eabe720809d5c415188aeb",
                "md5": "83e834cf03e83fbc857b9ecc465d9cd0",
                "sha256": "aafdb6e8c5e920d981be0649a5fd9c11d5b8e08371c6bb76984351f0939e56b8"
            },
            "downloads": -1,
            "filename": "django-pesapal-1.3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "83e834cf03e83fbc857b9ecc465d9cd0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14878,
            "upload_time": "2023-01-26T14:21:34",
            "upload_time_iso_8601": "2023-01-26T14:21:34.363462Z",
            "url": "https://files.pythonhosted.org/packages/dc/2d/494cdbe66e333d3144ff5ee4433be840fc63d9eabe720809d5c415188aeb/django-pesapal-1.3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-26 14:21:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "odero",
    "github_project": "django-pesapal",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "Django",
            "specs": [
                [
                    ">=",
                    "2.2"
                ],
                [
                    "<",
                    "4"
                ]
            ]
        },
        {
            "name": "wheel",
            "specs": [
                [
                    ">=",
                    "0.37.1"
                ]
            ]
        },
        {
            "name": "oauth2",
            "specs": [
                [
                    "==",
                    "1.9.0.post1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.20.0"
                ],
                [
                    "<=",
                    "2.27.1"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "django-pesapal"
}
        
Elapsed time: 0.03851s