public function getOrderCompleted(Models\Order $order)
    {
        if (!$order->hasProducts()) {
            throw new \Exception('$order should have at least one product');
        }

        return $this->getTrackPayload(ActionTypes::ORDER_COMPLETED, [
            PayloadProperties::PROPERTIES => [
                [
                    PayloadProperties::ORDER_TOTAL_PRICE => $order->getOrderTotal(),
                    PayloadProperties::PRODUCTS => $order->toArray()
                ]
            ]
        ]);
    }
public function getOrderCompleted(Models\Order $order)
    {
        if (!$order->hasProducts()) {
            throw new \Exception('$order should have at least one product');
        }

        return $this->getTrackPayload(ActionTypes::ORDER_COMPLETED, [
            PayloadProperties::PROPERTIES => [
                [
                    PayloadProperties::ORDER_TOTAL_PRICE => $order->getOrderTotal(),
                    PayloadProperties::PRODUCTS => $order->toArray()
                ]
            ]
        ]);
    }
public function getOrderCompleted ( Models \ Order $ order ) { if ( ! $ order -> hasProducts ( ) ) { throw new \ Exception ( '$order should have at least one product' ) ; } return $ this -> getTrackPayload ( ActionTypes :: ORDER_COMPLETED , [ PayloadProperties :: PROPERTIES => [ [ PayloadProperties :: ORDER_TOTAL_PRICE => $ order -> getOrderTotal ( ) , PayloadProperties :: PRODUCTS => $ order -> toArray ( ) ] ] ] ) ; }
Generates payload for order completed events

@param Models\Order $order
@throws Exception
@return array
Generates payload for order completed events