class GoCardlessPro::Resources::InstalmentSchedule

Instalment schedules are objects which represent a collection of related payments, with the intention to collect the `total_amount` specified. The API supports both schedule-based creation (similar to subscriptions) as well as explicit selection of differing payment amounts and charge dates.

Unlike subscriptions, the payments are created immediately, so the instalment schedule cannot be modified once submitted and instead can only be cancelled (which will cancel any of the payments which have not yet been submitted).

Customers will receive a single notification about the complete schedule of collection.

Attributes

created_at[R]
currency[R]
id[R]
metadata[R]
name[R]
payment_errors[R]
status[R]
total_amount[R]

Public Class Methods

new(object, response = nil) click to toggle source

Initialize a instalment_schedule resource instance @param object [Hash] an object returned from the API

# File lib/gocardless_pro/resources/instalment_schedule.rb, line 44
def initialize(object, response = nil)
  @object = object

  @created_at = object['created_at']
  @currency = object['currency']
  @id = object['id']
  @links = object['links']
  @metadata = object['metadata']
  @name = object['name']
  @payment_errors = object['payment_errors']
  @status = object['status']
  @total_amount = object['total_amount']
  @response = response
end

Public Instance Methods

api_response() click to toggle source
# File lib/gocardless_pro/resources/instalment_schedule.rb, line 59
def api_response
  ApiResponse.new(@response)
end
to_h() click to toggle source

Provides the instalment_schedule resource as a hash of all its readable attributes

# File lib/gocardless_pro/resources/instalment_schedule.rb, line 69
def to_h
  @object
end