Class: Increase::Resources::Simulations::CardSettlements

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardSettlements

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

Parameters:



43
44
45
# File 'lib/increase/resources/simulations/card_settlements.rb', line 43

def initialize(client:)
  @client = client
end

Instance Method Details

#create(card_id: , pending_transaction_id: , amount: nil, request_options: {}) ⇒ Increase::Models::Transaction

Some parameter documentations has been truncated, see Models::Simulations::CardSettlementCreateParams for more details.

Simulates the settlement of an authorization by a card acquirer. After a card authorization is created, the merchant will eventually send a settlement. This simulates that event, which may occur many days after the purchase in production. The amount settled can be different from the amount originally authorized, for example, when adding a tip to a restaurant bill.

Parameters:

  • card_id (String)

    The identifier of the Card to create a settlement on.

  • pending_transaction_id (String)

    The identifier of the Pending Transaction for the Card Authorization you wish to

  • amount (Integer)

    The amount to be settled. This defaults to the amount of the Pending Transaction

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

Returns:

See Also:



29
30
31
32
33
34
35
36
37
38
# File 'lib/increase/resources/simulations/card_settlements.rb', line 29

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