diff --git a/CHANGELOG.md b/CHANGELOG.md index d692786..63e5e51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +### v2.73.0 (2026-06-12) +* * * +### New Resources: +- [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks) has been added. +- [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances) has been added. +- [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations) has been added. +- [`PromotionalGrant`](https://apidocs.chargebee.com/docs/api/promotional_grants) has been added. + + +### New Attributes: +- [`notes`](https://apidocs.chargebee.com/docs/api/credit_notes/credit-note-object#notes) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`layout`](https://apidocs.chargebee.com/docs/api/hosted_pages/hosted-page-object#layout) has been added to [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). + + +### New Parameters: +- [`sort_by`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#sort_by) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). + + +### New Enums: +- `available`, `exhausted`, `scheduled`, and `in_grace_period` have been added as new values enum `Status`. +- `subscription_created`, `subscription_changed`, `top_up`, `promotional_grants`, and `rollover` 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/grant_blocks/grant-block-object#account_type) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#unit_type) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/ledger_account_balances/ledger-account-balance-object#unit_type) in [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances). +- `allocation`, `capture`, `authorize`, `release_authorization`, `capture_authorization`, `expiry`, `void`, `rollover`, and `adjustment` have been added as new values to enum attribute [`type`](https://apidocs.chargebee.com/docs/api/ledger_operations/ledger-operation-object#type) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/ledger_operations/ledger-operation-object#unit_type) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `expires_at`, `created_at`, and `effective_from` have been added as new values to enum query parameter `sort_by.asc` 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). +- `expires_at`, `created_at`, and `effective_from` have been added as new values to enum query parameter `sort_by.desc` 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). +- `allocation`, `release_authorization`, `void`, `capture`, `rollover`, `adjustment`, `expiry`, `authorize`, and `capture_authorization` have been added as new values to enum query parameter `type.is` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `allocation`, `release_authorization`, `void`, `capture`, `rollover`, `adjustment`, `expiry`, `authorize`, and `capture_authorization` have been added as new values to enum query parameter `type.in` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `created_at` has been added as a new value to enum query parameter `sort_by.asc` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `created_at` has been added as a new value to enum query parameter `sort_by.desc` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `updated_at` and `created_at` have been added as new values to enum query parameter `sort_by.asc` in [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) of [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- `updated_at` and `created_at` have been added as new values to enum query parameter `sort_by.desc` in [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) of [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). + + + ### v2.72.0 (2026-06-08) * * * ### New Attributes: diff --git a/Gemfile.lock b/Gemfile.lock index 5f5a192..39d0378 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - chargebee (2.72.0) + chargebee (2.73.0) cgi (>= 0.1.0, < 1.0.0) GEM diff --git a/VERSION b/VERSION index 9e0b850..6406782 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.72.0 +2.73.0 diff --git a/chargebee.gemspec b/chargebee.gemspec index 93c99e7..a3aeccd 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.72.0' - s.date = '2026-06-08' + s.version = '2.73.0' + s.date = '2026-06-12' s.summary = "Ruby client for Chargebee API." s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com." s.metadata = { @@ -81,6 +81,7 @@ Gem::Specification.new do |s| lib/chargebee/models/filter_condition.rb lib/chargebee/models/gateway_error_detail.rb lib/chargebee/models/gift.rb + lib/chargebee/models/grant_block.rb lib/chargebee/models/hierarchy.rb lib/chargebee/models/hosted_page.rb lib/chargebee/models/impacted_customer.rb @@ -94,6 +95,8 @@ Gem::Specification.new do |s| lib/chargebee/models/item_entitlement.rb lib/chargebee/models/item_family.rb lib/chargebee/models/item_price.rb + lib/chargebee/models/ledger_account_balance.rb + lib/chargebee/models/ledger_operation.rb lib/chargebee/models/metadata.rb lib/chargebee/models/model.rb lib/chargebee/models/non_subscription.rb @@ -120,6 +123,7 @@ Gem::Specification.new do |s| lib/chargebee/models/price_variant.rb lib/chargebee/models/pricing_page_session.rb lib/chargebee/models/promotional_credit.rb + lib/chargebee/models/promotional_grant.rb lib/chargebee/models/purchase.rb lib/chargebee/models/quote.rb lib/chargebee/models/quote_entitlement.rb diff --git a/lib/chargebee.rb b/lib/chargebee.rb index 93108b3..973c55b 100644 --- a/lib/chargebee.rb +++ b/lib/chargebee.rb @@ -100,7 +100,7 @@ module ChargeBee - VERSION = '2.72.0' + VERSION = '2.73.0' @@default_env = nil @@verify_ca_certs = true diff --git a/lib/chargebee/models/credit_note.rb b/lib/chargebee/models/credit_note.rb index 74e441d..747edd1 100644 --- a/lib/chargebee/models/credit_note.rb +++ b/lib/chargebee/models/credit_note.rb @@ -61,7 +61,7 @@ class SiteDetailsAtCreation < Model :status, :vat_number, :date, :price_type, :currency_code, :total, :amount_allocated, :amount_refunded, :amount_available, :refunded_at, :voided_at, :generated_at, :resource_version, :updated_at, :channel, :line_items_next_offset, :sub_total, :sub_total_in_local_currency, :total_in_local_currency, - :local_currency_code, :round_off_amount, :fractional_correction, :line_items, :line_item_tiers, + :local_currency_code, :round_off_amount, :fractional_correction, :notes, :line_items, :line_item_tiers, :line_item_discounts, :line_item_taxes, :line_item_addresses, :discounts, :taxes, :tax_origin, :linked_refunds, :allocations, :deleted, :tax_category, :local_currency_exchange_rate, :create_reason_code, :vat_number_prefix, :business_entity_id, :shipping_address, :billing_address, :einvoice, :site_details_at_creation diff --git a/lib/chargebee/models/grant_block.rb b/lib/chargebee/models/grant_block.rb new file mode 100644 index 0000000..1e826f2 --- /dev/null +++ b/lib/chargebee/models/grant_block.rb @@ -0,0 +1,19 @@ +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, :metadata, + :grant_source, :created_at, :account_type, :unit_id, :unit_type + + # OPERATIONS + #----------- + + def self.list_grant_blocks(params, env=nil, headers={}) + jsonKeys = { + } + options = {} + Request.send('get', uri_path("grant_blocks"), params, env, headers,nil, true, jsonKeys, options) + end + + end # ~GrantBlock +end # ~ChargeBee \ No newline at end of file diff --git a/lib/chargebee/models/hosted_page.rb b/lib/chargebee/models/hosted_page.rb index 326392b..f35b59e 100644 --- a/lib/chargebee/models/hosted_page.rb +++ b/lib/chargebee/models/hosted_page.rb @@ -2,7 +2,7 @@ module ChargeBee class HostedPage < Model attr_accessor :id, :type, :url, :state, :failure_reason, :pass_thru_content, :embed, :created_at, - :expires_at, :updated_at, :resource_version, :checkout_info, :business_entity_id + :expires_at, :layout, :updated_at, :resource_version, :checkout_info, :business_entity_id class Content < Result end @@ -82,6 +82,7 @@ def self.update_card(params, env=nil, headers={}) Request.send('post', uri_path("hosted_pages","update_card"), params, env, headers,nil, false, jsonKeys, options) end + # @deprecated This method is deprecated and will be removed in a future version. def self.update_payment_method(params, env=nil, headers={}) jsonKeys = { } diff --git a/lib/chargebee/models/ledger_account_balance.rb b/lib/chargebee/models/ledger_account_balance.rb new file mode 100644 index 0000000..315a99d --- /dev/null +++ b/lib/chargebee/models/ledger_account_balance.rb @@ -0,0 +1,25 @@ +module ChargeBee + class LedgerAccountBalance < Model + + class ProvisionedBalance < Model + attr_accessor :total_balance, :usable_balance, :hold_amount + end + + 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 + + # OPERATIONS + #----------- + + def self.list_ledger_account_balances(params, env=nil, headers={}) + jsonKeys = { + } + options = {} + Request.send('get', uri_path("ledger_account_balances"), params, env, headers,nil, true, jsonKeys, options) + end + + end # ~LedgerAccountBalance +end # ~ChargeBee \ No newline at end of file diff --git a/lib/chargebee/models/ledger_operation.rb b/lib/chargebee/models/ledger_operation.rb new file mode 100644 index 0000000..393ce6b --- /dev/null +++ b/lib/chargebee/models/ledger_operation.rb @@ -0,0 +1,59 @@ +module ChargeBee + class LedgerOperation < Model + + attr_accessor :id, :type, :amount, :start_balance, :end_balance, :provisioned_start_balance, + :provisioned_end_balance, :overdraft_start_balance, :overdraft_end_balance, :parent_ledger_operation_id, + :ledger_operation_timestamp, :auto_release_timestamp, :metadata, :created_at, :modified_at, + :subscription_id, :unit_id, :unit_type + + # OPERATIONS + #----------- + + def self.retrieve_ledger_operation(id, env=nil, headers={}) + jsonKeys = { + } + options = {} + Request.send('get', uri_path("ledger_operations",id.to_s), {}, env, headers,nil, false, jsonKeys, options) + end + + def self.list_ledger_operations(params, env=nil, headers={}) + jsonKeys = { + } + options = {} + Request.send('get', uri_path("ledger_operations"), params, env, headers,nil, true, jsonKeys, options) + end + + def self.capture(params, env=nil, headers={}) + jsonKeys = { + :metadata => 0, + } + options = {} + Request.send('post', uri_path("ledger_operations","capture"), params, env, headers,nil, true, jsonKeys, options) + end + + def self.authorize(params, env=nil, headers={}) + jsonKeys = { + :metadata => 0, + } + options = {} + Request.send('post', uri_path("ledger_operations","authorize"), params, env, headers,nil, true, jsonKeys, options) + end + + def self.capture_authorization(params, env=nil, headers={}) + jsonKeys = { + :metadata => 0, + } + options = {} + Request.send('post', uri_path("ledger_operations","capture_authorization"), params, env, headers,nil, true, jsonKeys, options) + end + + def self.release_authorization(params, env=nil, headers={}) + jsonKeys = { + :metadata => 0, + } + options = {} + Request.send('post', uri_path("ledger_operations","release_authorization"), params, env, headers,nil, true, jsonKeys, options) + end + + end # ~LedgerOperation +end # ~ChargeBee \ No newline at end of file diff --git a/lib/chargebee/models/promotional_grant.rb b/lib/chargebee/models/promotional_grant.rb new file mode 100644 index 0000000..bb20e6d --- /dev/null +++ b/lib/chargebee/models/promotional_grant.rb @@ -0,0 +1,20 @@ +module ChargeBee + class PromotionalGrant < Model + + attr_accessor :subscription_id, :unit_id, :amount, :expires_at, :metadata + + # OPERATIONS + #----------- + + def self.promotional_grants(params, env=nil, headers={}) + jsonKeys = { + :metadata => 0, + } + options = { + :isIdempotent => true + } + Request.send('post', uri_path("promotional_grants"), params, env, headers,nil, true, jsonKeys, options) + end + + end # ~PromotionalGrant +end # ~ChargeBee \ No newline at end of file diff --git a/lib/chargebee/result.rb b/lib/chargebee/result.rb index c7e3a95..70d1124 100644 --- a/lib/chargebee/result.rb +++ b/lib/chargebee/result.rb @@ -593,6 +593,27 @@ def alert_status() return alert_status; end + def ledger_account_balance() + ledger_account_balance = get(:ledger_account_balance, LedgerAccountBalance, + {:provisioned_balance => LedgerAccountBalance::ProvisionedBalance, :overdraft_balance => LedgerAccountBalance::OverdraftBalance}); + return ledger_account_balance; + end + + def ledger_operation() + ledger_operation = get(:ledger_operation, LedgerOperation); + return ledger_operation; + end + + def grant_block() + grant_block = get(:grant_block, GrantBlock); + return grant_block; + end + + def promotional_grant() + promotional_grant = get(:promotional_grant, PromotionalGrant); + return promotional_grant; + end + def impacted_customer() impacted_customer = get(:impacted_customer, ImpactedCustomer, {:download => ImpactedCustomer::Download}); @@ -669,6 +690,18 @@ def personalized_offers() return personalized_offers; end + def ledger_operations() + ledger_operations = get_list(:ledger_operations, LedgerOperation, + {}); + return ledger_operations; + end + + def grant_blocks() + grant_blocks = get_list(:grant_blocks, GrantBlock, + {}); + return grant_blocks; + end + def to_s(*args) JSON.pretty_generate(@response)