protected function getPartiallyRefundedOrders()
    {
        $pagseguroOrdersIdArray = array();

        $connection = $this->getConnection();
        $select = $connection->select()
            ->from( ['ps' => $this->getPrefixTableName('pagseguro_orders')], ['order_id'] )
            ->where('ps.partially_refunded = ?', '1');

        if ($this->_scopeConfig->getValue('payment/pagseguro/environment')) {
            $select = $select->where('ps.environment = ?', $this->_scopeConfig->getValue('payment/pagseguro/environment'));
        }

        $connection->prepare($select);

        foreach ($connection->fetchAll($select) as $value) {
            $pagseguroOrdersIdArray[] = $value['order_id'];
        }

        return $pagseguroOrdersIdArray;
    }