Class: Increase::Resources::Cards

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

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:



217
218
219
# File 'lib/increase/resources/cards.rb', line 217

def initialize(client:)
  @client = client
end

Instance Method Details

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

Create a Card

Parameters:

  • account_id (String)

    The Account the card should belong to.

  • authorization_controls (Increase::Models::CardCreateParams::AuthorizationControls)

    Controls that restrict how this card can be used.

  • billing_address (Increase::Models::CardCreateParams::BillingAddress)

    The card's billing address.

  • description (String)

    The description you choose to give the card.

  • digital_wallet (Increase::Models::CardCreateParams::DigitalWallet)

    The contact information used in the two-factor steps for digital wallet card creation. To add the card to a digital wallet, you may supply an email or phone number with this request. Otherwise, subscribe and then action a Real Time Decision with the category digital_wallet_token_requested or digital_wallet_authentication_requested.

  • entity_id (String)

    The Entity the card belongs to. You only need to supply this in rare situations when the card is not for the Account holder.

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

Returns:

See Also:



35
36
37
38
# File 'lib/increase/resources/cards.rb', line 35

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

Create an iframe URL for a Card to display the card details. More details about styling and usage can be found in the documentation.

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 the appearance of the card rendered in the iframe.

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

Returns:

See Also:



158
159
160
161
162
163
164
165
166
167
# File 'lib/increase/resources/cards.rb', line 158

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:



181
182
183
184
185
186
187
188
# File 'lib/increase/resources/cards.rb', line 181

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>

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 that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about idempotency.

  • limit (Integer)

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

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

Returns:

See Also:



128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/increase/resources/cards.rb', line 128

def list(params = {})
  parsed, options = Increase::CardListParams.dump_request(params)
  query = Increase::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "cards",
    query: query,
    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:



51
52
53
54
55
56
57
58
# File 'lib/increase/resources/cards.rb', line 51

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, authorization_controls: nil, billing_address: nil, description: nil, digital_wallet: nil, entity_id: nil, status: nil, request_options: {}) ⇒ Increase::Models::Card

Update a Card

Parameters:

Returns:

See Also:



90
91
92
93
94
95
96
97
98
99
# File 'lib/increase/resources/cards.rb', line 90

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:



203
204
205
206
207
208
209
210
211
212
# File 'lib/increase/resources/cards.rb', line 203

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