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
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 41 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.
30 31 32 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 30 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.
32 33 34 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 32 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
33 34 35 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 33 def @metadata end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
34 35 36 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 34 def name @name end |
#payment_errors ⇒ Object (readonly)
Returns the value of attribute payment_errors.
35 36 37 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 35 def payment_errors @payment_errors end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
36 37 38 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 36 def status @status end |
#total_amount ⇒ Object (readonly)
Returns the value of attribute total_amount.
37 38 39 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 37 def total_amount @total_amount end |
Instance Method Details
#api_response ⇒ Object
56 57 58 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 56 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
61 62 63 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 61 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
66 67 68 |
# File 'lib/gocardless_pro/resources/instalment_schedule.rb', line 66 def to_h @object end |