checkout package

Submodules

checkout.admin module

class checkout.admin.CheckoutSettingsAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

media

checkout.forms module

class checkout.forms.CheckoutForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

Checkout form.

If extending this to a form that has contact address fields then set additional_prefix to make the field names unique.

additional_data()[source]
additional_prefix = ''
base_fields = {'action': <django.forms.fields.ChoiceField object>, 'token': <django.forms.fields.CharField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {'action': <django.forms.fields.ChoiceField object>, 'token': <django.forms.fields.CharField object>}
media
class checkout.forms.CustomerCheckoutForm(*args, **kwargs)[source]

Bases: checkout.forms.CheckoutForm

class Meta[source]

Bases: object

fields = ('action',)
model

alias of checkout.models.Customer

base_fields = {'action': <django.forms.fields.ChoiceField object>, 'token': <django.forms.fields.CharField object>}
declared_fields = {'action': <django.forms.fields.ChoiceField object>, 'token': <django.forms.fields.CharField object>}
media
class checkout.forms.CustomerEmptyForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ()
model

alias of checkout.models.Customer

base_fields = {}
declared_fields = {}
media
class checkout.forms.CustomerPaymentForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ('description', 'total')
model

alias of checkout.models.CustomerPayment

base_fields = {'description': <django.forms.fields.CharField object>, 'total': <django.forms.fields.DecimalField object>}
declared_fields = {}
media
class checkout.forms.ObjectPaymentPlanEmptyForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ()
model

alias of checkout.models.ObjectPaymentPlan

base_fields = {}
declared_fields = {}
media
class checkout.forms.ObjectPaymentPlanInstalmentCheckoutForm(*args, **kwargs)[source]

Bases: checkout.forms.CheckoutForm

class Meta[source]

Bases: object

fields = ('action',)
model

alias of checkout.models.ObjectPaymentPlanInstalment

base_fields = {'action': <django.forms.fields.ChoiceField object>, 'token': <django.forms.fields.CharField object>}
declared_fields = {'action': <django.forms.fields.ChoiceField object>, 'token': <django.forms.fields.CharField object>}
media
class checkout.forms.ObjectPaymentPlanInstalmentEmptyForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ()
model

alias of checkout.models.ObjectPaymentPlanInstalment

base_fields = {}
declared_fields = {}
media
class checkout.forms.PaymentPlanEmptyForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ()
model

alias of checkout.models.PaymentPlan

base_fields = {}
declared_fields = {}
media
class checkout.forms.PaymentPlanForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ('slug', 'name', 'deposit', 'count', 'interval')
model

alias of checkout.models.PaymentPlan

base_fields = {'count': <django.forms.fields.IntegerField object>, 'deposit': <django.forms.fields.IntegerField object>, 'interval': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'slug': <django.forms.fields.SlugField object>}
declared_fields = {}
media

checkout.models module

class checkout.models.Checkout(*args, **kwargs)[source]

Bases: base.model_utils.TimeStampedModel

Checkout.

Create a ‘Checkout’ instance when you want to interact with Stripe e.g. take a payment, get card details to set-up a payment plan or refresh the details of an expired card.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

action

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

action_id

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

charge(current_user)[source]

Charge the user’s card.

Must be a member of staff or anonymous (used when running as a background task) to use this method.

To take payments for the current user, use the charge_user method.

charge_user(current_user)[source]

Charge the card of the current user.

Use this method when the logged in user is performing the transaction.

To take money from another user’s card, you must be a member of staff and use the charge method.

checkout_date

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

checkoutadditional

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

content_object

Provide a generic many-to-one relation through the content_type and object_id fields.

This class also doubles as an accessor to the related object (similar to ForwardManyToOneDescriptor) by adding itself as a model attribute.

content_object_url
content_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

content_type_id

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

customer

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

customer_id

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

date_of_birth
description

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

fail()[source]

Checkout failed - so update and notify admin.

failed

Did the checkout request fail?

get_next_by_checkout_date(*, field=<django.db.models.fields.DateTimeField: checkout_date>, is_next=True, **kwargs)
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_checkout_date(*, field=<django.db.models.fields.DateTimeField: checkout_date>, is_next=False, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

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

invoice_data
is_invoice
is_manual
is_payment
is_payment_plan

Used in success templates.

notify(request=None)[source]

Send notification of checkout status.

Pass in a ‘request’ if you want the email to contain the URL of the checkout transaction.

object_id

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

objects = <checkout.models.CheckoutManager object>
paymentrunitem_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

previous_address_data
state

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

state_id

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

success()[source]

Checkout successful.

This method is called from within a transaction. See checkout.success in the model manager.

total

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

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

user_id

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

class checkout.models.CheckoutAction(id, created, modified, name, slug, payment)[source]

Bases: base.model_utils.TimeStampedModel

CARD_REFRESH = 'card_refresh'
CHARGE = 'charge'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

INVOICE = 'invoice'
MANUAL = 'manual'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PAYMENT = 'payment'
PAYMENT_PLAN = 'payment_plan'
checkout_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

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

invoice
name

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

objects = <checkout.models.CheckoutActionManager object>
payment

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

payment_plan
slug

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

class checkout.models.CheckoutActionManager[source]

Bases: django.db.models.manager.Manager

card_refresh
charge
invoice
manual
payment
payment_plan
class checkout.models.CheckoutAdditional(*args, **kwargs)[source]

Bases: base.model_utils.TimeStampedModel

If a user decides to pay by invoice, there are the details.

Links with the ‘CheckoutForm’ in checkout/forms.py. Probably easier to put validation in the form if required.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

address_1

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

address_2

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

address_3

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

checkout

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

checkout_id

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

company_name

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

contact_name

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

country

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

county

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

date_of_birth

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

email

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

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

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

objects = <checkout.models.CheckoutAdditionalManager object>
phone

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

postcode

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

town

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

class checkout.models.CheckoutAdditionalManager[source]

Bases: django.db.models.manager.Manager

create_checkout_additional(checkout, **kwargs)[source]
exception checkout.models.CheckoutError(value)[source]

Bases: Exception

class checkout.models.CheckoutManager[source]

Bases: django.db.models.manager.Manager

audit(content_type=None)[source]
audit_content_object(content_object)[source]
audit_content_type(content_type)[source]
audit_customers(customers)[source]
charge(content_object, current_user, payment_run_item=None)[source]

Collect some money from a customer.

You must be a member of staff to use this method. For payment plans, a background process will charge the card. In this case, the user will be anonymous.

We should only attempt to collect money if the customer has already entered their card details.

create_checkout(action, content_object, user)[source]

Create a checkout payment request.

for_content_object(obj)[source]
manual(content_object, current_user)[source]

Mark a transaction as paid (manual).

You must be a member of staff to use this method.

success()[source]
class checkout.models.CheckoutSettings(id, default_payment_plan)[source]

Bases: base.singleton.SingletonModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

default_payment_plan

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

default_payment_plan_id

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

id

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

objects = <checkout.models.CheckoutSettingsManager object>
class checkout.models.CheckoutSettingsManager[source]

Bases: django.db.models.manager.Manager

settings
class checkout.models.CheckoutState(id, created, modified, name, slug)[source]

Bases: base.model_utils.TimeStampedModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

FAIL = 'fail'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PENDING = 'pending'
REQUEST = 'request'
SUCCESS = 'success'
checkout_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

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

is_pending
is_success
name

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

objectpaymentplaninstalment_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <checkout.models.CheckoutStateManager object>
slug

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

class checkout.models.CheckoutStateManager[source]

Bases: django.db.models.manager.Manager

fail
pending
request

The ‘request’ state is used for payment plans only.

It allows the system to set the state to request before charging the account.

success
class checkout.models.Customer(*args, **kwargs)[source]

Bases: base.model_utils.TimeStampedModel

Stripe Customer.

Link the Stripe customer to an email address (and name).

Note: It is expected that multiple users in our databases could have the same email address. If they have different names, then this table looks very confusing. Try checking the ‘content_object’ of the ‘Checkout’ model if you need to diagnose an issue.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

MAIL_TEMPLATE_CARD_EXPIRY = 'customer_card_expiry'
MAIL_TEMPLATE_CARD_REFRESH_REQUEST = 'contact_card_refresh_request'
MAIL_TEMPLATE_REMINDER = 'customer_instalment_reminder'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

checkout_actions
checkout_can_charge

We can always take a payment for this object!

checkout_description
checkout_email
checkout_fail(checkout)[source]
checkout_fail_url(checkout_pk)[source]
checkout_name
checkout_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

checkout_success(checkout)[source]
checkout_success_url(checkout_pk)[source]
checkout_total
customer_id

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

customerpayment_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

email

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

expiry_date

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

get_absolute_url()[source]
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

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

is_expiring

Is the card expiring within the next month?

If the expiry_date is None, then it has not expired.

The expiry date is set to the last day of the month e.g. for September 2015, the expiry_date will be 30/09/2015.

name

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

objects = <checkout.models.CustomerManager object>
refresh

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

class checkout.models.CustomerManager[source]

Bases: django.db.models.manager.Manager

get_customer(email)[source]

Get the Stripe customer from the email address.

Note: email addresses are case-sensitive. For more info, see https://code.djangoproject.com/ticket/17561.

get_customers(email)[source]
init_customer(content_object, token)[source]

Initialise Stripe customer using email, description and token.

  1. Lookup existing customer record in the database.
    • Retrieve customer from Stripe and update description and token.
  2. If the customer does not exist:
  • Create Stripe customer with email, description and token.
  • Create a customer record in the database.

Return the customer database record and clear the card refresh flag.

refresh

Customers with expiring cards.

refresh_credit_card(email)[source]
update_card_expiry(email)[source]

Find the customer, get the expiry date from Stripe and update.

class checkout.models.CustomerPayment(*args, **kwargs)[source]

Bases: base.model_utils.TimeStampedModel

Take a payment from a customer.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

checkout_actions
checkout_can_charge
checkout_description
checkout_email
checkout_fail(checkout)[source]
checkout_fail_url(checkout_pk)[source]
checkout_name
checkout_success(checkout)[source]
checkout_success_url(checkout_pk)[source]
checkout_total
customer

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

customer_id

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

description

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

get_absolute_url()[source]
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

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

objects = <django.db.models.manager.Manager object>
total

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

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

user_id

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

class checkout.models.ObjectPaymentPlan(*args, **kwargs)[source]

Bases: base.model_utils.TimeStampedModel

Payment plan for an object.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

charge_deposit(user)[source]
content_object

Provide a generic many-to-one relation through the content_type and object_id fields.

This class also doubles as an accessor to the related object (similar to ForwardManyToOneDescriptor) by adding itself as a model attribute.

content_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

content_type_id

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

create_instalments()[source]

The deposit has been paid, so create the instalments.

delete()[source]
deleted

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

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

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

instalment_count
instalments_due(due_date=None)[source]

Check if previous instalments are due.

Note

The due_date parameter will exclude instalments due before this date.

object_id

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

objectpaymentplaninstalment_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <checkout.models.ObjectPaymentPlanManager object>
payment_count
payment_plan

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

payment_plan_id

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

payments
total

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

class checkout.models.ObjectPaymentPlanInstalment(*args, **kwargs)[source]

Bases: base.model_utils.TimeStampedModel

Payments due for an object.

The deposit record gets created first. It has the deposit field set to True.

The instalment records are created after the deposit has been collected. Instalment records have the deposit field set to False.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

REMINDER_CHECK = 21
REMINDER_DAYS = 7
RETRY_COUNT = 4
amount

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

can_mark_paid
checkout_actions

Payments are normally charged directly.

checkout_audit
checkout_can_charge

Check we can take the payment.

checkout_description
checkout_email
checkout_fail(checkout)[source]

Update the object to record the payment failure.

Called from within a transaction so you can update the model.

checkout_fail_url(checkout_pk)[source]

No UI, so no URL.

checkout_name
checkout_success(checkout)[source]

Update the object to record the payment success.

Called from within a transaction and you can update the model.

checkout_success_url(checkout_pk)[source]
checkout_total
count

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

current_instalment
deposit

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

due

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

get_absolute_url()[source]

TODO Update this to display the payment plan.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_due(*, field=<django.db.models.fields.DateField: due>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_due(*, field=<django.db.models.fields.DateField: due>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

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

object_payment_plan

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

object_payment_plan_id

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

objects = <checkout.models.ObjectPaymentPlanInstalmentManager object>
paymentrunitem_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

retry_count

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

set_retry_payment()[source]
state

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

state_id

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

class checkout.models.ObjectPaymentPlanInstalmentManager[source]

Bases: django.db.models.manager.Manager

create_object_payment_plan_instalment(object_payment_plan, count, deposit, amount, due)[source]
due

Lock the records while we try and take the payment.

TODO Do we need to check that a payment is not already linked to this record?

reminder()[source]

List of instalments which will be due soon.

This information will be used to send a reminder email to the customer so they can make sure they have money in their account.

reminder_emails()[source]
  1. Which reminder emails are due.
  2. Remove email addresses which have already been sent a reminder.
send_payment_reminder_emails()[source]
class checkout.models.ObjectPaymentPlanManager[source]

Bases: django.db.models.manager.Manager

charge_deposit(content_object, user)[source]
create_object_payment_plan(content_object, payment_plan, total)[source]

Create a payment plan for an object with the initial deposit record.

This method must be called from within a transaction.

fail_or_request
for_content_object(obj)[source]

Return the ObjectPaymentPlan instance for obj.

outstanding_payment_plans

List of outstanding payment plans.

Used to refresh card expiry dates.

refresh_card_expiry_dates()[source]

Refresh the card expiry dates for outstanding payment plans.

report_card_expiry_dates

Outstanding payment plans showing expiry dates in order.

class checkout.models.PaymentPlan(*args, **kwargs)[source]

Bases: base.model_utils.TimeStampedModel

Definition of a payment plan.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

can_update
checkoutsettings_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

count

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

deleted

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

deposit

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

deposit_amount(total)[source]
example(deposit_date, total)[source]
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

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

instalments(deposit_date, total)[source]

Calculate the instalment dates and values.

interval

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

name

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

objectpaymentplan_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <checkout.models.PaymentPlanManager object>
save(*args, **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.

slug

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

class checkout.models.PaymentPlanManager[source]

Bases: django.db.models.manager.Manager

create_payment_plan(slug, name, deposit, count, interval)[source]
current()[source]

List of payment plan headers excluding ‘deleted’.

class checkout.models.PaymentRun(id, created)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

created

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

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
id

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

item_count()[source]
objects = <checkout.models.PaymentRunManager object>
paymentrunitem_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class checkout.models.PaymentRunItem(id, created, modified, payment_run, instalment, checkout)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

checkout

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

checkout_id

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

created

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

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

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

instalment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

instalment_id

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

modified

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

objects = <checkout.models.PaymentRunItemManager object>
payment_run

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

payment_run_id

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

class checkout.models.PaymentRunItemManager[source]

Bases: django.db.models.manager.Manager

create_payment_run_item(payment_run, instalment)[source]
class checkout.models.PaymentRunManager[source]

Bases: django.db.models.manager.Manager

create_payment_run()[source]
notify(payment_run, error_count)[source]

Send notification of payment run

process_payments()[source]

Process pending payments.

We set the status to ‘request’ before asking for the money. This is because we can’t put the payment request into a transaction. If we are not careful, we could have a situation where the payment succeeds and we don’t manage to set the state to ‘success’. In the code below, if the payment fails the record will be left in the ‘request’ state and so we won’t ask for the money again.

checkout.models.as_pennies(total)[source]
checkout.models.default_checkout_state()[source]
checkout.models.expiry_date_as_str(item)[source]

checkout.service module

checkout.tasks module

checkout.urls module

checkout.views module

class checkout.views.CheckoutAuditListView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.list.ListView

get_context_data(**kwargs)[source]

Get the context for this view.

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

paginate_by = 10
class checkout.views.CheckoutBaseMixin[source]

Bases: object

Some methods for use in creating a checkout

get_context_data(**kwargs)[source]
get_form_kwargs()[source]
class checkout.views.CheckoutCardRefreshListView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.list.ListView

Customers with expiring cards.

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

paginate_by = 10
template_name = 'checkout/card_refresh_list.html'
class checkout.views.CheckoutDashTemplateView(**kwargs)[source]

Bases: braces.views._access.StaffuserRequiredMixin, braces.views._access.LoginRequiredMixin, base.view_utils.BaseMixin, django.views.generic.base.TemplateView

template_name = 'checkout/dash.html'
class checkout.views.CheckoutListView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.list.ListView

get_context_data(**kwargs)[source]

Get the context for this view.

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

paginate_by = 10
class checkout.views.CheckoutMixin[source]

Bases: checkout.views.CheckoutBaseMixin

Checkout using a standalone view.

Use with an UpdateView e.g:

class ShopCheckoutUpdateView(CheckoutMixin, BaseMixin, UpdateView):
form_valid(form)[source]

Process the payment

get_context_data(**kwargs)[source]
class checkout.views.CheckoutSuccessMixin[source]

Bases: object

Thank you for your payment (etc).

Use with a DetailView e.g:

class ShopCheckoutSuccessView(
    CheckoutSuccessMixin, BaseMixin, DetailView):
get_context_data(**kwargs)[source]
model

alias of checkout.models.Checkout

class checkout.views.CustomerCardRefreshFormView(**kwargs)[source]

Bases: braces.views._access.StaffuserRequiredMixin, braces.views._access.LoginRequiredMixin, base.view_utils.BaseMixin, django.views.generic.edit.UpdateView

Send an email to a user asking them to refresh their card details.

The email will contain a link to the page on the site where the user can enter their card details.

The URL is hard-coded to be web.contact.card.refresh.

form_class

alias of checkout.forms.CustomerEmptyForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of checkout.models.Customer

template_name = 'checkout/customer_card_refresh_form.html'
class checkout.views.CustomerChargeCreateView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.edit.CreateView

form_class

alias of checkout.forms.CustomerPaymentForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of checkout.models.CustomerPayment

class checkout.views.CustomerCheckoutRefreshUpdateView(**kwargs)[source]

Bases: braces.views._access.StaffuserRequiredMixin, braces.views._access.LoginRequiredMixin, checkout.views.CheckoutMixin, base.view_utils.BaseMixin, django.views.generic.edit.UpdateView

form_class

alias of checkout.forms.CustomerCheckoutForm

model

alias of checkout.models.Customer

template_name = 'checkout/customer_checkout_refresh.html'
class checkout.views.CustomerTemplateView(**kwargs)[source]

Bases: braces.views._access.StaffuserRequiredMixin, braces.views._access.LoginRequiredMixin, base.view_utils.BaseMixin, django.views.generic.base.TemplateView

get_context_data(**kwargs)[source]
template_name = 'checkout/customer.html'
class checkout.views.ObjectPaymentPlanCardFailListView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.list.ListView

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

paginate_by = 10
class checkout.views.ObjectPaymentPlanDeleteView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.edit.UpdateView

form_class

alias of checkout.forms.ObjectPaymentPlanEmptyForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of checkout.models.ObjectPaymentPlan

template_name = 'checkout/object_paymentplan_delete.html'
class checkout.views.ObjectPaymentPlanDetailView(**kwargs)[source]

Bases: braces.views._access.StaffuserRequiredMixin, braces.views._access.LoginRequiredMixin, base.view_utils.BaseMixin, django.views.generic.detail.DetailView

model

alias of checkout.models.ObjectPaymentPlan

class checkout.views.ObjectPaymentPlanInstalmentAuditListView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.list.ListView

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

paginate_by = 15
class checkout.views.ObjectPaymentPlanInstalmentChargeUpdateView(**kwargs)[source]

Bases: braces.views._access.StaffuserRequiredMixin, braces.views._access.LoginRequiredMixin, base.view_utils.BaseMixin, django.views.generic.edit.UpdateView

Charge the customers card for this instalment.

form_class

alias of checkout.forms.ObjectPaymentPlanInstalmentEmptyForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of checkout.models.ObjectPaymentPlanInstalment

template_name = 'checkout/objectpaymentplaninstalment_charge_form.html'
class checkout.views.ObjectPaymentPlanInstalmentDetailView(**kwargs)[source]

Bases: braces.views._access.StaffuserRequiredMixin, braces.views._access.LoginRequiredMixin, base.view_utils.BaseMixin, django.views.generic.detail.DetailView

model

alias of checkout.models.ObjectPaymentPlanInstalment

class checkout.views.ObjectPaymentPlanInstalmentPaidUpdateView(**kwargs)[source]

Bases: braces.views._access.StaffuserRequiredMixin, braces.views._access.LoginRequiredMixin, base.view_utils.BaseMixin, django.views.generic.edit.UpdateView

Mark this instalment as paid.

form_class

alias of checkout.forms.ObjectPaymentPlanInstalmentEmptyForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of checkout.models.ObjectPaymentPlanInstalment

template_name = 'checkout/objectpaymentplaninstalment_paid_form.html'
class checkout.views.ObjectPaymentPlanListView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.list.ListView

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

model

alias of checkout.models.ObjectPaymentPlan

paginate_by = 10
class checkout.views.PaymentPlanCreateView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.edit.CreateView

form_class

alias of checkout.forms.PaymentPlanForm

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of checkout.models.PaymentPlan

class checkout.views.PaymentPlanDeleteView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.edit.UpdateView

form_class

alias of checkout.forms.PaymentPlanEmptyForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of checkout.models.PaymentPlan

template_name = 'checkout/paymentplan_delete.html'
class checkout.views.PaymentPlanListView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.list.ListView

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

paginate_by = 5
class checkout.views.PaymentPlanUpdateView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.edit.UpdateView

form_class

alias of checkout.forms.PaymentPlanForm

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of checkout.models.PaymentPlan

class checkout.views.PaymentRunItemListView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.list.ListView

get_context_data(**kwargs)[source]

Get the context for this view.

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

paginate_by = 20
class checkout.views.PaymentRunListView(**kwargs)[source]

Bases: braces.views._access.LoginRequiredMixin, braces.views._access.StaffuserRequiredMixin, base.view_utils.BaseMixin, django.views.generic.list.ListView

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

paginate_by = 20
checkout.views.payment_plan_example(total)[source]

Module contents