chargebee 2.8.0 → 2.8.1

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
- SHA256:
3
- metadata.gz: 5313e0ccaa457855df52b89719c4363d56b9abc7b49597a6824ed063a69ab8d3
4
- data.tar.gz: a1ce4600484c5fdcb7b8d529d36f542ea0d42c2bcb0288b7d6b350bd1770c8ba
2
+ SHA1:
3
+ metadata.gz: 20dad3d2ee271dc1cdf5b5b58a0815eea42d3f05
4
+ data.tar.gz: d123a46803308d39abda913f805e7fe946602027
5
5
  SHA512:
6
- metadata.gz: fdfe10f1f88fb45542eebf6944795be482697039c91898e11d6c4bab77b7e3fdef25d9eaa0c3e38a6aeb9c491303859755a19fb7452796f0c76e36e38a760496
7
- data.tar.gz: e61978f0038d899e713f0d0e6820212e4042ec262d73fa5e58dc3b4a3b4f3ed3c3c158da632216279de26161989bea026a895e9d27d43c1d2e19fe4feb6ffb20
6
+ metadata.gz: 6474ebce061c2e3cb858f2258c0a059b34bdd6390b6ae6269d199ce4be2eb3c99e168209dabe63e6cf713c95350beacc5709b7fb3bf691e91e25181d08720a3d
7
+ data.tar.gz: 75fcf9f883e0fd92c9b04937bf6f79623956bfff1a7f3fc87b15eeb32a30356bad115ac71a5cfaf17911aa6c7be17ef4646bb8ca0fb495574717faee15974c2c
@@ -1,3 +1,36 @@
1
+ ### v2.8.1 (2020-11-26)
2
+ * * *
3
+ ##### New resources:
4
+ item_family, item, item_price, attached_item and differential_price are added. Applicable only for Product Catalog V2
5
+
6
+ ##### New end points:
7
+ * 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
8
+ * 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
9
+ * estimates#advance_invoice_estimate has been added in estimate resource
10
+ * 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
11
+ * checkout_new_for_items and checkout_existing_for_items have been added in hosted_pages api. Applicable only for Product Catalog V2
12
+ * 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
13
+ * 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
14
+ * 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
15
+ * subscriptions#edit_advance_invoice_schedule, subscriptions#retrieve_advance_invoice and subscriptions#remove_an_advance_invoice_schedules have been added in subscription resource
16
+ * unbilled_charges#create_an_invoice_for_unbilled_charges has been added to unbilled_charge resource
17
+
18
+ ##### New attributes:
19
+ * item_constraints and item_constraint_criteria have been added in coupon resource. Applicable only for Product Catalog V2
20
+ * success_url and failure_url have been added in payment_intent resource
21
+ * subscription_items and item_tiers have been added in quoted_subscription resource. Applicable only for Product Catalog V2
22
+ * has_scheduled_advance_invoices has been added in subscription resource
23
+ * subscription_items, item_tiers and charged_items have been added in subscription resource. Applicable only for Product Catalog V2
24
+
25
+ ##### New parameters:
26
+ * 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
27
+ * invoice_immediately, schedule_type and fixed_interval_schedule have been added to the end point: subscriptions#charge_future_renewals
28
+ * success_url and failure_url have been added to the end points: payment_intents#create_a_payment_intent, payment_intents#update_a_payment_intent
29
+
30
+ ##### New Enum values:
31
+ * PLAN_ITEM_PRICE, ADDON_ITEM_PRICE, CHARGE_ITEM_PRICE are added to Entitytype Enum
32
+ * 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
33
+
1
34
  ### v2.8.0 (2020-11-16)
2
35
  * * *
3
36
  * 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 +1766,4 @@ Support for creating plans & addons on the fly via API.
1733
1766
 
1734
1767
  * API to fetch multiple subscriptions of a customer.
1735
1768
 
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.
1769
+ * Added support to get the list of events filtered by event type. Events can be fetched based on the event type eg., payment_succeeded.
@@ -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.1'
8
+ s.date = '2020-11-26'
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
@@ -47,7 +47,7 @@ require File.dirname(__FILE__) + '/chargebee/models/payment_intent.rb'
47
47
 
48
48
  module ChargeBee
49
49
 
50
- VERSION = '2.8.0'
50
+ VERSION = '2.8.1'
51
51
 
52
52
  @@default_env = nil
53
53
  @@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
@@ -0,0 +1,39 @@
1
+ module ChargeBee
2
+ class DifferentialPrice < Model
3
+
4
+ class Tier < Model
5
+ attr_accessor :starting_unit, :ending_unit, :price
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
@@ -15,14 +15,26 @@ module ChargeBee
15
15
  Request.send('get', uri_path("customers",id.to_s,"create_subscription_estimate"), params, env, headers)
16
16
  end
17
17
 
18
+ def self.create_sub_item_for_customer_estimate(id, params, env=nil, headers={})
19
+ Request.send('post', uri_path("customers",id.to_s,"create_subscription_for_items_estimate"), params, env, headers)
20
+ end
21
+
18
22
  def self.update_subscription(params, env=nil, headers={})
19
23
  Request.send('post', uri_path("estimates","update_subscription"), params, env, headers)
20
24
  end
21
25
 
26
+ def self.update_subscription_for_items(params, env=nil, headers={})
27
+ Request.send('post', uri_path("estimates","update_subscription_for_items"), params, env, headers)
28
+ end
29
+
22
30
  def self.renewal_estimate(id, params={}, env=nil, headers={})
23
31
  Request.send('get', uri_path("subscriptions",id.to_s,"renewal_estimate"), params, env, headers)
24
32
  end
25
33
 
34
+ def self.advance_invoice_estimate(id, params={}, env=nil, headers={})
35
+ Request.send('post', uri_path("subscriptions",id.to_s,"advance_invoice_estimate"), params, env, headers)
36
+ end
37
+
26
38
  def self.upcoming_invoices_estimate(id, env=nil, headers={})
27
39
  Request.send('get', uri_path("customers",id.to_s,"upcoming_invoices_estimate"), {}, env, headers)
28
40
  end
@@ -51,5 +63,9 @@ module ChargeBee
51
63
  Request.send('post', uri_path("estimates","create_invoice"), params, env, headers)
52
64
  end
53
65
 
66
+ def self.create_invoice_for_items(params, env=nil, headers={})
67
+ Request.send('post', uri_path("estimates","create_invoice_for_items"), params, env, headers)
68
+ end
69
+
54
70
  end # ~Estimate
55
71
  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
@@ -22,10 +22,18 @@ 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_new_for_items(params, env=nil, headers={})
26
+ Request.send('post', uri_path("hosted_pages","checkout_new_for_items"), params, env, headers)
27
+ end
28
+
25
29
  def self.checkout_existing(params, env=nil, headers={})
26
30
  Request.send('post', uri_path("hosted_pages","checkout_existing"), params, env, headers)
27
31
  end
28
32
 
33
+ def self.checkout_existing_for_items(params, env=nil, headers={})
34
+ Request.send('post', uri_path("hosted_pages","checkout_existing_for_items"), params, env, headers)
35
+ end
36
+
29
37
  def self.update_card(params, env=nil, headers={})
30
38
  Request.send('post', uri_path("hosted_pages","update_card"), params, env, headers)
31
39
  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,36 @@
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, :applicable_items, :metadata
11
+
12
+ # OPERATIONS
13
+ #-----------
14
+
15
+ def self.create(params, env=nil, headers={})
16
+ Request.send('post', uri_path("items"), params, env, headers)
17
+ end
18
+
19
+ def self.retrieve(id, env=nil, headers={})
20
+ Request.send('get', uri_path("items",id.to_s), {}, env, headers)
21
+ end
22
+
23
+ def self.update(id, params={}, env=nil, headers={})
24
+ Request.send('post', uri_path("items",id.to_s), params, env, headers)
25
+ end
26
+
27
+ def self.list(params={}, env=nil, headers={})
28
+ Request.send_list_request('get', uri_path("items"), params, env, headers)
29
+ end
30
+
31
+ def self.delete(id, env=nil, headers={})
32
+ Request.send('post', uri_path("items",id.to_s,"delete"), {}, env, headers)
33
+ end
34
+
35
+ end # ~Item
36
+ 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,46 @@
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
21
+
22
+ # OPERATIONS
23
+ #-----------
24
+
25
+ def self.create(params, env=nil, headers={})
26
+ Request.send('post', uri_path("item_prices"), params, env, headers)
27
+ end
28
+
29
+ def self.retrieve(id, env=nil, headers={})
30
+ Request.send('get', uri_path("item_prices",id.to_s), {}, env, headers)
31
+ end
32
+
33
+ def self.update(id, params={}, env=nil, headers={})
34
+ Request.send('post', uri_path("item_prices",id.to_s), params, env, headers)
35
+ end
36
+
37
+ def self.list(params={}, env=nil, headers={})
38
+ Request.send_list_request('get', uri_path("item_prices"), params, env, headers)
39
+ end
40
+
41
+ def self.delete(id, env=nil, headers={})
42
+ Request.send('post', uri_path("item_prices",id.to_s,"delete"), {}, env, headers)
43
+ end
44
+
45
+ end # ~ItemPrice
46
+ end # ~ChargeBee
@@ -56,7 +56,7 @@ module ChargeBee
56
56
  if(path.nil? || path.strip.length < 1)
57
57
  raise "Id is empty or nil"
58
58
  end
59
- url = "#{url}/#{URI.encode(path.strip)}"
59
+ url = "#{url}/#{URI.encode_www_form_component(path.strip)}"
60
60
  end
61
61
  return url
62
62
  end
@@ -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, :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
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
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,18 @@ 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
+
111
144
  def self.import_subscription(params, env=nil, headers={})
112
145
  Request.send('post', uri_path("subscriptions","import_subscription"), params, env, headers)
113
146
  end
@@ -120,6 +153,10 @@ module ChargeBee
120
153
  Request.send('post', uri_path("subscriptions",id.to_s,"import_contract_term"), params, env, headers)
121
154
  end
122
155
 
156
+ def self.import_for_items(id, params, env=nil, headers={})
157
+ Request.send('post', uri_path("customers",id.to_s,"import_for_items"), params, env, headers)
158
+ end
159
+
123
160
  def self.override_billing_profile(id, params={}, env=nil, headers={})
124
161
  Request.send('post', uri_path("subscriptions",id.to_s,"override_billing_profile"), params, env, headers)
125
162
  end
@@ -136,6 +173,10 @@ module ChargeBee
136
173
  Request.send('post', uri_path("subscriptions",id.to_s,"cancel"), params, env, headers)
137
174
  end
138
175
 
176
+ def self.cancel_for_items(id, params={}, env=nil, headers={})
177
+ Request.send('post', uri_path("subscriptions",id.to_s,"cancel_for_items"), params, env, headers)
178
+ end
179
+
139
180
  def self.resume(id, params={}, env=nil, headers={})
140
181
  Request.send('post', uri_path("subscriptions",id.to_s,"resume"), params, env, headers)
141
182
  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
@@ -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
 
@@ -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
 
@@ -227,6 +228,33 @@ module ChargeBee
227
228
  return payment_intent;
228
229
  end
229
230
 
231
+ def item_family()
232
+ item_family = get(:item_family, ItemFamily);
233
+ return item_family;
234
+ end
235
+
236
+ def item()
237
+ item = get(:item, Item,
238
+ {:applicable_items => Item::ApplicableItem});
239
+ return item;
240
+ end
241
+
242
+ def item_price()
243
+ item_price = get(:item_price, ItemPrice,
244
+ {:tiers => ItemPrice::Tier, :tax_detail => ItemPrice::TaxDetail, :accounting_detail => ItemPrice::AccountingDetail});
245
+ return item_price;
246
+ end
247
+
248
+ def attached_item()
249
+ attached_item = get(:attached_item, AttachedItem);
250
+ return attached_item;
251
+ end
252
+
253
+ def differential_price()
254
+ differential_price = get(:differential_price, DifferentialPrice,
255
+ {:tiers => DifferentialPrice::Tier, :parent_periods => DifferentialPrice::ParentPeriod});
256
+ return differential_price;
257
+ end
230
258
 
231
259
  def unbilled_charges()
232
260
  unbilled_charges = get_list(:unbilled_charges, UnbilledCharge,
@@ -258,6 +286,12 @@ module ChargeBee
258
286
  return invoices;
259
287
  end
260
288
 
289
+ def differential_prices()
290
+ differential_prices = get_list(:differential_prices, DifferentialPrice,
291
+ {:tiers => DifferentialPrice::Tier, :parent_periods => DifferentialPrice::ParentPeriod});
292
+ return differential_prices;
293
+ end
294
+
261
295
 
262
296
  def to_s(*args)
263
297
  JSON.pretty_generate(@response)
@@ -274,7 +308,7 @@ module ChargeBee
274
308
  when Hash
275
309
  model = klass.construct(obj, sub_types, dependant_types)
276
310
  dependant_sub_types.each do |k,v|
277
- model.init_dependant(obj, k, v);
311
+ model.init_dependant(obj, k, v);
278
312
  end
279
313
  set_val.push(model)
280
314
  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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajaraman S
@@ -9,68 +9,68 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-11-16 00:00:00.000000000 Z
12
+ date: 2020-11-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_pure
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: '2.1'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: '2.1'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rest-client
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - '>='
33
33
  - !ruby/object:Gem::Version
34
34
  version: '1.8'
35
- - - "<"
35
+ - - <
36
36
  - !ruby/object:Gem::Version
37
37
  version: '3.0'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ">="
42
+ - - '>='
43
43
  - !ruby/object:Gem::Version
44
44
  version: '1.8'
45
- - - "<"
45
+ - - <
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rspec
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.0.0
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 3.0.0
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: mocha
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  description: Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com.
@@ -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
@@ -151,21 +156,22 @@ licenses:
151
156
  metadata: {}
152
157
  post_install_message:
153
158
  rdoc_options:
154
- - "--charset=UTF-8"
159
+ - --charset=UTF-8
155
160
  require_paths:
156
161
  - lib
157
162
  required_ruby_version: !ruby/object:Gem::Requirement
158
163
  requirements:
159
- - - ">="
164
+ - - '>='
160
165
  - !ruby/object:Gem::Version
161
166
  version: 1.9.3
162
167
  required_rubygems_version: !ruby/object:Gem::Requirement
163
168
  requirements:
164
- - - ">="
169
+ - - '>='
165
170
  - !ruby/object:Gem::Version
166
171
  version: '0'
167
172
  requirements: []
168
- rubygems_version: 3.0.3
173
+ rubyforge_project:
174
+ rubygems_version: 2.4.5
169
175
  signing_key:
170
176
  specification_version: 2
171
177
  summary: Ruby client for Chargebee API.