Requires magento object & Base order to be loaded globally

@param string $mageOrderId

@throws \Exception
504907
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();
    }
617171
protected function prepareOrderComponentsAccountOrder(array &$order)
    {
        $this->setItemOrderCartComponent($order, $this->price);
        $this->setItemOrderPriceRuleComponent($order, $this->price, $this->price_rule);
        $this->setItemOrderPaymentComponent($order, $this->price, $this->payment, $this->order);
        $this->setItemOrderShippingComponent($order, $this->price, $this->shipping, $this->order);

        ksort($order['data']['components']);
    }
1181004
public function createOrderCouponsByCartCoupons(OrderOnCreatedEvent $event)
    {
        $this
            ->cartCouponToOrderTransformer
            ->createOrderCouponsByCartCoupons(
                $event->getCart(),
                $event->getOrder()
            );
    }
1326346
protected function _cancelOrder()
    {
         if ($this->_order->getId()) {
            // Only save order that's in this magento store
            $this->_order->cancel()->save();
        } else {
            // The order is not in this magento store, simply set state of this empty order to cancel
            $this->_order->setState(Mage_Sales_Model_Order::STATE_CANCELED);
        }
        return $this;
    }
1067717
public function initHasSortOrder()
    {
        $this->fillable = array_merge($this->fillable, $this->hasSortOrderFillableFields);
        $this->casts = array_merge($this->casts, $this->hasSortOrderCastFields);
    }
1308274
public function checkRequired()
    {
        foreach ($this->required as $attribute) {
            throw_if(! collect($this->attributes)->offsetExists($attribute),
                FieldRequiredAttributeException::class, $attribute);
        }

        return $this;
    }
57029
public static com.liferay.commerce.model.CommerceOrder createCommerceOrder(
		long commerceOrderId) {
		return getService().createCommerceOrder(commerceOrderId);
	}
668040
public function PaymentOrderCancel($paymentOrderId, $amount, $currency)
    {
        $request = new Request();
        $request->setMethod('POST');

        foreach (array('paymentOrderId', 'amount', 'currency') as $param) {
            if (null == $$param) {
                throw new InvalidArgumentException($param);
            }
        }

        $params = array(
            'PaymentOrderId' => $paymentOrderId,
            'CancelAmount'   => $amount,
            'Currency'       => $currency
        );

        $request->setContent(json_encode($params));

        return $this->doRequest('PaymentOrder/Cancel', $request)->getContentJson();
    }
759804
public function execute()
    {
        try {
            $nofitication = new \UOL\PagSeguro\Model\NotificationMethod(
                $this->_objectManager->create('\Magento\Framework\App\Config\ScopeConfigInterface'),
                $this->_objectManager->create('\Magento\Sales\Api\OrderRepositoryInterface'),
                $this->_objectManager->create('\Magento\Sales\Api\Data\OrderStatusHistoryInterface'),
                $this->_objectManager->create('Magento\Framework\Module\ModuleList'),
                $this->_objectManager->create('\Magento\Framework\Model\ResourceModel\Db\Context')
            );
            $nofitication->init();
        } catch (\Exception $ex) {
            //log already written in your pagseguro log file if pagseguro log is enabled in admin
            exit;
        }
    }
1164830
public function setDefaultOrder($column, $order = self::ORDER_ASC): void
    {
        $this->defaultOrder = [$column => $order];
    }
963564
@Override
	public List<CommerceOrderItem> findByCommerceOrderId(long commerceOrderId) {
		return findByCommerceOrderId(commerceOrderId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
136485
protected function setOrder($order_id)
    {
        $this->data_order = array();

        if (is_numeric($order_id)) {

            $this->data_order = $this->order->get($order_id);

            if (empty($this->data_order)) {
                $this->outputHttpStatus(404);
            }

            $this->order_history->setViewed($this->data_order);
            $this->prepareOrder($this->data_order);
        }
    }
1231726
public function setOrder(\Core\Entity\Order $order = null) {
        $this->order = $order;

        return $this;
    }
483583
public function cancel($purchaseOrderId, $order)
    {
        if(!is_numeric($purchaseOrderId)){
            throw new \Exception("purchaseOrderId must be numeric",1448480746);
        }

        $schema = [
            '/orderCancellation' => [
                'namespace' => 'ns3',
                'childNamespace' => 'ns3',
            ],
            '/orderCancellation/orderLines' => [
                'sendItemsAs' => 'orderLine',
            ],
            '/orderCancellation/orderLines/orderLine/orderLineStatuses' => [
                'sendItemsAs' => 'orderLineStatus',
            ],
            '@namespaces' => [
                'ns3' => 'http://walmart.com/mp/v3/orders'
            ],
        ];

        $a2x = new A2X($order, $schema);
        $xml = $a2x->asXml();
        
        return $this->cancelOrder([
            'purchaseOrderId' => $purchaseOrderId,
            'order' => $xml,
        ]);
    }
1120345
public function setIntegrationOrderDetailInfoArr(array $IntegrationOrderDetailInfoArr)
    {
        foreach ($IntegrationOrderDetailInfoArr as $integrationOrderDetailInfo) {
            if (!$integrationOrderDetailInfo instanceof IntegrationOrderDetailInfo) {
                throw new Exception('Invalid IntegrationOrderDetailInfo');
            }
        }
        $this->IntegrationOrderDetailInfoArr = $IntegrationOrderDetailInfoArr;
    }
50033
@Override
	public com.liferay.commerce.model.CommerceOrder createCommerceOrder(
		long commerceOrderId) {
		return _commerceOrderLocalService.createCommerceOrder(commerceOrderId);
	}
1001998
public Orderer newOrderer(String name, String grpcURL) throws InvalidArgumentException {
        clientCheck();
        return newOrderer(name, grpcURL, null);
    }