Class: Increase::Resources::Simulations::CardAuthentications

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardAuthentications

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

Parameters:



106
107
108
# File 'lib/increase/resources/simulations/card_authentications.rb', line 106

def initialize(client:)
  @client = client
end

Instance Method Details

#challenge_attempts(card_payment_id, one_time_code:, request_options: {}) ⇒ Increase::Models::CardPayment

Simulates an attempt at a Card Authentication Challenge. This updates the card_authentications object under the Card Payment. You can also attempt the challenge by navigating to https://dashboard.increase.com/card_authentication_simulation/:card_payment_id.

Parameters:

  • card_payment_id (String)

    The identifier of the Card Payment to be challenged.

  • one_time_code (String)

    The one-time code to be validated.

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

Returns:

See Also:



67
68
69
70
71
72
73
74
75
76
# File 'lib/increase/resources/simulations/card_authentications.rb', line 67

def challenge_attempts(card_payment_id, params)
  parsed, options = Increase::Simulations::CardAuthenticationChallengeAttemptsParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["simulations/card_authentications/%1$s/challenge_attempts", card_payment_id],
    body: parsed,
    model: Increase::CardPayment,
    options: options
  )
end

#challenges(card_payment_id, request_options: {}) ⇒ Increase::Models::CardPayment

Simulates starting a Card Authentication Challenge for an existing Card Authentication. This updates the card_authentications object under the Card Payment. To attempt the challenge, use the /simulations/card_authentications/:card_payment_id/challenge_attempts endpoint or navigate to https://dashboard.increase.com/card_authentication_simulation/:card_payment_id.

Parameters:

  • card_payment_id (String)

    The identifier of the Card Payment to be challenged.

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

Returns:

See Also:



94
95
96
97
98
99
100
101
# File 'lib/increase/resources/simulations/card_authentications.rb', line 94

def challenges(card_payment_id, params = {})
  @client.request(
    method: :post,
    path: ["simulations/card_authentications/%1$s/challenges", card_payment_id],
    model: Increase::CardPayment,
    options: params[:request_options]
  )
end

#create(card_id:, category: nil, device_channel: nil, merchant_acceptor_id: nil, merchant_category_code: nil, merchant_country: nil, merchant_name: nil, purchase_amount: nil, request_options: {}) ⇒ Increase::Models::CardPayment

Simulates a Card Authentication attempt on a Card. The attempt always results in a Card Payment being created, either with a status that allows further action or a terminal failed status.

Parameters:

  • card_id (String)

    The identifier of the Card to be authorized.

  • category (Symbol, Increase::Models::Simulations::CardAuthenticationCreateParams::Category)

    The category of the card authentication attempt.

  • device_channel (Symbol, Increase::Models::Simulations::CardAuthenticationCreateParams::DeviceChannel)

    The device channel of the card authentication attempt.

  • merchant_acceptor_id (String)

    The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.

  • merchant_category_code (String)

    The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.

  • merchant_country (String)

    The country the merchant resides in.

  • merchant_name (String)

    The name of the merchant

  • purchase_amount (Integer)

    The purchase amount in cents.

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

Returns:

See Also:



40
41
42
43
44
45
46
47
48
49
# File 'lib/increase/resources/simulations/card_authentications.rb', line 40

def create(params)
  parsed, options = Increase::Simulations::CardAuthenticationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "simulations/card_authentications",
    body: parsed,
    model: Increase::CardPayment,
    options: options
  )
end