Returns the details of a Token Customer. This includes the masked card information
 for displaying in a UI

 @param [Integer] token_customer_id eWAY Token Customer ID to look up.
 @return [QueryCustomerResponse]
164381
def query_customer(token_customer_id)
      @logger.debug('Query customer with id:' + token_customer_id.to_s) if @logger
      unless @is_valid
        return make_response_with_exception(Exceptions::APIKeyInvalidException.new('API key, password or Rapid endpoint missing or invalid'), QueryCustomerResponse)
      end
      begin
        url = @web_url + Constants::DIRECT_CUSTOMER_SEARCH_METHOD + Constants::JSON_SUFFIX
        url = URI.encode(url)

        request = Message::CustomerProcess::QueryCustomerMsgProcess.create_request(token_customer_id.to_s)
        response = Message::CustomerProcess::QueryCustomerMsgProcess.send_request(url, @api_key, @password, @version, request)
        Message::CustomerProcess::QueryCustomerMsgProcess.make_result(response)
      rescue => e
        @logger.error(e.to_s) if @logger
        make_response_with_exception(e, QueryCustomerResponse)
      end
    end
986211
public function deleteCustomer($customer_id)
    {
        list($response, $statusCode, $httpHeader) = $this->deleteCustomerWithHttpInfo ($customer_id);
        return $response; 
    }
1011697
def info(self, token):
        
        _res = dict(zip(['_id', 'type', 'sid', 'exp'],
                        self.split_token(token)))
        if _res['type'] != self.type:
            raise WrongTokenType(_res['type'])
        else:
            _res['handler'] = self
            _res['black_listed'] = self.is_black_listed(token)
            return _res
338061
def stripe_token
      plaid_account = PlaidRails::Account.find(params[:id])
      client = Plaid::Client.new(env: PlaidRails.env,
        client_id: PlaidRails.client_id,
        secret: PlaidRails.secret,
        public_key: PlaidRails.public_key)
      stripe_response = client.processor.stripe.bank_account_token.
        create(plaid_account.access_token, plaid_account.plaid_id)
      bank_account_token = stripe_response['stripe_bank_account_token']
      plaid_account.update(stripe_token: bank_account_token)
      render json: {id: bank_account_token}
    end
953442
def tempo_account_get_all_account_by_customer_id(self, customer_id):
        
        url = 'rest/tempo-accounts/1/account/customer/{customerId}/'.format(customerId=customer_id)
        return self.get(url)
309210
def token_getter(is_personal=True, is_internal=False):
    
    def wrapper(f):
        @wraps(f)
        def decorated(*args, **kwargs):
            if 'token_id' not in kwargs:
                abort(500)

            token = Token.query.filter_by(
                id=kwargs.pop('token_id'),
                user_id=current_user.get_id(),
                is_personal=is_personal,
                is_internal=is_internal,
            ).first()

            if token is None:
                abort(404)

            return f(token, *args, **kwargs)
        return decorated
    return wrapper
1357858
def get_card_suffix(user)
      card_number = nil
      if user.valid_authnet_payment_profile_id && user.authnet_payment_profile_id
        resp = self.gateway.get_customer_payment_profile({
          :customer_profile_id => user.authnet_customer_profile_id.to_i,
          :customer_payment_profile_id => user.authnet_payment_profile_id.to_i
        })            
        if resp.success? && resp.params['payment_profile'] && resp.params['payment_profile']['payment'] && resp.params['payment_profile']['payment']['credit_card'] && resp.params['payment_profile']['payment']['credit_card']['card_number']                         
          card_number = resp.params['payment_profile']['payment']['credit_card']['card_number'].gsub('X', '')         
        end
      end    
      return card_number
    end
1213180
def fetch(self, customer_id, data={}, **kwargs):
        "
        return super(Customer, self).fetch(customer_id, data, **kwargs)
364678
protected function getStripeCustomer($token = null, array $options = [])
    {
        if ($this->owner->stripe_id) {
            $customer = $this->owner->asStripeCustomer();
        } else {
            $customer = $this->owner->createAsStripeCustomer($options);
        }

        if ($token) {
            $this->owner->updateCard($token);
        }

        return $customer;
    }
1175460
def all(self, customer_id, data={}, **kwargs):
        "
        url = "{}/{}/tokens".format(self.base_url, customer_id)
        return self.get_url(url, data, **kwargs)
606384
public function getCardMemberCardDetail($begin_date, $end_date, $card_id)
    {
        $data = ['begin_date' => $begin_date, 'end_date' => $end_date, 'card_id' => $card_id];
        $url = "https://api.weixin.qq.com/datacube/getcardmembercarddetail?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
131199
def card_account
      response = JSON.parse(@client.get("users/#{send(:id)}/card_accounts").body)
      Promisepay::CardAccount.new(@client, response['card_accounts'])
    rescue Promisepay::UnprocessableEntity
      nil
    end
911210
def get_id_from_token(token)
      storage.get_all(tokens_key).each { |id, t| return id if t == token }
      false
    end
350824
def encode_id_token(self, id_token):
        

        # Encode the ID token using the `client_secret`.
        #
        # TODO: Using the `client_secret` is not ideal, since it is transmitted
        # over the wire in some authentication flows.  A better alternative is
        # to use the public key of the issuer, which also allows the ID token to
        # be shared among clients. Doing so however adds some operational
        # costs. We should consider this for the future.

        secret = id_token.access_token.client.client_secret

        return id_token.encode(secret)
191282
def get_user(self, validated_token):
        
        if api_settings.USER_ID_CLAIM not in validated_token:
            # The TokenUser class assumes tokens will have a recognizable user
            # identifier claim.
            raise InvalidToken(_('Token contained no recognizable user identification'))

        return TokenUser(validated_token)
321578
def token_account
      return {} unless token
      if token.respond_to?(:account)
        token.account
      elsif token.kind_of?(Hash) && token['account'].kind_of?(String)
        config.find_account(token['account'])
      else
        {}
      end
    rescue => ex
      error { "Access token refresh exception" }
      error { ex }
      false
    end
930469
public function getStoredCardDetails($token = false)
    {
        if (empty($token) || !is_string($token)) {
            Error::throwError('ip', Error::$errors['orderInput']['token']);
        }

        $response = TokenService::getStoredCardDetails($token);

        if (!isset($response['paymentMethod'])) {
            Error::throwError("apierror");
        }

        return $response['paymentMethod'];
    }