django-plans-paypal


Namedjango-plans-paypal JSON
Version 0.7.1 PyPI version JSON
download
home_pagehttps://github.com/PetrDlouhy/django-plans-paypal
SummaryIntegration between django-plans and django-paypal.
upload_time2024-04-23 10:11:03
maintainerNone
docs_urlNone
authorPetr Dlouhý
requires_pythonNone
licenseMIT
keywords django-plans-paypal
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage
            =============================
Django plans paypal
=============================

.. image:: https://badge.fury.io/py/django-plans-paypal.svg
    :target: https://badge.fury.io/py/django-plans-paypal

.. image:: https://github.com/PetrDlouhy/django-plans-paypal/actions/workflows/main.yml/badge.svg
    :target: https://github.com/PetrDlouhy/django-plans-paypal/actions/workflows/main.yml

.. image:: https://codecov.io/gh/PetrDlouhy/django-plans-paypal/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/PetrDlouhy/django-plans-paypal

Almost automatic integration between `django-plans <https://github.com/django-getpaid/django-plans>`_ and `django-paypal <https://github.com/spookylukey/django-paypal>`_.
This will add subscribe buttons to the order page and automatically confirm the `Order` after the payment.

Currently it is in experimetal stage, wher only recurring payments (subscribtions) are supported.


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

The full documentation is at https://django-plans-paypal.readthedocs.io.

Quickstart
----------

Install and configure ``django-plans`` and ``django-paypal`` apps.
Capture mode is not yet supported, so ``PAYMENT_VARINANTS`` with ``'capture': False`` will not get confirmed.

Install Django plans paypal::

    pip install django-plans-paypal

Add it to your ``INSTALLED_APPS``, before the ``plans``:

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'payments',
        'paypal.standard.ipn',
        'plans_paypal',
        ...
    )

Add your bussiness account e-mail address to settings:

.. code-block:: python

   PAYPAL_BUSSINESS_EMAIL = "foo@bar.com"

   # To enable encrypted PayPal form:
   PAYPAL_ENCRYPTED_FORM = True
   PAYPAL_PRIVATE_CERT = os.path.join(BASE_DIR, 'certs/paypal_private.pem')
   PAYPAL_PUBLIC_CERT = os.path.join(BASE_DIR, 'certs/paypal_public.pem')
   PAYPAL_CERT = os.path.join(BASE_DIR, 'certs/paypal_cert.pem')
   PAYPAL_CERT_ID = 'xxxxx'


Add Django ``plans_paypal`` to the URL patterns:

.. code-block:: python

    urlpatterns = [
        ...
        url(r'^plans-paypal', include('plans_paypal.urls')),
        ...
    ]

Override `django-plans` class `CreateOrderView` so that `get_success_url()` returns url of `paypal-payment` view:

.. code-block:: python

    def get_success_url(self):
       return reverse("paypal-payment", kwargs={'order_id': self.object.id})

Sandbox testing
---------------

Set following settings:

.. code-block:: python

   PAYPAL_TEST_BUSSINESS_EMAIL = "foo@bar.com"
   PAYPAL_TEST = True

   # For encrypted PayPal sandbox form:
   PAYPAL_TEST_PRIVATE_CERT = os.path.join(BASE_DIR, 'certs/paypal_private.pem')
   PAYPAL_TEST_PUBLIC_CERT = os.path.join(BASE_DIR, 'certs/paypal_public.pem')
   PAYPAL_TEST_CERT = os.path.join(BASE_DIR, 'certs/paypal_sandbox_cert.pem')
   PAYPAL_TEST_CERT_ID = 'xxxx'


Redirect user to `paypal-payment-sandbox` instead of `paypal-payment` view.

Features
--------

* TODO

Running Tests
-------------

Does the code actually work?

::

    source <YOURVIRTUALENV>/bin/activate
    (myenv) $ pip install tox
    (myenv) $ tox

Credits
-------

Tools used in rendering this package:

*  Cookiecutter_
*  `cookiecutter-djangopackage`_

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage




History
-------

0.7.1 (2024-04-23)
++++++++++++++++++
* fail if PaymentFailureView is requested on completed orders

0.7.0 (2024-04-12)
++++++++++++++++++
* migrate code to RecurringUserPlan.renewal_triggered_by
* migrate data of RecurringUserPlans with payment_provider="paypal-recurring" and renewal_triggered_by=TASK to renewal_triggered_by=OTHER

0.6.0 (2023-03-22)
+++++++++++++++++++
* Fix amount received on recurring payments, add tests

0.5.1 (2023-02-11)
+++++++++++++++++++
* allow only logged users to access the failure view

0.5.0 (2022-12-14)
+++++++++++++++++++

* Fix tax received on recurring payments
* More robust receiving original Order ID (if PayPal fails to handle custom_data)
* update to Django 4.1
* fix completing recurring payments if first order status is returned
* only log error if custom data can't be parsed

0.4.10 (2022-04-29)
+++++++++++++++++++
* fix problem with duplicate payments
* PayPalPaymentAdmin: display connected IPN fields

0.4.9 (2022-03-07)
++++++++++++++++++
* make parsing custom_data more robust

0.4.8 (2022-01-19)
++++++++++++++++++
* fix last release
* add tests and test on all supported Django/Python versions through GitHub actions

0.4.7 (2022-01-13)
++++++++++++++++++
* fix problem if there was ' in custom payment data

0.4.6 (2021-12-02)
++++++++++++++++++
* fix problem with creating bad JSON

0.4.5 (2021-12-01)
++++++++++++++++++
* fix IPN field editing in PayPalPaymentAdmin
* store also user e-mail in custom to enable search in IPN admin

0.4.4 (2021-12-01)
++++++++++++++++++
* create PayPalPayment before completing the order

0.4.3 (2021-11-30)
++++++++++++++++++
* fix problem with recurring payments
* add created/modified/author auto fields

0.4.2 (2021-11-08)
++++++++++++++++++
* fix problem with other IPN types

0.4.1 (2021-10-18)
++++++++++++++++++
* cancel order after returning to failure URL

0.4.0 (2021-10-18)
++++++++++++++++++
* allow to set up encrypted PayPal form

0.3.0 (2021-10-15)
++++++++++++++++++
* fixes and improvements to the sandbox/production functionality
* reverse sandbox logic - if no `PAYPAL_TEST`, the sandbox view would return production so nobody can pay through sandbox on production server

0.2.2 (2021-10-12)
++++++++++++++++++
* fix foregotten pudb

0.2.1 (2021-10-12)
++++++++++++++++++
* add sandbox view, so both production and sandbox can be used on one server

0.2.0 (2021-10-11)
++++++++++++++++++
* fix periods to complain with PayPal maximal durations

0.1.0 (2021-10-08)
++++++++++++++++++
* hook ipn.PayPalIpn object with plans.Order (for later usage e.g. determining PayPal fee)
* set plan renewal for django-plans

0.0.2 (2018-08-05)
++++++++++++++++++

* Payment process without capturing should work
* Automatic buttons generation

0.0.1 (2018-07-23)
++++++++++++++++++

* First release on PyPI.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/PetrDlouhy/django-plans-paypal",
    "name": "django-plans-paypal",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "django-plans-paypal",
    "author": "Petr Dlouh\u00fd",
    "author_email": "petr.dlouhy@email.cz",
    "download_url": "https://files.pythonhosted.org/packages/73/4b/77827e179f7a71d4a968f5f051d663c0a2306e59bd3421379fc41916b539/django-plans-paypal-0.7.1.tar.gz",
    "platform": null,
    "description": "=============================\nDjango plans paypal\n=============================\n\n.. image:: https://badge.fury.io/py/django-plans-paypal.svg\n    :target: https://badge.fury.io/py/django-plans-paypal\n\n.. image:: https://github.com/PetrDlouhy/django-plans-paypal/actions/workflows/main.yml/badge.svg\n    :target: https://github.com/PetrDlouhy/django-plans-paypal/actions/workflows/main.yml\n\n.. image:: https://codecov.io/gh/PetrDlouhy/django-plans-paypal/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/PetrDlouhy/django-plans-paypal\n\nAlmost automatic integration between `django-plans <https://github.com/django-getpaid/django-plans>`_ and `django-paypal <https://github.com/spookylukey/django-paypal>`_.\nThis will add subscribe buttons to the order page and automatically confirm the `Order` after the payment.\n\nCurrently it is in experimetal stage, wher only recurring payments (subscribtions) are supported.\n\n\nDocumentation\n-------------\n\nThe full documentation is at https://django-plans-paypal.readthedocs.io.\n\nQuickstart\n----------\n\nInstall and configure ``django-plans`` and ``django-paypal`` apps.\nCapture mode is not yet supported, so ``PAYMENT_VARINANTS`` with ``'capture': False`` will not get confirmed.\n\nInstall Django plans paypal::\n\n    pip install django-plans-paypal\n\nAdd it to your ``INSTALLED_APPS``, before the ``plans``:\n\n.. code-block:: python\n\n    INSTALLED_APPS = (\n        ...\n        'payments',\n        'paypal.standard.ipn',\n        'plans_paypal',\n        ...\n    )\n\nAdd your bussiness account e-mail address to settings:\n\n.. code-block:: python\n\n   PAYPAL_BUSSINESS_EMAIL = \"foo@bar.com\"\n\n   # To enable encrypted PayPal form:\n   PAYPAL_ENCRYPTED_FORM = True\n   PAYPAL_PRIVATE_CERT = os.path.join(BASE_DIR, 'certs/paypal_private.pem')\n   PAYPAL_PUBLIC_CERT = os.path.join(BASE_DIR, 'certs/paypal_public.pem')\n   PAYPAL_CERT = os.path.join(BASE_DIR, 'certs/paypal_cert.pem')\n   PAYPAL_CERT_ID = 'xxxxx'\n\n\nAdd Django ``plans_paypal`` to the URL patterns:\n\n.. code-block:: python\n\n    urlpatterns = [\n        ...\n        url(r'^plans-paypal', include('plans_paypal.urls')),\n        ...\n    ]\n\nOverride `django-plans` class `CreateOrderView` so that `get_success_url()` returns url of `paypal-payment` view:\n\n.. code-block:: python\n\n    def get_success_url(self):\n       return reverse(\"paypal-payment\", kwargs={'order_id': self.object.id})\n\nSandbox testing\n---------------\n\nSet following settings:\n\n.. code-block:: python\n\n   PAYPAL_TEST_BUSSINESS_EMAIL = \"foo@bar.com\"\n   PAYPAL_TEST = True\n\n   # For encrypted PayPal sandbox form:\n   PAYPAL_TEST_PRIVATE_CERT = os.path.join(BASE_DIR, 'certs/paypal_private.pem')\n   PAYPAL_TEST_PUBLIC_CERT = os.path.join(BASE_DIR, 'certs/paypal_public.pem')\n   PAYPAL_TEST_CERT = os.path.join(BASE_DIR, 'certs/paypal_sandbox_cert.pem')\n   PAYPAL_TEST_CERT_ID = 'xxxx'\n\n\nRedirect user to `paypal-payment-sandbox` instead of `paypal-payment` view.\n\nFeatures\n--------\n\n* TODO\n\nRunning Tests\n-------------\n\nDoes the code actually work?\n\n::\n\n    source <YOURVIRTUALENV>/bin/activate\n    (myenv) $ pip install tox\n    (myenv) $ tox\n\nCredits\n-------\n\nTools used in rendering this package:\n\n*  Cookiecutter_\n*  `cookiecutter-djangopackage`_\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage\n\n\n\n\nHistory\n-------\n\n0.7.1 (2024-04-23)\n++++++++++++++++++\n* fail if PaymentFailureView is requested on completed orders\n\n0.7.0 (2024-04-12)\n++++++++++++++++++\n* migrate code to RecurringUserPlan.renewal_triggered_by\n* migrate data of RecurringUserPlans with payment_provider=\"paypal-recurring\" and renewal_triggered_by=TASK to renewal_triggered_by=OTHER\n\n0.6.0 (2023-03-22)\n+++++++++++++++++++\n* Fix amount received on recurring payments, add tests\n\n0.5.1 (2023-02-11)\n+++++++++++++++++++\n* allow only logged users to access the failure view\n\n0.5.0 (2022-12-14)\n+++++++++++++++++++\n\n* Fix tax received on recurring payments\n* More robust receiving original Order ID (if PayPal fails to handle custom_data)\n* update to Django 4.1\n* fix completing recurring payments if first order status is returned\n* only log error if custom data can't be parsed\n\n0.4.10 (2022-04-29)\n+++++++++++++++++++\n* fix problem with duplicate payments\n* PayPalPaymentAdmin: display connected IPN fields\n\n0.4.9 (2022-03-07)\n++++++++++++++++++\n* make parsing custom_data more robust\n\n0.4.8 (2022-01-19)\n++++++++++++++++++\n* fix last release\n* add tests and test on all supported Django/Python versions through GitHub actions\n\n0.4.7 (2022-01-13)\n++++++++++++++++++\n* fix problem if there was ' in custom payment data\n\n0.4.6 (2021-12-02)\n++++++++++++++++++\n* fix problem with creating bad JSON\n\n0.4.5 (2021-12-01)\n++++++++++++++++++\n* fix IPN field editing in PayPalPaymentAdmin\n* store also user e-mail in custom to enable search in IPN admin\n\n0.4.4 (2021-12-01)\n++++++++++++++++++\n* create PayPalPayment before completing the order\n\n0.4.3 (2021-11-30)\n++++++++++++++++++\n* fix problem with recurring payments\n* add created/modified/author auto fields\n\n0.4.2 (2021-11-08)\n++++++++++++++++++\n* fix problem with other IPN types\n\n0.4.1 (2021-10-18)\n++++++++++++++++++\n* cancel order after returning to failure URL\n\n0.4.0 (2021-10-18)\n++++++++++++++++++\n* allow to set up encrypted PayPal form\n\n0.3.0 (2021-10-15)\n++++++++++++++++++\n* fixes and improvements to the sandbox/production functionality\n* reverse sandbox logic - if no `PAYPAL_TEST`, the sandbox view would return production so nobody can pay through sandbox on production server\n\n0.2.2 (2021-10-12)\n++++++++++++++++++\n* fix foregotten pudb\n\n0.2.1 (2021-10-12)\n++++++++++++++++++\n* add sandbox view, so both production and sandbox can be used on one server\n\n0.2.0 (2021-10-11)\n++++++++++++++++++\n* fix periods to complain with PayPal maximal durations\n\n0.1.0 (2021-10-08)\n++++++++++++++++++\n* hook ipn.PayPalIpn object with plans.Order (for later usage e.g. determining PayPal fee)\n* set plan renewal for django-plans\n\n0.0.2 (2018-08-05)\n++++++++++++++++++\n\n* Payment process without capturing should work\n* Automatic buttons generation\n\n0.0.1 (2018-07-23)\n++++++++++++++++++\n\n* First release on PyPI.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Integration between django-plans and django-paypal.",
    "version": "0.7.1",
    "project_urls": {
        "Homepage": "https://github.com/PetrDlouhy/django-plans-paypal"
    },
    "split_keywords": [
        "django-plans-paypal"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "226c1711d5965884145fc76095919465c1dec712ba909e5a1083fb59da797019",
                "md5": "7ccdd7a5e8407826a0a2f012532dc9f4",
                "sha256": "4fe073b2710e916e0fa66ffd9fa83c45e78c791859248b711d0583368b689fae"
            },
            "downloads": -1,
            "filename": "django_plans_paypal-0.7.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7ccdd7a5e8407826a0a2f012532dc9f4",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 17129,
            "upload_time": "2024-04-23T10:11:00",
            "upload_time_iso_8601": "2024-04-23T10:11:00.103469Z",
            "url": "https://files.pythonhosted.org/packages/22/6c/1711d5965884145fc76095919465c1dec712ba909e5a1083fb59da797019/django_plans_paypal-0.7.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "734b77827e179f7a71d4a968f5f051d663c0a2306e59bd3421379fc41916b539",
                "md5": "8be4f37aece1fcf2ec79a94b2b0f1d44",
                "sha256": "52f4b48f974579aa465307074e842d28d79dee9820b546a42d47ce394ec71210"
            },
            "downloads": -1,
            "filename": "django-plans-paypal-0.7.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8be4f37aece1fcf2ec79a94b2b0f1d44",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25662,
            "upload_time": "2024-04-23T10:11:03",
            "upload_time_iso_8601": "2024-04-23T10:11:03.616576Z",
            "url": "https://files.pythonhosted.org/packages/73/4b/77827e179f7a71d4a968f5f051d663c0a2306e59bd3421379fc41916b539/django-plans-paypal-0.7.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-23 10:11:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PetrDlouhy",
    "github_project": "django-plans-paypal",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "django-plans-paypal"
}
        
Elapsed time: 0.21610s