Class: Increase::Resources::CardDetails

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardDetails

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

Parameters:



80
81
82
# File 'lib/increase/resources/card_details.rb', line 80

def initialize(client:)
  @client = client
end

Instance Method Details

#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](/documentation/embedded-card-component).

Parameters:

  • card_id (String)

    The identifier of the Card to retrieve details for.

  • physical_card_id (String)

    The identifier of the Physical Card to retrieve details for.

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

Returns:

See Also:



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

def create_details_iframe(card_id, params = {})
  parsed, options = Increase::CardDetailCreateDetailsIframeParams.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::CardDetailsAPI

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:



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

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

#update(card_id, pin: , request_options: {}) ⇒ Increase::Models::CardDetailsAPI

Update a Card’s PIN

Parameters:

  • card_id (String)

    The card identifier.

  • pin (String)

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

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

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
# File 'lib/increase/resources/card_details.rb', line 19

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