pay.models.payment_provider
Attributes
Classes
Represents a payment provider.  | 
Module Contents
- class pay.models.payment_provider.PaymentProvider[source]
 Bases:
onegov.core.orm.Base,onegov.core.orm.mixins.TimestampMixin,onegov.core.orm.mixins.ContentMixin,Generic[_P]Represents a payment provider.
- payment(*, amount: decimal.Decimal | None = None, currency: str = 'CHF', remote_id: str | None = None, state: onegov.pay.types.PaymentState = 'open', **kwargs: Any) _P[source]
 Creates a new payment using the correct model.
- adjust_price(price: onegov.pay.Price | None) onegov.pay.Price | None[source]
 Called by client implementations this method allows to adjust the price by adding a fee to it.
By default no change is made.
- abstractmethod charge(amount: decimal.Decimal, currency: str, token: str) onegov.pay.models.payment.Payment[source]
 Given a payment token, charges the customer and creates a payment which is returned.
- property title: str[source]
 - Abstractmethod:
 
The title of the payment provider (i.e. the product name).
- property public_identity: str[source]
 - Abstractmethod:
 
The public identifier of this payment provider. For example, the account name.
- property identity: str | None[source]
 - Abstractmethod:
 
Uniquely identifies this payment provider amongst other providers of the same type (say the private key of the api). Used to be able to tell if a new oauth connection is the same as an existing one.
This identity is not meant to be displayed.
- property connected: bool[source]
 Returns True if the provider is properly hooked up to the payment provider.
- abstractmethod get_token(request: onegov.core.request.CoreRequest) str | None[source]
 Extracts this provider’s specific token from the request.
- abstractmethod checkout_button(label: str, amount: decimal.Decimal | None, currency: str | None, complete_url: str, request: onegov.core.request.CoreRequest, **extra: Any) markupsafe.Markup[source]
 Renders a checkout button.
- abstractmethod prepare_oauth_request(redirect_url: str, success_url: str, error_url: str, user_fields: dict[str, Any] | None = None) str[source]
 Registers the oauth request with the oauth_gateway and returns an url that is ready to be used for the complete oauth request.
- abstractmethod process_oauth_response(request_params: collections.abc.Mapping[str, Any]) None[source]
 Processes the oauth response using the parameters passed by the returning oauth request via the gateway.