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

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

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.



45
46
47
# File 'lib/increase/resources/simulations/card_settlements.rb', line 45

def initialize(client:)
  @client = client
end

Instance Method Details

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

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.



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

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