All Projects → django-getpaid → Django Getpaid

django-getpaid / Django Getpaid

Licence: mit
Django payments processor.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Getpaid

Dj Stripe
Django + Stripe Made Easy
Stars: ✭ 1,022 (+175.47%)
Mutual labels:  payments, django
Django Payments
Universal payment handling for Django.
Stars: ✭ 575 (+54.99%)
Mutual labels:  payments, django
Dj Paypal
Paypal integration for Django - Inspired by Dj-Stripe
Stars: ✭ 55 (-85.18%)
Mutual labels:  payments, django
Pinax Stripe
a payments Django app for Stripe
Stars: ✭ 650 (+75.2%)
Mutual labels:  payments, django
Shopping cart
A basic shopping cart for digital products. Made with Django
Stars: ✭ 70 (-81.13%)
Mutual labels:  payments, django
Collectfast
A faster collectstatic command.
Stars: ✭ 352 (-5.12%)
Mutual labels:  django
Pretalx
Conference planning tool: CfP, scheduling, speaker management
Stars: ✭ 363 (-2.16%)
Mutual labels:  django
Django Sekizai
Django Template Blocks with extra functionality
Stars: ✭ 353 (-4.85%)
Mutual labels:  django
Typeidea
Django企业开发实战对应项目代码
Stars: ✭ 351 (-5.39%)
Mutual labels:  django
Django User Sessions
Extend Django sessions with a foreign key back to the user, allowing enumerating all user's sessions.
Stars: ✭ 368 (-0.81%)
Mutual labels:  django
Django Blog
django搭建博客
Stars: ✭ 365 (-1.62%)
Mutual labels:  django
Django Bakery
A set of helpers for baking your Django site out as flat files
Stars: ✭ 360 (-2.96%)
Mutual labels:  django
Graphene Django Extras
Extras functionalities for Graphene-Django
Stars: ✭ 356 (-4.04%)
Mutual labels:  django
Django Tutorial
Django 基本教學 - 從無到有 Django-Beginners-Guide 📝
Stars: ✭ 365 (-1.62%)
Mutual labels:  django
Vmaig blog
an opensource blog system based on django 2.2 and bootstrap https://vmaig.com
Stars: ✭ 354 (-4.58%)
Mutual labels:  django
Healthchecks
A cron monitoring tool written in Python & Django
Stars: ✭ 4,297 (+1058.22%)
Mutual labels:  django
Channels Api
RESTful Websocket APIs with Django Rest Framework and Channels
Stars: ✭ 353 (-4.85%)
Mutual labels:  django
Try Django 1.11
Learn the fundamentals behind one of the most popular web frameworks in the world: Django. We will teach you step-by-step how to implement concepts like Views, Template Rendering, Forms, Saving Data, URL routing, Deployment aka Going Live, and so much more. Django is a web-framework written in Python and runs the backend for many of the internet's most popular websites such as Instagram and Pinterest. Get started today!
Stars: ✭ 359 (-3.23%)
Mutual labels:  django
Django Postgres Extra
Bringing all of PostgreSQL's awesomeness to Django.
Stars: ✭ 365 (-1.62%)
Mutual labels:  django
Django Watchman
django-watchman exposes a status endpoint for your backing services like databases, caches, etc.
Stars: ✭ 357 (-3.77%)
Mutual labels:  django

.. image:: https://img.shields.io/pypi/v/django-getpaid.svg :target: https://pypi.org/project/django-getpaid/ :alt: Latest PyPI version .. image:: https://img.shields.io/travis/sunscrapers/django-getpaid.svg :target: https://travis-ci.org/sunscrapers/django-getpaid .. image:: https://api.codacy.com/project/badge/Coverage/d25ba81e2e4740d6aac356f4ac90b16d :target: https://www.codacy.com/manual/dekoza/django-getpaid .. image:: https://img.shields.io/pypi/wheel/django-getpaid.svg :target: https://pypi.org/project/django-getpaid/ .. image:: https://img.shields.io/pypi/l/django-getpaid.svg :target: https://pypi.org/project/django-getpaid/ .. image:: https://api.codacy.com/project/badge/Grade/d25ba81e2e4740d6aac356f4ac90b16d :target: https://www.codacy.com/manual/dekoza/django-getpaid

============================= Welcome to django-getpaid

django-getpaid is payment processing framework for Django

Documentation

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

Features

  • support for multiple payment brokers at the same time
  • very 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)
  • support for global and per-plugin validators
  • 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:

.. code-block:: console

pip install django-getpaid
pip install django-getpaid-payu

Add them to your INSTALLED_APPS:

.. code-block:: python

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

Add getpaid to URL patterns:

.. code-block:: python

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

Define an Order model by subclassing getpaid.models.AbstractOrder and define some required methods:

.. code-block:: python

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_buyer_info(self):
        return {"email": self.buyer.email}

    def get_currency(self):
        return "EUR"

    def get_description(self):
        return self.description

.. note:: If you already have an Order model and don't want to subclass AbstractOrder just make sure you implement all methods.

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

.. code-block:: python

GETPAID_ORDER_MODEL = 'yourapp.MyCustomOrder'

GETPAID_BACKEND_SETTINGS = {
    "getpaid_payu": {
        # take these from your merchant panel:
        "pos_id": 12345,
        "second_key": "91ae651578c5b5aa93f2d38a9be8ce11",
        "oauth_id": 12345,
        "oauth_secret": "12f071174cb7eb79d4aac5bc2f07563f",
    },
}

Write a view that will create the Payment.

An example view and its hookup to urls.py can look like this:

.. code-block:: python

# orders/views.py
from getpaid.forms import PaymentMethodForm

class OrderView(DetailView):
    model = Order

    def get_context_data(self, **kwargs):
        context = super(OrderView, self).get_context_data(**kwargs)
        context["payment_form"] = PaymentMethodForm(
            initial={"order": self.object, "currency": self.object.currency}
        )
        return context

# main urls.py

urlpatterns = [
    # ...
    path("order/<int:pk>/", OrderView.as_view(), name="order_detail"),
]

You'll also need a template (order_detail.html in this case) for this view. Here's the important part:

.. code-block::

<h2>Choose payment broker:</h2>
<form action="{% url 'getpaid:create-payment' %}" method="post">
    {% csrf_token %}
    {{ payment_form.as_p }}
    <input type="submit" value="Checkout">
</form>

Running Tests

.. code-block:: console

poetry install
poetry run tox

Alternatives

  • django-payments <https://github.com/mirumee/django-payments>_

Credits

Created by Krzysztof Dorosz <https://github.com/cypreess>. Redesigned and rewritten by Dominik Kozaczko <https://github.com/dekoza>.

Currently sponsored by ClearCode <https://clearcode.cc>_

Development of version 2.0 sponsored by SUNSCRAPERS <https://sunscrapers.com/>_

Disclaimer

This project has nothing in common with getpaid <http://code.google.com/p/getpaid/>_ plone project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].