Class: Increase::Resources::Simulations::CardIncrements

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardIncrements

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

Parameters:



41
42
43
# File 'lib/increase/resources/simulations/card_increments.rb', line 41

def initialize(client:)
  @client = client
end

Instance Method Details

#create(amount:, card_payment_id:, event_subscription_id: nil, request_options: {}) ⇒ Increase::Models::CardPayment

Simulates the increment of an authorization by a card acquirer. An authorization can be incremented multiple times.

Parameters:

  • amount (Integer)

    The amount of the increment in minor units in the card authorization's currency.

  • card_payment_id (String)

    The identifier of the Card Payment to create an increment on.

  • event_subscription_id (String)

    The identifier of the Event Subscription to use. If provided, will override the default real time event subscription. Because you can only create one real time decision event subscription, you can use this field to route events to any specified event subscription for testing purposes.

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

Returns:

See Also:



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

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