Class: ChargeBee::Subscription

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

Defined Under Namespace

Classes: Addon, Coupon, ReferralInfo, 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.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def activated_at
  @activated_at
end

#addonsObject

Returns the value of attribute addons.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def addons
  @addons
end

#affiliate_tokenObject

Returns the value of attribute affiliate_token.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def affiliate_token
  @affiliate_token
end

#auto_collectionObject

Returns the value of attribute auto_collection.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def auto_collection
  @auto_collection
end

#base_currency_codeObject

Returns the value of attribute base_currency_code.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def base_currency_code
  @base_currency_code
end

#billing_periodObject

Returns the value of attribute billing_period.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def billing_period
  @billing_period
end

#billing_period_unitObject

Returns the value of attribute billing_period_unit.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def billing_period_unit
  @billing_period_unit
end

#cancel_reasonObject

Returns the value of attribute cancel_reason.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def cancel_reason
  @cancel_reason
end

#cancelled_atObject

Returns the value of attribute cancelled_at.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def cancelled_at
  @cancelled_at
end

#couponObject

Returns the value of attribute coupon.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def coupon
  @coupon
end

#couponsObject

Returns the value of attribute coupons.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def coupons
  @coupons
end

#created_atObject

Returns the value of attribute created_at.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def created_at
  @created_at
end

#created_from_ipObject

Returns the value of attribute created_from_ip.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def created_from_ip
  @created_from_ip
end

#currency_codeObject

Returns the value of attribute currency_code.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def currency_code
  @currency_code
end

#current_term_endObject

Returns the value of attribute current_term_end.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def current_term_end
  @current_term_end
end

#current_term_startObject

Returns the value of attribute current_term_start.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def current_term_start
  @current_term_start
end

#customer_idObject

Returns the value of attribute customer_id.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def customer_id
  @customer_id
end

#deletedObject

Returns the value of attribute deleted.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def deleted
  @deleted
end

#due_invoices_countObject

Returns the value of attribute due_invoices_count.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def due_invoices_count
  @due_invoices_count
end

#due_sinceObject

Returns the value of attribute due_since.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def due_since
  @due_since
end

#exchange_rateObject

Returns the value of attribute exchange_rate.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def exchange_rate
  @exchange_rate
end

#has_scheduled_changesObject

Returns the value of attribute has_scheduled_changes.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def has_scheduled_changes
  @has_scheduled_changes
end

#idObject

Returns the value of attribute id.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def id
  @id
end

#invoice_notesObject

Returns the value of attribute invoice_notes.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def invoice_notes
  @invoice_notes
end

#meta_dataObject

Returns the value of attribute meta_data.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def 
  
end

#mrrObject

Returns the value of attribute mrr.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def mrr
  @mrr
end

#next_billing_atObject

Returns the value of attribute next_billing_at.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def next_billing_at
  @next_billing_at
end

#payment_source_idObject

Returns the value of attribute payment_source_id.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def payment_source_id
  @payment_source_id
end

#plan_free_quantityObject

Returns the value of attribute plan_free_quantity.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def plan_free_quantity
  @plan_free_quantity
end

#plan_idObject

Returns the value of attribute plan_id.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def plan_id
  @plan_id
end

#plan_quantityObject

Returns the value of attribute plan_quantity.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def plan_quantity
  @plan_quantity
end

#plan_unit_priceObject

Returns the value of attribute plan_unit_price.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def plan_unit_price
  @plan_unit_price
end

#po_numberObject

Returns the value of attribute po_number.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def po_number
  @po_number
end

#referral_infoObject

Returns the value of attribute referral_info.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def referral_info
  @referral_info
end

#remaining_billing_cyclesObject

Returns the value of attribute remaining_billing_cycles.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def remaining_billing_cycles
  @remaining_billing_cycles
end

#resource_versionObject

Returns the value of attribute resource_version.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def resource_version
  @resource_version
end

#setup_feeObject

Returns the value of attribute setup_fee.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def setup_fee
  @setup_fee
end

#shipping_addressObject

Returns the value of attribute shipping_address.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def shipping_address
  @shipping_address
end

#start_dateObject

Returns the value of attribute start_date.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def start_date
  @start_date
end

#started_atObject

Returns the value of attribute started_at.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def status
  @status
end

#total_duesObject

Returns the value of attribute total_dues.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def total_dues
  @total_dues
end

#trial_endObject

Returns the value of attribute trial_end.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def trial_end
  @trial_end
end

#trial_startObject

Returns the value of attribute trial_start.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def trial_start
  @trial_start
end

#updated_atObject

Returns the value of attribute updated_at.



20
21
22
# File 'lib/chargebee/models/subscription.rb', line 20

def updated_at
  @updated_at
end

Class Method Details

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



83
84
85
# File 'lib/chargebee/models/subscription.rb', line 83

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



75
76
77
# File 'lib/chargebee/models/subscription.rb', line 75

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



71
72
73
# File 'lib/chargebee/models/subscription.rb', line 71

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



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

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

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



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

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

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

OPERATIONS




31
32
33
# File 'lib/chargebee/models/subscription.rb', line 31

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



35
36
37
# File 'lib/chargebee/models/subscription.rb', line 35

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



107
108
109
# File 'lib/chargebee/models/subscription.rb', line 107

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

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



99
100
101
# File 'lib/chargebee/models/subscription.rb', line 99

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

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



95
96
97
# File 'lib/chargebee/models/subscription.rb', line 95

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

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



39
40
41
# File 'lib/chargebee/models/subscription.rb', line 39

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

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



103
104
105
# File 'lib/chargebee/models/subscription.rb', line 103

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

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



79
80
81
# File 'lib/chargebee/models/subscription.rb', line 79

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



63
64
65
# File 'lib/chargebee/models/subscription.rb', line 63

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



59
60
61
# File 'lib/chargebee/models/subscription.rb', line 59

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



55
56
57
# File 'lib/chargebee/models/subscription.rb', line 55

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



47
48
49
# File 'lib/chargebee/models/subscription.rb', line 47

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



51
52
53
# File 'lib/chargebee/models/subscription.rb', line 51

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



43
44
45
# File 'lib/chargebee/models/subscription.rb', line 43

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



67
68
69
# File 'lib/chargebee/models/subscription.rb', line 67

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