shop.payment_providers.abstract =============================== .. py:module:: shop.payment_providers.abstract Attributes ---------- .. autoapisummary:: shop.payment_providers.abstract.logger Classes ------- .. autoapisummary:: shop.payment_providers.abstract.PaymentProviderAbstract Module Contents --------------- .. py:data:: logger .. 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