pay.models.payment_providers.stripe
Attributes
Classes
Captures an open stripe charge when the transaction finishes. |
|
All stripe fee calculations in one place (should they ever change). |
|
Represents a payment done through various means. |
|
Represents a payment provider. |
Functions
|
Module Contents
- class pay.models.payment_providers.stripe.StripeCaptureManager(api_key: str, charge_id: str)[source]
Captures an open stripe charge when the transaction finishes.
If there is an error during this step, it is logged, but the transaction still continues successfully.
The user is then supposed to manually capture the charge.
- class pay.models.payment_providers.stripe.StripeFeePolicy[source]
All stripe fee calculations in one place (should they ever change).
- class pay.models.payment_providers.stripe.StripePayment[source]
Bases:
onegov.pay.models.payment.Payment
Represents a payment done through various means.
- provider: sqlalchemy.orm.relationship[StripeConnect][source]
- class pay.models.payment_providers.stripe.StripeConnect[source]
Bases:
onegov.pay.models.payment_provider.PaymentProvider
[StripePayment
]Represents a payment provider.
- adjust_price(price: onegov.pay.utils.Price | None) onegov.pay.utils.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.
- property payment_class: type[StripePayment][source]
- property public_identity: str[source]
The public identifier of this payment provider. For example, the account name.
- property identity: str | None[source]
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.
- charge(amount: decimal.Decimal, currency: str, token: str) StripePayment [source]
Given a payment token, charges the customer and creates a payment which is returned.
- checkout_button(label: str, amount: decimal.Decimal | None, currency: str | None, action: str = 'submit', **extra: Any) markupsafe.Markup [source]
Generates the html for the checkout button.
- oauth_url(redirect_uri: str, state: str | None = None, user_fields: dict[str, Any] | None = None) str [source]
Generates an oauth url to be shown in the browser.
- prepare_oauth_request(redirect_uri: 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.
- process_oauth_response(request_params: Mapping[str, Any]) None [source]
Takes the parameters of an incoming oauth request and stores them on the payment provider if successful.
- sync() None [source]
Updates the local payment information with the information from the remote payment provider.
- sync_payouts(session: sqlalchemy.orm.Session) None [source]
See https://stripe.com/docs/api/balance_transactions/list and https://stripe.com/docs/api/payouts