From 3b3ed8b61ebd1771558b4f8a2b49a1106ca387e8 Mon Sep 17 00:00:00 2001 From: chargebee-ci Date: Wed, 19 Aug 2026 10:12:07 +0000 Subject: [PATCH] Releasing v4.26.0 --- CHANGELOG.md | 69 ++++++++ VERSION | 2 +- .../Contracts/CouponActionsInterface.php | 2 +- .../Contracts/CreditNoteActionsInterface.php | 17 ++ .../Contracts/CreditUnitActionsInterface.php | 4 +- .../Contracts/EntitlementActionsInterface.php | 6 +- .../Contracts/ExportActionsInterface.php | 41 ++++- .../Contracts/HostedPageActionsInterface.php | 1 + .../Contracts/InvoiceActionsInterface.php | 25 ++- .../LedgerOperationActionsInterface.php | 2 +- .../Contracts/MeterActionsInterface.php | 2 +- ...mnichannelSubscriptionActionsInterface.php | 8 +- .../PaymentIntentActionsInterface.php | 2 + .../PaymentSourceActionsInterface.php | 19 +++ .../Contracts/QuoteActionsInterface.php | 40 +++++ .../QuoteEntitlementActionsInterface.php | 41 +++++ .../Contracts/RampActionsInterface.php | 4 +- .../VaultedPaymentMethodActionsInterface.php | 29 ++++ src/Actions/CouponActions.php | 2 +- src/Actions/CreditNoteActions.php | 37 +++++ src/Actions/CreditUnitActions.php | 4 +- src/Actions/EntitlementActions.php | 6 +- src/Actions/ExportActions.php | 61 ++++++- src/Actions/HostedPageActions.php | 1 + src/Actions/InvoiceActions.php | 45 ++++- src/Actions/LedgerOperationActions.php | 2 +- src/Actions/MeterActions.php | 2 +- .../OmnichannelSubscriptionActions.php | 8 +- src/Actions/PaymentIntentActions.php | 4 + src/Actions/PaymentSourceActions.php | 38 +++++ src/Actions/QuoteActions.php | 40 +++++ src/Actions/QuoteEntitlementActions.php | 73 ++++++++ src/Actions/RampActions.php | 4 +- src/Actions/VaultedPaymentMethodActions.php | 59 +++++++ src/ChargebeeClient.php | 12 ++ .../CreditOptionForCurrentTermCharges.php | 1 + src/Enums/EnabledEvents.php | 4 + src/Enums/EntityType.php | 6 +- src/Enums/EventType.php | 4 + src/Enums/GatewayName.php | 73 ++++++++ src/Enums/InvoiceAction.php | 14 ++ src/Resources/Content/Content.php | 58 ++++++- .../Enums/Status.php | 15 ++ .../GatewayPaymentMethodToken.php | 130 +++++++++++++++ .../OmnichannelSubscriptionItemMetric.php | 156 ++++++++++++++++++ .../Enums/PaymentIntentMetadataSource.php | 16 +- .../PaymentIntent/PaymentAttempt.php | 24 ++- src/Resources/PaymentIntent/PaymentIntent.php | 12 +- src/Resources/PaymentSource/PaymentSource.php | 12 +- src/Resources/Quote/Quote.php | 14 +- .../QuoteEntitlement/Enums/ActionType.php | 14 ++ .../QuoteEntitlement/Enums/EntityType.php | 3 + .../QuoteEntitlement/QuoteEntitlement.php | 78 ++++++++- src/Resources/QuotedRamp/LineItem.php | 14 +- .../VaultedPaymentMethod.php | 96 +++++++++++ .../UpdateCreditNoteResponse.php | 45 +++++ .../ExportResponse/RampsExportResponse.php | 45 +++++ .../VoidBeforeCaptureInvoiceResponse.php | 59 +++++++ ...sForPaymentSourcePaymentSourceResponse.php | 54 ++++++ ...tSourcePaymentSourceResponseListObject.php | 14 ++ ...teEntitlementsQuoteEntitlementResponse.php | 54 ++++++ ...entsQuoteEntitlementResponseListObject.php | 14 ++ .../RetrieveVaultedPaymentMethodResponse.php | 45 +++++ src/Version.php | 2 +- 64 files changed, 1731 insertions(+), 57 deletions(-) create mode 100644 src/Actions/Contracts/QuoteEntitlementActionsInterface.php create mode 100644 src/Actions/Contracts/VaultedPaymentMethodActionsInterface.php create mode 100644 src/Actions/QuoteEntitlementActions.php create mode 100644 src/Actions/VaultedPaymentMethodActions.php create mode 100644 src/Enums/GatewayName.php create mode 100644 src/Enums/InvoiceAction.php create mode 100644 src/Resources/GatewayPaymentMethodToken/Enums/Status.php create mode 100644 src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php create mode 100644 src/Resources/OmnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.php create mode 100644 src/Resources/QuoteEntitlement/Enums/ActionType.php create mode 100644 src/Resources/VaultedPaymentMethod/VaultedPaymentMethod.php create mode 100644 src/Responses/CreditNoteResponse/UpdateCreditNoteResponse.php create mode 100644 src/Responses/ExportResponse/RampsExportResponse.php create mode 100644 src/Responses/InvoiceResponse/VoidBeforeCaptureInvoiceResponse.php create mode 100644 src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponse.php create mode 100644 src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject.php create mode 100644 src/Responses/QuoteEntitlementResponse/ListQuoteEntitlementsQuoteEntitlementResponse.php create mode 100644 src/Responses/QuoteEntitlementResponse/ListQuoteEntitlementsQuoteEntitlementResponseListObject.php create mode 100644 src/Responses/VaultedPaymentMethodResponse/RetrieveVaultedPaymentMethodResponse.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 84d17f4d..b309f340 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,72 @@ +### v4.26.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). + + + ### v4.25.2 (2026-08-18) * * * ### Bug Fixes: diff --git a/VERSION b/VERSION index 52665044..06edb387 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.25.2 +4.26.0 diff --git a/src/Actions/Contracts/CouponActionsInterface.php b/src/Actions/Contracts/CouponActionsInterface.php index 79ac6006..96c89dbb 100644 --- a/src/Actions/Contracts/CouponActionsInterface.php +++ b/src/Actions/Contracts/CouponActionsInterface.php @@ -86,8 +86,8 @@ * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/CreditNoteActionsInterface.php b/src/Actions/Contracts/CreditNoteActionsInterface.php index 672a641e..8c21c574 100644 --- a/src/Actions/Contracts/CreditNoteActionsInterface.php +++ b/src/Actions/Contracts/CreditNoteActionsInterface.php @@ -8,6 +8,7 @@ use Chargebee\Responses\CreditNoteResponse\VoidCreditNoteCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\CreateCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\DownloadEinvoiceCreditNoteResponse; +use Chargebee\Responses\CreditNoteResponse\UpdateCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\RemoveTaxWithheldRefundCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\CreditNotesForCustomerCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\RetrieveCreditNoteResponse; @@ -447,6 +448,22 @@ public function all(array $params = [], array $headers = []): ListCreditNoteResp */ public function create(array $params, array $headers = []): CreateCreditNoteResponse; + /** + * @see https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details?lang=php-v4 + * @param array{ + * comment?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateCreditNoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params = [], array $headers = []): UpdateCreditNoteResponse; + /** * @see https://apidocs.chargebee.com/docs/api/credit_notes/download-e-invoice-for-credit-note?lang=php-v4 * diff --git a/src/Actions/Contracts/CreditUnitActionsInterface.php b/src/Actions/Contracts/CreditUnitActionsInterface.php index c421db6a..d787ad09 100644 --- a/src/Actions/Contracts/CreditUnitActionsInterface.php +++ b/src/Actions/Contracts/CreditUnitActionsInterface.php @@ -21,12 +21,12 @@ * limit?: int, * offset?: string, * status?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/EntitlementActionsInterface.php b/src/Actions/Contracts/EntitlementActionsInterface.php index a0f27658..398ae8ba 100644 --- a/src/Actions/Contracts/EntitlementActionsInterface.php +++ b/src/Actions/Contracts/EntitlementActionsInterface.php @@ -18,16 +18,16 @@ * limit?: int, * offset?: string, * feature_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_type?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * include_drafts?: bool, * embed?: string, diff --git a/src/Actions/Contracts/ExportActionsInterface.php b/src/Actions/Contracts/ExportActionsInterface.php index 1b86222f..2c7b112c 100644 --- a/src/Actions/Contracts/ExportActionsInterface.php +++ b/src/Actions/Contracts/ExportActionsInterface.php @@ -9,6 +9,7 @@ use Chargebee\Responses\ExportResponse\CreditNotesExportResponse; use Chargebee\Responses\ExportResponse\CouponsExportResponse; use Chargebee\Responses\ExportResponse\SubscriptionsExportResponse; +use Chargebee\Responses\ExportResponse\RampsExportResponse; use Chargebee\Responses\ExportResponse\OrdersExportResponse; use Chargebee\Responses\ExportResponse\PlansExportResponse; use Chargebee\Responses\ExportResponse\AttachedItemsExportResponse; @@ -326,6 +327,44 @@ public function attachedItems(array $params = [], array $headers = []): Attached */ public function transactions(array $params = [], array $headers = []): TransactionsExportResponse; + /** + * @see https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps?lang=php-v4 + * @param array{ + * ramp?: array{ + * status?: array{ + * is?: string, + * in?: string, + * }, + * subscription_id?: array{ + * is?: string, + * in?: string, + * }, + * effective_from?: array{ + * after?: string, + * before?: string, + * on?: string, + * between?: string, + * }, + * updated_at?: array{ + * after?: string, + * before?: string, + * on?: string, + * between?: string, + * }, + * }, + * export_type?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return RampsExportResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function ramps(array $params = [], array $headers = []): RampsExportResponse; + /** * @see https://apidocs.chargebee.com/docs/api/exports/export-differential-price?lang=php-v4 * @param array{ @@ -1602,8 +1641,8 @@ public function creditNotes(array $params = [], array $headers = []): CreditNote * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/HostedPageActionsInterface.php b/src/Actions/Contracts/HostedPageActionsInterface.php index 7ff525f0..accbe4ff 100644 --- a/src/Actions/Contracts/HostedPageActionsInterface.php +++ b/src/Actions/Contracts/HostedPageActionsInterface.php @@ -678,6 +678,7 @@ public function checkoutExistingForItems(array $params, array $headers = []): Ch * pass_thru_content?: string, * cancel_url?: string, * redirect_url?: string, + * locale?: string, * } $params Description of the parameters * * @param array $headers diff --git a/src/Actions/Contracts/InvoiceActionsInterface.php b/src/Actions/Contracts/InvoiceActionsInterface.php index 12496a82..942b1751 100644 --- a/src/Actions/Contracts/InvoiceActionsInterface.php +++ b/src/Actions/Contracts/InvoiceActionsInterface.php @@ -6,6 +6,7 @@ use Chargebee\Responses\InvoiceResponse\AddChargeItemInvoiceResponse; use Chargebee\Responses\InvoiceResponse\DeleteInvoiceResponse; use Chargebee\Responses\InvoiceResponse\ApplyPaymentsInvoiceResponse; +use Chargebee\Responses\InvoiceResponse\VoidBeforeCaptureInvoiceResponse; use Chargebee\Responses\InvoiceResponse\WriteOffInvoiceResponse; use Chargebee\Responses\InvoiceResponse\RecordTaxWithheldInvoiceResponse; use Chargebee\Responses\InvoiceResponse\CollectPaymentInvoiceResponse; @@ -605,6 +606,24 @@ public function all(array $params = [], array $headers = []): ListInvoiceRespons */ public function create(array $params = [], array $headers = []): CreateInvoiceResponse; + /** + * @see https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture?lang=php-v4 + * @param array{ + * comment?: string, + * void_reason_code?: string, + * invoice_action?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return VoidBeforeCaptureInvoiceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function voidBeforeCapture(string $id, array $params = [], array $headers = []): VoidBeforeCaptureInvoiceResponse; + /** * @see https://apidocs.chargebee.com/docs/api/invoices/close-a-pending-invoice?lang=php-v4 * @param array{ @@ -1244,13 +1263,13 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] * offset?: string, * payment_reference_number?: array{ * number?: array{ - * in?: string, - * is?: string, + * is?: string, + * in?: string, * }, * }, * id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/LedgerOperationActionsInterface.php b/src/Actions/Contracts/LedgerOperationActionsInterface.php index b6113808..862dc17d 100644 --- a/src/Actions/Contracts/LedgerOperationActionsInterface.php +++ b/src/Actions/Contracts/LedgerOperationActionsInterface.php @@ -117,8 +117,8 @@ public function authorize(array $params, array $headers = []): AuthorizeLedgerOp * between?: mixed, * }, * type?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/Contracts/MeterActionsInterface.php b/src/Actions/Contracts/MeterActionsInterface.php index 9c14370c..7c0fdfdc 100644 --- a/src/Actions/Contracts/MeterActionsInterface.php +++ b/src/Actions/Contracts/MeterActionsInterface.php @@ -17,8 +17,8 @@ * limit?: int, * offset?: string, * name?: array{ - * starts_with?: mixed, * is?: mixed, + * starts_with?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php b/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php index 802e5ab6..74ab758f 100644 --- a/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php +++ b/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php @@ -107,12 +107,16 @@ public function omnichannelTransactionsForOmnichannelSubscription(string $id, ar * not_in?: mixed, * }, * updated_at?: array{ - * before?: mixed, * after?: mixed, + * on?: mixed, + * before?: mixed, + * between?: mixed, * }, * purchased_at?: array{ - * before?: mixed, * after?: mixed, + * on?: mixed, + * before?: mixed, + * between?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/Contracts/PaymentIntentActionsInterface.php b/src/Actions/Contracts/PaymentIntentActionsInterface.php index 7cfe1da5..d79830ed 100644 --- a/src/Actions/Contracts/PaymentIntentActionsInterface.php +++ b/src/Actions/Contracts/PaymentIntentActionsInterface.php @@ -36,6 +36,7 @@ public function retrieve(string $id, array $headers = []): RetrievePaymentIntent * payment_method_type?: string, * success_url?: string, * failure_url?: string, + * payment_method_options?: mixed, * } $params Description of the parameters * @param string $id * @param array $headers @@ -61,6 +62,7 @@ public function update(string $id, array $params = [], array $headers = []): Upd * payment_method_type?: string, * success_url?: string, * failure_url?: string, + * payment_method_options?: mixed, * } $params Description of the parameters * * @param array $headers diff --git a/src/Actions/Contracts/PaymentSourceActionsInterface.php b/src/Actions/Contracts/PaymentSourceActionsInterface.php index aa39ba0c..5df49f3e 100644 --- a/src/Actions/Contracts/PaymentSourceActionsInterface.php +++ b/src/Actions/Contracts/PaymentSourceActionsInterface.php @@ -1,6 +1,7 @@ $headers + * @return ListGatewayTokensForPaymentSourcePaymentSourceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listGatewayTokensForPaymentSource(string $id, array $params = [], array $headers = []): ListGatewayTokensForPaymentSourcePaymentSourceResponse; + /** * @see https://apidocs.chargebee.com/docs/api/payment_sources/verify-bank-account-payment-source?lang=php-v4 * @param array{ diff --git a/src/Actions/Contracts/QuoteActionsInterface.php b/src/Actions/Contracts/QuoteActionsInterface.php index 9c0f3e57..66e526f1 100644 --- a/src/Actions/Contracts/QuoteActionsInterface.php +++ b/src/Actions/Contracts/QuoteActionsInterface.php @@ -101,6 +101,7 @@ * charge_on_option?: string, * start_date?: int, * end_date?: int, + * description?: string, * ramp_tier_id?: string, * }>, * discounts?: array, + * entitlement_overrides?: array, * name?: string, * notes?: string, * expires_at?: int, @@ -319,6 +329,7 @@ public function retrieveSignedPdf(string $id, array $headers = []): RetrieveSign * item_type?: string, * start_date?: int, * end_date?: int, + * description?: string, * ramp_tier_id?: string, * }>, * discounts?: array, + * entitlement_overrides?: array, * notes?: string, * expires_at?: int, * mandatory_items_to_remove?: array, @@ -563,6 +583,7 @@ public function delete(string $id, array $params = [], array $headers = []): Del * charge_on_option?: string, * start_date?: int, * end_date?: int, + * description?: string, * ramp_tier_id?: string, * }>, * discounts?: array, + * entitlement_overrides?: array, * notes?: string, * expires_at?: int, * billing_cycles?: int, @@ -685,6 +715,7 @@ public function editCreateSubCustomerQuoteForItems(string $id, array $params, ar * item_type?: string, * start_date?: int, * end_date?: int, + * description?: string, * ramp_tier_id?: string, * }>, * discounts?: array, + * entitlement_overrides?: array, * name?: string, * notes?: string, * expires_at?: int, diff --git a/src/Actions/Contracts/QuoteEntitlementActionsInterface.php b/src/Actions/Contracts/QuoteEntitlementActionsInterface.php new file mode 100644 index 00000000..eea00d44 --- /dev/null +++ b/src/Actions/Contracts/QuoteEntitlementActionsInterface.php @@ -0,0 +1,41 @@ + $headers + * @return ListQuoteEntitlementsQuoteEntitlementResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listQuoteEntitlements(string $id, array $params = [], array $headers = []): ListQuoteEntitlementsQuoteEntitlementResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/RampActionsInterface.php b/src/Actions/Contracts/RampActionsInterface.php index 99798c48..1df8df1c 100644 --- a/src/Actions/Contracts/RampActionsInterface.php +++ b/src/Actions/Contracts/RampActionsInterface.php @@ -111,12 +111,12 @@ public function createForSubscription(string $id, array $params, array $headers * offset?: string, * include_deleted?: bool, * status?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * subscription_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * effective_from?: array{ * after?: mixed, diff --git a/src/Actions/Contracts/VaultedPaymentMethodActionsInterface.php b/src/Actions/Contracts/VaultedPaymentMethodActionsInterface.php new file mode 100644 index 00000000..3507b96a --- /dev/null +++ b/src/Actions/Contracts/VaultedPaymentMethodActionsInterface.php @@ -0,0 +1,29 @@ + $headers + * @return RetrieveVaultedPaymentMethodResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveVaultedPaymentMethodResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/CouponActions.php b/src/Actions/CouponActions.php index 6bdeda1a..75e7d556 100644 --- a/src/Actions/CouponActions.php +++ b/src/Actions/CouponActions.php @@ -99,8 +99,8 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/CreditNoteActions.php b/src/Actions/CreditNoteActions.php index d7be5867..e84f4452 100644 --- a/src/Actions/CreditNoteActions.php +++ b/src/Actions/CreditNoteActions.php @@ -10,6 +10,7 @@ use Chargebee\Responses\CreditNoteResponse\CreateCreditNoteResponse; use Chargebee\ValueObjects\Encoders\ListParamEncoder; use Chargebee\Responses\CreditNoteResponse\DownloadEinvoiceCreditNoteResponse; +use Chargebee\Responses\CreditNoteResponse\UpdateCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\RemoveTaxWithheldRefundCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\CreditNotesForCustomerCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\RetrieveCreditNoteResponse; @@ -657,6 +658,42 @@ public function create(array $params, array $headers = []): CreateCreditNoteResp return CreateCreditNoteResponse::from($respObject->data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details?lang=php-v4 + * @param array{ + * comment?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateCreditNoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params = [], array $headers = []): UpdateCreditNoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["credit_notes",$id,"update"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("creditNote") + ->withTelemetryOperation("update") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateCreditNoteResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/credit_notes/download-e-invoice-for-credit-note?lang=php-v4 * diff --git a/src/Actions/CreditUnitActions.php b/src/Actions/CreditUnitActions.php index 0220eb0e..5a78f9ff 100644 --- a/src/Actions/CreditUnitActions.php +++ b/src/Actions/CreditUnitActions.php @@ -34,12 +34,12 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * limit?: int, * offset?: string, * status?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/EntitlementActions.php b/src/Actions/EntitlementActions.php index d83d96c2..ac18aadc 100644 --- a/src/Actions/EntitlementActions.php +++ b/src/Actions/EntitlementActions.php @@ -31,16 +31,16 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * limit?: int, * offset?: string, * feature_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_type?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * include_drafts?: bool, * embed?: string, diff --git a/src/Actions/ExportActions.php b/src/Actions/ExportActions.php index 78cda91f..16baac05 100644 --- a/src/Actions/ExportActions.php +++ b/src/Actions/ExportActions.php @@ -9,6 +9,7 @@ use Chargebee\Responses\ExportResponse\CreditNotesExportResponse; use Chargebee\Responses\ExportResponse\CouponsExportResponse; use Chargebee\Responses\ExportResponse\SubscriptionsExportResponse; +use Chargebee\Responses\ExportResponse\RampsExportResponse; use Chargebee\Responses\ExportResponse\OrdersExportResponse; use Chargebee\Responses\ExportResponse\PlansExportResponse; use Chargebee\Responses\ExportResponse\AttachedItemsExportResponse; @@ -398,6 +399,64 @@ public function transactions(array $params = [], array $headers = []): Transacti return TransactionsExportResponse::from($respObject->data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps?lang=php-v4 + * @param array{ + * ramp?: array{ + * status?: array{ + * is?: string, + * in?: string, + * }, + * subscription_id?: array{ + * is?: string, + * in?: string, + * }, + * effective_from?: array{ + * after?: string, + * before?: string, + * on?: string, + * between?: string, + * }, + * updated_at?: array{ + * after?: string, + * before?: string, + * on?: string, + * between?: string, + * }, + * }, + * export_type?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return RampsExportResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function ramps(array $params = [], array $headers = []): RampsExportResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["exports","ramps"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("export") + ->withTelemetryOperation("ramps") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RampsExportResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/exports/export-differential-price?lang=php-v4 * @param array{ @@ -1852,8 +1911,8 @@ public function creditNotes(array $params = [], array $headers = []): CreditNote * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/HostedPageActions.php b/src/Actions/HostedPageActions.php index 2be0332b..4c78ff9b 100644 --- a/src/Actions/HostedPageActions.php +++ b/src/Actions/HostedPageActions.php @@ -951,6 +951,7 @@ public function checkoutExistingForItems(array $params, array $headers = []): Ch * pass_thru_content?: string, * cancel_url?: string, * redirect_url?: string, + * locale?: string, * } $params Description of the parameters * * @param array $headers diff --git a/src/Actions/InvoiceActions.php b/src/Actions/InvoiceActions.php index c1023e6c..63271ee9 100644 --- a/src/Actions/InvoiceActions.php +++ b/src/Actions/InvoiceActions.php @@ -6,6 +6,7 @@ use Chargebee\Responses\InvoiceResponse\AddChargeItemInvoiceResponse; use Chargebee\Responses\InvoiceResponse\DeleteInvoiceResponse; use Chargebee\Responses\InvoiceResponse\ApplyPaymentsInvoiceResponse; +use Chargebee\Responses\InvoiceResponse\VoidBeforeCaptureInvoiceResponse; use Chargebee\Responses\InvoiceResponse\WriteOffInvoiceResponse; use Chargebee\Responses\InvoiceResponse\RecordTaxWithheldInvoiceResponse; use Chargebee\Responses\InvoiceResponse\CollectPaymentInvoiceResponse; @@ -916,6 +917,44 @@ public function create(array $params = [], array $headers = []): CreateInvoiceRe return CreateInvoiceResponse::from($respObject->data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture?lang=php-v4 + * @param array{ + * comment?: string, + * void_reason_code?: string, + * invoice_action?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return VoidBeforeCaptureInvoiceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function voidBeforeCapture(string $id, array $params = [], array $headers = []): VoidBeforeCaptureInvoiceResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["invoices",$id,"void_before_capture"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("invoice") + ->withTelemetryOperation("voidBeforeCapture") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return VoidBeforeCaptureInvoiceResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/invoices/close-a-pending-invoice?lang=php-v4 * @param array{ @@ -1834,13 +1873,13 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] * offset?: string, * payment_reference_number?: array{ * number?: array{ - * in?: string, - * is?: string, + * is?: string, + * in?: string, * }, * }, * id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/LedgerOperationActions.php b/src/Actions/LedgerOperationActions.php index 35ec570c..689e7578 100644 --- a/src/Actions/LedgerOperationActions.php +++ b/src/Actions/LedgerOperationActions.php @@ -219,8 +219,8 @@ public function authorize(array $params, array $headers = []): AuthorizeLedgerOp * between?: mixed, * }, * type?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/MeterActions.php b/src/Actions/MeterActions.php index 83f0acc8..5bd549c4 100644 --- a/src/Actions/MeterActions.php +++ b/src/Actions/MeterActions.php @@ -30,8 +30,8 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * limit?: int, * offset?: string, * name?: array{ - * starts_with?: mixed, * is?: mixed, + * starts_with?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/OmnichannelSubscriptionActions.php b/src/Actions/OmnichannelSubscriptionActions.php index 884f803d..336c4a6e 100644 --- a/src/Actions/OmnichannelSubscriptionActions.php +++ b/src/Actions/OmnichannelSubscriptionActions.php @@ -177,12 +177,16 @@ public function omnichannelTransactionsForOmnichannelSubscription(string $id, ar * not_in?: mixed, * }, * updated_at?: array{ - * before?: mixed, * after?: mixed, + * on?: mixed, + * before?: mixed, + * between?: mixed, * }, * purchased_at?: array{ - * before?: mixed, * after?: mixed, + * on?: mixed, + * before?: mixed, + * between?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/PaymentIntentActions.php b/src/Actions/PaymentIntentActions.php index b604e515..13b40f28 100644 --- a/src/Actions/PaymentIntentActions.php +++ b/src/Actions/PaymentIntentActions.php @@ -66,6 +66,7 @@ public function retrieve(string $id, array $headers = []): RetrievePaymentIntent * payment_method_type?: string, * success_url?: string, * failure_url?: string, + * payment_method_options?: mixed, * } $params Description of the parameters * @param string $id * @param array $headers @@ -79,6 +80,7 @@ public function retrieve(string $id, array $headers = []): RetrievePaymentIntent public function update(string $id, array $params = [], array $headers = []): UpdatePaymentIntentResponse { $jsonKeys = [ + "paymentMethodOptions" => 0, ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) @@ -111,6 +113,7 @@ public function update(string $id, array $params = [], array $headers = []): Upd * payment_method_type?: string, * success_url?: string, * failure_url?: string, + * payment_method_options?: mixed, * } $params Description of the parameters * * @param array $headers @@ -124,6 +127,7 @@ public function update(string $id, array $params = [], array $headers = []): Upd public function create(array $params, array $headers = []): CreatePaymentIntentResponse { $jsonKeys = [ + "paymentMethodOptions" => 0, ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) diff --git a/src/Actions/PaymentSourceActions.php b/src/Actions/PaymentSourceActions.php index f6d69c43..1a960045 100644 --- a/src/Actions/PaymentSourceActions.php +++ b/src/Actions/PaymentSourceActions.php @@ -1,6 +1,7 @@ data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * include_deleted?: bool, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ListGatewayTokensForPaymentSourcePaymentSourceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listGatewayTokensForPaymentSource(string $id, array $params = [], array $headers = []): ListGatewayTokensForPaymentSourcePaymentSourceResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["payment_sources",$id,"gateway_payment_method_tokens"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("paymentSource") + ->withTelemetryOperation("listGatewayTokensForPaymentSource") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListGatewayTokensForPaymentSourcePaymentSourceResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/payment_sources/verify-bank-account-payment-source?lang=php-v4 * @param array{ diff --git a/src/Actions/QuoteActions.php b/src/Actions/QuoteActions.php index fedce707..f8de3f7d 100644 --- a/src/Actions/QuoteActions.php +++ b/src/Actions/QuoteActions.php @@ -114,6 +114,7 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * charge_on_option?: string, * start_date?: int, * end_date?: int, + * description?: string, * ramp_tier_id?: string, * }>, * discounts?: array, + * entitlement_overrides?: array, * name?: string, * notes?: string, * expires_at?: int, @@ -468,6 +478,7 @@ public function retrieveSignedPdf(string $id, array $headers = []): RetrieveSign * item_type?: string, * start_date?: int, * end_date?: int, + * description?: string, * ramp_tier_id?: string, * }>, * discounts?: array, + * entitlement_overrides?: array, * notes?: string, * expires_at?: int, * mandatory_items_to_remove?: array, @@ -809,6 +829,7 @@ public function delete(string $id, array $params = [], array $headers = []): Del * charge_on_option?: string, * start_date?: int, * end_date?: int, + * description?: string, * ramp_tier_id?: string, * }>, * discounts?: array, + * entitlement_overrides?: array, * notes?: string, * expires_at?: int, * billing_cycles?: int, @@ -951,6 +981,7 @@ public function editCreateSubCustomerQuoteForItems(string $id, array $params, ar * item_type?: string, * start_date?: int, * end_date?: int, + * description?: string, * ramp_tier_id?: string, * }>, * discounts?: array, + * entitlement_overrides?: array, * name?: string, * notes?: string, * expires_at?: int, diff --git a/src/Actions/QuoteEntitlementActions.php b/src/Actions/QuoteEntitlementActions.php new file mode 100644 index 00000000..ef85f88e --- /dev/null +++ b/src/Actions/QuoteEntitlementActions.php @@ -0,0 +1,73 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/quote_entitlements/list-quote-entitlements?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * entity_id?: array{ + * is?: mixed, + * }, + * start_date?: array{ + * on?: mixed, + * }, + * end_date?: array{ + * on?: mixed, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ListQuoteEntitlementsQuoteEntitlementResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listQuoteEntitlements(string $id, array $params = [], array $headers = []): ListQuoteEntitlementsQuoteEntitlementResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["quotes",$id,"quote_entitlements"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("quoteEntitlement") + ->withTelemetryOperation("listQuoteEntitlements") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListQuoteEntitlementsQuoteEntitlementResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/RampActions.php b/src/Actions/RampActions.php index b932522d..897af978 100644 --- a/src/Actions/RampActions.php +++ b/src/Actions/RampActions.php @@ -162,12 +162,12 @@ public function createForSubscription(string $id, array $params, array $headers * offset?: string, * include_deleted?: bool, * status?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * subscription_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * effective_from?: array{ * after?: mixed, diff --git a/src/Actions/VaultedPaymentMethodActions.php b/src/Actions/VaultedPaymentMethodActions.php new file mode 100644 index 00000000..8719fa45 --- /dev/null +++ b/src/Actions/VaultedPaymentMethodActions.php @@ -0,0 +1,59 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/vaulted_payment_methods/retrieve-vaulted-payment-method?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveVaultedPaymentMethodResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveVaultedPaymentMethodResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["vaulted_payment_methods",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("vaultedPaymentMethod") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveVaultedPaymentMethodResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/ChargebeeClient.php b/src/ChargebeeClient.php index c2bf088a..4dd2eb8c 100644 --- a/src/ChargebeeClient.php +++ b/src/ChargebeeClient.php @@ -114,6 +114,8 @@ use Chargebee\Actions\PurchaseActions; use Chargebee\Actions\Contracts\QuoteActionsInterface; use Chargebee\Actions\QuoteActions; +use Chargebee\Actions\Contracts\QuoteEntitlementActionsInterface; +use Chargebee\Actions\QuoteEntitlementActions; use Chargebee\Actions\Contracts\RampActionsInterface; use Chargebee\Actions\RampActions; use Chargebee\Actions\Contracts\RecordedPurchaseActionsInterface; @@ -144,6 +146,8 @@ use Chargebee\Actions\UsageFileActions; use Chargebee\Actions\Contracts\UsageSummaryActionsInterface; use Chargebee\Actions\UsageSummaryActions; +use Chargebee\Actions\Contracts\VaultedPaymentMethodActionsInterface; +use Chargebee\Actions\VaultedPaymentMethodActions; use Chargebee\Actions\Contracts\VirtualBankAccountActionsInterface; use Chargebee\Actions\VirtualBankAccountActions; use Chargebee\Actions\Contracts\WebhookEndpointActionsInterface; @@ -455,6 +459,10 @@ public function quote() :QuoteActionsInterface { return new QuoteActions($this->httpClientFactory, $this->env); } + public function quoteEntitlement() :QuoteEntitlementActionsInterface { + return new QuoteEntitlementActions($this->httpClientFactory, $this->env); + } + public function ramp() :RampActionsInterface { return new RampActions($this->httpClientFactory, $this->env); } @@ -515,6 +523,10 @@ public function usageSummary() :UsageSummaryActionsInterface { return new UsageSummaryActions($this->httpClientFactory, $this->env); } + public function vaultedPaymentMethod() :VaultedPaymentMethodActionsInterface { + return new VaultedPaymentMethodActions($this->httpClientFactory, $this->env); + } + public function virtualBankAccount() :VirtualBankAccountActionsInterface { return new VirtualBankAccountActions($this->httpClientFactory, $this->env); } diff --git a/src/Enums/CreditOptionForCurrentTermCharges.php b/src/Enums/CreditOptionForCurrentTermCharges.php index b88f804e..7bf81c77 100644 --- a/src/Enums/CreditOptionForCurrentTermCharges.php +++ b/src/Enums/CreditOptionForCurrentTermCharges.php @@ -6,6 +6,7 @@ enum CreditOptionForCurrentTermCharges : string { case NONE = "none"; case PRORATE = "prorate"; case FULL = "full"; + case CONSUMPTION_BASED = "consumption_based"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Enums/EnabledEvents.php b/src/Enums/EnabledEvents.php index 0826060b..0e4537ab 100644 --- a/src/Enums/EnabledEvents.php +++ b/src/Enums/EnabledEvents.php @@ -226,10 +226,14 @@ enum EnabledEvents : string { case ALERT_STATUS_CHANGED = "alert_status_changed"; case OMNICHANNEL_SUBSCRIPTION_ITEM_UPDATED = "omnichannel_subscription_item_updated"; case OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED = "omnichannel_subscription_item_recovered"; + case OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED = "omnichannel_subscription_item_mrr_updated"; case LEDGER_ACCOUNT_BALANCE_UPDATED = "ledger_account_balance_updated"; case GRANT_BLOCKS_CREATED = "grant_blocks_created"; case GRANT_BLOCKS_UPDATED = "grant_blocks_updated"; case LEDGER_UPDATED = "ledger_updated"; + case VAULT_TOKEN_CREATED = "vault_token_created"; + case VAULT_TOKEN_UPDATED = "vault_token_updated"; + case VAULT_TOKEN_DELETED = "vault_token_deleted"; case PLAN_CREATED = "plan_created"; case PLAN_UPDATED = "plan_updated"; case PLAN_DELETED = "plan_deleted"; diff --git a/src/Enums/EntityType.php b/src/Enums/EntityType.php index 43b69fbd..95712d91 100644 --- a/src/Enums/EntityType.php +++ b/src/Enums/EntityType.php @@ -12,7 +12,6 @@ enum EntityType : string { case PLAN_PRICE = "plan_price"; case ADDON_PRICE = "addon_price"; case CHARGE_PRICE = "charge_price"; - case CHARGE = "charge"; case INVOICE = "invoice"; case QUOTE = "quote"; case CREDIT_NOTE = "credit_note"; @@ -45,6 +44,11 @@ enum EntityType : string { case BUSINESS_RULE = "business_rule"; case RULESET = "ruleset"; case ALERT_STATUS = "alert_status"; + case OMNICHANNEL_SUBSCRIPTION_ITEM_METRIC = "omnichannel_subscription_item_metric"; + /* + * @depcreated + */ + case CHARGE = "charge"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Enums/EventType.php b/src/Enums/EventType.php index bb9b3c29..d0b24f0f 100644 --- a/src/Enums/EventType.php +++ b/src/Enums/EventType.php @@ -217,10 +217,14 @@ enum EventType : string { case ALERT_STATUS_CHANGED = "alert_status_changed"; case OMNICHANNEL_SUBSCRIPTION_ITEM_UPDATED = "omnichannel_subscription_item_updated"; case OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED = "omnichannel_subscription_item_recovered"; + case OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED = "omnichannel_subscription_item_mrr_updated"; case LEDGER_ACCOUNT_BALANCE_UPDATED = "ledger_account_balance_updated"; case GRANT_BLOCKS_CREATED = "grant_blocks_created"; case GRANT_BLOCKS_UPDATED = "grant_blocks_updated"; case LEDGER_UPDATED = "ledger_updated"; + case VAULT_TOKEN_CREATED = "vault_token_created"; + case VAULT_TOKEN_UPDATED = "vault_token_updated"; + case VAULT_TOKEN_DELETED = "vault_token_deleted"; case PLAN_CREATED = "plan_created"; case PLAN_UPDATED = "plan_updated"; case PLAN_DELETED = "plan_deleted"; diff --git a/src/Enums/GatewayName.php b/src/Enums/GatewayName.php new file mode 100644 index 00000000..f7d70a18 --- /dev/null +++ b/src/Enums/GatewayName.php @@ -0,0 +1,73 @@ + \ No newline at end of file diff --git a/src/Enums/InvoiceAction.php b/src/Enums/InvoiceAction.php new file mode 100644 index 00000000..14920acb --- /dev/null +++ b/src/Enums/InvoiceAction.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/Content/Content.php b/src/Resources/Content/Content.php index 05cee5bf..63243e96 100644 --- a/src/Resources/Content/Content.php +++ b/src/Resources/Content/Content.php @@ -42,6 +42,7 @@ use Chargebee\Resources\Feature\Feature; use Chargebee\Resources\FilterCondition\FilterCondition; use Chargebee\Resources\GatewayErrorDetail\GatewayErrorDetail; +use Chargebee\Resources\GatewayPaymentMethodToken\GatewayPaymentMethodToken; use Chargebee\Resources\Gift\Gift; use Chargebee\Resources\GrantBlock\GrantBlock; use Chargebee\Resources\Hierarchy\Hierarchy; @@ -70,6 +71,7 @@ use Chargebee\Resources\OmnichannelOneTimeOrderItem\OmnichannelOneTimeOrderItem; use Chargebee\Resources\OmnichannelSubscription\OmnichannelSubscription; use Chargebee\Resources\OmnichannelSubscriptionItem\OmnichannelSubscriptionItem; +use Chargebee\Resources\OmnichannelSubscriptionItemMetric\OmnichannelSubscriptionItemMetric; use Chargebee\Resources\OmnichannelSubscriptionItemOffer\OmnichannelSubscriptionItemOffer; use Chargebee\Resources\OmnichannelSubscriptionItemScheduledChange\OmnichannelSubscriptionItemScheduledChange; use Chargebee\Resources\OmnichannelTransaction\OmnichannelTransaction; @@ -90,6 +92,7 @@ use Chargebee\Resources\PromotionalGrant\PromotionalGrant; use Chargebee\Resources\Purchase\Purchase; use Chargebee\Resources\Quote\Quote; +use Chargebee\Resources\QuoteEntitlement\QuoteEntitlement; use Chargebee\Resources\QuoteLineGroup\QuoteLineGroup; use Chargebee\Resources\QuotedCharge\QuotedCharge; use Chargebee\Resources\QuotedDeltaRamp\QuotedDeltaRamp; @@ -116,6 +119,7 @@ use Chargebee\Resources\UsageEvent\UsageEvent; use Chargebee\Resources\UsageFile\UsageFile; use Chargebee\Resources\UsageSummary\UsageSummary; +use Chargebee\Resources\VaultedPaymentMethod\VaultedPaymentMethod; use Chargebee\Resources\VirtualBankAccount\VirtualBankAccount; use Chargebee\Resources\WebhookEndpoint\WebhookEndpoint; @@ -366,6 +370,12 @@ class Content { */ public ?GatewayErrorDetail $gatewayerrordetail; + /** + * + * @var ?GatewayPaymentMethodToken $gatewaypaymentmethodtoken + */ + public ?GatewayPaymentMethodToken $gatewaypaymentmethodtoken; + /** * * @var ?Gift $gift @@ -534,6 +544,12 @@ class Content { */ public ?OmnichannelSubscriptionItem $omnichannelsubscriptionitem; + /** + * + * @var ?OmnichannelSubscriptionItemMetric $omnichannelsubscriptionitemmetric + */ + public ?OmnichannelSubscriptionItemMetric $omnichannelsubscriptionitemmetric; + /** * * @var ?OmnichannelSubscriptionItemOffer $omnichannelsubscriptionitemoffer @@ -654,6 +670,12 @@ class Content { */ public ?Quote $quote; + /** + * + * @var ?QuoteEntitlement $quoteentitlement + */ + public ?QuoteEntitlement $quoteentitlement; + /** * * @var ?QuoteLineGroup $quotelinegroup @@ -810,6 +832,12 @@ class Content { */ public ?UsageSummary $usagesummary; + /** + * + * @var ?VaultedPaymentMethod $vaultedpaymentmethod + */ + public ?VaultedPaymentMethod $vaultedpaymentmethod; + /** * * @var ?VirtualBankAccount $virtualbankaccount @@ -825,7 +853,7 @@ class Content { /** * @var array $knownFields */ - protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "async_response" , "async_response_list" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "column_definition" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "credit_unit" , "currency" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "download" , "einvoice" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "filter_condition" , "gateway_error_detail" , "gift" , "grant_block" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "ledger_account_balance" , "ledger_entry" , "ledger_operation" , "metadata" , "meter" , "metered_feature" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "promotional_grant" , "purchase" , "quote" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "virtual_bank_account" , "webhook_endpoint" ]; + protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "async_response" , "async_response_list" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "column_definition" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "credit_unit" , "currency" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "download" , "einvoice" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "filter_condition" , "gateway_error_detail" , "gateway_payment_method_token" , "gift" , "grant_block" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "ledger_account_balance" , "ledger_entry" , "ledger_operation" , "metadata" , "meter" , "metered_feature" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_metric" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "promotional_grant" , "purchase" , "quote" , "quote_entitlement" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "vaulted_payment_method" , "virtual_bank_account" , "webhook_endpoint" ]; /** * dynamic properties for resources @@ -875,6 +903,7 @@ private function __construct( ?Feature $feature, ?FilterCondition $filtercondition, ?GatewayErrorDetail $gatewayerrordetail, + ?GatewayPaymentMethodToken $gatewaypaymentmethodtoken, ?Gift $gift, ?GrantBlock $grantblock, ?Hierarchy $hierarchy, @@ -903,6 +932,7 @@ private function __construct( ?OmnichannelOneTimeOrderItem $omnichannelonetimeorderitem, ?OmnichannelSubscription $omnichannelsubscription, ?OmnichannelSubscriptionItem $omnichannelsubscriptionitem, + ?OmnichannelSubscriptionItemMetric $omnichannelsubscriptionitemmetric, ?OmnichannelSubscriptionItemOffer $omnichannelsubscriptionitemoffer, ?OmnichannelSubscriptionItemScheduledChange $omnichannelsubscriptionitemscheduledchange, ?OmnichannelTransaction $omnichanneltransaction, @@ -923,6 +953,7 @@ private function __construct( ?PromotionalGrant $promotionalgrant, ?Purchase $purchase, ?Quote $quote, + ?QuoteEntitlement $quoteentitlement, ?QuoteLineGroup $quotelinegroup, ?QuotedCharge $quotedcharge, ?QuotedDeltaRamp $quoteddeltaramp, @@ -949,6 +980,7 @@ private function __construct( ?UsageEvent $usageevent, ?UsageFile $usagefile, ?UsageSummary $usagesummary, + ?VaultedPaymentMethod $vaultedpaymentmethod, ?VirtualBankAccount $virtualbankaccount, ?WebhookEndpoint $webhookendpoint, ) @@ -994,6 +1026,7 @@ private function __construct( $this->feature = $feature; $this->filtercondition = $filtercondition; $this->gatewayerrordetail = $gatewayerrordetail; + $this->gatewaypaymentmethodtoken = $gatewaypaymentmethodtoken; $this->gift = $gift; $this->grantblock = $grantblock; $this->hierarchy = $hierarchy; @@ -1022,6 +1055,7 @@ private function __construct( $this->omnichannelonetimeorderitem = $omnichannelonetimeorderitem; $this->omnichannelsubscription = $omnichannelsubscription; $this->omnichannelsubscriptionitem = $omnichannelsubscriptionitem; + $this->omnichannelsubscriptionitemmetric = $omnichannelsubscriptionitemmetric; $this->omnichannelsubscriptionitemoffer = $omnichannelsubscriptionitemoffer; $this->omnichannelsubscriptionitemscheduledchange = $omnichannelsubscriptionitemscheduledchange; $this->omnichanneltransaction = $omnichanneltransaction; @@ -1042,6 +1076,7 @@ private function __construct( $this->promotionalgrant = $promotionalgrant; $this->purchase = $purchase; $this->quote = $quote; + $this->quoteentitlement = $quoteentitlement; $this->quotelinegroup = $quotelinegroup; $this->quotedcharge = $quotedcharge; $this->quoteddeltaramp = $quoteddeltaramp; @@ -1068,6 +1103,7 @@ private function __construct( $this->usageevent = $usageevent; $this->usagefile = $usagefile; $this->usagesummary = $usagesummary; + $this->vaultedpaymentmethod = $vaultedpaymentmethod; $this->virtualbankaccount = $virtualbankaccount; $this->webhookendpoint = $webhookendpoint; } @@ -1115,6 +1151,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['feature']) ? Feature::from($resourceAttributes['feature']) : null, isset($resourceAttributes['filter_condition']) ? FilterCondition::from($resourceAttributes['filter_condition']) : null, isset($resourceAttributes['gateway_error_detail']) ? GatewayErrorDetail::from($resourceAttributes['gateway_error_detail']) : null, + isset($resourceAttributes['gateway_payment_method_token']) ? GatewayPaymentMethodToken::from($resourceAttributes['gateway_payment_method_token']) : null, isset($resourceAttributes['gift']) ? Gift::from($resourceAttributes['gift']) : null, isset($resourceAttributes['grant_block']) ? GrantBlock::from($resourceAttributes['grant_block']) : null, isset($resourceAttributes['hierarchy']) ? Hierarchy::from($resourceAttributes['hierarchy']) : null, @@ -1143,6 +1180,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['omnichannel_one_time_order_item']) ? OmnichannelOneTimeOrderItem::from($resourceAttributes['omnichannel_one_time_order_item']) : null, isset($resourceAttributes['omnichannel_subscription']) ? OmnichannelSubscription::from($resourceAttributes['omnichannel_subscription']) : null, isset($resourceAttributes['omnichannel_subscription_item']) ? OmnichannelSubscriptionItem::from($resourceAttributes['omnichannel_subscription_item']) : null, + isset($resourceAttributes['omnichannel_subscription_item_metric']) ? OmnichannelSubscriptionItemMetric::from($resourceAttributes['omnichannel_subscription_item_metric']) : null, isset($resourceAttributes['omnichannel_subscription_item_offer']) ? OmnichannelSubscriptionItemOffer::from($resourceAttributes['omnichannel_subscription_item_offer']) : null, isset($resourceAttributes['omnichannel_subscription_item_scheduled_change']) ? OmnichannelSubscriptionItemScheduledChange::from($resourceAttributes['omnichannel_subscription_item_scheduled_change']) : null, isset($resourceAttributes['omnichannel_transaction']) ? OmnichannelTransaction::from($resourceAttributes['omnichannel_transaction']) : null, @@ -1163,6 +1201,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['promotional_grant']) ? PromotionalGrant::from($resourceAttributes['promotional_grant']) : null, isset($resourceAttributes['purchase']) ? Purchase::from($resourceAttributes['purchase']) : null, isset($resourceAttributes['quote']) ? Quote::from($resourceAttributes['quote']) : null, + isset($resourceAttributes['quote_entitlement']) ? QuoteEntitlement::from($resourceAttributes['quote_entitlement']) : null, isset($resourceAttributes['quote_line_group']) ? QuoteLineGroup::from($resourceAttributes['quote_line_group']) : null, isset($resourceAttributes['quoted_charge']) ? QuotedCharge::from($resourceAttributes['quoted_charge']) : null, isset($resourceAttributes['quoted_delta_ramp']) ? QuotedDeltaRamp::from($resourceAttributes['quoted_delta_ramp']) : null, @@ -1189,6 +1228,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['usage_event']) ? UsageEvent::from($resourceAttributes['usage_event']) : null, isset($resourceAttributes['usage_file']) ? UsageFile::from($resourceAttributes['usage_file']) : null, isset($resourceAttributes['usage_summary']) ? UsageSummary::from($resourceAttributes['usage_summary']) : null, + isset($resourceAttributes['vaulted_payment_method']) ? VaultedPaymentMethod::from($resourceAttributes['vaulted_payment_method']) : null, isset($resourceAttributes['virtual_bank_account']) ? VirtualBankAccount::from($resourceAttributes['virtual_bank_account']) : null, isset($resourceAttributes['webhook_endpoint']) ? WebhookEndpoint::from($resourceAttributes['webhook_endpoint']) : null, @@ -1314,6 +1354,10 @@ public function toArray(): array + + + + @@ -1447,6 +1491,9 @@ public function toArray(): array if($this->gatewayerrordetail instanceof GatewayErrorDetail){ $data['gateway_error_detail'] = $this->gatewayerrordetail->toArray(); } + if($this->gatewaypaymentmethodtoken instanceof GatewayPaymentMethodToken){ + $data['gateway_payment_method_token'] = $this->gatewaypaymentmethodtoken->toArray(); + } if($this->gift instanceof Gift){ $data['gift'] = $this->gift->toArray(); } @@ -1531,6 +1578,9 @@ public function toArray(): array if($this->omnichannelsubscriptionitem instanceof OmnichannelSubscriptionItem){ $data['omnichannel_subscription_item'] = $this->omnichannelsubscriptionitem->toArray(); } + if($this->omnichannelsubscriptionitemmetric instanceof OmnichannelSubscriptionItemMetric){ + $data['omnichannel_subscription_item_metric'] = $this->omnichannelsubscriptionitemmetric->toArray(); + } if($this->omnichannelsubscriptionitemoffer instanceof OmnichannelSubscriptionItemOffer){ $data['omnichannel_subscription_item_offer'] = $this->omnichannelsubscriptionitemoffer->toArray(); } @@ -1591,6 +1641,9 @@ public function toArray(): array if($this->quote instanceof Quote){ $data['quote'] = $this->quote->toArray(); } + if($this->quoteentitlement instanceof QuoteEntitlement){ + $data['quote_entitlement'] = $this->quoteentitlement->toArray(); + } if($this->quotelinegroup instanceof QuoteLineGroup){ $data['quote_line_group'] = $this->quotelinegroup->toArray(); } @@ -1669,6 +1722,9 @@ public function toArray(): array if($this->usagesummary instanceof UsageSummary){ $data['usage_summary'] = $this->usagesummary->toArray(); } + if($this->vaultedpaymentmethod instanceof VaultedPaymentMethod){ + $data['vaulted_payment_method'] = $this->vaultedpaymentmethod->toArray(); + } if($this->virtualbankaccount instanceof VirtualBankAccount){ $data['virtual_bank_account'] = $this->virtualbankaccount->toArray(); } diff --git a/src/Resources/GatewayPaymentMethodToken/Enums/Status.php b/src/Resources/GatewayPaymentMethodToken/Enums/Status.php new file mode 100644 index 00000000..ed9d7204 --- /dev/null +++ b/src/Resources/GatewayPaymentMethodToken/Enums/Status.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php b/src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php new file mode 100644 index 00000000..8f9f8bfe --- /dev/null +++ b/src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php @@ -0,0 +1,130 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "gateway_account_id" , "gateway_customer_id" , "gateway_token" , "created_at" , "updated_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $gateway_account_id, + ?string $gateway_customer_id, + ?string $gateway_token, + ?int $created_at, + ?int $updated_at, + ?\Chargebee\Enums\GatewayName $gateway_name, + ?\Chargebee\Resources\GatewayPaymentMethodToken\Enums\Status $status, + ) + { + $this->id = $id; + $this->gateway_account_id = $gateway_account_id; + $this->gateway_customer_id = $gateway_customer_id; + $this->gateway_token = $gateway_token; + $this->created_at = $created_at; + $this->updated_at = $updated_at; + $this->gateway_name = $gateway_name; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['gateway_account_id'] ?? null, + $resourceAttributes['gateway_customer_id'] ?? null, + $resourceAttributes['gateway_token'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + + + isset($resourceAttributes['gateway_name']) ? \Chargebee\Enums\GatewayName::tryFromValue($resourceAttributes['gateway_name']) : null, + + isset($resourceAttributes['status']) ? \Chargebee\Resources\GatewayPaymentMethodToken\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'gateway_account_id' => $this->gateway_account_id, + 'gateway_customer_id' => $this->gateway_customer_id, + 'gateway_token' => $this->gateway_token, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + + 'gateway_name' => $this->gateway_name?->value, + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/OmnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.php b/src/Resources/OmnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.php new file mode 100644 index 00000000..c0fca60b --- /dev/null +++ b/src/Resources/OmnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.php @@ -0,0 +1,156 @@ + $knownFields + */ + protected static array $knownFields = [ "customer_id" , "omnichannel_subscription_id" , "omnichannel_subscription_item_id" , "item_id_at_source" , "mrr_currency" , "mrr_units" , "mrr_nanos" , "effective_from" , "calculated_at" , "created_at" , "resource_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $customer_id, + ?string $omnichannel_subscription_id, + ?string $omnichannel_subscription_item_id, + ?string $item_id_at_source, + ?string $mrr_currency, + ?int $mrr_units, + ?int $mrr_nanos, + ?int $effective_from, + ?int $calculated_at, + ?int $created_at, + ?int $resource_version, + ) + { + $this->customer_id = $customer_id; + $this->omnichannel_subscription_id = $omnichannel_subscription_id; + $this->omnichannel_subscription_item_id = $omnichannel_subscription_item_id; + $this->item_id_at_source = $item_id_at_source; + $this->mrr_currency = $mrr_currency; + $this->mrr_units = $mrr_units; + $this->mrr_nanos = $mrr_nanos; + $this->effective_from = $effective_from; + $this->calculated_at = $calculated_at; + $this->created_at = $created_at; + $this->resource_version = $resource_version; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['omnichannel_subscription_id'] ?? null, + $resourceAttributes['omnichannel_subscription_item_id'] ?? null, + $resourceAttributes['item_id_at_source'] ?? null, + $resourceAttributes['mrr_currency'] ?? null, + $resourceAttributes['mrr_units'] ?? null, + $resourceAttributes['mrr_nanos'] ?? null, + $resourceAttributes['effective_from'] ?? null, + $resourceAttributes['calculated_at'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['customer_id' => $this->customer_id, + 'omnichannel_subscription_id' => $this->omnichannel_subscription_id, + 'omnichannel_subscription_item_id' => $this->omnichannel_subscription_item_id, + 'item_id_at_source' => $this->item_id_at_source, + 'mrr_currency' => $this->mrr_currency, + 'mrr_units' => $this->mrr_units, + 'mrr_nanos' => $this->mrr_nanos, + 'effective_from' => $this->effective_from, + 'calculated_at' => $this->calculated_at, + 'created_at' => $this->created_at, + 'resource_version' => $this->resource_version, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/PaymentIntent/Enums/PaymentIntentMetadataSource.php b/src/Resources/PaymentIntent/Enums/PaymentIntentMetadataSource.php index 91f8aaaa..b4ec7969 100644 --- a/src/Resources/PaymentIntent/Enums/PaymentIntentMetadataSource.php +++ b/src/Resources/PaymentIntent/Enums/PaymentIntentMetadataSource.php @@ -3,16 +3,12 @@ namespace Chargebee\Resources\PaymentIntent\Enums; enum PaymentIntentMetadataSource : string { - case CB_JS = "cb_js"; - case COMPONENTS_FIELDS = "components_fields"; - case CHECKOUT_V3 = "checkout_v3"; - case PAYNOW_V3 = "paynow_v3"; - case PORTAL_V3 = "portal_v3"; - case GIFT_V3 = "gift_v3"; - case CHECKOUT_V4 = "checkout_v4"; - case PAYMENT_COMPONENT = "payment_component"; - case PC_INAPP_V4 = "pc_inapp_v4"; - case PC_FPC_V4 = "pc_fpc_v4"; + case PAYMENT_METHOD_HELPER = "payment_method_helper"; + case CARD_COMPONENTS = "card_components"; + case CHECKOUT = "checkout"; + case COLLECT_NOW = "collect_now"; + case PORTAL = "portal"; + case PAYMENT_COMPONENTS = "payment_components"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/PaymentIntent/PaymentAttempt.php b/src/Resources/PaymentIntent/PaymentAttempt.php index 8fcd625d..745b0698 100644 --- a/src/Resources/PaymentIntent/PaymentAttempt.php +++ b/src/Resources/PaymentIntent/PaymentAttempt.php @@ -63,10 +63,22 @@ class PaymentAttempt { */ public ?\Chargebee\Resources\GatewayErrorDetail\GatewayErrorDetail $error_detail; + /** + * + * @var ?string $routing_rule_id + */ + public ?string $routing_rule_id; + + /** + * + * @var ?string $payment_method_display_rule_id + */ + public ?string $payment_method_display_rule_id; + /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "status" , "payment_method_type" , "id_at_gateway" , "error_code" , "error_text" , "checkout_details" , "created_at" , "modified_at" , "error_detail" ]; + protected static array $knownFields = [ "id" , "status" , "payment_method_type" , "id_at_gateway" , "error_code" , "error_text" , "checkout_details" , "created_at" , "modified_at" , "error_detail" , "routing_rule_id" , "payment_method_display_rule_id" ]; /** * dynamic properties for resources @@ -85,6 +97,8 @@ private function __construct( ?int $created_at, ?int $modified_at, ?\Chargebee\Resources\GatewayErrorDetail\GatewayErrorDetail $error_detail, + ?string $routing_rule_id, + ?string $payment_method_display_rule_id, ) { $this->id = $id; @@ -96,7 +110,9 @@ private function __construct( $this->checkout_details = $checkout_details; $this->created_at = $created_at; $this->modified_at = $modified_at; - $this->error_detail = $error_detail; + $this->error_detail = $error_detail; + $this->routing_rule_id = $routing_rule_id; + $this->payment_method_display_rule_id = $payment_method_display_rule_id; } public static function from(array $resourceAttributes): self @@ -111,6 +127,8 @@ public static function from(array $resourceAttributes): self $resourceAttributes['created_at'] ?? null, $resourceAttributes['modified_at'] ?? null, isset($resourceAttributes['error_detail']) ? \Chargebee\Resources\GatewayErrorDetail\GatewayErrorDetail::from($resourceAttributes['error_detail']) : null, + $resourceAttributes['routing_rule_id'] ?? null, + $resourceAttributes['payment_method_display_rule_id'] ?? null, ); @@ -131,6 +149,8 @@ public function toArray(): array 'created_at' => $this->created_at, 'modified_at' => $this->modified_at, + 'routing_rule_id' => $this->routing_rule_id, + 'payment_method_display_rule_id' => $this->payment_method_display_rule_id, ], function ($value) { return $value !== null; diff --git a/src/Resources/PaymentIntent/PaymentIntent.php b/src/Resources/PaymentIntent/PaymentIntent.php index 9d156eed..006cafad 100644 --- a/src/Resources/PaymentIntent/PaymentIntent.php +++ b/src/Resources/PaymentIntent/PaymentIntent.php @@ -75,6 +75,12 @@ class PaymentIntent { */ public ?int $updated_at; + /** + * + * @var mixed $payment_method_options + */ + public mixed $payment_method_options; + /** * * @var ?string $customer_id @@ -126,7 +132,7 @@ class PaymentIntent { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "currency_code" , "amount" , "gateway_account_id" , "expires_at" , "reference_id" , "success_url" , "failure_url" , "created_at" , "modified_at" , "resource_version" , "updated_at" , "customer_id" , "gateway" , "active_payment_attempt" , "payment_attempts" , "payment_intent_metadata" , "business_entity_id" ]; + protected static array $knownFields = [ "id" , "currency_code" , "amount" , "gateway_account_id" , "expires_at" , "reference_id" , "success_url" , "failure_url" , "created_at" , "modified_at" , "resource_version" , "updated_at" , "payment_method_options" , "customer_id" , "gateway" , "active_payment_attempt" , "payment_attempts" , "payment_intent_metadata" , "business_entity_id" ]; /** * dynamic properties for resources @@ -147,6 +153,7 @@ private function __construct( ?int $modified_at, ?int $resource_version, ?int $updated_at, + mixed $payment_method_options, ?string $customer_id, ?string $gateway, ?PaymentAttempt $active_payment_attempt, @@ -169,6 +176,7 @@ private function __construct( $this->modified_at = $modified_at; $this->resource_version = $resource_version; $this->updated_at = $updated_at; + $this->payment_method_options = $payment_method_options; $this->customer_id = $customer_id; $this->gateway = $gateway; $this->active_payment_attempt = $active_payment_attempt; @@ -197,6 +205,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['modified_at'] ?? null, $resourceAttributes['resource_version'] ?? null, $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['payment_method_options'] ?? null, $resourceAttributes['customer_id'] ?? null, $resourceAttributes['gateway'] ?? null, isset($resourceAttributes['active_payment_attempt']) ? PaymentAttempt::from($resourceAttributes['active_payment_attempt']) : null, @@ -229,6 +238,7 @@ public function toArray(): array 'modified_at' => $this->modified_at, 'resource_version' => $this->resource_version, 'updated_at' => $this->updated_at, + 'payment_method_options' => $this->payment_method_options, 'customer_id' => $this->customer_id, 'gateway' => $this->gateway, diff --git a/src/Resources/PaymentSource/PaymentSource.php b/src/Resources/PaymentSource/PaymentSource.php index 4e7bc8b9..43f04f19 100644 --- a/src/Resources/PaymentSource/PaymentSource.php +++ b/src/Resources/PaymentSource/PaymentSource.php @@ -117,6 +117,12 @@ class PaymentSource { */ public ?array $mandates; + /** + * + * @var mixed $vault_token + */ + public mixed $vault_token; + /** * * @var ?bool $deleted @@ -150,7 +156,7 @@ class PaymentSource { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "resource_version" , "updated_at" , "created_at" , "customer_id" , "reference_id" , "gateway_account_id" , "ip_address" , "issuing_country" , "card" , "bank_account" , "boleto" , "billing_address" , "amazon_payment" , "upi" , "paypal" , "venmo" , "klarna_pay_now" , "mandates" , "deleted" , "business_entity_id" ]; + protected static array $knownFields = [ "id" , "resource_version" , "updated_at" , "created_at" , "customer_id" , "reference_id" , "gateway_account_id" , "ip_address" , "issuing_country" , "card" , "bank_account" , "boleto" , "billing_address" , "amazon_payment" , "upi" , "paypal" , "venmo" , "klarna_pay_now" , "mandates" , "vault_token" , "deleted" , "business_entity_id" ]; /** * dynamic properties for resources @@ -178,6 +184,7 @@ private function __construct( ?Venmo $venmo, ?KlarnaPayNow $klarna_pay_now, ?array $mandates, + mixed $vault_token, ?bool $deleted, ?string $business_entity_id, ?\Chargebee\Enums\Type $type, @@ -204,6 +211,7 @@ private function __construct( $this->venmo = $venmo; $this->klarna_pay_now = $klarna_pay_now; $this->mandates = $mandates; + $this->vault_token = $vault_token; $this->deleted = $deleted; $this->business_entity_id = $business_entity_id; $this->type = $type; @@ -236,6 +244,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['venmo']) ? Venmo::from($resourceAttributes['venmo']) : null, isset($resourceAttributes['klarna_pay_now']) ? KlarnaPayNow::from($resourceAttributes['klarna_pay_now']) : null, $mandates, + $resourceAttributes['vault_token'] ?? null, $resourceAttributes['deleted'] ?? null, $resourceAttributes['business_entity_id'] ?? null, @@ -273,6 +282,7 @@ public function toArray(): array + 'vault_token' => $this->vault_token, 'deleted' => $this->deleted, 'business_entity_id' => $this->business_entity_id, diff --git a/src/Resources/Quote/Quote.php b/src/Resources/Quote/Quote.php index 110501a0..20138a23 100644 --- a/src/Resources/Quote/Quote.php +++ b/src/Resources/Quote/Quote.php @@ -232,6 +232,12 @@ class Quote extends SupportsCustomFields { */ public ?int $total_discount; + /** + * + * @var ?bool $has_entitlements + */ + public ?bool $has_entitlements; + /** * * @var ?\Chargebee\Enums\PriceType $price_type @@ -253,7 +259,7 @@ class Quote extends SupportsCustomFields { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "name" , "po_number" , "customer_id" , "subscription_id" , "invoice_id" , "vat_number" , "valid_till" , "date" , "total_payable" , "charge_on_acceptance" , "sub_total" , "total" , "credits_applied" , "amount_paid" , "amount_due" , "version" , "resource_version" , "updated_at" , "vat_number_prefix" , "line_items" , "line_item_tiers" , "line_item_discounts" , "line_item_taxes" , "discounts" , "taxes" , "tax_category" , "currency_code" , "notes" , "shipping_address" , "billing_address" , "contract_term_start" , "contract_term_end" , "contract_term_termination_fee" , "business_entity_id" , "deleted" , "total_contract_value" , "total_discount" ]; + protected static array $knownFields = [ "id" , "name" , "po_number" , "customer_id" , "subscription_id" , "invoice_id" , "vat_number" , "valid_till" , "date" , "total_payable" , "charge_on_acceptance" , "sub_total" , "total" , "credits_applied" , "amount_paid" , "amount_due" , "version" , "resource_version" , "updated_at" , "vat_number_prefix" , "line_items" , "line_item_tiers" , "line_item_discounts" , "line_item_taxes" , "discounts" , "taxes" , "tax_category" , "currency_code" , "notes" , "shipping_address" , "billing_address" , "contract_term_start" , "contract_term_end" , "contract_term_termination_fee" , "business_entity_id" , "deleted" , "total_contract_value" , "total_discount" , "has_entitlements" ]; /** * dynamic properties for resources @@ -300,6 +306,7 @@ private function __construct( ?bool $deleted, ?int $total_contract_value, ?int $total_discount, + ?bool $has_entitlements, ?\Chargebee\Enums\PriceType $price_type, ?\Chargebee\Resources\Quote\Enums\Status $status, ?\Chargebee\Resources\Quote\Enums\OperationType $operation_type, @@ -342,7 +349,8 @@ private function __construct( $this->business_entity_id = $business_entity_id; $this->deleted = $deleted; $this->total_contract_value = $total_contract_value; - $this->total_discount = $total_discount; + $this->total_discount = $total_discount; + $this->has_entitlements = $has_entitlements; $this->price_type = $price_type; $this->status = $status; $this->operation_type = $operation_type; @@ -412,6 +420,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['deleted'] ?? null, $resourceAttributes['total_contract_value'] ?? null, $resourceAttributes['total_discount'] ?? null, + $resourceAttributes['has_entitlements'] ?? null, isset($resourceAttributes['price_type']) ? \Chargebee\Enums\PriceType::tryFromValue($resourceAttributes['price_type']) : null, @@ -470,6 +479,7 @@ public function toArray(): array 'deleted' => $this->deleted, 'total_contract_value' => $this->total_contract_value, 'total_discount' => $this->total_discount, + 'has_entitlements' => $this->has_entitlements, 'price_type' => $this->price_type?->value, diff --git a/src/Resources/QuoteEntitlement/Enums/ActionType.php b/src/Resources/QuoteEntitlement/Enums/ActionType.php new file mode 100644 index 00000000..3b946f22 --- /dev/null +++ b/src/Resources/QuoteEntitlement/Enums/ActionType.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/QuoteEntitlement/Enums/EntityType.php b/src/Resources/QuoteEntitlement/Enums/EntityType.php index ec4084c9..5b815aff 100644 --- a/src/Resources/QuoteEntitlement/Enums/EntityType.php +++ b/src/Resources/QuoteEntitlement/Enums/EntityType.php @@ -6,6 +6,9 @@ enum EntityType : string { case PLAN_PRICE = "plan_price"; case ADDON_PRICE = "addon_price"; case CHARGE_PRICE = "charge_price"; + /* + * @depcreated + */ case CHARGE = "charge"; case UNKNOWN = "unknown"; diff --git a/src/Resources/QuoteEntitlement/QuoteEntitlement.php b/src/Resources/QuoteEntitlement/QuoteEntitlement.php index 491c43d3..b65dec82 100644 --- a/src/Resources/QuoteEntitlement/QuoteEntitlement.php +++ b/src/Resources/QuoteEntitlement/QuoteEntitlement.php @@ -51,16 +51,58 @@ class QuoteEntitlement { */ public ?int $modified_at; + /** + * + * @var ?bool $is_overridden + */ + public ?bool $is_overridden; + + /** + * + * @var ?string $feature_name + */ + public ?string $feature_name; + + /** + * + * @var ?string $feature_unit + */ + public ?string $feature_unit; + + /** + * + * @var ?string $feature_type + */ + public ?string $feature_type; + + /** + * + * @var ?string $name + */ + public ?string $name; + + /** + * + * @var ?bool $metered + */ + public ?bool $metered; + /** * * @var ?\Chargebee\Resources\QuoteEntitlement\Enums\EntityType $entity_type */ public ?\Chargebee\Resources\QuoteEntitlement\Enums\EntityType $entity_type; + /** + * + * @var ?\Chargebee\Resources\QuoteEntitlement\Enums\ActionType $action_type + */ + public ?\Chargebee\Resources\QuoteEntitlement\Enums\ActionType $action_type; + /** * @var array $knownFields */ - protected static array $knownFields = [ "entity_id" , "feature_id" , "value" , "is_enabled" , "start_date" , "end_date" , "created_at" , "modified_at" ]; + protected static array $knownFields = [ "entity_id" , "feature_id" , "value" , "is_enabled" , "start_date" , "end_date" , "created_at" , "modified_at" , "is_overridden" , "feature_name" , "feature_unit" , "feature_type" , "name" , "metered" ]; /** * dynamic properties for resources @@ -77,7 +119,14 @@ private function __construct( ?int $end_date, ?int $created_at, ?int $modified_at, + ?bool $is_overridden, + ?string $feature_name, + ?string $feature_unit, + ?string $feature_type, + ?string $name, + ?bool $metered, ?\Chargebee\Resources\QuoteEntitlement\Enums\EntityType $entity_type, + ?\Chargebee\Resources\QuoteEntitlement\Enums\ActionType $action_type, ) { $this->entity_id = $entity_id; @@ -87,8 +136,15 @@ private function __construct( $this->start_date = $start_date; $this->end_date = $end_date; $this->created_at = $created_at; - $this->modified_at = $modified_at; - $this->entity_type = $entity_type; + $this->modified_at = $modified_at; + $this->is_overridden = $is_overridden; + $this->feature_name = $feature_name; + $this->feature_unit = $feature_unit; + $this->feature_type = $feature_type; + $this->name = $name; + $this->metered = $metered; + $this->entity_type = $entity_type; + $this->action_type = $action_type; } public static function from(array $resourceAttributes): self @@ -101,9 +157,17 @@ public static function from(array $resourceAttributes): self $resourceAttributes['end_date'] ?? null, $resourceAttributes['created_at'] ?? null, $resourceAttributes['modified_at'] ?? null, + $resourceAttributes['is_overridden'] ?? null, + $resourceAttributes['feature_name'] ?? null, + $resourceAttributes['feature_unit'] ?? null, + $resourceAttributes['feature_type'] ?? null, + $resourceAttributes['name'] ?? null, + $resourceAttributes['metered'] ?? null, isset($resourceAttributes['entity_type']) ? \Chargebee\Resources\QuoteEntitlement\Enums\EntityType::tryFromValue($resourceAttributes['entity_type']) : null, + + isset($resourceAttributes['action_type']) ? \Chargebee\Resources\QuoteEntitlement\Enums\ActionType::tryFromValue($resourceAttributes['action_type']) : null, ); @@ -121,9 +185,17 @@ public function toArray(): array 'end_date' => $this->end_date, 'created_at' => $this->created_at, 'modified_at' => $this->modified_at, + 'is_overridden' => $this->is_overridden, + 'feature_name' => $this->feature_name, + 'feature_unit' => $this->feature_unit, + 'feature_type' => $this->feature_type, + 'name' => $this->name, + 'metered' => $this->metered, 'entity_type' => $this->entity_type?->value, + 'action_type' => $this->action_type?->value, + ], function ($value) { return $value !== null; }); diff --git a/src/Resources/QuotedRamp/LineItem.php b/src/Resources/QuotedRamp/LineItem.php index e5549670..f2cee5f9 100644 --- a/src/Resources/QuotedRamp/LineItem.php +++ b/src/Resources/QuotedRamp/LineItem.php @@ -177,10 +177,16 @@ class LineItem { */ public ?string $net_amount_per_billing_cycle_in_decimal; + /** + * + * @var ?string $description + */ + public ?string $description; + /** * @var array $knownFields */ - protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "metered_quantity" , "unit_price" , "unit_price_in_decimal" , "amount" , "amount_in_decimal" , "billing_period" , "billing_period_unit" , "free_quantity" , "free_quantity_in_decimal" , "billing_cycles" , "service_period_days" , "charge_on_event" , "charge_once" , "charge_on_option" , "start_date" , "end_date" , "ramp_tier_id" , "discount_per_billing_cycle" , "discount_per_billing_cycle_in_decimal" , "item_level_discount_per_billing_cycle" , "item_level_discount_per_billing_cycle_in_decimal" , "amount_per_billing_cycle" , "amount_per_billing_cycle_in_decimal" , "net_amount_per_billing_cycle" , "net_amount_per_billing_cycle_in_decimal" ]; + protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "metered_quantity" , "unit_price" , "unit_price_in_decimal" , "amount" , "amount_in_decimal" , "billing_period" , "billing_period_unit" , "free_quantity" , "free_quantity_in_decimal" , "billing_cycles" , "service_period_days" , "charge_on_event" , "charge_once" , "charge_on_option" , "start_date" , "end_date" , "ramp_tier_id" , "discount_per_billing_cycle" , "discount_per_billing_cycle_in_decimal" , "item_level_discount_per_billing_cycle" , "item_level_discount_per_billing_cycle_in_decimal" , "amount_per_billing_cycle" , "amount_per_billing_cycle_in_decimal" , "net_amount_per_billing_cycle" , "net_amount_per_billing_cycle_in_decimal" , "description" ]; /** * dynamic properties for resources @@ -218,6 +224,7 @@ private function __construct( ?string $amount_per_billing_cycle_in_decimal, ?int $net_amount_per_billing_cycle, ?string $net_amount_per_billing_cycle_in_decimal, + ?string $description, ) { $this->item_price_id = $item_price_id; @@ -248,7 +255,8 @@ private function __construct( $this->amount_per_billing_cycle = $amount_per_billing_cycle; $this->amount_per_billing_cycle_in_decimal = $amount_per_billing_cycle_in_decimal; $this->net_amount_per_billing_cycle = $net_amount_per_billing_cycle; - $this->net_amount_per_billing_cycle_in_decimal = $net_amount_per_billing_cycle_in_decimal; + $this->net_amount_per_billing_cycle_in_decimal = $net_amount_per_billing_cycle_in_decimal; + $this->description = $description; } public static function from(array $resourceAttributes): self @@ -282,6 +290,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['amount_per_billing_cycle_in_decimal'] ?? null, $resourceAttributes['net_amount_per_billing_cycle'] ?? null, $resourceAttributes['net_amount_per_billing_cycle_in_decimal'] ?? null, + $resourceAttributes['description'] ?? null, ); @@ -321,6 +330,7 @@ public function toArray(): array 'amount_per_billing_cycle_in_decimal' => $this->amount_per_billing_cycle_in_decimal, 'net_amount_per_billing_cycle' => $this->net_amount_per_billing_cycle, 'net_amount_per_billing_cycle_in_decimal' => $this->net_amount_per_billing_cycle_in_decimal, + 'description' => $this->description, ], function ($value) { return $value !== null; diff --git a/src/Resources/VaultedPaymentMethod/VaultedPaymentMethod.php b/src/Resources/VaultedPaymentMethod/VaultedPaymentMethod.php new file mode 100644 index 00000000..0de6d7c4 --- /dev/null +++ b/src/Resources/VaultedPaymentMethod/VaultedPaymentMethod.php @@ -0,0 +1,96 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "customer_id" , "credit_card_id" , "created_at" , "modified_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $customer_id, + ?string $credit_card_id, + ?int $created_at, + ?int $modified_at, + ) + { + $this->id = $id; + $this->customer_id = $customer_id; + $this->credit_card_id = $credit_card_id; + $this->created_at = $created_at; + $this->modified_at = $modified_at; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['credit_card_id'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['modified_at'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'customer_id' => $this->customer_id, + 'credit_card_id' => $this->credit_card_id, + 'created_at' => $this->created_at, + 'modified_at' => $this->modified_at, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/CreditNoteResponse/UpdateCreditNoteResponse.php b/src/Responses/CreditNoteResponse/UpdateCreditNoteResponse.php new file mode 100644 index 00000000..223e023a --- /dev/null +++ b/src/Responses/CreditNoteResponse/UpdateCreditNoteResponse.php @@ -0,0 +1,45 @@ +credit_note = $credit_note; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['credit_note']) ? CreditNote::from($resourceAttributes['credit_note']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->credit_note instanceof CreditNote){ + $data['credit_note'] = $this->credit_note->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/ExportResponse/RampsExportResponse.php b/src/Responses/ExportResponse/RampsExportResponse.php new file mode 100644 index 00000000..401058c3 --- /dev/null +++ b/src/Responses/ExportResponse/RampsExportResponse.php @@ -0,0 +1,45 @@ +export = $export; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['export']) ? Export::from($resourceAttributes['export']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->export instanceof Export){ + $data['export'] = $this->export->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/InvoiceResponse/VoidBeforeCaptureInvoiceResponse.php b/src/Responses/InvoiceResponse/VoidBeforeCaptureInvoiceResponse.php new file mode 100644 index 00000000..54ee7995 --- /dev/null +++ b/src/Responses/InvoiceResponse/VoidBeforeCaptureInvoiceResponse.php @@ -0,0 +1,59 @@ +invoice = $invoice; + $this->credit_note = $credit_note; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['invoice']) ? Invoice::from($resourceAttributes['invoice']) : null, + + isset($resourceAttributes['credit_note']) ? CreditNote::from($resourceAttributes['credit_note']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->invoice instanceof Invoice){ + $data['invoice'] = $this->invoice->toArray(); + } + if($this->credit_note instanceof CreditNote){ + $data['credit_note'] = $this->credit_note->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponse.php b/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponse.php new file mode 100644 index 00000000..bbde2983 --- /dev/null +++ b/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject { + return new ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject( + isset($result['gateway_payment_method_token']) ? GatewayPaymentMethodToken::from($result['gateway_payment_method_token']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject.php b/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject.php new file mode 100644 index 00000000..ec02e9c1 --- /dev/null +++ b/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject.php @@ -0,0 +1,14 @@ +gateway_payment_method_token = $gateway_payment_method_token; + } +} diff --git a/src/Responses/QuoteEntitlementResponse/ListQuoteEntitlementsQuoteEntitlementResponse.php b/src/Responses/QuoteEntitlementResponse/ListQuoteEntitlementsQuoteEntitlementResponse.php new file mode 100644 index 00000000..a7fc55c8 --- /dev/null +++ b/src/Responses/QuoteEntitlementResponse/ListQuoteEntitlementsQuoteEntitlementResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ListQuoteEntitlementsQuoteEntitlementResponseListObject { + return new ListQuoteEntitlementsQuoteEntitlementResponseListObject( + isset($result['quote_entitlement']) ? QuoteEntitlement::from($result['quote_entitlement']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/QuoteEntitlementResponse/ListQuoteEntitlementsQuoteEntitlementResponseListObject.php b/src/Responses/QuoteEntitlementResponse/ListQuoteEntitlementsQuoteEntitlementResponseListObject.php new file mode 100644 index 00000000..84a6de98 --- /dev/null +++ b/src/Responses/QuoteEntitlementResponse/ListQuoteEntitlementsQuoteEntitlementResponseListObject.php @@ -0,0 +1,14 @@ +quote_entitlement = $quote_entitlement; + } +} diff --git a/src/Responses/VaultedPaymentMethodResponse/RetrieveVaultedPaymentMethodResponse.php b/src/Responses/VaultedPaymentMethodResponse/RetrieveVaultedPaymentMethodResponse.php new file mode 100644 index 00000000..cae54ee2 --- /dev/null +++ b/src/Responses/VaultedPaymentMethodResponse/RetrieveVaultedPaymentMethodResponse.php @@ -0,0 +1,45 @@ +vaulted_payment_method = $vaulted_payment_method; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['vaulted_payment_method']) ? VaultedPaymentMethod::from($resourceAttributes['vaulted_payment_method']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->vaulted_payment_method instanceof VaultedPaymentMethod){ + $data['vaulted_payment_method'] = $this->vaulted_payment_method->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Version.php b/src/Version.php index 3f65901a..fa9c78f3 100644 --- a/src/Version.php +++ b/src/Version.php @@ -4,7 +4,7 @@ final class Version { - const VERSION = '4.25.2'; + const VERSION = '4.26.0'; } ?> \ No newline at end of file