Class: Mollie::Subscription
Direct Known Subclasses
Constant Summary collapse
- STATUS_ACTIVE =
'active'.freeze
- STATUS_PENDING =
Waiting for a valid mandate.
'pending'.freeze
- STATUS_CANCELED =
'canceled'.freeze
- STATUS_SUSPENDED =
Active, but mandate became invalid.
'suspended'.freeze
- STATUS_COMPLETED =
'completed'.freeze
Instance Attribute Summary collapse
-
#_links ⇒ Object
(also: #links)
Returns the value of attribute _links.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#application_fee ⇒ Object
Returns the value of attribute application_fee.
-
#canceled_at ⇒ Object
Returns the value of attribute canceled_at.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#customer_id ⇒ Object
Returns the value of attribute customer_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#mandate_id ⇒ Object
Returns the value of attribute mandate_id.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#method ⇒ Object
Returns the value of attribute method.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#next_payment_date ⇒ Object
Returns the value of attribute next_payment_date.
-
#status ⇒ Object
Returns the value of attribute status.
-
#times ⇒ Object
Returns the value of attribute times.
-
#times_remaining ⇒ Object
Returns the value of attribute times_remaining.
-
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
Attributes inherited from Base
Instance Method Summary collapse
- #active? ⇒ Boolean
- #canceled? ⇒ Boolean
- #completed? ⇒ Boolean
- #customer(options = {}) ⇒ Object
- #payments(options = {}) ⇒ Object
- #pending? ⇒ Boolean
- #suspended? ⇒ Boolean
Methods inherited from Base
all, #assign_attributes, cancel, create, #delete, delete, get, id_param, #initialize, parent_id, request, resource_name, update, #update
Constructor Details
This class inherits a constructor from Mollie::Base
Instance Attribute Details
#_links ⇒ Object Also known as: links
Returns the value of attribute _links.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def _links @_links end |
#amount ⇒ Object
Returns the value of attribute amount.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def amount @amount end |
#application_fee ⇒ Object
Returns the value of attribute application_fee.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def application_fee @application_fee end |
#canceled_at ⇒ Object
Returns the value of attribute canceled_at.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def canceled_at @canceled_at end |
#created_at ⇒ Object
Returns the value of attribute created_at.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def created_at @created_at end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def customer_id @customer_id end |
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def id @id end |
#interval ⇒ Object
Returns the value of attribute interval.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def interval @interval end |
#mandate_id ⇒ Object
Returns the value of attribute mandate_id.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def mandate_id @mandate_id end |
#metadata ⇒ Object
Returns the value of attribute metadata.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def @metadata end |
#method ⇒ Object
Returns the value of attribute method.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def method @method end |
#mode ⇒ Object
Returns the value of attribute mode.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def mode @mode end |
#next_payment_date ⇒ Object
Returns the value of attribute next_payment_date.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def next_payment_date @next_payment_date end |
#status ⇒ Object
Returns the value of attribute status.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def status @status end |
#times ⇒ Object
Returns the value of attribute times.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def times @times end |
#times_remaining ⇒ Object
Returns the value of attribute times_remaining.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def times_remaining @times_remaining end |
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
9 10 11 |
# File 'lib/mollie/subscription.rb', line 9 def webhook_url @webhook_url end |
Instance Method Details
#active? ⇒ Boolean
30 31 32 |
# File 'lib/mollie/subscription.rb', line 30 def active? status == STATUS_ACTIVE end |
#canceled? ⇒ Boolean
42 43 44 |
# File 'lib/mollie/subscription.rb', line 42 def canceled? status == STATUS_CANCELED end |
#completed? ⇒ Boolean
46 47 48 |
# File 'lib/mollie/subscription.rb', line 46 def completed? status == STATUS_COMPLETED end |
#customer(options = {}) ⇒ Object
82 83 84 |
# File 'lib/mollie/subscription.rb', line 82 def customer( = {}) Customer.get(customer_id, ) end |
#payments(options = {}) ⇒ Object
86 87 88 89 90 91 |
# File 'lib/mollie/subscription.rb', line 86 def payments( = {}) resource_url = Util.extract_url(links, 'payments') return if resource_url.nil? response = Mollie::Client.instance.perform_http_call('GET', resource_url, nil, {}, ) Mollie::List.new(response, Mollie::Payment) end |
#pending? ⇒ Boolean
34 35 36 |
# File 'lib/mollie/subscription.rb', line 34 def pending? status == STATUS_PENDING end |
#suspended? ⇒ Boolean
38 39 40 |
# File 'lib/mollie/subscription.rb', line 38 def suspended? status == STATUS_SUSPENDED end |