class plata.payment.modules.base.ProcessorBase(shop)[source]

Payment processor base class

already_paid(order, request=None)[source]

Handles the case where a payment module is selected but the order is already completely paid for (f.e. because an amount discount has been used which covers the order).

Does nothing if the order status is PAID already.


Clear pending payments


Create a pending payment

create_transactions(order, stage, **kwargs)[source]

Create transactions for all order items. The real work is offloaded to StockTransaction.objects.bulk_create.

default_name = u'unnamed'

Human-readable name for this payment module. You may use i18n here.


Decides whether this payment module is available for a given request.

Defaults to True. If you need to disable payment modules for certain visitors or group of visitors, that is the method you are searching for.


Defines URLs for this payment processor

Note that these URLs are added directly to the shop views URLconf without prefixes. It is your responsability to namespace these URLs so they don’t clash with shop views and other payment processors.

key = u'unnamed'

Safe key for this payment module (shouldn’t contain special chars, spaces etc.)


Returns name of this payment module suitable for human consumption

Defaults to default_name but can be overridden by placing an entry in PLATA_PAYMENT_MODULE_NAMES. Example:

    'paypal': _('Paypal and credit cards'),
order_paid(order, payment=None, request=None)[source]

Call this when the order has been fully paid for.

This method does the following:

  • Sets order status to PAID.
  • Calculates the remaining discount amount (if any) and calls the order_paid signal.
  • Clears pending payments which aren’t interesting anymore anyway.
process_order_confirmed(request, order)[source]

This is the initial entry point of payment modules and is called when the user has selected a payment module and accepted the terms and conditions of the shop.

Must return a response which is presented to the user, i.e. a form with hidden values forwarding the user to the PSP or a redirect to the success page if no further processing is needed.


Returns URLconf definitions used by this payment processor

This is especially useful for processors offering server-to-server communication such as Paypal’s IPN (Instant Payment Notification) where Paypal communicates payment success immediately and directly, without involving the client.

Define your own URLs in get_urls.

Cash on delivery

Payment module for cash on delivery handling

Automatically completes every order passed.

Check support

Payment module for check/transfer



PayPal support

Payment module for PayPal integration

Needs the following settings to work correctly:

    'BUSINESS': '',
    'LIVE': True, # Or False

Postfinance support

Payment module for Postfinance integration

Needs the following settings to work correctly:

    'PSPID': 'your_shop_id',
    'LIVE': True, # Or False
    'SHA1_IN': 'yourhash',
    'SHA1_OUT': 'yourotherhash',

Ogone support

Payment module for Ogone integration

Needs the following settings to work correctly:

    'PSPID': 'your_shop_id',
    'LIVE': True, # Or False
    'SHA1_IN': 'yourhash',
    'SHA1_OUT': 'yourotherhash',

Datatrans support

Payment module for Datatrans integration

Needs the following settings to work correctly:

    'MERCHANT_ID': '1000000000000',
    'LIVE': False

Billogram support

Payson support

PagSeguro support

Pagseguro payment module for django-plata Authors:, Date: 03/14/2012

Stripe support