Class: Paymill::Subscription

Inherits:
Base
  • Object
show all
Includes:
Restful::Delete, Restful::Update
Defined in:
lib/paymill/models/subscription.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#app_id, #created_at, #id, #updated_at

Instance Method Summary collapse

Methods included from Restful::Delete

#delete

Methods included from Restful::Update

#update

Methods inherited from Base

#initialize

Methods included from Restful::All

#all

Methods included from Restful::Find

#find

Methods included from Restful::Create

#create

Constructor Details

This class inherits a constructor from Paymill::Base

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



8
9
10
# File 'lib/paymill/models/subscription.rb', line 8

def amount
  @amount
end

#canceled_atObject (readonly)

Returns the value of attribute canceled_at.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def canceled_at
  @canceled_at
end

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def client
  @client
end

#currencyObject

Returns the value of attribute currency.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def currency
  @currency
end

#end_of_periodObject (readonly)

Returns the value of attribute end_of_period.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def end_of_period
  @end_of_period
end

#intervalObject

Returns the value of attribute interval.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def interval
  @interval
end

#is_canceledObject (readonly)

Returns the value of attribute is_canceled.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def is_canceled
  @is_canceled
end

#is_deletedObject (readonly)

Returns the value of attribute is_deleted.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def is_deleted
  @is_deleted
end

#livemodeObject (readonly)

Returns the value of attribute livemode.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def livemode
  @livemode
end

#mandate_referenceObject (readonly)

Returns the value of attribute mandate_reference.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def mandate_reference
  @mandate_reference
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def name
  @name
end

#next_capture_atObject (readonly)

Returns the value of attribute next_capture_at.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def next_capture_at
  @next_capture_at
end

#offerObject

Returns the value of attribute offer.



8
9
10
# File 'lib/paymill/models/subscription.rb', line 8

def offer
  @offer
end

#paymentObject

Returns the value of attribute payment.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def payment
  @payment
end

#period_of_validityObject

Returns the value of attribute period_of_validity.



8
9
10
# File 'lib/paymill/models/subscription.rb', line 8

def period_of_validity
  @period_of_validity
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def status
  @status
end

#temp_amountObject (readonly)

Returns the value of attribute temp_amount.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def temp_amount
  @temp_amount
end

#trial_endObject

Returns the value of attribute trial_end.



8
9
10
# File 'lib/paymill/models/subscription.rb', line 8

def trial_end
  @trial_end
end

#trial_startObject (readonly)

Returns the value of attribute trial_start.



6
7
8
# File 'lib/paymill/models/subscription.rb', line 6

def trial_start
  @trial_start
end

Instance Method Details

#cancelObject



87
88
89
# File 'lib/paymill/models/subscription.rb', line 87

def cancel()
  delete( remove: false )
end

#limit(limit) ⇒ Object



68
69
70
71
72
73
# File 'lib/paymill/models/subscription.rb', line 68

def limit( limit )
  @offer = nil
  @amount = nil
  @period_of_validity = limit
  update()
end

#pauseObject



75
76
77
78
79
# File 'lib/paymill/models/subscription.rb', line 75

def pause()
  @offer = nil
  @amount = nil
  update( pause: true )
end

#playObject



81
82
83
84
85
# File 'lib/paymill/models/subscription.rb', line 81

def play()
  @offer = nil
  @amount = nil
  update( pause: false )
end

#removeObject



91
92
93
# File 'lib/paymill/models/subscription.rb', line 91

def remove()
  delete( remove: true )
end

#stop_trial_periodObject



54
55
56
57
58
59
# File 'lib/paymill/models/subscription.rb', line 54

def stop_trial_period()
  @offer = nil
  @amount = nil
  @trial_end = nil
  update( trial_end: false )
end

#unlimitObject



61
62
63
64
65
66
# File 'lib/paymill/models/subscription.rb', line 61

def unlimit()
  @offer = nil
  @amount = nil
  @period_of_validity = 'remove'
  update()
end

#update_amount_once(amount) ⇒ Object



34
35
36
# File 'lib/paymill/models/subscription.rb', line 34

def update_amount_once( amount )
  update_amount( amount, 0 )
end

#update_amount_permanently(amount) ⇒ Object



38
39
40
# File 'lib/paymill/models/subscription.rb', line 38

def update_amount_permanently( amount )
  update_amount( amount, 1 )
end

#update_offer_with_refund(offer) ⇒ Object



46
47
48
# File 'lib/paymill/models/subscription.rb', line 46

def update_offer_with_refund( offer )
  update_offer( offer, 1 )
end

#update_offer_with_refund_and_capture_date(offer) ⇒ Object



50
51
52
# File 'lib/paymill/models/subscription.rb', line 50

def update_offer_with_refund_and_capture_date( offer )
  update_offer( offer, 2 )
end

#update_offer_without_changes(offer) ⇒ Object



42
43
44
# File 'lib/paymill/models/subscription.rb', line 42

def update_offer_without_changes( offer )
  update_offer( offer, 0 )
end