Class: Increase::Resources::Simulations::CardReversals

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardReversals

Returns a new instance of CardReversals.



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

def initialize(client:)
  @client = client
end

Instance Method Details

#create(params = {}, opts = {}) ⇒ Increase::Models::CardPayment

Simulates the reversal of an authorization by a card acquirer. An authorization can be partially reversed multiple times, up until the total authorized amount. Marks the pending transaction as complete if the authorization is fully reversed.

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_payment_id (String)

    The identifier of the Card Payment to create a reversal on.

  • :amount (Integer)

    The amount of the reversal in minor units in the card authorization's currency. This defaults to the authorization amount.

Returns:



24
25
26
27
28
29
30
31
# File 'lib/increase/resources/simulations/card_reversals.rb', line 24

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