Skip to main content

Multi-broker payment processor for Django

Project description

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.

Quickstart

Install django-getpaid and a payment backend:

pip install django-getpaid
pip install django-getpaid-dotpay

Add them to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'getpaid',
    'getpaid_dotpay',
    ...
]

Add django-getpaid’s URL patterns:

urlpatterns = [
    ...
    url(r'^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):
    # fields
    def get_absolute_url(self):
        return reverse('order-detail', kwargs=dict(pk=self.pk))

    def get_total_amount(self):
        return self.amount

    def get_user_info(self):
        return dict(email=self.buyer.email)

    def get_description(self):
        return self.description

Select your Order model in settings.py and provide settings for payment backends:

GETPAID_ORDER_MODEL = 'yourapp.MyCustomOrder'

GETPAID_BACKEND_SETTINGS = {
    'getpaid_dotpay': {   # dotted import path of the plugin
        # refer to backend docs for its real settings
        'merchant_id': 123456789,
        'key2': abcdef123456789,
    },
}

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 using multiple currencies (but one per payment)

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

Running Tests

Does the code actually work?

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

Disclaimer

This project has nothing in common with getpaid plone project.

Credits

Proudly sponsored by SUNSCRAPERS

Tools used in rendering this package:

History

Version 2.0.0 (2019-08-26)

  • BREAKING: Complete redesign of internal API.

  • Payment becomes swappable model - like Django’s User model

  • Payment acts as customizable interface to PaymentProcessor

  • see documentation for full list

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-getpaid-2.0.0rc1.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distribution

django_getpaid-2.0.0rc1-py2.py3-none-any.whl (19.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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