chargebee 2.44.0 → 2.45.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
2
  SHA1:
3
- metadata.gz: 44da361071398b749b3cfe048a50212229dc63d5
4
- data.tar.gz: 61146139b6c738cdec5dfd56365896c0ab8ebcc6
3
+ metadata.gz: b208888f008a46366fe669c8e57d02499d746c17
4
+ data.tar.gz: b442b3269d75b8f48cbf7c5419d505d5c064c471
5
5
  SHA512:
6
- metadata.gz: 2d3d45972fb75a39b58c075ede16dd7478a883b7aff76777434bbe7b803f25d4f31aee680f44898fbcab524943b6a23761f326a5af414aeb2445bc92c69c8a3a
7
- data.tar.gz: 9f0ebf9ce1b70a1d5d59c0f7001a02701bc9aacf1a5dbbbfecb1eb766321c02e90084cb6286a6cd41716525f9e31b3265d2d2a9d646f9c5f0d2e546babcac890
6
+ metadata.gz: 5ea145f8734b23ac354601d483db3558989cf2d1f23bbe9fcdf4a76ba38591df9a6e9e9dd9fd0b11753cc615818298987ae9e8d5ccf85106179bf4ade88db351
7
+ data.tar.gz: 9ec01d94c69b6bb3fd7bba84611bf1dfb63de1aff226c8fa02f952ce029a23ad909174f4de302ca7147149ca05d96bd67c747cdcfbed42356c40f368edb3f480
data/CHANGELOG.md CHANGED
@@ -1,3 +1,33 @@
1
+ ### v2.45.0 (2024-10-17)
2
+ * * *
3
+
4
+ #### New Resource:
5
+ * PaymentScheduleEstimate has been added.
6
+
7
+ ### New Attributes:
8
+ * payment_schedule_estimates has been added to Estimate.
9
+ * usage_accumulation_reset_frequency has been added to ItemPrice.
10
+ * name has been added to PaymentScheduleScheme.
11
+ * usage_accumulation_reset_frequency has been added to QuotedSubscription#SubscriptionItem.
12
+ * usage_accumulation_reset_frequency has been added to Subscription#SubscriptionItem.
13
+
14
+ ### New Endpoints:
15
+ * Estimate#PaymentSchedule has been added.
16
+
17
+ ### New Input Params:
18
+ * usage_accumulation_reset_frequency has been added to ItemPrice#CreateParams.
19
+ * usage_accumulation_reset_frequency has been added to ItemPrice#UpdateParams.
20
+ * discounts has been added to PricingPageSession#CreateForNewSubscriptionParams.
21
+ * discounts has been added to PricingPageSession#CreateForExistingSubscriptionParams.
22
+ * invoice_immediately has been added to Quote#ConvertParams.
23
+
24
+ ### v2.44.1 (2024-10-03)
25
+ * * *
26
+
27
+ #### Bug Fixes:
28
+ * metadata field not working bug fixed.
29
+ * meta_data field not working bug fixed.
30
+
1
31
  ### v2.44.0 (2024-09-19)
2
32
  * * *
3
33
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chargebee (2.44.0)
4
+ chargebee (2.45.0)
5
5
  cgi (>= 0.1.0, < 1.0.0)
6
6
  json_pure (~> 2.1)
7
7
  rest-client (>= 1.8, <= 2.0.2)
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.44.0'
8
- s.date = '2024-09-19'
7
+ s.version = '2.45.0'
8
+ s.date = '2024-10-17'
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
  s.metadata = {
@@ -92,6 +92,7 @@ Gem::Specification.new do |s|
92
92
  lib/chargebee/models/payment_intent.rb
93
93
  lib/chargebee/models/payment_reference_number.rb
94
94
  lib/chargebee/models/payment_schedule.rb
95
+ lib/chargebee/models/payment_schedule_estimate.rb
95
96
  lib/chargebee/models/payment_schedule_scheme.rb
96
97
  lib/chargebee/models/payment_source.rb
97
98
  lib/chargebee/models/payment_voucher.rb
@@ -2,7 +2,8 @@ module ChargeBee
2
2
  class Estimate < Model
3
3
 
4
4
  attr_accessor :created_at, :subscription_estimate, :subscription_estimates, :invoice_estimate,
5
- :invoice_estimates, :next_invoice_estimate, :credit_note_estimates, :unbilled_charge_estimates
5
+ :invoice_estimates, :payment_schedule_estimates, :next_invoice_estimate, :credit_note_estimates,
6
+ :unbilled_charge_estimates
6
7
 
7
8
  # OPERATIONS
8
9
  #-----------
@@ -83,5 +84,9 @@ module ChargeBee
83
84
  Request.send('post', uri_path("estimates","create_invoice_for_items"), params, env, headers)
84
85
  end
85
86
 
87
+ def self.payment_schedules(params, env=nil, headers={})
88
+ Request.send('post', uri_path("estimates","payment_schedules"), params, env, headers)
89
+ end
90
+
86
91
  end # ~Estimate
87
92
  end # ~ChargeBee
@@ -21,9 +21,9 @@ module ChargeBee
21
21
  :price_variant_id, :proration_type, :pricing_model, :price, :price_in_decimal, :period, :currency_code,
22
22
  :period_unit, :trial_period, :trial_period_unit, :trial_end_action, :shipping_period, :shipping_period_unit,
23
23
  :billing_cycles, :free_quantity, :free_quantity_in_decimal, :channel, :resource_version, :updated_at,
24
- :created_at, :archived_at, :invoice_notes, :tiers, :is_taxable, :tax_detail, :tax_providers_fields,
25
- :accounting_detail, :metadata, :item_type, :archivable, :parent_item_id, :show_description_in_invoices,
26
- :show_description_in_quotes
24
+ :created_at, :usage_accumulation_reset_frequency, :archived_at, :invoice_notes, :tiers, :is_taxable,
25
+ :tax_detail, :tax_providers_fields, :accounting_detail, :metadata, :item_type, :archivable,
26
+ :parent_item_id, :show_description_in_invoices, :show_description_in_quotes
27
27
 
28
28
  # OPERATIONS
29
29
  #-----------
@@ -0,0 +1,14 @@
1
+ module ChargeBee
2
+ class PaymentScheduleEstimate < Model
3
+
4
+ class ScheduleEntry < Model
5
+ attr_accessor :id, :date, :amount, :status
6
+ end
7
+
8
+ attr_accessor :id, :scheme_id, :entity_type, :entity_id, :amount, :currency_code, :schedule_entries
9
+
10
+ # OPERATIONS
11
+ #-----------
12
+
13
+ end # ~PaymentScheduleEstimate
14
+ end # ~ChargeBee
@@ -5,8 +5,8 @@ module ChargeBee
5
5
  attr_accessor :period, :amount_percentage
6
6
  end
7
7
 
8
- attr_accessor :id, :description, :number_of_schedules, :period_unit, :period, :created_at, :resource_version,
9
- :updated_at, :preferred_schedules
8
+ attr_accessor :id, :name, :description, :number_of_schedules, :period_unit, :period, :created_at,
9
+ :resource_version, :updated_at, :preferred_schedules
10
10
 
11
11
  # OPERATIONS
12
12
  #-----------
@@ -14,7 +14,7 @@ module ChargeBee
14
14
  end
15
15
 
16
16
  class SubscriptionItem < Model
17
- attr_accessor :item_price_id, :item_type, :quantity, :quantity_in_decimal, :metered_quantity, :last_calculated_at, :unit_price, :unit_price_in_decimal, :amount, :amount_in_decimal, :billing_period, :billing_period_unit, :free_quantity, :free_quantity_in_decimal, :trial_end, :billing_cycles, :service_period_days, :charge_on_event, :charge_once, :charge_on_option, :proration_type
17
+ attr_accessor :item_price_id, :item_type, :quantity, :quantity_in_decimal, :metered_quantity, :last_calculated_at, :unit_price, :unit_price_in_decimal, :amount, :amount_in_decimal, :billing_period, :billing_period_unit, :free_quantity, :free_quantity_in_decimal, :trial_end, :billing_cycles, :service_period_days, :charge_on_event, :charge_once, :charge_on_option, :proration_type, :usage_accumulation_reset_frequency
18
18
  end
19
19
 
20
20
  class ItemTier < Model
@@ -2,7 +2,7 @@ module ChargeBee
2
2
  class Subscription < Model
3
3
 
4
4
  class SubscriptionItem < Model
5
- attr_accessor :item_price_id, :item_type, :quantity, :quantity_in_decimal, :metered_quantity, :last_calculated_at, :unit_price, :unit_price_in_decimal, :amount, :amount_in_decimal, :billing_period, :billing_period_unit, :free_quantity, :free_quantity_in_decimal, :trial_end, :billing_cycles, :service_period_days, :charge_on_event, :charge_once, :charge_on_option, :proration_type
5
+ attr_accessor :item_price_id, :item_type, :quantity, :quantity_in_decimal, :metered_quantity, :last_calculated_at, :unit_price, :unit_price_in_decimal, :amount, :amount_in_decimal, :billing_period, :billing_period_unit, :free_quantity, :free_quantity_in_decimal, :trial_end, :billing_cycles, :service_period_days, :charge_on_event, :charge_once, :charge_on_option, :proration_type, :usage_accumulation_reset_frequency
6
6
  end
7
7
 
8
8
  class ItemTier < Model
@@ -154,7 +154,7 @@ module ChargeBee
154
154
 
155
155
  def estimate()
156
156
  estimate = get(:estimate, Estimate, {},
157
- {:subscription_estimate => SubscriptionEstimate, :subscription_estimates => SubscriptionEstimate, :invoice_estimate => InvoiceEstimate, :invoice_estimates => InvoiceEstimate, :next_invoice_estimate => InvoiceEstimate, :credit_note_estimates => CreditNoteEstimate, :unbilled_charge_estimates => UnbilledCharge});
157
+ {:subscription_estimate => SubscriptionEstimate, :subscription_estimates => SubscriptionEstimate, :invoice_estimate => InvoiceEstimate, :invoice_estimates => InvoiceEstimate, :payment_schedule_estimates => PaymentScheduleEstimate, :next_invoice_estimate => InvoiceEstimate, :credit_note_estimates => CreditNoteEstimate, :unbilled_charge_estimates => UnbilledCharge});
158
158
  estimate.init_dependant(@response[:estimate], :subscription_estimate,
159
159
  {:shipping_address => SubscriptionEstimate::ShippingAddress, :contract_term => SubscriptionEstimate::ContractTerm});
160
160
  estimate.init_dependant(@response[:estimate], :invoice_estimate,
@@ -165,6 +165,8 @@ module ChargeBee
165
165
  {:shipping_address => SubscriptionEstimate::ShippingAddress, :contract_term => SubscriptionEstimate::ContractTerm});
166
166
  estimate.init_dependant_list(@response[:estimate], :invoice_estimates,
167
167
  {:line_items => InvoiceEstimate::LineItem, :discounts => InvoiceEstimate::Discount, :taxes => InvoiceEstimate::Tax, :line_item_taxes => InvoiceEstimate::LineItemTax, :line_item_tiers => InvoiceEstimate::LineItemTier, :line_item_discounts => InvoiceEstimate::LineItemDiscount});
168
+ estimate.init_dependant_list(@response[:estimate], :payment_schedule_estimates,
169
+ {:schedule_entries => PaymentScheduleEstimate::ScheduleEntry});
168
170
  estimate.init_dependant_list(@response[:estimate], :credit_note_estimates,
169
171
  {:line_items => CreditNoteEstimate::LineItem, :discounts => CreditNoteEstimate::Discount, :taxes => CreditNoteEstimate::Tax, :line_item_taxes => CreditNoteEstimate::LineItemTax, :line_item_discounts => CreditNoteEstimate::LineItemDiscount, :line_item_tiers => CreditNoteEstimate::LineItemTier});
170
172
  estimate.init_dependant_list(@response[:estimate], :unbilled_charge_estimates,
@@ -6,7 +6,9 @@ module ChargeBee
6
6
  case value
7
7
  when Hash
8
8
  value.each do |k, v|
9
- if(v.kind_of? Hash or v.kind_of? Array)
9
+ if k == :metadata or k == :meta_data # metadata is encoded as a JSON string instead of URL-encoded.
10
+ serialized.merge!({k.to_s => as_str(v)})
11
+ elsif(v.kind_of? Hash or v.kind_of? Array)
10
12
  serialized.merge!(serialize(v, k))
11
13
  else
12
14
  key = "#{(prefix!=nil) ? prefix:''}#{(prefix!=nil) ? '['+k.to_s+']' : k}#{(idx != nil) ? '['+idx.to_s+']':''}"
@@ -17,7 +19,7 @@ module ChargeBee
17
19
  value.each_with_index do |v, i|
18
20
  serialized.merge!(serialize(v, prefix, i))
19
21
  end
20
- else
22
+ else
21
23
  if(idx != nil and prefix != nil)
22
24
  key = "#{prefix}[#{idx.to_s}]"
23
25
  serialized.merge!({key => as_str(value)})
data/lib/chargebee.rb CHANGED
@@ -77,10 +77,12 @@ require File.dirname(__FILE__) + '/chargebee/models/metadata'
77
77
  require File.dirname(__FILE__) + '/chargebee/models/customer_entitlement'
78
78
  require File.dirname(__FILE__) + '/chargebee/models/payment_schedule'
79
79
  require File.dirname(__FILE__) + '/chargebee/models/payment_schedule_scheme'
80
+ require File.dirname(__FILE__) + '/chargebee/models/payment_schedule_estimate'
81
+
80
82
 
81
83
  module ChargeBee
82
84
 
83
- VERSION = '2.44.0'
85
+ VERSION = '2.45.0'
84
86
 
85
87
  @@default_env = nil
86
88
  @@verify_ca_certs = true
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.44.0
4
+ version: 2.45.0
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: 2024-09-19 00:00:00.000000000 Z
12
+ date: 2024-10-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_pure
@@ -165,6 +165,7 @@ files:
165
165
  - lib/chargebee/models/payment_intent.rb
166
166
  - lib/chargebee/models/payment_reference_number.rb
167
167
  - lib/chargebee/models/payment_schedule.rb
168
+ - lib/chargebee/models/payment_schedule_estimate.rb
168
169
  - lib/chargebee/models/payment_schedule_scheme.rb
169
170
  - lib/chargebee/models/payment_source.rb
170
171
  - lib/chargebee/models/payment_voucher.rb