Class: Increase::Resources::Simulations::CardTokens

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

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:



40
41
42
# File 'lib/increase/resources/simulations/card_tokens.rb', line 40

def initialize(client:)
  @client = client
end

Instance Method Details

#create(capabilities: nil, expiration: nil, last4: nil, prefix: nil, primary_account_number_length: nil, request_options: {}) ⇒ Increase::Models::CardToken

Simulates tokenizing a card in the sandbox environment.

Parameters:

  • capabilities (Array<Increase::Models::Simulations::CardTokenCreateParams::Capability>)

    The capabilities of the outbound card token.

  • expiration (Date)

    The expiration date of the card.

  • last4 (String)

    The last 4 digits of the card number.

  • prefix (String)

    The prefix of the card number, usually the first 8 digits.

  • primary_account_number_length (Integer)

    The total length of the card number, including prefix and last4.

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

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
# File 'lib/increase/resources/simulations/card_tokens.rb', line 26

def create(params = {})
  parsed, options = Increase::Simulations::CardTokenCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "simulations/card_tokens",
    body: parsed,
    model: Increase::CardToken,
    options: options
  )
end