public function updateOrderStatus()
    {
        $orderUpdated = false;
        $order = $this->getOrder();

        if (!is_null($order)) {
            $orderPayment = $this->getOrderPayment();
            $order = $this->recalculateAmounts($order);
            $newOrderStatus = $this->calculateOrderStatus($orderPayment, $order);
            $this->persistNewOrderStatus($order, $newOrderStatus);
            $orderUpdated = true;
        }

        return $orderUpdated;
    }