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

Returns a new instance of InterestPayments.



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

def initialize(client:)
  @client = client
end

Instance Method Details

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

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

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):

  • :account_id (String)

    The identifier of the Account Number the Interest Payment is for.

  • :amount (Integer)

    The interest amount in cents. Must be positive.

  • :period_end (String)

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

  • :period_start (String)

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

Returns:



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

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