public function createAndSave($mageOrderId)
    {
        $order = $this->orderFactory->create()
            ->setOrderId($mageOrderId)
            ->setStoreId($this->config->getStoreViewId())
            ->setShopgateOrderNumber($this->sgOrder->getOrderNumber())
            ->setIsShippingBlocked($this->sgOrder->getIsShippingBlocked())
            ->setIsPaid($this->sgOrder->getIsPaid())
            ->setIsTest($this->sgOrder->getIsTest())
            ->setIsCustomerInvoiceBlocked($this->sgOrder->getIsCustomerInvoiceBlocked());

        try {
            $order->setReceivedData(\Zend_Json_Encoder::encode($this->sgOrder->toArray()));
        } catch (\InvalidArgumentException $exception) {
            $this->sgLogger->error($exception->getMessage());
        }
        $order->save();
    }
public function createAndSave($mageOrderId)
    {
        $order = $this->orderFactory->create()
            ->setOrderId($mageOrderId)
            ->setStoreId($this->config->getStoreViewId())
            ->setShopgateOrderNumber($this->sgOrder->getOrderNumber())
            ->setIsShippingBlocked($this->sgOrder->getIsShippingBlocked())
            ->setIsPaid($this->sgOrder->getIsPaid())
            ->setIsTest($this->sgOrder->getIsTest())
            ->setIsCustomerInvoiceBlocked($this->sgOrder->getIsCustomerInvoiceBlocked());

        try {
            $order->setReceivedData(\Zend_Json_Encoder::encode($this->sgOrder->toArray()));
        } catch (\InvalidArgumentException $exception) {
            $this->sgLogger->error($exception->getMessage());
        }
        $order->save();
    }
public function createAndSave ( $ mageOrderId ) { $ order = $ this -> orderFactory -> create ( ) -> setOrderId ( $ mageOrderId ) -> setStoreId ( $ this -> config -> getStoreViewId ( ) ) -> setShopgateOrderNumber ( $ this -> sgOrder -> getOrderNumber ( ) ) -> setIsShippingBlocked ( $ this -> sgOrder -> getIsShippingBlocked ( ) ) -> setIsPaid ( $ this -> sgOrder -> getIsPaid ( ) ) -> setIsTest ( $ this -> sgOrder -> getIsTest ( ) ) -> setIsCustomerInvoiceBlocked ( $ this -> sgOrder -> getIsCustomerInvoiceBlocked ( ) ) ; try { $ order -> setReceivedData ( \ Zend_Json_Encoder :: encode ( $ this -> sgOrder -> toArray ( ) ) ) ; } catch ( \ InvalidArgumentException $ exception ) { $ this -> sgLogger -> error ( $ exception -> getMessage ( ) ) ; } $ order -> save ( ) ; }
Requires magento object & Base order to be loaded globally

@param string $mageOrderId

@throws \Exception
Requires magento object & Base order to be loaded globally