<?php
/**
 * Created by PhpStorm.
 * User: Zooma
 * Date: 21/09/15
 * Time: 15:58
 */


class Channel_Engine_Order_Complete {


    private $client;

    /**
     * Constructor
     */
    public function __construct($client) {

        $this->client = $client;
        add_action('woocommerce_order_status_completed', array($this,'post_shipment_complete_status') , 0, 1 );
    }

    public function post_shipment_complete_status($wc_order_id){

        require_once(plugin_dir_path(__FILE__) . 'class-channel-engine-api.php');

        $channel_engine_api_client = new Channel_Engine_API($this->client);
        $channel_engine_api_client->post_shipment_complete_status($wc_order_id);
    }

}
<?php
/**
 * Created by PhpStorm.
 * User: Zooma
 * Date: 21/09/15
 * Time: 15:58
 */


class Channel_Engine_Order_Complete {


    private $client;

    /**
     * Constructor
     */
    public function __construct($client) {

        $this->client = $client;
        add_action('woocommerce_order_status_completed', array($this,'post_shipment_complete_status'), 5, 1);
    }

    public function post_shipment_complete_status($wc_order_id){

        require_once(plugin_dir_path(__FILE__) . 'class-channel-engine-api.php');

        $channel_engine_api_client = new Channel_Engine_API($this->client);
        $channel_engine_api_client->post_shipment_complete_status($wc_order_id);
    }

}
Change webhook priority to allow store owners to use the event before us
Change webhook priority to allow store owners to use the event before us
