Class: Increase::Resources::Cards

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/cards.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Cards

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 Cards.

Parameters:



147
148
149
# File 'lib/increase/resources/cards.rb', line 147

def initialize(client:)
  @client = client
end

Instance Method Details

#create(account_id: , billing_address: nil, description: nil, digital_wallet: nil, entity_id: nil, request_options: {}) ⇒ Increase::Models::Card

Some parameter documentations has been truncated, see Models::CardCreateParams for more details.

Create a Card

Parameters:

Returns:

See Also:



28
29
30
31
# File 'lib/increase/resources/cards.rb', line 28

def create(params)
  parsed, options = Increase::CardCreateParams.dump_request(params)
  @client.request(method: :post, path: "cards", body: parsed, model: Increase::Card, options: options)
end

#details(card_id, request_options: {}) ⇒ Increase::Models::CardDetails

Retrieve sensitive details for a Card

Parameters:

  • card_id (String)

    The identifier of the Card to retrieve details for.

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

Returns:

See Also:



135
136
137
138
139
140
141
142
# File 'lib/increase/resources/cards.rb', line 135

def details(card_id, params = {})
  @client.request(
    method: :get,
    path: ["cards/%1$s/details", card_id],
    model: Increase::CardDetails,
    options: params[:request_options]
  )
end

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

Some parameter documentations has been truncated, see Models::CardListParams for more details.

List Cards

Parameters:

  • account_id (String)

    Filter Cards to ones belonging to the specified Account.

  • created_at (Increase::Models::CardListParams::CreatedAt)
  • cursor (String)

    Return the page of entries after this one.

  • idempotency_key (String)

    Filter records to the one with the specified ‘idempotency_key` you chose for tha

  • limit (Integer)

    Limit the size of the list that is returned. The default (and maximum) is 100 ob

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

Returns:

See Also:



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/increase/resources/cards.rb', line 112

def list(params = {})
  parsed, options = Increase::CardListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "cards",
    query: parsed,
    page: Increase::Internal::Page,
    model: Increase::Card,
    options: options
  )
end

#retrieve(card_id, request_options: {}) ⇒ Increase::Models::Card

Retrieve a Card

Parameters:

  • card_id (String)

    The identifier of the Card.

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

Returns:

See Also:



44
45
46
47
48
49
50
51
# File 'lib/increase/resources/cards.rb', line 44

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

#update(card_id, billing_address: nil, description: nil, digital_wallet: nil, entity_id: nil, status: nil, request_options: {}) ⇒ Increase::Models::Card

Some parameter documentations has been truncated, see Models::CardUpdateParams for more details.

Update a Card

Parameters:

Returns:

See Also:



77
78
79
80
81
82
83
84
85
86
# File 'lib/increase/resources/cards.rb', line 77

def update(card_id, params = {})
  parsed, options = Increase::CardUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["cards/%1$s", card_id],
    body: parsed,
    model: Increase::Card,
    options: options
  )
end