public function fetchRefund($refundId)
    {
        if ($this->offsetExists('refunds')) {
            foreach ($this['refunds'] as $refund) {
                if ($refund->getId() !== $refundId) {
                    continue;
                }

                return $refund;
            }
        }

        $refund = new Refund($this->connector, $this->getLocation(), $refundId);
        $refund->fetch();

        $this['refunds'][] = $refund;

        return $refund;
    }
public function fetchRefund($refundId)
    {
        if ($this->offsetExists('refunds')) {
            foreach ($this['refunds'] as $refund) {
                if ($refund->getId() !== $refundId) {
                    continue;
                }

                return $refund;
            }
        }

        $refund = new Refund($this->connector, $this->getLocation(), $refundId);
        $refund->fetch();

        $this['refunds'][] = $refund;

        return $refund;
    }
public function fetchRefund ( $ refundId ) { if ( $ this -> offsetExists ( 'refunds' ) ) { foreach ( $ this [ 'refunds' ] as $ refund ) { if ( $ refund -> getId ( ) !== $ refundId ) { continue ; } return $ refund ; } } $ refund = new Refund ( $ this -> connector , $ this -> getLocation ( ) , $ refundId ) ; $ refund -> fetch ( ) ; $ this [ 'refunds' ] [ ] = $ refund ; return $ refund ; }
Fetches the specified refund.

@param string $refundId Refund ID

@see Refund::fetch() For more information on how to fetch a refund

@throws ConnectorException        When the API replies with an error response
@throws RequestException          When an error is encountered
@throws \RuntimeException         On an unexpected API response
@throws \RuntimeException         If the response content type is not JSON
@throws \InvalidArgumentException If the JSON cannot be parsed
@throws \LogicException           When Guzzle cannot populate the response

@return Refund
Fetches the specified refund .