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:



201
202
203
# File 'lib/increase/resources/cards.rb', line 201

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

#create_details_iframe(card_id, physical_card_id: nil, request_options: {}) ⇒ Increase::Models::CardIframeURL

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

Create an iframe URL for a Card to display the card details. More details about styling and usage can be found in the [documentation](/documentation/embedded-card-component).

Parameters:

  • card_id (String)

    The identifier of the Card to create an iframe for.

  • physical_card_id (String)

    The identifier of the Physical Card to create an iframe for. This will inform th

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

Returns:

See Also:



142
143
144
145
146
147
148
149
150
151
# File 'lib/increase/resources/cards.rb', line 142

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

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

Sensitive details for a Card include the primary account number, expiry, card verification code, and PIN.

Parameters:

  • card_id (String)

    The identifier of the Card to retrieve details for.

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

Returns:

See Also:



165
166
167
168
169
170
171
172
# File 'lib/increase/resources/cards.rb', line 165

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

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

Update a Card’s PIN

Parameters:

  • card_id (String)

    The identifier of the Card to update the PIN for.

  • pin (String)

    The 4-digit PIN for the card, for use with ATMs.

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

Returns:

See Also:



187
188
189
190
191
192
193
194
195
196
# File 'lib/increase/resources/cards.rb', line 187

def update_pin(card_id, params)
  parsed, options = Increase::CardUpdatePinParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["cards/%1$s/update_pin", card_id],
    body: parsed,
    model: Increase::CardDetails,
    options: options
  )
end