web_payments.django package

Submodules

web_payments.django.apps module

class web_payments.django.apps.WebPaymentsConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

name = 'web_payments'
ready()[source]

Override this method in subclasses to run code when Django starts.

web_payments.django.models module

class web_payments.django.models.BasePayment(*args, **kwargs)[source]

Bases: django.db.models.base.Model, web_payments.logic.BasicPayment

Represents a single transaction. Each instance has one or more PaymentItem.

class Meta[source]

Bases: object

abstract = False
classmethod check_token_exists(token)[source]

create token for process_url

get_fraud_status_display(*, field=<django.db.models.fields.CharField: fraud_status>)
get_process_url(extra_data=None)[source]

returns a communication url, should kept secret except if provider communication is with customer

get_provider_variant()[source]

return ProviderVariant for this payment object

get_status_display(*, field=<django.db.models.fields.CharField: status>)
classmethod list_providers(**kwargs)[source]

returns an iterable with ProviderVariants

save(**kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

signal_status_change()[source]

Called on status change. Should send signal (see django.models for example). must to be overwritten to be useful

class web_payments.django.models.BasePaymentWithAddress(*args, **kwargs)[source]

Bases: web_payments.django.models.BasePayment

Has real billing address + shippingaddress alias on billing address

class Meta[source]

Bases: object

abstract = False
billing_address_1

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

billing_address_2

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

billing_city

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

billing_country_area

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

billing_country_code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

billing_email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

billing_first_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

billing_last_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

billing_postcode

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_billing_address()
get_fraud_status_display(*, field=<django.db.models.fields.CharField: fraud_status>)
get_shipping_address()
get_status_display(*, field=<django.db.models.fields.CharField: status>)

web_payments.django.signals module

web_payments.django.urls module

This module is responsible for automatic processing of provider callback data (asynchronous transaction updates).

web_payments.django.urls.process_data(request, token, provider=None)[source]

Calls process_data of an appropriate provider.

Raises Http404 if variant does not exist.

web_payments.django.urls.static_callback(request, variant)[source]

Module contents

web_payments.django.get_base_url(provider=None)[source]

Returns host url according to project settings. Protocol is chosen by PAYMENT_PROTOCOL variable. If PAYMENT_HOST is not specified, get domain from Sites. Otherwise checks if it’s callable and returns it’s result. If it’s not a callable treats it as domain.

web_payments.django.get_payment_model()[source]

Return the Payment model that is active in this project

web_payments.django.initialize()[source]

overwrites get/set language with django equivalents