From e21fa19e6fafd8573c9df7cc811fd670af9b40c2 Mon Sep 17 00:00:00 2001 From: cb-alish Date: Fri, 12 Jun 2026 15:16:44 +0530 Subject: [PATCH 1/2] Releasing v4.22.0 --- CHANGELOG.md | 37 +++ VERSION | 2 +- .../Contracts/CouponActionsInterface.php | 2 +- .../Contracts/EntitlementActionsInterface.php | 6 +- .../Contracts/ExportActionsInterface.php | 2 +- .../Contracts/GrantBlockActionsInterface.php | 60 ++++ .../Contracts/HostedPageActionsInterface.php | 3 +- .../Contracts/InvoiceActionsInterface.php | 6 +- .../LedgerAccountBalanceActionsInterface.php | 38 +++ .../LedgerOperationActionsInterface.php | 153 ++++++++++ ...mnichannelSubscriptionActionsInterface.php | 4 + .../PromotionalGrantActionsInterface.php | 35 +++ .../Contracts/RampActionsInterface.php | 4 +- src/Actions/CouponActions.php | 2 +- src/Actions/EntitlementActions.php | 6 +- src/Actions/ExportActions.php | 2 +- src/Actions/GrantBlockActions.php | 92 ++++++ src/Actions/HostedPageActions.php | 1 + src/Actions/InvoiceActions.php | 6 +- src/Actions/LedgerAccountBalanceActions.php | 70 +++++ src/Actions/LedgerOperationActions.php | 281 ++++++++++++++++++ .../OmnichannelSubscriptionActions.php | 4 + src/Actions/PromotionalGrantActions.php | 68 +++++ src/Actions/RampActions.php | 4 +- src/ChargebeeClient.php | 24 ++ src/Enums/Status.php | 16 + src/Resources/Content/Content.php | 58 +++- src/Resources/CreditNote/CreditNote.php | 12 +- .../GrantBlock/Enums/AccountType.php | 14 + .../GrantBlock/Enums/GrantSource.php | 17 ++ src/Resources/GrantBlock/Enums/UnitType.php | 13 + src/Resources/GrantBlock/GrantBlock.php | 234 +++++++++++++++ src/Resources/HostedPage/Enums/Type.php | 5 +- src/Resources/HostedPage/HostedPage.php | 14 +- .../LedgerAccountBalance/Enums/UnitType.php | 13 + .../LedgerAccountBalance.php | 114 +++++++ .../LedgerAccountBalance/OverdraftBalance.php | 106 +++++++ .../ProvisionedBalance.php | 76 +++++ src/Resources/LedgerOperation/Enums/Type.php | 21 ++ .../LedgerOperation/Enums/UnitType.php | 13 + .../LedgerOperation/LedgerOperation.php | 230 ++++++++++++++ .../PromotionalGrant/PromotionalGrant.php | 96 ++++++ .../ListGrantBlocksGrantBlockResponse.php | 54 ++++ ...rantBlocksGrantBlockResponseListObject.php | 14 + ...ntBalancesLedgerAccountBalanceResponse.php | 54 ++++ ...LedgerAccountBalanceResponseListObject.php | 14 + .../AuthorizeLedgerOperationResponse.php | 59 ++++ ...reAuthorizationLedgerOperationResponse.php | 59 ++++ .../CaptureLedgerOperationResponse.php | 59 ++++ ...edgerOperationsLedgerOperationResponse.php | 54 ++++ ...tionsLedgerOperationResponseListObject.php | 14 + ...seAuthorizationLedgerOperationResponse.php | 59 ++++ ...LedgerOperationLedgerOperationResponse.php | 45 +++ ...motionalGrantsPromotionalGrantResponse.php | 69 +++++ src/Version.php | 2 +- 55 files changed, 2493 insertions(+), 27 deletions(-) create mode 100644 src/Actions/Contracts/GrantBlockActionsInterface.php create mode 100644 src/Actions/Contracts/LedgerAccountBalanceActionsInterface.php create mode 100644 src/Actions/Contracts/LedgerOperationActionsInterface.php create mode 100644 src/Actions/Contracts/PromotionalGrantActionsInterface.php create mode 100644 src/Actions/GrantBlockActions.php create mode 100644 src/Actions/LedgerAccountBalanceActions.php create mode 100644 src/Actions/LedgerOperationActions.php create mode 100644 src/Actions/PromotionalGrantActions.php create mode 100644 src/Enums/Status.php create mode 100644 src/Resources/GrantBlock/Enums/AccountType.php create mode 100644 src/Resources/GrantBlock/Enums/GrantSource.php create mode 100644 src/Resources/GrantBlock/Enums/UnitType.php create mode 100644 src/Resources/GrantBlock/GrantBlock.php create mode 100644 src/Resources/LedgerAccountBalance/Enums/UnitType.php create mode 100644 src/Resources/LedgerAccountBalance/LedgerAccountBalance.php create mode 100644 src/Resources/LedgerAccountBalance/OverdraftBalance.php create mode 100644 src/Resources/LedgerAccountBalance/ProvisionedBalance.php create mode 100644 src/Resources/LedgerOperation/Enums/Type.php create mode 100644 src/Resources/LedgerOperation/Enums/UnitType.php create mode 100644 src/Resources/LedgerOperation/LedgerOperation.php create mode 100644 src/Resources/PromotionalGrant/PromotionalGrant.php create mode 100644 src/Responses/GrantBlockResponse/ListGrantBlocksGrantBlockResponse.php create mode 100644 src/Responses/GrantBlockResponse/ListGrantBlocksGrantBlockResponseListObject.php create mode 100644 src/Responses/LedgerAccountBalanceResponse/ListLedgerAccountBalancesLedgerAccountBalanceResponse.php create mode 100644 src/Responses/LedgerAccountBalanceResponse/ListLedgerAccountBalancesLedgerAccountBalanceResponseListObject.php create mode 100644 src/Responses/LedgerOperationResponse/AuthorizeLedgerOperationResponse.php create mode 100644 src/Responses/LedgerOperationResponse/CaptureAuthorizationLedgerOperationResponse.php create mode 100644 src/Responses/LedgerOperationResponse/CaptureLedgerOperationResponse.php create mode 100644 src/Responses/LedgerOperationResponse/ListLedgerOperationsLedgerOperationResponse.php create mode 100644 src/Responses/LedgerOperationResponse/ListLedgerOperationsLedgerOperationResponseListObject.php create mode 100644 src/Responses/LedgerOperationResponse/ReleaseAuthorizationLedgerOperationResponse.php create mode 100644 src/Responses/LedgerOperationResponse/RetrieveLedgerOperationLedgerOperationResponse.php create mode 100644 src/Responses/PromotionalGrantResponse/PromotionalGrantsPromotionalGrantResponse.php diff --git a/CHANGELOG.md b/CHANGELOG.md index ec1fed6d..ac40da07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +### v4.22.0 (2026-06-12) +* * * +### New Resources: +- [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks) has been added. +- [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances) has been added. +- [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations) has been added. +- [`PromotionalGrant`](https://apidocs.chargebee.com/docs/api/promotional_grants) has been added. + + +### New Attributes: +- [`notes`](https://apidocs.chargebee.com/docs/api/credit_notes/credit-note-object#notes) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`layout`](https://apidocs.chargebee.com/docs/api/hosted_pages/hosted-page-object#layout) has been added to [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). + + +### New Parameters: +- [`sort_by`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#sort_by) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). + + +### New Enums: +- `available`, `exhausted`, `scheduled`, and `in_grace_period` have been added as new values enum `Status`. +- `subscription_created`, `subscription_changed`, `top_up`, `promotional_grants`, and `rollover` have been added as new values to enum attribute [`grant_source`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#grant_source) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `provisioned` and `overdraft` have been added as new values to enum attribute [`account_type`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#account_type) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#unit_type) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/ledger_account_balances/ledger-account-balance-object#unit_type) in [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances). +- `allocation`, `capture`, `authorize`, `release_authorization`, `capture_authorization`, `expiry`, `void`, `rollover`, and `adjustment` have been added as new values to enum attribute [`type`](https://apidocs.chargebee.com/docs/api/ledger_operations/ledger-operation-object#type) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/ledger_operations/ledger-operation-object#unit_type) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `expires_at`, `created_at`, and `effective_from` have been added as new values to enum query parameter `sort_by.asc` in [`list_grant_blocks`](https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks) of [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `expires_at`, `created_at`, and `effective_from` have been added as new values to enum query parameter `sort_by.desc` in [`list_grant_blocks`](https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks) of [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `allocation`, `release_authorization`, `void`, `capture`, `rollover`, `adjustment`, `expiry`, `authorize`, and `capture_authorization` have been added as new values to enum query parameter `type.is` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `allocation`, `release_authorization`, `void`, `capture`, `rollover`, `adjustment`, `expiry`, `authorize`, and `capture_authorization` have been added as new values to enum query parameter `type.in` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `created_at` has been added as a new value to enum query parameter `sort_by.asc` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `created_at` has been added as a new value to enum query parameter `sort_by.desc` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `updated_at` and `created_at` have been added as new values to enum query parameter `sort_by.asc` in [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) of [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- `updated_at` and `created_at` have been added as new values to enum query parameter `sort_by.desc` in [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) of [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). + + + ### v4.21.0 (2026-06-08) * * * ### New Attributes: diff --git a/VERSION b/VERSION index 7c6be317..d7638f37 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.21.0 +4.22.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/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 35c8546e..4909437e 100644 --- a/src/Actions/Contracts/ExportActionsInterface.php +++ b/src/Actions/Contracts/ExportActionsInterface.php @@ -1602,8 +1602,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/GrantBlockActionsInterface.php b/src/Actions/Contracts/GrantBlockActionsInterface.php new file mode 100644 index 00000000..7bfc4c5a --- /dev/null +++ b/src/Actions/Contracts/GrantBlockActionsInterface.php @@ -0,0 +1,60 @@ + $headers + * @return ListGrantBlocksGrantBlockResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listGrantBlocks(array $params, array $headers = []): ListGrantBlocksGrantBlockResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/HostedPageActionsInterface.php b/src/Actions/Contracts/HostedPageActionsInterface.php index 0ffe1d3f..7ff525f0 100644 --- a/src/Actions/Contracts/HostedPageActionsInterface.php +++ b/src/Actions/Contracts/HostedPageActionsInterface.php @@ -162,7 +162,7 @@ public function checkoutOneTimeForItems(array $params, array $headers = []): CheckoutOneTimeForItemsHostedPageResponse; /** - * @see https://apidocs.chargebee.com/docs/api/hosted_pages/update-payment-method?lang=php-v4 + * * @param array{ * customer?: array{ * id?: string, @@ -180,6 +180,7 @@ public function checkoutOneTimeForItems(array $params, array $headers = []): Che * iframe_messaging?: bool, * } $params Description of the parameters * + * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers * @return UpdatePaymentMethodHostedPageResponse * @throws PaymentException diff --git a/src/Actions/Contracts/InvoiceActionsInterface.php b/src/Actions/Contracts/InvoiceActionsInterface.php index 63fc9bd2..5e1f46f7 100644 --- a/src/Actions/Contracts/InvoiceActionsInterface.php +++ b/src/Actions/Contracts/InvoiceActionsInterface.php @@ -1238,13 +1238,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/LedgerAccountBalanceActionsInterface.php b/src/Actions/Contracts/LedgerAccountBalanceActionsInterface.php new file mode 100644 index 00000000..1ea14359 --- /dev/null +++ b/src/Actions/Contracts/LedgerAccountBalanceActionsInterface.php @@ -0,0 +1,38 @@ + $headers + * @return ListLedgerAccountBalancesLedgerAccountBalanceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listLedgerAccountBalances(array $params, array $headers = []): ListLedgerAccountBalancesLedgerAccountBalanceResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/LedgerOperationActionsInterface.php b/src/Actions/Contracts/LedgerOperationActionsInterface.php new file mode 100644 index 00000000..a44dfd24 --- /dev/null +++ b/src/Actions/Contracts/LedgerOperationActionsInterface.php @@ -0,0 +1,153 @@ + $headers + * @return ReleaseAuthorizationLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function releaseAuthorization(array $params, array $headers = []): ReleaseAuthorizationLedgerOperationResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/capture?lang=php-v4 + * @param array{ + * id?: string, + * subscription_id?: string, + * unit_id?: string, + * amount?: string, + * ledger_operation_timestamp?: int, + * metadata?: mixed, + * } $params Description of the parameters + * + * @param array $headers + * @return CaptureLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function capture(array $params, array $headers = []): CaptureLedgerOperationResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/authorize?lang=php-v4 + * @param array{ + * id?: string, + * subscription_id?: string, + * unit_id?: string, + * amount?: string, + * ledger_operation_timestamp?: int, + * auto_release_timestamp?: int, + * metadata?: mixed, + * } $params Description of the parameters + * + * @param array $headers + * @return AuthorizeLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function authorize(array $params, array $headers = []): AuthorizeLedgerOperationResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * subscription_id?: array{ + * is?: mixed, + * }, + * unit_id?: array{ + * is?: mixed, + * }, + * created_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * type?: array{ + * is?: mixed, + * in?: mixed, + * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListLedgerOperationsLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listLedgerOperations(array $params, array $headers = []): ListLedgerOperationsLedgerOperationResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/capture-authorization?lang=php-v4 + * @param array{ + * authorization_id?: string, + * id?: string, + * amount?: string, + * ledger_operation_timestamp?: int, + * metadata?: mixed, + * } $params Description of the parameters + * + * @param array $headers + * @return CaptureAuthorizationLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function captureAuthorization(array $params, array $headers = []): CaptureAuthorizationLedgerOperationResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/retrieve-ledger-operation?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveLedgerOperationLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieveLedgerOperation(string $id, array $headers = []): RetrieveLedgerOperationLedgerOperationResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php b/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php index 45cdfe5c..802e5ab6 100644 --- a/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php +++ b/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php @@ -114,6 +114,10 @@ public function omnichannelTransactionsForOmnichannelSubscription(string $id, ar * before?: mixed, * after?: mixed, * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, * } $params Description of the parameters * * @param array $headers diff --git a/src/Actions/Contracts/PromotionalGrantActionsInterface.php b/src/Actions/Contracts/PromotionalGrantActionsInterface.php new file mode 100644 index 00000000..d5fbfe32 --- /dev/null +++ b/src/Actions/Contracts/PromotionalGrantActionsInterface.php @@ -0,0 +1,35 @@ + $headers + * @return PromotionalGrantsPromotionalGrantResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function promotionalGrants(array $params, array $headers = []): PromotionalGrantsPromotionalGrantResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/RampActionsInterface.php b/src/Actions/Contracts/RampActionsInterface.php index 1f9eccce..c8a18bba 100644 --- a/src/Actions/Contracts/RampActionsInterface.php +++ b/src/Actions/Contracts/RampActionsInterface.php @@ -110,12 +110,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/CouponActions.php b/src/Actions/CouponActions.php index 9cdfe0ca..bcfab703 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/EntitlementActions.php b/src/Actions/EntitlementActions.php index 6602900d..ebee27f0 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 9117c8cb..b9035866 100644 --- a/src/Actions/ExportActions.php +++ b/src/Actions/ExportActions.php @@ -1828,8 +1828,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/GrantBlockActions.php b/src/Actions/GrantBlockActions.php new file mode 100644 index 00000000..5e11324a --- /dev/null +++ b/src/Actions/GrantBlockActions.php @@ -0,0 +1,92 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * subscription_id?: array{ + * is?: mixed, + * }, + * unit_id?: array{ + * is?: mixed, + * }, + * effective_from?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * expires_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * created_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListGrantBlocksGrantBlockResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listGrantBlocks(array $params, array $headers = []): ListGrantBlocksGrantBlockResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["grant_blocks"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaderOverride("Content-Type", "application/json") + ->withHeaders($headers) + ->withParams($params) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListGrantBlocksGrantBlockResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/HostedPageActions.php b/src/Actions/HostedPageActions.php index 720b6ee7..23658eac 100644 --- a/src/Actions/HostedPageActions.php +++ b/src/Actions/HostedPageActions.php @@ -211,6 +211,7 @@ public function checkoutOneTimeForItems(array $params, array $headers = []): Che * iframe_messaging?: bool, * } $params Description of the parameters * + * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers * @return UpdatePaymentMethodHostedPageResponse * @throws PaymentException diff --git a/src/Actions/InvoiceActions.php b/src/Actions/InvoiceActions.php index a2278724..19f3a990 100644 --- a/src/Actions/InvoiceActions.php +++ b/src/Actions/InvoiceActions.php @@ -1770,13 +1770,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/LedgerAccountBalanceActions.php b/src/Actions/LedgerAccountBalanceActions.php new file mode 100644 index 00000000..b2b3e87a --- /dev/null +++ b/src/Actions/LedgerAccountBalanceActions.php @@ -0,0 +1,70 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_account_balances/list-ledger-account-balances?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * subscription_id?: array{ + * is?: mixed, + * }, + * unit_id?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListLedgerAccountBalancesLedgerAccountBalanceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listLedgerAccountBalances(array $params, array $headers = []): ListLedgerAccountBalancesLedgerAccountBalanceResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["ledger_account_balances"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaderOverride("Content-Type", "application/json") + ->withHeaders($headers) + ->withParams($params) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListLedgerAccountBalancesLedgerAccountBalanceResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/LedgerOperationActions.php b/src/Actions/LedgerOperationActions.php new file mode 100644 index 00000000..4b07eed0 --- /dev/null +++ b/src/Actions/LedgerOperationActions.php @@ -0,0 +1,281 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/release-authorization?lang=php-v4 + * @param array{ + * authorization_id?: string, + * id?: string, + * ledger_operation_timestamp?: int, + * metadata?: mixed, + * } $params Description of the parameters + * + * @param array $headers + * @return ReleaseAuthorizationLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function releaseAuthorization(array $params, array $headers = []): ReleaseAuthorizationLedgerOperationResponse + { + $jsonKeys = [ + "metadata" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["ledger_operations","release_authorization"]) + ->withParamEncoder( new JsonParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaderOverride("Content-Type", "application/json") + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(false) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ReleaseAuthorizationLedgerOperationResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/capture?lang=php-v4 + * @param array{ + * id?: string, + * subscription_id?: string, + * unit_id?: string, + * amount?: string, + * ledger_operation_timestamp?: int, + * metadata?: mixed, + * } $params Description of the parameters + * + * @param array $headers + * @return CaptureLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function capture(array $params, array $headers = []): CaptureLedgerOperationResponse + { + $jsonKeys = [ + "metadata" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["ledger_operations","capture"]) + ->withParamEncoder( new JsonParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaderOverride("Content-Type", "application/json") + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(false) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CaptureLedgerOperationResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/authorize?lang=php-v4 + * @param array{ + * id?: string, + * subscription_id?: string, + * unit_id?: string, + * amount?: string, + * ledger_operation_timestamp?: int, + * auto_release_timestamp?: int, + * metadata?: mixed, + * } $params Description of the parameters + * + * @param array $headers + * @return AuthorizeLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function authorize(array $params, array $headers = []): AuthorizeLedgerOperationResponse + { + $jsonKeys = [ + "metadata" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["ledger_operations","authorize"]) + ->withParamEncoder( new JsonParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaderOverride("Content-Type", "application/json") + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(false) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return AuthorizeLedgerOperationResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * subscription_id?: array{ + * is?: mixed, + * }, + * unit_id?: array{ + * is?: mixed, + * }, + * created_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * type?: array{ + * is?: mixed, + * in?: mixed, + * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListLedgerOperationsLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listLedgerOperations(array $params, array $headers = []): ListLedgerOperationsLedgerOperationResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["ledger_operations"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaderOverride("Content-Type", "application/json") + ->withHeaders($headers) + ->withParams($params) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListLedgerOperationsLedgerOperationResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/capture-authorization?lang=php-v4 + * @param array{ + * authorization_id?: string, + * id?: string, + * amount?: string, + * ledger_operation_timestamp?: int, + * metadata?: mixed, + * } $params Description of the parameters + * + * @param array $headers + * @return CaptureAuthorizationLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function captureAuthorization(array $params, array $headers = []): CaptureAuthorizationLedgerOperationResponse + { + $jsonKeys = [ + "metadata" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["ledger_operations","capture_authorization"]) + ->withParamEncoder( new JsonParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaderOverride("Content-Type", "application/json") + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(false) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CaptureAuthorizationLedgerOperationResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_operations/retrieve-ledger-operation?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveLedgerOperationLedgerOperationResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieveLedgerOperation(string $id, array $headers = []): RetrieveLedgerOperationLedgerOperationResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["ledger_operations",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveLedgerOperationLedgerOperationResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/OmnichannelSubscriptionActions.php b/src/Actions/OmnichannelSubscriptionActions.php index 1f75df82..c0a48624 100644 --- a/src/Actions/OmnichannelSubscriptionActions.php +++ b/src/Actions/OmnichannelSubscriptionActions.php @@ -178,6 +178,10 @@ public function omnichannelTransactionsForOmnichannelSubscription(string $id, ar * before?: mixed, * after?: mixed, * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, * } $params Description of the parameters * * @param array $headers diff --git a/src/Actions/PromotionalGrantActions.php b/src/Actions/PromotionalGrantActions.php new file mode 100644 index 00000000..2d280aa6 --- /dev/null +++ b/src/Actions/PromotionalGrantActions.php @@ -0,0 +1,68 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/promotional_grants/create-promotional-grant?lang=php-v4 + * @param array{ + * subscription_id?: string, + * unit_id?: string, + * amount?: string, + * expires_at?: int, + * metadata?: mixed, + * } $params Description of the parameters + * + * @param array $headers + * @return PromotionalGrantsPromotionalGrantResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function promotionalGrants(array $params, array $headers = []): PromotionalGrantsPromotionalGrantResponse + { + $jsonKeys = [ + "metadata" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["promotional_grants"]) + ->withParamEncoder( new JsonParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaderOverride("Content-Type", "application/json") + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return PromotionalGrantsPromotionalGrantResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/RampActions.php b/src/Actions/RampActions.php index 9be5910d..1eb86739 100644 --- a/src/Actions/RampActions.php +++ b/src/Actions/RampActions.php @@ -157,12 +157,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/ChargebeeClient.php b/src/ChargebeeClient.php index 62f6b1f6..925fd464 100644 --- a/src/ChargebeeClient.php +++ b/src/ChargebeeClient.php @@ -48,6 +48,8 @@ use Chargebee\Actions\FeatureActions; use Chargebee\Actions\Contracts\GiftActionsInterface; use Chargebee\Actions\GiftActions; +use Chargebee\Actions\Contracts\GrantBlockActionsInterface; +use Chargebee\Actions\GrantBlockActions; use Chargebee\Actions\Contracts\HostedPageActionsInterface; use Chargebee\Actions\HostedPageActions; use Chargebee\Actions\Contracts\InAppSubscriptionActionsInterface; @@ -62,6 +64,10 @@ use Chargebee\Actions\ItemFamilyActions; use Chargebee\Actions\Contracts\ItemPriceActionsInterface; use Chargebee\Actions\ItemPriceActions; +use Chargebee\Actions\Contracts\LedgerAccountBalanceActionsInterface; +use Chargebee\Actions\LedgerAccountBalanceActions; +use Chargebee\Actions\Contracts\LedgerOperationActionsInterface; +use Chargebee\Actions\LedgerOperationActions; use Chargebee\Actions\Contracts\NonSubscriptionActionsInterface; use Chargebee\Actions\NonSubscriptionActions; use Chargebee\Actions\Contracts\OfferEventActionsInterface; @@ -96,6 +102,8 @@ use Chargebee\Actions\PricingPageSessionActions; use Chargebee\Actions\Contracts\PromotionalCreditActionsInterface; use Chargebee\Actions\PromotionalCreditActions; +use Chargebee\Actions\Contracts\PromotionalGrantActionsInterface; +use Chargebee\Actions\PromotionalGrantActions; use Chargebee\Actions\Contracts\PurchaseActionsInterface; use Chargebee\Actions\PurchaseActions; use Chargebee\Actions\Contracts\QuoteActionsInterface; @@ -305,6 +313,10 @@ public function gift() :GiftActionsInterface { return new GiftActions($this->httpClientFactory, $this->env); } + public function grantBlock() :GrantBlockActionsInterface { + return new GrantBlockActions($this->httpClientFactory, $this->env); + } + public function hostedPage() :HostedPageActionsInterface { return new HostedPageActions($this->httpClientFactory, $this->env); } @@ -333,6 +345,14 @@ public function itemPrice() :ItemPriceActionsInterface { return new ItemPriceActions($this->httpClientFactory, $this->env); } + public function ledgerAccountBalance() :LedgerAccountBalanceActionsInterface { + return new LedgerAccountBalanceActions($this->httpClientFactory, $this->env); + } + + public function ledgerOperation() :LedgerOperationActionsInterface { + return new LedgerOperationActions($this->httpClientFactory, $this->env); + } + public function nonSubscription() :NonSubscriptionActionsInterface { return new NonSubscriptionActions($this->httpClientFactory, $this->env); } @@ -401,6 +421,10 @@ public function promotionalCredit() :PromotionalCreditActionsInterface { return new PromotionalCreditActions($this->httpClientFactory, $this->env); } + public function promotionalGrant() :PromotionalGrantActionsInterface { + return new PromotionalGrantActions($this->httpClientFactory, $this->env); + } + public function purchase() :PurchaseActionsInterface { return new PurchaseActions($this->httpClientFactory, $this->env); } diff --git a/src/Enums/Status.php b/src/Enums/Status.php new file mode 100644 index 00000000..6ee5b977 --- /dev/null +++ b/src/Enums/Status.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/src/Resources/Content/Content.php b/src/Resources/Content/Content.php index a06a6c1c..a365acbf 100644 --- a/src/Resources/Content/Content.php +++ b/src/Resources/Content/Content.php @@ -39,6 +39,7 @@ use Chargebee\Resources\FilterCondition\FilterCondition; use Chargebee\Resources\GatewayErrorDetail\GatewayErrorDetail; use Chargebee\Resources\Gift\Gift; +use Chargebee\Resources\GrantBlock\GrantBlock; use Chargebee\Resources\Hierarchy\Hierarchy; use Chargebee\Resources\HostedPage\HostedPage; use Chargebee\Resources\ImpactedCustomer\ImpactedCustomer; @@ -52,6 +53,8 @@ use Chargebee\Resources\ItemEntitlement\ItemEntitlement; use Chargebee\Resources\ItemFamily\ItemFamily; use Chargebee\Resources\ItemPrice\ItemPrice; +use Chargebee\Resources\LedgerAccountBalance\LedgerAccountBalance; +use Chargebee\Resources\LedgerOperation\LedgerOperation; use Chargebee\Resources\Metadata\Metadata; use Chargebee\Resources\NonSubscription\NonSubscription; use Chargebee\Resources\OfferEvent\OfferEvent; @@ -77,6 +80,7 @@ use Chargebee\Resources\PriceVariant\PriceVariant; use Chargebee\Resources\PricingPageSession\PricingPageSession; use Chargebee\Resources\PromotionalCredit\PromotionalCredit; +use Chargebee\Resources\PromotionalGrant\PromotionalGrant; use Chargebee\Resources\Purchase\Purchase; use Chargebee\Resources\Quote\Quote; use Chargebee\Resources\QuoteLineGroup\QuoteLineGroup; @@ -337,6 +341,12 @@ class Content { */ public ?Gift $gift; + /** + * + * @var ?GrantBlock $grantblock + */ + public ?GrantBlock $grantblock; + /** * * @var ?Hierarchy $hierarchy @@ -415,6 +425,18 @@ class Content { */ public ?ItemPrice $itemprice; + /** + * + * @var ?LedgerAccountBalance $ledgeraccountbalance + */ + public ?LedgerAccountBalance $ledgeraccountbalance; + + /** + * + * @var ?LedgerOperation $ledgeroperation + */ + public ?LedgerOperation $ledgeroperation; + /** * * @var ?Metadata $metadata @@ -565,6 +587,12 @@ class Content { */ public ?PromotionalCredit $promotionalcredit; + /** + * + * @var ?PromotionalGrant $promotionalgrant + */ + public ?PromotionalGrant $promotionalgrant; + /** * * @var ?Purchase $purchase @@ -748,7 +776,7 @@ class Content { /** * @var array $knownFields */ - protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "currency" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "download" , "einvoice" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "filter_condition" , "gateway_error_detail" , "gift" , "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" , "metadata" , "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" , "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" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "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_operation" , "metadata" , "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" ]; /** * dynamic properties for resources @@ -795,6 +823,7 @@ private function __construct( ?FilterCondition $filtercondition, ?GatewayErrorDetail $gatewayerrordetail, ?Gift $gift, + ?GrantBlock $grantblock, ?Hierarchy $hierarchy, ?HostedPage $hostedpage, ?ImpactedCustomer $impactedcustomer, @@ -808,6 +837,8 @@ private function __construct( ?ItemEntitlement $itementitlement, ?ItemFamily $itemfamily, ?ItemPrice $itemprice, + ?LedgerAccountBalance $ledgeraccountbalance, + ?LedgerOperation $ledgeroperation, ?Metadata $metadata, ?NonSubscription $nonsubscription, ?OfferEvent $offerevent, @@ -833,6 +864,7 @@ private function __construct( ?PriceVariant $pricevariant, ?PricingPageSession $pricingpagesession, ?PromotionalCredit $promotionalcredit, + ?PromotionalGrant $promotionalgrant, ?Purchase $purchase, ?Quote $quote, ?QuoteLineGroup $quotelinegroup, @@ -903,6 +935,7 @@ private function __construct( $this->filtercondition = $filtercondition; $this->gatewayerrordetail = $gatewayerrordetail; $this->gift = $gift; + $this->grantblock = $grantblock; $this->hierarchy = $hierarchy; $this->hostedpage = $hostedpage; $this->impactedcustomer = $impactedcustomer; @@ -916,6 +949,8 @@ private function __construct( $this->itementitlement = $itementitlement; $this->itemfamily = $itemfamily; $this->itemprice = $itemprice; + $this->ledgeraccountbalance = $ledgeraccountbalance; + $this->ledgeroperation = $ledgeroperation; $this->metadata = $metadata; $this->nonsubscription = $nonsubscription; $this->offerevent = $offerevent; @@ -941,6 +976,7 @@ private function __construct( $this->pricevariant = $pricevariant; $this->pricingpagesession = $pricingpagesession; $this->promotionalcredit = $promotionalcredit; + $this->promotionalgrant = $promotionalgrant; $this->purchase = $purchase; $this->quote = $quote; $this->quotelinegroup = $quotelinegroup; @@ -1013,6 +1049,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['filter_condition']) ? FilterCondition::from($resourceAttributes['filter_condition']) : null, isset($resourceAttributes['gateway_error_detail']) ? GatewayErrorDetail::from($resourceAttributes['gateway_error_detail']) : 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, isset($resourceAttributes['hosted_page']) ? HostedPage::from($resourceAttributes['hosted_page']) : null, isset($resourceAttributes['impacted_customer']) ? ImpactedCustomer::from($resourceAttributes['impacted_customer']) : null, @@ -1026,6 +1063,8 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['item_entitlement']) ? ItemEntitlement::from($resourceAttributes['item_entitlement']) : null, isset($resourceAttributes['item_family']) ? ItemFamily::from($resourceAttributes['item_family']) : null, isset($resourceAttributes['item_price']) ? ItemPrice::from($resourceAttributes['item_price']) : null, + isset($resourceAttributes['ledger_account_balance']) ? LedgerAccountBalance::from($resourceAttributes['ledger_account_balance']) : null, + isset($resourceAttributes['ledger_operation']) ? LedgerOperation::from($resourceAttributes['ledger_operation']) : null, isset($resourceAttributes['metadata']) ? Metadata::from($resourceAttributes['metadata']) : null, isset($resourceAttributes['non_subscription']) ? NonSubscription::from($resourceAttributes['non_subscription']) : null, isset($resourceAttributes['offer_event']) ? OfferEvent::from($resourceAttributes['offer_event']) : null, @@ -1051,6 +1090,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['price_variant']) ? PriceVariant::from($resourceAttributes['price_variant']) : null, isset($resourceAttributes['pricing_page_session']) ? PricingPageSession::from($resourceAttributes['pricing_page_session']) : null, isset($resourceAttributes['promotional_credit']) ? PromotionalCredit::from($resourceAttributes['promotional_credit']) : null, + 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_line_group']) ? QuoteLineGroup::from($resourceAttributes['quote_line_group']) : null, @@ -1193,6 +1233,10 @@ public function toArray(): array + + + + @@ -1317,6 +1361,9 @@ public function toArray(): array if($this->gift instanceof Gift){ $data['gift'] = $this->gift->toArray(); } + if($this->grantblock instanceof GrantBlock){ + $data['grant_block'] = $this->grantblock->toArray(); + } if($this->hierarchy instanceof Hierarchy){ $data['hierarchy'] = $this->hierarchy->toArray(); } @@ -1356,6 +1403,12 @@ public function toArray(): array if($this->itemprice instanceof ItemPrice){ $data['item_price'] = $this->itemprice->toArray(); } + if($this->ledgeraccountbalance instanceof LedgerAccountBalance){ + $data['ledger_account_balance'] = $this->ledgeraccountbalance->toArray(); + } + if($this->ledgeroperation instanceof LedgerOperation){ + $data['ledger_operation'] = $this->ledgeroperation->toArray(); + } if($this->metadata instanceof Metadata){ $data['metadata'] = $this->metadata->toArray(); } @@ -1431,6 +1484,9 @@ public function toArray(): array if($this->promotionalcredit instanceof PromotionalCredit){ $data['promotional_credit'] = $this->promotionalcredit->toArray(); } + if($this->promotionalgrant instanceof PromotionalGrant){ + $data['promotional_grant'] = $this->promotionalgrant->toArray(); + } if($this->purchase instanceof Purchase){ $data['purchase'] = $this->purchase->toArray(); } diff --git a/src/Resources/CreditNote/CreditNote.php b/src/Resources/CreditNote/CreditNote.php index d96e14ed..0f6545e6 100644 --- a/src/Resources/CreditNote/CreditNote.php +++ b/src/Resources/CreditNote/CreditNote.php @@ -142,6 +142,12 @@ class CreditNote extends SupportsCustomFields { */ public ?int $fractional_correction; + /** + * + * @var ?array $notes + */ + public ?array $notes; + /** * * @var ?array $line_items @@ -295,7 +301,7 @@ class CreditNote extends SupportsCustomFields { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "customer_id" , "subscription_id" , "reference_invoice_id" , "vat_number" , "date" , "currency_code" , "total" , "amount_allocated" , "amount_refunded" , "amount_available" , "refunded_at" , "voided_at" , "generated_at" , "resource_version" , "updated_at" , "line_items_next_offset" , "sub_total" , "sub_total_in_local_currency" , "total_in_local_currency" , "local_currency_code" , "round_off_amount" , "fractional_correction" , "line_items" , "line_item_tiers" , "line_item_discounts" , "line_item_taxes" , "line_item_addresses" , "discounts" , "taxes" , "tax_origin" , "linked_refunds" , "allocations" , "deleted" , "tax_category" , "local_currency_exchange_rate" , "create_reason_code" , "vat_number_prefix" , "business_entity_id" , "shipping_address" , "billing_address" , "einvoice" , "site_details_at_creation" ]; + protected static array $knownFields = [ "id" , "customer_id" , "subscription_id" , "reference_invoice_id" , "vat_number" , "date" , "currency_code" , "total" , "amount_allocated" , "amount_refunded" , "amount_available" , "refunded_at" , "voided_at" , "generated_at" , "resource_version" , "updated_at" , "line_items_next_offset" , "sub_total" , "sub_total_in_local_currency" , "total_in_local_currency" , "local_currency_code" , "round_off_amount" , "fractional_correction" , "notes" , "line_items" , "line_item_tiers" , "line_item_discounts" , "line_item_taxes" , "line_item_addresses" , "discounts" , "taxes" , "tax_origin" , "linked_refunds" , "allocations" , "deleted" , "tax_category" , "local_currency_exchange_rate" , "create_reason_code" , "vat_number_prefix" , "business_entity_id" , "shipping_address" , "billing_address" , "einvoice" , "site_details_at_creation" ]; /** * dynamic properties for resources @@ -327,6 +333,7 @@ private function __construct( ?string $local_currency_code, ?int $round_off_amount, ?int $fractional_correction, + ?array $notes, ?array $line_items, ?array $line_item_tiers, ?array $line_item_discounts, @@ -377,6 +384,7 @@ private function __construct( $this->local_currency_code = $local_currency_code; $this->round_off_amount = $round_off_amount; $this->fractional_correction = $fractional_correction; + $this->notes = $notes; $this->line_items = $line_items; $this->line_item_tiers = $line_item_tiers; $this->line_item_discounts = $line_item_discounts; @@ -465,6 +473,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['local_currency_code'] ?? null, $resourceAttributes['round_off_amount'] ?? null, $resourceAttributes['fractional_correction'] ?? null, + $resourceAttributes['notes'] ?? null, $line_items, $line_item_tiers, $line_item_discounts, @@ -532,6 +541,7 @@ public function toArray(): array 'local_currency_code' => $this->local_currency_code, 'round_off_amount' => $this->round_off_amount, 'fractional_correction' => $this->fractional_correction, + 'notes' => $this->notes, diff --git a/src/Resources/GrantBlock/Enums/AccountType.php b/src/Resources/GrantBlock/Enums/AccountType.php new file mode 100644 index 00000000..0b1cba42 --- /dev/null +++ b/src/Resources/GrantBlock/Enums/AccountType.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/GrantBlock/Enums/GrantSource.php b/src/Resources/GrantBlock/Enums/GrantSource.php new file mode 100644 index 00000000..10aa32fd --- /dev/null +++ b/src/Resources/GrantBlock/Enums/GrantSource.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/src/Resources/GrantBlock/Enums/UnitType.php b/src/Resources/GrantBlock/Enums/UnitType.php new file mode 100644 index 00000000..0ff97f16 --- /dev/null +++ b/src/Resources/GrantBlock/Enums/UnitType.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/src/Resources/GrantBlock/GrantBlock.php b/src/Resources/GrantBlock/GrantBlock.php new file mode 100644 index 00000000..9fb5942a --- /dev/null +++ b/src/Resources/GrantBlock/GrantBlock.php @@ -0,0 +1,234 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "granted_amount" , "effective_from" , "expires_at" , "balance" , "hold_amount" , "used_amount" , "expired_amount" , "rolled_over_amount" , "voided_amount" , "origin_grant_block_id" , "metadata" , "created_at" , "unit_id" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $granted_amount, + ?int $effective_from, + ?int $expires_at, + ?string $balance, + ?string $hold_amount, + ?string $used_amount, + ?string $expired_amount, + ?string $rolled_over_amount, + ?string $voided_amount, + ?string $origin_grant_block_id, + ?string $metadata, + ?int $created_at, + ?string $unit_id, + ?\Chargebee\Enums\Status $status, + ?\Chargebee\Resources\GrantBlock\Enums\GrantSource $grant_source, + ?\Chargebee\Resources\GrantBlock\Enums\AccountType $account_type, + ?\Chargebee\Resources\GrantBlock\Enums\UnitType $unit_type, + ) + { + $this->id = $id; + $this->granted_amount = $granted_amount; + $this->effective_from = $effective_from; + $this->expires_at = $expires_at; + $this->balance = $balance; + $this->hold_amount = $hold_amount; + $this->used_amount = $used_amount; + $this->expired_amount = $expired_amount; + $this->rolled_over_amount = $rolled_over_amount; + $this->voided_amount = $voided_amount; + $this->origin_grant_block_id = $origin_grant_block_id; + $this->metadata = $metadata; + $this->created_at = $created_at; + $this->unit_id = $unit_id; + $this->status = $status; + $this->grant_source = $grant_source; + $this->account_type = $account_type; + $this->unit_type = $unit_type; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['granted_amount'] ?? null, + $resourceAttributes['effective_from'] ?? null, + $resourceAttributes['expires_at'] ?? null, + $resourceAttributes['balance'] ?? null, + $resourceAttributes['hold_amount'] ?? null, + $resourceAttributes['used_amount'] ?? null, + $resourceAttributes['expired_amount'] ?? null, + $resourceAttributes['rolled_over_amount'] ?? null, + $resourceAttributes['voided_amount'] ?? null, + $resourceAttributes['origin_grant_block_id'] ?? null, + $resourceAttributes['metadata'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['unit_id'] ?? null, + + + isset($resourceAttributes['status']) ? \Chargebee\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + isset($resourceAttributes['grant_source']) ? \Chargebee\Resources\GrantBlock\Enums\GrantSource::tryFromValue($resourceAttributes['grant_source']) : null, + + isset($resourceAttributes['account_type']) ? \Chargebee\Resources\GrantBlock\Enums\AccountType::tryFromValue($resourceAttributes['account_type']) : null, + + isset($resourceAttributes['unit_type']) ? \Chargebee\Resources\GrantBlock\Enums\UnitType::tryFromValue($resourceAttributes['unit_type']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'granted_amount' => $this->granted_amount, + 'effective_from' => $this->effective_from, + 'expires_at' => $this->expires_at, + 'balance' => $this->balance, + 'hold_amount' => $this->hold_amount, + 'used_amount' => $this->used_amount, + 'expired_amount' => $this->expired_amount, + 'rolled_over_amount' => $this->rolled_over_amount, + 'voided_amount' => $this->voided_amount, + 'origin_grant_block_id' => $this->origin_grant_block_id, + 'metadata' => $this->metadata, + 'created_at' => $this->created_at, + 'unit_id' => $this->unit_id, + + 'status' => $this->status?->value, + + 'grant_source' => $this->grant_source?->value, + + 'account_type' => $this->account_type?->value, + + 'unit_type' => $this->unit_type?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/HostedPage/Enums/Type.php b/src/Resources/HostedPage/Enums/Type.php index 382dd4b9..d732a92c 100644 --- a/src/Resources/HostedPage/Enums/Type.php +++ b/src/Resources/HostedPage/Enums/Type.php @@ -5,7 +5,6 @@ enum Type : string { case CHECKOUT_NEW = "checkout_new"; case CHECKOUT_EXISTING = "checkout_existing"; - case UPDATE_PAYMENT_METHOD = "update_payment_method"; case MANAGE_PAYMENT_SOURCES = "manage_payment_sources"; case COLLECT_NOW = "collect_now"; case EXTEND_SUBSCRIPTION = "extend_subscription"; @@ -19,6 +18,10 @@ enum Type : string { * @depcreated */ case UPDATE_CARD = "update_card"; + /* + * @depcreated + */ + case UPDATE_PAYMENT_METHOD = "update_payment_method"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/HostedPage/HostedPage.php b/src/Resources/HostedPage/HostedPage.php index b0d14e1d..3b574949 100644 --- a/src/Resources/HostedPage/HostedPage.php +++ b/src/Resources/HostedPage/HostedPage.php @@ -70,6 +70,12 @@ class HostedPage { */ public ?string $business_entity_id; + /** + * + * @var ?\Chargebee\Enums\Layout $layout + */ + public ?\Chargebee\Enums\Layout $layout; + /** * * @var ?\Chargebee\Resources\HostedPage\Enums\Type $type @@ -111,6 +117,7 @@ private function __construct( ?int $resource_version, mixed $checkout_info, ?string $business_entity_id, + ?\Chargebee\Enums\Layout $layout, ?\Chargebee\Resources\HostedPage\Enums\Type $type, ?\Chargebee\Resources\HostedPage\Enums\State $state, ?\Chargebee\Resources\HostedPage\Enums\FailureReason $failure_reason, @@ -126,7 +133,8 @@ private function __construct( $this->updated_at = $updated_at; $this->resource_version = $resource_version; $this->checkout_info = $checkout_info; - $this->business_entity_id = $business_entity_id; + $this->business_entity_id = $business_entity_id; + $this->layout = $layout; $this->type = $type; $this->state = $state; $this->failure_reason = $failure_reason; @@ -146,6 +154,8 @@ public static function from(array $resourceAttributes): self $resourceAttributes['checkout_info'] ?? null, $resourceAttributes['business_entity_id'] ?? null, + + isset($resourceAttributes['layout']) ? \Chargebee\Enums\Layout::tryFromValue($resourceAttributes['layout']) : null, isset($resourceAttributes['type']) ? \Chargebee\Resources\HostedPage\Enums\Type::tryFromValue($resourceAttributes['type']) : null, @@ -173,6 +183,8 @@ public function toArray(): array 'checkout_info' => $this->checkout_info, 'business_entity_id' => $this->business_entity_id, + 'layout' => $this->layout?->value, + 'type' => $this->type?->value, 'state' => $this->state?->value, diff --git a/src/Resources/LedgerAccountBalance/Enums/UnitType.php b/src/Resources/LedgerAccountBalance/Enums/UnitType.php new file mode 100644 index 00000000..2a4aff29 --- /dev/null +++ b/src/Resources/LedgerAccountBalance/Enums/UnitType.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/src/Resources/LedgerAccountBalance/LedgerAccountBalance.php b/src/Resources/LedgerAccountBalance/LedgerAccountBalance.php new file mode 100644 index 00000000..162d7c0d --- /dev/null +++ b/src/Resources/LedgerAccountBalance/LedgerAccountBalance.php @@ -0,0 +1,114 @@ + $knownFields + */ + protected static array $knownFields = [ "subscription_id" , "unit_id" , "modified_at" , "provisioned_balance" , "overdraft_balance" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $subscription_id, + ?string $unit_id, + ?int $modified_at, + ?ProvisionedBalance $provisioned_balance, + ?OverdraftBalance $overdraft_balance, + ?\Chargebee\Resources\LedgerAccountBalance\Enums\UnitType $unit_type, + ) + { + $this->subscription_id = $subscription_id; + $this->unit_id = $unit_id; + $this->modified_at = $modified_at; + $this->provisioned_balance = $provisioned_balance; + $this->overdraft_balance = $overdraft_balance; + $this->unit_type = $unit_type; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['subscription_id'] ?? null, + $resourceAttributes['unit_id'] ?? null, + $resourceAttributes['modified_at'] ?? null, + isset($resourceAttributes['provisioned_balance']) ? ProvisionedBalance::from($resourceAttributes['provisioned_balance']) : null, + isset($resourceAttributes['overdraft_balance']) ? OverdraftBalance::from($resourceAttributes['overdraft_balance']) : null, + + + isset($resourceAttributes['unit_type']) ? \Chargebee\Resources\LedgerAccountBalance\Enums\UnitType::tryFromValue($resourceAttributes['unit_type']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['subscription_id' => $this->subscription_id, + 'unit_id' => $this->unit_id, + 'modified_at' => $this->modified_at, + + + + 'unit_type' => $this->unit_type?->value, + + ], function ($value) { + return $value !== null; + }); + + + if($this->provisioned_balance instanceof ProvisionedBalance){ + $data['provisioned_balance'] = $this->provisioned_balance->toArray(); + } + if($this->overdraft_balance instanceof OverdraftBalance){ + $data['overdraft_balance'] = $this->overdraft_balance->toArray(); + } + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/LedgerAccountBalance/OverdraftBalance.php b/src/Resources/LedgerAccountBalance/OverdraftBalance.php new file mode 100644 index 00000000..e2bc24ef --- /dev/null +++ b/src/Resources/LedgerAccountBalance/OverdraftBalance.php @@ -0,0 +1,106 @@ + $knownFields + */ + protected static array $knownFields = [ "is_unlimited" , "limit" , "total_balance" , "usable_balance" , "used_amount" , "hold_amount" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?bool $is_unlimited, + ?string $limit, + ?string $total_balance, + ?string $usable_balance, + ?string $used_amount, + ?string $hold_amount, + ) + { + $this->is_unlimited = $is_unlimited; + $this->limit = $limit; + $this->total_balance = $total_balance; + $this->usable_balance = $usable_balance; + $this->used_amount = $used_amount; + $this->hold_amount = $hold_amount; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['is_unlimited'] ?? null, + $resourceAttributes['limit'] ?? null, + $resourceAttributes['total_balance'] ?? null, + $resourceAttributes['usable_balance'] ?? null, + $resourceAttributes['used_amount'] ?? null, + $resourceAttributes['hold_amount'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['is_unlimited' => $this->is_unlimited, + 'limit' => $this->limit, + 'total_balance' => $this->total_balance, + 'usable_balance' => $this->usable_balance, + 'used_amount' => $this->used_amount, + 'hold_amount' => $this->hold_amount, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/LedgerAccountBalance/ProvisionedBalance.php b/src/Resources/LedgerAccountBalance/ProvisionedBalance.php new file mode 100644 index 00000000..dd78f3b2 --- /dev/null +++ b/src/Resources/LedgerAccountBalance/ProvisionedBalance.php @@ -0,0 +1,76 @@ + $knownFields + */ + protected static array $knownFields = [ "total_balance" , "usable_balance" , "hold_amount" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $total_balance, + ?string $usable_balance, + ?string $hold_amount, + ) + { + $this->total_balance = $total_balance; + $this->usable_balance = $usable_balance; + $this->hold_amount = $hold_amount; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['total_balance'] ?? null, + $resourceAttributes['usable_balance'] ?? null, + $resourceAttributes['hold_amount'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['total_balance' => $this->total_balance, + 'usable_balance' => $this->usable_balance, + 'hold_amount' => $this->hold_amount, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/LedgerOperation/Enums/Type.php b/src/Resources/LedgerOperation/Enums/Type.php new file mode 100644 index 00000000..959ed3a0 --- /dev/null +++ b/src/Resources/LedgerOperation/Enums/Type.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/src/Resources/LedgerOperation/Enums/UnitType.php b/src/Resources/LedgerOperation/Enums/UnitType.php new file mode 100644 index 00000000..7653cc93 --- /dev/null +++ b/src/Resources/LedgerOperation/Enums/UnitType.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/src/Resources/LedgerOperation/LedgerOperation.php b/src/Resources/LedgerOperation/LedgerOperation.php new file mode 100644 index 00000000..26fcb3b4 --- /dev/null +++ b/src/Resources/LedgerOperation/LedgerOperation.php @@ -0,0 +1,230 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "amount" , "start_balance" , "end_balance" , "provisioned_start_balance" , "provisioned_end_balance" , "overdraft_start_balance" , "overdraft_end_balance" , "parent_ledger_operation_id" , "ledger_operation_timestamp" , "auto_release_timestamp" , "metadata" , "created_at" , "modified_at" , "subscription_id" , "unit_id" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $amount, + ?string $start_balance, + ?string $end_balance, + ?string $provisioned_start_balance, + ?string $provisioned_end_balance, + ?string $overdraft_start_balance, + ?string $overdraft_end_balance, + ?string $parent_ledger_operation_id, + ?int $ledger_operation_timestamp, + ?int $auto_release_timestamp, + ?string $metadata, + ?int $created_at, + ?int $modified_at, + ?string $subscription_id, + ?string $unit_id, + ?\Chargebee\Resources\LedgerOperation\Enums\Type $type, + ?\Chargebee\Resources\LedgerOperation\Enums\UnitType $unit_type, + ) + { + $this->id = $id; + $this->amount = $amount; + $this->start_balance = $start_balance; + $this->end_balance = $end_balance; + $this->provisioned_start_balance = $provisioned_start_balance; + $this->provisioned_end_balance = $provisioned_end_balance; + $this->overdraft_start_balance = $overdraft_start_balance; + $this->overdraft_end_balance = $overdraft_end_balance; + $this->parent_ledger_operation_id = $parent_ledger_operation_id; + $this->ledger_operation_timestamp = $ledger_operation_timestamp; + $this->auto_release_timestamp = $auto_release_timestamp; + $this->metadata = $metadata; + $this->created_at = $created_at; + $this->modified_at = $modified_at; + $this->subscription_id = $subscription_id; + $this->unit_id = $unit_id; + $this->type = $type; + $this->unit_type = $unit_type; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['amount'] ?? null, + $resourceAttributes['start_balance'] ?? null, + $resourceAttributes['end_balance'] ?? null, + $resourceAttributes['provisioned_start_balance'] ?? null, + $resourceAttributes['provisioned_end_balance'] ?? null, + $resourceAttributes['overdraft_start_balance'] ?? null, + $resourceAttributes['overdraft_end_balance'] ?? null, + $resourceAttributes['parent_ledger_operation_id'] ?? null, + $resourceAttributes['ledger_operation_timestamp'] ?? null, + $resourceAttributes['auto_release_timestamp'] ?? null, + $resourceAttributes['metadata'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['modified_at'] ?? null, + $resourceAttributes['subscription_id'] ?? null, + $resourceAttributes['unit_id'] ?? null, + + + isset($resourceAttributes['type']) ? \Chargebee\Resources\LedgerOperation\Enums\Type::tryFromValue($resourceAttributes['type']) : null, + + isset($resourceAttributes['unit_type']) ? \Chargebee\Resources\LedgerOperation\Enums\UnitType::tryFromValue($resourceAttributes['unit_type']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'amount' => $this->amount, + 'start_balance' => $this->start_balance, + 'end_balance' => $this->end_balance, + 'provisioned_start_balance' => $this->provisioned_start_balance, + 'provisioned_end_balance' => $this->provisioned_end_balance, + 'overdraft_start_balance' => $this->overdraft_start_balance, + 'overdraft_end_balance' => $this->overdraft_end_balance, + 'parent_ledger_operation_id' => $this->parent_ledger_operation_id, + 'ledger_operation_timestamp' => $this->ledger_operation_timestamp, + 'auto_release_timestamp' => $this->auto_release_timestamp, + 'metadata' => $this->metadata, + 'created_at' => $this->created_at, + 'modified_at' => $this->modified_at, + 'subscription_id' => $this->subscription_id, + 'unit_id' => $this->unit_id, + + 'type' => $this->type?->value, + + 'unit_type' => $this->unit_type?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/PromotionalGrant/PromotionalGrant.php b/src/Resources/PromotionalGrant/PromotionalGrant.php new file mode 100644 index 00000000..dac65050 --- /dev/null +++ b/src/Resources/PromotionalGrant/PromotionalGrant.php @@ -0,0 +1,96 @@ + $knownFields + */ + protected static array $knownFields = [ "subscription_id" , "unit_id" , "amount" , "expires_at" , "metadata" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $subscription_id, + ?string $unit_id, + ?string $amount, + ?int $expires_at, + ?string $metadata, + ) + { + $this->subscription_id = $subscription_id; + $this->unit_id = $unit_id; + $this->amount = $amount; + $this->expires_at = $expires_at; + $this->metadata = $metadata; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['subscription_id'] ?? null, + $resourceAttributes['unit_id'] ?? null, + $resourceAttributes['amount'] ?? null, + $resourceAttributes['expires_at'] ?? null, + $resourceAttributes['metadata'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['subscription_id' => $this->subscription_id, + 'unit_id' => $this->unit_id, + 'amount' => $this->amount, + 'expires_at' => $this->expires_at, + 'metadata' => $this->metadata, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/GrantBlockResponse/ListGrantBlocksGrantBlockResponse.php b/src/Responses/GrantBlockResponse/ListGrantBlocksGrantBlockResponse.php new file mode 100644 index 00000000..6a5db62f --- /dev/null +++ b/src/Responses/GrantBlockResponse/ListGrantBlocksGrantBlockResponse.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): ListGrantBlocksGrantBlockResponseListObject { + return new ListGrantBlocksGrantBlockResponseListObject( + isset($result['grant_block']) ? GrantBlock::from($result['grant_block']) : 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/GrantBlockResponse/ListGrantBlocksGrantBlockResponseListObject.php b/src/Responses/GrantBlockResponse/ListGrantBlocksGrantBlockResponseListObject.php new file mode 100644 index 00000000..38564249 --- /dev/null +++ b/src/Responses/GrantBlockResponse/ListGrantBlocksGrantBlockResponseListObject.php @@ -0,0 +1,14 @@ +grant_block = $grant_block; + } +} diff --git a/src/Responses/LedgerAccountBalanceResponse/ListLedgerAccountBalancesLedgerAccountBalanceResponse.php b/src/Responses/LedgerAccountBalanceResponse/ListLedgerAccountBalancesLedgerAccountBalanceResponse.php new file mode 100644 index 00000000..977b985f --- /dev/null +++ b/src/Responses/LedgerAccountBalanceResponse/ListLedgerAccountBalancesLedgerAccountBalanceResponse.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): ListLedgerAccountBalancesLedgerAccountBalanceResponseListObject { + return new ListLedgerAccountBalancesLedgerAccountBalanceResponseListObject( + isset($result['ledger_account_balance']) ? LedgerAccountBalance::from($result['ledger_account_balance']) : 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/LedgerAccountBalanceResponse/ListLedgerAccountBalancesLedgerAccountBalanceResponseListObject.php b/src/Responses/LedgerAccountBalanceResponse/ListLedgerAccountBalancesLedgerAccountBalanceResponseListObject.php new file mode 100644 index 00000000..d65b6aa5 --- /dev/null +++ b/src/Responses/LedgerAccountBalanceResponse/ListLedgerAccountBalancesLedgerAccountBalanceResponseListObject.php @@ -0,0 +1,14 @@ +ledger_account_balance = $ledger_account_balance; + } +} diff --git a/src/Responses/LedgerOperationResponse/AuthorizeLedgerOperationResponse.php b/src/Responses/LedgerOperationResponse/AuthorizeLedgerOperationResponse.php new file mode 100644 index 00000000..395b7c8b --- /dev/null +++ b/src/Responses/LedgerOperationResponse/AuthorizeLedgerOperationResponse.php @@ -0,0 +1,59 @@ +ledger_operation = $ledger_operation; + $this->ledger_account_balance = $ledger_account_balance; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['ledger_operation']) ? LedgerOperation::from($resourceAttributes['ledger_operation']) : null, + + isset($resourceAttributes['ledger_account_balance']) ? LedgerAccountBalance::from($resourceAttributes['ledger_account_balance']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->ledger_operation instanceof LedgerOperation){ + $data['ledger_operation'] = $this->ledger_operation->toArray(); + } + if($this->ledger_account_balance instanceof LedgerAccountBalance){ + $data['ledger_account_balance'] = $this->ledger_account_balance->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/LedgerOperationResponse/CaptureAuthorizationLedgerOperationResponse.php b/src/Responses/LedgerOperationResponse/CaptureAuthorizationLedgerOperationResponse.php new file mode 100644 index 00000000..a43d855f --- /dev/null +++ b/src/Responses/LedgerOperationResponse/CaptureAuthorizationLedgerOperationResponse.php @@ -0,0 +1,59 @@ +ledger_operation = $ledger_operation; + $this->ledger_account_balance = $ledger_account_balance; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['ledger_operation']) ? LedgerOperation::from($resourceAttributes['ledger_operation']) : null, + + isset($resourceAttributes['ledger_account_balance']) ? LedgerAccountBalance::from($resourceAttributes['ledger_account_balance']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->ledger_operation instanceof LedgerOperation){ + $data['ledger_operation'] = $this->ledger_operation->toArray(); + } + if($this->ledger_account_balance instanceof LedgerAccountBalance){ + $data['ledger_account_balance'] = $this->ledger_account_balance->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/LedgerOperationResponse/CaptureLedgerOperationResponse.php b/src/Responses/LedgerOperationResponse/CaptureLedgerOperationResponse.php new file mode 100644 index 00000000..1a62df12 --- /dev/null +++ b/src/Responses/LedgerOperationResponse/CaptureLedgerOperationResponse.php @@ -0,0 +1,59 @@ +ledger_operation = $ledger_operation; + $this->ledger_account_balance = $ledger_account_balance; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['ledger_operation']) ? LedgerOperation::from($resourceAttributes['ledger_operation']) : null, + + isset($resourceAttributes['ledger_account_balance']) ? LedgerAccountBalance::from($resourceAttributes['ledger_account_balance']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->ledger_operation instanceof LedgerOperation){ + $data['ledger_operation'] = $this->ledger_operation->toArray(); + } + if($this->ledger_account_balance instanceof LedgerAccountBalance){ + $data['ledger_account_balance'] = $this->ledger_account_balance->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/LedgerOperationResponse/ListLedgerOperationsLedgerOperationResponse.php b/src/Responses/LedgerOperationResponse/ListLedgerOperationsLedgerOperationResponse.php new file mode 100644 index 00000000..f6c290a6 --- /dev/null +++ b/src/Responses/LedgerOperationResponse/ListLedgerOperationsLedgerOperationResponse.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): ListLedgerOperationsLedgerOperationResponseListObject { + return new ListLedgerOperationsLedgerOperationResponseListObject( + isset($result['ledger_operation']) ? LedgerOperation::from($result['ledger_operation']) : 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/LedgerOperationResponse/ListLedgerOperationsLedgerOperationResponseListObject.php b/src/Responses/LedgerOperationResponse/ListLedgerOperationsLedgerOperationResponseListObject.php new file mode 100644 index 00000000..8061addc --- /dev/null +++ b/src/Responses/LedgerOperationResponse/ListLedgerOperationsLedgerOperationResponseListObject.php @@ -0,0 +1,14 @@ +ledger_operation = $ledger_operation; + } +} diff --git a/src/Responses/LedgerOperationResponse/ReleaseAuthorizationLedgerOperationResponse.php b/src/Responses/LedgerOperationResponse/ReleaseAuthorizationLedgerOperationResponse.php new file mode 100644 index 00000000..e237a08d --- /dev/null +++ b/src/Responses/LedgerOperationResponse/ReleaseAuthorizationLedgerOperationResponse.php @@ -0,0 +1,59 @@ +ledger_operation = $ledger_operation; + $this->ledger_account_balance = $ledger_account_balance; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['ledger_operation']) ? LedgerOperation::from($resourceAttributes['ledger_operation']) : null, + + isset($resourceAttributes['ledger_account_balance']) ? LedgerAccountBalance::from($resourceAttributes['ledger_account_balance']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->ledger_operation instanceof LedgerOperation){ + $data['ledger_operation'] = $this->ledger_operation->toArray(); + } + if($this->ledger_account_balance instanceof LedgerAccountBalance){ + $data['ledger_account_balance'] = $this->ledger_account_balance->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/LedgerOperationResponse/RetrieveLedgerOperationLedgerOperationResponse.php b/src/Responses/LedgerOperationResponse/RetrieveLedgerOperationLedgerOperationResponse.php new file mode 100644 index 00000000..a4c595e2 --- /dev/null +++ b/src/Responses/LedgerOperationResponse/RetrieveLedgerOperationLedgerOperationResponse.php @@ -0,0 +1,45 @@ +ledger_operation = $ledger_operation; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['ledger_operation']) ? LedgerOperation::from($resourceAttributes['ledger_operation']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->ledger_operation instanceof LedgerOperation){ + $data['ledger_operation'] = $this->ledger_operation->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PromotionalGrantResponse/PromotionalGrantsPromotionalGrantResponse.php b/src/Responses/PromotionalGrantResponse/PromotionalGrantsPromotionalGrantResponse.php new file mode 100644 index 00000000..0a899538 --- /dev/null +++ b/src/Responses/PromotionalGrantResponse/PromotionalGrantsPromotionalGrantResponse.php @@ -0,0 +1,69 @@ + $ledger_operations + */ + public ?array $ledger_operations; + + /** + * + * @var ?array $grant_blocks + */ + public ?array $grant_blocks; + + + private function __construct( + ?array $ledger_operations, + ?array $grant_blocks, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->ledger_operations = $ledger_operations; + $this->grant_blocks = $grant_blocks; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $ledger_operations = array_map(fn (array $result): LedgerOperation => LedgerOperation::from( + $result + ), $resourceAttributes['ledger_operations'] ?? []); + + $grant_blocks = array_map(fn (array $result): GrantBlock => GrantBlock::from( + $result + ), $resourceAttributes['grant_blocks'] ?? []); + + return new self($ledger_operations,$grant_blocks, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + + if($this->ledger_operations !== []) { + $data['ledger_operations'] = array_map( + fn (LedgerOperation $ledger_operations): array => $ledger_operations->toArray(), + $this->ledger_operations + ); + } + if($this->grant_blocks !== []) { + $data['grant_blocks'] = array_map( + fn (GrantBlock $grant_blocks): array => $grant_blocks->toArray(), + $this->grant_blocks + ); + } + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Version.php b/src/Version.php index 7aba070c..cdb8658b 100644 --- a/src/Version.php +++ b/src/Version.php @@ -4,7 +4,7 @@ final class Version { - const VERSION = '4.21.0'; + const VERSION = '4.22.0'; } ?> \ No newline at end of file From b1e1e974f09ce179f19b6b4636c9bead8b88d391 Mon Sep 17 00:00:00 2001 From: cb-alish Date: Mon, 15 Jun 2026 10:30:27 +0530 Subject: [PATCH 2/2] Exclude GET operations from JSON input flag checks --- src/Actions/GrantBlockActions.php | 2 -- src/Actions/LedgerAccountBalanceActions.php | 2 -- src/Actions/LedgerOperationActions.php | 1 - src/Actions/OfferFulfillmentActions.php | 3 +-- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Actions/GrantBlockActions.php b/src/Actions/GrantBlockActions.php index 5e11324a..405ca7e7 100644 --- a/src/Actions/GrantBlockActions.php +++ b/src/Actions/GrantBlockActions.php @@ -3,7 +3,6 @@ use Chargebee\Responses\GrantBlockResponse\ListGrantBlocksGrantBlockResponse; use Chargebee\Actions\Contracts\GrantBlockActionsInterface; -use Chargebee\ValueObjects\Encoders\JsonParamEncoder; use Chargebee\ValueObjects\Encoders\ListParamEncoder; use Chargebee\ValueObjects\Encoders\URLFormEncoder; use Chargebee\ValueObjects\Transporters\ChargebeePayload; @@ -79,7 +78,6 @@ public function listGrantBlocks(array $params, array $headers = []): ListGrantBl ->withParamEncoder(new ListParamEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) - ->withHeaderOverride("Content-Type", "application/json") ->withHeaders($headers) ->withParams($params) ->build(); diff --git a/src/Actions/LedgerAccountBalanceActions.php b/src/Actions/LedgerAccountBalanceActions.php index b2b3e87a..5c7de425 100644 --- a/src/Actions/LedgerAccountBalanceActions.php +++ b/src/Actions/LedgerAccountBalanceActions.php @@ -3,7 +3,6 @@ use Chargebee\Responses\LedgerAccountBalanceResponse\ListLedgerAccountBalancesLedgerAccountBalanceResponse; use Chargebee\Actions\Contracts\LedgerAccountBalanceActionsInterface; -use Chargebee\ValueObjects\Encoders\JsonParamEncoder; use Chargebee\ValueObjects\Encoders\ListParamEncoder; use Chargebee\ValueObjects\Encoders\URLFormEncoder; use Chargebee\ValueObjects\Transporters\ChargebeePayload; @@ -57,7 +56,6 @@ public function listLedgerAccountBalances(array $params, array $headers = []): L ->withParamEncoder(new ListParamEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) - ->withHeaderOverride("Content-Type", "application/json") ->withHeaders($headers) ->withParams($params) ->build(); diff --git a/src/Actions/LedgerOperationActions.php b/src/Actions/LedgerOperationActions.php index 4b07eed0..259bd46b 100644 --- a/src/Actions/LedgerOperationActions.php +++ b/src/Actions/LedgerOperationActions.php @@ -198,7 +198,6 @@ public function listLedgerOperations(array $params, array $headers = []): ListLe ->withParamEncoder(new ListParamEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) - ->withHeaderOverride("Content-Type", "application/json") ->withHeaders($headers) ->withParams($params) ->build(); diff --git a/src/Actions/OfferFulfillmentActions.php b/src/Actions/OfferFulfillmentActions.php index 71ec9da5..8c7f099b 100644 --- a/src/Actions/OfferFulfillmentActions.php +++ b/src/Actions/OfferFulfillmentActions.php @@ -82,10 +82,9 @@ public function offerFulfillmentsGet(string $id, array $headers = []): OfferFulf ->withEnvironment($this->env) ->withHttpMethod("get") ->withUriPaths(["offer_fulfillments",$id]) - ->withParamEncoder( new JsonParamEncoder()) + ->withParamEncoder( new URLFormEncoder()) ->withSubDomain("grow") ->withJsonKeys($jsonKeys) - ->withHeaderOverride("Content-Type", "application/json") ->withHeaders($headers) ->build(); $apiRequester = new APIRequester($this->httpClientFactory, $this->env);