pay.models.payment

Module Contents

Classes

Payment

Represents a payment done through various means.

ManualPayment

A manual payment is a payment without associated payment provider.

class pay.models.payment.Payment[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.TimestampMixin, onegov.core.orm.mixins.ContentMixin, onegov.core.orm.abstract.associable.Associable

Represents a payment done through various means.

property fee: decimal.Decimal[source]

The fee associated with this payment. The payment amount includes the fee. To get the net amount use the net_amount property.

property net_amount: decimal.Decimal[source]
abstract property remote_url: str[source]

Returns the url of this object on the payment provider.

__tablename__ = 'payments'[source]
id: Column[uuid.UUID][source]
source: Column[str][source]
amount: Column[Decimal | None][source]
currency: Column[str][source]
remote_id: Column[str | None][source]
state: Column[PaymentState][source]
provider_id: Column[uuid.UUID | None][source]
__mapper_args__[source]
paid() bool[source]

Our states are essentially one paid and n unpaid states (indicating various ways in which the payment can end up being unpaid).

So this boolean acts as coarse filter to divide payemnts into the two states that really matter.

abstract sync(remote_obj: Any | None = None) None[source]

Updates the local payment information with the information from the remote payment provider.

class pay.models.payment.ManualPayment[source]

Bases: Payment

A manual payment is a payment without associated payment provider.

For example, a payment paid in cash.

__mapper_args__[source]
sync(remote_obj: None = None) None[source]

Updates the local payment information with the information from the remote payment provider.