Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Latest PyPI version https://img.shields.io/travis/sunscrapers/django-getpaid.svg https://img.shields.io/coveralls/github/cypreess/django-getpaid.svg https://img.shields.io/pypi/wheel/django-getpaid.svg https://img.shields.io/pypi/l/django-getpaid.svg

django-getpaid is a multi-broker payment processor for Django

Documentation

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

Features

  • support for multiple payment brokers at the same time

  • clean but flexible architecture

  • support for asynchronous status updates - both push and pull

  • support for modern REST-based broker APIs

  • support for multiple currencies (but one per payment)

  • easy customization with provided base abstract models and swappable mechanic (same as with Django’s User model)

Quickstart

Install django-getpaid and at least one payment backend:

pip install django-getpaid
pip install django-getpaid-paynow

Add them to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'getpaid',
    'getpaid_paynow',  # one of plugins
    ...
]

Add getpaid to URL patterns:

urlpatterns = [
    ...
    path('payments/', include('getpaid.urls')),
    ...
]

Use getpaid.models.AbstractOrder as parent class of your Order model and define minimal set of methods:

from getpaid.models import AbstractOrder

class MyCustomOrder(AbstractOrder):
    amount = models.DecimalField(decimal_places=2, max_digits=8)
    description = models.CharField(max_length=128)
    buyer = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)

    def get_absolute_url(self):
        return reverse('order-detail', kwargs={"pk": self.pk})

    def get_total_amount(self):
        return self.amount

    def get_user_info(self):
        return {"email": self.buyer.email}

    def get_description(self):
        return self.description

Inform getpaid of your Order model in settings.py and provide settings for payment backends:

GETPAID_ORDER_MODEL = 'yourapp.MyCustomOrder'

GETPAID_BACKEND_SETTINGS = {
    'getpaid_paynow': {   # dotted import path of the plugin
        # refer to backend docs for its real settings
        "api_key": "9bcdead5-b194-4eb5-a1d5-c1654572e624",
        "signature_key": "54d22fdb-2a8b-4711-a2e9-0e69a2a91189",
    },
}

And… provide some business logic ;)

Your pre-payment view should use getpaid.forms.PaymentMethodForm bound with payment data. During binding the form will generate a list of plugins (payment methods) supporting your currency and hide rest of the fields. Then this form should be POSTed to {% url 'getpaid:create-payment' %} to create new payment. You should be automatically redirected to paywall. After payment you should by default return to order-detail page but this behavior can be changed by plugin’s config.

Running Tests

Does the code actually work?

poetry install
poetry run tox

Credits

Created by Krzysztof Dorosz. Redesigned and rewritten by Dominik Kozaczko.

Proudly sponsored by SUNSCRAPERS

Tools used in rendering this package:

Disclaimer

This project has nothing in common with getpaid plone project.

Download files

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

Source Distribution

django-getpaid-2.0.0rc6.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

django_getpaid-2.0.0rc6-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file django-getpaid-2.0.0rc6.tar.gz.

File metadata

  • Download URL: django-getpaid-2.0.0rc6.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.6.2-1-MANJARO

File hashes

Hashes for django-getpaid-2.0.0rc6.tar.gz
Algorithm Hash digest
SHA256 3377ed8089bca56f56e28c7c9382c379ace481d04dcc50a6db694c32b2d86896
MD5 a85a9125d835fe8d8ad224f1df0d430c
BLAKE2b-256 5f50bdca32fc18275204d78dc52d5a8b422fb95dda47d7cac9561aee1a38b60e

See more details on using hashes here.

File details

Details for the file django_getpaid-2.0.0rc6-py3-none-any.whl.

File metadata

  • Download URL: django_getpaid-2.0.0rc6-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.6.2-1-MANJARO

File hashes

Hashes for django_getpaid-2.0.0rc6-py3-none-any.whl
Algorithm Hash digest
SHA256 9cc7c74edfc9b0b2f3f4d5a26f7e49115d28e9050286d3dd9aee9425f142ab96
MD5 b44cf63b3603cb0ff84aa5a7a074f335
BLAKE2b-256 091b1ef81a62b8e26f25bb04be6755f8b927d9ec93b102a8a74f921a27ce0363

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