shop.payment_providers¶
Submodules¶
shop.payment_providers.abstractshop.payment_providers.amazon_payshop.payment_providers.invoiceshop.payment_providers.paypal_plusshop.payment_providers.prepaymentshop.payment_providers.unzer_abstractshop.payment_providers.unzer_applepayshop.payment_providers.unzer_bancontactshop.payment_providers.unzer_cardshop.payment_providers.unzer_googlepayshop.payment_providers.unzer_idealshop.payment_providers.unzer_paylater_invoiceshop.payment_providers.unzer_paypalshop.payment_providers.unzer_sofort
Package Contents¶
Classes¶
Abstract base class for all payment providers in the ViUR Shop. |
|
Amazon Pay integration for the ViUR Shop. |
|
Invoice payment method for the ViUR Shop. |
|
PayPal Plus integration for the ViUR Shop. |
|
Prepayment method for the ViUR Shop. |
|
Prepayment method for the ViUR Shop. |
- class shop.payment_providers.PaymentProviderAbstract(*, image_path=None, is_available=None)¶
Bases:
viur.core.prototypes.instanced_module.InstancedModule,viur.core.Module,abc.ABCAbstract base class for all payment providers in the ViUR Shop.
Provides a standardized interface for implementing different payment methods, including methods for checkout, charging, and handling payment states.
Subclasses must implement the required methods to integrate specific payment providers.
- Parameters:
image_path (str | None)
is_available (t.Callable[[t.Self, SkeletonInstance_T[viur.shop.skeletons.order.OrderSkel] | None], bool] | None)
- abstract property name: str¶
Define the internal name of the payment provider
- Return type:
str
- property title: viur.core.translate¶
Define the external title of the payment provider
- Return type:
viur.core.translate
- property description: viur.core.translate¶
Define the description of the payment provider
- Return type:
viur.core.translate
- shop: shop.shop.Shop¶
Reference to the main
Shopinstance.
- is_available(order_skel)¶
- Parameters:
order_skel (SkeletonInstance_T[viur.shop.skeletons.order.OrderSkel] | None)
- Return type:
bool
- can_checkout(order_skel)¶
Check if a checkout process can be started
An empty list means not error, a list with errors rejects the checkout start.
- Parameters:
order_skel (SkeletonInstance_T[viur.shop.skeletons.order.OrderSkel] | None)
- Return type:
list[ClientError]
- abstract checkout(order_skel)¶
- Parameters:
order_skel (viur.core.skeleton.SkeletonInstance)
- Return type:
t.Any
- get_checkout_start_data(order_skel)¶
- Parameters:
order_skel (viur.core.skeleton.SkeletonInstance)
- Return type:
t.Any
- can_order(order_skel)¶
- Parameters:
order_skel (viur.core.skeleton.SkeletonInstance)
- Return type:
list[ClientError]
- abstract charge()¶
- abstract check_payment_state(order_skel)¶
Check the payment state from the PaymentProvider API/service
Access
OrderSkel.is_paidto get the payment state of an order.- Parameters:
order_skel (viur.core.skeleton.SkeletonInstance)
- Return type:
tuple[bool, t.Any]
- abstract return_handler()¶
- abstract webhook()¶
- abstract get_debug_information()¶
- _append_payment_to_order_skel(order_skel, payment=None)¶
Append payment data to an order
Append payment_provider name and creationdate by default. Write safely in a transaction.
- Parameters:
order_skel (SkeletonInstance_T[viur.shop.skeletons.order.OrderSkel])
payment (dict[str, t.Any] | None)
- Return type:
SkeletonInstance_T[viur.shop.skeletons.order.OrderSkel]
- serialize_for_api(order_skel)¶
Serialize this Payment Provder for the API
Used by
Order.get_payment_providers()andOrder.payment_providers_list()Can be subclasses to expose more information via API.- Parameters:
order_skel (SkeletonInstance_T[viur.shop.skeletons.order.OrderSkel] | None)
- Return type:
- class shop.payment_providers.AmazonPay(*, mws_access_key, mws_secret_key, merchant_id, client_id, client_secret, region='de', currency_code='EUR', sandbox=False, language='en', **kwargs)¶
Bases:
shop.payment_providers.PaymentProviderAbstractAmazon Pay integration for the ViUR Shop.
Handles the checkout process using Amazon Pay, including authorization and payment capture. Requires Amazon MWS credentials and configuration parameters.
- Parameters:
mws_access_key (str) – Amazon MWS access key.
mws_secret_key (str) – Amazon MWS secret key.
merchant_id (str) – Amazon merchant ID.
client_id (str) – Amazon client ID.
client_secret (str) – Amazon client secret.
region (str) – Region code (default: ‘de’).
currency_code (str) – Currency code (default: ‘EUR’).
sandbox (bool) – Use sandbox environment (default: False).
language (str) – Language code (default: ‘en’).
kwargs (Any)
- name: Final[str] = 'amazonpay'¶
- checkout(order_skel)¶
- Parameters:
order_skel (viur.core.skeleton.SkeletonInstance)
- Return type:
Any
- get_checkout_start_data(order_skel)¶
- Parameters:
order_skel (viur.core.skeleton.SkeletonInstance)
- Return type:
Any
- charge()¶
- check_payment_state(order_skel)¶
Check the payment state from the PaymentProvider API/service
Access
OrderSkel.is_paidto get the payment state of an order.- Parameters:
order_skel (viur.core.skeleton.SkeletonInstance)
- Return type:
tuple[bool, Any]
- return_handler()¶
- webhook()¶
- get_debug_information()¶
- class shop.payment_providers.Invoice(*, image_path=None, is_available=None)¶
Bases:
shop.payment_providers.PaymentProviderAbstractInvoice payment method for the ViUR Shop.
Allows customers to place orders with the agreement to pay later via invoice. The order can be marked as ready to ship (RTS) immediately but is not considered paid.
- Note:
Payment processing (the customer pays this order in the next x days) and verification are handled externally and not within this module.
- Parameters:
image_path (str | None)
is_available (t.Callable[[t.Self, SkeletonInstance_T[viur.shop.skeletons.order.OrderSkel] | None], bool] | None)
- name: Final[str] = 'invoice'¶
- checkout(order_skel)¶
- Parameters:
order_skel (shop.types.SkeletonInstance_T[shop.skeletons.OrderSkel])
- Return type:
None
- charge()¶
- Return type:
None
- check_payment_state(order_skel)¶
Check the payment state from the PaymentProvider API/service
Access
OrderSkel.is_paidto get the payment state of an order.- Parameters:
order_skel (viur.core.skeleton.SkeletonInstance)
- Return type:
tuple[bool, Any]
- return_handler()¶
- webhook()¶
- get_debug_information()¶
- class shop.payment_providers.PayPalPlus¶
Bases:
shop.payment_providers.PaymentProviderAbstractPayPal Plus integration for the ViUR Shop.
Supports multiple payment methods through PayPal Plus, including PayPal, credit card, and more. Handles the checkout process, payment state checks, and webhook handling for payment updates.
- name: Final[str] = 'paypal_plus'¶
- checkout(order_skel)¶
- Parameters:
order_skel (viur.core.skeleton.SkeletonInstance)
- Return type:
Any
- charge()¶
- check_payment_state()¶
- return_handler()¶
- webhook()¶
- get_debug_information()¶
- class shop.payment_providers.PrePayment(*, image_path=None, is_available=None)¶
Bases:
PrepaymentPrepayment method for the ViUR Shop.
Allows customers to place orders with the agreement to pay in advance. The order is marked as ready to ship (RTS) once payment is received.
The customer pays this order in the next x days, shipping will wait.
- Note:
Payment receipt verification (The customer pays this order in the next x days, shipping will wait) is handled externally and not within this module.
- Parameters:
image_path (str | None)
is_available (t.Callable[[t.Self, SkeletonInstance_T[viur.shop.skeletons.order.OrderSkel] | None], bool] | None)
- class shop.payment_providers.Prepayment(*, image_path=None, is_available=None)¶
Bases:
shop.payment_providers.PaymentProviderAbstractPrepayment method for the ViUR Shop.
Allows customers to place orders with the agreement to pay in advance. The order is marked as ready to ship (RTS) once payment is received.
The customer pays this order in the next x days, shipping will wait.
- Note:
Payment receipt verification (The customer pays this order in the next x days, shipping will wait) is handled externally and not within this module.
- Parameters:
image_path (str | None)
is_available (t.Callable[[t.Self, SkeletonInstance_T[viur.shop.skeletons.order.OrderSkel] | None], bool] | None)
- name: Final[str] = 'prepayment'¶
- checkout(order_skel)¶
- Parameters:
order_skel (shop.types.SkeletonInstance_T[shop.skeletons.OrderSkel])
- Return type:
None
- charge()¶
- Return type:
None
- check_payment_state(order_skel)¶
Check the payment state from the PaymentProvider API/service
Access
OrderSkel.is_paidto get the payment state of an order.- Parameters:
order_skel (viur.core.skeleton.SkeletonInstance)
- Return type:
tuple[bool, Any]
- return_handler()¶
- webhook()¶
- get_debug_information()¶