Helper/Discount.php
public function loadAmastyGiftCard($code)
    {
        try {
            if (!$this->isAmastyGiftCardAvailable()) {
                return null;
            }

            $accountModel = $this->amastyAccountFactory->getInstance()
                ->create()
                ->loadByCode($code);
            return $accountModel && $accountModel->getId() ? $accountModel : null;
        } catch (\Exception $e) {
            return null;
        }
    }
public function loadAmastyGiftCard($code)
    {
        try {
            if (!$this->isAmastyGiftCardAvailable()) {
                return null;
            }

            $accountModel = $this->amastyAccountFactory->getInstance()
                ->create()
                ->loadByCode($code);
            return $accountModel && $accountModel->getId() ? $accountModel : null;
        } catch (\Exception $e) {
            return null;
        }
    }
public function loadAmastyGiftCard ( $ code ) { try { if ( ! $ this -> isAmastyGiftCardAvailable ( ) ) { return null ; } $ accountModel = $ this -> amastyAccountFactory -> getInstance ( ) -> create ( ) -> loadByCode ( $ code ) ; return $ accountModel && $ accountModel -> getId ( ) ? $ accountModel : null ; } catch ( \ Exception $ e ) { return null ; } }
Load Amasty Gift Card account object.
@param string $code Gift Card coupon code
@return \Amasty\GiftCard\Model\Account|null
Load Amasty Gift Card account object .