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

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

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:



40
41
42
# File 'lib/increase/resources/simulations/card_refunds.rb', line 40

def initialize(client:)
  @client = client
end

Instance Method Details

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

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

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 `transac

  • pending_transaction_id (String)

    The identifier of the Pending Transaction for the refund authorization. If this

  • transaction_id (String)

    The identifier for the Transaction to refund. The Transaction’s source must have

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

Returns:

See Also:



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

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