pay.models.payment

Classes

Payment

Represents a payment done through various means.

ManualPayment

A manual payment is a payment without associated payment provider.

Module Contents

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.

__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]
provider: relationship[PaymentProvider[Self] | None][source]
__mapper_args__[source]
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]
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.

property remote_url: str[source]
Abstractmethod:

Returns the url of this object on the payment provider.

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.