Class: ChargeBee::Subscription

Inherits:
Model
  • Object
show all
Defined in:
lib/chargebee/models/subscription.rb

Defined Under Namespace

Classes: Addon, Coupon, ShippingAddress

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Model

construct, #init_dependant, #init_dependant_list, #initialize, #inspect, #load, #method_missing, #to_s, uri_path

Constructor Details

This class inherits a constructor from ChargeBee::Model

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ChargeBee::Model

Instance Attribute Details

#activated_atObject

Returns the value of attribute activated_at


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def activated_at
  @activated_at
end

#addonsObject

Returns the value of attribute addons


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def addons
  @addons
end

#affiliate_tokenObject

Returns the value of attribute affiliate_token


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def affiliate_token
  @affiliate_token
end

#cancel_reasonObject

Returns the value of attribute cancel_reason


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def cancel_reason
  @cancel_reason
end

#cancelled_atObject

Returns the value of attribute cancelled_at


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def cancelled_at
  @cancelled_at
end

#couponObject

Returns the value of attribute coupon


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def coupon
  @coupon
end

#couponsObject

Returns the value of attribute coupons


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def coupons
  @coupons
end

#created_atObject

Returns the value of attribute created_at


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def created_at
  @created_at
end

#created_from_ipObject

Returns the value of attribute created_from_ip


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def created_from_ip
  @created_from_ip
end

#currency_codeObject

Returns the value of attribute currency_code


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def currency_code
  @currency_code
end

#current_term_endObject

Returns the value of attribute current_term_end


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def current_term_end
  @current_term_end
end

#current_term_startObject

Returns the value of attribute current_term_start


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def current_term_start
  @current_term_start
end

#customer_idObject

Returns the value of attribute customer_id


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def customer_id
  @customer_id
end

#due_invoices_countObject

Returns the value of attribute due_invoices_count


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def due_invoices_count
  @due_invoices_count
end

#due_sinceObject

Returns the value of attribute due_since


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def due_since
  @due_since
end

#has_scheduled_changesObject

Returns the value of attribute has_scheduled_changes


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def has_scheduled_changes
  @has_scheduled_changes
end

#idObject

Returns the value of attribute id


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def id
  @id
end

#invoice_notesObject

Returns the value of attribute invoice_notes


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def invoice_notes
  @invoice_notes
end

#meta_dataObject

Returns the value of attribute meta_data


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def 
  @meta_data
end

#plan_idObject

Returns the value of attribute plan_id


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def plan_id
  @plan_id
end

#plan_quantityObject

Returns the value of attribute plan_quantity


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def plan_quantity
  @plan_quantity
end

#po_numberObject

Returns the value of attribute po_number


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def po_number
  @po_number
end

#remaining_billing_cyclesObject

Returns the value of attribute remaining_billing_cycles


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def remaining_billing_cycles
  @remaining_billing_cycles
end

#shipping_addressObject

Returns the value of attribute shipping_address


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def shipping_address
  @shipping_address
end

#start_dateObject

Returns the value of attribute start_date


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def start_date
  @start_date
end

#started_atObject

Returns the value of attribute started_at


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def status
  @status
end

#total_duesObject

Returns the value of attribute total_dues


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def total_dues
  @total_dues
end

#trial_endObject

Returns the value of attribute trial_end


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def trial_end
  @trial_end
end

#trial_startObject

Returns the value of attribute trial_start


16
17
18
# File 'lib/chargebee/models/subscription.rb', line 16

def trial_start
  @trial_start
end

Class Method Details

.add_charge_at_term_end(id, params, env = nil, headers = {}) ⇒ Object


77
78
79
# File 'lib/chargebee/models/subscription.rb', line 77

def self.add_charge_at_term_end(id, params, env=nil, headers={})
  Request.send('post', uri_path("subscriptions",id.to_s,"add_charge_at_term_end"), params, env, headers)
end

.cancel(id, params = {}, env = nil, headers = {}) ⇒ Object


69
70
71
# File 'lib/chargebee/models/subscription.rb', line 69

def self.cancel(id, params={}, env=nil, headers={})
  Request.send('post', uri_path("subscriptions",id.to_s,"cancel"), params, env, headers)
end

.change_term_end(id, params, env = nil, headers = {}) ⇒ Object


65
66
67
# File 'lib/chargebee/models/subscription.rb', line 65

def self.change_term_end(id, params, env=nil, headers={})
  Request.send('post', uri_path("subscriptions",id.to_s,"change_term_end"), params, env, headers)
end

.charge_addon_at_term_end(id, params, env = nil, headers = {}) ⇒ Object


81
82
83
# File 'lib/chargebee/models/subscription.rb', line 81

def self.charge_addon_at_term_end(id, params, env=nil, headers={})
  Request.send('post', uri_path("subscriptions",id.to_s,"charge_addon_at_term_end"), params, env, headers)
end

.create(params, env = nil, headers = {}) ⇒ Object

OPERATIONS



25
26
27
# File 'lib/chargebee/models/subscription.rb', line 25

def self.create(params, env=nil, headers={})
  Request.send('post', uri_path("subscriptions"), params, env, headers)
end

.create_for_customer(id, params, env = nil, headers = {}) ⇒ Object


29
30
31
# File 'lib/chargebee/models/subscription.rb', line 29

def self.create_for_customer(id, params, env=nil, headers={})
  Request.send('post', uri_path("customers",id.to_s,"subscriptions"), params, env, headers)
end

.delete(id, env = nil, headers = {}) ⇒ Object


85
86
87
# File 'lib/chargebee/models/subscription.rb', line 85

def self.delete(id, env=nil, headers={})
  Request.send('post', uri_path("subscriptions",id.to_s,"delete"), {}, env, headers)
end

.list(params = {}, env = nil, headers = {}) ⇒ Object


33
34
35
# File 'lib/chargebee/models/subscription.rb', line 33

def self.list(params={}, env=nil, headers={})
  Request.send_list_request('get', uri_path("subscriptions"), params, env, headers)
end

.reactivate(id, params = {}, env = nil, headers = {}) ⇒ Object


73
74
75
# File 'lib/chargebee/models/subscription.rb', line 73

def self.reactivate(id, params={}, env=nil, headers={})
  Request.send('post', uri_path("subscriptions",id.to_s,"reactivate"), params, env, headers)
end

.remove_coupons(id, params = {}, env = nil, headers = {}) ⇒ Object


57
58
59
# File 'lib/chargebee/models/subscription.rb', line 57

def self.remove_coupons(id, params={}, env=nil, headers={})
  Request.send('post', uri_path("subscriptions",id.to_s,"remove_coupons"), params, env, headers)
end

.remove_scheduled_cancellation(id, params = {}, env = nil, headers = {}) ⇒ Object


53
54
55
# File 'lib/chargebee/models/subscription.rb', line 53

def self.remove_scheduled_cancellation(id, params={}, env=nil, headers={})
  Request.send('post', uri_path("subscriptions",id.to_s,"remove_scheduled_cancellation"), params, env, headers)
end

.remove_scheduled_changes(id, env = nil, headers = {}) ⇒ Object


49
50
51
# File 'lib/chargebee/models/subscription.rb', line 49

def self.remove_scheduled_changes(id, env=nil, headers={})
  Request.send('post', uri_path("subscriptions",id.to_s,"remove_scheduled_changes"), {}, env, headers)
end

.retrieve(id, env = nil, headers = {}) ⇒ Object


41
42
43
# File 'lib/chargebee/models/subscription.rb', line 41

def self.retrieve(id, env=nil, headers={})
  Request.send('get', uri_path("subscriptions",id.to_s), {}, env, headers)
end

.retrieve_with_scheduled_changes(id, env = nil, headers = {}) ⇒ Object


45
46
47
# File 'lib/chargebee/models/subscription.rb', line 45

def self.retrieve_with_scheduled_changes(id, env=nil, headers={})
  Request.send('get', uri_path("subscriptions",id.to_s,"retrieve_with_scheduled_changes"), {}, env, headers)
end

.subscriptions_for_customer(id, params = {}, env = nil, headers = {}) ⇒ Object


37
38
39
# File 'lib/chargebee/models/subscription.rb', line 37

def self.subscriptions_for_customer(id, params={}, env=nil, headers={})
  Request.send('get', uri_path("customers",id.to_s,"subscriptions"), params, env, headers)
end

.update(id, params = {}, env = nil, headers = {}) ⇒ Object


61
62
63
# File 'lib/chargebee/models/subscription.rb', line 61

def self.update(id, params={}, env=nil, headers={})
  Request.send('post', uri_path("subscriptions",id.to_s), params, env, headers)
end