chargebee 2.8.0 → 2.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5313e0ccaa457855df52b89719c4363d56b9abc7b49597a6824ed063a69ab8d3
4
- data.tar.gz: a1ce4600484c5fdcb7b8d529d36f542ea0d42c2bcb0288b7d6b350bd1770c8ba
3
+ metadata.gz: b333712c66ffa98e25335aa2dd0d257a14dd084f597b394f0e80d0bdeee39c1c
4
+ data.tar.gz: 6ced89dbe2cc28abf11298f454889528a4a56a3f1f634d494a3265382521ae64
5
5
  SHA512:
6
- metadata.gz: fdfe10f1f88fb45542eebf6944795be482697039c91898e11d6c4bab77b7e3fdef25d9eaa0c3e38a6aeb9c491303859755a19fb7452796f0c76e36e38a760496
7
- data.tar.gz: e61978f0038d899e713f0d0e6820212e4042ec262d73fa5e58dc3b4a3b4f3ed3c3c158da632216279de26161989bea026a895e9d27d43c1d2e19fe4feb6ffb20
6
+ metadata.gz: fa308ee3a14f85bea5e343e4ddaee714359d69967cc774a1d1a308f36b6eaab08b6900015489e8bbc832c441174ebe20852beb31bfec5b4b21bdd955c0608b8f
7
+ data.tar.gz: ff63da2192c8229791bb0beb50c9fedb7a573670eb5ce280e9d02d62040c100146f787b47999c0a494568ac7930b0dc61c0999d8c308fff0b458d218b7b7b787
data/CHANGELOG.md CHANGED
@@ -1,3 +1,93 @@
1
+ ### v2.8.5 (2021-02-04)
2
+ * * *
3
+ * fixed: missing requires for Product Catalog V2 resources.
4
+
5
+ ### v2.8.4 (2021-01-20)
6
+ * * *
7
+ * Ruby Library-URL encoding Issue - bugfix
8
+ ### v2.8.3 (2021-01-19)
9
+ * * *
10
+ ##### New resources:
11
+ * Usages is added. Applicable only for Product Catalog V2
12
+
13
+ ##### New end points:
14
+ * hosted_pages#checkout_one-time_payments has been added in hosted_pages resource
15
+
16
+ ##### New attributes:
17
+ * auto_close_invoices has been added to customers, subscriptions resources
18
+ * metered, usage_calculation have been added to items resources
19
+ * create_pending_invoices, auto_close_invoices have been added to subscriptions resources
20
+
21
+ ##### New parameters:
22
+ * auto_close_invoices has been added to the endpoint: customers#create_a_customer, customers#list_customers, customers#update_a_customer
23
+ * invoice_allocations[invoice_id] has been added to the endpoint: customers#collect_payment_for_customer
24
+ * coupon_ids has been added to the endpoint: estimates#create_invoice_for_items_estimate. Applicable only for Product Catalog V2
25
+ * subscription[auto_close_invoices] has been added to the endpoint: exports#export_revenue_recognition_reports, exports#export_deferred_revenue_reports, exports#export_subscriptions
26
+ * customer[auto_close_invoices] has been added to the endpoint: exports#export_revenue_recognition_reports, exports#export_deferred_revenue_reports, exports#export_customers
27
+ * item[metered], item[usage_calculation] have been added to the endpoint: exports#export_items. Applicable only for Product Catalog V2
28
+ * subscription_id has been added to the endpoint: invoices#add_one-time_charge_to_a_pending_invoice, invoices#add_non-recurring_addon_to_a_pending_invoice
29
+ * subscription_id has been added to the endpoint: invoices#add_a_charge-item_to_a_pending_invoice. Applicable only for Product Catalog V2
30
+ * metered, usage_calculation have been added to the endpoint: items#create_an_item, items#list_item. Applicable only for Product Catalog V2
31
+ * create_pending_invoices, auto_close_invoices, first_invoice_pending have been added to the endpoint: subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items,subscriptions#import_subscription_for_items. Applicable only for Product Catalog V2
32
+ * create_pending_invoices, auto_close_invoices have been added to the endpoint: subscriptions#list_subscriptions
33
+
34
+ ### v2.8.2 (2020-12-15)
35
+ * * *
36
+ ##### New end points:
37
+ * estimate_for_creating_a_customer_and_subscription, cancel_subscription_for_items_estimate, gift_subscription_estimate_for_items have been added in estimate resource. Applicable only for Product Catalog V2
38
+ * regenerate_invoice_estimate has been added in estimate resource
39
+ * create_a_gift_subscription_for_items has been added in gift resource. Applicable only for Product Catalog V2
40
+ * regenerate_invoice has been added in subscription resource
41
+
42
+ ##### New attributes:
43
+ * show_description_in_invoices, show_description_in_quotes have been added to the resource item_prices
44
+ * tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal] have been added to the resource differential_prices
45
+ * show_description_in_invoices, show_description_in_quotes have been added to the resource item_prices. Applicable only for Product Catalog V2
46
+
47
+ ##### New parameters:
48
+ * payment_intent[additional_info] has been added to the endpoints customers#create_a_customer, invoices#create_an_invoice, payment_sources#create_using_payment_intent, subscriptions#create_a_subscription, subscriptions#update_a_subscription, subscriptions#create_subscription_for_customer, subscriptions#reactivate_a_subscription, subscriptions#resume_a_subscription
49
+ * payment_intent[additional_info] has been added to the endpoints gifts#create_a_gift_subscription_for_items, invoices#create_invoice_for_items_and_one-time_charges, subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items. Applicable only for Product Catalog V2
50
+ * contract_term[action_at_term_end], contract_term[cancellation_cutoff_period], subscription[contract_term_billing_cycle_on_renewal] has been added to the endpoint estimates#estimate_for_creating_a_subscription. Applicable only for Product Catalog V2
51
+ * cancel_at, contract_term_cancel_option, cancel_reason_code have been added to the endpoint estimates#cancel_subscription_for_items_estimate
52
+ * event_based_addons has been added to the endpoint estimates#cancel_subscription_for_items_estimate
53
+ * redirect_url has been added to the endpoint hosted_pages#accept_a_quote
54
+ * token_id, retain_payment_source, card, bank_account, payment_method added have been added to the endpoint invoices#create_an_invoice
55
+ * token_id, retain_payment_source, card, bank_account, payment_method added have been added to the endpoint invoices#create_invoice_for_items_and_one-time_charges. Applicable only for Product Catalog V2
56
+ * show_description_in_invoices, show_description_in_quotes have been added to the endpoints item_prices#create_an_item_price, item_prices#update_an_item_price. Applicable only for Product Catalog V2
57
+
58
+ ### v2.8.1 (2020-11-26)
59
+ * * *
60
+ ##### New resources:
61
+ item_family, item, item_price, attached_item and differential_price are added. Applicable only for Product Catalog V2
62
+
63
+ ##### New end points:
64
+ * coupons#create_a_coupon_for_items and coupons#update_a_coupon_for_items have been added in coupon resource. Applicable only for Product Catalog V2
65
+ * estimates#estimate_for_creating_a_subscription, estimates#estimate_for_updating_a_subscription and estimates#create_invoice_for_items_estimate have been added in estimate resource. Applicable only for Product Catalog V2
66
+ * estimates#advance_invoice_estimate has been added in estimate resource
67
+ * exports#export_item_families, exports#export_items, exports#export_item_prices, exports#export_attached_items and exports#export_differential_price have been added in export api. Applicable only for Product Catalog V2
68
+ * checkout_new_for_items and checkout_existing_for_items have been added in hosted_pages api. Applicable only for Product Catalog V2
69
+ * invoices#create_invoice_for_items_and_one-time_charges, invoices#create_invoice_for_a_charge-item and invoices#add_a_charge-item_to_a_pending_invoice have been added in invoice resource. Applicable only for Product Catalog V2
70
+ * quotes#create_a_quote_for_a_new_subscription_items, quotes#create_a_quote_for_update_subscription_items and quotes#create_a_quote_for_charge_and_charge_items have been added in quote resource. Applicable only for Product Catalog V2
71
+ * subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items, subscriptions#import_subscription_for_items and subscriptions#cancel_subscription_for_items have been added in subscription resource. Applicable only for Product Catalog V2
72
+ * subscriptions#edit_advance_invoice_schedule, subscriptions#retrieve_advance_invoice and subscriptions#remove_an_advance_invoice_schedules have been added in subscription resource
73
+ * unbilled_charges#create_an_invoice_for_unbilled_charges has been added to unbilled_charge resource
74
+
75
+ ##### New attributes:
76
+ * item_constraints and item_constraint_criteria have been added in coupon resource. Applicable only for Product Catalog V2
77
+ * success_url and failure_url have been added in payment_intent resource
78
+ * subscription_items and item_tiers have been added in quoted_subscription resource. Applicable only for Product Catalog V2
79
+ * has_scheduled_advance_invoices has been added in subscription resource
80
+ * subscription_items, item_tiers and charged_items have been added in subscription resource. Applicable only for Product Catalog V2
81
+
82
+ ##### New parameters:
83
+ * item_id and item_price_id have been added to the end point: subscriptions#list_subscriptions, exports#export_revenue_recognition_reports, exports#export_deferred_revenue_reports, exports#export_subscriptions. Applicable only for Product Catalog V2
84
+ * invoice_immediately, schedule_type and fixed_interval_schedule have been added to the end point: subscriptions#charge_future_renewals
85
+ * success_url and failure_url have been added to the end points: payment_intents#create_a_payment_intent, payment_intents#update_a_payment_intent
86
+
87
+ ##### New Enum values:
88
+ * PLAN_ITEM_PRICE, ADDON_ITEM_PRICE, CHARGE_ITEM_PRICE are added to Entitytype Enum
89
+ * ITEM_FAMILY_CREATED, ITEM_FAMILY_UPDATED, ITEM_FAMILY_DELETED, ITEM_CREATED, ITEM_UPDATED, ITEM_DELETED, ITEM_PRICE_CREATED, ITEM_PRICE_UPDATED, ITEM_PRICE_DELETED, ATTACHED_ITEM_CREATED, ATTACHED_ITEM_UPDATED, ATTACHED_ITEM_DELETED, DIFFERENTIAL_PRICE_CREATED, DIFFERENTIAL_PRICE_UPDATED, DIFFERENTIAL_PRICE_DELETED are added to EventType Enum
90
+
1
91
  ### v2.8.0 (2020-11-16)
2
92
  * * *
3
93
  * New attributes price_in_decimal, tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal] have been added to the resource addon
@@ -1733,4 +1823,4 @@ Support for creating plans & addons on the fly via API.
1733
1823
 
1734
1824
  * API to fetch multiple subscriptions of a customer.
1735
1825
 
1736
- * Added support to get the list of events filtered by event type. Events can be fetched based on the event type eg., payment_succeeded.
1826
+ * Added support to get the list of events filtered by event type. Events can be fetched based on the event type eg., payment_succeeded.
data/chargebee.gemspec CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
  s.required_ruby_version = '>= 1.9.3'
6
6
  s.name = 'chargebee'
7
- s.version = '2.8.0'
8
- s.date = '2020-11-16'
7
+ s.version = '2.8.5'
8
+ s.date = '2021-02-04'
9
9
 
10
10
  s.summary = "Ruby client for Chargebee API."
11
11
  s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com."
@@ -41,6 +41,7 @@ Gem::Specification.new do |s|
41
41
  lib/chargebee/models/addon.rb
42
42
  lib/chargebee/models/address.rb
43
43
  lib/chargebee/models/advance_invoice_schedule.rb
44
+ lib/chargebee/models/attached_item.rb
44
45
  lib/chargebee/models/card.rb
45
46
  lib/chargebee/models/comment.rb
46
47
  lib/chargebee/models/contact.rb
@@ -51,6 +52,7 @@ Gem::Specification.new do |s|
51
52
  lib/chargebee/models/credit_note.rb
52
53
  lib/chargebee/models/credit_note_estimate.rb
53
54
  lib/chargebee/models/customer.rb
55
+ lib/chargebee/models/differential_price.rb
54
56
  lib/chargebee/models/download.rb
55
57
  lib/chargebee/models/estimate.rb
56
58
  lib/chargebee/models/event.rb
@@ -60,6 +62,9 @@ Gem::Specification.new do |s|
60
62
  lib/chargebee/models/hosted_page.rb
61
63
  lib/chargebee/models/invoice.rb
62
64
  lib/chargebee/models/invoice_estimate.rb
65
+ lib/chargebee/models/item.rb
66
+ lib/chargebee/models/item_family.rb
67
+ lib/chargebee/models/item_price.rb
63
68
  lib/chargebee/models/model.rb
64
69
  lib/chargebee/models/order.rb
65
70
  lib/chargebee/models/payment_intent.rb
@@ -79,6 +84,7 @@ Gem::Specification.new do |s|
79
84
  lib/chargebee/models/token.rb
80
85
  lib/chargebee/models/transaction.rb
81
86
  lib/chargebee/models/unbilled_charge.rb
87
+ lib/chargebee/models/usage.rb
82
88
  lib/chargebee/models/virtual_bank_account.rb
83
89
  lib/chargebee/request.rb
84
90
  lib/chargebee/rest.rb
data/lib/chargebee.rb CHANGED
@@ -44,10 +44,16 @@ require File.dirname(__FILE__) + '/chargebee/models/quote'
44
44
  require File.dirname(__FILE__) + '/chargebee/models/contact.rb'
45
45
  require File.dirname(__FILE__) + '/chargebee/models/hierarchy.rb'
46
46
  require File.dirname(__FILE__) + '/chargebee/models/payment_intent.rb'
47
+ require File.dirname(__FILE__) + '/chargebee/models/attached_item.rb'
48
+ require File.dirname(__FILE__) + '/chargebee/models/differential_price.rb'
49
+ require File.dirname(__FILE__) + '/chargebee/models/item.rb'
50
+ require File.dirname(__FILE__) + '/chargebee/models/item_family.rb'
51
+ require File.dirname(__FILE__) + '/chargebee/models/item_price.rb'
52
+ require File.dirname(__FILE__) + '/chargebee/models/usage.rb'
47
53
 
48
54
  module ChargeBee
49
55
 
50
- VERSION = '2.8.0'
56
+ VERSION = '2.8.5'
51
57
 
52
58
  @@default_env = nil
53
59
  @@verify_ca_certs = true
@@ -0,0 +1,35 @@
1
+ module ChargeBee
2
+ class AttachedItem < Model
3
+
4
+ attr_accessor :id, :parent_item_id, :item_id, :type, :status, :quantity, :billing_cycles, :charge_on_event,
5
+ :charge_once, :created_at, :resource_version, :updated_at
6
+
7
+ # OPERATIONS
8
+ #-----------
9
+
10
+ def self.create(id, params, env=nil, headers={})
11
+ Request.send('post', uri_path("items",id.to_s,"attached_items"), params, env, headers)
12
+ end
13
+
14
+ def self.update(id, params, env=nil, headers={})
15
+ Request.send('post', uri_path("attached_items",id.to_s), params, env, headers)
16
+ end
17
+
18
+ def self.retrieve(id, params, env=nil, headers={})
19
+ Request.send('get', uri_path("attached_items",id.to_s), params, env, headers)
20
+ end
21
+
22
+ def self.delete(id, params, env=nil, headers={})
23
+ Request.send('post', uri_path("attached_items",id.to_s,"delete"), params, env, headers)
24
+ end
25
+
26
+ def self.list(id, params={}, env=nil, headers={})
27
+ Request.send_list_request('get', uri_path("items",id.to_s,"attached_items"), params, env, headers)
28
+ end
29
+
30
+ def self.list_internal(params={}, env=nil, headers={})
31
+ Request.send('get', uri_path("attached_items","list_internal"), params, env, headers)
32
+ end
33
+
34
+ end # ~AttachedItem
35
+ end # ~ChargeBee
@@ -1,11 +1,19 @@
1
1
  module ChargeBee
2
2
  class Coupon < Model
3
3
 
4
+ class ItemConstraint < Model
5
+ attr_accessor :item_type, :constraint, :item_price_ids
6
+ end
7
+
8
+ class ItemConstraintCriteria < Model
9
+ attr_accessor :item_type, :currencies, :item_family_ids, :item_price_periods
10
+ end
11
+
4
12
  attr_accessor :id, :name, :invoice_name, :discount_type, :discount_percentage, :discount_amount,
5
13
  :discount_quantity, :currency_code, :duration_type, :duration_month, :valid_till, :max_redemptions,
6
14
  :status, :apply_discount_on, :apply_on, :plan_constraint, :addon_constraint, :created_at, :archived_at,
7
- :resource_version, :updated_at, :included_in_mrr, :plan_ids, :addon_ids, :redemptions, :invoice_notes,
8
- :meta_data
15
+ :resource_version, :updated_at, :included_in_mrr, :plan_ids, :addon_ids, :item_constraints,
16
+ :item_constraint_criteria, :redemptions, :invoice_notes, :meta_data
9
17
 
10
18
  # OPERATIONS
11
19
  #-----------
@@ -14,6 +22,14 @@ module ChargeBee
14
22
  Request.send('post', uri_path("coupons"), params, env, headers)
15
23
  end
16
24
 
25
+ def self.create_for_items(params, env=nil, headers={})
26
+ Request.send('post', uri_path("coupons","create_for_items"), params, env, headers)
27
+ end
28
+
29
+ def self.update_for_items(id, params, env=nil, headers={})
30
+ Request.send('post', uri_path("coupons",id.to_s,"update_for_items"), params, env, headers)
31
+ end
32
+
17
33
  def self.list(params={}, env=nil, headers={})
18
34
  Request.send_list_request('get', uri_path("coupons"), params, env, headers)
19
35
  end
@@ -37,12 +37,12 @@ module ChargeBee
37
37
  :offline_payment_method, :net_term_days, :vat_number_validated_time, :vat_number_status, :allow_direct_debit,
38
38
  :is_location_valid, :created_at, :created_from_ip, :exemption_details, :taxability, :entity_code,
39
39
  :exempt_number, :resource_version, :updated_at, :locale, :billing_date, :billing_date_mode,
40
- :billing_day_of_week, :billing_day_of_week_mode, :pii_cleared, :card_status, :fraud_flag, :primary_payment_source_id,
41
- :backup_payment_source_id, :billing_address, :referral_urls, :contacts, :payment_method, :invoice_notes,
42
- :preferred_currency_code, :promotional_credits, :unbilled_charges, :refundable_credits, :excess_payments,
43
- :balances, :meta_data, :deleted, :registered_for_gst, :consolidated_invoicing, :customer_type,
44
- :business_customer_without_vat_number, :client_profile_id, :relationship, :use_default_hierarchy_settings,
45
- :parent_account_access, :child_account_access
40
+ :billing_day_of_week, :billing_day_of_week_mode, :pii_cleared, :auto_close_invoices, :card_status,
41
+ :fraud_flag, :primary_payment_source_id, :backup_payment_source_id, :billing_address, :referral_urls,
42
+ :contacts, :payment_method, :invoice_notes, :preferred_currency_code, :promotional_credits,
43
+ :unbilled_charges, :refundable_credits, :excess_payments, :balances, :meta_data, :deleted, :registered_for_gst,
44
+ :consolidated_invoicing, :customer_type, :business_customer_without_vat_number, :client_profile_id,
45
+ :relationship, :use_default_hierarchy_settings, :parent_account_access, :child_account_access
46
46
 
47
47
  # OPERATIONS
48
48
  #-----------
@@ -107,7 +107,7 @@ module ChargeBee
107
107
  Request.send('post', uri_path("customers",id.to_s,"record_excess_payment"), params, env, headers)
108
108
  end
109
109
 
110
- def self.collect_payment(id, params={}, env=nil, headers={})
110
+ def self.collect_payment(id, params, env=nil, headers={})
111
111
  Request.send('post', uri_path("customers",id.to_s,"collect_payment"), params, env, headers)
112
112
  end
113
113
 
@@ -0,0 +1,39 @@
1
+ module ChargeBee
2
+ class DifferentialPrice < Model
3
+
4
+ class Tier < Model
5
+ attr_accessor :starting_unit, :ending_unit, :price, :starting_unit_in_decimal, :ending_unit_in_decimal, :price_in_decimal
6
+ end
7
+
8
+ class ParentPeriod < Model
9
+ attr_accessor :period_unit, :period
10
+ end
11
+
12
+ attr_accessor :id, :item_price_id, :parent_item_id, :price, :status, :resource_version, :updated_at,
13
+ :created_at, :modified_at, :tiers, :currency_code, :parent_periods
14
+
15
+ # OPERATIONS
16
+ #-----------
17
+
18
+ def self.create(id, params, env=nil, headers={})
19
+ Request.send('post', uri_path("item_prices",id.to_s,"differential_prices"), params, env, headers)
20
+ end
21
+
22
+ def self.retrieve(id, params, env=nil, headers={})
23
+ Request.send('get', uri_path("differential_prices",id.to_s), params, env, headers)
24
+ end
25
+
26
+ def self.update(id, params, env=nil, headers={})
27
+ Request.send('post', uri_path("differential_prices",id.to_s), params, env, headers)
28
+ end
29
+
30
+ def self.delete(id, params, env=nil, headers={})
31
+ Request.send('post', uri_path("differential_prices",id.to_s,"delete"), params, env, headers)
32
+ end
33
+
34
+ def self.list(params={}, env=nil, headers={})
35
+ Request.send_list_request('get', uri_path("differential_prices"), params, env, headers)
36
+ end
37
+
38
+ end # ~DifferentialPrice
39
+ end # ~ChargeBee
@@ -11,18 +11,38 @@ module ChargeBee
11
11
  Request.send('post', uri_path("estimates","create_subscription"), params, env, headers)
12
12
  end
13
13
 
14
+ def self.create_sub_item_estimate(params, env=nil, headers={})
15
+ Request.send('post', uri_path("estimates","create_subscription_for_items"), params, env, headers)
16
+ end
17
+
14
18
  def self.create_sub_for_customer_estimate(id, params, env=nil, headers={})
15
19
  Request.send('get', uri_path("customers",id.to_s,"create_subscription_estimate"), params, env, headers)
16
20
  end
17
21
 
22
+ def self.create_sub_item_for_customer_estimate(id, params, env=nil, headers={})
23
+ Request.send('post', uri_path("customers",id.to_s,"create_subscription_for_items_estimate"), params, env, headers)
24
+ end
25
+
18
26
  def self.update_subscription(params, env=nil, headers={})
19
27
  Request.send('post', uri_path("estimates","update_subscription"), params, env, headers)
20
28
  end
21
29
 
30
+ def self.update_subscription_for_items(params, env=nil, headers={})
31
+ Request.send('post', uri_path("estimates","update_subscription_for_items"), params, env, headers)
32
+ end
33
+
22
34
  def self.renewal_estimate(id, params={}, env=nil, headers={})
23
35
  Request.send('get', uri_path("subscriptions",id.to_s,"renewal_estimate"), params, env, headers)
24
36
  end
25
37
 
38
+ def self.advance_invoice_estimate(id, params={}, env=nil, headers={})
39
+ Request.send('post', uri_path("subscriptions",id.to_s,"advance_invoice_estimate"), params, env, headers)
40
+ end
41
+
42
+ def self.regenerate_invoice_estimate(id, params={}, env=nil, headers={})
43
+ Request.send('post', uri_path("subscriptions",id.to_s,"regenerate_invoice_estimate"), params, env, headers)
44
+ end
45
+
26
46
  def self.upcoming_invoices_estimate(id, env=nil, headers={})
27
47
  Request.send('get', uri_path("customers",id.to_s,"upcoming_invoices_estimate"), {}, env, headers)
28
48
  end
@@ -35,6 +55,10 @@ module ChargeBee
35
55
  Request.send('post', uri_path("subscriptions",id.to_s,"cancel_subscription_estimate"), params, env, headers)
36
56
  end
37
57
 
58
+ def self.cancel_subscription_for_items(id, params={}, env=nil, headers={})
59
+ Request.send('post', uri_path("subscriptions",id.to_s,"cancel_subscription_for_items_estimate"), params, env, headers)
60
+ end
61
+
38
62
  def self.pause_subscription(id, params={}, env=nil, headers={})
39
63
  Request.send('post', uri_path("subscriptions",id.to_s,"pause_subscription_estimate"), params, env, headers)
40
64
  end
@@ -47,9 +71,17 @@ module ChargeBee
47
71
  Request.send('post', uri_path("estimates","gift_subscription"), params, env, headers)
48
72
  end
49
73
 
74
+ def self.gift_subscription_for_items(params, env=nil, headers={})
75
+ Request.send('post', uri_path("estimates","gift_subscription_for_items"), params, env, headers)
76
+ end
77
+
50
78
  def self.create_invoice(params={}, env=nil, headers={})
51
79
  Request.send('post', uri_path("estimates","create_invoice"), params, env, headers)
52
80
  end
53
81
 
82
+ def self.create_invoice_for_items(params, env=nil, headers={})
83
+ Request.send('post', uri_path("estimates","create_invoice_for_items"), params, env, headers)
84
+ end
85
+
54
86
  end # ~Estimate
55
87
  end # ~ChargeBee
@@ -83,5 +83,25 @@ end
83
83
  Request.send('post', uri_path("exports","orders"), params, env, headers)
84
84
  end
85
85
 
86
+ def self.item_families(params={}, env=nil, headers={})
87
+ Request.send('post', uri_path("exports","item_families"), params, env, headers)
88
+ end
89
+
90
+ def self.items(params={}, env=nil, headers={})
91
+ Request.send('post', uri_path("exports","items"), params, env, headers)
92
+ end
93
+
94
+ def self.item_prices(params={}, env=nil, headers={})
95
+ Request.send('post', uri_path("exports","item_prices"), params, env, headers)
96
+ end
97
+
98
+ def self.attached_items(params={}, env=nil, headers={})
99
+ Request.send('post', uri_path("exports","attached_items"), params, env, headers)
100
+ end
101
+
102
+ def self.differential_prices(params={}, env=nil, headers={})
103
+ Request.send('post', uri_path("exports","differential_prices"), params, env, headers)
104
+ end
105
+
86
106
  end # ~Export
87
107
  end # ~ChargeBee
@@ -23,6 +23,10 @@ module ChargeBee
23
23
  Request.send('post', uri_path("gifts"), params, env, headers)
24
24
  end
25
25
 
26
+ def self.create_for_items(params, env=nil, headers={})
27
+ Request.send('post', uri_path("gifts","create_for_items"), params, env, headers)
28
+ end
29
+
26
30
  def self.retrieve(id, env=nil, headers={})
27
31
  Request.send('get', uri_path("gifts",id.to_s), {}, env, headers)
28
32
  end
@@ -22,10 +22,22 @@ module ChargeBee
22
22
  Request.send('post', uri_path("hosted_pages","checkout_new"), params, env, headers)
23
23
  end
24
24
 
25
+ def self.checkout_one_time(params={}, env=nil, headers={})
26
+ Request.send('post', uri_path("hosted_pages","checkout_one_time"), params, env, headers)
27
+ end
28
+
29
+ def self.checkout_new_for_items(params, env=nil, headers={})
30
+ Request.send('post', uri_path("hosted_pages","checkout_new_for_items"), params, env, headers)
31
+ end
32
+
25
33
  def self.checkout_existing(params, env=nil, headers={})
26
34
  Request.send('post', uri_path("hosted_pages","checkout_existing"), params, env, headers)
27
35
  end
28
36
 
37
+ def self.checkout_existing_for_items(params, env=nil, headers={})
38
+ Request.send('post', uri_path("hosted_pages","checkout_existing_for_items"), params, env, headers)
39
+ end
40
+
29
41
  def self.update_card(params, env=nil, headers={})
30
42
  Request.send('post', uri_path("hosted_pages","update_card"), params, env, headers)
31
43
  end
@@ -78,6 +78,10 @@ module ChargeBee
78
78
  Request.send('post', uri_path("invoices"), params, env, headers)
79
79
  end
80
80
 
81
+ def self.create_for_charge_items_and_charges(params={}, env=nil, headers={})
82
+ Request.send('post', uri_path("invoices","create_for_charge_items_and_charges"), params, env, headers)
83
+ end
84
+
81
85
  def self.charge(params, env=nil, headers={})
82
86
  Request.send('post', uri_path("invoices","charge"), params, env, headers)
83
87
  end
@@ -86,6 +90,10 @@ module ChargeBee
86
90
  Request.send('post', uri_path("invoices","charge_addon"), params, env, headers)
87
91
  end
88
92
 
93
+ def self.create_for_charge_item(params, env=nil, headers={})
94
+ Request.send('post', uri_path("invoices","create_for_charge_item"), params, env, headers)
95
+ end
96
+
89
97
  def self.stop_dunning(id, params={}, env=nil, headers={})
90
98
  Request.send('post', uri_path("invoices",id.to_s,"stop_dunning"), params, env, headers)
91
99
  end
@@ -130,6 +138,10 @@ module ChargeBee
130
138
  Request.send('post', uri_path("invoices",id.to_s,"add_addon_charge"), params, env, headers)
131
139
  end
132
140
 
141
+ def self.add_charge_item(id, params, env=nil, headers={})
142
+ Request.send('post', uri_path("invoices",id.to_s,"add_charge_item"), params, env, headers)
143
+ end
144
+
133
145
  def self.close(id, params={}, env=nil, headers={})
134
146
  Request.send('post', uri_path("invoices",id.to_s,"close"), params, env, headers)
135
147
  end
@@ -0,0 +1,37 @@
1
+ module ChargeBee
2
+ class Item < Model
3
+
4
+ class ApplicableItem < Model
5
+ attr_accessor :id
6
+ end
7
+
8
+ attr_accessor :id, :name, :description, :status, :resource_version, :updated_at, :item_family_id,
9
+ :type, :is_shippable, :is_giftable, :redirect_url, :enabled_for_checkout, :enabled_in_portal,
10
+ :included_in_mrr, :item_applicability, :gift_claim_redirect_url, :unit, :metered, :usage_calculation,
11
+ :applicable_items, :metadata
12
+
13
+ # OPERATIONS
14
+ #-----------
15
+
16
+ def self.create(params, env=nil, headers={})
17
+ Request.send('post', uri_path("items"), params, env, headers)
18
+ end
19
+
20
+ def self.retrieve(id, env=nil, headers={})
21
+ Request.send('get', uri_path("items",id.to_s), {}, env, headers)
22
+ end
23
+
24
+ def self.update(id, params={}, env=nil, headers={})
25
+ Request.send('post', uri_path("items",id.to_s), params, env, headers)
26
+ end
27
+
28
+ def self.list(params={}, env=nil, headers={})
29
+ Request.send_list_request('get', uri_path("items"), params, env, headers)
30
+ end
31
+
32
+ def self.delete(id, env=nil, headers={})
33
+ Request.send('post', uri_path("items",id.to_s,"delete"), {}, env, headers)
34
+ end
35
+
36
+ end # ~Item
37
+ end # ~ChargeBee
@@ -0,0 +1,30 @@
1
+ module ChargeBee
2
+ class ItemFamily < Model
3
+
4
+ attr_accessor :id, :name, :description, :status, :resource_version, :updated_at
5
+
6
+ # OPERATIONS
7
+ #-----------
8
+
9
+ def self.create(params, env=nil, headers={})
10
+ Request.send('post', uri_path("item_families"), params, env, headers)
11
+ end
12
+
13
+ def self.retrieve(id, env=nil, headers={})
14
+ Request.send('get', uri_path("item_families",id.to_s), {}, env, headers)
15
+ end
16
+
17
+ def self.list(params={}, env=nil, headers={})
18
+ Request.send_list_request('get', uri_path("item_families"), params, env, headers)
19
+ end
20
+
21
+ def self.update(id, params={}, env=nil, headers={})
22
+ Request.send('post', uri_path("item_families",id.to_s), params, env, headers)
23
+ end
24
+
25
+ def self.delete(id, env=nil, headers={})
26
+ Request.send('post', uri_path("item_families",id.to_s,"delete"), {}, env, headers)
27
+ end
28
+
29
+ end # ~ItemFamily
30
+ end # ~ChargeBee
@@ -0,0 +1,47 @@
1
+ module ChargeBee
2
+ class ItemPrice < Model
3
+
4
+ class Tier < Model
5
+ attr_accessor :starting_unit, :ending_unit, :price, :starting_unit_in_decimal, :ending_unit_in_decimal, :price_in_decimal
6
+ end
7
+
8
+ class TaxDetail < Model
9
+ attr_accessor :tax_profile_id, :avalara_sale_type, :avalara_transaction_type, :avalara_service_type, :avalara_tax_code, :taxjar_product_code
10
+ end
11
+
12
+ class AccountingDetail < Model
13
+ attr_accessor :sku, :accounting_code, :accounting_category1, :accounting_category2
14
+ end
15
+
16
+ attr_accessor :id, :name, :item_family_id, :item_id, :description, :status, :external_name,
17
+ :pricing_model, :price, :period, :currency_code, :period_unit, :trial_period, :trial_period_unit,
18
+ :shipping_period, :shipping_period_unit, :billing_cycles, :free_quantity, :free_quantity_in_decimal,
19
+ :price_in_decimal, :resource_version, :updated_at, :created_at, :invoice_notes, :tiers, :is_taxable,
20
+ :tax_detail, :accounting_detail, :metadata, :item_type, :archivable, :parent_item_id, :show_description_in_invoices,
21
+ :show_description_in_quotes
22
+
23
+ # OPERATIONS
24
+ #-----------
25
+
26
+ def self.create(params, env=nil, headers={})
27
+ Request.send('post', uri_path("item_prices"), params, env, headers)
28
+ end
29
+
30
+ def self.retrieve(id, env=nil, headers={})
31
+ Request.send('get', uri_path("item_prices",id.to_s), {}, env, headers)
32
+ end
33
+
34
+ def self.update(id, params={}, env=nil, headers={})
35
+ Request.send('post', uri_path("item_prices",id.to_s), params, env, headers)
36
+ end
37
+
38
+ def self.list(params={}, env=nil, headers={})
39
+ Request.send_list_request('get', uri_path("item_prices"), params, env, headers)
40
+ end
41
+
42
+ def self.delete(id, env=nil, headers={})
43
+ Request.send('post', uri_path("item_prices",id.to_s,"delete"), {}, env, headers)
44
+ end
45
+
46
+ end # ~ItemPrice
47
+ end # ~ChargeBee
@@ -6,8 +6,8 @@ module ChargeBee
6
6
  end
7
7
 
8
8
  attr_accessor :id, :status, :currency_code, :amount, :gateway_account_id, :expires_at, :reference_id,
9
- :payment_method_type, :created_at, :modified_at, :resource_version, :updated_at, :customer_id,
10
- :gateway, :active_payment_attempt
9
+ :payment_method_type, :success_url, :failure_url, :created_at, :modified_at, :resource_version,
10
+ :updated_at, :customer_id, :gateway, :active_payment_attempt
11
11
 
12
12
  # OPERATIONS
13
13
  #-----------
@@ -50,6 +50,10 @@ module ChargeBee
50
50
  Request.send('post', uri_path("quotes",id.to_s,"edit_create_subscription_quote"), params, env, headers)
51
51
  end
52
52
 
53
+ def self.create_sub_items_for_customer_quote(id, params, env=nil, headers={})
54
+ Request.send('post', uri_path("customers",id.to_s,"create_subscription_quote_for_items"), params, env, headers)
55
+ end
56
+
53
57
  def self.update_subscription_quote(params, env=nil, headers={})
54
58
  Request.send('post', uri_path("quotes","update_subscription_quote"), params, env, headers)
55
59
  end
@@ -58,10 +62,18 @@ module ChargeBee
58
62
  Request.send('post', uri_path("quotes",id.to_s,"edit_update_subscription_quote"), params, env, headers)
59
63
  end
60
64
 
65
+ def self.update_subscription_quote_for_items(params, env=nil, headers={})
66
+ Request.send('post', uri_path("quotes","update_subscription_quote_for_items"), params, env, headers)
67
+ end
68
+
61
69
  def self.create_for_onetime_charges(params, env=nil, headers={})
62
70
  Request.send('post', uri_path("quotes","create_for_onetime_charges"), params, env, headers)
63
71
  end
64
72
 
73
+ def self.create_for_charge_items_and_charges(params, env=nil, headers={})
74
+ Request.send('post', uri_path("quotes","create_for_charge_items_and_charges"), params, env, headers)
75
+ end
76
+
65
77
  def self.edit_one_time_quote(id, params={}, env=nil, headers={})
66
78
  Request.send('post', uri_path("quotes",id.to_s,"edit_one_time_quote"), params, env, headers)
67
79
  end
@@ -13,9 +13,17 @@ module ChargeBee
13
13
  attr_accessor :coupon_id, :apply_till, :applied_count, :coupon_code
14
14
  end
15
15
 
16
+ class SubscriptionItem < Model
17
+ attr_accessor :item_price_id, :item_type, :quantity, :unit_price, :amount, :free_quantity, :trial_end, :billing_cycles, :service_period_days, :charge_on_event, :charge_once, :charge_on_option
18
+ end
19
+
20
+ class ItemTier < Model
21
+ attr_accessor :item_price_id, :starting_unit, :ending_unit, :price
22
+ end
23
+
16
24
  attr_accessor :id, :plan_id, :plan_quantity, :plan_unit_price, :setup_fee, :billing_period,
17
25
  :billing_period_unit, :start_date, :trial_end, :remaining_billing_cycles, :po_number, :auto_collection,
18
- :addons, :event_based_addons, :coupons
26
+ :addons, :event_based_addons, :coupons, :subscription_items, :item_tiers
19
27
 
20
28
  # OPERATIONS
21
29
  #-----------
@@ -1,6 +1,18 @@
1
1
  module ChargeBee
2
2
  class Subscription < Model
3
3
 
4
+ class SubscriptionItem < Model
5
+ attr_accessor :item_price_id, :item_type, :quantity, :metered_quantity, :last_calculated_at, :unit_price, :amount, :free_quantity, :trial_end, :billing_cycles, :service_period_days, :charge_on_event, :charge_once, :charge_on_option
6
+ end
7
+
8
+ class ItemTier < Model
9
+ attr_accessor :item_price_id, :starting_unit, :ending_unit, :price, :starting_unit_in_decimal, :ending_unit_in_decimal, :price_in_decimal
10
+ end
11
+
12
+ class ChargedItem < Model
13
+ attr_accessor :item_price_id, :last_charged_at
14
+ end
15
+
4
16
  class Addon < Model
5
17
  attr_accessor :id, :quantity, :unit_price, :amount, :trial_end, :remaining_billing_cycles, :quantity_in_decimal, :unit_price_in_decimal, :amount_in_decimal
6
18
  end
@@ -34,12 +46,13 @@ module ChargeBee
34
46
  :customer_id, :plan_amount, :plan_free_quantity, :status, :trial_start, :current_term_start,
35
47
  :current_term_end, :next_billing_at, :created_at, :started_at, :activated_at, :gift_id, :contract_term_billing_cycle_on_renewal,
36
48
  :override_relationship, :pause_date, :resume_date, :cancelled_at, :cancel_reason, :affiliate_token,
37
- :created_from_ip, :resource_version, :updated_at, :has_scheduled_changes, :payment_source_id,
38
- :plan_free_quantity_in_decimal, :plan_quantity_in_decimal, :plan_unit_price_in_decimal, :plan_amount_in_decimal,
39
- :offline_payment_method, :due_invoices_count, :due_since, :total_dues, :mrr, :exchange_rate,
40
- :base_currency_code, :addons, :event_based_addons, :charged_event_based_addons, :coupon, :coupons,
41
- :shipping_address, :referral_info, :invoice_notes, :meta_data, :deleted, :contract_term, :cancel_reason_code,
42
- :free_period, :free_period_unit
49
+ :created_from_ip, :resource_version, :updated_at, :has_scheduled_advance_invoices, :has_scheduled_changes,
50
+ :payment_source_id, :plan_free_quantity_in_decimal, :plan_quantity_in_decimal, :plan_unit_price_in_decimal,
51
+ :plan_amount_in_decimal, :offline_payment_method, :subscription_items, :item_tiers, :charged_items,
52
+ :due_invoices_count, :due_since, :total_dues, :mrr, :exchange_rate, :base_currency_code, :addons,
53
+ :event_based_addons, :charged_event_based_addons, :coupon, :coupons, :shipping_address, :referral_info,
54
+ :invoice_notes, :meta_data, :metadata, :deleted, :contract_term, :cancel_reason_code, :free_period,
55
+ :free_period_unit, :create_pending_invoices, :auto_close_invoices
43
56
 
44
57
  # OPERATIONS
45
58
  #-----------
@@ -52,6 +65,10 @@ module ChargeBee
52
65
  Request.send('post', uri_path("customers",id.to_s,"subscriptions"), params, env, headers)
53
66
  end
54
67
 
68
+ def self.create_with_items(id, params, env=nil, headers={})
69
+ Request.send('post', uri_path("customers",id.to_s,"subscription_for_items"), params, env, headers)
70
+ end
71
+
55
72
  def self.list(params={}, env=nil, headers={})
56
73
  Request.send_list_request('get', uri_path("subscriptions"), params, env, headers)
57
74
  end
@@ -88,6 +105,10 @@ module ChargeBee
88
105
  Request.send('post', uri_path("subscriptions",id.to_s), params, env, headers)
89
106
  end
90
107
 
108
+ def self.update_for_items(id, params, env=nil, headers={})
109
+ Request.send('post', uri_path("subscriptions",id.to_s,"update_for_items"), params, env, headers)
110
+ end
111
+
91
112
  def self.change_term_end(id, params, env=nil, headers={})
92
113
  Request.send('post', uri_path("subscriptions",id.to_s,"change_term_end"), params, env, headers)
93
114
  end
@@ -108,6 +129,22 @@ module ChargeBee
108
129
  Request.send('post', uri_path("subscriptions",id.to_s,"charge_future_renewals"), params, env, headers)
109
130
  end
110
131
 
132
+ def self.edit_advance_invoice_schedule(id, params={}, env=nil, headers={})
133
+ Request.send('post', uri_path("subscriptions",id.to_s,"edit_advance_invoice_schedule"), params, env, headers)
134
+ end
135
+
136
+ def self.retrieve_advance_invoice_schedule(id, env=nil, headers={})
137
+ Request.send('get', uri_path("subscriptions",id.to_s,"retrieve_advance_invoice_schedule"), {}, env, headers)
138
+ end
139
+
140
+ def self.remove_advance_invoice_schedule(id, params={}, env=nil, headers={})
141
+ Request.send('post', uri_path("subscriptions",id.to_s,"remove_advance_invoice_schedule"), params, env, headers)
142
+ end
143
+
144
+ def self.regenerate_invoice(id, params={}, env=nil, headers={})
145
+ Request.send('post', uri_path("subscriptions",id.to_s,"regenerate_invoice"), params, env, headers)
146
+ end
147
+
111
148
  def self.import_subscription(params, env=nil, headers={})
112
149
  Request.send('post', uri_path("subscriptions","import_subscription"), params, env, headers)
113
150
  end
@@ -120,6 +157,10 @@ module ChargeBee
120
157
  Request.send('post', uri_path("subscriptions",id.to_s,"import_contract_term"), params, env, headers)
121
158
  end
122
159
 
160
+ def self.import_for_items(id, params, env=nil, headers={})
161
+ Request.send('post', uri_path("customers",id.to_s,"import_for_items"), params, env, headers)
162
+ end
163
+
123
164
  def self.override_billing_profile(id, params={}, env=nil, headers={})
124
165
  Request.send('post', uri_path("subscriptions",id.to_s,"override_billing_profile"), params, env, headers)
125
166
  end
@@ -136,6 +177,10 @@ module ChargeBee
136
177
  Request.send('post', uri_path("subscriptions",id.to_s,"cancel"), params, env, headers)
137
178
  end
138
179
 
180
+ def self.cancel_for_items(id, params={}, env=nil, headers={})
181
+ Request.send('post', uri_path("subscriptions",id.to_s,"cancel_for_items"), params, env, headers)
182
+ end
183
+
139
184
  def self.resume(id, params={}, env=nil, headers={})
140
185
  Request.send('post', uri_path("subscriptions",id.to_s,"resume"), params, env, headers)
141
186
  end
@@ -13,6 +13,10 @@ module ChargeBee
13
13
  # OPERATIONS
14
14
  #-----------
15
15
 
16
+ def self.create(params, env=nil, headers={})
17
+ Request.send('post', uri_path("unbilled_charges"), params, env, headers)
18
+ end
19
+
16
20
  def self.invoice_unbilled_charges(params={}, env=nil, headers={})
17
21
  Request.send('post', uri_path("unbilled_charges","invoice_unbilled_charges"), params, env, headers)
18
22
  end
@@ -0,0 +1,31 @@
1
+ module ChargeBee
2
+ class Usage < Model
3
+
4
+ attr_accessor :id, :usage_date, :subscription_id, :item_price_id, :invoice_id, :line_item_id,
5
+ :quantity, :source, :note, :resource_version, :updated_at, :created_at
6
+
7
+ # OPERATIONS
8
+ #-----------
9
+
10
+ def self.create(id, params, env=nil, headers={})
11
+ Request.send('post', uri_path("subscriptions",id.to_s,"usages"), params, env, headers)
12
+ end
13
+
14
+ def self.retrieve(id, params, env=nil, headers={})
15
+ Request.send('get', uri_path("subscriptions",id.to_s,"usage"), params, env, headers)
16
+ end
17
+
18
+ def self.delete(id, params, env=nil, headers={})
19
+ Request.send('post', uri_path("subscriptions",id.to_s,"delete_usage"), params, env, headers)
20
+ end
21
+
22
+ def self.list(params, env=nil, headers={})
23
+ Request.send_list_request('get', uri_path("usages"), params, env, headers)
24
+ end
25
+
26
+ def self.pdf(params, env=nil, headers={})
27
+ Request.send('post', uri_path("usages","pdf"), params, env, headers)
28
+ end
29
+
30
+ end # ~Usage
31
+ end # ~ChargeBee
@@ -7,7 +7,7 @@ module ChargeBee
7
7
 
8
8
  def subscription()
9
9
  subscription = get(:subscription, Subscription,
10
- {:addons => Subscription::Addon, :event_based_addons => Subscription::EventBasedAddon, :charged_event_based_addons => Subscription::ChargedEventBasedAddon, :coupons => Subscription::Coupon, :shipping_address => Subscription::ShippingAddress, :referral_info => Subscription::ReferralInfo, :contract_term => Subscription::ContractTerm});
10
+ {:subscription_items => Subscription::SubscriptionItem, :item_tiers => Subscription::ItemTier, :charged_items => Subscription::ChargedItem, :addons => Subscription::Addon, :event_based_addons => Subscription::EventBasedAddon, :charged_event_based_addons => Subscription::ChargedEventBasedAddon, :coupons => Subscription::Coupon, :shipping_address => Subscription::ShippingAddress, :referral_info => Subscription::ReferralInfo, :contract_term => Subscription::ContractTerm});
11
11
  return subscription;
12
12
  end
13
13
 
@@ -16,7 +16,7 @@ module ChargeBee
16
16
  return contract_term;
17
17
  end
18
18
 
19
- def advance_invoice_schedule()
19
+ def advance_invoice_schedule()
20
20
  advance_invoice_schedule = get(:advance_invoice_schedule, AdvanceInvoiceSchedule,
21
21
  {:fixed_interval_schedule => AdvanceInvoiceSchedule::FixedIntervalSchedule, :specific_dates_schedule => AdvanceInvoiceSchedule::SpecificDatesSchedule});
22
22
  return advance_invoice_schedule;
@@ -136,7 +136,7 @@ module ChargeBee
136
136
 
137
137
  def quoted_subscription()
138
138
  quoted_subscription = get(:quoted_subscription, QuotedSubscription,
139
- {:addons => QuotedSubscription::Addon, :event_based_addons => QuotedSubscription::EventBasedAddon, :coupons => QuotedSubscription::Coupon});
139
+ {:addons => QuotedSubscription::Addon, :event_based_addons => QuotedSubscription::EventBasedAddon, :coupons => QuotedSubscription::Coupon, :subscription_items => QuotedSubscription::SubscriptionItem, :item_tiers => QuotedSubscription::ItemTier});
140
140
  return quoted_subscription;
141
141
  end
142
142
 
@@ -159,7 +159,8 @@ module ChargeBee
159
159
  end
160
160
 
161
161
  def coupon()
162
- coupon = get(:coupon, Coupon);
162
+ coupon = get(:coupon, Coupon,
163
+ {:item_constraints => Coupon::ItemConstraint, :item_constraint_criteria => Coupon::ItemConstraintCriteria});
163
164
  return coupon;
164
165
  end
165
166
 
@@ -178,6 +179,11 @@ module ChargeBee
178
179
  return address;
179
180
  end
180
181
 
182
+ def usage()
183
+ usage = get(:usage, Usage);
184
+ return usage;
185
+ end
186
+
181
187
  def event()
182
188
  event = get(:event, Event,
183
189
  {:webhooks => Event::Webhook});
@@ -227,6 +233,33 @@ module ChargeBee
227
233
  return payment_intent;
228
234
  end
229
235
 
236
+ def item_family()
237
+ item_family = get(:item_family, ItemFamily);
238
+ return item_family;
239
+ end
240
+
241
+ def item()
242
+ item = get(:item, Item,
243
+ {:applicable_items => Item::ApplicableItem});
244
+ return item;
245
+ end
246
+
247
+ def item_price()
248
+ item_price = get(:item_price, ItemPrice,
249
+ {:tiers => ItemPrice::Tier, :tax_detail => ItemPrice::TaxDetail, :accounting_detail => ItemPrice::AccountingDetail});
250
+ return item_price;
251
+ end
252
+
253
+ def attached_item()
254
+ attached_item = get(:attached_item, AttachedItem);
255
+ return attached_item;
256
+ end
257
+
258
+ def differential_price()
259
+ differential_price = get(:differential_price, DifferentialPrice,
260
+ {:tiers => DifferentialPrice::Tier, :parent_periods => DifferentialPrice::ParentPeriod});
261
+ return differential_price;
262
+ end
230
263
 
231
264
  def unbilled_charges()
232
265
  unbilled_charges = get_list(:unbilled_charges, UnbilledCharge,
@@ -258,6 +291,12 @@ module ChargeBee
258
291
  return invoices;
259
292
  end
260
293
 
294
+ def differential_prices()
295
+ differential_prices = get_list(:differential_prices, DifferentialPrice,
296
+ {:tiers => DifferentialPrice::Tier, :parent_periods => DifferentialPrice::ParentPeriod});
297
+ return differential_prices;
298
+ end
299
+
261
300
 
262
301
  def to_s(*args)
263
302
  JSON.pretty_generate(@response)
@@ -274,7 +313,7 @@ module ChargeBee
274
313
  when Hash
275
314
  model = klass.construct(obj, sub_types, dependant_types)
276
315
  dependant_sub_types.each do |k,v|
277
- model.init_dependant(obj, k, v);
316
+ model.init_dependant(obj, k, v);
278
317
  end
279
318
  set_val.push(model)
280
319
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chargebee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajaraman S
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-11-16 00:00:00.000000000 Z
12
+ date: 2021-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_pure
@@ -96,6 +96,7 @@ files:
96
96
  - lib/chargebee/models/addon.rb
97
97
  - lib/chargebee/models/address.rb
98
98
  - lib/chargebee/models/advance_invoice_schedule.rb
99
+ - lib/chargebee/models/attached_item.rb
99
100
  - lib/chargebee/models/card.rb
100
101
  - lib/chargebee/models/comment.rb
101
102
  - lib/chargebee/models/contact.rb
@@ -106,6 +107,7 @@ files:
106
107
  - lib/chargebee/models/credit_note.rb
107
108
  - lib/chargebee/models/credit_note_estimate.rb
108
109
  - lib/chargebee/models/customer.rb
110
+ - lib/chargebee/models/differential_price.rb
109
111
  - lib/chargebee/models/download.rb
110
112
  - lib/chargebee/models/estimate.rb
111
113
  - lib/chargebee/models/event.rb
@@ -115,6 +117,9 @@ files:
115
117
  - lib/chargebee/models/hosted_page.rb
116
118
  - lib/chargebee/models/invoice.rb
117
119
  - lib/chargebee/models/invoice_estimate.rb
120
+ - lib/chargebee/models/item.rb
121
+ - lib/chargebee/models/item_family.rb
122
+ - lib/chargebee/models/item_price.rb
118
123
  - lib/chargebee/models/model.rb
119
124
  - lib/chargebee/models/order.rb
120
125
  - lib/chargebee/models/payment_intent.rb
@@ -134,6 +139,7 @@ files:
134
139
  - lib/chargebee/models/token.rb
135
140
  - lib/chargebee/models/transaction.rb
136
141
  - lib/chargebee/models/unbilled_charge.rb
142
+ - lib/chargebee/models/usage.rb
137
143
  - lib/chargebee/models/virtual_bank_account.rb
138
144
  - lib/chargebee/request.rb
139
145
  - lib/chargebee/rest.rb