diff --git a/CHANGELOG.md b/CHANGELOG.md index ec8b5602..da4e5c49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,175 @@ +### v4.28.0 (2026-11-02) +* * * +### New Resources: +- `Citation` has been added. +- `CollectionsDispute` has been added. +- `CollectionsPaymentPromise` has been added. +- `CollectionsReminderSequence` has been added. +- `CustomData` has been added. +- `DraftEstimate` has been added. +- `DraftRequest` has been added. +- `EmailAttachment` has been added. +- `EmailConversation` has been added. +- `EmailMessage` has been added. +- `Execution` has been added. +- `GroupByAttribute` has been added. +- `GroupByRecommendation` has been added. +- `PreferenceVariant` has been added. +- `PriceRamp` has been added. +- `PrivateNote` has been added. +- `RampInterval` has been added. +- `RetrySegment` has been added. + + +### New Actions: +- `retrieve_a_business_entity` has been added to `BusinessEntity`. +- `update_business_entity` has been added to `BusinessEntity`. +- `list_business_entities` has been added to `BusinessEntity`. +- `create_a_business_entity` has been added to `BusinessEntity`. +- `remove_payment_schedule_scheme_from_an_invoice` has been added to `Invoice`. +- `update_overdraft_limit` has been added to `LedgerAccountBalance`. + + +### New Attributes: +- `email_conversation_id` has been added to `EmailLog`. +- `gateway` has been added to `GatewayPaymentMethodToken`. +- `retry_segment_id` has been added to `Invoice`. +- `price_ramp_id` has been added to `ItemPrice`. +- `group_by` has been added to `Meter`. +- `group_by` has been added to `MeteredFeature`. +- `origin` has been added to `OmnichannelSubscription`. +- `expiration_reason_at_source` has been added to `OmnichannelSubscriptionItem`. +- `cancellation_reason_at_source` has been added to `OmnichannelSubscriptionItem`. +- `gateway_metadata` has been added to `Transaction`. +- `attributes` has been added to `UsageSummary`. + + +### New Parameters: +- `limit` has been added as query parameter to `list_business_entities` in `BusinessEntity`. +- `offset` has been added as query parameter to `list_business_entities` in `BusinessEntity`. +- `include_deleted` has been added as query parameter to `list_business_entities` in `BusinessEntity`. +- `name` has been added as query parameter to `list_business_entities` in `BusinessEntity`. +- `group_by` has been added as query parameter to `retrieve_usage_summary_for_a_subscription` in `UsageSummary`. +- `name` has been added as request body parameter to `update_business_entity` in `BusinessEntity`. +- `status` has been added as request body parameter to `update_business_entity` in `BusinessEntity`. +- `name` has been added as request body parameter to `create_a_business_entity` in `BusinessEntity`. +- `status` has been added as request body parameter to `create_a_business_entity` in `BusinessEntity`. +- `customer_notes` has been added as request body parameter to `import_credit_note` in `CreditNote`. +- `line_items.tax_exempt_reason` has been added as request body parameter to `import_invoice` in `Invoice`. +- `comment` has been added as request body parameter to `remove_payment_schedule_scheme_from_an_invoice` in `Invoice`. +- `subscription_id` has been added as request body parameter to `update_overdraft_limit` in `LedgerAccountBalance`. +- `unit_id` has been added as request body parameter to `update_overdraft_limit` in `LedgerAccountBalance`. +- `is_unlimited` has been added as request body parameter to `update_overdraft_limit` in `LedgerAccountBalance`. +- `limit` has been added as request body parameter to `update_overdraft_limit` in `LedgerAccountBalance`. +- `change_reason` has been added as request body parameter to `update_overdraft_limit` in `LedgerAccountBalance`. +- `bank_account` has been added as request body parameter to `create_using_permanent_token` in `PaymentSource`. +- `purchase_items.trial_end` has been added as request body parameter to `create_a_purchase` in `Purchase`. +- `subscription_info.trial_end` has been added as request body parameter to `create_a_purchase` in `Purchase`. +- `subscription_info.start_date` has been added as request body parameter to `create_a_purchase` in `Purchase`. +- `purchase_items.trial_end` has been added as request body parameter to `estimates_for_purchase` in `Purchase`. +- `subscription_info.trial_end` has been added as request body parameter to `estimates_for_purchase` in `Purchase`. +- `subscription_info.start_date` has been added as request body parameter to `estimates_for_purchase` in `Purchase`. +- `items_to_add.description` has been added as request body parameter to `create_a_ramp` in `Ramp`. +- `items_to_update.description` has been added as request body parameter to `create_a_ramp` in `Ramp`. +- `items_to_add.description` has been added as request body parameter to `update_a_subscription_ramp` in `Ramp`. +- `items_to_update.description` has been added as request body parameter to `update_a_subscription_ramp` in `Ramp`. +- `group_by` has been added as request body parameter to `retrieve_usages_for_an_invoice_as_pdf` in `Usage`. + + +### New Events: +- `chargeback_lost` has been added. +- `price_ramp_updated` has been added. +- `refund_failed` has been added. +- `chargeback_initiated` has been added. +- `collections_payment_promise_fulfilled` has been added. +- `collections_dispute_resolved` has been added. +- `collections_dispute_updated` has been added. +- `collections_payment_promise_updated` has been added. +- `chargeback_won` has been added. +- `price_ramp_created` has been added. +- `collections_reminder_sequence_created` has been added. +- `email_message_received` has been added. +- `collections_payment_promise_broken` has been added. +- `price_ramp_deleted` has been added. +- `collections_payment_promise_created` has been added. +- `private_note_added` has been added. +- `collections_dispute_created` has been added. +- `collections_payment_promise_cancelled` has been added. +- `collections_dispute_withdrawn` has been added. +- `collections_reminder_sequence_paused` has been added. +- `collections_reminder_sequence_resumed` has been added. +- `payment_schedules_cancelled` has been added. +- `collections_reminder_sequence_completed` has been added. + + +### Deleted Resources: +- AppliedBusinessRule has been removed. + + +### Deleted Attributes: +- `handle` has been removed from `AppliedBusinessRule`. +- `entity_type` has been removed from `AppliedBusinessRule`. +- `entity_id` has been removed from `AppliedBusinessRule`. +- `entity_version` has been removed from `AppliedBusinessRule`. +- `rule_id` has been removed from `AppliedBusinessRule`. +- `version` has been removed from `AppliedBusinessRule`. +- `created_at` has been removed from `AppliedBusinessRule`. +- `modified_at` has been removed from `AppliedBusinessRule`. +- `gateway_name` has been removed from `GatewayPaymentMethodToken`. + + +### Deleted Events: +- `business_rules_applied` has been removed. + + +### New Enums: +- `task` has been added as a new value enum `EntityType`. +- `payment_schedules_cancelled`, `refund_failed`, `price_ramp_created`, `price_ramp_updated`, `price_ramp_deleted`, `chargeback_initiated`, `chargeback_won`, `chargeback_lost`, `collections_reminder_sequence_created`, `collections_reminder_sequence_paused`, `collections_reminder_sequence_resumed`, `collections_reminder_sequence_completed`, `collections_payment_promise_created`, `collections_payment_promise_updated`, `collections_payment_promise_fulfilled`, `collections_payment_promise_cancelled`, `collections_payment_promise_broken`, `collections_dispute_created`, `collections_dispute_updated`, `collections_dispute_resolved`, `collections_dispute_withdrawn`, `email_message_received`, and `private_note_added` have been added as new values enum `EventType`. +- `mcp`, `copilot`, and `agent` have been added as new values enum `Source`. +- `low`, `medium`, `high`, and `not_provided` have been added as new values to enum attribute `confidence_level` in `Citation`. +- `open`, `resolved`, and `withdrawn` have been added as new values to enum attribute `status` in `CollectionsDispute`. +- `active`, `fulfilled`, `broken`, and `cancelled` have been added as new values to enum attribute `status` in `CollectionsPaymentPromise`. +- `active`, `completed`, `paused`, and `failed` have been added as new values to enum attribute `status` in `CollectionsReminderSequence`. +- `success` and `failed` have been added as new values to enum attribute `status` in `DraftEstimate`. +- `open` and `executed` have been added as new values to enum attribute `status` in `DraftRequest`. +- `contact`, `site_user`, `agent`, and `other` have been added as new values to enum attribute `author_type` in `EmailMessage`. +- `pending`, `sent`, and `failed` have been added as new values to enum attribute `send_status` in `EmailMessage`. +- `success` and `failed` have been added as new values to enum attribute `status` in `Execution`. +- `valid` and `invalid` have been added as new values to enum attribute `status` in `GatewayPaymentMethodToken`. +- `low_coverage` and `high_cardinality` have been added as new values to enum attribute `warning_reasons` in `GroupByAttribute`. +- `roku` and `amazon_app_store` have been added as new values to enum attribute `source` in `OmnichannelOneTimeOrder`. +- `roku` and `amazon_app_store` have been added as new values to enum attribute `source` in `OmnichannelSubscription`. +- `other` has been added as a new value to enum attribute `cancellation_reason` in `OmnichannelSubscriptionItem`. +- `active`, `archived`, and `deleted` have been added as new values to enum attribute `status` in `PriceRamp`. +- `site_user`, `agent`, and `other` have been added as new values to enum attribute `author_type` in `PrivateNote`. +- `roku` and `amazon_app_store` have been added as new values to enum attribute `source` in `RecordedPurchase`. +- `and` and `or` have been added as new values to enum attribute `condition_logic` in `RetrySegment`. +- `true` and `false` have been added as new values to enum query parameter `name.is_present` in `list_business_entities` of `BusinessEntity`. +- `broken`, `fulfilled`, `active`, and `cancelled` have been added as new values to enum query parameter `status.is` in `list_collections_payment_promises` of `CollectionsPaymentPromise`. +- `not_provided`, `high`, `low`, and `medium` have been added as new values to enum request body parameter `citations.confidence_level` in `add_citations_to_a_draft_request` of `DraftRequest`. +- `not_provided`, `high`, `low`, and `medium` have been added as new values to enum request body parameter `citations.confidence_level` in `update_a_draft_request` of `DraftRequest`. +- `not_provided`, `high`, `low`, and `medium` have been added as new values to enum request body parameter `citations.confidence_level` in `create_a_draft_request` of `DraftRequest`. +- `roku` and `amazon_app_store` have been added as new values to enum query parameter `source.is` in `list_omnichannel_one_time_orders` of `OmnichannelOneTimeOrder`. +- `roku` and `amazon_app_store` have been added as new values to enum query parameter `source.is_not` in `list_omnichannel_one_time_orders` of `OmnichannelOneTimeOrder`. +- `roku` and `amazon_app_store` have been added as new values to enum query parameter `source.in` in `list_omnichannel_one_time_orders` of `OmnichannelOneTimeOrder`. +- `roku` and `amazon_app_store` have been added as new values to enum query parameter `source.not_in` in `list_omnichannel_one_time_orders` of `OmnichannelOneTimeOrder`. +- `roku` and `amazon_app_store` have been added as new values to enum query parameter `source.is` in `list_omnichannel_subscriptions` of `OmnichannelSubscription`. +- `roku` and `amazon_app_store` have been added as new values to enum query parameter `source.is_not` in `list_omnichannel_subscriptions` of `OmnichannelSubscription`. +- `roku` and `amazon_app_store` have been added as new values to enum query parameter `source.in` in `list_omnichannel_subscriptions` of `OmnichannelSubscription`. +- `roku` and `amazon_app_store` have been added as new values to enum query parameter `source.not_in` in `list_omnichannel_subscriptions` of `OmnichannelSubscription`. +- `bacs`, `pad`, `sepa_core`, `ach`, `autogiro`, `becs_nz`, and `becs` have been added as new values to enum request body parameter `bank_account.scheme` in `create_using_permanent_token` of `PaymentSource`. +- `archived` and `active` have been added as new values to enum query parameter `status.is` in `list_price_ramps` of `PriceRamp`. +- `archived` and `active` have been added as new values to enum query parameter `status.is_not` in `list_price_ramps` of `PriceRamp`. +- `archived` and `active` have been added as new values to enum query parameter `status.in` in `list_price_ramps` of `PriceRamp`. +- `archived` and `active` have been added as new values to enum query parameter `status.not_in` in `list_price_ramps` of `PriceRamp`. +- `true` and `false` have been added as new values to enum query parameter `business_entity_id.is_present` in `list_price_ramps` of `PriceRamp`. +- `true` and `false` have been added as new values to enum query parameter `include_site_level_resources.is` in `list_price_ramps` of `PriceRamp`. +- `updated_at`, `id`, and `status` have been added as new values to enum query parameter `sort_by.asc` in `list_price_ramps` of `PriceRamp`. +- `updated_at`, `id`, and `status` have been added as new values to enum query parameter `sort_by.desc` in `list_price_ramps` of `PriceRamp`. +- `active` and `archived` have been added as new values to enum request body parameter `status` in `update_a_price_ramp` of `PriceRamp`. + + + ### v4.27.0 (2026-09-24) * * * ### New Resources: diff --git a/VERSION b/VERSION index 02bb6671..ad94be36 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.27.0 +4.28.0 diff --git a/src/Actions/BusinessEntityActions.php b/src/Actions/BusinessEntityActions.php index 59cc9b1e..827bae6b 100644 --- a/src/Actions/BusinessEntityActions.php +++ b/src/Actions/BusinessEntityActions.php @@ -1,7 +1,11 @@ env = $env; } + /** + * @see https://apidocs.chargebee.com/docs/api/business_entities/retrieve-a-business-entity?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveBusinessEntityResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveBusinessEntityResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["business_entities",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("businessEntity") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveBusinessEntityResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_entities/update-business-entity?lang=php-v4 + * @param array{ + * name?: string, + * status?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateBusinessEntityResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params = [], array $headers = []): UpdateBusinessEntityResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_entities",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("businessEntity") + ->withTelemetryOperation("update") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateBusinessEntityResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_entities/list-business-entities?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * include_deleted?: bool, + * name?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * is_present?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListBusinessEntityResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListBusinessEntityResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["business_entities"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("businessEntity") + ->withTelemetryOperation("list") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListBusinessEntityResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_entities/create-a-business-entity?lang=php-v4 + * @param array{ + * name?: string, + * status?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateBusinessEntityResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreateBusinessEntityResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_entities"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("businessEntity") + ->withTelemetryOperation("create") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CreateBusinessEntityResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/business_entities/list-the-business-entity-transfers?lang=php-v4 * @param array{ diff --git a/src/Actions/CollectionsPaymentPromiseActions.php b/src/Actions/CollectionsPaymentPromiseActions.php new file mode 100644 index 00000000..02dbac35 --- /dev/null +++ b/src/Actions/CollectionsPaymentPromiseActions.php @@ -0,0 +1,222 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/collections_payment_promises/list-collections-payment-promises?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * customer_id?: array{ + * is?: mixed, + * }, + * invoice_id?: array{ + * is?: mixed, + * }, + * status?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listCollectionsPaymentPromises(array $params = [], array $headers = []): ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["collections_payment_promises"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("collectionsPaymentPromise") + ->withTelemetryOperation("listCollectionsPaymentPromises") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/collections_payment_promises/create-a-collections-payment-promise?lang=php-v4 + * @param array{ + * customer_id?: string, + * invoice_id?: string, + * amount?: int, + * currency_code?: string, + * promised_on?: int, + * reason?: string, + * promised_by?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function createCollectionsPaymentPromise(array $params, array $headers = []): CreateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["collections_payment_promises"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(false) + ->withTelemetryResource("collectionsPaymentPromise") + ->withTelemetryOperation("createCollectionsPaymentPromise") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CreateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/collections_payment_promises/cancel-a-collections-payment-promise?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return CancelCollectionsPaymentPromiseResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function cancel(string $id, array $headers = []): CancelCollectionsPaymentPromiseResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["collections_payment_promises",$id,"cancel"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(false) + ->withTelemetryResource("collectionsPaymentPromise") + ->withTelemetryOperation("cancel") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CancelCollectionsPaymentPromiseResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/collections_payment_promises/retrieve-a-payment-promise?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveCollectionsPaymentPromiseResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveCollectionsPaymentPromiseResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["collections_payment_promises",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("collectionsPaymentPromise") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveCollectionsPaymentPromiseResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/collections_payment_promises/update-a-collections-payment-promise?lang=php-v4 + * @param array{ + * promised_on?: int, + * reason?: string, + * promised_by?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateCollectionsPaymentPromise(string $id, array $params = [], array $headers = []): UpdateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["collections_payment_promises",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("collectionsPaymentPromise") + ->withTelemetryOperation("updateCollectionsPaymentPromise") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/BusinessEntityActionsInterface.php b/src/Actions/Contracts/BusinessEntityActionsInterface.php index 9e3a65e8..9940e83a 100644 --- a/src/Actions/Contracts/BusinessEntityActionsInterface.php +++ b/src/Actions/Contracts/BusinessEntityActionsInterface.php @@ -1,7 +1,11 @@ $headers + * @return RetrieveBusinessEntityResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveBusinessEntityResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_entities/update-business-entity?lang=php-v4 + * @param array{ + * name?: string, + * status?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateBusinessEntityResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params = [], array $headers = []): UpdateBusinessEntityResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_entities/list-business-entities?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * include_deleted?: bool, + * name?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * is_present?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListBusinessEntityResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListBusinessEntityResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_entities/create-a-business-entity?lang=php-v4 + * @param array{ + * name?: string, + * status?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateBusinessEntityResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreateBusinessEntityResponse; + /** * @see https://apidocs.chargebee.com/docs/api/business_entities/list-the-business-entity-transfers?lang=php-v4 * @param array{ diff --git a/src/Actions/Contracts/CollectionsPaymentPromiseActionsInterface.php b/src/Actions/Contracts/CollectionsPaymentPromiseActionsInterface.php new file mode 100644 index 00000000..448d2e89 --- /dev/null +++ b/src/Actions/Contracts/CollectionsPaymentPromiseActionsInterface.php @@ -0,0 +1,113 @@ + $headers + * @return ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listCollectionsPaymentPromises(array $params = [], array $headers = []): ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/collections_payment_promises/create-a-collections-payment-promise?lang=php-v4 + * @param array{ + * customer_id?: string, + * invoice_id?: string, + * amount?: int, + * currency_code?: string, + * promised_on?: int, + * reason?: string, + * promised_by?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function createCollectionsPaymentPromise(array $params, array $headers = []): CreateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/collections_payment_promises/cancel-a-collections-payment-promise?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return CancelCollectionsPaymentPromiseResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function cancel(string $id, array $headers = []): CancelCollectionsPaymentPromiseResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/collections_payment_promises/retrieve-a-payment-promise?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveCollectionsPaymentPromiseResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveCollectionsPaymentPromiseResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/collections_payment_promises/update-a-collections-payment-promise?lang=php-v4 + * @param array{ + * promised_on?: int, + * reason?: string, + * promised_by?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateCollectionsPaymentPromise(string $id, array $params = [], array $headers = []): UpdateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/CouponActionsInterface.php b/src/Actions/Contracts/CouponActionsInterface.php index 96c89dbb..79ac6006 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{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/CreditNoteActionsInterface.php b/src/Actions/Contracts/CreditNoteActionsInterface.php index cb11df85..98416913 100644 --- a/src/Actions/Contracts/CreditNoteActionsInterface.php +++ b/src/Actions/Contracts/CreditNoteActionsInterface.php @@ -144,6 +144,7 @@ public function recordRefund(string $id, array $params, array $headers = []): Re * currency_code?: string, * create_reason_code?: string, * date?: int, + * customer_notes?: string, * status?: string, * total?: int, * refunded_at?: int, diff --git a/src/Actions/Contracts/CreditUnitActionsInterface.php b/src/Actions/Contracts/CreditUnitActionsInterface.php index d787ad09..c421db6a 100644 --- a/src/Actions/Contracts/CreditUnitActionsInterface.php +++ b/src/Actions/Contracts/CreditUnitActionsInterface.php @@ -21,12 +21,12 @@ * limit?: int, * offset?: string, * status?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/CustomerActionsInterface.php b/src/Actions/Contracts/CustomerActionsInterface.php index b872abdb..f7e9e19b 100644 --- a/src/Actions/Contracts/CustomerActionsInterface.php +++ b/src/Actions/Contracts/CustomerActionsInterface.php @@ -37,22 +37,6 @@ Interface CustomerActionsInterface { - /** - * @see https://apidocs.chargebee.com/docs/api/customers/delete-a-customer?lang=php-v4 - * @param array{ - * delete_payment_method?: bool, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return DeleteCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function delete(string $id, array $params = [], array $headers = []): DeleteCustomerResponse; - /** * * @param array{ @@ -173,22 +157,6 @@ public function assignPaymentRole(string $id, array $params, array $headers = [] */ public function move(array $params, array $headers = []): MoveCustomerResponse; - /** - * @see https://apidocs.chargebee.com/docs/api/customers/get-hierarchy?lang=php-v4 - * @param array{ - * hierarchy_operation_type?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return HierarchyCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function hierarchy(string $id, array $params, array $headers = []): HierarchyCustomerResponse; - /** * @see https://apidocs.chargebee.com/docs/api/customers/update-payment-method-for-a-customer?lang=php-v4 * @param array{ @@ -213,101 +181,6 @@ public function hierarchy(string $id, array $params, array $headers = []): Hiera */ public function updatePaymentMethod(string $id, array $params, array $headers = []): UpdatePaymentMethodCustomerResponse; - /** - * @see https://apidocs.chargebee.com/docs/api/customers/retrieve-a-customer?lang=php-v4 - * - * @param string $id - * @param array $headers - * @return RetrieveCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function retrieve(string $id, array $headers = []): RetrieveCustomerResponse; - - /** - * @see https://apidocs.chargebee.com/docs/api/customers/update-a-customer?lang=php-v4 - * @param array{ - * tax_providers_fields?: array, - * first_name?: string, - * last_name?: string, - * email?: string, - * preferred_currency_code?: string, - * phone?: string, - * company?: string, - * auto_collection?: string, - * allow_direct_debit?: bool, - * net_term_days?: int, - * taxability?: string, - * exemption_details?: array, - * customer_type?: string, - * client_profile_id?: string, - * taxjar_exemption_category?: string, - * locale?: string, - * entity_code?: string, - * exempt_number?: string, - * offline_payment_method?: string, - * invoice_notes?: string, - * auto_close_invoices?: bool, - * meta_data?: mixed, - * fraud_flag?: string, - * consolidated_invoicing?: bool, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return UpdateCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function update(string $id, array $params = [], array $headers = []): UpdateCustomerResponse; - - /** - * @see https://apidocs.chargebee.com/docs/api/customers/list-hierarchy-details?lang=php-v4 - * @param array{ - * limit?: int, - * offset?: string, - * hierarchy_operation_type?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return ListHierarchyDetailCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function listHierarchyDetail(string $id, array $params, array $headers = []): ListHierarchyDetailCustomerResponse; - - /** - * @see https://apidocs.chargebee.com/docs/api/customers/change-billing-date?lang=php-v4 - * @param array{ - * billing_date?: int, - * billing_month?: int, - * billing_date_mode?: string, - * billing_day_of_week?: string, - * billing_day_of_week_mode?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return ChangeBillingDateCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function changeBillingDate(string $id, array $params = [], array $headers = []): ChangeBillingDateCustomerResponse; - /** * @see https://apidocs.chargebee.com/docs/api/customers/list-customers?lang=php-v4 * @param array{ @@ -561,32 +434,6 @@ public function all(array $params = [], array $headers = []): ListCustomerRespon */ public function create(array $params = [], array $headers = []): CreateCustomerResponse; - /** - * @see https://apidocs.chargebee.com/docs/api/customers/add-contacts-to-a-customer?lang=php-v4 - * @param array{ - * contact?: array{ - * id?: string, - * first_name?: string, - * last_name?: string, - * email?: string, - * phone?: string, - * label?: string, - * enabled?: bool, - * send_billing_email?: bool, - * send_account_email?: bool, - * }, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return AddContactCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function addContact(string $id, array $params, array $headers = []): AddContactCustomerResponse; - /** * @see https://apidocs.chargebee.com/docs/api/customers/list-of-contacts-for-a-customer?lang=php-v4 * @param array{ @@ -604,27 +451,6 @@ public function addContact(string $id, array $params, array $headers = []): AddC */ public function contactsForCustomer(string $id, array $params = [], array $headers = []): ContactsForCustomerCustomerResponse; - /** - * - * @param array{ - * amount?: int, - * currency_code?: string, - * description?: string, - * credit_type?: string, - * reference?: string, - * } $params Description of the parameters - * @param string $id - * @deprecated This method is deprecated and will be removed in a future version. - * @param array $headers - * @return DeductPromotionalCreditsCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function deductPromotionalCredits(string $id, array $params, array $headers = []): DeductPromotionalCreditsCustomerResponse; - /** * @see https://apidocs.chargebee.com/docs/api/customers/clear-personal-data-of-a-customer?lang=php-v4 * @@ -639,82 +465,6 @@ public function deductPromotionalCredits(string $id, array $params, array $heade */ public function clearPersonalData(string $id, array $headers = []): ClearPersonalDataCustomerResponse; - /** - * @see https://apidocs.chargebee.com/docs/api/customers/merge-customers?lang=php-v4 - * @param array{ - * from_customer_id?: string, - * to_customer_id?: string, - * } $params Description of the parameters - * - * @param array $headers - * @return MergeCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function merge(array $params, array $headers = []): MergeCustomerResponse; - - /** - * @see https://apidocs.chargebee.com/docs/api/customers/collect-payment-for-customer?lang=php-v4 - * @param array{ - * payment_method?: array{ - * type?: string, - * gateway_account_id?: string, - * reference_id?: string, - * tmp_token?: string, - * additional_information?: mixed, - * }, - * card?: array{ - * gateway_account_id?: string, - * first_name?: string, - * last_name?: string, - * number?: string, - * expiry_month?: int, - * expiry_year?: int, - * cvv?: string, - * preferred_scheme?: string, - * billing_addr1?: string, - * billing_addr2?: string, - * billing_city?: string, - * billing_state_code?: string, - * billing_state?: string, - * billing_zip?: string, - * billing_country?: string, - * additional_information?: mixed, - * }, - * payment_intent?: array{ - * id?: string, - * gateway_account_id?: string, - * gw_token?: string, - * payment_method_type?: string, - * gw_payment_method_id?: string, - * reference_id?: string, - * additional_information?: mixed, - * }, - * invoice_allocations?: array, - * amount?: int, - * payment_source_id?: string, - * token_id?: string, - * replace_primary_payment_source?: bool, - * retain_payment_source?: bool, - * payment_initiator?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return CollectPaymentCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function collectPayment(string $id, array $params, array $headers = []): CollectPaymentCustomerResponse; - /** * @see https://apidocs.chargebee.com/docs/api/customers/record-an-excess-payment-for-a-customer?lang=php-v4 * @param array{ @@ -776,33 +526,7 @@ public function sendPaymentRequest(string $id, array $headers = []): SendPayment public function setPromotionalCredits(string $id, array $params, array $headers = []): SetPromotionalCreditsCustomerResponse; /** - * @see https://apidocs.chargebee.com/docs/api/customers/update-contacts-for-a-customer?lang=php-v4 - * @param array{ - * contact?: array{ - * id?: string, - * first_name?: string, - * last_name?: string, - * email?: string, - * phone?: string, - * label?: string, - * enabled?: bool, - * send_billing_email?: bool, - * send_account_email?: bool, - * }, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return UpdateContactCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function updateContact(string $id, array $params, array $headers = []): UpdateContactCustomerResponse; - - /** - * @see https://apidocs.chargebee.com/docs/api/customers/update-hierarchy-access-settings-for-a-customer?lang=php-v4 + * @see https://apidocs.chargebee.com/docs/api/customers/update-hierarchy-access-settings-for-a-customer?lang=php-v4 * @param array{ * parent_account_access?: array{ * portal_edit_child_subscriptions?: string, @@ -882,5 +606,281 @@ public function updateHierarchySettings(string $id, array $params = [], array $h */ public function updateBillingInfo(string $id, array $params = [], array $headers = []): UpdateBillingInfoCustomerResponse; + /** + * @see https://apidocs.chargebee.com/docs/api/customers/delete-a-customer?lang=php-v4 + * @param array{ + * delete_payment_method?: bool, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return DeleteCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $params = [], array $headers = []): DeleteCustomerResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/get-hierarchy?lang=php-v4 + * @param array{ + * hierarchy_operation_type?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return HierarchyCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function hierarchy(string $id, array $params, array $headers = []): HierarchyCustomerResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/retrieve-a-customer?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveCustomerResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/update-a-customer?lang=php-v4 + * @param array{ + * tax_providers_fields?: array, + * first_name?: string, + * last_name?: string, + * email?: string, + * preferred_currency_code?: string, + * phone?: string, + * company?: string, + * auto_collection?: string, + * allow_direct_debit?: bool, + * net_term_days?: int, + * taxability?: string, + * exemption_details?: array, + * customer_type?: string, + * client_profile_id?: string, + * taxjar_exemption_category?: string, + * locale?: string, + * entity_code?: string, + * exempt_number?: string, + * offline_payment_method?: string, + * invoice_notes?: string, + * auto_close_invoices?: bool, + * meta_data?: mixed, + * fraud_flag?: string, + * consolidated_invoicing?: bool, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params = [], array $headers = []): UpdateCustomerResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/list-hierarchy-details?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * hierarchy_operation_type?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ListHierarchyDetailCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listHierarchyDetail(string $id, array $params, array $headers = []): ListHierarchyDetailCustomerResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/change-billing-date?lang=php-v4 + * @param array{ + * billing_date?: int, + * billing_month?: int, + * billing_date_mode?: string, + * billing_day_of_week?: string, + * billing_day_of_week_mode?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ChangeBillingDateCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function changeBillingDate(string $id, array $params = [], array $headers = []): ChangeBillingDateCustomerResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/add-contacts-to-a-customer?lang=php-v4 + * @param array{ + * contact?: array{ + * id?: string, + * first_name?: string, + * last_name?: string, + * email?: string, + * phone?: string, + * label?: string, + * enabled?: bool, + * send_billing_email?: bool, + * send_account_email?: bool, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return AddContactCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function addContact(string $id, array $params, array $headers = []): AddContactCustomerResponse; + + /** + * + * @param array{ + * amount?: int, + * currency_code?: string, + * description?: string, + * credit_type?: string, + * reference?: string, + * } $params Description of the parameters + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. + * @param array $headers + * @return DeductPromotionalCreditsCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function deductPromotionalCredits(string $id, array $params, array $headers = []): DeductPromotionalCreditsCustomerResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/merge-customers?lang=php-v4 + * @param array{ + * from_customer_id?: string, + * to_customer_id?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return MergeCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function merge(array $params, array $headers = []): MergeCustomerResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/collect-payment-for-customer?lang=php-v4 + * @param array{ + * payment_method?: array{ + * type?: string, + * gateway_account_id?: string, + * reference_id?: string, + * tmp_token?: string, + * additional_information?: mixed, + * }, + * card?: array{ + * gateway_account_id?: string, + * first_name?: string, + * last_name?: string, + * number?: string, + * expiry_month?: int, + * expiry_year?: int, + * cvv?: string, + * preferred_scheme?: string, + * billing_addr1?: string, + * billing_addr2?: string, + * billing_city?: string, + * billing_state_code?: string, + * billing_state?: string, + * billing_zip?: string, + * billing_country?: string, + * additional_information?: mixed, + * }, + * payment_intent?: array{ + * id?: string, + * gateway_account_id?: string, + * gw_token?: string, + * payment_method_type?: string, + * gw_payment_method_id?: string, + * reference_id?: string, + * additional_information?: mixed, + * }, + * invoice_allocations?: array, + * amount?: int, + * payment_source_id?: string, + * token_id?: string, + * replace_primary_payment_source?: bool, + * retain_payment_source?: bool, + * payment_initiator?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return CollectPaymentCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function collectPayment(string $id, array $params, array $headers = []): CollectPaymentCustomerResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/update-contacts-for-a-customer?lang=php-v4 + * @param array{ + * contact?: array{ + * id?: string, + * first_name?: string, + * last_name?: string, + * email?: string, + * phone?: string, + * label?: string, + * enabled?: bool, + * send_billing_email?: bool, + * send_account_email?: bool, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateContactCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateContact(string $id, array $params, array $headers = []): UpdateContactCustomerResponse; + } ?> \ No newline at end of file diff --git a/src/Actions/Contracts/EinvoiceActionsInterface.php b/src/Actions/Contracts/EinvoiceActionsInterface.php index 951b91fc..4e748b81 100644 --- a/src/Actions/Contracts/EinvoiceActionsInterface.php +++ b/src/Actions/Contracts/EinvoiceActionsInterface.php @@ -18,12 +18,12 @@ * limit?: int, * offset?: string, * id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * reference_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * updated_at?: array{ * after?: mixed, diff --git a/src/Actions/Contracts/EntitlementActionsInterface.php b/src/Actions/Contracts/EntitlementActionsInterface.php index 398ae8ba..a0f27658 100644 --- a/src/Actions/Contracts/EntitlementActionsInterface.php +++ b/src/Actions/Contracts/EntitlementActionsInterface.php @@ -18,16 +18,16 @@ * limit?: int, * offset?: string, * feature_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * entity_type?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * entity_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * include_drafts?: bool, * embed?: string, diff --git a/src/Actions/Contracts/ExportActionsInterface.php b/src/Actions/Contracts/ExportActionsInterface.php index 2c7b112c..d5abc4a0 100644 --- a/src/Actions/Contracts/ExportActionsInterface.php +++ b/src/Actions/Contracts/ExportActionsInterface.php @@ -332,12 +332,12 @@ public function transactions(array $params = [], array $headers = []): Transacti * @param array{ * ramp?: array{ * status?: array{ - * is?: string, - * in?: string, + * in?: string, + * is?: string, * }, * subscription_id?: array{ - * is?: string, - * in?: string, + * in?: string, + * is?: string, * }, * effective_from?: array{ * after?: string, @@ -434,8 +434,8 @@ public function differentialPrices(array $params = [], array $headers = []): Dif * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -641,8 +641,8 @@ public function retrieve(string $id, array $headers = []): RetrieveExportRespons * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -732,8 +732,8 @@ public function priceVariants(array $params = [], array $headers = []): PriceVar * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -1641,8 +1641,8 @@ public function creditNotes(array $params = [], array $headers = []): CreditNote * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * @@ -1901,8 +1901,8 @@ public function orders(array $params = [], array $headers = []): OrdersExportRes * not_in?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/InvoiceActionsInterface.php b/src/Actions/Contracts/InvoiceActionsInterface.php index 10f2fdda..6dcb14f6 100644 --- a/src/Actions/Contracts/InvoiceActionsInterface.php +++ b/src/Actions/Contracts/InvoiceActionsInterface.php @@ -40,6 +40,7 @@ use Chargebee\Responses\InvoiceResponse\ListPaymentReferenceNumbersInvoiceResponse; use Chargebee\Responses\InvoiceResponse\RemoveTaxWithheldInvoiceResponse; use Chargebee\Responses\InvoiceResponse\CreateForChargeItemInvoiceResponse; +use Chargebee\Responses\InvoiceResponse\RemovePaymentScheduleSchemeInvoiceResponse; use Chargebee\Responses\InvoiceResponse\RemoveCreditNoteInvoiceResponse; use Chargebee\Responses\InvoiceResponse\ImportInvoiceInvoiceResponse; use Chargebee\Responses\InvoiceResponse\RefundInvoiceResponse; @@ -1105,6 +1106,7 @@ public function delete(string $id, array $params = [], array $headers = []): Del * tax10_amount?: int, * is_partial_tax_applied?: bool, * taxable_amount?: int, + * tax_exempt_reason?: string, * proration_mode?: string, * created_at?: int, * }>, @@ -1280,13 +1282,13 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] * offset?: string, * payment_reference_number?: array{ * number?: array{ - * is?: string, - * in?: string, + * in?: string, + * is?: string, * }, * }, * id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * @@ -1300,6 +1302,22 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] */ public function listPaymentReferenceNumbers(array $params = [], array $headers = []): ListPaymentReferenceNumbersInvoiceResponse; + /** + * @see https://apidocs.chargebee.com/docs/api/invoices/remove-payment-schedule-scheme-from-an-invoice?lang=php-v4 + * @param array{ + * comment?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return RemovePaymentScheduleSchemeInvoiceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function removePaymentScheduleScheme(string $id, array $params = [], array $headers = []): RemovePaymentScheduleSchemeInvoiceResponse; + /** * @see https://apidocs.chargebee.com/docs/api/invoices/collect-payment-for-an-invoice?lang=php-v4 * @param array{ diff --git a/src/Actions/Contracts/ItemActionsInterface.php b/src/Actions/Contracts/ItemActionsInterface.php index be97d2d7..f150d119 100644 --- a/src/Actions/Contracts/ItemActionsInterface.php +++ b/src/Actions/Contracts/ItemActionsInterface.php @@ -96,8 +96,8 @@ * not_in?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/ItemFamilyActionsInterface.php b/src/Actions/Contracts/ItemFamilyActionsInterface.php index 281a920c..56bb02c2 100644 --- a/src/Actions/Contracts/ItemFamilyActionsInterface.php +++ b/src/Actions/Contracts/ItemFamilyActionsInterface.php @@ -53,8 +53,8 @@ public function delete(string $id, array $headers = []): DeleteItemFamilyRespons * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/ItemPriceActionsInterface.php b/src/Actions/Contracts/ItemPriceActionsInterface.php index 747fd076..80e86b7d 100644 --- a/src/Actions/Contracts/ItemPriceActionsInterface.php +++ b/src/Actions/Contracts/ItemPriceActionsInterface.php @@ -248,8 +248,8 @@ public function findApplicableItems(string $id, array $params = [], array $heade * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/LedgerAccountBalanceActionsInterface.php b/src/Actions/Contracts/LedgerAccountBalanceActionsInterface.php index 1ea14359..326e3b32 100644 --- a/src/Actions/Contracts/LedgerAccountBalanceActionsInterface.php +++ b/src/Actions/Contracts/LedgerAccountBalanceActionsInterface.php @@ -2,6 +2,7 @@ namespace Chargebee\Actions\Contracts; use Chargebee\Responses\LedgerAccountBalanceResponse\ListLedgerAccountBalancesLedgerAccountBalanceResponse; +use Chargebee\Responses\LedgerAccountBalanceResponse\UpdateOverdraftLimitLedgerAccountBalanceResponse; use Exception; use Chargebee\Exceptions\PaymentException; use Chargebee\Exceptions\OperationFailedException; @@ -11,6 +12,26 @@ Interface LedgerAccountBalanceActionsInterface { + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_account_balances/update-overdraft-limit?lang=php-v4 + * @param array{ + * subscription_id?: string, + * unit_id?: string, + * is_unlimited?: bool, + * limit?: string, + * change_reason?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return UpdateOverdraftLimitLedgerAccountBalanceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateOverdraftLimit(array $params, array $headers = []): UpdateOverdraftLimitLedgerAccountBalanceResponse; + /** * @see https://apidocs.chargebee.com/docs/api/ledger_account_balances/list-ledger-account-balances?lang=php-v4 * @param array{ diff --git a/src/Actions/Contracts/LedgerOperationActionsInterface.php b/src/Actions/Contracts/LedgerOperationActionsInterface.php index a146171d..a3b92ba6 100644 --- a/src/Actions/Contracts/LedgerOperationActionsInterface.php +++ b/src/Actions/Contracts/LedgerOperationActionsInterface.php @@ -119,8 +119,8 @@ public function authorize(array $params, array $headers = []): AuthorizeLedgerOp * between?: mixed, * }, * type?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php b/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php index 74ab758f..124b01c2 100644 --- a/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php +++ b/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php @@ -107,16 +107,16 @@ public function omnichannelTransactionsForOmnichannelSubscription(string $id, ar * not_in?: mixed, * }, * updated_at?: array{ - * after?: mixed, - * on?: mixed, - * before?: mixed, * between?: mixed, + * before?: mixed, + * on?: mixed, + * after?: mixed, * }, * purchased_at?: array{ - * after?: mixed, - * on?: mixed, - * before?: mixed, * between?: mixed, + * before?: mixed, + * on?: mixed, + * after?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/Contracts/PaymentSourceActionsInterface.php b/src/Actions/Contracts/PaymentSourceActionsInterface.php index 3782ca9a..9c7eedc6 100644 --- a/src/Actions/Contracts/PaymentSourceActionsInterface.php +++ b/src/Actions/Contracts/PaymentSourceActionsInterface.php @@ -38,6 +38,16 @@ * brand?: string, * funding_type?: string, * }, + * bank_account?: array{ + * account_type?: string, + * account_holder_type?: string, + * first_name?: string, + * last_name?: string, + * company?: string, + * scheme?: string, + * last4?: string, + * echeck_type?: string, + * }, * billing_address?: array{ * first_name?: string, * last_name?: string, diff --git a/src/Actions/Contracts/PriceRampActionsInterface.php b/src/Actions/Contracts/PriceRampActionsInterface.php new file mode 100644 index 00000000..9d73bfa5 --- /dev/null +++ b/src/Actions/Contracts/PriceRampActionsInterface.php @@ -0,0 +1,148 @@ + $headers + * @return ListPriceRampResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListPriceRampResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/price_ramps/create-a-price-ramp?lang=php-v4 + * @param array{ + * ramp_intervals?: array, + * item_price_id?: string, + * business_entity_id?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return CreatePriceRampResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreatePriceRampResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/price_ramps/delete-a-price-ramp?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeletePriceRampResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $headers = []): DeletePriceRampResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/price_ramps/retrieve-a-price-ramp?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrievePriceRampResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrievePriceRampResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/price_ramps/update-a-price-ramp?lang=php-v4 + * @param array{ + * ramp_intervals?: array, + * status?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdatePriceRampResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params, array $headers = []): UpdatePriceRampResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/PriceVariantActionsInterface.php b/src/Actions/Contracts/PriceVariantActionsInterface.php index b28c0e11..61a2947f 100644 --- a/src/Actions/Contracts/PriceVariantActionsInterface.php +++ b/src/Actions/Contracts/PriceVariantActionsInterface.php @@ -67,8 +67,8 @@ public function delete(string $id, array $headers = []): DeletePriceVariantRespo * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/PurchaseActionsInterface.php b/src/Actions/Contracts/PurchaseActionsInterface.php index 1a54f911..50b99937 100644 --- a/src/Actions/Contracts/PurchaseActionsInterface.php +++ b/src/Actions/Contracts/PurchaseActionsInterface.php @@ -42,6 +42,7 @@ * unit_amount?: int, * unit_amount_in_decimal?: string, * quantity_in_decimal?: string, + * trial_end?: int, * }>, * item_tiers?: array, * contract_terms?: array, * item_tiers?: array, * contract_terms?: array, * items_to_update?: array, * item_tiers?: array, * items_to_update?: array, * item_tiers?: array $headers + * @return RetrieveRetrySegmentResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $params = [], array $headers = []): RetrieveRetrySegmentResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/UsageActionsInterface.php b/src/Actions/Contracts/UsageActionsInterface.php index bf6c6c65..8b250e48 100644 --- a/src/Actions/Contracts/UsageActionsInterface.php +++ b/src/Actions/Contracts/UsageActionsInterface.php @@ -21,7 +21,11 @@ * invoice?: array{ * id?: string, * }, - * disposition_type?: string, + * group_by?: array, + * disposition_type?: string, * } $params Description of the parameters * * @param array $headers diff --git a/src/Actions/Contracts/UsageSummaryActionsInterface.php b/src/Actions/Contracts/UsageSummaryActionsInterface.php index d006558b..19797bc4 100644 --- a/src/Actions/Contracts/UsageSummaryActionsInterface.php +++ b/src/Actions/Contracts/UsageSummaryActionsInterface.php @@ -20,7 +20,8 @@ * window_size?: string, * timeframe_start?: int, * timeframe_end?: int, - * } $params Description of the parameters + * group_by?: array, + * } $params Description of the parameters * @param string $id * @param array $headers * @return RetrieveUsageSummaryForSubscriptionUsageSummaryResponse diff --git a/src/Actions/CouponActions.php b/src/Actions/CouponActions.php index 75e7d556..6bdeda1a 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{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/CreditNoteActions.php b/src/Actions/CreditNoteActions.php index 0ad51336..b5665984 100644 --- a/src/Actions/CreditNoteActions.php +++ b/src/Actions/CreditNoteActions.php @@ -177,6 +177,7 @@ public function recordRefund(string $id, array $params, array $headers = []): Re * currency_code?: string, * create_reason_code?: string, * date?: int, + * customer_notes?: string, * status?: string, * total?: int, * refunded_at?: int, diff --git a/src/Actions/CreditUnitActions.php b/src/Actions/CreditUnitActions.php index 5a78f9ff..0220eb0e 100644 --- a/src/Actions/CreditUnitActions.php +++ b/src/Actions/CreditUnitActions.php @@ -34,12 +34,12 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * limit?: int, * offset?: string, * status?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/CustomerActions.php b/src/Actions/CustomerActions.php index dbe63185..8231cc9a 100644 --- a/src/Actions/CustomerActions.php +++ b/src/Actions/CustomerActions.php @@ -50,42 +50,6 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e $this->env = $env; } - /** - * @see https://apidocs.chargebee.com/docs/api/customers/delete-a-customer?lang=php-v4 - * @param array{ - * delete_payment_method?: bool, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return DeleteCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function delete(string $id, array $params = [], array $headers = []): DeleteCustomerResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("post") - ->withUriPaths(["customers",$id,"delete"]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withIdempotent(true) - ->withTelemetryResource("customer") - ->withTelemetryOperation("delete") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return DeleteCustomerResponse::from($respObject->data, $respObject->headers); - } - /** * @see https://apidocs.chargebee.com/docs/api/customers/add-promotional-credits-to-a-customer?lang=php-v4 * @param array{ @@ -325,41 +289,6 @@ public function move(array $params, array $headers = []): MoveCustomerResponse return MoveCustomerResponse::from($respObject->data, $respObject->headers); } - /** - * @see https://apidocs.chargebee.com/docs/api/customers/get-hierarchy?lang=php-v4 - * @param array{ - * hierarchy_operation_type?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return HierarchyCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function hierarchy(string $id, array $params, array $headers = []): HierarchyCustomerResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("get") - ->withUriPaths(["customers",$id,"hierarchy"]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withTelemetryResource("customer") - ->withTelemetryOperation("hierarchy") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return HierarchyCustomerResponse::from($respObject->data, $respObject->headers); - } - /** * @see https://apidocs.chargebee.com/docs/api/customers/update-payment-method-for-a-customer?lang=php-v4 * @param array{ @@ -405,180 +334,6 @@ public function updatePaymentMethod(string $id, array $params, array $headers = return UpdatePaymentMethodCustomerResponse::from($respObject->data, $respObject->headers); } - /** - * @see https://apidocs.chargebee.com/docs/api/customers/retrieve-a-customer?lang=php-v4 - * - * @param string $id - * @param array $headers - * @return RetrieveCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function retrieve(string $id, array $headers = []): RetrieveCustomerResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("get") - ->withUriPaths(["customers",$id]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withTelemetryResource("customer") - ->withTelemetryOperation("retrieve") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return RetrieveCustomerResponse::from($respObject->data, $respObject->headers); - } - - /** - * @see https://apidocs.chargebee.com/docs/api/customers/update-a-customer?lang=php-v4 - * @param array{ - * tax_providers_fields?: array, - * first_name?: string, - * last_name?: string, - * email?: string, - * preferred_currency_code?: string, - * phone?: string, - * company?: string, - * auto_collection?: string, - * allow_direct_debit?: bool, - * net_term_days?: int, - * taxability?: string, - * exemption_details?: array, - * customer_type?: string, - * client_profile_id?: string, - * taxjar_exemption_category?: string, - * locale?: string, - * entity_code?: string, - * exempt_number?: string, - * offline_payment_method?: string, - * invoice_notes?: string, - * auto_close_invoices?: bool, - * meta_data?: mixed, - * fraud_flag?: string, - * consolidated_invoicing?: bool, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return UpdateCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function update(string $id, array $params = [], array $headers = []): UpdateCustomerResponse - { - $jsonKeys = [ - "exemptionDetails" => 0, - "metaData" => 0, - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("post") - ->withUriPaths(["customers",$id]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withIdempotent(true) - ->withTelemetryResource("customer") - ->withTelemetryOperation("update") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return UpdateCustomerResponse::from($respObject->data, $respObject->headers); - } - - /** - * @see https://apidocs.chargebee.com/docs/api/customers/list-hierarchy-details?lang=php-v4 - * @param array{ - * limit?: int, - * offset?: string, - * hierarchy_operation_type?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return ListHierarchyDetailCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function listHierarchyDetail(string $id, array $params, array $headers = []): ListHierarchyDetailCustomerResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("get") - ->withUriPaths(["customers",$id,"hierarchy_detail"]) - ->withParamEncoder(new ListParamEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withTelemetryResource("customer") - ->withTelemetryOperation("listHierarchyDetail") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return ListHierarchyDetailCustomerResponse::from($respObject->data, $respObject->headers); - } - - /** - * @see https://apidocs.chargebee.com/docs/api/customers/change-billing-date?lang=php-v4 - * @param array{ - * billing_date?: int, - * billing_month?: int, - * billing_date_mode?: string, - * billing_day_of_week?: string, - * billing_day_of_week_mode?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return ChangeBillingDateCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function changeBillingDate(string $id, array $params = [], array $headers = []): ChangeBillingDateCustomerResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("post") - ->withUriPaths(["customers",$id,"change_billing_date"]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withIdempotent(true) - ->withTelemetryResource("customer") - ->withTelemetryOperation("changeBillingDate") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return ChangeBillingDateCustomerResponse::from($respObject->data, $respObject->headers); - } - /** * @see https://apidocs.chargebee.com/docs/api/customers/list-customers?lang=php-v4 * @param array{ @@ -876,53 +631,7 @@ public function create(array $params = [], array $headers = []): CreateCustomerR } /** - * @see https://apidocs.chargebee.com/docs/api/customers/add-contacts-to-a-customer?lang=php-v4 - * @param array{ - * contact?: array{ - * id?: string, - * first_name?: string, - * last_name?: string, - * email?: string, - * phone?: string, - * label?: string, - * enabled?: bool, - * send_billing_email?: bool, - * send_account_email?: bool, - * }, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return AddContactCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function addContact(string $id, array $params, array $headers = []): AddContactCustomerResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("post") - ->withUriPaths(["customers",$id,"add_contact"]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withIdempotent(true) - ->withTelemetryResource("customer") - ->withTelemetryOperation("addContact") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return AddContactCustomerResponse::from($respObject->data, $respObject->headers); - } - - /** - * @see https://apidocs.chargebee.com/docs/api/customers/list-of-contacts-for-a-customer?lang=php-v4 + * @see https://apidocs.chargebee.com/docs/api/customers/list-of-contacts-for-a-customer?lang=php-v4 * @param array{ * limit?: int, * offset?: string, @@ -957,47 +666,6 @@ public function contactsForCustomer(string $id, array $params = [], array $heade return ContactsForCustomerCustomerResponse::from($respObject->data, $respObject->headers); } - /** - * @see https://apidocs.chargebee.com/docs/api/customers/deduct-promotional-credits-for-a-customer?lang=php-v4 - * @param array{ - * amount?: int, - * currency_code?: string, - * description?: string, - * credit_type?: string, - * reference?: string, - * } $params Description of the parameters - * @param string $id - * @deprecated This method is deprecated and will be removed in a future version. - * @param array $headers - * @return DeductPromotionalCreditsCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function deductPromotionalCredits(string $id, array $params, array $headers = []): DeductPromotionalCreditsCustomerResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("post") - ->withUriPaths(["customers",$id,"deduct_promotional_credits"]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withIdempotent(true) - ->withTelemetryResource("customer") - ->withTelemetryOperation("deductPromotionalCredits") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return DeductPromotionalCreditsCustomerResponse::from($respObject->data, $respObject->headers); - } - /** * @see https://apidocs.chargebee.com/docs/api/customers/clear-personal-data-of-a-customer?lang=php-v4 * @@ -1031,123 +699,6 @@ public function clearPersonalData(string $id, array $headers = []): ClearPersona return ClearPersonalDataCustomerResponse::from($respObject->data, $respObject->headers); } - /** - * @see https://apidocs.chargebee.com/docs/api/customers/merge-customers?lang=php-v4 - * @param array{ - * from_customer_id?: string, - * to_customer_id?: string, - * } $params Description of the parameters - * - * @param array $headers - * @return MergeCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function merge(array $params, array $headers = []): MergeCustomerResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("post") - ->withUriPaths(["customers","merge"]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withIdempotent(true) - ->withTelemetryResource("customer") - ->withTelemetryOperation("merge") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return MergeCustomerResponse::from($respObject->data, $respObject->headers); - } - - /** - * @see https://apidocs.chargebee.com/docs/api/customers/collect-payment-for-customer?lang=php-v4 - * @param array{ - * payment_method?: array{ - * type?: string, - * gateway_account_id?: string, - * reference_id?: string, - * tmp_token?: string, - * additional_information?: mixed, - * }, - * card?: array{ - * gateway_account_id?: string, - * first_name?: string, - * last_name?: string, - * number?: string, - * expiry_month?: int, - * expiry_year?: int, - * cvv?: string, - * preferred_scheme?: string, - * billing_addr1?: string, - * billing_addr2?: string, - * billing_city?: string, - * billing_state_code?: string, - * billing_state?: string, - * billing_zip?: string, - * billing_country?: string, - * additional_information?: mixed, - * }, - * payment_intent?: array{ - * id?: string, - * gateway_account_id?: string, - * gw_token?: string, - * payment_method_type?: string, - * gw_payment_method_id?: string, - * reference_id?: string, - * additional_information?: mixed, - * }, - * invoice_allocations?: array, - * amount?: int, - * payment_source_id?: string, - * token_id?: string, - * replace_primary_payment_source?: bool, - * retain_payment_source?: bool, - * payment_initiator?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return CollectPaymentCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function collectPayment(string $id, array $params, array $headers = []): CollectPaymentCustomerResponse - { - $jsonKeys = [ - "additionalInformation" => 1, - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("post") - ->withUriPaths(["customers",$id,"collect_payment"]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withIdempotent(true) - ->withTelemetryResource("customer") - ->withTelemetryOperation("collectPayment") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return CollectPaymentCustomerResponse::from($respObject->data, $respObject->headers); - } - /** * @see https://apidocs.chargebee.com/docs/api/customers/record-an-excess-payment-for-a-customer?lang=php-v4 * @param array{ @@ -1267,52 +818,6 @@ public function setPromotionalCredits(string $id, array $params, array $headers return SetPromotionalCreditsCustomerResponse::from($respObject->data, $respObject->headers); } - /** - * @see https://apidocs.chargebee.com/docs/api/customers/update-contacts-for-a-customer?lang=php-v4 - * @param array{ - * contact?: array{ - * id?: string, - * first_name?: string, - * last_name?: string, - * email?: string, - * phone?: string, - * label?: string, - * enabled?: bool, - * send_billing_email?: bool, - * send_account_email?: bool, - * }, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return UpdateContactCustomerResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function updateContact(string $id, array $params, array $headers = []): UpdateContactCustomerResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("post") - ->withUriPaths(["customers",$id,"update_contact"]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withIdempotent(true) - ->withTelemetryResource("customer") - ->withTelemetryOperation("updateContact") - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return UpdateContactCustomerResponse::from($respObject->data, $respObject->headers); - } - /** * @see https://apidocs.chargebee.com/docs/api/customers/update-hierarchy-access-settings-for-a-customer?lang=php-v4 * @param array{ @@ -1434,5 +939,500 @@ public function updateBillingInfo(string $id, array $params = [], array $headers return UpdateBillingInfoCustomerResponse::from($respObject->data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/customers/delete-a-customer?lang=php-v4 + * @param array{ + * delete_payment_method?: bool, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return DeleteCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $params = [], array $headers = []): DeleteCustomerResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["customers",$id,"delete"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("customer") + ->withTelemetryOperation("delete") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return DeleteCustomerResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/get-hierarchy?lang=php-v4 + * @param array{ + * hierarchy_operation_type?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return HierarchyCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function hierarchy(string $id, array $params, array $headers = []): HierarchyCustomerResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["customers",$id,"hierarchy"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("customer") + ->withTelemetryOperation("hierarchy") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return HierarchyCustomerResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/retrieve-a-customer?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveCustomerResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["customers",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("customer") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveCustomerResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/update-a-customer?lang=php-v4 + * @param array{ + * tax_providers_fields?: array, + * first_name?: string, + * last_name?: string, + * email?: string, + * preferred_currency_code?: string, + * phone?: string, + * company?: string, + * auto_collection?: string, + * allow_direct_debit?: bool, + * net_term_days?: int, + * taxability?: string, + * exemption_details?: array, + * customer_type?: string, + * client_profile_id?: string, + * taxjar_exemption_category?: string, + * locale?: string, + * entity_code?: string, + * exempt_number?: string, + * offline_payment_method?: string, + * invoice_notes?: string, + * auto_close_invoices?: bool, + * meta_data?: mixed, + * fraud_flag?: string, + * consolidated_invoicing?: bool, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params = [], array $headers = []): UpdateCustomerResponse + { + $jsonKeys = [ + "exemptionDetails" => 0, + "metaData" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["customers",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("customer") + ->withTelemetryOperation("update") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateCustomerResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/list-hierarchy-details?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * hierarchy_operation_type?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ListHierarchyDetailCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listHierarchyDetail(string $id, array $params, array $headers = []): ListHierarchyDetailCustomerResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["customers",$id,"hierarchy_detail"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("customer") + ->withTelemetryOperation("listHierarchyDetail") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListHierarchyDetailCustomerResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/change-billing-date?lang=php-v4 + * @param array{ + * billing_date?: int, + * billing_month?: int, + * billing_date_mode?: string, + * billing_day_of_week?: string, + * billing_day_of_week_mode?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ChangeBillingDateCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function changeBillingDate(string $id, array $params = [], array $headers = []): ChangeBillingDateCustomerResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["customers",$id,"change_billing_date"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("customer") + ->withTelemetryOperation("changeBillingDate") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ChangeBillingDateCustomerResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/add-contacts-to-a-customer?lang=php-v4 + * @param array{ + * contact?: array{ + * id?: string, + * first_name?: string, + * last_name?: string, + * email?: string, + * phone?: string, + * label?: string, + * enabled?: bool, + * send_billing_email?: bool, + * send_account_email?: bool, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return AddContactCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function addContact(string $id, array $params, array $headers = []): AddContactCustomerResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["customers",$id,"add_contact"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("customer") + ->withTelemetryOperation("addContact") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return AddContactCustomerResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/deduct-promotional-credits-for-a-customer?lang=php-v4 + * @param array{ + * amount?: int, + * currency_code?: string, + * description?: string, + * credit_type?: string, + * reference?: string, + * } $params Description of the parameters + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. + * @param array $headers + * @return DeductPromotionalCreditsCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function deductPromotionalCredits(string $id, array $params, array $headers = []): DeductPromotionalCreditsCustomerResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["customers",$id,"deduct_promotional_credits"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("customer") + ->withTelemetryOperation("deductPromotionalCredits") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return DeductPromotionalCreditsCustomerResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/merge-customers?lang=php-v4 + * @param array{ + * from_customer_id?: string, + * to_customer_id?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return MergeCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function merge(array $params, array $headers = []): MergeCustomerResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["customers","merge"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("customer") + ->withTelemetryOperation("merge") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return MergeCustomerResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/collect-payment-for-customer?lang=php-v4 + * @param array{ + * payment_method?: array{ + * type?: string, + * gateway_account_id?: string, + * reference_id?: string, + * tmp_token?: string, + * additional_information?: mixed, + * }, + * card?: array{ + * gateway_account_id?: string, + * first_name?: string, + * last_name?: string, + * number?: string, + * expiry_month?: int, + * expiry_year?: int, + * cvv?: string, + * preferred_scheme?: string, + * billing_addr1?: string, + * billing_addr2?: string, + * billing_city?: string, + * billing_state_code?: string, + * billing_state?: string, + * billing_zip?: string, + * billing_country?: string, + * additional_information?: mixed, + * }, + * payment_intent?: array{ + * id?: string, + * gateway_account_id?: string, + * gw_token?: string, + * payment_method_type?: string, + * gw_payment_method_id?: string, + * reference_id?: string, + * additional_information?: mixed, + * }, + * invoice_allocations?: array, + * amount?: int, + * payment_source_id?: string, + * token_id?: string, + * replace_primary_payment_source?: bool, + * retain_payment_source?: bool, + * payment_initiator?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return CollectPaymentCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function collectPayment(string $id, array $params, array $headers = []): CollectPaymentCustomerResponse + { + $jsonKeys = [ + "additionalInformation" => 1, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["customers",$id,"collect_payment"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("customer") + ->withTelemetryOperation("collectPayment") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CollectPaymentCustomerResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/customers/update-contacts-for-a-customer?lang=php-v4 + * @param array{ + * contact?: array{ + * id?: string, + * first_name?: string, + * last_name?: string, + * email?: string, + * phone?: string, + * label?: string, + * enabled?: bool, + * send_billing_email?: bool, + * send_account_email?: bool, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateContactCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateContact(string $id, array $params, array $headers = []): UpdateContactCustomerResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["customers",$id,"update_contact"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("customer") + ->withTelemetryOperation("updateContact") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateContactCustomerResponse::from($respObject->data, $respObject->headers); + } + } ?> \ No newline at end of file diff --git a/src/Actions/EinvoiceActions.php b/src/Actions/EinvoiceActions.php index d94095bc..19b5cd03 100644 --- a/src/Actions/EinvoiceActions.php +++ b/src/Actions/EinvoiceActions.php @@ -31,12 +31,12 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * limit?: int, * offset?: string, * id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * reference_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * updated_at?: array{ * after?: mixed, diff --git a/src/Actions/EntitlementActions.php b/src/Actions/EntitlementActions.php index ac18aadc..d83d96c2 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{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * entity_type?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * entity_id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * include_drafts?: bool, * embed?: string, diff --git a/src/Actions/ExportActions.php b/src/Actions/ExportActions.php index 16baac05..6bcf6a89 100644 --- a/src/Actions/ExportActions.php +++ b/src/Actions/ExportActions.php @@ -404,12 +404,12 @@ public function transactions(array $params = [], array $headers = []): Transacti * @param array{ * ramp?: array{ * status?: array{ - * is?: string, - * in?: string, + * in?: string, + * is?: string, * }, * subscription_id?: array{ - * is?: string, - * in?: string, + * in?: string, + * is?: string, * }, * effective_from?: array{ * after?: string, @@ -546,8 +546,8 @@ public function differentialPrices(array $params = [], array $headers = []): Dif * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -811,8 +811,8 @@ public function retrieve(string $id, array $headers = []): RetrieveExportRespons * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -922,8 +922,8 @@ public function priceVariants(array $params = [], array $headers = []): PriceVar * }, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, @@ -1911,8 +1911,8 @@ public function creditNotes(array $params = [], array $headers = []): CreditNote * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * @@ -2211,8 +2211,8 @@ public function orders(array $params = [], array $headers = []): OrdersExportRes * not_in?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/InvoiceActions.php b/src/Actions/InvoiceActions.php index 15418629..7a9d92b5 100644 --- a/src/Actions/InvoiceActions.php +++ b/src/Actions/InvoiceActions.php @@ -42,6 +42,7 @@ use Chargebee\Responses\InvoiceResponse\ListPaymentReferenceNumbersInvoiceResponse; use Chargebee\Responses\InvoiceResponse\RemoveTaxWithheldInvoiceResponse; use Chargebee\Responses\InvoiceResponse\CreateForChargeItemInvoiceResponse; +use Chargebee\Responses\InvoiceResponse\RemovePaymentScheduleSchemeInvoiceResponse; use Chargebee\Responses\InvoiceResponse\RemoveCreditNoteInvoiceResponse; use Chargebee\Responses\InvoiceResponse\ImportInvoiceInvoiceResponse; use Chargebee\Responses\InvoiceResponse\RefundInvoiceResponse; @@ -1635,6 +1636,7 @@ public function delete(string $id, array $params = [], array $headers = []): Del * tax10_amount?: int, * is_partial_tax_applied?: bool, * taxable_amount?: int, + * tax_exempt_reason?: string, * proration_mode?: string, * created_at?: int, * }>, @@ -1909,13 +1911,13 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] * offset?: string, * payment_reference_number?: array{ * number?: array{ - * is?: string, - * in?: string, + * in?: string, + * is?: string, * }, * }, * id?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * } $params Description of the parameters * @@ -1948,6 +1950,42 @@ public function listPaymentReferenceNumbers(array $params = [], array $headers = return ListPaymentReferenceNumbersInvoiceResponse::from($respObject->data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/invoices/remove-payment-schedule-scheme-from-an-invoice?lang=php-v4 + * @param array{ + * comment?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return RemovePaymentScheduleSchemeInvoiceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function removePaymentScheduleScheme(string $id, array $params = [], array $headers = []): RemovePaymentScheduleSchemeInvoiceResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["invoices",$id,"remove_payment_schedule_scheme"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("invoice") + ->withTelemetryOperation("removePaymentScheduleScheme") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RemovePaymentScheduleSchemeInvoiceResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/invoices/collect-payment-for-an-invoice?lang=php-v4 * @param array{ diff --git a/src/Actions/ItemActions.php b/src/Actions/ItemActions.php index 2e459e5a..9a2821db 100644 --- a/src/Actions/ItemActions.php +++ b/src/Actions/ItemActions.php @@ -109,8 +109,8 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * not_in?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/ItemFamilyActions.php b/src/Actions/ItemFamilyActions.php index b2f019e0..7619d591 100644 --- a/src/Actions/ItemFamilyActions.php +++ b/src/Actions/ItemFamilyActions.php @@ -85,8 +85,8 @@ public function delete(string $id, array $headers = []): DeleteItemFamilyRespons * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/ItemPriceActions.php b/src/Actions/ItemPriceActions.php index f563f943..0195f4c2 100644 --- a/src/Actions/ItemPriceActions.php +++ b/src/Actions/ItemPriceActions.php @@ -357,8 +357,8 @@ public function findApplicableItems(string $id, array $params = [], array $heade * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/LedgerAccountBalanceActions.php b/src/Actions/LedgerAccountBalanceActions.php index 9a17dc6e..fff9456b 100644 --- a/src/Actions/LedgerAccountBalanceActions.php +++ b/src/Actions/LedgerAccountBalanceActions.php @@ -3,6 +3,7 @@ use Chargebee\Responses\LedgerAccountBalanceResponse\ListLedgerAccountBalancesLedgerAccountBalanceResponse; use Chargebee\Actions\Contracts\LedgerAccountBalanceActionsInterface; +use Chargebee\Responses\LedgerAccountBalanceResponse\UpdateOverdraftLimitLedgerAccountBalanceResponse; use Chargebee\ValueObjects\Encoders\ListParamEncoder; use Chargebee\ValueObjects\Encoders\URLFormEncoder; use Chargebee\ValueObjects\Transporters\ChargebeePayload; @@ -24,6 +25,46 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e $this->env = $env; } + /** + * @see https://apidocs.chargebee.com/docs/api/ledger_account_balances/update-overdraft-limit?lang=php-v4 + * @param array{ + * subscription_id?: string, + * unit_id?: string, + * is_unlimited?: bool, + * limit?: string, + * change_reason?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return UpdateOverdraftLimitLedgerAccountBalanceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateOverdraftLimit(array $params, array $headers = []): UpdateOverdraftLimitLedgerAccountBalanceResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["ledger_account_balances","update_overdraft_limit"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(false) + ->withTelemetryResource("ledgerAccountBalance") + ->withTelemetryOperation("updateOverdraftLimit") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateOverdraftLimitLedgerAccountBalanceResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/ledger_account_balances/list-ledger-account-balances?lang=php-v4 * @param array{ diff --git a/src/Actions/LedgerOperationActions.php b/src/Actions/LedgerOperationActions.php index ca1fcfd4..3f42ac63 100644 --- a/src/Actions/LedgerOperationActions.php +++ b/src/Actions/LedgerOperationActions.php @@ -221,8 +221,8 @@ public function authorize(array $params, array $headers = []): AuthorizeLedgerOp * between?: mixed, * }, * type?: array{ - * is?: mixed, * in?: mixed, + * is?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/OmnichannelSubscriptionActions.php b/src/Actions/OmnichannelSubscriptionActions.php index 336c4a6e..1d86c810 100644 --- a/src/Actions/OmnichannelSubscriptionActions.php +++ b/src/Actions/OmnichannelSubscriptionActions.php @@ -177,16 +177,16 @@ public function omnichannelTransactionsForOmnichannelSubscription(string $id, ar * not_in?: mixed, * }, * updated_at?: array{ - * after?: mixed, - * on?: mixed, - * before?: mixed, * between?: mixed, + * before?: mixed, + * on?: mixed, + * after?: mixed, * }, * purchased_at?: array{ - * after?: mixed, - * on?: mixed, - * before?: mixed, * between?: mixed, + * before?: mixed, + * on?: mixed, + * after?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/PaymentSourceActions.php b/src/Actions/PaymentSourceActions.php index e5c0bd06..2d205a01 100644 --- a/src/Actions/PaymentSourceActions.php +++ b/src/Actions/PaymentSourceActions.php @@ -51,6 +51,16 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * brand?: string, * funding_type?: string, * }, + * bank_account?: array{ + * account_type?: string, + * account_holder_type?: string, + * first_name?: string, + * last_name?: string, + * company?: string, + * scheme?: string, + * last4?: string, + * echeck_type?: string, + * }, * billing_address?: array{ * first_name?: string, * last_name?: string, diff --git a/src/Actions/PriceRampActions.php b/src/Actions/PriceRampActions.php new file mode 100644 index 00000000..4711fb12 --- /dev/null +++ b/src/Actions/PriceRampActions.php @@ -0,0 +1,257 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/price_ramps/list-price-ramps?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * item_price_id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * status?: array{ + * is?: mixed, + * is_not?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * updated_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * business_entity_id?: array{ + * is_present?: mixed, + * is?: mixed, + * }, + * include_site_level_resources?: array{ + * is?: mixed, + * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListPriceRampResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListPriceRampResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["price_ramps"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("priceRamp") + ->withTelemetryOperation("list") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListPriceRampResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/price_ramps/create-a-price-ramp?lang=php-v4 + * @param array{ + * ramp_intervals?: array, + * item_price_id?: string, + * business_entity_id?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return CreatePriceRampResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreatePriceRampResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["price_ramps"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("priceRamp") + ->withTelemetryOperation("create") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CreatePriceRampResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/price_ramps/delete-a-price-ramp?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeletePriceRampResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $headers = []): DeletePriceRampResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["price_ramps",$id,"delete"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("priceRamp") + ->withTelemetryOperation("delete") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return DeletePriceRampResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/price_ramps/retrieve-a-price-ramp?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrievePriceRampResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrievePriceRampResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["price_ramps",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("priceRamp") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrievePriceRampResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/price_ramps/update-a-price-ramp?lang=php-v4 + * @param array{ + * ramp_intervals?: array, + * status?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdatePriceRampResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params, array $headers = []): UpdatePriceRampResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["price_ramps",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("priceRamp") + ->withTelemetryOperation("update") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdatePriceRampResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/PriceVariantActions.php b/src/Actions/PriceVariantActions.php index b3715575..c89292c8 100644 --- a/src/Actions/PriceVariantActions.php +++ b/src/Actions/PriceVariantActions.php @@ -99,8 +99,8 @@ public function delete(string $id, array $headers = []): DeletePriceVariantRespo * between?: mixed, * }, * business_entity_id?: array{ - * is?: mixed, * is_present?: mixed, + * is?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/PurchaseActions.php b/src/Actions/PurchaseActions.php index 5bcea696..9b6dd031 100644 --- a/src/Actions/PurchaseActions.php +++ b/src/Actions/PurchaseActions.php @@ -54,6 +54,7 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * unit_amount?: int, * unit_amount_in_decimal?: string, * quantity_in_decimal?: string, + * trial_end?: int, * }>, * item_tiers?: array, * contract_terms?: array, * item_tiers?: array, * contract_terms?: array, * items_to_update?: array, * item_tiers?: array, * items_to_update?: array, * item_tiers?: arrayhttpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/retry_segments/retrieve-a-retry-segment?lang=php-v4 + * @param array{ + * invoice_id?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return RetrieveRetrySegmentResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $params = [], array $headers = []): RetrieveRetrySegmentResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["retry_segments",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("retrySegment") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveRetrySegmentResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/UsageActions.php b/src/Actions/UsageActions.php index 7d9a7ba5..9a674f6d 100644 --- a/src/Actions/UsageActions.php +++ b/src/Actions/UsageActions.php @@ -34,7 +34,11 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * invoice?: array{ * id?: string, * }, - * disposition_type?: string, + * group_by?: array, + * disposition_type?: string, * } $params Description of the parameters * * @param array $headers @@ -48,6 +52,7 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e public function pdf(array $params, array $headers = []): PdfUsageResponse { $jsonKeys = [ + "attributes" => 1, ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) diff --git a/src/Actions/UsageSummaryActions.php b/src/Actions/UsageSummaryActions.php index 2e2fab6a..a705033a 100644 --- a/src/Actions/UsageSummaryActions.php +++ b/src/Actions/UsageSummaryActions.php @@ -33,7 +33,8 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * window_size?: string, * timeframe_start?: int, * timeframe_end?: int, - * } $params Description of the parameters + * group_by?: array, + * } $params Description of the parameters * @param string $id * @param array $headers * @return RetrieveUsageSummaryForSubscriptionUsageSummaryResponse diff --git a/src/ChargebeeClient.php b/src/ChargebeeClient.php index 1b8f415e..f1bf3ebc 100644 --- a/src/ChargebeeClient.php +++ b/src/ChargebeeClient.php @@ -18,6 +18,8 @@ use Chargebee\Actions\BusinessRulesetActions; use Chargebee\Actions\Contracts\CardActionsInterface; use Chargebee\Actions\CardActions; +use Chargebee\Actions\Contracts\CollectionsPaymentPromiseActionsInterface; +use Chargebee\Actions\CollectionsPaymentPromiseActions; use Chargebee\Actions\Contracts\CommentActionsInterface; use Chargebee\Actions\CommentActions; use Chargebee\Actions\Contracts\ConfigurationActionsInterface; @@ -42,6 +44,8 @@ use Chargebee\Actions\DifferentialPriceActions; use Chargebee\Actions\Contracts\DisputeActionsInterface; use Chargebee\Actions\DisputeActions; +use Chargebee\Actions\Contracts\DraftRequestActionsInterface; +use Chargebee\Actions\DraftRequestActions; use Chargebee\Actions\Contracts\EinvoiceActionsInterface; use Chargebee\Actions\EinvoiceActions; use Chargebee\Actions\Contracts\EmailLogActionsInterface; @@ -114,6 +118,8 @@ use Chargebee\Actions\PlanActions; use Chargebee\Actions\Contracts\PortalSessionActionsInterface; use Chargebee\Actions\PortalSessionActions; +use Chargebee\Actions\Contracts\PriceRampActionsInterface; +use Chargebee\Actions\PriceRampActions; use Chargebee\Actions\Contracts\PriceVariantActionsInterface; use Chargebee\Actions\PriceVariantActions; use Chargebee\Actions\Contracts\PricingPageSessionActionsInterface; @@ -134,6 +140,8 @@ use Chargebee\Actions\RecordedPurchaseActions; use Chargebee\Actions\Contracts\ResourceMigrationActionsInterface; use Chargebee\Actions\ResourceMigrationActions; +use Chargebee\Actions\Contracts\RetrySegmentActionsInterface; +use Chargebee\Actions\RetrySegmentActions; use Chargebee\Actions\Contracts\RuleActionsInterface; use Chargebee\Actions\RuleActions; use Chargebee\Actions\Contracts\SiteMigrationDetailActionsInterface; @@ -279,6 +287,10 @@ public function card() :CardActionsInterface { return new CardActions($this->httpClientFactory, $this->env); } + public function collectionsPaymentPromise() :CollectionsPaymentPromiseActionsInterface { + return new CollectionsPaymentPromiseActions($this->httpClientFactory, $this->env); + } + public function comment() :CommentActionsInterface { return new CommentActions($this->httpClientFactory, $this->env); } @@ -327,6 +339,10 @@ public function dispute() :DisputeActionsInterface { return new DisputeActions($this->httpClientFactory, $this->env); } + public function draftRequest() :DraftRequestActionsInterface { + return new DraftRequestActions($this->httpClientFactory, $this->env); + } + public function einvoice() :EinvoiceActionsInterface { return new EinvoiceActions($this->httpClientFactory, $this->env); } @@ -471,6 +487,10 @@ public function portalSession() :PortalSessionActionsInterface { return new PortalSessionActions($this->httpClientFactory, $this->env); } + public function priceRamp() :PriceRampActionsInterface { + return new PriceRampActions($this->httpClientFactory, $this->env); + } + public function priceVariant() :PriceVariantActionsInterface { return new PriceVariantActions($this->httpClientFactory, $this->env); } @@ -511,6 +531,10 @@ public function resourceMigration() :ResourceMigrationActionsInterface { return new ResourceMigrationActions($this->httpClientFactory, $this->env); } + public function retrySegment() :RetrySegmentActionsInterface { + return new RetrySegmentActions($this->httpClientFactory, $this->env); + } + public function rule() :RuleActionsInterface { return new RuleActions($this->httpClientFactory, $this->env); } diff --git a/src/Enums/EnabledEvents.php b/src/Enums/EnabledEvents.php index bf73a722..e0c3cca6 100644 --- a/src/Enums/EnabledEvents.php +++ b/src/Enums/EnabledEvents.php @@ -67,6 +67,7 @@ enum EnabledEvents : string { case PAYMENT_SCHEDULES_UPDATED = "payment_schedules_updated"; case PAYMENT_SCHEDULE_SCHEME_CREATED = "payment_schedule_scheme_created"; case PAYMENT_SCHEDULE_SCHEME_DELETED = "payment_schedule_scheme_deleted"; + case PAYMENT_SCHEDULES_CANCELLED = "payment_schedules_cancelled"; case SUBSCRIPTION_RENEWAL_REMINDER = "subscription_renewal_reminder"; case ADD_USAGES_REMINDER = "add_usages_reminder"; case PAYMENT_DUE_REMINDER = "payment_due_reminder"; @@ -77,6 +78,7 @@ enum EnabledEvents : string { case PAYMENT_FAILED = "payment_failed"; case DUNNING_UPDATED = "dunning_updated"; case PAYMENT_REFUNDED = "payment_refunded"; + case REFUND_FAILED = "refund_failed"; case PAYMENT_INITIATED = "payment_initiated"; case REFUND_INITIATED = "refund_initiated"; case NETD_PAYMENT_DUE_REMINDER = "netd_payment_due_reminder"; @@ -228,6 +230,9 @@ enum EnabledEvents : string { case ALERT_STATUS_CHANGED = "alert_status_changed"; case OMNICHANNEL_SUBSCRIPTION_ITEM_UPDATED = "omnichannel_subscription_item_updated"; case OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED = "omnichannel_subscription_item_recovered"; + case PRICE_RAMP_CREATED = "price_ramp_created"; + case PRICE_RAMP_UPDATED = "price_ramp_updated"; + case PRICE_RAMP_DELETED = "price_ramp_deleted"; case OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED = "omnichannel_subscription_item_mrr_updated"; case LEDGER_ACCOUNT_BALANCE_UPDATED = "ledger_account_balance_updated"; case GRANT_BLOCKS_CREATED = "grant_blocks_created"; @@ -242,12 +247,29 @@ enum EnabledEvents : string { case VAULT_TOKEN_CREATED = "vault_token_created"; case VAULT_TOKEN_UPDATED = "vault_token_updated"; case VAULT_TOKEN_DELETED = "vault_token_deleted"; - case BUSINESS_RULES_APPLIED = "business_rules_applied"; + case CHARGEBACK_INITIATED = "chargeback_initiated"; + case CHARGEBACK_WON = "chargeback_won"; + case CHARGEBACK_LOST = "chargeback_lost"; case BUSINESS_RULESET_CREATED = "business_ruleset_created"; case BUSINESS_RULESET_UPDATED = "business_ruleset_updated"; case BUSINESS_RULESET_ACTIVATED = "business_ruleset_activated"; case BUSINESS_RULESET_DEACTIVATED = "business_ruleset_deactivated"; case BUSINESS_RULESET_DELETED = "business_ruleset_deleted"; + case COLLECTIONS_REMINDER_SEQUENCE_CREATED = "collections_reminder_sequence_created"; + case COLLECTIONS_REMINDER_SEQUENCE_PAUSED = "collections_reminder_sequence_paused"; + case COLLECTIONS_REMINDER_SEQUENCE_RESUMED = "collections_reminder_sequence_resumed"; + case COLLECTIONS_REMINDER_SEQUENCE_COMPLETED = "collections_reminder_sequence_completed"; + case COLLECTIONS_PAYMENT_PROMISE_CREATED = "collections_payment_promise_created"; + case COLLECTIONS_PAYMENT_PROMISE_UPDATED = "collections_payment_promise_updated"; + case COLLECTIONS_PAYMENT_PROMISE_FULFILLED = "collections_payment_promise_fulfilled"; + case COLLECTIONS_PAYMENT_PROMISE_CANCELLED = "collections_payment_promise_cancelled"; + case COLLECTIONS_PAYMENT_PROMISE_BROKEN = "collections_payment_promise_broken"; + case COLLECTIONS_DISPUTE_CREATED = "collections_dispute_created"; + case COLLECTIONS_DISPUTE_UPDATED = "collections_dispute_updated"; + case COLLECTIONS_DISPUTE_RESOLVED = "collections_dispute_resolved"; + case COLLECTIONS_DISPUTE_WITHDRAWN = "collections_dispute_withdrawn"; + case EMAIL_MESSAGE_RECEIVED = "email_message_received"; + case PRIVATE_NOTE_ADDED = "private_note_added"; case PLAN_CREATED = "plan_created"; case PLAN_UPDATED = "plan_updated"; case PLAN_DELETED = "plan_deleted"; diff --git a/src/Enums/EntityType.php b/src/Enums/EntityType.php index c559cb98..8b699b7d 100644 --- a/src/Enums/EntityType.php +++ b/src/Enums/EntityType.php @@ -12,12 +12,12 @@ enum EntityType : string { case PLAN_PRICE = "plan_price"; case ADDON_PRICE = "addon_price"; case CHARGE_PRICE = "charge_price"; + case ADDON = "addon"; case INVOICE = "invoice"; case QUOTE = "quote"; case CREDIT_NOTE = "credit_note"; case TRANSACTION = "transaction"; case PLAN = "plan"; - case ADDON = "addon"; case ORDER = "order"; case ITEM_FAMILY = "item_family"; case ITEM = "item"; @@ -46,6 +46,7 @@ enum EntityType : string { case ALERT_STATUS = "alert_status"; case OMNICHANNEL_SUBSCRIPTION_ITEM_METRIC = "omnichannel_subscription_item_metric"; case PRICE_RAMP = "price_ramp"; + case TASK = "task"; /* * @depcreated */ diff --git a/src/Enums/EventType.php b/src/Enums/EventType.php index 3127f759..a897c5a1 100644 --- a/src/Enums/EventType.php +++ b/src/Enums/EventType.php @@ -67,6 +67,7 @@ enum EventType : string { case PAYMENT_SCHEDULES_UPDATED = "payment_schedules_updated"; case PAYMENT_SCHEDULE_SCHEME_CREATED = "payment_schedule_scheme_created"; case PAYMENT_SCHEDULE_SCHEME_DELETED = "payment_schedule_scheme_deleted"; + case PAYMENT_SCHEDULES_CANCELLED = "payment_schedules_cancelled"; case SUBSCRIPTION_RENEWAL_REMINDER = "subscription_renewal_reminder"; case ADD_USAGES_REMINDER = "add_usages_reminder"; case PAYMENT_DUE_REMINDER = "payment_due_reminder"; @@ -77,6 +78,7 @@ enum EventType : string { case PAYMENT_FAILED = "payment_failed"; case DUNNING_UPDATED = "dunning_updated"; case PAYMENT_REFUNDED = "payment_refunded"; + case REFUND_FAILED = "refund_failed"; case PAYMENT_INITIATED = "payment_initiated"; case REFUND_INITIATED = "refund_initiated"; case AUTHORIZATION_SUCCEEDED = "authorization_succeeded"; @@ -219,6 +221,9 @@ enum EventType : string { case ALERT_STATUS_CHANGED = "alert_status_changed"; case OMNICHANNEL_SUBSCRIPTION_ITEM_UPDATED = "omnichannel_subscription_item_updated"; case OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED = "omnichannel_subscription_item_recovered"; + case PRICE_RAMP_CREATED = "price_ramp_created"; + case PRICE_RAMP_UPDATED = "price_ramp_updated"; + case PRICE_RAMP_DELETED = "price_ramp_deleted"; case OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED = "omnichannel_subscription_item_mrr_updated"; case LEDGER_ACCOUNT_BALANCE_UPDATED = "ledger_account_balance_updated"; case GRANT_BLOCKS_CREATED = "grant_blocks_created"; @@ -233,12 +238,29 @@ enum EventType : string { case VAULT_TOKEN_CREATED = "vault_token_created"; case VAULT_TOKEN_UPDATED = "vault_token_updated"; case VAULT_TOKEN_DELETED = "vault_token_deleted"; - case BUSINESS_RULES_APPLIED = "business_rules_applied"; + case CHARGEBACK_INITIATED = "chargeback_initiated"; + case CHARGEBACK_WON = "chargeback_won"; + case CHARGEBACK_LOST = "chargeback_lost"; case BUSINESS_RULESET_CREATED = "business_ruleset_created"; case BUSINESS_RULESET_UPDATED = "business_ruleset_updated"; case BUSINESS_RULESET_ACTIVATED = "business_ruleset_activated"; case BUSINESS_RULESET_DEACTIVATED = "business_ruleset_deactivated"; case BUSINESS_RULESET_DELETED = "business_ruleset_deleted"; + case COLLECTIONS_REMINDER_SEQUENCE_CREATED = "collections_reminder_sequence_created"; + case COLLECTIONS_REMINDER_SEQUENCE_PAUSED = "collections_reminder_sequence_paused"; + case COLLECTIONS_REMINDER_SEQUENCE_RESUMED = "collections_reminder_sequence_resumed"; + case COLLECTIONS_REMINDER_SEQUENCE_COMPLETED = "collections_reminder_sequence_completed"; + case COLLECTIONS_PAYMENT_PROMISE_CREATED = "collections_payment_promise_created"; + case COLLECTIONS_PAYMENT_PROMISE_UPDATED = "collections_payment_promise_updated"; + case COLLECTIONS_PAYMENT_PROMISE_FULFILLED = "collections_payment_promise_fulfilled"; + case COLLECTIONS_PAYMENT_PROMISE_CANCELLED = "collections_payment_promise_cancelled"; + case COLLECTIONS_PAYMENT_PROMISE_BROKEN = "collections_payment_promise_broken"; + case COLLECTIONS_DISPUTE_CREATED = "collections_dispute_created"; + case COLLECTIONS_DISPUTE_UPDATED = "collections_dispute_updated"; + case COLLECTIONS_DISPUTE_RESOLVED = "collections_dispute_resolved"; + case COLLECTIONS_DISPUTE_WITHDRAWN = "collections_dispute_withdrawn"; + case EMAIL_MESSAGE_RECEIVED = "email_message_received"; + case PRIVATE_NOTE_ADDED = "private_note_added"; case PLAN_CREATED = "plan_created"; case PLAN_UPDATED = "plan_updated"; case PLAN_DELETED = "plan_deleted"; diff --git a/src/Enums/Source.php b/src/Enums/Source.php index cb92cd50..30c873ec 100644 --- a/src/Enums/Source.php +++ b/src/Enums/Source.php @@ -14,6 +14,9 @@ enum Source : string { case JS_API = "js_api"; case MIGRATION = "migration"; case EXTERNAL_SERVICE = "external_service"; + case MCP = "mcp"; + case COPILOT = "copilot"; + case AGENT = "agent"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/Citation/Citation.php b/src/Resources/Citation/Citation.php new file mode 100644 index 00000000..4534b15a --- /dev/null +++ b/src/Resources/Citation/Citation.php @@ -0,0 +1,111 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "param_name" , "author_name" , "created_at" , "content" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $param_name, + ?string $author_name, + ?int $created_at, + ?Content $content, + ?\Chargebee\Resources\Citation\Enums\ConfidenceLevel $confidence_level, + ) + { + $this->id = $id; + $this->param_name = $param_name; + $this->author_name = $author_name; + $this->created_at = $created_at; + $this->content = $content; + $this->confidence_level = $confidence_level; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['param_name'] ?? null, + $resourceAttributes['author_name'] ?? null, + $resourceAttributes['created_at'] ?? null, + isset($resourceAttributes['content']) ? Content::from($resourceAttributes['content']) : null, + + + isset($resourceAttributes['confidence_level']) ? \Chargebee\Resources\Citation\Enums\ConfidenceLevel::tryFromValue($resourceAttributes['confidence_level']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'param_name' => $this->param_name, + 'author_name' => $this->author_name, + 'created_at' => $this->created_at, + + + 'confidence_level' => $this->confidence_level?->value, + + ], function ($value) { + return $value !== null; + }); + + + if($this->content instanceof Content){ + $data['content'] = $this->content->toArray(); + } + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Citation/Enums/ConfidenceLevel.php b/src/Resources/Citation/Enums/ConfidenceLevel.php new file mode 100644 index 00000000..89197a0b --- /dev/null +++ b/src/Resources/Citation/Enums/ConfidenceLevel.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/src/Resources/CollectionsDispute/CollectionsDispute.php b/src/Resources/CollectionsDispute/CollectionsDispute.php new file mode 100644 index 00000000..8459fe2b --- /dev/null +++ b/src/Resources/CollectionsDispute/CollectionsDispute.php @@ -0,0 +1,218 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "customer_id" , "invoice_id" , "line_item_id" , "currency_code" , "billed_amount" , "claimed_deduction" , "dispute_reason_code" , "resolved_reason_code" , "reason" , "opened_at" , "resolved_at" , "created_at" , "updated_at" , "resource_version" , "undisputed_amount" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $customer_id, + ?string $invoice_id, + ?string $line_item_id, + ?string $currency_code, + ?int $billed_amount, + ?int $claimed_deduction, + ?string $dispute_reason_code, + ?string $resolved_reason_code, + ?string $reason, + ?int $opened_at, + ?int $resolved_at, + ?int $created_at, + ?int $updated_at, + ?int $resource_version, + ?int $undisputed_amount, + ?\Chargebee\Resources\CollectionsDispute\Enums\Status $status, + ) + { + $this->id = $id; + $this->customer_id = $customer_id; + $this->invoice_id = $invoice_id; + $this->line_item_id = $line_item_id; + $this->currency_code = $currency_code; + $this->billed_amount = $billed_amount; + $this->claimed_deduction = $claimed_deduction; + $this->dispute_reason_code = $dispute_reason_code; + $this->resolved_reason_code = $resolved_reason_code; + $this->reason = $reason; + $this->opened_at = $opened_at; + $this->resolved_at = $resolved_at; + $this->created_at = $created_at; + $this->updated_at = $updated_at; + $this->resource_version = $resource_version; + $this->undisputed_amount = $undisputed_amount; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['invoice_id'] ?? null, + $resourceAttributes['line_item_id'] ?? null, + $resourceAttributes['currency_code'] ?? null, + $resourceAttributes['billed_amount'] ?? null, + $resourceAttributes['claimed_deduction'] ?? null, + $resourceAttributes['dispute_reason_code'] ?? null, + $resourceAttributes['resolved_reason_code'] ?? null, + $resourceAttributes['reason'] ?? null, + $resourceAttributes['opened_at'] ?? null, + $resourceAttributes['resolved_at'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + $resourceAttributes['undisputed_amount'] ?? null, + + + isset($resourceAttributes['status']) ? \Chargebee\Resources\CollectionsDispute\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'customer_id' => $this->customer_id, + 'invoice_id' => $this->invoice_id, + 'line_item_id' => $this->line_item_id, + 'currency_code' => $this->currency_code, + 'billed_amount' => $this->billed_amount, + 'claimed_deduction' => $this->claimed_deduction, + 'dispute_reason_code' => $this->dispute_reason_code, + 'resolved_reason_code' => $this->resolved_reason_code, + 'reason' => $this->reason, + 'opened_at' => $this->opened_at, + 'resolved_at' => $this->resolved_at, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + 'resource_version' => $this->resource_version, + 'undisputed_amount' => $this->undisputed_amount, + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/CollectionsDispute/Enums/Status.php b/src/Resources/CollectionsDispute/Enums/Status.php new file mode 100644 index 00000000..3676fc88 --- /dev/null +++ b/src/Resources/CollectionsDispute/Enums/Status.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/src/Resources/CollectionsPaymentPromise/CollectionsPaymentPromise.php b/src/Resources/CollectionsPaymentPromise/CollectionsPaymentPromise.php new file mode 100644 index 00000000..4a4fff89 --- /dev/null +++ b/src/Resources/CollectionsPaymentPromise/CollectionsPaymentPromise.php @@ -0,0 +1,148 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "customer_id" , "invoice_id" , "reason" , "promised_by" , "promised_on" , "created_at" , "updated_at" , "resource_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $customer_id, + ?string $invoice_id, + ?string $reason, + ?string $promised_by, + ?int $promised_on, + ?int $created_at, + ?int $updated_at, + ?int $resource_version, + ?\Chargebee\Resources\CollectionsPaymentPromise\Enums\Status $status, + ) + { + $this->id = $id; + $this->customer_id = $customer_id; + $this->invoice_id = $invoice_id; + $this->reason = $reason; + $this->promised_by = $promised_by; + $this->promised_on = $promised_on; + $this->created_at = $created_at; + $this->updated_at = $updated_at; + $this->resource_version = $resource_version; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['invoice_id'] ?? null, + $resourceAttributes['reason'] ?? null, + $resourceAttributes['promised_by'] ?? null, + $resourceAttributes['promised_on'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + + + isset($resourceAttributes['status']) ? \Chargebee\Resources\CollectionsPaymentPromise\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'customer_id' => $this->customer_id, + 'invoice_id' => $this->invoice_id, + 'reason' => $this->reason, + 'promised_by' => $this->promised_by, + 'promised_on' => $this->promised_on, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + 'resource_version' => $this->resource_version, + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/CollectionsPaymentPromise/Enums/Status.php b/src/Resources/CollectionsPaymentPromise/Enums/Status.php new file mode 100644 index 00000000..159d2b44 --- /dev/null +++ b/src/Resources/CollectionsPaymentPromise/Enums/Status.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/src/Resources/CollectionsReminderSequence/ActionLog.php b/src/Resources/CollectionsReminderSequence/ActionLog.php new file mode 100644 index 00000000..0b9e2616 --- /dev/null +++ b/src/Resources/CollectionsReminderSequence/ActionLog.php @@ -0,0 +1,96 @@ + $knownFields + */ + protected static array $knownFields = [ "action_type" , "status" , "reason_code" , "executed_at" , "scheduled_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $action_type, + ?string $status, + ?string $reason_code, + ?int $executed_at, + ?int $scheduled_at, + ) + { + $this->action_type = $action_type; + $this->status = $status; + $this->reason_code = $reason_code; + $this->executed_at = $executed_at; + $this->scheduled_at = $scheduled_at; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['action_type'] ?? null, + $resourceAttributes['status'] ?? null, + $resourceAttributes['reason_code'] ?? null, + $resourceAttributes['executed_at'] ?? null, + $resourceAttributes['scheduled_at'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['action_type' => $this->action_type, + 'status' => $this->status, + 'reason_code' => $this->reason_code, + 'executed_at' => $this->executed_at, + 'scheduled_at' => $this->scheduled_at, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/CollectionsReminderSequence/CollectionsReminderSequence.php b/src/Resources/CollectionsReminderSequence/CollectionsReminderSequence.php new file mode 100644 index 00000000..6f2ca0bf --- /dev/null +++ b/src/Resources/CollectionsReminderSequence/CollectionsReminderSequence.php @@ -0,0 +1,178 @@ + $action_logs + */ + public ?array $action_logs; + + /** + * + * @var ?\Chargebee\Resources\CollectionsReminderSequence\Enums\Status $status + */ + public ?\Chargebee\Resources\CollectionsReminderSequence\Enums\Status $status; + + /** + * @var array $knownFields + */ + protected static array $knownFields = [ "id" , "invoice_id" , "customer_id" , "paused_until" , "pause_note" , "started_at" , "completed_at" , "created_at" , "updated_at" , "resource_version" , "action_logs" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $invoice_id, + ?string $customer_id, + ?int $paused_until, + ?string $pause_note, + ?int $started_at, + ?int $completed_at, + ?int $created_at, + ?int $updated_at, + ?int $resource_version, + ?array $action_logs, + ?\Chargebee\Resources\CollectionsReminderSequence\Enums\Status $status, + ) + { + $this->id = $id; + $this->invoice_id = $invoice_id; + $this->customer_id = $customer_id; + $this->paused_until = $paused_until; + $this->pause_note = $pause_note; + $this->started_at = $started_at; + $this->completed_at = $completed_at; + $this->created_at = $created_at; + $this->updated_at = $updated_at; + $this->resource_version = $resource_version; + $this->action_logs = $action_logs; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $action_logs = array_map(fn (array $result): ActionLog => ActionLog::from( + $result + ), $resourceAttributes['action_logs'] ?? []); + + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['invoice_id'] ?? null, + $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['paused_until'] ?? null, + $resourceAttributes['pause_note'] ?? null, + $resourceAttributes['started_at'] ?? null, + $resourceAttributes['completed_at'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + $action_logs, + + + isset($resourceAttributes['status']) ? \Chargebee\Resources\CollectionsReminderSequence\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'invoice_id' => $this->invoice_id, + 'customer_id' => $this->customer_id, + 'paused_until' => $this->paused_until, + 'pause_note' => $this->pause_note, + 'started_at' => $this->started_at, + 'completed_at' => $this->completed_at, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + 'resource_version' => $this->resource_version, + + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + if($this->action_logs !== []){ + $data['action_logs'] = array_map( + fn (ActionLog $action_logs): array => $action_logs->toArray(), + $this->action_logs + ); + } + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/CollectionsReminderSequence/Enums/CollectionsReminderSequenceActionLogActionType.php b/src/Resources/CollectionsReminderSequence/Enums/CollectionsReminderSequenceActionLogActionType.php new file mode 100644 index 00000000..f2e15521 --- /dev/null +++ b/src/Resources/CollectionsReminderSequence/Enums/CollectionsReminderSequenceActionLogActionType.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/src/Resources/CollectionsReminderSequence/Enums/CollectionsReminderSequenceActionLogReasonCode.php b/src/Resources/CollectionsReminderSequence/Enums/CollectionsReminderSequenceActionLogReasonCode.php new file mode 100644 index 00000000..0ae8faf4 --- /dev/null +++ b/src/Resources/CollectionsReminderSequence/Enums/CollectionsReminderSequenceActionLogReasonCode.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/src/Resources/CollectionsReminderSequence/Enums/CollectionsReminderSequenceActionLogStatus.php b/src/Resources/CollectionsReminderSequence/Enums/CollectionsReminderSequenceActionLogStatus.php new file mode 100644 index 00000000..b2607480 --- /dev/null +++ b/src/Resources/CollectionsReminderSequence/Enums/CollectionsReminderSequenceActionLogStatus.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/src/Resources/CollectionsReminderSequence/Enums/Status.php b/src/Resources/CollectionsReminderSequence/Enums/Status.php new file mode 100644 index 00000000..2ea445d1 --- /dev/null +++ b/src/Resources/CollectionsReminderSequence/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 ec40f4b1..96b0ef24 100644 --- a/src/Resources/Content/Content.php +++ b/src/Resources/Content/Content.php @@ -6,7 +6,6 @@ use Chargebee\Resources\AdvanceInvoiceSchedule\AdvanceInvoiceSchedule; use Chargebee\Resources\Alert\Alert; use Chargebee\Resources\AlertStatus\AlertStatus; -use Chargebee\Resources\AppliedBusinessRule\AppliedBusinessRule; use Chargebee\Resources\AppliedRule\AppliedRule; use Chargebee\Resources\ApplyRule\ApplyRule; use Chargebee\Resources\AsyncResponse\AsyncResponse; @@ -21,6 +20,10 @@ use Chargebee\Resources\BusinessRuleset\BusinessRuleset; use Chargebee\Resources\BusinessRulesetRule\BusinessRulesetRule; use Chargebee\Resources\Card\Card; +use Chargebee\Resources\Citation\Citation; +use Chargebee\Resources\CollectionsDispute\CollectionsDispute; +use Chargebee\Resources\CollectionsPaymentPromise\CollectionsPaymentPromise; +use Chargebee\Resources\CollectionsReminderSequence\CollectionsReminderSequence; use Chargebee\Resources\ColumnDefinition\ColumnDefinition; use Chargebee\Resources\Comment\Comment; use Chargebee\Resources\Configuration\Configuration; @@ -34,6 +37,7 @@ use Chargebee\Resources\CreditNoteEstimate\CreditNoteEstimate; use Chargebee\Resources\CreditUnit\CreditUnit; use Chargebee\Resources\Currency\Currency; +use Chargebee\Resources\CustomData\CustomData; use Chargebee\Resources\CustomDataSchema\CustomDataSchema; use Chargebee\Resources\Customer\Customer; use Chargebee\Resources\CustomerEntitlement\CustomerEntitlement; @@ -41,12 +45,18 @@ use Chargebee\Resources\Discount\Discount; use Chargebee\Resources\Dispute\Dispute; use Chargebee\Resources\Download\Download; +use Chargebee\Resources\DraftEstimate\DraftEstimate; +use Chargebee\Resources\DraftRequest\DraftRequest; use Chargebee\Resources\Einvoice\Einvoice; +use Chargebee\Resources\EmailAttachment\EmailAttachment; +use Chargebee\Resources\EmailConversation\EmailConversation; use Chargebee\Resources\EmailLog\EmailLog; +use Chargebee\Resources\EmailMessage\EmailMessage; use Chargebee\Resources\Entitlement\Entitlement; use Chargebee\Resources\EntitlementOverride\EntitlementOverride; use Chargebee\Resources\Estimate\Estimate; use Chargebee\Resources\Event\Event; +use Chargebee\Resources\Execution\Execution; use Chargebee\Resources\Export\Export; use Chargebee\Resources\Feature\Feature; use Chargebee\Resources\FilterCondition\FilterCondition; @@ -54,6 +64,8 @@ use Chargebee\Resources\GatewayPaymentMethodToken\GatewayPaymentMethodToken; use Chargebee\Resources\Gift\Gift; use Chargebee\Resources\GrantBlock\GrantBlock; +use Chargebee\Resources\GroupByAttribute\GroupByAttribute; +use Chargebee\Resources\GroupByRecommendation\GroupByRecommendation; use Chargebee\Resources\Hierarchy\Hierarchy; use Chargebee\Resources\HostedPage\HostedPage; use Chargebee\Resources\ImpactedCustomer\ImpactedCustomer; @@ -95,8 +107,11 @@ use Chargebee\Resources\PersonalizedOffer\PersonalizedOffer; use Chargebee\Resources\Plan\Plan; use Chargebee\Resources\PortalSession\PortalSession; +use Chargebee\Resources\PreferenceVariant\PreferenceVariant; +use Chargebee\Resources\PriceRamp\PriceRamp; use Chargebee\Resources\PriceVariant\PriceVariant; use Chargebee\Resources\PricingPageSession\PricingPageSession; +use Chargebee\Resources\PrivateNote\PrivateNote; use Chargebee\Resources\PromotionalCredit\PromotionalCredit; use Chargebee\Resources\PromotionalGrant\PromotionalGrant; use Chargebee\Resources\Purchase\Purchase; @@ -108,8 +123,10 @@ use Chargebee\Resources\QuotedRamp\QuotedRamp; use Chargebee\Resources\QuotedSubscription\QuotedSubscription; use Chargebee\Resources\Ramp\Ramp; +use Chargebee\Resources\RampInterval\RampInterval; use Chargebee\Resources\RecordedPurchase\RecordedPurchase; use Chargebee\Resources\ResourceMigration\ResourceMigration; +use Chargebee\Resources\RetrySegment\RetrySegment; use Chargebee\Resources\Rule\Rule; use Chargebee\Resources\SiteMigrationDetail\SiteMigrationDetail; use Chargebee\Resources\Subscription\Subscription; @@ -163,12 +180,6 @@ class Content { */ public ?AlertStatus $alertstatus; - /** - * - * @var ?AppliedBusinessRule $appliedbusinessrule - */ - public ?AppliedBusinessRule $appliedbusinessrule; - /** * * @var ?AppliedRule $appliedrule @@ -253,6 +264,30 @@ class Content { */ public ?Card $card; + /** + * + * @var ?Citation $citation + */ + public ?Citation $citation; + + /** + * + * @var ?CollectionsDispute $collectionsdispute + */ + public ?CollectionsDispute $collectionsdispute; + + /** + * + * @var ?CollectionsPaymentPromise $collectionspaymentpromise + */ + public ?CollectionsPaymentPromise $collectionspaymentpromise; + + /** + * + * @var ?CollectionsReminderSequence $collectionsremindersequence + */ + public ?CollectionsReminderSequence $collectionsremindersequence; + /** * * @var ?ColumnDefinition $columndefinition @@ -331,6 +366,12 @@ class Content { */ public ?Currency $currency; + /** + * + * @var ?CustomData $customdata + */ + public ?CustomData $customdata; + /** * * @var ?CustomDataSchema $customdataschema @@ -373,18 +414,48 @@ class Content { */ public ?Download $download; + /** + * + * @var ?DraftEstimate $draftestimate + */ + public ?DraftEstimate $draftestimate; + + /** + * + * @var ?DraftRequest $draftrequest + */ + public ?DraftRequest $draftrequest; + /** * * @var ?Einvoice $einvoice */ public ?Einvoice $einvoice; + /** + * + * @var ?EmailAttachment $emailattachment + */ + public ?EmailAttachment $emailattachment; + + /** + * + * @var ?EmailConversation $emailconversation + */ + public ?EmailConversation $emailconversation; + /** * * @var ?EmailLog $emaillog */ public ?EmailLog $emaillog; + /** + * + * @var ?EmailMessage $emailmessage + */ + public ?EmailMessage $emailmessage; + /** * * @var ?Entitlement $entitlement @@ -409,6 +480,12 @@ class Content { */ public ?Event $event; + /** + * + * @var ?Execution $execution + */ + public ?Execution $execution; + /** * * @var ?Export $export @@ -451,6 +528,18 @@ class Content { */ public ?GrantBlock $grantblock; + /** + * + * @var ?GroupByAttribute $groupbyattribute + */ + public ?GroupByAttribute $groupbyattribute; + + /** + * + * @var ?GroupByRecommendation $groupbyrecommendation + */ + public ?GroupByRecommendation $groupbyrecommendation; + /** * * @var ?Hierarchy $hierarchy @@ -697,6 +786,18 @@ class Content { */ public ?PortalSession $portalsession; + /** + * + * @var ?PreferenceVariant $preferencevariant + */ + public ?PreferenceVariant $preferencevariant; + + /** + * + * @var ?PriceRamp $priceramp + */ + public ?PriceRamp $priceramp; + /** * * @var ?PriceVariant $pricevariant @@ -709,6 +810,12 @@ class Content { */ public ?PricingPageSession $pricingpagesession; + /** + * + * @var ?PrivateNote $privatenote + */ + public ?PrivateNote $privatenote; + /** * * @var ?PromotionalCredit $promotionalcredit @@ -775,6 +882,12 @@ class Content { */ public ?Ramp $ramp; + /** + * + * @var ?RampInterval $rampinterval + */ + public ?RampInterval $rampinterval; + /** * * @var ?RecordedPurchase $recordedpurchase @@ -787,6 +900,12 @@ class Content { */ public ?ResourceMigration $resourcemigration; + /** + * + * @var ?RetrySegment $retrysegment + */ + public ?RetrySegment $retrysegment; + /** * * @var ?Rule $rule @@ -916,7 +1035,7 @@ class Content { /** * @var array $knownFields */ - protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "applied_business_rule" , "applied_rule" , "apply_rule" , "async_response" , "async_response_list" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "business_rule" , "business_ruleset" , "business_ruleset_rule" , "card" , "column_definition" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "credit_unit" , "currency" , "custom_data_schema" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "dispute" , "download" , "einvoice" , "email_log" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "filter_condition" , "gateway_error_detail" , "gateway_payment_method_token" , "gift" , "grant_block" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "ledger_account_balance" , "ledger_entry" , "ledger_operation" , "metadata" , "meter" , "metered_feature" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_metric" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "promotional_grant" , "purchase" , "quote" , "quote_entitlement" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "vaulted_payment_method" , "virtual_bank_account" , "webhook_endpoint" ]; + protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "applied_rule" , "apply_rule" , "async_response" , "async_response_list" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "business_rule" , "business_ruleset" , "business_ruleset_rule" , "card" , "citation" , "collections_dispute" , "collections_payment_promise" , "collections_reminder_sequence" , "column_definition" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "credit_unit" , "currency" , "custom_data" , "custom_data_schema" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "dispute" , "download" , "draft_estimate" , "draft_request" , "einvoice" , "email_attachment" , "email_conversation" , "email_log" , "email_message" , "entitlement" , "entitlement_override" , "estimate" , "event" , "execution" , "export" , "feature" , "filter_condition" , "gateway_error_detail" , "gateway_payment_method_token" , "gift" , "grant_block" , "group_by_attribute" , "group_by_recommendation" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "ledger_account_balance" , "ledger_entry" , "ledger_operation" , "metadata" , "meter" , "metered_feature" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_metric" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "preference_variant" , "price_ramp" , "price_variant" , "pricing_page_session" , "private_note" , "promotional_credit" , "promotional_grant" , "purchase" , "quote" , "quote_entitlement" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "ramp_interval" , "recorded_purchase" , "resource_migration" , "retry_segment" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "vaulted_payment_method" , "virtual_bank_account" , "webhook_endpoint" ]; /** * dynamic properties for resources @@ -930,7 +1049,6 @@ private function __construct( ?AdvanceInvoiceSchedule $advanceinvoiceschedule, ?Alert $alert, ?AlertStatus $alertstatus, - ?AppliedBusinessRule $appliedbusinessrule, ?AppliedRule $appliedrule, ?ApplyRule $applyrule, ?AsyncResponse $asyncresponse, @@ -945,6 +1063,10 @@ private function __construct( ?BusinessRuleset $businessruleset, ?BusinessRulesetRule $businessrulesetrule, ?Card $card, + ?Citation $citation, + ?CollectionsDispute $collectionsdispute, + ?CollectionsPaymentPromise $collectionspaymentpromise, + ?CollectionsReminderSequence $collectionsremindersequence, ?ColumnDefinition $columndefinition, ?Comment $comment, ?Configuration $configuration, @@ -958,6 +1080,7 @@ private function __construct( ?CreditNoteEstimate $creditnoteestimate, ?CreditUnit $creditunit, ?Currency $currency, + ?CustomData $customdata, ?CustomDataSchema $customdataschema, ?Customer $customer, ?CustomerEntitlement $customerentitlement, @@ -965,12 +1088,18 @@ private function __construct( ?Discount $discount, ?Dispute $dispute, ?Download $download, + ?DraftEstimate $draftestimate, + ?DraftRequest $draftrequest, ?Einvoice $einvoice, + ?EmailAttachment $emailattachment, + ?EmailConversation $emailconversation, ?EmailLog $emaillog, + ?EmailMessage $emailmessage, ?Entitlement $entitlement, ?EntitlementOverride $entitlementoverride, ?Estimate $estimate, ?Event $event, + ?Execution $execution, ?Export $export, ?Feature $feature, ?FilterCondition $filtercondition, @@ -978,6 +1107,8 @@ private function __construct( ?GatewayPaymentMethodToken $gatewaypaymentmethodtoken, ?Gift $gift, ?GrantBlock $grantblock, + ?GroupByAttribute $groupbyattribute, + ?GroupByRecommendation $groupbyrecommendation, ?Hierarchy $hierarchy, ?HostedPage $hostedpage, ?ImpactedCustomer $impactedcustomer, @@ -1019,8 +1150,11 @@ private function __construct( ?PersonalizedOffer $personalizedoffer, ?Plan $plan, ?PortalSession $portalsession, + ?PreferenceVariant $preferencevariant, + ?PriceRamp $priceramp, ?PriceVariant $pricevariant, ?PricingPageSession $pricingpagesession, + ?PrivateNote $privatenote, ?PromotionalCredit $promotionalcredit, ?PromotionalGrant $promotionalgrant, ?Purchase $purchase, @@ -1032,8 +1166,10 @@ private function __construct( ?QuotedRamp $quotedramp, ?QuotedSubscription $quotedsubscription, ?Ramp $ramp, + ?RampInterval $rampinterval, ?RecordedPurchase $recordedpurchase, ?ResourceMigration $resourcemigration, + ?RetrySegment $retrysegment, ?Rule $rule, ?SiteMigrationDetail $sitemigrationdetail, ?Subscription $subscription, @@ -1062,7 +1198,6 @@ private function __construct( $this->advanceinvoiceschedule = $advanceinvoiceschedule; $this->alert = $alert; $this->alertstatus = $alertstatus; - $this->appliedbusinessrule = $appliedbusinessrule; $this->appliedrule = $appliedrule; $this->applyrule = $applyrule; $this->asyncresponse = $asyncresponse; @@ -1077,6 +1212,10 @@ private function __construct( $this->businessruleset = $businessruleset; $this->businessrulesetrule = $businessrulesetrule; $this->card = $card; + $this->citation = $citation; + $this->collectionsdispute = $collectionsdispute; + $this->collectionspaymentpromise = $collectionspaymentpromise; + $this->collectionsremindersequence = $collectionsremindersequence; $this->columndefinition = $columndefinition; $this->comment = $comment; $this->configuration = $configuration; @@ -1090,6 +1229,7 @@ private function __construct( $this->creditnoteestimate = $creditnoteestimate; $this->creditunit = $creditunit; $this->currency = $currency; + $this->customdata = $customdata; $this->customdataschema = $customdataschema; $this->customer = $customer; $this->customerentitlement = $customerentitlement; @@ -1097,12 +1237,18 @@ private function __construct( $this->discount = $discount; $this->dispute = $dispute; $this->download = $download; + $this->draftestimate = $draftestimate; + $this->draftrequest = $draftrequest; $this->einvoice = $einvoice; + $this->emailattachment = $emailattachment; + $this->emailconversation = $emailconversation; $this->emaillog = $emaillog; + $this->emailmessage = $emailmessage; $this->entitlement = $entitlement; $this->entitlementoverride = $entitlementoverride; $this->estimate = $estimate; $this->event = $event; + $this->execution = $execution; $this->export = $export; $this->feature = $feature; $this->filtercondition = $filtercondition; @@ -1110,6 +1256,8 @@ private function __construct( $this->gatewaypaymentmethodtoken = $gatewaypaymentmethodtoken; $this->gift = $gift; $this->grantblock = $grantblock; + $this->groupbyattribute = $groupbyattribute; + $this->groupbyrecommendation = $groupbyrecommendation; $this->hierarchy = $hierarchy; $this->hostedpage = $hostedpage; $this->impactedcustomer = $impactedcustomer; @@ -1151,8 +1299,11 @@ private function __construct( $this->personalizedoffer = $personalizedoffer; $this->plan = $plan; $this->portalsession = $portalsession; + $this->preferencevariant = $preferencevariant; + $this->priceramp = $priceramp; $this->pricevariant = $pricevariant; $this->pricingpagesession = $pricingpagesession; + $this->privatenote = $privatenote; $this->promotionalcredit = $promotionalcredit; $this->promotionalgrant = $promotionalgrant; $this->purchase = $purchase; @@ -1164,8 +1315,10 @@ private function __construct( $this->quotedramp = $quotedramp; $this->quotedsubscription = $quotedsubscription; $this->ramp = $ramp; + $this->rampinterval = $rampinterval; $this->recordedpurchase = $recordedpurchase; $this->resourcemigration = $resourcemigration; + $this->retrysegment = $retrysegment; $this->rule = $rule; $this->sitemigrationdetail = $sitemigrationdetail; $this->subscription = $subscription; @@ -1196,7 +1349,6 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['advance_invoice_schedule']) ? AdvanceInvoiceSchedule::from($resourceAttributes['advance_invoice_schedule']) : null, isset($resourceAttributes['alert']) ? Alert::from($resourceAttributes['alert']) : null, isset($resourceAttributes['alert_status']) ? AlertStatus::from($resourceAttributes['alert_status']) : null, - isset($resourceAttributes['applied_business_rule']) ? AppliedBusinessRule::from($resourceAttributes['applied_business_rule']) : null, isset($resourceAttributes['applied_rule']) ? AppliedRule::from($resourceAttributes['applied_rule']) : null, isset($resourceAttributes['apply_rule']) ? ApplyRule::from($resourceAttributes['apply_rule']) : null, isset($resourceAttributes['async_response']) ? AsyncResponse::from($resourceAttributes['async_response']) : null, @@ -1211,6 +1363,10 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['business_ruleset']) ? BusinessRuleset::from($resourceAttributes['business_ruleset']) : null, isset($resourceAttributes['business_ruleset_rule']) ? BusinessRulesetRule::from($resourceAttributes['business_ruleset_rule']) : null, isset($resourceAttributes['card']) ? Card::from($resourceAttributes['card']) : null, + isset($resourceAttributes['citation']) ? Citation::from($resourceAttributes['citation']) : null, + isset($resourceAttributes['collections_dispute']) ? CollectionsDispute::from($resourceAttributes['collections_dispute']) : null, + isset($resourceAttributes['collections_payment_promise']) ? CollectionsPaymentPromise::from($resourceAttributes['collections_payment_promise']) : null, + isset($resourceAttributes['collections_reminder_sequence']) ? CollectionsReminderSequence::from($resourceAttributes['collections_reminder_sequence']) : null, isset($resourceAttributes['column_definition']) ? ColumnDefinition::from($resourceAttributes['column_definition']) : null, isset($resourceAttributes['comment']) ? Comment::from($resourceAttributes['comment']) : null, isset($resourceAttributes['configuration']) ? Configuration::from($resourceAttributes['configuration']) : null, @@ -1224,6 +1380,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['credit_note_estimate']) ? CreditNoteEstimate::from($resourceAttributes['credit_note_estimate']) : null, isset($resourceAttributes['credit_unit']) ? CreditUnit::from($resourceAttributes['credit_unit']) : null, isset($resourceAttributes['currency']) ? Currency::from($resourceAttributes['currency']) : null, + isset($resourceAttributes['custom_data']) ? CustomData::from($resourceAttributes['custom_data']) : null, isset($resourceAttributes['custom_data_schema']) ? CustomDataSchema::from($resourceAttributes['custom_data_schema']) : null, isset($resourceAttributes['customer']) ? Customer::from($resourceAttributes['customer']) : null, isset($resourceAttributes['customer_entitlement']) ? CustomerEntitlement::from($resourceAttributes['customer_entitlement']) : null, @@ -1231,12 +1388,18 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['discount']) ? Discount::from($resourceAttributes['discount']) : null, isset($resourceAttributes['dispute']) ? Dispute::from($resourceAttributes['dispute']) : null, isset($resourceAttributes['download']) ? Download::from($resourceAttributes['download']) : null, + isset($resourceAttributes['draft_estimate']) ? DraftEstimate::from($resourceAttributes['draft_estimate']) : null, + isset($resourceAttributes['draft_request']) ? DraftRequest::from($resourceAttributes['draft_request']) : null, isset($resourceAttributes['einvoice']) ? Einvoice::from($resourceAttributes['einvoice']) : null, + isset($resourceAttributes['email_attachment']) ? EmailAttachment::from($resourceAttributes['email_attachment']) : null, + isset($resourceAttributes['email_conversation']) ? EmailConversation::from($resourceAttributes['email_conversation']) : null, isset($resourceAttributes['email_log']) ? EmailLog::from($resourceAttributes['email_log']) : null, + isset($resourceAttributes['email_message']) ? EmailMessage::from($resourceAttributes['email_message']) : null, isset($resourceAttributes['entitlement']) ? Entitlement::from($resourceAttributes['entitlement']) : null, isset($resourceAttributes['entitlement_override']) ? EntitlementOverride::from($resourceAttributes['entitlement_override']) : null, isset($resourceAttributes['estimate']) ? Estimate::from($resourceAttributes['estimate']) : null, isset($resourceAttributes['event']) ? Event::from($resourceAttributes['event']) : null, + isset($resourceAttributes['execution']) ? Execution::from($resourceAttributes['execution']) : null, isset($resourceAttributes['export']) ? Export::from($resourceAttributes['export']) : null, isset($resourceAttributes['feature']) ? Feature::from($resourceAttributes['feature']) : null, isset($resourceAttributes['filter_condition']) ? FilterCondition::from($resourceAttributes['filter_condition']) : null, @@ -1244,6 +1407,8 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['gateway_payment_method_token']) ? GatewayPaymentMethodToken::from($resourceAttributes['gateway_payment_method_token']) : null, isset($resourceAttributes['gift']) ? Gift::from($resourceAttributes['gift']) : null, isset($resourceAttributes['grant_block']) ? GrantBlock::from($resourceAttributes['grant_block']) : null, + isset($resourceAttributes['group_by_attribute']) ? GroupByAttribute::from($resourceAttributes['group_by_attribute']) : null, + isset($resourceAttributes['group_by_recommendation']) ? GroupByRecommendation::from($resourceAttributes['group_by_recommendation']) : 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, @@ -1285,8 +1450,11 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['personalized_offer']) ? PersonalizedOffer::from($resourceAttributes['personalized_offer']) : null, isset($resourceAttributes['plan']) ? Plan::from($resourceAttributes['plan']) : null, isset($resourceAttributes['portal_session']) ? PortalSession::from($resourceAttributes['portal_session']) : null, + isset($resourceAttributes['preference_variant']) ? PreferenceVariant::from($resourceAttributes['preference_variant']) : null, + isset($resourceAttributes['price_ramp']) ? PriceRamp::from($resourceAttributes['price_ramp']) : null, isset($resourceAttributes['price_variant']) ? PriceVariant::from($resourceAttributes['price_variant']) : null, isset($resourceAttributes['pricing_page_session']) ? PricingPageSession::from($resourceAttributes['pricing_page_session']) : null, + isset($resourceAttributes['private_note']) ? PrivateNote::from($resourceAttributes['private_note']) : 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, @@ -1298,8 +1466,10 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['quoted_ramp']) ? QuotedRamp::from($resourceAttributes['quoted_ramp']) : null, isset($resourceAttributes['quoted_subscription']) ? QuotedSubscription::from($resourceAttributes['quoted_subscription']) : null, isset($resourceAttributes['ramp']) ? Ramp::from($resourceAttributes['ramp']) : null, + isset($resourceAttributes['ramp_interval']) ? RampInterval::from($resourceAttributes['ramp_interval']) : null, isset($resourceAttributes['recorded_purchase']) ? RecordedPurchase::from($resourceAttributes['recorded_purchase']) : null, isset($resourceAttributes['resource_migration']) ? ResourceMigration::from($resourceAttributes['resource_migration']) : null, + isset($resourceAttributes['retry_segment']) ? RetrySegment::from($resourceAttributes['retry_segment']) : null, isset($resourceAttributes['rule']) ? Rule::from($resourceAttributes['rule']) : null, isset($resourceAttributes['site_migration_detail']) ? SiteMigrationDetail::from($resourceAttributes['site_migration_detail']) : null, isset($resourceAttributes['subscription']) ? Subscription::from($resourceAttributes['subscription']) : null, @@ -1444,6 +1614,23 @@ public function toArray(): array + + + + + + + + + + + + + + + + + @@ -1482,9 +1669,6 @@ public function toArray(): array if($this->alertstatus instanceof AlertStatus){ $data['alert_status'] = $this->alertstatus->toArray(); } - if($this->appliedbusinessrule instanceof AppliedBusinessRule){ - $data['applied_business_rule'] = $this->appliedbusinessrule->toArray(); - } if($this->appliedrule instanceof AppliedRule){ $data['applied_rule'] = $this->appliedrule->toArray(); } @@ -1527,6 +1711,18 @@ public function toArray(): array if($this->card instanceof Card){ $data['card'] = $this->card->toArray(); } + if($this->citation instanceof Citation){ + $data['citation'] = $this->citation->toArray(); + } + if($this->collectionsdispute instanceof CollectionsDispute){ + $data['collections_dispute'] = $this->collectionsdispute->toArray(); + } + if($this->collectionspaymentpromise instanceof CollectionsPaymentPromise){ + $data['collections_payment_promise'] = $this->collectionspaymentpromise->toArray(); + } + if($this->collectionsremindersequence instanceof CollectionsReminderSequence){ + $data['collections_reminder_sequence'] = $this->collectionsremindersequence->toArray(); + } if($this->columndefinition instanceof ColumnDefinition){ $data['column_definition'] = $this->columndefinition->toArray(); } @@ -1566,6 +1762,9 @@ public function toArray(): array if($this->currency instanceof Currency){ $data['currency'] = $this->currency->toArray(); } + if($this->customdata instanceof CustomData){ + $data['custom_data'] = $this->customdata->toArray(); + } if($this->customdataschema instanceof CustomDataSchema){ $data['custom_data_schema'] = $this->customdataschema->toArray(); } @@ -1587,12 +1786,27 @@ public function toArray(): array if($this->download instanceof Download){ $data['download'] = $this->download->toArray(); } + if($this->draftestimate instanceof DraftEstimate){ + $data['draft_estimate'] = $this->draftestimate->toArray(); + } + if($this->draftrequest instanceof DraftRequest){ + $data['draft_request'] = $this->draftrequest->toArray(); + } if($this->einvoice instanceof Einvoice){ $data['einvoice'] = $this->einvoice->toArray(); } + if($this->emailattachment instanceof EmailAttachment){ + $data['email_attachment'] = $this->emailattachment->toArray(); + } + if($this->emailconversation instanceof EmailConversation){ + $data['email_conversation'] = $this->emailconversation->toArray(); + } if($this->emaillog instanceof EmailLog){ $data['email_log'] = $this->emaillog->toArray(); } + if($this->emailmessage instanceof EmailMessage){ + $data['email_message'] = $this->emailmessage->toArray(); + } if($this->entitlement instanceof Entitlement){ $data['entitlement'] = $this->entitlement->toArray(); } @@ -1605,6 +1819,9 @@ public function toArray(): array if($this->event instanceof Event){ $data['event'] = $this->event->toArray(); } + if($this->execution instanceof Execution){ + $data['execution'] = $this->execution->toArray(); + } if($this->export instanceof Export){ $data['export'] = $this->export->toArray(); } @@ -1626,6 +1843,12 @@ public function toArray(): array if($this->grantblock instanceof GrantBlock){ $data['grant_block'] = $this->grantblock->toArray(); } + if($this->groupbyattribute instanceof GroupByAttribute){ + $data['group_by_attribute'] = $this->groupbyattribute->toArray(); + } + if($this->groupbyrecommendation instanceof GroupByRecommendation){ + $data['group_by_recommendation'] = $this->groupbyrecommendation->toArray(); + } if($this->hierarchy instanceof Hierarchy){ $data['hierarchy'] = $this->hierarchy->toArray(); } @@ -1749,12 +1972,21 @@ public function toArray(): array if($this->portalsession instanceof PortalSession){ $data['portal_session'] = $this->portalsession->toArray(); } + if($this->preferencevariant instanceof PreferenceVariant){ + $data['preference_variant'] = $this->preferencevariant->toArray(); + } + if($this->priceramp instanceof PriceRamp){ + $data['price_ramp'] = $this->priceramp->toArray(); + } if($this->pricevariant instanceof PriceVariant){ $data['price_variant'] = $this->pricevariant->toArray(); } if($this->pricingpagesession instanceof PricingPageSession){ $data['pricing_page_session'] = $this->pricingpagesession->toArray(); } + if($this->privatenote instanceof PrivateNote){ + $data['private_note'] = $this->privatenote->toArray(); + } if($this->promotionalcredit instanceof PromotionalCredit){ $data['promotional_credit'] = $this->promotionalcredit->toArray(); } @@ -1788,12 +2020,18 @@ public function toArray(): array if($this->ramp instanceof Ramp){ $data['ramp'] = $this->ramp->toArray(); } + if($this->rampinterval instanceof RampInterval){ + $data['ramp_interval'] = $this->rampinterval->toArray(); + } if($this->recordedpurchase instanceof RecordedPurchase){ $data['recorded_purchase'] = $this->recordedpurchase->toArray(); } if($this->resourcemigration instanceof ResourceMigration){ $data['resource_migration'] = $this->resourcemigration->toArray(); } + if($this->retrysegment instanceof RetrySegment){ + $data['retry_segment'] = $this->retrysegment->toArray(); + } if($this->rule instanceof Rule){ $data['rule'] = $this->rule->toArray(); } diff --git a/src/Resources/CustomData/CustomData.php b/src/Resources/CustomData/CustomData.php new file mode 100644 index 00000000..dff6d918 --- /dev/null +++ b/src/Resources/CustomData/CustomData.php @@ -0,0 +1,118 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "schema_id" , "schema_values" , "created_at" , "modified_at" , "updated_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $schema_id, + ?string $schema_values, + ?int $created_at, + ?int $modified_at, + ?int $updated_at, + ?\Chargebee\Enums\EntityType $entity_type, + ) + { + $this->id = $id; + $this->schema_id = $schema_id; + $this->schema_values = $schema_values; + $this->created_at = $created_at; + $this->modified_at = $modified_at; + $this->updated_at = $updated_at; + $this->entity_type = $entity_type; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['schema_id'] ?? null, + $resourceAttributes['schema_values'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['modified_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + + + isset($resourceAttributes['entity_type']) ? \Chargebee\Enums\EntityType::tryFromValue($resourceAttributes['entity_type']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'schema_id' => $this->schema_id, + 'schema_values' => $this->schema_values, + 'created_at' => $this->created_at, + 'modified_at' => $this->modified_at, + 'updated_at' => $this->updated_at, + + 'entity_type' => $this->entity_type?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/DraftEstimate/DraftEstimate.php b/src/Resources/DraftEstimate/DraftEstimate.php new file mode 100644 index 00000000..cbf35104 --- /dev/null +++ b/src/Resources/DraftEstimate/DraftEstimate.php @@ -0,0 +1,108 @@ + $knownFields + */ + protected static array $knownFields = [ "http_status" , "created_at" , "result" , "error_detail" , "revision_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?int $http_status, + ?int $created_at, + mixed $result, + mixed $error_detail, + ?int $revision_version, + ?\Chargebee\Resources\DraftEstimate\Enums\Status $status, + ) + { + $this->http_status = $http_status; + $this->created_at = $created_at; + $this->result = $result; + $this->error_detail = $error_detail; + $this->revision_version = $revision_version; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['http_status'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['result'] ?? null, + $resourceAttributes['error_detail'] ?? null, + $resourceAttributes['revision_version'] ?? null, + + + isset($resourceAttributes['status']) ? \Chargebee\Resources\DraftEstimate\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['http_status' => $this->http_status, + 'created_at' => $this->created_at, + 'result' => $this->result, + 'error_detail' => $this->error_detail, + 'revision_version' => $this->revision_version, + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/DraftEstimate/Enums/Status.php b/src/Resources/DraftEstimate/Enums/Status.php new file mode 100644 index 00000000..c129741c --- /dev/null +++ b/src/Resources/DraftEstimate/Enums/Status.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/DraftRequest/DraftRequest.php b/src/Resources/DraftRequest/DraftRequest.php new file mode 100644 index 00000000..83a27595 --- /dev/null +++ b/src/Resources/DraftRequest/DraftRequest.php @@ -0,0 +1,211 @@ + $validations + */ + public ?array $validations; + + /** + * + * @var ?bool $has_comments + */ + public ?bool $has_comments; + + /** + * + * @var ?bool $has_citations + */ + public ?bool $has_citations; + + /** + * + * @var ?array $executions + */ + public ?array $executions; + + /** + * + * @var ?\Chargebee\Resources\DraftRequest\Enums\Status $status + */ + public ?\Chargebee\Resources\DraftRequest\Enums\Status $status; + + /** + * @var array $knownFields + */ + protected static array $knownFields = [ "id" , "path_param" , "request_uri" , "operation_id" , "executed_at" , "created_at" , "resource_version" , "updated_at" , "current_revision" , "validations" , "has_comments" , "has_citations" , "executions" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $path_param, + ?string $request_uri, + ?string $operation_id, + ?int $executed_at, + ?int $created_at, + ?int $resource_version, + ?int $updated_at, + ?DraftRevision $current_revision, + ?array $validations, + ?bool $has_comments, + ?bool $has_citations, + ?array $executions, + ?\Chargebee\Resources\DraftRequest\Enums\Status $status, + ) + { + $this->id = $id; + $this->path_param = $path_param; + $this->request_uri = $request_uri; + $this->operation_id = $operation_id; + $this->executed_at = $executed_at; + $this->created_at = $created_at; + $this->resource_version = $resource_version; + $this->updated_at = $updated_at; + $this->current_revision = $current_revision; + $this->validations = $validations; + $this->has_comments = $has_comments; + $this->has_citations = $has_citations; + $this->executions = $executions; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $validations = array_map(fn (array $result): Validation => Validation::from( + $result + ), $resourceAttributes['validations'] ?? []); + + $executions = array_map(fn (array $result): Execution => Execution::from( + $result + ), $resourceAttributes['executions'] ?? []); + + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['path_param'] ?? null, + $resourceAttributes['request_uri'] ?? null, + $resourceAttributes['operation_id'] ?? null, + $resourceAttributes['executed_at'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + $resourceAttributes['updated_at'] ?? null, + isset($resourceAttributes['current_revision']) ? DraftRevision::from($resourceAttributes['current_revision']) : null, + $validations, + $resourceAttributes['has_comments'] ?? null, + $resourceAttributes['has_citations'] ?? null, + $executions, + + + isset($resourceAttributes['status']) ? \Chargebee\Resources\DraftRequest\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'path_param' => $this->path_param, + 'request_uri' => $this->request_uri, + 'operation_id' => $this->operation_id, + 'executed_at' => $this->executed_at, + 'created_at' => $this->created_at, + 'resource_version' => $this->resource_version, + 'updated_at' => $this->updated_at, + + + 'has_comments' => $this->has_comments, + 'has_citations' => $this->has_citations, + + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + if($this->current_revision instanceof DraftRevision){ + $data['current_revision'] = $this->current_revision->toArray(); + } + + if($this->validations !== []){ + $data['validations'] = array_map( + fn (Validation $validations): array => $validations->toArray(), + $this->validations + ); + } + if($this->executions !== []){ + $data['executions'] = array_map( + fn (Execution $executions): array => $executions->toArray(), + $this->executions + ); + } + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/DraftRequest/DraftRevision.php b/src/Resources/DraftRequest/DraftRevision.php new file mode 100644 index 00000000..af6d2ca5 --- /dev/null +++ b/src/Resources/DraftRequest/DraftRevision.php @@ -0,0 +1,76 @@ + $knownFields + */ + protected static array $knownFields = [ "version" , "created_at" , "payload" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?int $version, + ?int $created_at, + mixed $payload, + ) + { + $this->version = $version; + $this->created_at = $created_at; + $this->payload = $payload; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['version'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['payload'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['version' => $this->version, + 'created_at' => $this->created_at, + 'payload' => $this->payload, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/DraftRequest/Enums/ExecutionStatus.php b/src/Resources/DraftRequest/Enums/ExecutionStatus.php new file mode 100644 index 00000000..599aa256 --- /dev/null +++ b/src/Resources/DraftRequest/Enums/ExecutionStatus.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/DraftRequest/Enums/Status.php b/src/Resources/DraftRequest/Enums/Status.php new file mode 100644 index 00000000..146743a5 --- /dev/null +++ b/src/Resources/DraftRequest/Enums/Status.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/DraftRequest/Execution.php b/src/Resources/DraftRequest/Execution.php new file mode 100644 index 00000000..dfa6fbaf --- /dev/null +++ b/src/Resources/DraftRequest/Execution.php @@ -0,0 +1,96 @@ + $knownFields + */ + protected static array $knownFields = [ "status" , "created_at" , "result" , "error_detail" , "revision_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $status, + ?int $created_at, + mixed $result, + mixed $error_detail, + ?int $revision_version, + ) + { + $this->status = $status; + $this->created_at = $created_at; + $this->result = $result; + $this->error_detail = $error_detail; + $this->revision_version = $revision_version; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['status'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['result'] ?? null, + $resourceAttributes['error_detail'] ?? null, + $resourceAttributes['revision_version'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['status' => $this->status, + 'created_at' => $this->created_at, + 'result' => $this->result, + 'error_detail' => $this->error_detail, + 'revision_version' => $this->revision_version, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/DraftRequest/Validation.php b/src/Resources/DraftRequest/Validation.php new file mode 100644 index 00000000..52eee5ef --- /dev/null +++ b/src/Resources/DraftRequest/Validation.php @@ -0,0 +1,96 @@ + $knownFields + */ + protected static array $knownFields = [ "category" , "level" , "message" , "param_name" , "type" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $category, + ?string $level, + ?string $message, + ?string $param_name, + ?string $type, + ) + { + $this->category = $category; + $this->level = $level; + $this->message = $message; + $this->param_name = $param_name; + $this->type = $type; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['category'] ?? null, + $resourceAttributes['level'] ?? null, + $resourceAttributes['message'] ?? null, + $resourceAttributes['param_name'] ?? null, + $resourceAttributes['type'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['category' => $this->category, + 'level' => $this->level, + 'message' => $this->message, + 'param_name' => $this->param_name, + 'type' => $this->type, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/EmailAttachment/EmailAttachment.php b/src/Resources/EmailAttachment/EmailAttachment.php new file mode 100644 index 00000000..359bb511 --- /dev/null +++ b/src/Resources/EmailAttachment/EmailAttachment.php @@ -0,0 +1,136 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "email_message_id" , "file_name" , "content_type" , "size_bytes" , "content_disposition" , "created_at" , "updated_at" , "resource_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $email_message_id, + ?string $file_name, + ?string $content_type, + ?int $size_bytes, + ?string $content_disposition, + ?int $created_at, + ?int $updated_at, + ?int $resource_version, + ) + { + $this->id = $id; + $this->email_message_id = $email_message_id; + $this->file_name = $file_name; + $this->content_type = $content_type; + $this->size_bytes = $size_bytes; + $this->content_disposition = $content_disposition; + $this->created_at = $created_at; + $this->updated_at = $updated_at; + $this->resource_version = $resource_version; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['email_message_id'] ?? null, + $resourceAttributes['file_name'] ?? null, + $resourceAttributes['content_type'] ?? null, + $resourceAttributes['size_bytes'] ?? null, + $resourceAttributes['content_disposition'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'email_message_id' => $this->email_message_id, + 'file_name' => $this->file_name, + 'content_type' => $this->content_type, + 'size_bytes' => $this->size_bytes, + 'content_disposition' => $this->content_disposition, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + 'resource_version' => $this->resource_version, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/EmailConversation/EmailConversation.php b/src/Resources/EmailConversation/EmailConversation.php new file mode 100644 index 00000000..15ff3c89 --- /dev/null +++ b/src/Resources/EmailConversation/EmailConversation.php @@ -0,0 +1,156 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "customer_id" , "mailbox_id" , "subject" , "last_message_preview" , "message_count" , "status" , "last_message_at" , "created_at" , "updated_at" , "resource_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $customer_id, + ?string $mailbox_id, + ?string $subject, + ?string $last_message_preview, + ?int $message_count, + ?string $status, + ?int $last_message_at, + ?int $created_at, + ?int $updated_at, + ?int $resource_version, + ) + { + $this->id = $id; + $this->customer_id = $customer_id; + $this->mailbox_id = $mailbox_id; + $this->subject = $subject; + $this->last_message_preview = $last_message_preview; + $this->message_count = $message_count; + $this->status = $status; + $this->last_message_at = $last_message_at; + $this->created_at = $created_at; + $this->updated_at = $updated_at; + $this->resource_version = $resource_version; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['mailbox_id'] ?? null, + $resourceAttributes['subject'] ?? null, + $resourceAttributes['last_message_preview'] ?? null, + $resourceAttributes['message_count'] ?? null, + $resourceAttributes['status'] ?? null, + $resourceAttributes['last_message_at'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'customer_id' => $this->customer_id, + 'mailbox_id' => $this->mailbox_id, + 'subject' => $this->subject, + 'last_message_preview' => $this->last_message_preview, + 'message_count' => $this->message_count, + 'status' => $this->status, + 'last_message_at' => $this->last_message_at, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + 'resource_version' => $this->resource_version, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/EmailLog/EmailLog.php b/src/Resources/EmailLog/EmailLog.php index e53efde7..eed72027 100644 --- a/src/Resources/EmailLog/EmailLog.php +++ b/src/Resources/EmailLog/EmailLog.php @@ -45,6 +45,12 @@ class EmailLog { */ public ?string $customer_id; + /** + * + * @var ?string $email_conversation_id + */ + public ?string $email_conversation_id; + /** * * @var ?string $site_id @@ -78,7 +84,7 @@ class EmailLog { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "template_name" , "from_address" , "to_address" , "subject" , "sent_on" , "customer_id" , "site_id" , "business_entity_id" , "brand_id" , "error_message" ]; + protected static array $knownFields = [ "id" , "template_name" , "from_address" , "to_address" , "subject" , "sent_on" , "customer_id" , "email_conversation_id" , "site_id" , "business_entity_id" , "brand_id" , "error_message" ]; /** * dynamic properties for resources @@ -94,6 +100,7 @@ private function __construct( ?string $subject, ?int $sent_on, ?string $customer_id, + ?string $email_conversation_id, ?string $site_id, ?string $business_entity_id, ?string $brand_id, @@ -108,6 +115,7 @@ private function __construct( $this->subject = $subject; $this->sent_on = $sent_on; $this->customer_id = $customer_id; + $this->email_conversation_id = $email_conversation_id; $this->site_id = $site_id; $this->business_entity_id = $business_entity_id; $this->brand_id = $brand_id; @@ -124,6 +132,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['subject'] ?? null, $resourceAttributes['sent_on'] ?? null, $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['email_conversation_id'] ?? null, $resourceAttributes['site_id'] ?? null, $resourceAttributes['business_entity_id'] ?? null, $resourceAttributes['brand_id'] ?? null, @@ -147,6 +156,7 @@ public function toArray(): array 'subject' => $this->subject, 'sent_on' => $this->sent_on, 'customer_id' => $this->customer_id, + 'email_conversation_id' => $this->email_conversation_id, 'site_id' => $this->site_id, 'business_entity_id' => $this->business_entity_id, 'brand_id' => $this->brand_id, diff --git a/src/Resources/EmailMessage/Attachment.php b/src/Resources/EmailMessage/Attachment.php new file mode 100644 index 00000000..d17fd227 --- /dev/null +++ b/src/Resources/EmailMessage/Attachment.php @@ -0,0 +1,136 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "email_message_id" , "file_name" , "content_type" , "size_bytes" , "content_disposition" , "created_at" , "updated_at" , "resource_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $email_message_id, + ?string $file_name, + ?string $content_type, + ?int $size_bytes, + ?string $content_disposition, + ?int $created_at, + ?int $updated_at, + ?int $resource_version, + ) + { + $this->id = $id; + $this->email_message_id = $email_message_id; + $this->file_name = $file_name; + $this->content_type = $content_type; + $this->size_bytes = $size_bytes; + $this->content_disposition = $content_disposition; + $this->created_at = $created_at; + $this->updated_at = $updated_at; + $this->resource_version = $resource_version; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['email_message_id'] ?? null, + $resourceAttributes['file_name'] ?? null, + $resourceAttributes['content_type'] ?? null, + $resourceAttributes['size_bytes'] ?? null, + $resourceAttributes['content_disposition'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'email_message_id' => $this->email_message_id, + 'file_name' => $this->file_name, + 'content_type' => $this->content_type, + 'size_bytes' => $this->size_bytes, + 'content_disposition' => $this->content_disposition, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + 'resource_version' => $this->resource_version, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/EmailMessage/EmailMessage.php b/src/Resources/EmailMessage/EmailMessage.php new file mode 100644 index 00000000..4d10adda --- /dev/null +++ b/src/Resources/EmailMessage/EmailMessage.php @@ -0,0 +1,230 @@ + $to_emails + */ + public ?array $to_emails; + + /** + * + * @var ?array $cc_emails + */ + public ?array $cc_emails; + + /** + * + * @var ?array $attachments + */ + public ?array $attachments; + + /** + * + * @var ?\Chargebee\Resources\EmailMessage\Enums\AuthorType $author_type + */ + public ?\Chargebee\Resources\EmailMessage\Enums\AuthorType $author_type; + + /** + * + * @var ?\Chargebee\Resources\EmailMessage\Enums\SendStatus $send_status + */ + public ?\Chargebee\Resources\EmailMessage\Enums\SendStatus $send_status; + + /** + * @var array $knownFields + */ + protected static array $knownFields = [ "id" , "email_conversation_id" , "message_type" , "content_html" , "content_text" , "created_at" , "updated_at" , "resource_version" , "mailbox_id" , "author_id" , "author_name" , "from_email" , "to_emails" , "cc_emails" , "attachments" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $email_conversation_id, + ?string $message_type, + ?string $content_html, + ?string $content_text, + ?int $created_at, + ?int $updated_at, + ?int $resource_version, + ?string $mailbox_id, + ?string $author_id, + ?string $author_name, + ?string $from_email, + ?array $to_emails, + ?array $cc_emails, + ?array $attachments, + ?\Chargebee\Resources\EmailMessage\Enums\AuthorType $author_type, + ?\Chargebee\Resources\EmailMessage\Enums\SendStatus $send_status, + ) + { + $this->id = $id; + $this->email_conversation_id = $email_conversation_id; + $this->message_type = $message_type; + $this->content_html = $content_html; + $this->content_text = $content_text; + $this->created_at = $created_at; + $this->updated_at = $updated_at; + $this->resource_version = $resource_version; + $this->mailbox_id = $mailbox_id; + $this->author_id = $author_id; + $this->author_name = $author_name; + $this->from_email = $from_email; + $this->to_emails = $to_emails; + $this->cc_emails = $cc_emails; + $this->attachments = $attachments; + $this->author_type = $author_type; + $this->send_status = $send_status; + } + + public static function from(array $resourceAttributes): self + { + $attachments = array_map(fn (array $result): Attachment => Attachment::from( + $result + ), $resourceAttributes['attachments'] ?? []); + + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['email_conversation_id'] ?? null, + $resourceAttributes['message_type'] ?? null, + $resourceAttributes['content_html'] ?? null, + $resourceAttributes['content_text'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + $resourceAttributes['mailbox_id'] ?? null, + $resourceAttributes['author_id'] ?? null, + $resourceAttributes['author_name'] ?? null, + $resourceAttributes['from_email'] ?? null, + $resourceAttributes['to_emails'] ?? null, + $resourceAttributes['cc_emails'] ?? null, + $attachments, + + + isset($resourceAttributes['author_type']) ? \Chargebee\Resources\EmailMessage\Enums\AuthorType::tryFromValue($resourceAttributes['author_type']) : null, + + isset($resourceAttributes['send_status']) ? \Chargebee\Resources\EmailMessage\Enums\SendStatus::tryFromValue($resourceAttributes['send_status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'email_conversation_id' => $this->email_conversation_id, + 'message_type' => $this->message_type, + 'content_html' => $this->content_html, + 'content_text' => $this->content_text, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + 'resource_version' => $this->resource_version, + 'mailbox_id' => $this->mailbox_id, + 'author_id' => $this->author_id, + 'author_name' => $this->author_name, + 'from_email' => $this->from_email, + 'to_emails' => $this->to_emails, + 'cc_emails' => $this->cc_emails, + + + 'author_type' => $this->author_type?->value, + + 'send_status' => $this->send_status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + if($this->attachments !== []){ + $data['attachments'] = array_map( + fn (Attachment $attachments): array => $attachments->toArray(), + $this->attachments + ); + } + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/EmailMessage/Enums/AuthorType.php b/src/Resources/EmailMessage/Enums/AuthorType.php new file mode 100644 index 00000000..87334719 --- /dev/null +++ b/src/Resources/EmailMessage/Enums/AuthorType.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/src/Resources/EmailMessage/Enums/SendStatus.php b/src/Resources/EmailMessage/Enums/SendStatus.php new file mode 100644 index 00000000..1c657e9c --- /dev/null +++ b/src/Resources/EmailMessage/Enums/SendStatus.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/src/Resources/Execution/Enums/Status.php b/src/Resources/Execution/Enums/Status.php new file mode 100644 index 00000000..ee72def1 --- /dev/null +++ b/src/Resources/Execution/Enums/Status.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/Execution/Execution.php b/src/Resources/Execution/Execution.php new file mode 100644 index 00000000..73d1171a --- /dev/null +++ b/src/Resources/Execution/Execution.php @@ -0,0 +1,98 @@ + $knownFields + */ + protected static array $knownFields = [ "created_at" , "result" , "error_detail" , "revision_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?int $created_at, + mixed $result, + mixed $error_detail, + ?int $revision_version, + ?\Chargebee\Resources\Execution\Enums\Status $status, + ) + { + $this->created_at = $created_at; + $this->result = $result; + $this->error_detail = $error_detail; + $this->revision_version = $revision_version; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['created_at'] ?? null, + $resourceAttributes['result'] ?? null, + $resourceAttributes['error_detail'] ?? null, + $resourceAttributes['revision_version'] ?? null, + + + isset($resourceAttributes['status']) ? \Chargebee\Resources\Execution\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['created_at' => $this->created_at, + 'result' => $this->result, + 'error_detail' => $this->error_detail, + 'revision_version' => $this->revision_version, + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/GatewayPaymentMethodToken/Enums/Status.php b/src/Resources/GatewayPaymentMethodToken/Enums/Status.php index ed9d7204..73d8286c 100644 --- a/src/Resources/GatewayPaymentMethodToken/Enums/Status.php +++ b/src/Resources/GatewayPaymentMethodToken/Enums/Status.php @@ -3,8 +3,8 @@ namespace Chargebee\Resources\GatewayPaymentMethodToken\Enums; enum Status : string { - case ACTIVE = "active"; - case INACTIVE = "inactive"; + case VALID = "valid"; + case INVALID = "invalid"; case PENDING_VERIFICATION = "pending_verification"; case UNKNOWN = "unknown"; diff --git a/src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php b/src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php index 8f9f8bfe..d3c109d9 100644 --- a/src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php +++ b/src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php @@ -41,9 +41,9 @@ class GatewayPaymentMethodToken { /** * - * @var ?\Chargebee\Enums\GatewayName $gateway_name + * @var ?\Chargebee\Enums\Gateway $gateway */ - public ?\Chargebee\Enums\GatewayName $gateway_name; + public ?\Chargebee\Enums\Gateway $gateway; /** * @@ -69,7 +69,7 @@ private function __construct( ?string $gateway_token, ?int $created_at, ?int $updated_at, - ?\Chargebee\Enums\GatewayName $gateway_name, + ?\Chargebee\Enums\Gateway $gateway, ?\Chargebee\Resources\GatewayPaymentMethodToken\Enums\Status $status, ) { @@ -79,7 +79,7 @@ private function __construct( $this->gateway_token = $gateway_token; $this->created_at = $created_at; $this->updated_at = $updated_at; - $this->gateway_name = $gateway_name; + $this->gateway = $gateway; $this->status = $status; } @@ -93,7 +93,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['updated_at'] ?? null, - isset($resourceAttributes['gateway_name']) ? \Chargebee\Enums\GatewayName::tryFromValue($resourceAttributes['gateway_name']) : null, + isset($resourceAttributes['gateway']) ? \Chargebee\Enums\Gateway::tryFromValue($resourceAttributes['gateway']) : null, isset($resourceAttributes['status']) ? \Chargebee\Resources\GatewayPaymentMethodToken\Enums\Status::tryFromValue($resourceAttributes['status']) : null, @@ -112,7 +112,7 @@ public function toArray(): array 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, - 'gateway_name' => $this->gateway_name?->value, + 'gateway' => $this->gateway?->value, 'status' => $this->status?->value, diff --git a/src/Resources/GroupByAttribute/Enums/WarningReasons.php b/src/Resources/GroupByAttribute/Enums/WarningReasons.php new file mode 100644 index 00000000..9b90c4ce --- /dev/null +++ b/src/Resources/GroupByAttribute/Enums/WarningReasons.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/GroupByAttribute/GroupByAttribute.php b/src/Resources/GroupByAttribute/GroupByAttribute.php new file mode 100644 index 00000000..859cf0b2 --- /dev/null +++ b/src/Resources/GroupByAttribute/GroupByAttribute.php @@ -0,0 +1,144 @@ + $sample_values + */ + public ?array $sample_values; + + /** + * + * @var array<\Chargebee\Enums\WarningReason> + */ + public array $warning_reasons; + + /** + * @var array $knownFields + */ + protected static array $knownFields = [ "attribute_name" , "rank" , "coverage_percent" , "cardinality" , "remaining_value_count" , "warning" , "sample_values" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $attribute_name, + ?int $rank, + ?int $coverage_percent, + ?int $cardinality, + ?int $remaining_value_count, + ?bool $warning, + ?array $sample_values, + ?array $warning_reasons, + + ) + { + $this->attribute_name = $attribute_name; + $this->rank = $rank; + $this->coverage_percent = $coverage_percent; + $this->cardinality = $cardinality; + $this->remaining_value_count = $remaining_value_count; + $this->warning = $warning; + $this->sample_values = $sample_values; + $this->warning_reasons = $warning_reasons; + + } + + public static function from(array $resourceAttributes): self + { + $warningReasons = []; + if (!empty($resourceAttributes['warning_reasons']) && is_array($resourceAttributes['warning_reasons'])) { + foreach ($resourceAttributes['warning_reasons'] as $enumValue) { + $enabledEvents[] = \Chargebee\Enums\WarningReason::tryFromValue($enumValue); + } + } + + $returnData = new self( $resourceAttributes['attribute_name'] ?? null, + $resourceAttributes['rank'] ?? null, + $resourceAttributes['coverage_percent'] ?? null, + $resourceAttributes['cardinality'] ?? null, + $resourceAttributes['remaining_value_count'] ?? null, + $resourceAttributes['warning'] ?? null, + $resourceAttributes['sample_values'] ?? null, + + + $warningReasons, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $warningReasons = []; + foreach ($this->warning_reasons as $enumValue) { + if ($enumValue instanceof \Chargebee\Enums\WarningReason) { + $warningReasons[] = $enumValue->value; + } + } + + $data = array_filter(['attribute_name' => $this->attribute_name, + 'rank' => $this->rank, + 'coverage_percent' => $this->coverage_percent, + 'cardinality' => $this->cardinality, + 'remaining_value_count' => $this->remaining_value_count, + 'warning' => $this->warning, + 'sample_values' => $this->sample_values, + + 'warning_reasons' => $warningReasons, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/GroupByRecommendation/GroupByRecommendation.php b/src/Resources/GroupByRecommendation/GroupByRecommendation.php new file mode 100644 index 00000000..43ae2e45 --- /dev/null +++ b/src/Resources/GroupByRecommendation/GroupByRecommendation.php @@ -0,0 +1,76 @@ + $knownFields + */ + protected static array $knownFields = [ "attribute_name" , "rank" , "reason" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $attribute_name, + ?int $rank, + ?string $reason, + ) + { + $this->attribute_name = $attribute_name; + $this->rank = $rank; + $this->reason = $reason; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['attribute_name'] ?? null, + $resourceAttributes['rank'] ?? null, + $resourceAttributes['reason'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['attribute_name' => $this->attribute_name, + 'rank' => $this->rank, + 'reason' => $this->reason, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Invoice/Invoice.php b/src/Resources/Invoice/Invoice.php index d057e3f7..a0fa887e 100644 --- a/src/Resources/Invoice/Invoice.php +++ b/src/Resources/Invoice/Invoice.php @@ -310,6 +310,12 @@ class Invoice extends SupportsCustomFields { */ public ?array $reference_transactions; + /** + * + * @var ?string $retry_segment_id + */ + public ?string $retry_segment_id; + /** * * @var ?array $dunning_attempts @@ -439,7 +445,7 @@ class Invoice extends SupportsCustomFields { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "customer_id" , "payment_owner" , "subscription_id" , "recurring" , "date" , "due_date" , "net_term_days" , "po_number" , "vat_number" , "exchange_rate" , "local_currency_exchange_rate" , "currency_code" , "local_currency_code" , "tax" , "sub_total" , "sub_total_in_local_currency" , "total" , "total_in_local_currency" , "amount_due" , "amount_adjusted" , "amount_paid" , "paid_at" , "write_off_amount" , "credits_applied" , "next_retry_at" , "voided_at" , "resource_version" , "updated_at" , "line_items_next_offset" , "exchange_rates" , "first_invoice" , "new_sales_amount" , "has_advance_charges" , "term_finalized" , "is_gifted" , "generated_at" , "expected_payment_date" , "amount_to_collect" , "round_off_amount" , "line_items" , "line_item_tiers" , "line_item_discounts" , "line_item_taxes" , "line_item_credits" , "line_item_addresses" , "discounts" , "taxes" , "tax_origin" , "linked_payments" , "reference_transactions" , "dunning_attempts" , "applied_credits" , "adjustment_credit_notes" , "issued_credit_notes" , "linked_orders" , "notes" , "shipping_address" , "billing_address" , "statement_descriptor" , "einvoice" , "void_reason_code" , "deleted" , "tax_category" , "vat_number_prefix" , "business_entity_id" , "brand_id" , "site_details_at_creation" ]; + protected static array $knownFields = [ "id" , "customer_id" , "payment_owner" , "subscription_id" , "recurring" , "date" , "due_date" , "net_term_days" , "po_number" , "vat_number" , "exchange_rate" , "local_currency_exchange_rate" , "currency_code" , "local_currency_code" , "tax" , "sub_total" , "sub_total_in_local_currency" , "total" , "total_in_local_currency" , "amount_due" , "amount_adjusted" , "amount_paid" , "paid_at" , "write_off_amount" , "credits_applied" , "next_retry_at" , "voided_at" , "resource_version" , "updated_at" , "line_items_next_offset" , "exchange_rates" , "first_invoice" , "new_sales_amount" , "has_advance_charges" , "term_finalized" , "is_gifted" , "generated_at" , "expected_payment_date" , "amount_to_collect" , "round_off_amount" , "line_items" , "line_item_tiers" , "line_item_discounts" , "line_item_taxes" , "line_item_credits" , "line_item_addresses" , "discounts" , "taxes" , "tax_origin" , "linked_payments" , "reference_transactions" , "retry_segment_id" , "dunning_attempts" , "applied_credits" , "adjustment_credit_notes" , "issued_credit_notes" , "linked_orders" , "notes" , "shipping_address" , "billing_address" , "statement_descriptor" , "einvoice" , "void_reason_code" , "deleted" , "tax_category" , "vat_number_prefix" , "business_entity_id" , "brand_id" , "site_details_at_creation" ]; /** * dynamic properties for resources @@ -499,6 +505,7 @@ private function __construct( ?TaxOrigin $tax_origin, ?array $linked_payments, ?array $reference_transactions, + ?string $retry_segment_id, ?array $dunning_attempts, ?array $applied_credits, ?array $adjustment_credit_notes, @@ -573,6 +580,7 @@ private function __construct( $this->tax_origin = $tax_origin; $this->linked_payments = $linked_payments; $this->reference_transactions = $reference_transactions; + $this->retry_segment_id = $retry_segment_id; $this->dunning_attempts = $dunning_attempts; $this->applied_credits = $applied_credits; $this->adjustment_credit_notes = $adjustment_credit_notes; @@ -717,6 +725,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['tax_origin']) ? TaxOrigin::from($resourceAttributes['tax_origin']) : null, $linked_payments, $reference_transactions, + $resourceAttributes['retry_segment_id'] ?? null, $dunning_attempts, $applied_credits, $adjustment_credit_notes, @@ -807,6 +816,7 @@ public function toArray(): array + 'retry_segment_id' => $this->retry_segment_id, diff --git a/src/Resources/ItemPrice/ItemPrice.php b/src/Resources/ItemPrice/ItemPrice.php index 46a2d10f..8eadcebb 100644 --- a/src/Resources/ItemPrice/ItemPrice.php +++ b/src/Resources/ItemPrice/ItemPrice.php @@ -46,6 +46,12 @@ class ItemPrice extends SupportsCustomFields { */ public ?string $price_variant_id; + /** + * + * @var ?string $price_ramp_id + */ + public ?string $price_ramp_id; + /** * * @var ?int $price @@ -265,7 +271,7 @@ class ItemPrice extends SupportsCustomFields { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "name" , "item_family_id" , "item_id" , "description" , "external_name" , "price_variant_id" , "price" , "price_in_decimal" , "period" , "currency_code" , "trial_period" , "shipping_period" , "billing_cycles" , "free_quantity" , "free_quantity_in_decimal" , "resource_version" , "updated_at" , "created_at" , "archived_at" , "invoice_notes" , "tiers" , "is_taxable" , "tax_detail" , "tax_providers_fields" , "accounting_detail" , "metadata" , "archivable" , "parent_item_id" , "show_description_in_invoices" , "show_description_in_quotes" , "deleted" , "business_entity_id" ]; + protected static array $knownFields = [ "id" , "name" , "item_family_id" , "item_id" , "description" , "external_name" , "price_variant_id" , "price_ramp_id" , "price" , "price_in_decimal" , "period" , "currency_code" , "trial_period" , "shipping_period" , "billing_cycles" , "free_quantity" , "free_quantity_in_decimal" , "resource_version" , "updated_at" , "created_at" , "archived_at" , "invoice_notes" , "tiers" , "is_taxable" , "tax_detail" , "tax_providers_fields" , "accounting_detail" , "metadata" , "archivable" , "parent_item_id" , "show_description_in_invoices" , "show_description_in_quotes" , "deleted" , "business_entity_id" ]; /** * dynamic properties for resources @@ -281,6 +287,7 @@ private function __construct( ?string $description, ?string $external_name, ?string $price_variant_id, + ?string $price_ramp_id, ?int $price, ?string $price_in_decimal, ?int $period, @@ -326,6 +333,7 @@ private function __construct( $this->description = $description; $this->external_name = $external_name; $this->price_variant_id = $price_variant_id; + $this->price_ramp_id = $price_ramp_id; $this->price = $price; $this->price_in_decimal = $price_in_decimal; $this->period = $period; @@ -381,6 +389,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['description'] ?? null, $resourceAttributes['external_name'] ?? null, $resourceAttributes['price_variant_id'] ?? null, + $resourceAttributes['price_ramp_id'] ?? null, $resourceAttributes['price'] ?? null, $resourceAttributes['price_in_decimal'] ?? null, $resourceAttributes['period'] ?? null, @@ -448,6 +457,7 @@ public function toArray(): array 'description' => $this->description, 'external_name' => $this->external_name, 'price_variant_id' => $this->price_variant_id, + 'price_ramp_id' => $this->price_ramp_id, 'price' => $this->price, 'price_in_decimal' => $this->price_in_decimal, 'period' => $this->period, diff --git a/src/Resources/Meter/Meter.php b/src/Resources/Meter/Meter.php index 64f19ffd..ae499a9e 100644 --- a/src/Resources/Meter/Meter.php +++ b/src/Resources/Meter/Meter.php @@ -51,6 +51,12 @@ class Meter { */ public ?array $features; + /** + * + * @var ?array $group_by + */ + public ?array $group_by; + /** * * @var ?\Chargebee\Resources\Meter\Enums\Type $type @@ -66,7 +72,7 @@ class Meter { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "name" , "description" , "query" , "created_at" , "updated_at" , "column_definitions" , "features" ]; + protected static array $knownFields = [ "id" , "name" , "description" , "query" , "created_at" , "updated_at" , "column_definitions" , "features" , "group_by" ]; /** * dynamic properties for resources @@ -83,6 +89,7 @@ private function __construct( ?int $updated_at, ?array $column_definitions, ?array $features, + ?array $group_by, ?\Chargebee\Resources\Meter\Enums\Type $type, ?\Chargebee\Resources\Meter\Enums\Status $status, ) @@ -94,7 +101,8 @@ private function __construct( $this->created_at = $created_at; $this->updated_at = $updated_at; $this->column_definitions = $column_definitions; - $this->features = $features; + $this->features = $features; + $this->group_by = $group_by; $this->type = $type; $this->status = $status; } @@ -117,6 +125,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['updated_at'] ?? null, $column_definitions, $features, + $resourceAttributes['group_by'] ?? null, isset($resourceAttributes['type']) ? \Chargebee\Resources\Meter\Enums\Type::tryFromValue($resourceAttributes['type']) : null, @@ -139,6 +148,7 @@ public function toArray(): array 'updated_at' => $this->updated_at, + 'group_by' => $this->group_by, 'type' => $this->type?->value, diff --git a/src/Resources/MeteredFeature/MeteredFeature.php b/src/Resources/MeteredFeature/MeteredFeature.php index 56388e55..1341059c 100644 --- a/src/Resources/MeteredFeature/MeteredFeature.php +++ b/src/Resources/MeteredFeature/MeteredFeature.php @@ -33,6 +33,12 @@ class MeteredFeature { */ public ?array $column_definitions; + /** + * + * @var ?array $group_by + */ + public ?array $group_by; + /** * * @var ?array<\Chargebee\Resources\Feature\Feature> $features @@ -54,7 +60,7 @@ class MeteredFeature { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "name" , "description" , "query" , "column_definitions" , "features" ]; + protected static array $knownFields = [ "id" , "name" , "description" , "query" , "column_definitions" , "group_by" , "features" ]; /** * dynamic properties for resources @@ -68,6 +74,7 @@ private function __construct( ?string $description, ?string $query, ?array $column_definitions, + ?array $group_by, ?array $features, ?\Chargebee\Enums\Type $type, ?\Chargebee\Enums\Status $status, @@ -78,6 +85,7 @@ private function __construct( $this->description = $description; $this->query = $query; $this->column_definitions = $column_definitions; + $this->group_by = $group_by; $this->features = $features; $this->type = $type; $this->status = $status; @@ -98,6 +106,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['description'] ?? null, $resourceAttributes['query'] ?? null, $column_definitions, + $resourceAttributes['group_by'] ?? null, $features, @@ -118,6 +127,7 @@ public function toArray(): array 'description' => $this->description, 'query' => $this->query, + 'group_by' => $this->group_by, 'type' => $this->type?->value, diff --git a/src/Resources/OmnichannelOneTimeOrder/Enums/Source.php b/src/Resources/OmnichannelOneTimeOrder/Enums/Source.php index ea149a5d..281f3a24 100644 --- a/src/Resources/OmnichannelOneTimeOrder/Enums/Source.php +++ b/src/Resources/OmnichannelOneTimeOrder/Enums/Source.php @@ -5,6 +5,8 @@ enum Source : string { case APPLE_APP_STORE = "apple_app_store"; case GOOGLE_PLAY_STORE = "google_play_store"; + case ROKU = "roku"; + case AMAZON_APP_STORE = "amazon_app_store"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/OmnichannelSubscription/Enums/OmnichannelSubscriptionItemCancellationReason.php b/src/Resources/OmnichannelSubscription/Enums/OmnichannelSubscriptionItemCancellationReason.php index c282185a..9a18fe86 100644 --- a/src/Resources/OmnichannelSubscription/Enums/OmnichannelSubscriptionItemCancellationReason.php +++ b/src/Resources/OmnichannelSubscription/Enums/OmnichannelSubscriptionItemCancellationReason.php @@ -8,6 +8,7 @@ enum OmnichannelSubscriptionItemCancellationReason : string { case REFUNDED_DUE_TO_APP_ISSUE = "refunded_due_to_app_issue"; case REFUNDED_FOR_OTHER_REASON = "refunded_for_other_reason"; case MERCHANT_REVOKED = "merchant_revoked"; + case OTHER = "other"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/OmnichannelSubscription/Enums/Source.php b/src/Resources/OmnichannelSubscription/Enums/Source.php index 1671447a..38461e12 100644 --- a/src/Resources/OmnichannelSubscription/Enums/Source.php +++ b/src/Resources/OmnichannelSubscription/Enums/Source.php @@ -5,6 +5,8 @@ enum Source : string { case APPLE_APP_STORE = "apple_app_store"; case GOOGLE_PLAY_STORE = "google_play_store"; + case ROKU = "roku"; + case AMAZON_APP_STORE = "amazon_app_store"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/OmnichannelSubscription/OmnichannelSubscription.php b/src/Resources/OmnichannelSubscription/OmnichannelSubscription.php index 044406d6..2b039087 100644 --- a/src/Resources/OmnichannelSubscription/OmnichannelSubscription.php +++ b/src/Resources/OmnichannelSubscription/OmnichannelSubscription.php @@ -27,6 +27,12 @@ class OmnichannelSubscription { */ public ?string $customer_id; + /** + * + * @var ?string $origin + */ + public ?string $origin; + /** * * @var ?int $created_at @@ -72,7 +78,7 @@ class OmnichannelSubscription { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "id_at_source" , "app_id" , "customer_id" , "created_at" , "purchased_at" , "updated_at" , "resource_version" , "omnichannel_subscription_items" , "initial_purchase_transaction" ]; + protected static array $knownFields = [ "id" , "id_at_source" , "app_id" , "customer_id" , "origin" , "created_at" , "purchased_at" , "updated_at" , "resource_version" , "omnichannel_subscription_items" , "initial_purchase_transaction" ]; /** * dynamic properties for resources @@ -85,6 +91,7 @@ private function __construct( ?string $id_at_source, ?string $app_id, ?string $customer_id, + ?string $origin, ?int $created_at, ?int $purchased_at, ?int $updated_at, @@ -98,6 +105,7 @@ private function __construct( $this->id_at_source = $id_at_source; $this->app_id = $app_id; $this->customer_id = $customer_id; + $this->origin = $origin; $this->created_at = $created_at; $this->purchased_at = $purchased_at; $this->updated_at = $updated_at; @@ -117,6 +125,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['id_at_source'] ?? null, $resourceAttributes['app_id'] ?? null, $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['origin'] ?? null, $resourceAttributes['created_at'] ?? null, $resourceAttributes['purchased_at'] ?? null, $resourceAttributes['updated_at'] ?? null, @@ -139,6 +148,7 @@ public function toArray(): array 'id_at_source' => $this->id_at_source, 'app_id' => $this->app_id, 'customer_id' => $this->customer_id, + 'origin' => $this->origin, 'created_at' => $this->created_at, 'purchased_at' => $this->purchased_at, 'updated_at' => $this->updated_at, diff --git a/src/Resources/OmnichannelSubscriptionItem/Enums/CancellationReason.php b/src/Resources/OmnichannelSubscriptionItem/Enums/CancellationReason.php index d329144c..8ccfd712 100644 --- a/src/Resources/OmnichannelSubscriptionItem/Enums/CancellationReason.php +++ b/src/Resources/OmnichannelSubscriptionItem/Enums/CancellationReason.php @@ -8,6 +8,7 @@ enum CancellationReason : string { case REFUNDED_DUE_TO_APP_ISSUE = "refunded_due_to_app_issue"; case REFUNDED_FOR_OTHER_REASON = "refunded_for_other_reason"; case MERCHANT_REVOKED = "merchant_revoked"; + case OTHER = "other"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/OmnichannelSubscriptionItem/OmnichannelSubscriptionItem.php b/src/Resources/OmnichannelSubscriptionItem/OmnichannelSubscriptionItem.php index a63c00f3..677a070a 100644 --- a/src/Resources/OmnichannelSubscriptionItem/OmnichannelSubscriptionItem.php +++ b/src/Resources/OmnichannelSubscriptionItem/OmnichannelSubscriptionItem.php @@ -39,12 +39,24 @@ class OmnichannelSubscriptionItem { */ public ?int $expired_at; + /** + * + * @var ?string $expiration_reason_at_source + */ + public ?string $expiration_reason_at_source; + /** * * @var ?int $cancelled_at */ public ?int $cancelled_at; + /** + * + * @var ?string $cancellation_reason_at_source + */ + public ?string $cancellation_reason_at_source; + /** * * @var ?int $grace_period_expires_at @@ -120,7 +132,7 @@ class OmnichannelSubscriptionItem { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "item_id_at_source" , "item_parent_id_at_source" , "current_term_start" , "current_term_end" , "expired_at" , "cancelled_at" , "grace_period_expires_at" , "resumes_at" , "has_scheduled_changes" , "updated_at" , "resource_version" , "omnichannel_subscription_item_offers" , "upcoming_renewal" , "linked_item" ]; + protected static array $knownFields = [ "id" , "item_id_at_source" , "item_parent_id_at_source" , "current_term_start" , "current_term_end" , "expired_at" , "expiration_reason_at_source" , "cancelled_at" , "cancellation_reason_at_source" , "grace_period_expires_at" , "resumes_at" , "has_scheduled_changes" , "updated_at" , "resource_version" , "omnichannel_subscription_item_offers" , "upcoming_renewal" , "linked_item" ]; /** * dynamic properties for resources @@ -135,7 +147,9 @@ private function __construct( ?int $current_term_start, ?int $current_term_end, ?int $expired_at, + ?string $expiration_reason_at_source, ?int $cancelled_at, + ?string $cancellation_reason_at_source, ?int $grace_period_expires_at, ?int $resumes_at, ?bool $has_scheduled_changes, @@ -156,7 +170,9 @@ private function __construct( $this->current_term_start = $current_term_start; $this->current_term_end = $current_term_end; $this->expired_at = $expired_at; + $this->expiration_reason_at_source = $expiration_reason_at_source; $this->cancelled_at = $cancelled_at; + $this->cancellation_reason_at_source = $cancellation_reason_at_source; $this->grace_period_expires_at = $grace_period_expires_at; $this->resumes_at = $resumes_at; $this->has_scheduled_changes = $has_scheduled_changes; @@ -183,7 +199,9 @@ public static function from(array $resourceAttributes): self $resourceAttributes['current_term_start'] ?? null, $resourceAttributes['current_term_end'] ?? null, $resourceAttributes['expired_at'] ?? null, + $resourceAttributes['expiration_reason_at_source'] ?? null, $resourceAttributes['cancelled_at'] ?? null, + $resourceAttributes['cancellation_reason_at_source'] ?? null, $resourceAttributes['grace_period_expires_at'] ?? null, $resourceAttributes['resumes_at'] ?? null, $resourceAttributes['has_scheduled_changes'] ?? null, @@ -216,7 +234,9 @@ public function toArray(): array 'current_term_start' => $this->current_term_start, 'current_term_end' => $this->current_term_end, 'expired_at' => $this->expired_at, + 'expiration_reason_at_source' => $this->expiration_reason_at_source, 'cancelled_at' => $this->cancelled_at, + 'cancellation_reason_at_source' => $this->cancellation_reason_at_source, 'grace_period_expires_at' => $this->grace_period_expires_at, 'resumes_at' => $this->resumes_at, 'has_scheduled_changes' => $this->has_scheduled_changes, diff --git a/src/Resources/PaymentSchedule/Enums/ScheduleEntryStatus.php b/src/Resources/PaymentSchedule/Enums/ScheduleEntryStatus.php index 45b99e7e..021ca331 100644 --- a/src/Resources/PaymentSchedule/Enums/ScheduleEntryStatus.php +++ b/src/Resources/PaymentSchedule/Enums/ScheduleEntryStatus.php @@ -6,6 +6,7 @@ enum ScheduleEntryStatus : string { case POSTED = "posted"; case PAYMENT_DUE = "payment_due"; case PAID = "paid"; + case VOIDED = "voided"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/PaymentScheduleEstimate/Enums/ScheduleEntryStatus.php b/src/Resources/PaymentScheduleEstimate/Enums/ScheduleEntryStatus.php index 043e0c70..63aa7437 100644 --- a/src/Resources/PaymentScheduleEstimate/Enums/ScheduleEntryStatus.php +++ b/src/Resources/PaymentScheduleEstimate/Enums/ScheduleEntryStatus.php @@ -6,6 +6,7 @@ enum ScheduleEntryStatus : string { case POSTED = "posted"; case PAYMENT_DUE = "payment_due"; case PAID = "paid"; + case VOIDED = "voided"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/PaymentSource/NetworkTransactionReference.php b/src/Resources/PaymentSource/NetworkTransactionReference.php index 6ab22155..be57404a 100644 --- a/src/Resources/PaymentSource/NetworkTransactionReference.php +++ b/src/Resources/PaymentSource/NetworkTransactionReference.php @@ -9,10 +9,16 @@ class NetworkTransactionReference { */ public ?string $original_network_transaction_id; + /** + * + * @var ?string $transaction_link_id + */ + public ?string $transaction_link_id; + /** * @var array $knownFields */ - protected static array $knownFields = [ "original_network_transaction_id" ]; + protected static array $knownFields = [ "original_network_transaction_id" , "transaction_link_id" ]; /** * dynamic properties for resources @@ -22,14 +28,17 @@ class NetworkTransactionReference { private function __construct( ?string $original_network_transaction_id, + ?string $transaction_link_id, ) { - $this->original_network_transaction_id = $original_network_transaction_id; + $this->original_network_transaction_id = $original_network_transaction_id; + $this->transaction_link_id = $transaction_link_id; } public static function from(array $resourceAttributes): self { $returnData = new self( $resourceAttributes['original_network_transaction_id'] ?? null, + $resourceAttributes['transaction_link_id'] ?? null, ); @@ -41,6 +50,7 @@ public function toArray(): array { $data = array_filter(['original_network_transaction_id' => $this->original_network_transaction_id, + 'transaction_link_id' => $this->transaction_link_id, ], function ($value) { return $value !== null; diff --git a/src/Resources/PreferenceVariant/PreferenceVariant.php b/src/Resources/PreferenceVariant/PreferenceVariant.php new file mode 100644 index 00000000..d9c7eb9c --- /dev/null +++ b/src/Resources/PreferenceVariant/PreferenceVariant.php @@ -0,0 +1,76 @@ + $knownFields + */ + protected static array $knownFields = [ "value" , "allow_override_in_interface" , "allow_override_in_api" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $value, + ?bool $allow_override_in_interface, + ?bool $allow_override_in_api, + ) + { + $this->value = $value; + $this->allow_override_in_interface = $allow_override_in_interface; + $this->allow_override_in_api = $allow_override_in_api; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['value'] ?? null, + $resourceAttributes['allow_override_in_interface'] ?? null, + $resourceAttributes['allow_override_in_api'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['value' => $this->value, + 'allow_override_in_interface' => $this->allow_override_in_interface, + 'allow_override_in_api' => $this->allow_override_in_api, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/PriceRamp/Enums/Status.php b/src/Resources/PriceRamp/Enums/Status.php new file mode 100644 index 00000000..d64e163e --- /dev/null +++ b/src/Resources/PriceRamp/Enums/Status.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/src/Resources/PriceRamp/PriceRamp.php b/src/Resources/PriceRamp/PriceRamp.php new file mode 100644 index 00000000..d4c72514 --- /dev/null +++ b/src/Resources/PriceRamp/PriceRamp.php @@ -0,0 +1,148 @@ + $ramp_intervals + */ + public ?array $ramp_intervals; + + /** + * + * @var ?string $business_entity_id + */ + public ?string $business_entity_id; + + /** + * + * @var ?\Chargebee\Resources\PriceRamp\Enums\Status $status + */ + public ?\Chargebee\Resources\PriceRamp\Enums\Status $status; + + /** + * @var array $knownFields + */ + protected static array $knownFields = [ "id" , "item_price_id" , "created_at" , "resource_version" , "updated_at" , "archived_at" , "ramp_intervals" , "business_entity_id" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $item_price_id, + ?int $created_at, + ?int $resource_version, + ?int $updated_at, + ?int $archived_at, + ?array $ramp_intervals, + ?string $business_entity_id, + ?\Chargebee\Resources\PriceRamp\Enums\Status $status, + ) + { + $this->id = $id; + $this->item_price_id = $item_price_id; + $this->created_at = $created_at; + $this->resource_version = $resource_version; + $this->updated_at = $updated_at; + $this->archived_at = $archived_at; + $this->ramp_intervals = $ramp_intervals; + $this->business_entity_id = $business_entity_id; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $ramp_intervals = array_map(fn (array $result): RampInterval => RampInterval::from( + $result + ), $resourceAttributes['ramp_intervals'] ?? []); + + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['item_price_id'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['archived_at'] ?? null, + $ramp_intervals, + $resourceAttributes['business_entity_id'] ?? null, + + + isset($resourceAttributes['status']) ? \Chargebee\Resources\PriceRamp\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'item_price_id' => $this->item_price_id, + 'created_at' => $this->created_at, + 'resource_version' => $this->resource_version, + 'updated_at' => $this->updated_at, + 'archived_at' => $this->archived_at, + + 'business_entity_id' => $this->business_entity_id, + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + if($this->ramp_intervals !== []){ + $data['ramp_intervals'] = array_map( + fn (RampInterval $ramp_intervals): array => $ramp_intervals->toArray(), + $this->ramp_intervals + ); + } + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/PriceRamp/RampInterval.php b/src/Resources/PriceRamp/RampInterval.php new file mode 100644 index 00000000..e50113e9 --- /dev/null +++ b/src/Resources/PriceRamp/RampInterval.php @@ -0,0 +1,96 @@ + $knownFields + */ + protected static array $knownFields = [ "starting_billing_cycle" , "ending_billing_cycle" , "apply_catalog_price" , "price" , "price_in_decimal" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?int $starting_billing_cycle, + ?int $ending_billing_cycle, + ?bool $apply_catalog_price, + ?int $price, + ?string $price_in_decimal, + ) + { + $this->starting_billing_cycle = $starting_billing_cycle; + $this->ending_billing_cycle = $ending_billing_cycle; + $this->apply_catalog_price = $apply_catalog_price; + $this->price = $price; + $this->price_in_decimal = $price_in_decimal; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['starting_billing_cycle'] ?? null, + $resourceAttributes['ending_billing_cycle'] ?? null, + $resourceAttributes['apply_catalog_price'] ?? null, + $resourceAttributes['price'] ?? null, + $resourceAttributes['price_in_decimal'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['starting_billing_cycle' => $this->starting_billing_cycle, + 'ending_billing_cycle' => $this->ending_billing_cycle, + 'apply_catalog_price' => $this->apply_catalog_price, + 'price' => $this->price, + 'price_in_decimal' => $this->price_in_decimal, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/PrivateNote/Enums/AuthorType.php b/src/Resources/PrivateNote/Enums/AuthorType.php new file mode 100644 index 00000000..8bafaf9c --- /dev/null +++ b/src/Resources/PrivateNote/Enums/AuthorType.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/src/Resources/PrivateNote/PrivateNote.php b/src/Resources/PrivateNote/PrivateNote.php new file mode 100644 index 00000000..be5a9d15 --- /dev/null +++ b/src/Resources/PrivateNote/PrivateNote.php @@ -0,0 +1,158 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "email_conversation_id" , "author_id" , "author_name" , "content_html" , "content_text" , "meta_data" , "created_at" , "resource_version" , "updated_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $email_conversation_id, + ?string $author_id, + ?string $author_name, + ?string $content_html, + ?string $content_text, + ?string $meta_data, + ?int $created_at, + ?int $resource_version, + ?int $updated_at, + ?\Chargebee\Resources\PrivateNote\Enums\AuthorType $author_type, + ) + { + $this->id = $id; + $this->email_conversation_id = $email_conversation_id; + $this->author_id = $author_id; + $this->author_name = $author_name; + $this->content_html = $content_html; + $this->content_text = $content_text; + $this->meta_data = $meta_data; + $this->created_at = $created_at; + $this->resource_version = $resource_version; + $this->updated_at = $updated_at; + $this->author_type = $author_type; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['email_conversation_id'] ?? null, + $resourceAttributes['author_id'] ?? null, + $resourceAttributes['author_name'] ?? null, + $resourceAttributes['content_html'] ?? null, + $resourceAttributes['content_text'] ?? null, + $resourceAttributes['meta_data'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + $resourceAttributes['updated_at'] ?? null, + + + isset($resourceAttributes['author_type']) ? \Chargebee\Resources\PrivateNote\Enums\AuthorType::tryFromValue($resourceAttributes['author_type']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'email_conversation_id' => $this->email_conversation_id, + 'author_id' => $this->author_id, + 'author_name' => $this->author_name, + 'content_html' => $this->content_html, + 'content_text' => $this->content_text, + 'meta_data' => $this->meta_data, + 'created_at' => $this->created_at, + 'resource_version' => $this->resource_version, + 'updated_at' => $this->updated_at, + + 'author_type' => $this->author_type?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Ramp/ItemsToAdd.php b/src/Resources/Ramp/ItemsToAdd.php index 6c5b0461..0e298c46 100644 --- a/src/Resources/Ramp/ItemsToAdd.php +++ b/src/Resources/Ramp/ItemsToAdd.php @@ -93,6 +93,12 @@ class ItemsToAdd { */ public ?string $charge_on_option; + /** + * + * @var ?string $description + */ + public ?string $description; + /** * * @var ?string $charge_on_event @@ -102,7 +108,7 @@ class ItemsToAdd { /** * @var array $knownFields */ - protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "unit_price" , "unit_price_in_decimal" , "amount" , "amount_in_decimal" , "free_quantity" , "free_quantity_in_decimal" , "billing_cycles" , "service_period_days" , "metered_quantity" , "charge_once" , "charge_on_option" , "charge_on_event" ]; + protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "unit_price" , "unit_price_in_decimal" , "amount" , "amount_in_decimal" , "free_quantity" , "free_quantity_in_decimal" , "billing_cycles" , "service_period_days" , "metered_quantity" , "charge_once" , "charge_on_option" , "description" , "charge_on_event" ]; /** * dynamic properties for resources @@ -126,6 +132,7 @@ private function __construct( ?string $metered_quantity, ?bool $charge_once, ?string $charge_on_option, + ?string $description, ?string $charge_on_event, ) { @@ -144,6 +151,7 @@ private function __construct( $this->metered_quantity = $metered_quantity; $this->charge_once = $charge_once; $this->charge_on_option = $charge_on_option; + $this->description = $description; $this->charge_on_event = $charge_on_event; } @@ -164,6 +172,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['metered_quantity'] ?? null, $resourceAttributes['charge_once'] ?? null, $resourceAttributes['charge_on_option'] ?? null, + $resourceAttributes['description'] ?? null, $resourceAttributes['charge_on_event'] ?? null, @@ -190,6 +199,7 @@ public function toArray(): array 'metered_quantity' => $this->metered_quantity, 'charge_once' => $this->charge_once, 'charge_on_option' => $this->charge_on_option, + 'description' => $this->description, 'charge_on_event' => $this->charge_on_event, ], function ($value) { diff --git a/src/Resources/Ramp/ItemsToUpdate.php b/src/Resources/Ramp/ItemsToUpdate.php index a5467197..7d6e0013 100644 --- a/src/Resources/Ramp/ItemsToUpdate.php +++ b/src/Resources/Ramp/ItemsToUpdate.php @@ -93,6 +93,12 @@ class ItemsToUpdate { */ public ?string $charge_on_option; + /** + * + * @var ?string $description + */ + public ?string $description; + /** * * @var ?string $charge_on_event @@ -102,7 +108,7 @@ class ItemsToUpdate { /** * @var array $knownFields */ - protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "unit_price" , "unit_price_in_decimal" , "amount" , "amount_in_decimal" , "free_quantity" , "free_quantity_in_decimal" , "billing_cycles" , "service_period_days" , "metered_quantity" , "charge_once" , "charge_on_option" , "charge_on_event" ]; + protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "unit_price" , "unit_price_in_decimal" , "amount" , "amount_in_decimal" , "free_quantity" , "free_quantity_in_decimal" , "billing_cycles" , "service_period_days" , "metered_quantity" , "charge_once" , "charge_on_option" , "description" , "charge_on_event" ]; /** * dynamic properties for resources @@ -126,6 +132,7 @@ private function __construct( ?string $metered_quantity, ?bool $charge_once, ?string $charge_on_option, + ?string $description, ?string $charge_on_event, ) { @@ -144,6 +151,7 @@ private function __construct( $this->metered_quantity = $metered_quantity; $this->charge_once = $charge_once; $this->charge_on_option = $charge_on_option; + $this->description = $description; $this->charge_on_event = $charge_on_event; } @@ -164,6 +172,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['metered_quantity'] ?? null, $resourceAttributes['charge_once'] ?? null, $resourceAttributes['charge_on_option'] ?? null, + $resourceAttributes['description'] ?? null, $resourceAttributes['charge_on_event'] ?? null, @@ -190,6 +199,7 @@ public function toArray(): array 'metered_quantity' => $this->metered_quantity, 'charge_once' => $this->charge_once, 'charge_on_option' => $this->charge_on_option, + 'description' => $this->description, 'charge_on_event' => $this->charge_on_event, ], function ($value) { diff --git a/src/Resources/RampInterval/RampInterval.php b/src/Resources/RampInterval/RampInterval.php new file mode 100644 index 00000000..207bc0eb --- /dev/null +++ b/src/Resources/RampInterval/RampInterval.php @@ -0,0 +1,96 @@ + $knownFields + */ + protected static array $knownFields = [ "starting_billing_cycle" , "ending_billing_cycle" , "apply_catalog_price" , "price" , "price_in_decimal" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?int $starting_billing_cycle, + ?int $ending_billing_cycle, + ?bool $apply_catalog_price, + ?int $price, + ?string $price_in_decimal, + ) + { + $this->starting_billing_cycle = $starting_billing_cycle; + $this->ending_billing_cycle = $ending_billing_cycle; + $this->apply_catalog_price = $apply_catalog_price; + $this->price = $price; + $this->price_in_decimal = $price_in_decimal; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['starting_billing_cycle'] ?? null, + $resourceAttributes['ending_billing_cycle'] ?? null, + $resourceAttributes['apply_catalog_price'] ?? null, + $resourceAttributes['price'] ?? null, + $resourceAttributes['price_in_decimal'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['starting_billing_cycle' => $this->starting_billing_cycle, + 'ending_billing_cycle' => $this->ending_billing_cycle, + 'apply_catalog_price' => $this->apply_catalog_price, + 'price' => $this->price, + 'price_in_decimal' => $this->price_in_decimal, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/RecordedPurchase/Enums/Source.php b/src/Resources/RecordedPurchase/Enums/Source.php index e81ed83a..416f28da 100644 --- a/src/Resources/RecordedPurchase/Enums/Source.php +++ b/src/Resources/RecordedPurchase/Enums/Source.php @@ -5,6 +5,8 @@ enum Source : string { case APPLE_APP_STORE = "apple_app_store"; case GOOGLE_PLAY_STORE = "google_play_store"; + case ROKU = "roku"; + case AMAZON_APP_STORE = "amazon_app_store"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/RetrySegment/Enums/ConditionLogic.php b/src/Resources/RetrySegment/Enums/ConditionLogic.php new file mode 100644 index 00000000..f74a4658 --- /dev/null +++ b/src/Resources/RetrySegment/Enums/ConditionLogic.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/RetrySegment/RetrySegment.php b/src/Resources/RetrySegment/RetrySegment.php new file mode 100644 index 00000000..0d414496 --- /dev/null +++ b/src/Resources/RetrySegment/RetrySegment.php @@ -0,0 +1,128 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "name" , "invoice_id" , "enabled" , "priority" , "criteria" , "retry_settings" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $name, + ?string $invoice_id, + ?bool $enabled, + ?int $priority, + mixed $criteria, + mixed $retry_settings, + ?\Chargebee\Resources\RetrySegment\Enums\ConditionLogic $condition_logic, + ) + { + $this->id = $id; + $this->name = $name; + $this->invoice_id = $invoice_id; + $this->enabled = $enabled; + $this->priority = $priority; + $this->criteria = $criteria; + $this->retry_settings = $retry_settings; + $this->condition_logic = $condition_logic; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['name'] ?? null, + $resourceAttributes['invoice_id'] ?? null, + $resourceAttributes['enabled'] ?? null, + $resourceAttributes['priority'] ?? null, + $resourceAttributes['criteria'] ?? null, + $resourceAttributes['retry_settings'] ?? null, + + + isset($resourceAttributes['condition_logic']) ? \Chargebee\Resources\RetrySegment\Enums\ConditionLogic::tryFromValue($resourceAttributes['condition_logic']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'name' => $this->name, + 'invoice_id' => $this->invoice_id, + 'enabled' => $this->enabled, + 'priority' => $this->priority, + 'criteria' => $this->criteria, + 'retry_settings' => $this->retry_settings, + + 'condition_logic' => $this->condition_logic?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Transaction/GatewayMetadata.php b/src/Resources/Transaction/GatewayMetadata.php new file mode 100644 index 00000000..c43f9707 --- /dev/null +++ b/src/Resources/Transaction/GatewayMetadata.php @@ -0,0 +1,56 @@ + $knownFields + */ + protected static array $knownFields = [ "acquirer_reference_id" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $acquirer_reference_id, + ) + { + $this->acquirer_reference_id = $acquirer_reference_id; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['acquirer_reference_id'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['acquirer_reference_id' => $this->acquirer_reference_id, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Transaction/Transaction.php b/src/Resources/Transaction/Transaction.php index e3321dfe..1018bf94 100644 --- a/src/Resources/Transaction/Transaction.php +++ b/src/Resources/Transaction/Transaction.php @@ -225,6 +225,12 @@ class Transaction { */ public ?string $payment_method_details; + /** + * + * @var ?GatewayMetadata $gateway_metadata + */ + public ?GatewayMetadata $gateway_metadata; + /** * * @var ?GatewayErrorDetail $error_detail @@ -288,7 +294,7 @@ class Transaction { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "customer_id" , "subscription_id" , "gateway_account_id" , "payment_source_id" , "reference_number" , "date" , "settled_at" , "exchange_rate" , "currency_code" , "amount" , "id_at_gateway" , "three_d_secure" , "error_code" , "error_text" , "voided_at" , "resource_version" , "updated_at" , "fraud_reason" , "custom_payment_method_id" , "amount_unused" , "masked_card_number" , "reference_transaction_id" , "refunded_txn_id" , "reference_authorization_id" , "amount_capturable" , "reversal_transaction_id" , "linked_invoices" , "linked_credit_notes" , "linked_refunds" , "linked_payments" , "deleted" , "iin" , "last4" , "merchant_reference_id" , "business_entity_id" , "payment_method_details" , "error_detail" , "custom_payment_method_name" , "network_transaction_details" ]; + protected static array $knownFields = [ "id" , "customer_id" , "subscription_id" , "gateway_account_id" , "payment_source_id" , "reference_number" , "date" , "settled_at" , "exchange_rate" , "currency_code" , "amount" , "id_at_gateway" , "three_d_secure" , "error_code" , "error_text" , "voided_at" , "resource_version" , "updated_at" , "fraud_reason" , "custom_payment_method_id" , "amount_unused" , "masked_card_number" , "reference_transaction_id" , "refunded_txn_id" , "reference_authorization_id" , "amount_capturable" , "reversal_transaction_id" , "linked_invoices" , "linked_credit_notes" , "linked_refunds" , "linked_payments" , "deleted" , "iin" , "last4" , "merchant_reference_id" , "business_entity_id" , "payment_method_details" , "gateway_metadata" , "error_detail" , "custom_payment_method_name" , "network_transaction_details" ]; /** * dynamic properties for resources @@ -334,6 +340,7 @@ private function __construct( ?string $merchant_reference_id, ?string $business_entity_id, ?string $payment_method_details, + ?GatewayMetadata $gateway_metadata, ?GatewayErrorDetail $error_detail, ?string $custom_payment_method_name, ?NetworkTransactionDetail $network_transaction_details, @@ -383,6 +390,7 @@ private function __construct( $this->merchant_reference_id = $merchant_reference_id; $this->business_entity_id = $business_entity_id; $this->payment_method_details = $payment_method_details; + $this->gateway_metadata = $gateway_metadata; $this->error_detail = $error_detail; $this->custom_payment_method_name = $custom_payment_method_name; $this->network_transaction_details = $network_transaction_details; @@ -450,6 +458,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['merchant_reference_id'] ?? null, $resourceAttributes['business_entity_id'] ?? null, $resourceAttributes['payment_method_details'] ?? null, + isset($resourceAttributes['gateway_metadata']) ? GatewayMetadata::from($resourceAttributes['gateway_metadata']) : null, isset($resourceAttributes['error_detail']) ? GatewayErrorDetail::from($resourceAttributes['error_detail']) : null, $resourceAttributes['custom_payment_method_name'] ?? null, isset($resourceAttributes['network_transaction_details']) ? NetworkTransactionDetail::from($resourceAttributes['network_transaction_details']) : null, @@ -515,6 +524,7 @@ public function toArray(): array 'business_entity_id' => $this->business_entity_id, 'payment_method_details' => $this->payment_method_details, + 'custom_payment_method_name' => $this->custom_payment_method_name, @@ -537,6 +547,9 @@ public function toArray(): array }); + if($this->gateway_metadata instanceof GatewayMetadata){ + $data['gateway_metadata'] = $this->gateway_metadata->toArray(); + } if($this->error_detail instanceof GatewayErrorDetail){ $data['error_detail'] = $this->error_detail->toArray(); } diff --git a/src/Resources/UsageSummary/UsageSummary.php b/src/Resources/UsageSummary/UsageSummary.php index b8b3babc..0400bd21 100644 --- a/src/Resources/UsageSummary/UsageSummary.php +++ b/src/Resources/UsageSummary/UsageSummary.php @@ -33,10 +33,16 @@ class UsageSummary { */ public ?int $aggregated_to; + /** + * + * @var mixed $attributes + */ + public mixed $attributes; + /** * @var array $knownFields */ - protected static array $knownFields = [ "subscription_id" , "feature_id" , "aggregated_value" , "aggregated_from" , "aggregated_to" ]; + protected static array $knownFields = [ "subscription_id" , "feature_id" , "aggregated_value" , "aggregated_from" , "aggregated_to" , "attributes" ]; /** * dynamic properties for resources @@ -50,13 +56,15 @@ private function __construct( ?string $aggregated_value, ?int $aggregated_from, ?int $aggregated_to, + mixed $attributes, ) { $this->subscription_id = $subscription_id; $this->feature_id = $feature_id; $this->aggregated_value = $aggregated_value; $this->aggregated_from = $aggregated_from; - $this->aggregated_to = $aggregated_to; + $this->aggregated_to = $aggregated_to; + $this->attributes = $attributes; } public static function from(array $resourceAttributes): self @@ -66,6 +74,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['aggregated_value'] ?? null, $resourceAttributes['aggregated_from'] ?? null, $resourceAttributes['aggregated_to'] ?? null, + $resourceAttributes['attributes'] ?? null, ); @@ -81,6 +90,7 @@ public function toArray(): array 'aggregated_value' => $this->aggregated_value, 'aggregated_from' => $this->aggregated_from, 'aggregated_to' => $this->aggregated_to, + 'attributes' => $this->attributes, ], function ($value) { return $value !== null; diff --git a/src/Responses/BusinessEntityResponse/CreateBusinessEntityResponse.php b/src/Responses/BusinessEntityResponse/CreateBusinessEntityResponse.php new file mode 100644 index 00000000..ac7469e0 --- /dev/null +++ b/src/Responses/BusinessEntityResponse/CreateBusinessEntityResponse.php @@ -0,0 +1,45 @@ +business_entity = $business_entity; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_entity']) ? BusinessEntity::from($resourceAttributes['business_entity']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_entity instanceof BusinessEntity){ + $data['business_entity'] = $this->business_entity->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessEntityResponse/ListBusinessEntityResponse.php b/src/Responses/BusinessEntityResponse/ListBusinessEntityResponse.php new file mode 100644 index 00000000..74f0a7ca --- /dev/null +++ b/src/Responses/BusinessEntityResponse/ListBusinessEntityResponse.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): ListBusinessEntityResponseListObject { + return new ListBusinessEntityResponseListObject( + isset($result['business_entity']) ? BusinessEntity::from($result['business_entity']) : 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/BusinessEntityResponse/ListBusinessEntityResponseListObject.php b/src/Responses/BusinessEntityResponse/ListBusinessEntityResponseListObject.php new file mode 100644 index 00000000..37c5903e --- /dev/null +++ b/src/Responses/BusinessEntityResponse/ListBusinessEntityResponseListObject.php @@ -0,0 +1,14 @@ +business_entity = $business_entity; + } +} diff --git a/src/Responses/BusinessEntityResponse/RetrieveBusinessEntityResponse.php b/src/Responses/BusinessEntityResponse/RetrieveBusinessEntityResponse.php new file mode 100644 index 00000000..d6a0c685 --- /dev/null +++ b/src/Responses/BusinessEntityResponse/RetrieveBusinessEntityResponse.php @@ -0,0 +1,45 @@ +business_entity = $business_entity; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_entity']) ? BusinessEntity::from($resourceAttributes['business_entity']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_entity instanceof BusinessEntity){ + $data['business_entity'] = $this->business_entity->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessEntityResponse/UpdateBusinessEntityResponse.php b/src/Responses/BusinessEntityResponse/UpdateBusinessEntityResponse.php new file mode 100644 index 00000000..1c5d5ed1 --- /dev/null +++ b/src/Responses/BusinessEntityResponse/UpdateBusinessEntityResponse.php @@ -0,0 +1,45 @@ +business_entity = $business_entity; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_entity']) ? BusinessEntity::from($resourceAttributes['business_entity']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_entity instanceof BusinessEntity){ + $data['business_entity'] = $this->business_entity->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/CollectionsPaymentPromiseResponse/CancelCollectionsPaymentPromiseResponse.php b/src/Responses/CollectionsPaymentPromiseResponse/CancelCollectionsPaymentPromiseResponse.php new file mode 100644 index 00000000..793cce54 --- /dev/null +++ b/src/Responses/CollectionsPaymentPromiseResponse/CancelCollectionsPaymentPromiseResponse.php @@ -0,0 +1,45 @@ +collections_payment_promise = $collections_payment_promise; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['collections_payment_promise']) ? CollectionsPaymentPromise::from($resourceAttributes['collections_payment_promise']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->collections_payment_promise instanceof CollectionsPaymentPromise){ + $data['collections_payment_promise'] = $this->collections_payment_promise->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/CollectionsPaymentPromiseResponse/CreateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse.php b/src/Responses/CollectionsPaymentPromiseResponse/CreateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse.php new file mode 100644 index 00000000..a902f687 --- /dev/null +++ b/src/Responses/CollectionsPaymentPromiseResponse/CreateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse.php @@ -0,0 +1,50 @@ + $collections_payment_promises + */ + public ?array $collections_payment_promises; + + + private function __construct( + ?array $collections_payment_promises, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->collections_payment_promises = $collections_payment_promises; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $collections_payment_promises = array_map(fn (array $result): CollectionsPaymentPromise => CollectionsPaymentPromise::from( + $result + ), $resourceAttributes['collections_payment_promises'] ?? []); + + return new self($collections_payment_promises, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + + if($this->collections_payment_promises !== []) { + $data['collections_payment_promises'] = array_map( + fn (CollectionsPaymentPromise $collections_payment_promises): array => $collections_payment_promises->toArray(), + $this->collections_payment_promises + ); + } + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/CollectionsPaymentPromiseResponse/ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponse.php b/src/Responses/CollectionsPaymentPromiseResponse/ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponse.php new file mode 100644 index 00000000..ec594f97 --- /dev/null +++ b/src/Responses/CollectionsPaymentPromiseResponse/ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponse.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): ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponseListObject { + return new ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponseListObject( + isset($result['collections_payment_promise']) ? CollectionsPaymentPromise::from($result['collections_payment_promise']) : 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/CollectionsPaymentPromiseResponse/ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponseListObject.php b/src/Responses/CollectionsPaymentPromiseResponse/ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponseListObject.php new file mode 100644 index 00000000..c079afc3 --- /dev/null +++ b/src/Responses/CollectionsPaymentPromiseResponse/ListCollectionsPaymentPromisesCollectionsPaymentPromiseResponseListObject.php @@ -0,0 +1,14 @@ +collections_payment_promise = $collections_payment_promise; + } +} diff --git a/src/Responses/CollectionsPaymentPromiseResponse/RetrieveCollectionsPaymentPromiseResponse.php b/src/Responses/CollectionsPaymentPromiseResponse/RetrieveCollectionsPaymentPromiseResponse.php new file mode 100644 index 00000000..b9d75faa --- /dev/null +++ b/src/Responses/CollectionsPaymentPromiseResponse/RetrieveCollectionsPaymentPromiseResponse.php @@ -0,0 +1,45 @@ +collections_payment_promise = $collections_payment_promise; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['collections_payment_promise']) ? CollectionsPaymentPromise::from($resourceAttributes['collections_payment_promise']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->collections_payment_promise instanceof CollectionsPaymentPromise){ + $data['collections_payment_promise'] = $this->collections_payment_promise->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/CollectionsPaymentPromiseResponse/UpdateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse.php b/src/Responses/CollectionsPaymentPromiseResponse/UpdateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse.php new file mode 100644 index 00000000..6b549adf --- /dev/null +++ b/src/Responses/CollectionsPaymentPromiseResponse/UpdateCollectionsPaymentPromiseCollectionsPaymentPromiseResponse.php @@ -0,0 +1,45 @@ +collections_payment_promise = $collections_payment_promise; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['collections_payment_promise']) ? CollectionsPaymentPromise::from($resourceAttributes['collections_payment_promise']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->collections_payment_promise instanceof CollectionsPaymentPromise){ + $data['collections_payment_promise'] = $this->collections_payment_promise->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/DraftRequestResponse/CitationsDraftRequestResponse.php b/src/Responses/DraftRequestResponse/CitationsDraftRequestResponse.php new file mode 100644 index 00000000..59be54d6 --- /dev/null +++ b/src/Responses/DraftRequestResponse/CitationsDraftRequestResponse.php @@ -0,0 +1,45 @@ +draft_request = $draft_request; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['draft_request']) ? DraftRequest::from($resourceAttributes['draft_request']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->draft_request instanceof DraftRequest){ + $data['draft_request'] = $this->draft_request->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/DraftRequestResponse/CommentsDraftRequestResponse.php b/src/Responses/DraftRequestResponse/CommentsDraftRequestResponse.php new file mode 100644 index 00000000..637efd29 --- /dev/null +++ b/src/Responses/DraftRequestResponse/CommentsDraftRequestResponse.php @@ -0,0 +1,45 @@ +draft_request = $draft_request; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['draft_request']) ? DraftRequest::from($resourceAttributes['draft_request']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->draft_request instanceof DraftRequest){ + $data['draft_request'] = $this->draft_request->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/DraftRequestResponse/CreateDraftRequestResponse.php b/src/Responses/DraftRequestResponse/CreateDraftRequestResponse.php new file mode 100644 index 00000000..b1327fa2 --- /dev/null +++ b/src/Responses/DraftRequestResponse/CreateDraftRequestResponse.php @@ -0,0 +1,45 @@ +draft_request = $draft_request; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['draft_request']) ? DraftRequest::from($resourceAttributes['draft_request']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->draft_request instanceof DraftRequest){ + $data['draft_request'] = $this->draft_request->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/DraftRequestResponse/EstimateDraftRequestResponse.php b/src/Responses/DraftRequestResponse/EstimateDraftRequestResponse.php new file mode 100644 index 00000000..451865c6 --- /dev/null +++ b/src/Responses/DraftRequestResponse/EstimateDraftRequestResponse.php @@ -0,0 +1,45 @@ +draft_estimate = $draft_estimate; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['draft_estimate']) ? DraftEstimate::from($resourceAttributes['draft_estimate']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->draft_estimate instanceof DraftEstimate){ + $data['draft_estimate'] = $this->draft_estimate->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/DraftRequestResponse/ExecuteDraftRequestResponse.php b/src/Responses/DraftRequestResponse/ExecuteDraftRequestResponse.php new file mode 100644 index 00000000..9e86bb84 --- /dev/null +++ b/src/Responses/DraftRequestResponse/ExecuteDraftRequestResponse.php @@ -0,0 +1,45 @@ +draft_request = $draft_request; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['draft_request']) ? DraftRequest::from($resourceAttributes['draft_request']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->draft_request instanceof DraftRequest){ + $data['draft_request'] = $this->draft_request->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/DraftRequestResponse/ListCitationsDraftRequestResponse.php b/src/Responses/DraftRequestResponse/ListCitationsDraftRequestResponse.php new file mode 100644 index 00000000..99820c8e --- /dev/null +++ b/src/Responses/DraftRequestResponse/ListCitationsDraftRequestResponse.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): ListCitationsDraftRequestResponseListObject { + return new ListCitationsDraftRequestResponseListObject( + isset($result['citation']) ? Citation::from($result['citation']) : 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/DraftRequestResponse/ListCitationsDraftRequestResponseListObject.php b/src/Responses/DraftRequestResponse/ListCitationsDraftRequestResponseListObject.php new file mode 100644 index 00000000..509102a9 --- /dev/null +++ b/src/Responses/DraftRequestResponse/ListCitationsDraftRequestResponseListObject.php @@ -0,0 +1,14 @@ +citation = $citation; + } +} diff --git a/src/Responses/DraftRequestResponse/ListCommentsDraftRequestResponse.php b/src/Responses/DraftRequestResponse/ListCommentsDraftRequestResponse.php new file mode 100644 index 00000000..18148a7a --- /dev/null +++ b/src/Responses/DraftRequestResponse/ListCommentsDraftRequestResponse.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): ListCommentsDraftRequestResponseListObject { + return new ListCommentsDraftRequestResponseListObject( + isset($result['comment']) ? Comment::from($result['comment']) : 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/DraftRequestResponse/ListCommentsDraftRequestResponseListObject.php b/src/Responses/DraftRequestResponse/ListCommentsDraftRequestResponseListObject.php new file mode 100644 index 00000000..63c8bba7 --- /dev/null +++ b/src/Responses/DraftRequestResponse/ListCommentsDraftRequestResponseListObject.php @@ -0,0 +1,14 @@ +comment = $comment; + } +} diff --git a/src/Responses/DraftRequestResponse/RetrieveDraftRequestResponse.php b/src/Responses/DraftRequestResponse/RetrieveDraftRequestResponse.php new file mode 100644 index 00000000..86f95804 --- /dev/null +++ b/src/Responses/DraftRequestResponse/RetrieveDraftRequestResponse.php @@ -0,0 +1,45 @@ +draft_request = $draft_request; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['draft_request']) ? DraftRequest::from($resourceAttributes['draft_request']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->draft_request instanceof DraftRequest){ + $data['draft_request'] = $this->draft_request->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/DraftRequestResponse/UpdateDraftRequestResponse.php b/src/Responses/DraftRequestResponse/UpdateDraftRequestResponse.php new file mode 100644 index 00000000..c12a8ebc --- /dev/null +++ b/src/Responses/DraftRequestResponse/UpdateDraftRequestResponse.php @@ -0,0 +1,45 @@ +draft_request = $draft_request; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['draft_request']) ? DraftRequest::from($resourceAttributes['draft_request']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->draft_request instanceof DraftRequest){ + $data['draft_request'] = $this->draft_request->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/InvoiceResponse/RemovePaymentScheduleSchemeInvoiceResponse.php b/src/Responses/InvoiceResponse/RemovePaymentScheduleSchemeInvoiceResponse.php new file mode 100644 index 00000000..fa2968c7 --- /dev/null +++ b/src/Responses/InvoiceResponse/RemovePaymentScheduleSchemeInvoiceResponse.php @@ -0,0 +1,45 @@ +invoice = $invoice; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['invoice']) ? Invoice::from($resourceAttributes['invoice']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->invoice instanceof Invoice){ + $data['invoice'] = $this->invoice->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/LedgerAccountBalanceResponse/UpdateOverdraftLimitLedgerAccountBalanceResponse.php b/src/Responses/LedgerAccountBalanceResponse/UpdateOverdraftLimitLedgerAccountBalanceResponse.php new file mode 100644 index 00000000..187505dd --- /dev/null +++ b/src/Responses/LedgerAccountBalanceResponse/UpdateOverdraftLimitLedgerAccountBalanceResponse.php @@ -0,0 +1,71 @@ +subscription_id = $subscription_id; + $this->unit_id = $unit_id; + $this->change_reason = $change_reason; + $this->overdraft_balance = $overdraft_balance; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + $resourceAttributes['subscription_id'] ?? null, + $resourceAttributes['unit_id'] ?? null, + $resourceAttributes['change_reason'] ?? null, + $resourceAttributes['overdraft_balance'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'subscription_id' => $this->subscription_id, + 'unit_id' => $this->unit_id, + 'change_reason' => $this->change_reason, + 'overdraft_balance' => $this->overdraft_balance, + ]); + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PriceRampResponse/CreatePriceRampResponse.php b/src/Responses/PriceRampResponse/CreatePriceRampResponse.php new file mode 100644 index 00000000..40592ac5 --- /dev/null +++ b/src/Responses/PriceRampResponse/CreatePriceRampResponse.php @@ -0,0 +1,45 @@ +price_ramp = $price_ramp; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['price_ramp']) ? PriceRamp::from($resourceAttributes['price_ramp']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->price_ramp instanceof PriceRamp){ + $data['price_ramp'] = $this->price_ramp->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PriceRampResponse/DeletePriceRampResponse.php b/src/Responses/PriceRampResponse/DeletePriceRampResponse.php new file mode 100644 index 00000000..4e6d397b --- /dev/null +++ b/src/Responses/PriceRampResponse/DeletePriceRampResponse.php @@ -0,0 +1,45 @@ +price_ramp = $price_ramp; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['price_ramp']) ? PriceRamp::from($resourceAttributes['price_ramp']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->price_ramp instanceof PriceRamp){ + $data['price_ramp'] = $this->price_ramp->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PriceRampResponse/ListPriceRampResponse.php b/src/Responses/PriceRampResponse/ListPriceRampResponse.php new file mode 100644 index 00000000..10c3578d --- /dev/null +++ b/src/Responses/PriceRampResponse/ListPriceRampResponse.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): ListPriceRampResponseListObject { + return new ListPriceRampResponseListObject( + isset($result['price_ramp']) ? PriceRamp::from($result['price_ramp']) : 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/PriceRampResponse/ListPriceRampResponseListObject.php b/src/Responses/PriceRampResponse/ListPriceRampResponseListObject.php new file mode 100644 index 00000000..84a70087 --- /dev/null +++ b/src/Responses/PriceRampResponse/ListPriceRampResponseListObject.php @@ -0,0 +1,14 @@ +price_ramp = $price_ramp; + } +} diff --git a/src/Responses/PriceRampResponse/RetrievePriceRampResponse.php b/src/Responses/PriceRampResponse/RetrievePriceRampResponse.php new file mode 100644 index 00000000..a541f7a8 --- /dev/null +++ b/src/Responses/PriceRampResponse/RetrievePriceRampResponse.php @@ -0,0 +1,45 @@ +price_ramp = $price_ramp; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['price_ramp']) ? PriceRamp::from($resourceAttributes['price_ramp']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->price_ramp instanceof PriceRamp){ + $data['price_ramp'] = $this->price_ramp->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PriceRampResponse/UpdatePriceRampResponse.php b/src/Responses/PriceRampResponse/UpdatePriceRampResponse.php new file mode 100644 index 00000000..e8569fb5 --- /dev/null +++ b/src/Responses/PriceRampResponse/UpdatePriceRampResponse.php @@ -0,0 +1,45 @@ +price_ramp = $price_ramp; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['price_ramp']) ? PriceRamp::from($resourceAttributes['price_ramp']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->price_ramp instanceof PriceRamp){ + $data['price_ramp'] = $this->price_ramp->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/RetrySegmentResponse/RetrieveRetrySegmentResponse.php b/src/Responses/RetrySegmentResponse/RetrieveRetrySegmentResponse.php new file mode 100644 index 00000000..ca623873 --- /dev/null +++ b/src/Responses/RetrySegmentResponse/RetrieveRetrySegmentResponse.php @@ -0,0 +1,45 @@ +retry_segment = $retry_segment; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['retry_segment']) ? RetrySegment::from($resourceAttributes['retry_segment']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->retry_segment instanceof RetrySegment){ + $data['retry_segment'] = $this->retry_segment->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Version.php b/src/Version.php index 523dd102..fe2be066 100644 --- a/src/Version.php +++ b/src/Version.php @@ -4,7 +4,7 @@ final class Version { - const VERSION = '4.27.0'; + const VERSION = '4.28.0'; } ?> \ No newline at end of file