Helper/Discount.php
public function getUnirgyGiftCertBalanceByCode($giftcertCode)
    {
        /** @var \Unirgy\Giftcert\Model\Cert $giftCert */
        $unirgyInstance = $this->unirgyCertRepository->getInstance();

        $result = 0;
        if ($unirgyInstance) {
            $giftCert = $unirgyInstance->get($giftcertCode);
            if ($giftCert && $giftCert->getStatus() === 'A' && $giftCert->getBalance() > 0) {
                $result = $giftCert->getBalance();
            }
        }

        return (float) $result;
    }
public function getUnirgyGiftCertBalanceByCode($giftcertCode)
    {
        /** @var \Unirgy\Giftcert\Model\Cert $giftCert */
        $unirgyInstance = $this->unirgyCertRepository->getInstance();

        $result = 0;
        if ($unirgyInstance) {
            $giftCert = $unirgyInstance->get($giftcertCode);
            if ($giftCert && $giftCert->getStatus() === 'A' && $giftCert->getBalance() > 0) {
                $result = $giftCert->getBalance();
            }
        }

        return (float) $result;
    }
public function getUnirgyGiftCertBalanceByCode ( $ giftcertCode ) { /** @var \Unirgy\Giftcert\Model\Cert $giftCert */ $ unirgyInstance = $ this -> unirgyCertRepository -> getInstance ( ) ; $ result = 0 ; if ( $ unirgyInstance ) { $ giftCert = $ unirgyInstance -> get ( $ giftcertCode ) ; if ( $ giftCert && $ giftCert -> getStatus ( ) === 'A' && $ giftCert -> getBalance ( ) > 0 ) { $ result = $ giftCert -> getBalance ( ) ; } } return ( float ) $ result ; }
Get Unirgy_Giftcert balance.

@param $giftcertCode
@return float
@throws \Magento\Framework\Exception\NoSuchEntityException
Get Unirgy_Giftcert balance .