shop.modules.order ================== .. py:module:: shop.modules.order Attributes ---------- .. autoapisummary:: shop.modules.order.logger Classes ------- .. autoapisummary:: shop.modules.order.Order Module Contents --------------- .. py:data:: logger .. py:class:: Order(moduleName = None, modulePath = None, shop = None, *args, **kwargs) Bases: :py:obj:`shop.modules.abstract.ShopModuleAbstract`, :py:obj:`viur.core.prototypes.List` Abstract Class for all viur-shop sub/nested modules. The implementations should set `moduleName` as class variable, so the final module name for routing it not affected by the name of custom classes. .. py:attribute:: moduleName :value: 'order' .. py:attribute:: kindName :value: '{{viur_shop_modulename}}_order' .. py:attribute:: reference_user_created_skeletons_in_session :value: True If True, keys of skeletons that the current user has created will be stored in the session. .. py:method:: adminInfo() .. py:property:: current_session_order_key :type: viur.core.db.Key | None .. py:property:: current_order_skel :type: viur.shop.types.SkeletonInstance_T[shop.skeletons.order.OrderSkel] | None .. py:method:: canView(skel) .. py:method:: payment_providers_list(only_available = True) Get a list of payment providers. This method returns a JSON response containing a dictionary of payment providers. The keys represent provider identifiers, and the values are instances of `PaymentProviderResult` (dict) containing the details of each provider. :param only_available: If ``True`` (default), only payment providers that are currently available will be included in the response. If ``False``, all providers will be listed regardless of availability. :return: A JSON response with a dictionary of payment providers. .. py:method:: get_payment_providers(only_available = True) .. py:method:: order_get(order_key) .. py:method:: order_add(cart_key, payment_provider = SENTINEL, billing_address_key = SENTINEL, customer_key = SENTINEL, state_ordered = SENTINEL, state_paid = SENTINEL, state_rts = SENTINEL, **kwargs) .. py:method:: order_update(order_key, payment_provider = SENTINEL, billing_address_key = SENTINEL, customer_key = SENTINEL, state_ordered = SENTINEL, state_paid = SENTINEL, state_rts = SENTINEL, **kwargs) .. py:method:: _order_set_values(skel, *, payment_provider = SENTINEL, billing_address_key = SENTINEL, customer_key = SENTINEL, state_ordered = SENTINEL, state_paid = SENTINEL, state_rts = SENTINEL) .. py:method:: customer_is_valid(order_skel, customer_key) Checks if the given customer is a valid customer for this skel. The customer must be the same user or an root user. .. py:method:: checkout_start(order_key) Start the checkout process. Requires no errors in :meth:`self.can_checkout`. .. py:method:: can_checkout(order_skel) .. py:method:: freeze_order(order_skel) .. py:method:: _default_assign_uid(order_skel) Default order assign id method. Called as default/fallback for :attr:`Hook.ORDER_ASSIGN_UID`. .. py:method:: checkout_order(order_key) The final order now step. Requires no errors in :meth:`self.can_order`. .. py:method:: can_order(order_skel) .. py:method:: set_checkout_in_progress(order_skel) Set an order to the state *is_checkout_in_progress* .. py:method:: set_ordered(order_skel, payment) Set an order to the state *ordered* .. py:method:: set_paid(order_skel) Set an order to the state *paid* .. py:method:: set_rts(order_skel) Set an order to the state *Ready to ship* .. py:method:: additional_order_add(skel, /, **kwargs) Hook method called by :meth:`order_add` before the skeleton is saved. This method can be overridden in a subclass to implement additional API fields or make further modifications to the order skeleton (`skel`). By default, it raises an exception if unexpected arguments (``kwargs``) are provided and returns the unchanged `skel` object. :param skel: The current instance of the order skeleton. :param kwargs: Additional optional arguments for extended implementations. :raises TooManyArgumentsException: If unexpected arguments are passed in ``kwargs``. :return: The (potentially modified) order skeleton. .. py:method:: additional_order_update(skel, /, **kwargs) Hook method called by :meth:`order_update` before the skeleton is saved. This method can be overridden in a subclass to implement additional API fields or make further modifications to the order skeleton (`skel`). By default, it raises an exception if unexpected arguments (``kwargs``) are provided and returns the unchanged `skel` object. :param skel: The current instance of the order skeleton. :param kwargs: Additional optional arguments for extended implementations. :raises TooManyArgumentsException: If unexpected arguments are passed in ``kwargs``. :return: The (potentially modified) order skeleton. .. py:method:: get_payment_provider_by_name(payment_provider_name)