Release v2.73.0#123
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
PR Complexity Score: 3.8 - Simple
View Breakdown
- Lines Changed: 212
- Files Changed: 12
- Complexity Added: 15
- Raw Score: 62.74
Overview
This PR releases version 2.73.0 of the Chargebee Ruby client, introducing new models and API operations for grant blocks, ledger account balances/operations, and promotional grants. It also extends existing models (CreditNote, HostedPage, OmnichannelSubscription) with new attributes and sorting/query parameters. The Result wrapper is updated to expose the new resources and lists.
Key Changes
- Bumps gem version to 2.73.0 with updated date and changelog entry documenting the new APIs and enums.
- Adds
GrantBlockmodel with support for listing grant blocks and richer enum values around status, grant source, account type, and unit type. - Adds
LedgerAccountBalancemodel, including nestedProvisionedBalanceandOverdraftBalancestructures, and alist_ledger_account_balancesAPI. - Adds
LedgerOperationmodel with retrieve, list, and operation APIs (capture,authorize,capture_authorization,release_authorization) plus expandedtypeandunit_typeenums and sorting/filtering options. - Adds
PromotionalGrantmodel with an idempotentpromotional_grantscreation API. - Extends
CreditNotewith anotesattribute andHostedPagewith alayoutattribute. - Adds a
sort_byquery parameter (withcreated_at/updated_atoptions) tolist_omnichannel_subscriptions. - Updates
Resultto expose single-resource getters (ledger_account_balance,ledger_operation,grant_block,promotional_grant) and list getters (ledger_operations,grant_blocks). - Marks
HostedPage.update_payment_methodas deprecated.
Risks & Considerations
- New models and operations rely on backend API support; clients must ensure the Chargebee API version they target includes grant blocks, ledger operations, and promotional grants.
- Expanded enum values for statuses, types, and unit types could affect client-side logic that assumes a smaller set of possible values.
- The new list and sort parameters may change default ordering or filtering behavior if client code passes them incorrectly.
- Deprecation of
HostedPage.update_payment_methodsignals future removal; consumers should migrate to the recommended alternative before upgrading further.
File-level change summary
| File | Change summary |
|---|---|
| CHANGELOG.md | Adds v2.73.0 release notes describing new resources, attributes, parameters, and enum values. |
| Gemfile.lock | Updates the local chargebee gem version reference from 2.72.0 to 2.73.0. |
| VERSION | Bumps the library version string from 2.72.0 to 2.73.0. |
| chargebee.gemspec | Updates gem version/date and includes new model files (grant_block, ledger_account_balance, ledger_operation, promotional_grant) in the gem. |
| lib/chargebee.rb | Updates the ChargeBee::VERSION constant to 2.73.0. |
| lib/chargebee/models/credit_note.rb | Adds the notes attribute to the CreditNote model. |
| lib/chargebee/models/grant_block.rb | Introduces the GrantBlock model with attributes and a list_grant_blocks API method. |
| lib/chargebee/models/hosted_page.rb | Adds a layout attribute and marks update_payment_method as deprecated. |
| lib/chargebee/models/ledger_account_balance.rb | Introduces the LedgerAccountBalance model with nested balance types and a list_ledger_account_balances API method. |
| lib/chargebee/models/ledger_operation.rb | Introduces the LedgerOperation model with retrieve, list, and capture/authorize-related API methods. |
| lib/chargebee/models/promotional_grant.rb | Introduces the PromotionalGrant model with an idempotent promotional_grants creation API method. |
| lib/chargebee/result.rb | Adds getters for new single resources and list accessors for ledger operations and grant blocks to the Result wrapper. |
| 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 |
There was a problem hiding this comment.
Priority: 🟠 HIGH
Problem: The capture, authorize, capture_authorization, and release_authorization methods pass true for the boolean argument to Request.send, which is used to indicate a list response in the same file (list_ledger_operations), causing these single-operation endpoints to be treated as list endpoints.
Why: Treating a single-resource response as a list can break result parsing, e.g., callers expecting Result#ledger_operation may not work correctly if the internal Result is configured for list semantics, leading to runtime errors or incorrect data handling.
How to Fix: Change the boolean argument in these four Request.send calls from true to false so that these methods are handled as single-resource operations, consistent with retrieve_ledger_operation.
| 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 | |
| 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, false, 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, false, 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, false, 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, false, jsonKeys, options) | |
| end |
v2.73.0 (2026-06-12)
New Resources:
GrantBlockhas been added.LedgerAccountBalancehas been added.LedgerOperationhas been added.PromotionalGranthas been added.New Attributes:
noteshas been added toCreditNote.layouthas been added toHostedPage.New Parameters:
sort_byhas been added as query parameter tolist_omnichannel_subscriptionsinOmnichannelSubscription.New Enums:
available,exhausted,scheduled, andin_grace_periodhave been added as new values enumStatus.subscription_created,subscription_changed,top_up,promotional_grants, androlloverhave been added as new values to enum attributegrant_sourceinGrantBlock.provisionedandoverdrafthave been added as new values to enum attributeaccount_typeinGrantBlock.credit_unithas been added as a new value to enum attributeunit_typeinGrantBlock.credit_unithas been added as a new value to enum attributeunit_typeinLedgerAccountBalance.allocation,capture,authorize,release_authorization,capture_authorization,expiry,void,rollover, andadjustmenthave been added as new values to enum attributetypeinLedgerOperation.credit_unithas been added as a new value to enum attributeunit_typeinLedgerOperation.expires_at,created_at, andeffective_fromhave been added as new values to enum query parametersort_by.ascinlist_grant_blocksofGrantBlock.expires_at,created_at, andeffective_fromhave been added as new values to enum query parametersort_by.descinlist_grant_blocksofGrantBlock.allocation,release_authorization,void,capture,rollover,adjustment,expiry,authorize, andcapture_authorizationhave been added as new values to enum query parametertype.isinlist_ledger_operationsofLedgerOperation.allocation,release_authorization,void,capture,rollover,adjustment,expiry,authorize, andcapture_authorizationhave been added as new values to enum query parametertype.ininlist_ledger_operationsofLedgerOperation.created_athas been added as a new value to enum query parametersort_by.ascinlist_ledger_operationsofLedgerOperation.created_athas been added as a new value to enum query parametersort_by.descinlist_ledger_operationsofLedgerOperation.updated_atandcreated_athave been added as new values to enum query parametersort_by.ascinlist_omnichannel_subscriptionsofOmnichannelSubscription.updated_atandcreated_athave been added as new values to enum query parametersort_by.descinlist_omnichannel_subscriptionsofOmnichannelSubscription.