Skip to content
Switch branches/tags


Failed to load latest commit information.
Latest commit message
Commit time
Latest PyPI version

Welcome to django-getpaid

django-getpaid is payment processing framework for Django


The full documentation is at


  • 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)


Install django-getpaid and at least one payment backend:

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

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

from getpaid.abstracts 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":})

    def get_total_amount(self):
        return self.amount

    def get_buyer_info(self):
        return {"email":}

    def get_currency(self):
        return "EUR"

    def get_description(self):
        return self.description


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 and provide settings for payment backends:

GETPAID_ORDER_MODEL = 'yourapp.MyCustomOrder'

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

Create a migration for your model BEFORE adding getpaid to INSTALLED_APPS:

./ makemigrations

Add getpaid and broker plugin to your INSTALLED_APPS:

    'getpaid_payu',  # one of plugins

Migrate the database:

./ migrate

Add getpaid to URL patterns:

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

Write a view that will create the Payment.

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

# orders/
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

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:

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

Running Tests

poetry install
poetry run tox



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

Development of version 2.0 sponsored by SUNSCRAPERS


This project has nothing in common with getpaid plone project.