class Mollie::Subscription
Constants
- STATUS_ACTIVE
- STATUS_CANCELED
- STATUS_COMPLETED
- STATUS_PENDING
- STATUS_SUSPENDED
Attributes
Public Instance Methods
Source
# File lib/mollie/subscription.rb, line 30 def active? status == STATUS_ACTIVE end
Source
# File lib/mollie/subscription.rb, line 66 def amount=(amount) @amount = Mollie::Amount.new(amount) end
Source
# File lib/mollie/subscription.rb, line 97 def application_fee=(application_fee) amount = Amount.new(application_fee['amount']) description = application_fee['description'] @application_fee = OpenStruct.new( amount: amount, description: description ) end
Source
# File lib/mollie/subscription.rb, line 42 def canceled? status == STATUS_CANCELED end
Source
# File lib/mollie/subscription.rb, line 58 def canceled_at=(canceled_at) @canceled_at = begin Time.parse(canceled_at.to_s) rescue StandardError nil end end
Source
# File lib/mollie/subscription.rb, line 46 def completed? status == STATUS_COMPLETED end
Source
# File lib/mollie/subscription.rb, line 50 def created_at=(created_at) @created_at = begin Time.parse(created_at.to_s) rescue StandardError nil end end
Source
# File lib/mollie/subscription.rb, line 82 def customer(options = {}) Customer.get(customer_id, options) end
Source
# File lib/mollie/subscription.rb, line 93 def metadata=(metadata) @metadata = OpenStruct.new(metadata) if metadata.is_a?(Hash) end
Source
# File lib/mollie/subscription.rb, line 74 def next_payment_date=(next_payment_date) @next_payment_date = begin Date.parse(next_payment_date) rescue StandardError nil end end
Source
# File lib/mollie/subscription.rb, line 86 def payments(options = {}) resource_url = Util.extract_url(links, 'payments') return if resource_url.nil? response = Mollie::Client.instance.perform_http_call('GET', resource_url, nil, {}, options) Mollie::List.new(response, Mollie::Payment) end
Source
# File lib/mollie/subscription.rb, line 34 def pending? status == STATUS_PENDING end
Source
# File lib/mollie/subscription.rb, line 38 def suspended? status == STATUS_SUSPENDED end
Source
# File lib/mollie/subscription.rb, line 70 def times=(times) @times = times.to_i end