Order Management module

Learn more about the Order Management module.

The OrderManagementmodule keeps the Digital River orders and WooCommerce orders in sync by managing the state of the orders.

Specifications

This module is responsible for handling different order lifecycle states. It will also enable users to download and view order invoices for their purchases.

Order Management methods

Order Manager class

This class is the module's entry point.

Order Container class

This class acts as a Dependency Injection container for providing dependencies to classes present in the OrderManagement module.

State Manager class

This class updates the WC_Order status to reflect the corresponding Digital River order status.

Fulfiller class

This class handles automatic order fulfillment.

Invoice Manager class

This class manages order invoices.

State Transition Handler Classes

These three Handler classes are responsible for the order state transition.

State transition classes must implement the StateTransition interface. Optionally, they can also extend theBaseTransition class.

State Transition Interface

interface StateTransition {

    /**
     * Transition the status.
     * Also, perform any intermediate operations during transition.
     *
     * @param \WC_Order $order WC order object.
     *
     * @return void
     */
    public function transit( \WC_Order $order ): void;

    /**
     * Checks whether the current transition is valid or not.
     *
     * @param string    $status_to Status to which transition is happening.
     * @param string    $status_from Status from which transition is happening.
     * @param \WC_Order $order Order object.
     *
     * @return bool
     *
     * @throws Exception For non-accepted transitions.
     */
    public function valid( string $status_to, string $status_from, \WC_Order $order ): bool;
}

Last updated