private function lastRealOrderId()
    {   
        $lastRealOrderId = $this->_objectManager->create('\Magento\Checkout\Model\Session')->getLastRealOrder()->getId();

        if (is_null($lastRealOrderId)) {
            throw new \Exception("There is no order associated with this session.");
        } 
        
        return $lastRealOrderId;
    }