Class: Increase::Resources::Simulations::InterestPayments

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ InterestPayments

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

Parameters:



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

def initialize(client:)
  @client = client
end

Instance Method Details

#create(account_id: , amount: , accrued_on_account_id: nil, period_end: nil, period_start: nil, request_options: {}) ⇒ Increase::Models::Transaction

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

Simulates an interest payment to your account. In production, this happens automatically on the first of each month.

Parameters:

  • account_id (String)

    The identifier of the Account the Interest Payment should be paid to is for.

  • amount (Integer)

    The interest amount in cents. Must be positive.

  • accrued_on_account_id (String)

    The identifier of the Account the Interest accrued on. Defaults to ‘account_id`.

  • period_end (Time)

    The end of the interest period. If not provided, defaults to the current time.

  • period_start (Time)

    The start of the interest period. If not provided, defaults to the current time.

  • 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/interest_payments.rb', line 30

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