Skip to main content

Integration between django-plans and django-payments.

Project description

https://badge.fury.io/py/django-plans-payments.svg https://github.com/PetrDlouhy/django-plans-payments/actions/workflows/main.yml/badge.svg https://codecov.io/gh/PetrDlouhy/django-plans-payments/branch/master/graph/badge.svg

Almost automatic integration between django-plans and django-payments. This will add payment buttons to the order page and automatically confirm the Order after the payment. Optionally, it can return the corresponding order when a payment is refunded.

Documentation

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

Quickstart

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

Install Django plans payments:

pip install django-plans-payments

Add it to your INSTALLED_APPS, before the plans:

INSTALLED_APPS = (
    ...
    'related_admin',
    'plans_payments',
    'plans',
    ...
)

Add Django plans_payments to the URL patterns:

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

Set django-plans settings and set model to:

PAYMENT_MODEL = 'plans_payments.Payment'

Customer IP address

Customer IP address is stored in Payment model and used for some payment providers (i.e. PayU). For security reasons django-plans-payments does acquire the IP only from request REMOTE_ADDR parameter. If you are behind proxy, you will need to setup some mechanism to populate this variable from HTTP_X_FORWARDED_FOR parameter. The suggested solution is to use django-httpforwardedfor or django-xff application for that.

Running Tests

Does the code actually work?

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

Credits

Tools used in rendering this package:

History

2.0.2 (2025-05-29)

  • fix the release

2.0.1 (2025-05-29)

  • fix the release

2.0.0 (2025-05-29)

  • Implement the wallet logic

  • Drop support for Python 3.8, Django 4.1

  • Add support for Django 5.2

  • don’t obscure Exceptions by catching them

1.5.0 (2025-02-28)

  • Drop support for Python 3.7

  • Add support for Python 3.13, Django 5.1

  • fix the wrong assumption that Payment.extra_data["response"] contains a "transactions" key

1.4.1 (2024-04-24)

  • do not check whether a confirmed payment of a completed order is left anymore

1.4.0 (2024-04-15)

  • migrate to RecurringUserPlan.renewal_triggered_by

  • add renewal_triggered_by parameter to Payment.set_renew_token

  • deprecate automatic_renewal parameter of Payment.set_renew_token; use renewal_triggered_by parameter instead

  • deprecate None value of renewal_triggered_by parameter of Payment.set_renew_token; set an AbstractRecurringUserPlan.RENEWAL_TRIGGERED_BY instead

1.3.1 (2024-04-15)

  • fix typo in payment description

1.3.0 (2024-04-12)

  • add optional returning orders when payments are refunded

1.2.2 (2023-12-20)

  • add change_reason for django-simple-history

1.2.1 (2023-12-19)

  • specify sender=Payment for change_payment_status receiver

1.2.0 (2023-10-16)

  • bugfix release (fix prevoius bad release)

1.1.3 (2023-10-15)

  • add some indexes to Payment model

1.1.2 (2023-03-29)

  • reword Payment description to ommit word “Subscribtion” which might raise warnings for banks/card providers

1.1.1 (2023-01-27)

  • correction release, include wheel update, correctly rebase to master

1.1.0 (2023-01-27)

  • Fix transaction fee double counting

1.0.1 (2022-12-09)

  • Fix migrations

1.0.0 (2022-12-08)

  • Recurring payments functionality

0.2.0 (2018-08-05)

  • Payment process without capturing should work

  • Automatic buttons generation

0.1.0 (2018-07-23)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_plans_payments-2.0.2.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_plans_payments-2.0.2-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file django_plans_payments-2.0.2.tar.gz.

File metadata

  • Download URL: django_plans_payments-2.0.2.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for django_plans_payments-2.0.2.tar.gz
Algorithm Hash digest
SHA256 6bd25c6e6e8ea55f85be120ea4a6258094a8c3d57c3dcff8b1f29e4fcc8f15aa
MD5 b24040b28b0ba0132e18784546c7f87f
BLAKE2b-256 b63087394b3072e91e09505d4ec49a446c17b0abbc65b929270ddb87264d027b

See more details on using hashes here.

File details

Details for the file django_plans_payments-2.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_plans_payments-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5b4335ec37299a55f7fe0dae7aaba3105149b22798bed02cb8a4c8acb1b3fab6
MD5 c9014257ef85bad48bb86e79da9b7ca2
BLAKE2b-256 2160a2eb06a1aa33ef2c524a7f6fad05a62b6a8797edaf6a3cd3b4555a97daec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page