shop.payment_providers ====================== .. py:module:: shop.payment_providers Submodules ---------- .. toctree:: :maxdepth: 1 /viur/shop/payment_providers/abstract/index /viur/shop/payment_providers/amazon_pay/index /viur/shop/payment_providers/invoice/index /viur/shop/payment_providers/paypal_checkout/index /viur/shop/payment_providers/prepayment/index /viur/shop/payment_providers/unzer_abstract/index /viur/shop/payment_providers/unzer_applepay/index /viur/shop/payment_providers/unzer_bancontact/index /viur/shop/payment_providers/unzer_card/index /viur/shop/payment_providers/unzer_googlepay/index /viur/shop/payment_providers/unzer_ideal/index /viur/shop/payment_providers/unzer_paylater_invoice/index /viur/shop/payment_providers/unzer_paypal/index /viur/shop/payment_providers/unzer_sofort/index Classes ------- .. autoapisummary:: shop.payment_providers.PaymentProviderAbstract shop.payment_providers.AmazonPay shop.payment_providers.Invoice shop.payment_providers.PrePayment shop.payment_providers.Prepayment Package Contents ---------------- .. py:class:: PaymentProviderAbstract(*, image_path = None, is_available = None) Bases: :py:obj:`viur.core.prototypes.instanced_module.InstancedModule`, :py:obj:`viur.core.Module`, :py:obj:`abc.ABC` Abstract 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. .. py:attribute:: shop :type: shop.shop.Shop :value: None Reference to the main :class:`Shop` instance. .. py:attribute:: image_path :value: None .. py:property:: name :type: str :abstractmethod: Define the internal name of the payment provider .. py:property:: title :type: viur.core.translate Define the external title of the payment provider .. py:property:: description :type: viur.core.translate Define the description of the payment provider .. py:method:: is_available(order_skel) Decide whether the payment provider is available. .. py:method:: 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. .. py:method:: checkout(order_skel) :abstractmethod: .. py:method:: get_checkout_start_data(order_skel) .. py:method:: can_order(order_skel) .. py:method:: charge(order_skel, payment = None) :abstractmethod: .. py:method:: check_payment_state(order_skel) :abstractmethod: Check the payment state from the PaymentProvider API/service Access :attr:`OrderSkel.is_paid` to get the payment state of an order. .. py:method:: check_payment_deferred(order_key) Check the status for a payment deferred .. py:method:: return_handler() :abstractmethod: Frontend Endpoint where the might be redirected to by the payment provider during the payment flow .. py:method:: webhook() :abstractmethod: API Endpoint (Webhook) to listen for events from payment provider .. py:method:: get_debug_information() :abstractmethod: Provide information about the payment of an order. Only for debugging purposes. It's not an API endpoint. .. py:method:: _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. .. py:method:: serialize_for_api(order_skel) Serialize this Payment Provider for the API Used by :meth:`Order.get_payment_providers` and :meth:`Order.payment_providers_list` Can be subclasses to expose more information via API. .. py:method:: model_to_dict(obj) :classmethod: Convert any nested model to a JSON-compatible representation .. py:class:: AmazonPay(*, mws_access_key, mws_secret_key, merchant_id, client_id, client_secret, region = 'de', currency_code = 'EUR', sandbox = False, language = 'en', **kwargs) Bases: :py:obj:`shop.payment_providers.PaymentProviderAbstract` Amazon 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. :param mws_access_key: Amazon MWS access key. :param mws_secret_key: Amazon MWS secret key. :param merchant_id: Amazon merchant ID. :param client_id: Amazon client ID. :param client_secret: Amazon client secret. :param region: Region code (default: 'de'). :param currency_code: Currency code (default: 'EUR'). :param sandbox: Use sandbox environment (default: False). :param language: Language code (default: 'en'). .. py:attribute:: name :type: viur.shop.types.t.Final[str] :value: 'amazonpay' Define the internal name of the payment provider .. py:attribute:: mws_access_key .. py:attribute:: mws_secret_key .. py:attribute:: merchant_id .. py:attribute:: client_id .. py:attribute:: client_secret .. py:attribute:: sandbox :value: False .. py:attribute:: language :value: 'en' .. py:method:: checkout(order_skel) .. py:method:: get_checkout_start_data(order_skel) .. py:method:: charge(order_skel, payment = None) .. py:method:: check_payment_state(order_skel) Check the payment state from the PaymentProvider API/service Access :attr:`OrderSkel.is_paid` to get the payment state of an order. .. py:method:: return_handler() Frontend Endpoint where the might be redirected to by the payment provider during the payment flow .. py:method:: webhook() API Endpoint (Webhook) to listen for events from payment provider .. py:method:: get_debug_information() Provide information about the payment of an order. Only for debugging purposes. It's not an API endpoint. .. py:class:: Invoice(*, image_path = None, is_available = None) Bases: :py:obj:`shop.payment_providers.PaymentProviderAbstract` Invoice 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. .. py:attribute:: name :type: Final[str] :value: 'invoice' Define the internal name of the payment provider .. py:method:: checkout(order_skel) .. py:method:: charge(order_skel, payment = None) .. py:method:: check_payment_state(order_skel) Check the payment state from the PaymentProvider API/service Access :attr:`OrderSkel.is_paid` to get the payment state of an order. .. py:method:: return_handler() Frontend Endpoint where the might be redirected to by the payment provider during the payment flow .. py:method:: webhook() API Endpoint (Webhook) to listen for events from payment provider .. py:method:: get_debug_information() Provide information about the payment of an order. Only for debugging purposes. It's not an API endpoint. .. py:class:: PrePayment(*, image_path = None, is_available = None) Bases: :py:obj:`Prepayment` Prepayment 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. .. py:class:: Prepayment(*, image_path = None, is_available = None) Bases: :py:obj:`shop.payment_providers.PaymentProviderAbstract` Prepayment 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. .. py:attribute:: name :type: Final[str] :value: 'prepayment' Define the internal name of the payment provider .. py:method:: checkout(order_skel) .. py:method:: charge(order_skel, payment = None) .. py:method:: check_payment_state(order_skel) Check the payment state from the PaymentProvider API/service Access :attr:`OrderSkel.is_paid` to get the payment state of an order. .. py:method:: return_handler() Frontend Endpoint where the might be redirected to by the payment provider during the payment flow .. py:method:: webhook() API Endpoint (Webhook) to listen for events from payment provider .. py:method:: get_debug_information() Provide information about the payment of an order. Only for debugging purposes. It's not an API endpoint.