Class: Increase::Resources::Simulations::CardRefunds

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardRefunds

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

Parameters:



44
45
46
# File 'lib/increase/resources/simulations/card_refunds.rb', line 44

def initialize(client:)
  @client = client
end

Instance Method Details

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

Simulates refunding a card transaction. The full value of the original sandbox transaction is refunded.

Parameters:

  • amount (Integer)

    The refund amount in cents. Pulled off the pending_transaction or the transaction if not provided.

  • pending_transaction_id (String)

    The identifier of the Pending Transaction for the refund authorization. If this is provided, transaction must not be provided as a refund with a refund authorized can not be linked to a regular transaction.

  • transaction_id (String)

    The identifier for the Transaction to refund. The Transaction's source must have a category of card_settlement.

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

Returns:

See Also:



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

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