chargebee 2.9.0 → 2.11.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
- SHA1:
3
- metadata.gz: bf9aaa36c10321606b365e9cb898878374d8bdeb
4
- data.tar.gz: ef4145817cbe7bfc3c19be0b6ab6340549ad4eca
2
+ SHA256:
3
+ metadata.gz: e664476f0031637f5dc53d9d0222d6b3200302412d09e0f538c52b566c290bcc
4
+ data.tar.gz: e6f0dc23f445dc4adba98662b23590b3a957918ec3f0e8d274c750b2fab4a985
5
5
  SHA512:
6
- metadata.gz: d013ed6f9e917fb6a0636e16d4d169cd6647a4c39cc6bae4c93b341e3ca033062039e2413a3a8d0755a0263ab1c67e36522a55aa31de9b5b58fcfa7082320977
7
- data.tar.gz: 88a6561ac1a31be5c1f9b3e03be5a8a28ff02c02130578148cb633dd68634e08e9222b9e7521b22f65f22c3eb96a683d3cea3768c95376db022e63f0ce7305d5
6
+ metadata.gz: 6771250ed0a73f48d33fc4056cec1e5fa58a4222a7606e40a3ec484519a33e00caaede36b9cdd93a3c9918ca7107a054709cda4b12b8616c7812f5b43cb47868
7
+ data.tar.gz: 49d50cef08a046ecce8493de915fe1ba93e66a5b84b79cc8d8904dcb5e05d0e33018288393c9b55cf22954b504bd5e6a721e377aab622ffea821975a599400d7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
+ ### v2.11.1 (2021-12-22)
2
+ * * *
3
+
4
+ ### Fixes:
5
+ * Not restricting to use CGI version till 0.1.0 to address security vulnerabilities.
6
+
7
+ ### v2.11.0 (2021-12-08)
8
+ * * *
9
+
10
+ ### Fixes:
11
+ * Exposed function ChargeBee#update_connect_timeout_secs and ChargeBee#update_read_timeout_secs to set custom connect and read timeout.
12
+ * Updated default request connect and read timeout to 30s and 80s respectively.
13
+
14
+ #### New endpoints:
15
+ * payment_sources#update_bank_account have been added in payment_sources resource.
16
+ * item_price#item_price_find_applicable_items and item_price#item_price_find_applicable_item_prices have been added in item_price resource.
17
+
18
+ #### New Attributes:
19
+ * hsn_code have been added to the resource addon, item_price and plan.
20
+ * first_name, last_name and email have been added to the resource payment_sources.
21
+
22
+ #### New Resource:
23
+ * TaxWithheld has been added.Applicable only for API V2.
24
+
25
+ #### New Input parameters:
26
+ * hsn_code have been added to addons#create_an_addon, addons#update_an_addon, plan#create_an_plan and plan#update_an_plan apis.
27
+ * bank_account[first_name],bank_account[last_name] and bank_account[email] have been added to payment_sources#update_bank_account api.
28
+ * charges[hsn_code] have been added in estimate#Create_Invoice, estimate#Create_Invoice_For_Items, hosted_pages#Checkout_One_Time, hosted_pages#Checkout_One_Time_For_Items, invoice#create_an_invoice, invoice#Create_For_Charge_Items_And_Charges and unbilledCharge#create_an_unbilledCharge apis.
29
+ * tax_detail[hsn_code] have been added in item_price#create_an_itemPrice and item_price#update_an_itemPrice apis.
30
+ * include_deleted have been added in plan#plan_list and addon#addon_list apis.Applicable only for Product Catalog V1.
31
+
32
+ #### New Enum values:
33
+ * subscription_activated_with_backdating, tax_withheld_recorded, tax_withheld_deleted and tax_withheld_refunded has been added to event_type enum.
34
+
35
+ ### v2.10.1 (2021-10-18)
36
+ * * *
37
+
38
+ ### Fixes:
39
+ * Fixed .DS_Store file generation issue
40
+
41
+ ### v2.10.0 (2021-10-14)
42
+
43
+ #### New Attributes:
44
+ * entity_id has been added in order_line_item_discounts resource.
45
+
46
+ #### New Input parameters:
47
+ * line_items[tax5_name], line_items[tax5_amount], line_items[tax6_name], line_items[tax6_amount], line_items[tax7_name], line_items[tax7_amount], line_items[tax8_name], line_items[tax8_amount], line_items[tax9_name], line_items[tax9_amount], line_items[tax10_name], line_items[tax10_amount] have been added in import_invoice api.
48
+ * replace_primary_payment_source has been added in create_subscription_for_customer and create_subscription_for_items apis.
49
+
50
+ #### New Enum values:
51
+ * coupon_expired has been added to event_type enum.
52
+ * mollie has been added to gateway enum.
53
+ * item_level_discount and document_level_discount has been added to discount_type.
54
+
1
55
  ### v2.9.0 (2021-08-16)
2
56
  * * *
57
+
3
58
  #### New Attributes:
4
59
  * generated_at has been added in credit_note and invoice resources.
5
60
  * change_option have been added in quoted_subscription resource.
data/chargebee.gemspec CHANGED
@@ -4,9 +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.9.0'
8
- s.date = '2021-08-16'
9
-
7
+ s.version = '2.11.1'
8
+ s.date = '2021-12-22'
10
9
  s.summary = "Ruby client for Chargebee API."
11
10
  s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com."
12
11
 
@@ -22,8 +21,7 @@ Gem::Specification.new do |s|
22
21
 
23
22
  s.add_dependency('json_pure', '~> 2.1')
24
23
  s.add_dependency('rest-client', '>=1.8', '<=2.0.2')
25
- s.add_dependency('cgi', '<=0.1.0')
26
-
24
+ s.add_dependency('cgi', '>=0.1.0', '<1.0.0')
27
25
  s.add_development_dependency('rspec', '~> 3.0.0')
28
26
  s.add_development_dependency('mocha')
29
27
 
@@ -34,7 +32,6 @@ Gem::Specification.new do |s|
34
32
  README.rdoc
35
33
  Rakefile
36
34
  chargebee.gemspec
37
- lib/.DS_Store
38
35
  lib/chargebee.rb
39
36
  lib/chargebee/environment.rb
40
37
  lib/chargebee/errors.rb
@@ -81,6 +78,7 @@ Gem::Specification.new do |s|
81
78
  lib/chargebee/models/site_migration_detail.rb
82
79
  lib/chargebee/models/subscription.rb
83
80
  lib/chargebee/models/subscription_estimate.rb
81
+ lib/chargebee/models/tax_withheld.rb
84
82
  lib/chargebee/models/third_party_payment_method.rb
85
83
  lib/chargebee/models/time_machine.rb
86
84
  lib/chargebee/models/token.rb
@@ -4,14 +4,18 @@ module ChargeBee
4
4
  # in seconds
5
5
  TIME_MACHINE_TIMEOUT = 3
6
6
  EXPORT_TIMEOUT = 10
7
+ CONNECT_TIMEOUT = 30
8
+ READ_TIMEOUT = 80
7
9
 
8
- attr_accessor :api_key, :site, :time_machine_sleeptime, :export_sleeptime
10
+ attr_accessor :api_key, :site, :time_machine_sleeptime, :export_sleeptime, :connect_timeout, :read_timeout
9
11
  attr_reader :api_endpoint
10
12
 
11
13
  def initialize(options)
12
14
  options[:time_machine_sleeptime] ||= TIME_MACHINE_TIMEOUT
13
15
  options[:export_sleeptime] ||= EXPORT_TIMEOUT
14
- [:api_key, :site, :time_machine_sleeptime, :export_sleeptime].each do |attr|
16
+ options[:connect_timeout] ||= CONNECT_TIMEOUT
17
+ options[:read_timeout] ||= READ_TIMEOUT
18
+ [:api_key, :site, :time_machine_sleeptime, :export_sleeptime, :connect_timeout, :read_timeout].each do |attr|
15
19
  instance_variable_set "@#{attr}", options[attr]
16
20
  end
17
21
  if($CHARGEBEE_DOMAIN == nil)
@@ -7,7 +7,7 @@ module ChargeBee
7
7
 
8
8
  attr_accessor :id, :name, :invoice_name, :description, :pricing_model, :type, :charge_type,
9
9
  :price, :currency_code, :period, :period_unit, :unit, :status, :archived_at, :enabled_in_portal,
10
- :tax_code, :taxjar_product_code, :avalara_sale_type, :avalara_transaction_type, :avalara_service_type,
10
+ :tax_code, :hsn_code, :taxjar_product_code, :avalara_sale_type, :avalara_transaction_type, :avalara_service_type,
11
11
  :sku, :accounting_code, :accounting_category1, :accounting_category2, :accounting_category3,
12
12
  :accounting_category4, :is_shippable, :shipping_frequency_period, :shipping_frequency_period_unit,
13
13
  :resource_version, :updated_at, :price_in_decimal, :included_in_mrr, :invoice_notes, :taxable,
@@ -6,7 +6,7 @@ module ChargeBee
6
6
  end
7
7
 
8
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
9
+ attr_accessor :tax_profile_id, :avalara_sale_type, :avalara_transaction_type, :avalara_service_type, :avalara_tax_code, :hsn_code, :taxjar_product_code
10
10
  end
11
11
 
12
12
  class AccountingDetail < Model
@@ -43,5 +43,13 @@ module ChargeBee
43
43
  Request.send('post', uri_path("item_prices",id.to_s,"delete"), {}, env, headers)
44
44
  end
45
45
 
46
+ def self.find_applicable_items(id, params={}, env=nil, headers={})
47
+ Request.send('get', uri_path("item_prices",id.to_s,"applicable_items"), params, env, headers)
48
+ end
49
+
50
+ def self.find_applicable_item_prices(id, params={}, env=nil, headers={})
51
+ Request.send('get', uri_path("item_prices",id.to_s,"applicable_item_prices"), params, env, headers)
52
+ end
53
+
46
54
  end # ~ItemPrice
47
55
  end # ~ChargeBee
@@ -18,7 +18,7 @@ module ChargeBee
18
18
  end
19
19
 
20
20
  class LineItemDiscount < Model
21
- attr_accessor :line_item_id, :discount_type, :coupon_id, :discount_amount
21
+ attr_accessor :line_item_id, :discount_type, :coupon_id, :entity_id, :discount_amount
22
22
  end
23
23
 
24
24
  class LinkedCreditNote < Model
@@ -6,7 +6,7 @@ module ChargeBee
6
6
  end
7
7
 
8
8
  class BankAccount < Model
9
- attr_accessor :last4, :name_on_account, :bank_name, :mandate_id, :account_type, :echeck_type, :account_holder_type
9
+ attr_accessor :last4, :name_on_account, :first_name, :last_name, :bank_name, :mandate_id, :account_type, :echeck_type, :account_holder_type, :email
10
10
  end
11
11
 
12
12
  class AmazonPayment < Model
@@ -52,6 +52,10 @@ module ChargeBee
52
52
  Request.send('post', uri_path("payment_sources",id.to_s,"update_card"), params, env, headers)
53
53
  end
54
54
 
55
+ def self.update_bank_account(id, params={}, env=nil, headers={})
56
+ Request.send('post', uri_path("payment_sources",id.to_s,"update_bank_account"), params, env, headers)
57
+ end
58
+
55
59
  def self.verify_bank_account(id, params, env=nil, headers={})
56
60
  Request.send('post', uri_path("payment_sources",id.to_s,"verify_bank_account"), params, env, headers)
57
61
  end
@@ -20,7 +20,7 @@ module ChargeBee
20
20
  attr_accessor :id, :name, :invoice_name, :description, :price, :currency_code, :period, :period_unit,
21
21
  :trial_period, :trial_period_unit, :trial_end_action, :pricing_model, :charge_model, :free_quantity,
22
22
  :setup_cost, :downgrade_penalty, :status, :archived_at, :billing_cycles, :redirect_url, :enabled_in_hosted_pages,
23
- :enabled_in_portal, :addon_applicability, :tax_code, :taxjar_product_code, :avalara_sale_type,
23
+ :enabled_in_portal, :addon_applicability, :tax_code, :hsn_code, :taxjar_product_code, :avalara_sale_type,
24
24
  :avalara_transaction_type, :avalara_service_type, :sku, :accounting_code, :accounting_category1,
25
25
  :accounting_category2, :accounting_category3, :accounting_category4, :is_shippable, :shipping_frequency_period,
26
26
  :shipping_frequency_period_unit, :resource_version, :updated_at, :giftable, :claim_url, :free_quantity_in_decimal,
@@ -0,0 +1,10 @@
1
+ module ChargeBee
2
+ class TaxWithheld < Model
3
+
4
+ attr_accessor :id, :reference_number, :description, :date, :currency_code, :amount
5
+
6
+ # OPERATIONS
7
+ #-----------
8
+
9
+ end # ~TaxWithheld
10
+ end # ~ChargeBee
@@ -39,8 +39,8 @@ module ChargeBee
39
39
  :user => api_key,
40
40
  :headers => headers,
41
41
  :payload => payload,
42
- :open_timeout => 50,
43
- :timeout => 100
42
+ :open_timeout => env.connect_timeout,
43
+ :timeout => env.read_timeout
44
44
  }.merge(ssl_opts)
45
45
 
46
46
  begin
@@ -75,6 +75,11 @@ module ChargeBee
75
75
  return invoice;
76
76
  end
77
77
 
78
+ def tax_withheld()
79
+ tax_withheld = get(:tax_withheld, TaxWithheld);
80
+ return tax_withheld;
81
+ end
82
+
78
83
  def credit_note()
79
84
  credit_note = get(:credit_note, CreditNote,
80
85
  {:line_items => CreditNote::LineItem, :discounts => CreditNote::Discount, :line_item_discounts => CreditNote::LineItemDiscount, :line_item_tiers => CreditNote::LineItemTier, :taxes => CreditNote::Tax, :line_item_taxes => CreditNote::LineItemTax, :linked_refunds => CreditNote::LinkedRefund, :allocations => CreditNote::Allocation});
data/lib/chargebee.rb CHANGED
@@ -53,7 +53,7 @@ require File.dirname(__FILE__) + '/chargebee/models/usage.rb'
53
53
 
54
54
  module ChargeBee
55
55
 
56
- VERSION = '2.9.0'
56
+ VERSION = '2.11.1'
57
57
 
58
58
  @@default_env = nil
59
59
  @@verify_ca_certs = true
@@ -89,5 +89,12 @@ module ChargeBee
89
89
  @@user_agent
90
90
  end
91
91
 
92
+ def self.update_connect_timeout_secs(connect_timeout)
93
+ @@default_env.connect_timeout = connect_timeout
94
+ end
95
+
96
+ def self.update_read_timeout_secs(read_timeout)
97
+ @@default_env.read_timeout = read_timeout
98
+ end
92
99
  end
93
100
 
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.9.0
4
+ version: 2.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajaraman S
@@ -9,82 +9,88 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-08-16 00:00:00.000000000 Z
12
+ date: 2021-12-22 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: 2.0.2
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: 2.0.2
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: cgi
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - <=
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.1.0
55
+ - - "<"
56
+ - !ruby/object:Gem::Version
57
+ version: 1.0.0
55
58
  type: :runtime
56
59
  prerelease: false
57
60
  version_requirements: !ruby/object:Gem::Requirement
58
61
  requirements:
59
- - - <=
62
+ - - ">="
60
63
  - !ruby/object:Gem::Version
61
64
  version: 0.1.0
65
+ - - "<"
66
+ - !ruby/object:Gem::Version
67
+ version: 1.0.0
62
68
  - !ruby/object:Gem::Dependency
63
69
  name: rspec
64
70
  requirement: !ruby/object:Gem::Requirement
65
71
  requirements:
66
- - - ~>
72
+ - - "~>"
67
73
  - !ruby/object:Gem::Version
68
74
  version: 3.0.0
69
75
  type: :development
70
76
  prerelease: false
71
77
  version_requirements: !ruby/object:Gem::Requirement
72
78
  requirements:
73
- - - ~>
79
+ - - "~>"
74
80
  - !ruby/object:Gem::Version
75
81
  version: 3.0.0
76
82
  - !ruby/object:Gem::Dependency
77
83
  name: mocha
78
84
  requirement: !ruby/object:Gem::Requirement
79
85
  requirements:
80
- - - '>='
86
+ - - ">="
81
87
  - !ruby/object:Gem::Version
82
88
  version: '0'
83
89
  type: :development
84
90
  prerelease: false
85
91
  version_requirements: !ruby/object:Gem::Requirement
86
92
  requirements:
87
- - - '>='
93
+ - - ">="
88
94
  - !ruby/object:Gem::Version
89
95
  version: '0'
90
96
  description: Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com.
@@ -102,7 +108,6 @@ files:
102
108
  - README.rdoc
103
109
  - Rakefile
104
110
  - chargebee.gemspec
105
- - lib/.DS_Store
106
111
  - lib/chargebee.rb
107
112
  - lib/chargebee/environment.rb
108
113
  - lib/chargebee/errors.rb
@@ -149,6 +154,7 @@ files:
149
154
  - lib/chargebee/models/site_migration_detail.rb
150
155
  - lib/chargebee/models/subscription.rb
151
156
  - lib/chargebee/models/subscription_estimate.rb
157
+ - lib/chargebee/models/tax_withheld.rb
152
158
  - lib/chargebee/models/third_party_payment_method.rb
153
159
  - lib/chargebee/models/time_machine.rb
154
160
  - lib/chargebee/models/token.rb
@@ -172,22 +178,21 @@ licenses:
172
178
  metadata: {}
173
179
  post_install_message:
174
180
  rdoc_options:
175
- - --charset=UTF-8
181
+ - "--charset=UTF-8"
176
182
  require_paths:
177
183
  - lib
178
184
  required_ruby_version: !ruby/object:Gem::Requirement
179
185
  requirements:
180
- - - '>='
186
+ - - ">="
181
187
  - !ruby/object:Gem::Version
182
188
  version: 1.9.3
183
189
  required_rubygems_version: !ruby/object:Gem::Requirement
184
190
  requirements:
185
- - - '>='
191
+ - - ">="
186
192
  - !ruby/object:Gem::Version
187
193
  version: '0'
188
194
  requirements: []
189
- rubyforge_project:
190
- rubygems_version: 2.4.5
195
+ rubygems_version: 3.0.3
191
196
  signing_key:
192
197
  specification_version: 2
193
198
  summary: Ruby client for Chargebee API.
data/lib/.DS_Store DELETED
Binary file