From 42f19fdff399e421455eecd63a906f3374968fe9 Mon Sep 17 00:00:00 2001 From: cb-alish Date: Thu, 30 Jul 2026 14:37:40 +0530 Subject: [PATCH] Releasing v2.78.0 --- CHANGELOG.md | 58 +++++++++++++++++++ Gemfile.lock | 2 +- VERSION | 2 +- chargebee.gemspec | 6 +- lib/chargebee.rb | 4 +- lib/chargebee/models/alert.rb | 4 +- lib/chargebee/models/credit_unit.rb | 54 +++++++++++++++++ lib/chargebee/models/grant_block.rb | 7 ++- .../models/ledger_account_balance.rb | 3 +- lib/chargebee/models/ledger_entry.rb | 12 ++++ lib/chargebee/models/ledger_operation.rb | 14 ++++- lib/chargebee/result.rb | 16 +++++ 12 files changed, 168 insertions(+), 14 deletions(-) create mode 100644 lib/chargebee/models/credit_unit.rb create mode 100644 lib/chargebee/models/ledger_entry.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 947170a..63af661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,61 @@ +### v2.78.0 (2026-07-30) +* * * +### New Resources: +- [`CreditUnit`](https://apidocs.chargebee.com/docs/api/credit_units) has been added. +- [`LedgerEntry`](https://apidocs.chargebee.com/docs/api/ledger_entries) has been added. + + +### New Actions: +- [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) has been added to [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). + + +### New Attributes: +- [`unit_id`](https://apidocs.chargebee.com/docs/api/alerts/alert-object#unit_id) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`subscription_id`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#subscription_id) has been added to [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`modified_at`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#modified_at) has been added to [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`resource_version`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#resource_version) has been added to [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`created_at`](https://apidocs.chargebee.com/docs/api/ledger_account_balances/ledger-account-balance-object#created_at) has been added to [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances). +- [`resource_version`](https://apidocs.chargebee.com/docs/api/ledger_account_balances/ledger-account-balance-object#resource_version) has been added to [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances). + + +### New Parameters: +- [`account_type`](https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks#account_type) has been added as query parameter to [`list_grant_blocks`](https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`unit_id`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#unit_id) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`include_cancellation_day_in_billing`](https://apidocs.chargebee.com/docs/api/estimates/cancel-subscription-for-items-estimate#include_cancellation_day_in_billing) has been added as request body parameter to [`cancel_subscription_for_items_estimate`](https://apidocs.chargebee.com/docs/api/estimates/cancel-subscription-for-items-estimate) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`subscription_id`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#subscription_id) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- [`unit_id`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#unit_id) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- [`amount`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#amount) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- [`expires_at`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#expires_at) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- [`metadata`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#metadata) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- [`include_cancellation_day_in_billing`](https://apidocs.chargebee.com/docs/api/subscriptions/cancel-subscription-for-items#include_cancellation_day_in_billing) has been added as request body parameter to [`cancel_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/cancel-subscription-for-items) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). + + +### New Events: +- [`grant_blocks_created`](https://apidocs.chargebee.com/docs/api/events/webhook/grant_blocks_created) has been added. +- [`ledger_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/ledger_updated) has been added. +- [`ledger_account_balance_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/ledger_account_balance_updated) has been added. +- [`grant_blocks_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/grant_blocks_updated) has been added. + + +### New Enums: +- `ledger_account_balance_updated`, `grant_blocks_created`, `grant_blocks_updated`, and `ledger_updated` have been added as new values enum `EventType`. +- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values enum `PaymentMethod`. +- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values enum `PaymentMethodType`. +- `dana`, `touch_n_go`, `tamara`, `qpay`, `credit_balance_dropped`, `credit`, `debit`, `hold`, and `unhold` have been added as new values enum `Type`. +- `active` and `archived` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/credit_units/credit-unit-object#status) in [`CreditUnit`](https://apidocs.chargebee.com/docs/api/credit_units). +- `grant_renewal` and `subscription_renewed` have been added as new values to enum attribute [`grant_source`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#grant_source) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `provisioned` and `overdraft` have been added as new values to enum attribute [`account_type`](https://apidocs.chargebee.com/docs/api/ledger_entries/ledger-entry-object#account_type) in [`LedgerEntry`](https://apidocs.chargebee.com/docs/api/ledger_entries). +- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/ledger_entries/ledger-entry-object#unit_type) in [`LedgerEntry`](https://apidocs.chargebee.com/docs/api/ledger_entries). +- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values to enum attribute [`payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values to enum attribute [`active_payment_attempt.payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#active_payment_attempt_payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `archived` and `active` have been added as new values to enum query parameter `status.in` in [`list_credit_units`](https://apidocs.chargebee.com/docs/api/credit_units/list-credit-units) of [`CreditUnit`](https://apidocs.chargebee.com/docs/api/credit_units). +- `archived` and `active` have been added as new values to enum query parameter `status.is` in [`list_credit_units`](https://apidocs.chargebee.com/docs/api/credit_units/list-credit-units) of [`CreditUnit`](https://apidocs.chargebee.com/docs/api/credit_units). +- `provisioned` and `overdraft` have been added as new values to enum query parameter `account_type.is` in [`list_grant_blocks`](https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks) of [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values to enum request body parameter `payment_method_type` in [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values to enum request body parameter `payment_method_type` in [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). + + + ### v2.77.0 (2026-07-21) * * * ### New Resources: diff --git a/Gemfile.lock b/Gemfile.lock index 18c4a70..f7752ad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - chargebee (2.77.0) + chargebee (2.78.0) cgi (>= 0.1.0, < 1.0.0) GEM diff --git a/VERSION b/VERSION index 581bd1a..63221e3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.77.0 +2.78.0 diff --git a/chargebee.gemspec b/chargebee.gemspec index 62cf007..3adb72f 100644 --- a/chargebee.gemspec +++ b/chargebee.gemspec @@ -4,8 +4,8 @@ Gem::Specification.new do |s| s.rubygems_version = '1.3.5' s.required_ruby_version = '>= 1.9.3' s.name = 'chargebee' - s.version = '2.77.0' - s.date = '2026-07-21' + s.version = '2.78.0' + s.date = '2026-07-30' s.summary = "Ruby client for Chargebee API." s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com." s.metadata = { @@ -67,6 +67,7 @@ Gem::Specification.new do |s| lib/chargebee/models/cpq_quote_signature.rb lib/chargebee/models/credit_note.rb lib/chargebee/models/credit_note_estimate.rb + lib/chargebee/models/credit_unit.rb lib/chargebee/models/csv_tax_rule.rb lib/chargebee/models/currency.rb lib/chargebee/models/customer.rb @@ -99,6 +100,7 @@ Gem::Specification.new do |s| lib/chargebee/models/item_family.rb lib/chargebee/models/item_price.rb lib/chargebee/models/ledger_account_balance.rb + lib/chargebee/models/ledger_entry.rb lib/chargebee/models/ledger_operation.rb lib/chargebee/models/metadata.rb lib/chargebee/models/meter.rb diff --git a/lib/chargebee.rb b/lib/chargebee.rb index 7ebe7db..504af93 100644 --- a/lib/chargebee.rb +++ b/lib/chargebee.rb @@ -41,6 +41,7 @@ require File.dirname(__FILE__) + '/chargebee/models/cpq_quote_signature' require File.dirname(__FILE__) + '/chargebee/models/credit_note' require File.dirname(__FILE__) + '/chargebee/models/credit_note_estimate' +require File.dirname(__FILE__) + '/chargebee/models/credit_unit' require File.dirname(__FILE__) + '/chargebee/models/currency' require File.dirname(__FILE__) + '/chargebee/models/customer' require File.dirname(__FILE__) + '/chargebee/models/customer_entitlement' @@ -72,6 +73,7 @@ require File.dirname(__FILE__) + '/chargebee/models/item_family' require File.dirname(__FILE__) + '/chargebee/models/item_price' require File.dirname(__FILE__) + '/chargebee/models/ledger_account_balance' +require File.dirname(__FILE__) + '/chargebee/models/ledger_entry' require File.dirname(__FILE__) + '/chargebee/models/ledger_operation' require File.dirname(__FILE__) + '/chargebee/models/metadata' require File.dirname(__FILE__) + '/chargebee/models/meter' @@ -134,7 +136,7 @@ module ChargeBee - VERSION = '2.77.0' + VERSION = '2.78.0' @@default_env = nil @@verify_ca_certs = true diff --git a/lib/chargebee/models/alert.rb b/lib/chargebee/models/alert.rb index 0a04dbb..219520a 100644 --- a/lib/chargebee/models/alert.rb +++ b/lib/chargebee/models/alert.rb @@ -9,8 +9,8 @@ class FilterCondition < Model attr_accessor :field, :operator, :value end - attr_accessor :id, :type, :name, :description, :metered_feature_id, :currency_code, :subscription_id, - :status, :meta, :created_at, :updated_at, :threshold, :filter_conditions + attr_accessor :id, :type, :name, :description, :metered_feature_id, :currency_code, :unit_id, + :subscription_id, :status, :meta, :created_at, :updated_at, :threshold, :filter_conditions # OPERATIONS #----------- diff --git a/lib/chargebee/models/credit_unit.rb b/lib/chargebee/models/credit_unit.rb new file mode 100644 index 0000000..0ba561a --- /dev/null +++ b/lib/chargebee/models/credit_unit.rb @@ -0,0 +1,54 @@ +module ChargeBee + class CreditUnit < Model + + attr_accessor :id, :name, :external_name, :status, :resource_version, :updated_at, :created_at, + :created_by, :updated_by, :is_unlimited, :overdraft_amount + + # OPERATIONS + #----------- + + def self.list(params={}, env=nil, headers={}) + jsonKeys = { + } + options = {} + Request.send_list_request('get', uri_path("credit_units"), params, env, headers,nil, false, jsonKeys, options, "creditUnit", "list") + end + + def self.create(params, env=nil, headers={}) + jsonKeys = { + } + options = { + :isIdempotent => true + } + Request.send('post', uri_path("credit_units"), params, env, headers,nil, false, jsonKeys, options, "creditUnit", "create") + end + + def self.update(id, params={}, env=nil, headers={}) + jsonKeys = { + } + options = { + :isIdempotent => true + } + Request.send('post', uri_path("credit_units",id.to_s), params, env, headers,nil, false, jsonKeys, options, "creditUnit", "update") + end + + def self.archive(id, env=nil, headers={}) + jsonKeys = { + } + options = { + :isIdempotent => true + } + Request.send('post', uri_path("credit_units",id.to_s,"archive_command"), {}, env, headers,nil, false, jsonKeys, options, "creditUnit", "archive") + end + + def self.reactivate(id, env=nil, headers={}) + jsonKeys = { + } + options = { + :isIdempotent => true + } + Request.send('post', uri_path("credit_units",id.to_s,"reactivate_command"), {}, env, headers,nil, false, jsonKeys, options, "creditUnit", "reactivate") + end + + end # ~CreditUnit +end # ~ChargeBee \ No newline at end of file diff --git a/lib/chargebee/models/grant_block.rb b/lib/chargebee/models/grant_block.rb index 1abfd9c..e79c9af 100644 --- a/lib/chargebee/models/grant_block.rb +++ b/lib/chargebee/models/grant_block.rb @@ -1,9 +1,10 @@ module ChargeBee class GrantBlock < Model - attr_accessor :id, :granted_amount, :effective_from, :expires_at, :balance, :hold_amount, :used_amount, - :expired_amount, :rolled_over_amount, :voided_amount, :origin_grant_block_id, :status, :grant_source, - :created_at, :account_type, :unit_id, :unit_type, :metadata + attr_accessor :id, :subscription_id, :account_type, :unit_id, :unit_type, :granted_amount, :effective_from, + :expires_at, :balance, :hold_amount, :used_amount, :expired_amount, :rolled_over_amount, :voided_amount, + :origin_grant_block_id, :status, :grant_source, :created_at, :modified_at, :resource_version, + :metadata # OPERATIONS #----------- diff --git a/lib/chargebee/models/ledger_account_balance.rb b/lib/chargebee/models/ledger_account_balance.rb index 565d38f..e3dceaa 100644 --- a/lib/chargebee/models/ledger_account_balance.rb +++ b/lib/chargebee/models/ledger_account_balance.rb @@ -9,7 +9,8 @@ class OverdraftBalance < Model attr_accessor :is_unlimited, :limit, :total_balance, :usable_balance, :used_amount, :hold_amount end - attr_accessor :subscription_id, :unit_id, :unit_type, :modified_at, :provisioned_balance, :overdraft_balance + attr_accessor :subscription_id, :unit_id, :unit_type, :created_at, :modified_at, :resource_version, + :provisioned_balance, :overdraft_balance # OPERATIONS #----------- diff --git a/lib/chargebee/models/ledger_entry.rb b/lib/chargebee/models/ledger_entry.rb new file mode 100644 index 0000000..6fa1cb2 --- /dev/null +++ b/lib/chargebee/models/ledger_entry.rb @@ -0,0 +1,12 @@ +module ChargeBee + class LedgerEntry < Model + + attr_accessor :id, :subscription_id, :account_type, :unit_id, :unit_type, :amount, :grant_block_start_balance, + :grant_block_end_balance, :account_start_balance, :account_end_balance, :type, :ledger_operation_id, + :grant_block_id, :created_at, :modified_at + + # OPERATIONS + #----------- + + end # ~LedgerEntry +end # ~ChargeBee \ No newline at end of file diff --git a/lib/chargebee/models/ledger_operation.rb b/lib/chargebee/models/ledger_operation.rb index 54c54a1..10173cc 100644 --- a/lib/chargebee/models/ledger_operation.rb +++ b/lib/chargebee/models/ledger_operation.rb @@ -1,9 +1,9 @@ module ChargeBee class LedgerOperation < Model - attr_accessor :id, :type, :amount, :provisioned_start_balance, :provisioned_end_balance, :overdraft_start_balance, - :overdraft_end_balance, :parent_ledger_operation_id, :ledger_operation_timestamp, :auto_release_timestamp, - :created_at, :modified_at, :subscription_id, :unit_id, :unit_type, :metadata + attr_accessor :id, :subscription_id, :unit_id, :unit_type, :type, :amount, :provisioned_start_balance, + :provisioned_end_balance, :overdraft_start_balance, :overdraft_end_balance, :parent_ledger_operation_id, + :ledger_operation_timestamp, :auto_release_timestamp, :created_at, :modified_at, :metadata # OPERATIONS #----------- @@ -54,5 +54,13 @@ def self.release_authorization(params, env=nil, headers={}) Request.send('post', uri_path("ledger_operations","release_authorization"), params, env, headers,nil, true, jsonKeys, options, "ledgerOperation", "releaseAuthorization") end + def self.allocate(params, env=nil, headers={}) + jsonKeys = { + :metadata => 0, + } + options = {} + Request.send('post', uri_path("ledger_operations","allocate"), params, env, headers,nil, true, jsonKeys, options, "ledgerOperation", "allocate") + end + end # ~LedgerOperation end # ~ChargeBee \ No newline at end of file diff --git a/lib/chargebee/result.rb b/lib/chargebee/result.rb index a009fea..1b029b7 100644 --- a/lib/chargebee/result.rb +++ b/lib/chargebee/result.rb @@ -414,6 +414,11 @@ def metadata() return metadata; end + def credit_unit() + credit_unit = get(:credit_unit, CreditUnit); + return credit_unit; + end + def subscription_entitlement() subscription_entitlement = get(:subscription_entitlement, SubscriptionEntitlement, {:component => SubscriptionEntitlement::Component}); @@ -644,6 +649,11 @@ def grant_block() return grant_block; end + def ledger_entry() + ledger_entry = get(:ledger_entry, LedgerEntry); + return ledger_entry; + end + def promotional_grant() promotional_grant = get(:promotional_grant, PromotionalGrant); return promotional_grant; @@ -737,6 +747,12 @@ def grant_blocks() return grant_blocks; end + def ledger_entries() + ledger_entries = get_list(:ledger_entries, LedgerEntry, + {}); + return ledger_entries; + end + def to_s(*args) JSON.pretty_generate(@response)