pay.integration
Attributes
Classes
Provides payment integration for |
|
Enum where members are also (and must be) ints |
Functions
|
|
|
|
|
Processes a payment using various methods. |
Module Contents
- class pay.integration.PayApp[source]
Bases:
more.webassets.WebassetsApp
Provides payment integration for
onegov.core.framework.Framework
based applications.- configure_payment_providers(*, payment_providers_enabled: bool = False, payment_provider_defaults: dict[str, Any] | None = None, **cfg: Any) None [source]
Configures the preconfigured parameters for payment providers.
Takes one dictionary for each availble provider. Available providers can be found in the models/payment_providers folder. Additionally, it is possible to enable/disable custom payment providers for the whole site.
For example:
payment_providers_enabled: true payment_provider_defaults: stripe_connect: client_id: foo client_secret: bar
Since multiple payment providers (even of the same type) may exist, and because some information stored on the payment providers need to be configured differently for each application_id (and possibly set up through OAuth) we only provide default parameters.
When we create a new payment provider, these default values may be read by the payment provider.
- class pay.integration.PaymentError[source]
Bases:
enum.IntEnum
Enum where members are also (and must be) ints
- pay.integration.process_payment(method: onegov.pay.types.PaymentMethod, price: onegov.pay.utils.Price, provider: onegov.pay.PaymentProvider[Any] | None = None, token: str | None = None) Payment | PaymentError | None [source]
Processes a payment using various methods.
This method returns one of the following:
The processed payment if successful.
None if an unknown error occurred.
An error code (see below).
Possible error codes:
INSUFFICIENT_FUNDS - the card has insufficient funds.
Available methods:
‘free’: Payment may be done manually or by credit card ‘cc’: Payment must be done by credit card ‘manual’: Payment must be done manually