original_string: 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()
                  ]
              ]
          ]);
      }
code: 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()
                  ]
              ]
          ]);
      }
code_tokens: 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 ( ) ] ] ] ) ; }
docstring: Generates payload for order completed events
  
  @param Models\Order $order
  @throws Exception
  @return array
docstring_tokens: Generates payload for order completed events