Class: Increase::Resources::CardTokens

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/card_tokens.rb,
sig/increase/resources/card_tokens.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardTokens

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CardTokens.

Parameters:



81
82
83
# File 'lib/increase/resources/card_tokens.rb', line 81

def initialize(client:)
  @client = client
end

Instance Method Details

#capabilities(card_token_id, request_options: {}) ⇒ Increase::Models::CardTokenCapabilities

The capabilities of a Card Token describe whether the card can be used for specific operations, such as Card Push Transfers. The capabilities can change over time based on the issuing bank's configuration of the card range.

Parameters:

  • card_token_id (String)

    The identifier of the Card Token.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



69
70
71
72
73
74
75
76
# File 'lib/increase/resources/card_tokens.rb', line 69

def capabilities(card_token_id, params = {})
  @client.request(
    method: :get,
    path: ["card_tokens/%1$s/capabilities", card_token_id],
    model: Increase::CardTokenCapabilities,
    options: params[:request_options]
  )
end

#list(created_at: nil, cursor: nil, limit: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::CardToken>

List Card Tokens

Parameters:

Returns:

See Also:



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/increase/resources/card_tokens.rb', line 43

def list(params = {})
  parsed, options = Increase::CardTokenListParams.dump_request(params)
  query = Increase::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "card_tokens",
    query: query,
    page: Increase::Internal::Page,
    model: Increase::CardToken,
    options: options
  )
end

#retrieve(card_token_id, request_options: {}) ⇒ Increase::Models::CardToken

Retrieve a Card Token

Parameters:

  • card_token_id (String)

    The identifier of the Card Token.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



17
18
19
20
21
22
23
24
# File 'lib/increase/resources/card_tokens.rb', line 17

def retrieve(card_token_id, params = {})
  @client.request(
    method: :get,
    path: ["card_tokens/%1$s", card_token_id],
    model: Increase::CardToken,
    options: params[:request_options]
  )
end