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;
    }
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;
    }
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 ; }
Get last real order id

@return string id
Get last real order id