Class: GoCardlessPro::Resources::Mandate
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::Mandate
- Defined in:
- lib/gocardless_pro/resources/mandate.rb
Overview
Mandates represent the Direct Debit mandate with a [customer](#core-endpoints-customers).
GoCardless will notify you via a [webhook](#appendix-webhooks) whenever the status of a mandate changes.
Defined Under Namespace
Classes: Links
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#next_possible_charge_date ⇒ Object
readonly
Returns the value of attribute next_possible_charge_date.
-
#payments_require_approval ⇒ Object
readonly
Returns the value of attribute payments_require_approval.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ Mandate
constructor
Initialize a mandate resource instance.
-
#links ⇒ Object
Return the links that the resource has.
-
#to_h ⇒ Object
Provides the mandate resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ Mandate
Initialize a mandate resource instance
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 32 def initialize(object, response = nil) @object = object @created_at = object['created_at'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] @next_possible_charge_date = object['next_possible_charge_date'] @payments_require_approval = object['payments_require_approval'] @reference = object['reference'] @scheme = object['scheme'] @status = object['status'] @response = response end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
21 22 23 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 21 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
22 23 24 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 22 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
23 24 25 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 23 def @metadata end |
#next_possible_charge_date ⇒ Object (readonly)
Returns the value of attribute next_possible_charge_date.
24 25 26 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 24 def next_possible_charge_date @next_possible_charge_date end |
#payments_require_approval ⇒ Object (readonly)
Returns the value of attribute payments_require_approval.
25 26 27 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 25 def payments_require_approval @payments_require_approval end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
26 27 28 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 26 def reference @reference end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
27 28 29 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 27 def scheme @scheme end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
28 29 30 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 28 def status @status end |
Instance Method Details
#api_response ⇒ Object
47 48 49 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 47 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
52 53 54 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 52 def links @mandate_links ||= Links.new(@links) end |
#to_h ⇒ Object
Provides the mandate resource as a hash of all its readable attributes
57 58 59 |
# File 'lib/gocardless_pro/resources/mandate.rb', line 57 def to_h @object end |