Class: GoCardlessPro::Resources::InstalmentSchedule
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::InstalmentSchedule
- Defined in:
- lib/gocardless_pro/resources/instalment_schedule.rb
Overview
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.
Defined Under Namespace
Classes: Links
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#payment_errors ⇒ Object
readonly
Returns the value of attribute payment_errors.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#total_amount ⇒ Object
readonly
Returns the value of attribute total_amount.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ InstalmentSchedule
constructor
Initialize a instalment_schedule resource instance.
-
#links ⇒ Object
Return the links that the resource has.
-
#to_h ⇒ Object
Provides the instalment_schedule resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ InstalmentSchedule
Initialize a instalment_schedule resource instance
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 35 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 |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
31 32 33 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 31 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
31 32 33 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 31 def currency @currency end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
31 32 33 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 31 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
31 32 33 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 31 def @metadata end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 31 def name @name end |
#payment_errors ⇒ Object (readonly)
Returns the value of attribute payment_errors.
31 32 33 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 31 def payment_errors @payment_errors end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
31 32 33 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 31 def status @status end |
#total_amount ⇒ Object (readonly)
Returns the value of attribute total_amount.
31 32 33 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 31 def total_amount @total_amount end |
Instance Method Details
#api_response ⇒ Object
50 51 52 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 50 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
55 56 57 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 55 def links @instalment_schedule_links ||= Links.new(@links) end |
#to_h ⇒ Object
Provides the instalment_schedule resource as a hash of all its readable attributes
60 61 62 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 60 def to_h @object end |