chargebee 2.13.1 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 49d70f2529b34c3a788cbf65750ba516a34ace1760b1b9ad27113b1a3c11592b
4
- data.tar.gz: bdf0b4097567ec86e767586394c7e6f7bbb2a9ed4e16ce0d5aa3e0086bad4760
2
+ SHA1:
3
+ metadata.gz: 0232e352a693582a0e848b864963082981b8ab0a
4
+ data.tar.gz: 0fc491a54ffec2d077d039a76b65afbfda23999f
5
5
  SHA512:
6
- metadata.gz: a4a6cb02c12057610e0f7947855863f530eceacd201884e510e623a9fe2ad1800f5c8415d4e53e8f266f12b561f8c2b35ae28735c28fa62331fcdc8ce4aba57d
7
- data.tar.gz: f44994755b77b350fca0ee5e20e09afab9d6653258b0b49297e2aa7519d4015442bf503befe750d13693c290b55f389fa0ed7ccee29f8b7315c47560a398b19f
6
+ metadata.gz: 241fe47ea0959a545f5b84731ee03f73d152a268934b93f454405390accb25ba4c6a4e32c8103dc15c4a735dbf39e7bb5fbc77e7f996b2ae9f6ea8300cee140c
7
+ data.tar.gz: 029ab84935dd9cc0ce4203413275a8b7ede7cfe05085f404f61dd589438120c608c23bc14f83b240965ccd2557d732f5b4f5cbe782fe225462f5342045044fca
data/CHANGELOG.md CHANGED
@@ -1,10 +1,59 @@
1
+ ### v2.15.0 (2022-04-25)
2
+ * * *
3
+
4
+ #### New endpoints:
5
+ * UnbilledCharge#CreateUnbilledCharge has been added to UnbilledCharge resource. Applicable only for PC1.0.
6
+
7
+ #### New attributes:
8
+ * channel have been added to the Addon, AttachedItem, CreditNote, Customer, Invoice, ItemFamily, ItemPrice, Plan and Subscription resources.
9
+ * external_name and channel have been added to the Item resource.
10
+
11
+ #### New input parameters:
12
+ * external_name have been added to Item#CreateRequest and Item#UpdateRequest.
13
+ * channel have been added to Addon#AddonListRequest.
14
+ * channel have been added to CreditNote#CreditNoteListRequest.
15
+ * channel have been added to Customer#CustomerListRequest.
16
+ * invoice[channel], subscription[channel] and customer[channel] have been added to Export#RevenueRecognitionRequest and Export#DeferredRevenueRequest.
17
+ * plan[channel] have been added to Export#PlansRequest.
18
+ * addon[channel] have been added to Export#AddonsRequest.
19
+ * customer[channel] have been added to Export#CustomersRequest.
20
+ * subscription[channel] have been added to Export#SubscriptionsRequest.
21
+ * invoice[channel] have been added to Export#InvoicesRequest.
22
+ * credit_note[channel] have been added to Export#CreditNotesRequest.
23
+ * item[channel] have been added to Export#ItemsRequest.
24
+ * item_price[channel] have been added to Export#ItemPricesRequest.
25
+ * channel have been added to Invoice#InvoiceListRequest.
26
+ * channel have been added to Item#ItemListRequest.
27
+ * channel have been added to ItemPrice#ItemPriceListRequest.
28
+ * channel have been added to Plan#PlanListRequest.
29
+ * channel have been added to Subscription#SubscriptionListRequest.
30
+
31
+ ### Existing input parameter changes:
32
+ * item_family_id in Item#CreateRequest has been made as required field.
33
+
34
+ ### Removed enum values:
35
+ * coupon_expired event has been removed from EventTypeEnum.
36
+
37
+ ### v2.14.1 (2022-03-31)
38
+ * * *
39
+
40
+ ### Fixes:
41
+ * Fixed serialization issue.
42
+
43
+
44
+ ### v2.14.0 (2022-03-14)
45
+ * * *
46
+
47
+ #### New Input parameters:
48
+ * net_term_days has been added to subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items, subscriptions#import_subscription_for_items endpoints.
49
+
50
+
1
51
  ### v2.13.1 (2022-03-08)
2
52
  * * *
3
53
 
4
54
  ### Fixes:
5
55
  * Fixed RSpec testcase failure issue.
6
56
 
7
-
8
57
  ### v2.13.0 (2022-03-08)
9
58
  * * *
10
59
 
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.13.1'
8
- s.date = '2022-03-08'
7
+ s.version = '2.15.0'
8
+ s.date = '2022-04-25'
9
9
  s.summary = "Ruby client for Chargebee API."
10
10
  s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com."
11
11
 
@@ -10,8 +10,8 @@ module ChargeBee
10
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
- :resource_version, :updated_at, :price_in_decimal, :included_in_mrr, :invoice_notes, :taxable,
14
- :tax_profile_id, :meta_data, :tiers, :show_description_in_invoices, :show_description_in_quotes
13
+ :resource_version, :updated_at, :price_in_decimal, :included_in_mrr, :channel, :invoice_notes,
14
+ :taxable, :tax_profile_id, :meta_data, :tiers, :show_description_in_invoices, :show_description_in_quotes
15
15
 
16
16
  # OPERATIONS
17
17
  #-----------
@@ -2,7 +2,8 @@ module ChargeBee
2
2
  class AttachedItem < Model
3
3
 
4
4
  attr_accessor :id, :parent_item_id, :item_id, :type, :status, :quantity, :quantity_in_decimal,
5
- :billing_cycles, :charge_on_event, :charge_once, :created_at, :resource_version, :updated_at
5
+ :billing_cycles, :charge_on_event, :charge_once, :created_at, :resource_version, :updated_at,
6
+ :channel
6
7
 
7
8
  # OPERATIONS
8
9
  #-----------
@@ -40,7 +40,7 @@ module ChargeBee
40
40
  attr_accessor :id, :customer_id, :subscription_id, :reference_invoice_id, :type, :reason_code,
41
41
  :status, :vat_number, :date, :price_type, :currency_code, :total, :amount_allocated, :amount_refunded,
42
42
  :amount_available, :refunded_at, :voided_at, :generated_at, :resource_version, :updated_at,
43
- :einvoice, :sub_total, :sub_total_in_local_currency, :total_in_local_currency, :local_currency_code,
43
+ :channel, :einvoice, :sub_total, :sub_total_in_local_currency, :total_in_local_currency, :local_currency_code,
44
44
  :round_off_amount, :fractional_correction, :line_items, :discounts, :line_item_discounts, :line_item_tiers,
45
45
  :taxes, :line_item_taxes, :linked_refunds, :allocations, :deleted, :create_reason_code, :vat_number_prefix
46
46
 
@@ -41,9 +41,9 @@ module ChargeBee
41
41
  :offline_payment_method, :net_term_days, :vat_number_validated_time, :vat_number_status, :allow_direct_debit,
42
42
  :is_location_valid, :created_at, :created_from_ip, :exemption_details, :taxability, :entity_code,
43
43
  :exempt_number, :resource_version, :updated_at, :locale, :billing_date, :billing_date_mode,
44
- :billing_day_of_week, :billing_day_of_week_mode, :pii_cleared, :auto_close_invoices, :card_status,
45
- :fraud_flag, :primary_payment_source_id, :backup_payment_source_id, :billing_address, :referral_urls,
46
- :contacts, :payment_method, :invoice_notes, :preferred_currency_code, :promotional_credits,
44
+ :billing_day_of_week, :billing_day_of_week_mode, :pii_cleared, :auto_close_invoices, :channel,
45
+ :card_status, :fraud_flag, :primary_payment_source_id, :backup_payment_source_id, :billing_address,
46
+ :referral_urls, :contacts, :payment_method, :invoice_notes, :preferred_currency_code, :promotional_credits,
47
47
  :unbilled_charges, :refundable_credits, :excess_payments, :balances, :entity_identifiers, :is_einvoice_enabled,
48
48
  :meta_data, :deleted, :registered_for_gst, :consolidated_invoicing, :customer_type, :business_customer_without_vat_number,
49
49
  :client_profile_id, :relationship, :use_default_hierarchy_settings, :parent_account_access,
@@ -74,7 +74,7 @@ module ChargeBee
74
74
  :line_items, :discounts, :line_item_discounts, :taxes, :line_item_taxes, :line_item_tiers, :linked_payments,
75
75
  :dunning_attempts, :applied_credits, :adjustment_credit_notes, :issued_credit_notes, :linked_orders,
76
76
  :notes, :shipping_address, :billing_address, :einvoice, :payment_owner, :void_reason_code, :deleted,
77
- :vat_number_prefix
77
+ :vat_number_prefix, :channel
78
78
 
79
79
  # OPERATIONS
80
80
  #-----------
@@ -5,10 +5,10 @@ module ChargeBee
5
5
  attr_accessor :id
6
6
  end
7
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,
8
+ attr_accessor :id, :name, :external_name, :description, :status, :resource_version, :updated_at,
9
+ :item_family_id, :type, :is_shippable, :is_giftable, :redirect_url, :enabled_for_checkout, :enabled_in_portal,
10
10
  :included_in_mrr, :item_applicability, :gift_claim_redirect_url, :unit, :metered, :usage_calculation,
11
- :archived_at, :applicable_items, :metadata
11
+ :archived_at, :channel, :applicable_items, :metadata
12
12
 
13
13
  # OPERATIONS
14
14
  #-----------
@@ -1,7 +1,7 @@
1
1
  module ChargeBee
2
2
  class ItemFamily < Model
3
3
 
4
- attr_accessor :id, :name, :description, :status, :resource_version, :updated_at
4
+ attr_accessor :id, :name, :description, :status, :resource_version, :updated_at, :channel
5
5
 
6
6
  # OPERATIONS
7
7
  #-----------
@@ -16,9 +16,9 @@ module ChargeBee
16
16
  attr_accessor :id, :name, :item_family_id, :item_id, :description, :status, :external_name,
17
17
  :pricing_model, :price, :price_in_decimal, :period, :currency_code, :period_unit, :trial_period,
18
18
  :trial_period_unit, :trial_end_action, :shipping_period, :shipping_period_unit, :billing_cycles,
19
- :free_quantity, :free_quantity_in_decimal, :resource_version, :updated_at, :created_at, :archived_at,
20
- :invoice_notes, :tiers, :is_taxable, :tax_detail, :accounting_detail, :metadata, :item_type,
21
- :archivable, :parent_item_id, :show_description_in_invoices, :show_description_in_quotes
19
+ :free_quantity, :free_quantity_in_decimal, :channel, :resource_version, :updated_at, :created_at,
20
+ :archived_at, :invoice_notes, :tiers, :is_taxable, :tax_detail, :accounting_detail, :metadata,
21
+ :item_type, :archivable, :parent_item_id, :show_description_in_invoices, :show_description_in_quotes
22
22
 
23
23
  # OPERATIONS
24
24
  #-----------
@@ -24,8 +24,8 @@ module ChargeBee
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,
27
- :price_in_decimal, :invoice_notes, :taxable, :tax_profile_id, :meta_data, :tiers, :applicable_addons,
28
- :attached_addons, :event_based_addons, :show_description_in_invoices, :show_description_in_quotes
27
+ :price_in_decimal, :channel, :invoice_notes, :taxable, :tax_profile_id, :meta_data, :tiers,
28
+ :applicable_addons, :attached_addons, :event_based_addons, :show_description_in_invoices, :show_description_in_quotes
29
29
 
30
30
  # OPERATIONS
31
31
  #-----------
@@ -49,10 +49,10 @@ module ChargeBee
49
49
  :override_relationship, :pause_date, :resume_date, :cancelled_at, :cancel_reason, :affiliate_token,
50
50
  :created_from_ip, :resource_version, :updated_at, :has_scheduled_advance_invoices, :has_scheduled_changes,
51
51
  :payment_source_id, :plan_free_quantity_in_decimal, :plan_amount_in_decimal, :cancel_schedule_created_at,
52
- :offline_payment_method, :channel, :subscription_items, :item_tiers, :charged_items, :due_invoices_count,
53
- :due_since, :total_dues, :mrr, :exchange_rate, :base_currency_code, :addons, :event_based_addons,
54
- :charged_event_based_addons, :coupon, :coupons, :shipping_address, :referral_info, :invoice_notes,
55
- :meta_data, :metadata, :deleted, :changes_scheduled_at, :contract_term, :cancel_reason_code,
52
+ :offline_payment_method, :channel, :net_term_days, :subscription_items, :item_tiers, :charged_items,
53
+ :due_invoices_count, :due_since, :total_dues, :mrr, :exchange_rate, :base_currency_code, :addons,
54
+ :event_based_addons, :charged_event_based_addons, :coupon, :coupons, :shipping_address, :referral_info,
55
+ :invoice_notes, :meta_data, :metadata, :deleted, :changes_scheduled_at, :contract_term, :cancel_reason_code,
56
56
  :free_period, :free_period_unit, :create_pending_invoices, :auto_close_invoices
57
57
 
58
58
  # OPERATIONS
@@ -13,6 +13,10 @@ module ChargeBee
13
13
  # OPERATIONS
14
14
  #-----------
15
15
 
16
+ def self.create_unbilled_charge(params, env=nil, headers={})
17
+ Request.send('post', uri_path("unbilled_charges","create"), params, env, headers)
18
+ end
19
+
16
20
  def self.create(params, env=nil, headers={})
17
21
  Request.send('post', uri_path("unbilled_charges"), params, env, headers)
18
22
  end
@@ -6,21 +6,8 @@ module ChargeBee
6
6
  case value
7
7
  when Hash
8
8
  value.each do |k, v|
9
- if(v.kind_of? Hash)
9
+ if(v.kind_of? Hash or v.kind_of? Array)
10
10
  serialized.merge!(serialize(v, k))
11
- elsif(v.kind_of? Array)
12
- arrayContainsValue = false
13
- v.each_with_index do |v1, i1|
14
- if(v1.kind_of? Hash)
15
- serialized.merge!(serialize(v1, k, i1))
16
- else
17
- arrayContainsValue = true
18
- end
19
- end
20
- if(arrayContainsValue == true)
21
- key = "#{(prefix!=nil) ? prefix:''}#{(prefix!=nil) ? '['+k.to_s+']' : k}#{(idx != nil) ? '['+idx.to_s+']':''}"
22
- serialized.merge!({key => as_str(v)})
23
- end
24
11
  else
25
12
  key = "#{(prefix!=nil) ? prefix:''}#{(prefix!=nil) ? '['+k.to_s+']' : k}#{(idx != nil) ? '['+idx.to_s+']':''}"
26
13
  serialized.merge!({key => as_str(v)})
@@ -31,12 +18,12 @@ module ChargeBee
31
18
  serialized.merge!(serialize(v, prefix, i))
32
19
  end
33
20
  else
34
- if(idx != nil and prefix != nil)
21
+ if(idx != nil and prefix != nil)
35
22
  key = "#{prefix}[#{idx.to_s}]"
36
23
  serialized.merge!({key => as_str(value)})
37
- else
24
+ else
38
25
  raise ArgumentError.new("only hash or arrays are allowed as value")
39
- end
26
+ end
40
27
  end
41
28
  serialized
42
29
  end
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.13.1'
56
+ VERSION = '2.15.0'
57
57
 
58
58
  @@default_env = nil
59
59
  @@verify_ca_certs = true
@@ -23,20 +23,20 @@ describe "chargebee" do
23
23
  :cvv => "007"
24
24
  }
25
25
  }
26
- after = {
27
- "id"=>"sub_KyVq7DNSNM7CSD",
28
- "plan_id"=>"free",
29
- "addons[id][0]"=>"monitor",
30
- "addons[quantity][0]"=>"2",
31
- "addons[id][1]"=>"ssl",
32
- "addon_ids"=>"[\"addon_one\", \"addon_two\"]",
33
- "card[first_name]"=>"Rajaraman",
34
- "card[last_name]"=>"Santhanam",
35
- "card[number]"=>"4111111111111111",
36
- "card[expiry_month]"=>"1",
37
- "card[expiry_year]"=>"2024",
38
- "card[cvv]"=>"007"
39
- }
26
+ after = {
27
+ "id"=>"sub_KyVq7DNSNM7CSD",
28
+ "plan_id"=>"free",
29
+ "addons[id][0]"=>"monitor",
30
+ "addons[quantity][0]"=>"2",
31
+ "addons[id][1]"=>"ssl",
32
+ "addon_ids[0]"=>"addon_one",
33
+ "addon_ids[1]"=>"addon_two",
34
+ "card[first_name]"=>"Rajaraman",
35
+ "card[last_name]"=>"Santhanam",
36
+ "card[number]"=>"4111111111111111",
37
+ "card[expiry_month]"=>"1",
38
+ "card[expiry_year]"=>"2024",
39
+ "card[cvv]"=>"007"}
40
40
  expect(ChargeBee::Util.serialize(before)).to eq(after)
41
41
  end
42
42
 
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.13.1
4
+ version: 2.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajaraman S
@@ -9,88 +9,88 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-03-08 00:00:00.000000000 Z
12
+ date: 2022-04-25 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
- - - "<"
55
+ - - <
56
56
  - !ruby/object:Gem::Version
57
57
  version: 1.0.0
58
58
  type: :runtime
59
59
  prerelease: false
60
60
  version_requirements: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ">="
62
+ - - '>='
63
63
  - !ruby/object:Gem::Version
64
64
  version: 0.1.0
65
- - - "<"
65
+ - - <
66
66
  - !ruby/object:Gem::Version
67
67
  version: 1.0.0
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: rspec
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ~>
73
73
  - !ruby/object:Gem::Version
74
74
  version: 3.0.0
75
75
  type: :development
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - "~>"
79
+ - - ~>
80
80
  - !ruby/object:Gem::Version
81
81
  version: 3.0.0
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: mocha
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ">="
86
+ - - '>='
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ">="
93
+ - - '>='
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  description: Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com.
@@ -178,21 +178,22 @@ licenses:
178
178
  metadata: {}
179
179
  post_install_message:
180
180
  rdoc_options:
181
- - "--charset=UTF-8"
181
+ - --charset=UTF-8
182
182
  require_paths:
183
183
  - lib
184
184
  required_ruby_version: !ruby/object:Gem::Requirement
185
185
  requirements:
186
- - - ">="
186
+ - - '>='
187
187
  - !ruby/object:Gem::Version
188
188
  version: 1.9.3
189
189
  required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  requirements:
191
- - - ">="
191
+ - - '>='
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  requirements: []
195
- rubygems_version: 3.0.3
195
+ rubyforge_project:
196
+ rubygems_version: 2.4.5
196
197
  signing_key:
197
198
  specification_version: 2
198
199
  summary: Ruby client for Chargebee API.