From ea9a96d9898a31fcfa89dc3832a744d12c46ebae Mon Sep 17 00:00:00 2001 From: chargebee-ci Date: Wed, 19 Aug 2026 10:11:36 +0000 Subject: [PATCH] Releasing v3.28.0 --- CHANGELOG.md | 69 ++++++++++++++ VERSION | 2 +- chargebee/main.py | 6 ++ chargebee/models/__init__.py | 14 +++ chargebee/models/credit_note/operations.py | 23 +++++ chargebee/models/credit_note/responses.py | 6 ++ chargebee/models/enums.py | 90 ++++++++++++++++++- chargebee/models/export/operations.py | 30 +++++++ chargebee/models/export/responses.py | 6 ++ .../gateway_payment_method_token/__init__.py | 2 + .../operations.py | 19 ++++ .../gateway_payment_method_token/responses.py | 16 ++++ chargebee/models/hosted_page/operations.py | 1 + chargebee/models/invoice/operations.py | 29 +++++- chargebee/models/invoice/responses.py | 7 ++ .../__init__.py | 2 + .../operations.py | 10 +++ .../responses.py | 19 ++++ chargebee/models/payment_intent/operations.py | 30 ++++--- chargebee/models/payment_intent/responses.py | 5 ++ chargebee/models/payment_source/operations.py | 25 ++++++ chargebee/models/payment_source/responses.py | 15 ++++ .../models/pricing_page_session/operations.py | 2 +- chargebee/models/quote/operations.py | 52 +++++++++++ chargebee/models/quote/responses.py | 1 + .../models/quote_entitlement/operations.py | 36 +++++++- .../models/quote_entitlement/responses.py | 19 ++++ chargebee/models/quoted_ramp/operations.py | 1 + chargebee/models/quoted_ramp/responses.py | 1 + .../models/vaulted_payment_method/__init__.py | 2 + .../vaulted_payment_method/operations.py | 26 ++++++ .../vaulted_payment_method/responses.py | 19 ++++ chargebee/version.py | 2 +- 33 files changed, 568 insertions(+), 19 deletions(-) create mode 100644 chargebee/models/gateway_payment_method_token/__init__.py create mode 100644 chargebee/models/gateway_payment_method_token/operations.py create mode 100644 chargebee/models/gateway_payment_method_token/responses.py create mode 100644 chargebee/models/omnichannel_subscription_item_metric/__init__.py create mode 100644 chargebee/models/omnichannel_subscription_item_metric/operations.py create mode 100644 chargebee/models/omnichannel_subscription_item_metric/responses.py create mode 100644 chargebee/models/vaulted_payment_method/__init__.py create mode 100644 chargebee/models/vaulted_payment_method/operations.py create mode 100644 chargebee/models/vaulted_payment_method/responses.py diff --git a/CHANGELOG.md b/CHANGELOG.md index ec6eaf9c..25606885 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,72 @@ +### v3.28.0 (2026-08-19) +* * * +### New Resources: +- [`GatewayPaymentMethodToken`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens) has been added. +- [`OmnichannelSubscriptionItemMetric`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_item_metrics) has been added. +- [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements) has been added. +- [`VaultedPaymentMethod`](https://apidocs.chargebee.com/docs/api/vaulted_payment_methods) has been added. + + +### New Actions: +- [`update_credit_note_details`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) has been added to [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`void_authorizations_before_capture`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture) has been added to [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). + + +### New Attributes: +- [`payment_method_options`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_options) has been added to [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- [`vault_token`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#vault_token) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`has_entitlements`](https://apidocs.chargebee.com/docs/api/quotes/quote-object#has_entitlements) has been added to [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + +### New Parameters: +- [`updated_at.on`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at_on) 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). +- [`updated_at.between`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at_between) 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). +- [`purchased_at.on`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at_on) 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). +- [`purchased_at.between`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at_between) 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). +- [`limit`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#limit) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`offset`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#offset) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`include_deleted`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#include_deleted) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`comment`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details#comment) has been added as request body parameter to [`update_credit_note_details`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`ramp`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps#ramp) has been added as request body parameter to [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`export_type`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps#export_type) has been added as request body parameter to [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`locale`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-a-pre-cancel-hosted-page#locale) has been added as request body parameter to [`create_a_pre-cancel_hosted_page`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-a-pre-cancel-hosted-page) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`comment`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture#comment) has been added as request body parameter to [`void_authorizations_before_capture`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`void_reason_code`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture#void_reason_code) has been added as request body parameter to [`void_authorizations_before_capture`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`invoice_action`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture#invoice_action) has been added as request body parameter to [`void_authorizations_before_capture`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`payment_method_options`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent#payment_method_options) has been added as request body parameter to [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- [`payment_method_options`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent#payment_method_options) has been added as request body parameter to [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items#subscription_items_description) has been added as request body parameter to [`create_a_quote_for_a_new_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`entitlement_overrides`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items#entitlement_overrides) has been added as request body parameter to [`create_a_quote_for_a_new_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items#subscription_items_description) has been added as request body parameter to [`edit_update_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`entitlement_overrides`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items#entitlement_overrides) has been added as request body parameter to [`edit_update_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items#subscription_items_description) has been added as request body parameter to [`edit_create_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`entitlement_overrides`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items#entitlement_overrides) has been added as request body parameter to [`edit_create_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items#subscription_items_description) has been added as request body parameter to [`create_a_quote_for_update_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`entitlement_overrides`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items#entitlement_overrides) has been added as request body parameter to [`create_a_quote_for_update_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + +### New Events: +- [`vault_token_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_updated) has been added. +- [`vault_token_deleted`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_deleted) has been added. +- [`omnichannel_subscription_item_mrr_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/omnichannel_subscription_item_mrr_updated) has been added. +- [`vault_token_created`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_created) has been added. + + +### New Enums: +- `consumption_based` has been added as a new value enum `CreditOptionForCurrentTermCharges`. +- `omnichannel_subscription_item_metric` has been added as a new value enum `EntityType`. +- `omnichannel_subscription_item_mrr_updated`, `vault_token_created`, `vault_token_updated`, and `vault_token_deleted` have been added as new values enum `EventType`. +- `chargebee`, `chargebee_payments`, `adyen`, `stripe`, `wepay`, `braintree`, `authorize_net`, `paypal_pro`, `pin`, `eway`, `eway_rapid`, `worldpay`, `balanced_payments`, `beanstream`, `bluepay`, `elavon`, `first_data_global`, `hdfc`, `migs`, `nmi`, `ogone`, `paymill`, `paypal_payflow_pro`, `sage_pay`, `tco`, `wirecard`, `amazon_payments`, `paypal_express_checkout`, `gocardless`, `orbital`, `moneris_us`, `moneris`, `bluesnap`, `cybersource`, `vantiv`, `checkout_com`, `paypal`, `ingenico_direct`, `exact`, `mollie`, `quickbooks`, `razorpay`, `global_payments`, `bank_of_america`, `ecentric`, `metrics_global`, `windcave`, `pay_com`, `ebanx`, `dlocal`, `nuvei`, `solidgate`, `paystack`, `jp_morgan`, `deutsche_bank`, `ezidebit`, `twikey`, `tempus`, `moyasar`, `payway`, and `not_applicable` have been added as new values enum `GatewayName`. +- `void` and `write_off` have been added as new values enum `InvoiceAction`. +- `active`, `inactive`, and `pending_verification` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens/gateway-payment-method-token-object#status) in [`GatewayPaymentMethodToken`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens). +- `payment_method_helper`, `card_components`, `checkout`, `collect_now`, `portal`, and `payment_components` have been added as new values to enum attribute [`payment_intent_metadata.source`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_intent_metadata_source) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `plan_price`, `addon_price`, `charge_price`, and `charge` have been added as new values to enum attribute [`entity_type`](https://apidocs.chargebee.com/docs/api/quote_entitlements/quote-entitlement-object#entity_type) in [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements). +- `upsert` and `remove` have been added as new values to enum attribute [`action_type`](https://apidocs.chargebee.com/docs/api/quote_entitlements/quote-entitlement-object#action_type) in [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements). + + + ### v3.27.0 (2026-07-30) * * * ### New Resources: diff --git a/VERSION b/VERSION index 8c531204..a72fd67b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.27.0 +3.28.0 diff --git a/chargebee/main.py b/chargebee/main.py index fd856309..ac964d62 100644 --- a/chargebee/main.py +++ b/chargebee/main.py @@ -80,6 +80,7 @@ def __init__( self.Feature = chargebee.Feature(self.env) self.FilterCondition = chargebee.FilterCondition(self.env) self.GatewayErrorDetail = chargebee.GatewayErrorDetail(self.env) + self.GatewayPaymentMethodToken = chargebee.GatewayPaymentMethodToken(self.env) self.Gift = chargebee.Gift(self.env) self.GrantBlock = chargebee.GrantBlock(self.env) self.Hierarchy = chargebee.Hierarchy(self.env) @@ -111,6 +112,9 @@ def __init__( self.OmnichannelSubscriptionItem = chargebee.OmnichannelSubscriptionItem( self.env ) + self.OmnichannelSubscriptionItemMetric = ( + chargebee.OmnichannelSubscriptionItemMetric(self.env) + ) self.OmnichannelSubscriptionItemOffer = ( chargebee.OmnichannelSubscriptionItemOffer(self.env) ) @@ -135,6 +139,7 @@ def __init__( self.PromotionalGrant = chargebee.PromotionalGrant(self.env) self.Purchase = chargebee.Purchase(self.env) self.Quote = chargebee.Quote(self.env) + self.QuoteEntitlement = chargebee.QuoteEntitlement(self.env) self.QuoteLineGroup = chargebee.QuoteLineGroup(self.env) self.QuotedCharge = chargebee.QuotedCharge(self.env) self.QuotedDeltaRamp = chargebee.QuotedDeltaRamp(self.env) @@ -165,6 +170,7 @@ def __init__( self.UsageEvent = chargebee.UsageEvent(self.env) self.UsageFile = chargebee.UsageFile(self.env) self.UsageSummary = chargebee.UsageSummary(self.env) + self.VaultedPaymentMethod = chargebee.VaultedPaymentMethod(self.env) self.VirtualBankAccount = chargebee.VirtualBankAccount(self.env) self.WebhookEndpoint = chargebee.WebhookEndpoint(self.env) diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py index aeebdb87..a3becac0 100644 --- a/chargebee/models/__init__.py +++ b/chargebee/models/__init__.py @@ -44,7 +44,9 @@ FreePeriodUnit, FriendOfferType, Gateway, + GatewayName, HierarchyOperationType, + InvoiceAction, InvoiceDunningHandling, ItemType, Layout, @@ -176,6 +178,10 @@ from chargebee.models.gateway_error_detail.operations import GatewayErrorDetail +from chargebee.models.gateway_payment_method_token.operations import ( + GatewayPaymentMethodToken, +) + from chargebee.models.gift.operations import Gift from chargebee.models.grant_block.operations import GrantBlock @@ -236,6 +242,10 @@ OmnichannelSubscriptionItem, ) +from chargebee.models.omnichannel_subscription_item_metric.operations import ( + OmnichannelSubscriptionItemMetric, +) + from chargebee.models.omnichannel_subscription_item_offer.operations import ( OmnichannelSubscriptionItemOffer, ) @@ -282,6 +292,8 @@ from chargebee.models.quote.operations import Quote +from chargebee.models.quote_entitlement.operations import QuoteEntitlement + from chargebee.models.quote_line_group.operations import QuoteLineGroup from chargebee.models.quoted_charge.operations import QuotedCharge @@ -340,6 +352,8 @@ from chargebee.models.usage_summary.operations import UsageSummary +from chargebee.models.vaulted_payment_method.operations import VaultedPaymentMethod + from chargebee.models.virtual_bank_account.operations import VirtualBankAccount from chargebee.models.webhook_endpoint.operations import WebhookEndpoint diff --git a/chargebee/models/credit_note/operations.py b/chargebee/models/credit_note/operations.py index 3b388978..05f76d88 100644 --- a/chargebee/models/credit_note/operations.py +++ b/chargebee/models/credit_note/operations.py @@ -460,6 +460,9 @@ class CreditNotesForCustomerParams(TypedDict): class DeleteParams(TypedDict): comment: NotRequired[str] + class UpdateParams(TypedDict): + comment: NotRequired[str] + class RemoveTaxWithheldRefundParams(TypedDict): tax_withheld: NotRequired["CreditNote.RemoveTaxWithheldRefundTaxWithheldParams"] @@ -691,6 +694,26 @@ def delete(self, id, params: DeleteParams = None, headers=None) -> DeleteRespons operation="delete", ) + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: + jsonKeys = {} + options = { + "isIdempotent": True, + } + return request.send( + "post", + request.uri_path("credit_notes", id, "update"), + self.env, + cast(Dict[Any, Any], params), + headers, + UpdateResponse, + None, + False, + jsonKeys, + options, + resource="creditNote", + operation="update", + ) + def remove_tax_withheld_refund( self, id, params: RemoveTaxWithheldRefundParams, headers=None ) -> RemoveTaxWithheldRefundResponse: diff --git a/chargebee/models/credit_note/responses.py b/chargebee/models/credit_note/responses.py index 06bda953..a010fd7e 100644 --- a/chargebee/models/credit_note/responses.py +++ b/chargebee/models/credit_note/responses.py @@ -341,6 +341,12 @@ class DeleteResponse(Response): credit_note: CreditNoteResponse +@dataclass +class UpdateResponse(Response): + is_idempotency_replayed: bool + credit_note: CreditNoteResponse + + @dataclass class RemoveTaxWithheldRefundResponse(Response): is_idempotency_replayed: bool diff --git a/chargebee/models/enums.py b/chargebee/models/enums.py index 9f946b9d..13f5571e 100644 --- a/chargebee/models/enums.py +++ b/chargebee/models/enums.py @@ -224,6 +224,7 @@ class CreditOptionForCurrentTermCharges(Enum): NONE = "none" PRORATE = "prorate" FULL = "full" + CONSUMPTION_BASED = "consumption_based" def __str__(self): return self.value @@ -590,10 +591,16 @@ class EnabledEvents(Enum): ALERT_STATUS_CHANGED = "alert_status_changed" OMNICHANNEL_SUBSCRIPTION_ITEM_UPDATED = "omnichannel_subscription_item_updated" OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED = "omnichannel_subscription_item_recovered" + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED = ( + "omnichannel_subscription_item_mrr_updated" + ) LEDGER_ACCOUNT_BALANCE_UPDATED = "ledger_account_balance_updated" GRANT_BLOCKS_CREATED = "grant_blocks_created" GRANT_BLOCKS_UPDATED = "grant_blocks_updated" LEDGER_UPDATED = "ledger_updated" + VAULT_TOKEN_CREATED = "vault_token_created" + VAULT_TOKEN_UPDATED = "vault_token_updated" + VAULT_TOKEN_DELETED = "vault_token_deleted" PLAN_CREATED = "plan_created" PLAN_UPDATED = "plan_updated" PLAN_DELETED = "plan_deleted" @@ -649,7 +656,6 @@ class EntityType(Enum): PLAN_PRICE = "plan_price" ADDON_PRICE = "addon_price" CHARGE_PRICE = "charge_price" - CHARGE = "charge" INVOICE = "invoice" QUOTE = "quote" CREDIT_NOTE = "credit_note" @@ -684,6 +690,7 @@ class EntityType(Enum): BUSINESS_RULE = "business_rule" RULESET = "ruleset" ALERT_STATUS = "alert_status" + OMNICHANNEL_SUBSCRIPTION_ITEM_METRIC = "omnichannel_subscription_item_metric" def __str__(self): return self.value @@ -949,10 +956,16 @@ class EventType(Enum): ALERT_STATUS_CHANGED = "alert_status_changed" OMNICHANNEL_SUBSCRIPTION_ITEM_UPDATED = "omnichannel_subscription_item_updated" OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED = "omnichannel_subscription_item_recovered" + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED = ( + "omnichannel_subscription_item_mrr_updated" + ) LEDGER_ACCOUNT_BALANCE_UPDATED = "ledger_account_balance_updated" GRANT_BLOCKS_CREATED = "grant_blocks_created" GRANT_BLOCKS_UPDATED = "grant_blocks_updated" LEDGER_UPDATED = "ledger_updated" + VAULT_TOKEN_CREATED = "vault_token_created" + VAULT_TOKEN_UPDATED = "vault_token_updated" + VAULT_TOKEN_DELETED = "vault_token_deleted" PLAN_CREATED = "plan_created" PLAN_UPDATED = "plan_updated" PLAN_DELETED = "plan_deleted" @@ -1066,6 +1079,73 @@ def __str__(self): return self.value +class GatewayName(Enum): + CHARGEBEE = "chargebee" + CHARGEBEE_PAYMENTS = "chargebee_payments" + ADYEN = "adyen" + STRIPE = "stripe" + WEPAY = "wepay" + BRAINTREE = "braintree" + AUTHORIZE_NET = "authorize_net" + PAYPAL_PRO = "paypal_pro" + PIN = "pin" + EWAY = "eway" + EWAY_RAPID = "eway_rapid" + WORLDPAY = "worldpay" + BALANCED_PAYMENTS = "balanced_payments" + BEANSTREAM = "beanstream" + BLUEPAY = "bluepay" + ELAVON = "elavon" + FIRST_DATA_GLOBAL = "first_data_global" + HDFC = "hdfc" + MIGS = "migs" + NMI = "nmi" + OGONE = "ogone" + PAYMILL = "paymill" + PAYPAL_PAYFLOW_PRO = "paypal_payflow_pro" + SAGE_PAY = "sage_pay" + TCO = "tco" + WIRECARD = "wirecard" + AMAZON_PAYMENTS = "amazon_payments" + PAYPAL_EXPRESS_CHECKOUT = "paypal_express_checkout" + GOCARDLESS = "gocardless" + ORBITAL = "orbital" + MONERIS_US = "moneris_us" + MONERIS = "moneris" + BLUESNAP = "bluesnap" + CYBERSOURCE = "cybersource" + VANTIV = "vantiv" + CHECKOUT_COM = "checkout_com" + PAYPAL = "paypal" + INGENICO_DIRECT = "ingenico_direct" + EXACT = "exact" + MOLLIE = "mollie" + QUICKBOOKS = "quickbooks" + RAZORPAY = "razorpay" + GLOBAL_PAYMENTS = "global_payments" + BANK_OF_AMERICA = "bank_of_america" + ECENTRIC = "ecentric" + METRICS_GLOBAL = "metrics_global" + WINDCAVE = "windcave" + PAY_COM = "pay_com" + EBANX = "ebanx" + DLOCAL = "dlocal" + NUVEI = "nuvei" + SOLIDGATE = "solidgate" + PAYSTACK = "paystack" + JP_MORGAN = "jp_morgan" + DEUTSCHE_BANK = "deutsche_bank" + EZIDEBIT = "ezidebit" + TWIKEY = "twikey" + TEMPUS = "tempus" + MOYASAR = "moyasar" + PAYWAY = "payway" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class HierarchyOperationType(Enum): COMPLETE_HIERARCHY = "complete_hierarchy" SUBORDINATES = "subordinates" @@ -1075,6 +1155,14 @@ def __str__(self): return self.value +class InvoiceAction(Enum): + VOID = "void" + WRITE_OFF = "write_off" + + def __str__(self): + return self.value + + class InvoiceDunningHandling(Enum): CONTINUE = "continue" STOP = "stop" diff --git a/chargebee/models/export/operations.py b/chargebee/models/export/operations.py index 13faffd0..ad0177f0 100644 --- a/chargebee/models/export/operations.py +++ b/chargebee/models/export/operations.py @@ -336,6 +336,12 @@ class PriceVariantsPriceVariantParams(TypedDict): updated_at: NotRequired[Filters.TimestampFilter] created_at: NotRequired[Filters.TimestampFilter] + class RampsRampParams(TypedDict): + status: NotRequired[Filters.EnumFilter] + subscription_id: NotRequired[Filters.StringFilter] + effective_from: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + def wait_for_export_completion( self, export: ExportResponse, headers=None ) -> RetrieveResponse: @@ -465,6 +471,10 @@ class PriceVariantsParams(TypedDict): business_entity_id: NotRequired[Filters.StringFilter] include_site_level_resources: NotRequired[Filters.BooleanFilter] + class RampsParams(TypedDict): + ramp: NotRequired["Export.RampsRampParams"] + export_type: NotRequired[enums.ExportType] + def retrieve(self, id, headers=None) -> RetrieveResponse: jsonKeys = {} options = {} @@ -844,3 +854,23 @@ def price_variants( resource="export", operation="priceVariants", ) + + def ramps(self, params: RampsParams = None, headers=None) -> RampsResponse: + jsonKeys = {} + options = { + "isIdempotent": True, + } + return request.send( + "post", + request.uri_path("exports", "ramps"), + self.env, + cast(Dict[Any, Any], params), + headers, + RampsResponse, + None, + False, + jsonKeys, + options, + resource="export", + operation="ramps", + ) diff --git a/chargebee/models/export/responses.py b/chargebee/models/export/responses.py index 1571eca4..9c6013e1 100644 --- a/chargebee/models/export/responses.py +++ b/chargebee/models/export/responses.py @@ -128,3 +128,9 @@ class DifferentialPricesResponse(Response): class PriceVariantsResponse(Response): is_idempotency_replayed: bool export: ExportResponse + + +@dataclass +class RampsResponse(Response): + is_idempotency_replayed: bool + export: ExportResponse diff --git a/chargebee/models/gateway_payment_method_token/__init__.py b/chargebee/models/gateway_payment_method_token/__init__.py new file mode 100644 index 00000000..86867a31 --- /dev/null +++ b/chargebee/models/gateway_payment_method_token/__init__.py @@ -0,0 +1,2 @@ +from .operations import GatewayPaymentMethodToken +from .responses import GatewayPaymentMethodTokenResponse diff --git a/chargebee/models/gateway_payment_method_token/operations.py b/chargebee/models/gateway_payment_method_token/operations.py new file mode 100644 index 00000000..2616c100 --- /dev/null +++ b/chargebee/models/gateway_payment_method_token/operations.py @@ -0,0 +1,19 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum + + +@dataclass +class GatewayPaymentMethodToken: + env: environment.Environment + + class Status(Enum): + ACTIVE = "active" + INACTIVE = "inactive" + PENDING_VERIFICATION = "pending_verification" + + def __str__(self): + return self.value + + pass diff --git a/chargebee/models/gateway_payment_method_token/responses.py b/chargebee/models/gateway_payment_method_token/responses.py new file mode 100644 index 00000000..092d01a7 --- /dev/null +++ b/chargebee/models/gateway_payment_method_token/responses.py @@ -0,0 +1,16 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class GatewayPaymentMethodTokenResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + gateway_account_id: str = None + gateway_name: str = None + gateway_customer_id: str = None + gateway_token: str = None + status: str = None + created_at: int = None + updated_at: int = None diff --git a/chargebee/models/hosted_page/operations.py b/chargebee/models/hosted_page/operations.py index b2295fad..225b9da9 100644 --- a/chargebee/models/hosted_page/operations.py +++ b/chargebee/models/hosted_page/operations.py @@ -879,6 +879,7 @@ class PreCancelParams(TypedDict): pass_thru_content: NotRequired[str] cancel_url: NotRequired[str] redirect_url: NotRequired[str] + locale: NotRequired[str] class EventsParams(TypedDict): event_name: Required[enums.EventName] diff --git a/chargebee/models/invoice/operations.py b/chargebee/models/invoice/operations.py index abcdbdd2..60ce38a7 100644 --- a/chargebee/models/invoice/operations.py +++ b/chargebee/models/invoice/operations.py @@ -275,7 +275,7 @@ class ReferenceTransaction(TypedDict): txn_date: NotRequired[int] txn_amount: NotRequired[int] txn_type: Required["Invoice.TxnType"] - amount_capturable: Required[int] + amount_capturable: NotRequired[int] authorization_reason: NotRequired["Invoice.AuthorizationReason"] class DunningAttempt(TypedDict): @@ -1227,6 +1227,11 @@ class VoidInvoiceParams(TypedDict): class WriteOffParams(TypedDict): comment: NotRequired[str] + class VoidBeforeCaptureParams(TypedDict): + comment: NotRequired[str] + void_reason_code: NotRequired[str] + invoice_action: NotRequired[enums.InvoiceAction] + class DeleteParams(TypedDict): comment: NotRequired[str] @@ -1971,6 +1976,28 @@ def write_off( operation="writeOff", ) + def void_before_capture( + self, id, params: VoidBeforeCaptureParams = None, headers=None + ) -> VoidBeforeCaptureResponse: + jsonKeys = {} + options = { + "isIdempotent": True, + } + return request.send( + "post", + request.uri_path("invoices", id, "void_before_capture"), + self.env, + cast(Dict[Any, Any], params), + headers, + VoidBeforeCaptureResponse, + None, + False, + jsonKeys, + options, + resource="invoice", + operation="voidBeforeCapture", + ) + def delete(self, id, params: DeleteParams = None, headers=None) -> DeleteResponse: jsonKeys = {} options = { diff --git a/chargebee/models/invoice/responses.py b/chargebee/models/invoice/responses.py index e23aafe3..38f147c5 100644 --- a/chargebee/models/invoice/responses.py +++ b/chargebee/models/invoice/responses.py @@ -620,6 +620,13 @@ class WriteOffResponse(Response): credit_note: "credit_note.CreditNoteResponse" +@dataclass +class VoidBeforeCaptureResponse(Response): + is_idempotency_replayed: bool + invoice: InvoiceResponse + credit_note: "credit_note.CreditNoteResponse" = None + + @dataclass class DeleteResponse(Response): is_idempotency_replayed: bool diff --git a/chargebee/models/omnichannel_subscription_item_metric/__init__.py b/chargebee/models/omnichannel_subscription_item_metric/__init__.py new file mode 100644 index 00000000..c39bfa0a --- /dev/null +++ b/chargebee/models/omnichannel_subscription_item_metric/__init__.py @@ -0,0 +1,2 @@ +from .operations import OmnichannelSubscriptionItemMetric +from .responses import OmnichannelSubscriptionItemMetricResponse diff --git a/chargebee/models/omnichannel_subscription_item_metric/operations.py b/chargebee/models/omnichannel_subscription_item_metric/operations.py new file mode 100644 index 00000000..17d328cc --- /dev/null +++ b/chargebee/models/omnichannel_subscription_item_metric/operations.py @@ -0,0 +1,10 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast + + +@dataclass +class OmnichannelSubscriptionItemMetric: + env: environment.Environment + + pass diff --git a/chargebee/models/omnichannel_subscription_item_metric/responses.py b/chargebee/models/omnichannel_subscription_item_metric/responses.py new file mode 100644 index 00000000..0dd10694 --- /dev/null +++ b/chargebee/models/omnichannel_subscription_item_metric/responses.py @@ -0,0 +1,19 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class OmnichannelSubscriptionItemMetricResponse(Model): + raw_data: Dict[Any, Any] = None + customer_id: str = None + omnichannel_subscription_id: str = None + omnichannel_subscription_item_id: str = None + item_id_at_source: str = None + mrr_currency: str = None + mrr_units: int = None + mrr_nanos: int = None + effective_from: int = None + calculated_at: int = None + created_at: int = None + resource_version: int = None diff --git a/chargebee/models/payment_intent/operations.py b/chargebee/models/payment_intent/operations.py index 60198b60..f839e4d4 100644 --- a/chargebee/models/payment_intent/operations.py +++ b/chargebee/models/payment_intent/operations.py @@ -101,16 +101,12 @@ def __str__(self): return self.value class PaymentIntentMetadataSource(Enum): - CB_JS = "cb_js" - COMPONENTS_FIELDS = "components_fields" - CHECKOUT_V3 = "checkout_v3" - PAYNOW_V3 = "paynow_v3" - PORTAL_V3 = "portal_v3" - GIFT_V3 = "gift_v3" - CHECKOUT_V4 = "checkout_v4" - PAYMENT_COMPONENT = "payment_component" - PC_INAPP_V4 = "pc_inapp_v4" - PC_FPC_V4 = "pc_fpc_v4" + PAYMENT_METHOD_HELPER = "payment_method_helper" + CARD_COMPONENTS = "card_components" + CHECKOUT = "checkout" + COLLECT_NOW = "collect_now" + PORTAL = "portal" + PAYMENT_COMPONENTS = "payment_components" def __str__(self): return self.value @@ -126,6 +122,8 @@ class PaymentAttempt(TypedDict): created_at: Required[int] modified_at: Required[int] error_detail: NotRequired[gateway_error_detail.GatewayErrorDetailResponse] + routing_rule_id: NotRequired[str] + payment_method_display_rule_id: NotRequired[str] class PaymentAttempt(TypedDict): id: NotRequired[str] @@ -138,6 +136,8 @@ class PaymentAttempt(TypedDict): created_at: Required[int] modified_at: Required[int] error_detail: NotRequired[gateway_error_detail.GatewayErrorDetailResponse] + routing_rule_id: NotRequired[str] + payment_method_display_rule_id: NotRequired[str] class PaymentIntentMetadata(TypedDict): source: Required["PaymentIntent.PaymentIntentMetadataSource"] @@ -156,6 +156,7 @@ class CreateParams(TypedDict): payment_method_type: NotRequired["PaymentIntent.PaymentMethodType"] success_url: NotRequired[str] failure_url: NotRequired[str] + payment_method_options: NotRequired[Dict[Any, Any]] class UpdateParams(TypedDict): amount: NotRequired[int] @@ -164,9 +165,12 @@ class UpdateParams(TypedDict): payment_method_type: NotRequired["PaymentIntent.PaymentMethodType"] success_url: NotRequired[str] failure_url: NotRequired[str] + payment_method_options: NotRequired[Dict[Any, Any]] def create(self, params: CreateParams, headers=None) -> CreateResponse: - jsonKeys = {} + jsonKeys = { + "payment_method_options": 0, + } options = { "isIdempotent": True, } @@ -186,7 +190,9 @@ def create(self, params: CreateParams, headers=None) -> CreateResponse: ) def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: - jsonKeys = {} + jsonKeys = { + "payment_method_options": 0, + } options = { "isIdempotent": True, } diff --git a/chargebee/models/payment_intent/responses.py b/chargebee/models/payment_intent/responses.py index 8f6f2017..ebb6d0ac 100644 --- a/chargebee/models/payment_intent/responses.py +++ b/chargebee/models/payment_intent/responses.py @@ -18,6 +18,8 @@ class PaymentAttemptResponse(Model): created_at: int = None modified_at: int = None error_detail: gateway_error_detail.GatewayErrorDetailResponse = None + routing_rule_id: str = None + payment_method_display_rule_id: str = None @dataclass @@ -33,6 +35,8 @@ class PaymentAttemptResponse(Model): created_at: int = None modified_at: int = None error_detail: gateway_error_detail.GatewayErrorDetailResponse = None + routing_rule_id: str = None + payment_method_display_rule_id: str = None @dataclass @@ -61,6 +65,7 @@ class PaymentIntentResponse(Model): modified_at: int = None resource_version: int = None updated_at: int = None + payment_method_options: Dict[Any, Any] = None customer_id: str = None gateway: str = None active_payment_attempt: PaymentAttemptResponse = None diff --git a/chargebee/models/payment_source/operations.py b/chargebee/models/payment_source/operations.py index be47b424..a97d9136 100644 --- a/chargebee/models/payment_source/operations.py +++ b/chargebee/models/payment_source/operations.py @@ -295,6 +295,11 @@ class VerifyBankAccountParams(TypedDict): amount1: Required[int] amount2: Required[int] + class ListGatewayTokensForPaymentSourceParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + include_deleted: NotRequired[bool] + class ListParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] @@ -547,6 +552,26 @@ def verify_bank_account( operation="verifyBankAccount", ) + def list_gateway_tokens_for_payment_source( + self, id, params: ListGatewayTokensForPaymentSourceParams = None, headers=None + ) -> ListGatewayTokensForPaymentSourceResponse: + jsonKeys = {} + options = {} + return request.send( + "get", + request.uri_path("payment_sources", id, "gateway_payment_method_tokens"), + self.env, + cast(Dict[Any, Any], params), + headers, + ListGatewayTokensForPaymentSourceResponse, + None, + False, + jsonKeys, + options, + resource="paymentSource", + operation="listGatewayTokensForPaymentSource", + ) + def retrieve(self, id, headers=None) -> RetrieveResponse: jsonKeys = {} options = {} diff --git a/chargebee/models/payment_source/responses.py b/chargebee/models/payment_source/responses.py index ff8eb93d..4d1f4fa8 100644 --- a/chargebee/models/payment_source/responses.py +++ b/chargebee/models/payment_source/responses.py @@ -6,6 +6,7 @@ payment_intent, card, customer, + gateway_payment_method_token, third_party_payment_method, download, ) @@ -141,6 +142,7 @@ class PaymentSourceResponse(Model): venmo: VenmoResponse = None klarna_pay_now: KlarnaPayNowResponse = None mandates: List[MandateResponse] = None + vault_token: Dict[Any, Any] = None deleted: bool = None business_entity_id: str = None @@ -214,6 +216,19 @@ class VerifyBankAccountResponse(Response): payment_source: PaymentSourceResponse +@dataclass +class ListGatewayTokensForPaymentSourcePaymentSourceResponse: + gateway_payment_method_token: ( + "gateway_payment_method_token.GatewayPaymentMethodTokenResponse" + ) + + +@dataclass +class ListGatewayTokensForPaymentSourceResponse(Response): + list: List[ListGatewayTokensForPaymentSourcePaymentSourceResponse] + next_offset: str = None + + @dataclass class RetrieveResponse(Response): payment_source: PaymentSourceResponse diff --git a/chargebee/models/pricing_page_session/operations.py b/chargebee/models/pricing_page_session/operations.py index b61f3905..55f5e9cc 100644 --- a/chargebee/models/pricing_page_session/operations.py +++ b/chargebee/models/pricing_page_session/operations.py @@ -9,7 +9,7 @@ class PricingPageSession: env: environment.Environment class CreateForNewSubscriptionPricingPageParams(TypedDict): - id: Required[str] + id: NotRequired[str] class CreateForNewSubscriptionSubscriptionParams(TypedDict): id: NotRequired[str] diff --git a/chargebee/models/quote/operations.py b/chargebee/models/quote/operations.py index 3a7e3b54..7aec555c 100644 --- a/chargebee/models/quote/operations.py +++ b/chargebee/models/quote/operations.py @@ -556,6 +556,7 @@ class CreateSubItemsForCustomerQuoteSubscriptionItemParams(TypedDict): charge_on_option: NotRequired[enums.ChargeOnOption] start_date: NotRequired[int] end_date: NotRequired[int] + description: NotRequired[str] ramp_tier_id: NotRequired[str] class CreateSubItemsForCustomerQuoteDiscountParams(TypedDict): @@ -624,6 +625,15 @@ class CreateSubItemsForCustomerQuoteCouponParams(TypedDict): start_date: NotRequired[int] end_date: NotRequired[int] + class CreateSubItemsForCustomerQuoteEntitlementOverrideParams(TypedDict): + feature_id: NotRequired[str] + entity_id: NotRequired[str] + entity_type: NotRequired[enums.EntityType] + value: NotRequired[str] + is_enabled: NotRequired[bool] + start_date: NotRequired[int] + end_date: NotRequired[int] + class EditCreateSubCustomerQuoteForItemsSubscriptionParams(TypedDict): id: NotRequired[str] po_number: NotRequired[str] @@ -650,6 +660,7 @@ class EditCreateSubCustomerQuoteForItemsSubscriptionItemParams(TypedDict): charge_on_option: NotRequired[enums.ChargeOnOption] start_date: NotRequired[int] end_date: NotRequired[int] + description: NotRequired[str] ramp_tier_id: NotRequired[str] class EditCreateSubCustomerQuoteForItemsDiscountParams(TypedDict): @@ -718,6 +729,15 @@ class EditCreateSubCustomerQuoteForItemsCouponParams(TypedDict): start_date: NotRequired[int] end_date: NotRequired[int] + class EditCreateSubCustomerQuoteForItemsEntitlementOverrideParams(TypedDict): + feature_id: NotRequired[str] + entity_id: NotRequired[str] + entity_type: NotRequired[enums.EntityType] + value: NotRequired[str] + is_enabled: NotRequired[bool] + start_date: NotRequired[int] + end_date: NotRequired[int] + class UpdateSubscriptionQuoteForItemsSubscriptionParams(TypedDict): id: Required[str] setup_fee: NotRequired[int] @@ -743,6 +763,7 @@ class UpdateSubscriptionQuoteForItemsSubscriptionItemParams(TypedDict): item_type: NotRequired[enums.ItemType] start_date: NotRequired[int] end_date: NotRequired[int] + description: NotRequired[str] ramp_tier_id: NotRequired[str] class UpdateSubscriptionQuoteForItemsDiscountParams(TypedDict): @@ -818,6 +839,15 @@ class UpdateSubscriptionQuoteForItemsCouponParams(TypedDict): start_date: NotRequired[int] end_date: NotRequired[int] + class UpdateSubscriptionQuoteForItemsEntitlementOverrideParams(TypedDict): + feature_id: NotRequired[str] + entity_id: NotRequired[str] + entity_type: NotRequired[enums.EntityType] + value: NotRequired[str] + is_enabled: NotRequired[bool] + start_date: NotRequired[int] + end_date: NotRequired[int] + class EditUpdateSubscriptionQuoteForItemsSubscriptionItemParams(TypedDict): item_price_id: Required[str] quantity: NotRequired[int] @@ -833,6 +863,7 @@ class EditUpdateSubscriptionQuoteForItemsSubscriptionItemParams(TypedDict): item_type: NotRequired[enums.ItemType] start_date: NotRequired[int] end_date: NotRequired[int] + description: NotRequired[str] ramp_tier_id: NotRequired[str] class EditUpdateSubscriptionQuoteForItemsSubscriptionParams(TypedDict): @@ -917,6 +948,15 @@ class EditUpdateSubscriptionQuoteForItemsCouponParams(TypedDict): start_date: NotRequired[int] end_date: NotRequired[int] + class EditUpdateSubscriptionQuoteForItemsEntitlementOverrideParams(TypedDict): + feature_id: NotRequired[str] + entity_id: NotRequired[str] + entity_type: NotRequired[enums.EntityType] + value: NotRequired[str] + is_enabled: NotRequired[bool] + start_date: NotRequired[int] + end_date: NotRequired[int] + class CreateForChargeItemsAndChargesItemPriceParams(TypedDict): item_price_id: NotRequired[str] quantity: NotRequired[int] @@ -1237,6 +1277,9 @@ class CreateSubItemsForCustomerQuoteParams(TypedDict): ] net_term_days: NotRequired[int] coupons: NotRequired[List["Quote.CreateSubItemsForCustomerQuoteCouponParams"]] + entitlement_overrides: NotRequired[ + List["Quote.CreateSubItemsForCustomerQuoteEntitlementOverrideParams"] + ] class EditCreateSubCustomerQuoteForItemsParams(TypedDict): notes: NotRequired[str] @@ -1272,6 +1315,9 @@ class EditCreateSubCustomerQuoteForItemsParams(TypedDict): coupons: NotRequired[ List["Quote.EditCreateSubCustomerQuoteForItemsCouponParams"] ] + entitlement_overrides: NotRequired[ + List["Quote.EditCreateSubCustomerQuoteForItemsEntitlementOverrideParams"] + ] class UpdateSubscriptionQuoteForItemsParams(TypedDict): name: NotRequired[str] @@ -1313,6 +1359,9 @@ class UpdateSubscriptionQuoteForItemsParams(TypedDict): ] net_term_days: NotRequired[int] coupons: NotRequired[List["Quote.UpdateSubscriptionQuoteForItemsCouponParams"]] + entitlement_overrides: NotRequired[ + List["Quote.UpdateSubscriptionQuoteForItemsEntitlementOverrideParams"] + ] class EditUpdateSubscriptionQuoteForItemsParams(TypedDict): notes: NotRequired[str] @@ -1355,6 +1404,9 @@ class EditUpdateSubscriptionQuoteForItemsParams(TypedDict): coupons: NotRequired[ List["Quote.EditUpdateSubscriptionQuoteForItemsCouponParams"] ] + entitlement_overrides: NotRequired[ + List["Quote.EditUpdateSubscriptionQuoteForItemsEntitlementOverrideParams"] + ] class CreateForChargeItemsAndChargesParams(TypedDict): name: NotRequired[str] diff --git a/chargebee/models/quote/responses.py b/chargebee/models/quote/responses.py index b33d251d..397ed992 100644 --- a/chargebee/models/quote/responses.py +++ b/chargebee/models/quote/responses.py @@ -198,6 +198,7 @@ class QuoteResponse(Model): deleted: bool = None total_contract_value: int = None total_discount: int = None + has_entitlements: bool = None @dataclass diff --git a/chargebee/models/quote_entitlement/operations.py b/chargebee/models/quote_entitlement/operations.py index b7203863..24b77071 100644 --- a/chargebee/models/quote_entitlement/operations.py +++ b/chargebee/models/quote_entitlement/operations.py @@ -2,6 +2,7 @@ from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +from chargebee.filters import Filters @dataclass @@ -12,9 +13,40 @@ class EntityType(Enum): PLAN_PRICE = "plan_price" ADDON_PRICE = "addon_price" CHARGE_PRICE = "charge_price" - CHARGE = "charge" def __str__(self): return self.value - pass + class ActionType(Enum): + UPSERT = "upsert" + REMOVE = "remove" + + def __str__(self): + return self.value + + class ListQuoteEntitlementsParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + entity_id: NotRequired[Filters.StringFilter] + start_date: NotRequired[Filters.TimestampFilter] + end_date: NotRequired[Filters.TimestampFilter] + + def list_quote_entitlements( + self, id, params: ListQuoteEntitlementsParams = None, headers=None + ) -> ListQuoteEntitlementsResponse: + jsonKeys = {} + options = {} + return request.send( + "get", + request.uri_path("quotes", id, "quote_entitlements"), + self.env, + cast(Dict[Any, Any], params), + headers, + ListQuoteEntitlementsResponse, + None, + False, + jsonKeys, + options, + resource="quoteEntitlement", + operation="listQuoteEntitlements", + ) diff --git a/chargebee/models/quote_entitlement/responses.py b/chargebee/models/quote_entitlement/responses.py index 3010f03b..c167881e 100644 --- a/chargebee/models/quote_entitlement/responses.py +++ b/chargebee/models/quote_entitlement/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -8,6 +9,7 @@ class QuoteEntitlementResponse(Model): raw_data: Dict[Any, Any] = None entity_id: str = None entity_type: str = None + action_type: str = None feature_id: str = None value: str = None is_enabled: bool = None @@ -15,3 +17,20 @@ class QuoteEntitlementResponse(Model): end_date: int = None created_at: int = None modified_at: int = None + is_overridden: bool = None + feature_name: str = None + feature_unit: str = None + feature_type: str = None + name: str = None + metered: bool = None + + +@dataclass +class ListQuoteEntitlementsQuoteEntitlementResponse: + quote_entitlement: QuoteEntitlementResponse + + +@dataclass +class ListQuoteEntitlementsResponse(Response): + list: List[ListQuoteEntitlementsQuoteEntitlementResponse] + next_offset: str = None diff --git a/chargebee/models/quoted_ramp/operations.py b/chargebee/models/quoted_ramp/operations.py index 3dabc426..e10b3819 100644 --- a/chargebee/models/quoted_ramp/operations.py +++ b/chargebee/models/quoted_ramp/operations.py @@ -55,6 +55,7 @@ class LineItem(TypedDict): amount_per_billing_cycle_in_decimal: NotRequired[str] net_amount_per_billing_cycle: NotRequired[int] net_amount_per_billing_cycle_in_decimal: NotRequired[str] + description: NotRequired[str] class Discount(TypedDict): id: Required[str] diff --git a/chargebee/models/quoted_ramp/responses.py b/chargebee/models/quoted_ramp/responses.py index 0a329ed6..1ba1420f 100644 --- a/chargebee/models/quoted_ramp/responses.py +++ b/chargebee/models/quoted_ramp/responses.py @@ -35,6 +35,7 @@ class LineItemResponse(Model): amount_per_billing_cycle_in_decimal: str = None net_amount_per_billing_cycle: int = None net_amount_per_billing_cycle_in_decimal: str = None + description: str = None @dataclass diff --git a/chargebee/models/vaulted_payment_method/__init__.py b/chargebee/models/vaulted_payment_method/__init__.py new file mode 100644 index 00000000..fe71ada4 --- /dev/null +++ b/chargebee/models/vaulted_payment_method/__init__.py @@ -0,0 +1,2 @@ +from .operations import VaultedPaymentMethod +from .responses import VaultedPaymentMethodResponse diff --git a/chargebee/models/vaulted_payment_method/operations.py b/chargebee/models/vaulted_payment_method/operations.py new file mode 100644 index 00000000..11abb30e --- /dev/null +++ b/chargebee/models/vaulted_payment_method/operations.py @@ -0,0 +1,26 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast + + +@dataclass +class VaultedPaymentMethod: + env: environment.Environment + + def retrieve(self, id, headers=None) -> RetrieveResponse: + jsonKeys = {} + options = {} + return request.send( + "get", + request.uri_path("vaulted_payment_methods", id), + self.env, + None, + headers, + RetrieveResponse, + None, + False, + jsonKeys, + options, + resource="vaultedPaymentMethod", + operation="retrieve", + ) diff --git a/chargebee/models/vaulted_payment_method/responses.py b/chargebee/models/vaulted_payment_method/responses.py new file mode 100644 index 00000000..ec9119b2 --- /dev/null +++ b/chargebee/models/vaulted_payment_method/responses.py @@ -0,0 +1,19 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.response import Response + + +@dataclass +class VaultedPaymentMethodResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + customer_id: str = None + credit_card_id: str = None + created_at: int = None + modified_at: int = None + + +@dataclass +class RetrieveResponse(Response): + vaulted_payment_method: VaultedPaymentMethodResponse diff --git a/chargebee/version.py b/chargebee/version.py index 4daebf63..19ff2992 100644 --- a/chargebee/version.py +++ b/chargebee/version.py @@ -1 +1 @@ -VERSION = "3.27.0" +VERSION = "3.28.0"