Get a gift card by the id

@param string $giftCardId The gift card ID
@param Recurly_Client $client Optional client for the request, useful for mocking the client
@return object Recurly_Resource or null
@throws Recurly_Error
424134
public static function get($giftCardId, $client = null) {
    return Recurly_Base::_get(Recurly_GiftCard::uriForGiftCard($giftCardId), $client);
  }
672492
public function createNewCreditCard(CreditCard $creditCard, $id = null)
    {
        if (! $id) {
            $id = $this->data->id;
        }

        $creditCard->setContext(Moip::PAYMENT);

        $this->data = new stdClass;
        $this->data->method = 'CREDIT_CARD';
        $this->data->creditCard = $creditCard->getData();

        $response = $this->client->post('{id}/fundinginstruments', [$id], $this->data);

        $this->populate($response);

        return $this;
    }
815046
public function getPublicKey($client_id = '0')
    {

        $result = $this->client->getItem(array(
            "TableName"=> $this->config['public_key_table'],
            "Key" => array('client_id'   => array('S' => $client_id))
        ));
        if ($result->count()==0) {
            return false ;
        }
        $token = $this->dynamo2array($result);

        return $token['public_key'];

    }
648992
public function sendWxcard($toUser, $card_id, array $card_ext = array())
    {
        $ret = array();
        $ret['touser'] = $toUser;
        $ret['msgtype'] = 'wxcard';
        $ret['wxcard']['card_id'] = $card_id;
        if (! empty($card_ext)) {
            $ret['wxcard']['card_ext'] = json_encode($card_ext);
        }
        return $this->send($ret);
    }
559008
public function client($client = null)
    {
        if (!func_num_args()) {
            return $this->_client;
        }
        $this->_client = $client;
        return $this;
    }
494868
def get_recurring_bill_by_client(self, *, customer_id, date_begin=None, date_final=None):
        
        params = {
            "customerId": customer_id,
        }
        if date_begin and date_final:
            params['dateBegin'] = date_begin.strftime('%Y-%m-%d')
            params['dateFinal'] = date_final.strftime('%Y-%m-%d')
        return self.client._get(self.url + 'recurringBill', params=params, headers=self.get_headers())
1243436
public function cloneAmastyGiftCards($sourceQuoteId, $destinationQuoteId)
    {
        if (! $this->isAmastyGiftCardAvailable()) {
            return;
        }
        $connection = $this->resource->getConnection();
        $connection->beginTransaction();
        try {
            $giftCardTable = $this->resource->getTableName('amasty_amgiftcard_quote');

            // Clear previously applied gift cart codes from the immutable quote
            $sql = "DELETE FROM {$giftCardTable} WHERE quote_id = :destination_quote_id";
            $connection->query($sql, ['destination_quote_id' => $destinationQuoteId]);

            // Copy all gift cart codes applied to the parent quote to the immutable quote
            $sql = "INSERT INTO {$giftCardTable} (quote_id, code_id, account_id, base_gift_amount, code) 
                    SELECT :destination_quote_id, code_id, account_id, base_gift_amount, code
                    FROM {$giftCardTable} WHERE quote_id = :source_quote_id";
            $connection->query($sql, ['destination_quote_id' => $destinationQuoteId, 'source_quote_id' => $sourceQuoteId]);

            $connection->commit();
        } catch (\Zend_Db_Statement_Exception $e) {
            $connection->rollBack();
            $this->bugsnag->notifyException($e);
        }
    }
1155300
public function getCard($id)
    {
        return $this->auth(function () use ($id) {
            $data = json_encode([
                'card_id' => $id,
            ]);

            return $this->http->postJson($this->baseUrl . 'card/get?access_token=' . $this->accessToken, $data);
        });
    }
1281758
public function getRecipient(int $id): Recipient
    {
        if (!\array_key_exists($id, $this->recipients)) {
            throw new \InvalidArgumentException('The recipient does not exist.');
        }

        return $this->recipients[$id];
    }
1322328
public function getClientUser($client_id, $user_id)
    {
        $sql = 'SELECT * from %s where client_id = :client_id and user_id = :user_id';
        $sql = sprintf($sql, $this->config['client_user_table']);

        return $this->fetch($sql, compact('client_id', 'user_id'));
    }
856280
public function getAmastyGiftCardCodesCurrentValue($giftCardCodes)
    {
        $data = $this->amastyAccountCollection
            ->getInstance()
            ->joinCode()
            ->addFieldToFilter('gift_code', ['in'=>$giftCardCodes])
            ->getData();

        return array_sum(array_column($data, 'current_value'));
    }
313748
def create_card
      raise StandardError, 'Cliente null' if @client.nil?
      # la instancia de card recibe como parametro el @client al que se le va asociar la tarjeta
      card = PayuLatam::Card.new(@client)
      # hay un metodo card_params que genera el objeto a enviar con los datos correctos
      # se asignan los params correctos para la peticion
      card.params.merge! card_params

      # intento de creacion de tarjeta
      card.create!
      # si todo bien
      if card.success?
        # se llena la variable @card con la instancia de la clase PayuLatam::Card
        @card = card

        # no me acuerdo XD
        @client.remove_cards
        
        # se agrega la tarjeta al array de tarjetas del usuario. Ojo este array esta en memoria no necesariamente
        # es el mismo array de payu
        @client.add_card( card.response )

        # la respuesta de creacion de payu solo incluye el token de la tarjeta, entonces
        # volvemos a consultar la info almacenada en payu para recibier un poco mas de detalle y almacenarlo
        _card = card.load(card.response['token'])
        # se crea un registro de payu_card con la info publica de la tarjeta y el token de payu de la tarjeta
        @current_user.payu_cards.create(token: @card.response['token'], last_4: _card['number'], brand: _card['type'])
      else
        raise StandardError, "Error generando token de tarjeta: #{card.error}"
      end
    end
967183
public function checkClientCredentials($client_id, $client_secret = null)
    {
        $result = $this->collection('client_table')->findOne(array('client_id' => $client_id));

        return $result['client_secret'] == $client_secret;
    }
35491
def fetch_by_client_id(self, client_id):
        
        if client_id not in self.clients:
            raise ClientNotFoundError

        return self.clients[client_id]
634602
protected function checkClientCredentials($clientId, $clientSecret = null)
    {
        if (null === $application = $this->app['repo.api-applications']->findByClientId($clientId)) {
            return false;
        }

        if (null === $clientSecret) {
            return true;
        }

        return $application->getClientSecret() === $clientSecret;
    }
964951
public function getCard($cardID)
    {
        $tokenContext = new TokenContext("", 'get');
        $token = $this->accessTokenProvider->getToken($tokenContext);

        $responseModel = $this->cardClient->getCard($cardID, (string)$token);
        if ($responseModel instanceof ErrorResponseModel) {
            throw new CardClientException(
                "error response from card service", $responseModel->getCode(), $responseModel->getMessage()
            );
        }

        $card = $this->parseRawCard($responseModel->getRawSignedModel(), $responseModel->isOutdated());

        if (!$this->cardVerifier->verifyCard($card)) {
            throw new CardVerificationException('Validation errors have been detected');
        }

        return $card;
    }
106518
public function getCard($cardID, $token)
    {
        $httpResponse = $this->httpClient->send(
            new GetHttpRequest(
                sprintf("%s/card/v5/%s", $this->serviceUrl, $cardID),
                null,
                ["Authorization" => sprintf("Virgil %s", $token)]
            )
        );

        if (!$httpResponse->getHttpStatusCode()
                          ->isSuccess()) {
            return $this->parseErrorResponse($httpResponse->getBody());
        }

        $rawSignedModel = RawSignedModel::RawSignedModelFromJson($httpResponse->getBody());

        return new ResponseModel($httpResponse->getHeaders(), $rawSignedModel);
    }