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

Returns a new instance of CardSettlements.



7
8
9
# File 'lib/increase/resources/simulations/card_settlements.rb', line 7

def initialize(client:)
  @client = client
end

Instance Method Details

#create(params = {}, opts = {}) ⇒ 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.

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :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 settle.

  • :amount (Integer)

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

Returns:



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

def create(params = {}, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/simulations/card_settlements"
  req[:body] = params
  req[:model] = Increase::Models::Transaction
  @client.request(req, opts)
end