diff --git a/CHANGELOG.md b/CHANGELOG.md index da4e5c49..4e8c93b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,64 @@ +### v4.29.0 (2026-11-13) +* * * +### New Resources: +- `BillingLineItem` has been added. +- `BillingMetadata` has been added. +- `GatewayRequestLog` has been added. +- `GatewayWebhookLog` has been added. +- `OrganizationDetail` has been added. + + +### New Attributes: +- `description` has been added to `Discount`. +- `billing_metadata` has been added to `GrantBlock`. +- `offline_payment_method` has been added to `Invoice`. + + +### New Parameters: +- `discounts.description` has been added as request body parameter to `estimate_for_creating_a_customer_and_subscription` in `Estimate`. +- `discounts.description` has been added as request body parameter to `estimate_for_updating_a_subscription` in `Estimate`. +- `discounts.description` has been added as request body parameter to `estimate_for_creating_a_subscription` in `Estimate`. +- `allowed_billing_frequencies` has been added as request body parameter to `checkout_gift_subscription_for_items` in `HostedPage`. +- `show_billing_frequency_selector` has been added as request body parameter to `checkout_gift_subscription_for_items` in `HostedPage`. +- `allowed_billing_frequencies` has been added as request body parameter to `create_checkout_for_a_new_subscription` in `HostedPage`. +- `show_billing_frequency_selector` has been added as request body parameter to `create_checkout_for_a_new_subscription` in `HostedPage`. +- `allowed_billing_frequencies` has been added as request body parameter to `create_checkout_to_update_a_subscription` in `HostedPage`. +- `show_billing_frequency_selector` has been added as request body parameter to `create_checkout_to_update_a_subscription` in `HostedPage`. +- `credit_notes.amount` has been added as request body parameter to `apply_credits_for_an_invoice` in `Invoice`. +- `credit_notes.applied_at` has been added as request body parameter to `apply_credits_for_an_invoice` in `Invoice`. +- `offline_payment_method` has been added as request body parameter to `create_invoice_for_items_and_one-time_charges` in `Invoice`. +- `discounts.description` has been added as request body parameter to `update_subscription_for_items` in `Subscription`. +- `discounts.description` has been added as request body parameter to `create_subscription_for_items` in `Subscription`. +- `group_by.window_size` has been added as request body parameter to `retrieve_usages_for_an_invoice_as_pdf` in `Usage`. + + +### New Events: +- `organization_details_updated` has been added. +- `organization_details_created` has been added. + + +### Deleted Actions: +- `list_citations_for_a_draft_request` has been removed from `DraftRequest`. +- `add_citations_to_a_draft_request` has been removed from `DraftRequest`. +- `execute_a_draft_request` has been removed from `DraftRequest`. +- `estimate_a_draft_request` has been removed from `DraftRequest`. +- `list_comments_for_a_draft_request` has been removed from `DraftRequest`. +- `add_comments_to_a_draft_request` has been removed from `DraftRequest`. +- `retrieve_a_draft_request` has been removed from `DraftRequest`. +- `update_a_draft_request` has been removed from `DraftRequest`. +- `create_a_draft_request` has been removed from `DraftRequest`. + + +### New Enums: +- `organization_details_created` and `organization_details_updated` have been added as new values enum `EventType`. +- `invocation_time` has been added as a new value to enum query parameter `sort_by.asc` in `list_gateway_request_logs` of `GatewayRequestLog`. +- `invocation_time` has been added as a new value to enum query parameter `sort_by.desc` in `list_gateway_request_logs` of `GatewayRequestLog`. +- `received_at` has been added as a new value to enum query parameter `sort_by.asc` in `list_gateway_webhook_logs` of `GatewayWebhookLog`. +- `received_at` has been added as a new value to enum query parameter `sort_by.desc` in `list_gateway_webhook_logs` of `GatewayWebhookLog`. +- `none` and `day` have been added as new values to enum request body parameter `group_by.window_size` in `retrieve_usages_for_an_invoice_as_pdf` of `Usage`. + + + ### v4.28.0 (2026-11-02) * * * ### New Resources: diff --git a/VERSION b/VERSION index ad94be36..e052d560 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.28.0 +4.29.0 diff --git a/src/Actions/Contracts/EstimateActionsInterface.php b/src/Actions/Contracts/EstimateActionsInterface.php index 46322b5d..97570459 100644 --- a/src/Actions/Contracts/EstimateActionsInterface.php +++ b/src/Actions/Contracts/EstimateActionsInterface.php @@ -125,6 +125,7 @@ public function renewalEstimate(string $id, array $params = [], array $headers = * included_in_mrr?: bool, * item_price_id?: string, * quantity?: int, + * description?: string, * }>, * item_tiers?: array, * item_tiers?: array, * item_tiers?: array $headers + * @return RetrieveGatewayRequestLogResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveGatewayRequestLogResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/gateway_request_logs/list-gateway-request-logs?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * log_id?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * gateway?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * status_code?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * method?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * url?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * customer_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * invoice_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * transaction_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_method_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * gateway_credential_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_attempt_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_intent_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * operation_name?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * operation_type?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * source?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * invocation_time?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * response_received_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListGatewayRequestLogResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListGatewayRequestLogResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/GatewayWebhookLogActionsInterface.php b/src/Actions/Contracts/GatewayWebhookLogActionsInterface.php new file mode 100644 index 00000000..dc8f4f8a --- /dev/null +++ b/src/Actions/Contracts/GatewayWebhookLogActionsInterface.php @@ -0,0 +1,135 @@ + $headers + * @return RetrieveGatewayWebhookLogResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveGatewayWebhookLogResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/gateway_webhook_logs/list-gateway-webhook-logs?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * webhook_id?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * gateway?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * status_code?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * method?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * url?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * id_at_gateway?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * customer_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * invoice_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * transaction_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_method_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * gateway_credential_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_attempt_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_intent_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * received_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListGatewayWebhookLogResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListGatewayWebhookLogResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/HostedPageActionsInterface.php b/src/Actions/Contracts/HostedPageActionsInterface.php index 358df0bd..ece23900 100644 --- a/src/Actions/Contracts/HostedPageActionsInterface.php +++ b/src/Actions/Contracts/HostedPageActionsInterface.php @@ -283,12 +283,17 @@ public function events(array $params, array $headers = []): EventsHostedPageResp * ending_unit_in_decimal?: string, * price_in_decimal?: string, * }>, + * allowed_billing_frequencies?: array, * layout?: string, * business_entity_id?: string, * brand_id?: string, * redirect_url?: string, * coupon_ids?: array, - * } $params Description of the parameters + * show_billing_frequency_selector?: bool, + * } $params Description of the parameters * * @param array $headers * @return CheckoutGiftForItemsHostedPageResponse @@ -524,6 +529,10 @@ public function acceptQuote(array $params, array $headers = []): AcceptQuoteHost * operation?: string, * standard?: string, * }>, + * allowed_billing_frequencies?: array, * layout?: string, * business_entity_id?: string, * brand_id?: string, @@ -535,6 +544,7 @@ public function acceptQuote(array $params, array $headers = []): AcceptQuoteHost * redirect_url?: string, * cancel_url?: string, * pass_thru_content?: string, + * show_billing_frequency_selector?: bool, * allow_offline_payment_methods?: bool, * } $params Description of the parameters * @@ -645,6 +655,10 @@ public function claimGift(array $params, array $headers = []): ClaimGiftHostedPa * operation?: string, * standard?: string, * }>, + * allowed_billing_frequencies?: array, * layout?: string, * brand_id?: string, * mandatory_items_to_remove?: array, @@ -664,6 +678,7 @@ public function claimGift(array $params, array $headers = []): ClaimGiftHostedPa * redirect_url?: string, * cancel_url?: string, * pass_thru_content?: string, + * show_billing_frequency_selector?: bool, * allow_offline_payment_methods?: bool, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/InvoiceActionsInterface.php b/src/Actions/Contracts/InvoiceActionsInterface.php index 6dcb14f6..080d146c 100644 --- a/src/Actions/Contracts/InvoiceActionsInterface.php +++ b/src/Actions/Contracts/InvoiceActionsInterface.php @@ -654,6 +654,8 @@ public function close(string $id, array $params = [], array $headers = []): Clos * @param array{ * credit_notes?: array, * comment?: string, * } $params Description of the parameters @@ -895,6 +897,7 @@ public function createForChargeItem(array $params, array $headers = []): CreateF * payment_source_id?: string, * auto_collection?: string, * net_term_days?: int, + * offline_payment_method?: string, * invoice_date?: int, * create_pending_invoice?: bool, * token_id?: string, diff --git a/src/Actions/Contracts/ItemActionsInterface.php b/src/Actions/Contracts/ItemActionsInterface.php index f150d119..be97d2d7 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_present?: mixed, * is?: mixed, + * is_present?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/ItemFamilyActionsInterface.php b/src/Actions/Contracts/ItemFamilyActionsInterface.php index 56bb02c2..281a920c 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_present?: mixed, * is?: mixed, + * is_present?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/ItemPriceActionsInterface.php b/src/Actions/Contracts/ItemPriceActionsInterface.php index 80e86b7d..747fd076 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_present?: mixed, * is?: mixed, + * is_present?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php b/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php index 124b01c2..88baf3ce 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, * between?: mixed, - * before?: mixed, * on?: mixed, - * after?: mixed, + * before?: mixed, * }, * purchased_at?: array{ + * after?: mixed, * between?: mixed, - * before?: mixed, * on?: mixed, - * after?: mixed, + * before?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/Contracts/OrganizationDetailActionsInterface.php b/src/Actions/Contracts/OrganizationDetailActionsInterface.php new file mode 100644 index 00000000..2e403f20 --- /dev/null +++ b/src/Actions/Contracts/OrganizationDetailActionsInterface.php @@ -0,0 +1,81 @@ + $headers + * @return ListOrganizationDetailResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListOrganizationDetailResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/organization_details/update-organization-details?lang=php-v4 + * @param array{ + * organization_name?: string, + * email?: string, + * address_line1?: string, + * address_line2?: string, + * address_line3?: string, + * city?: string, + * state_code?: string, + * state?: string, + * zip?: string, + * country_code?: string, + * phone?: string, + * fax?: string, + * website?: string, + * is_vat_number_present?: bool, + * vat_number?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateOrganizationDetailResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreateOrganizationDetailResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/organization_details/retrieve-organization-details?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveOrganizationDetailResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveOrganizationDetailResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/PriceRampActionsInterface.php b/src/Actions/Contracts/PriceRampActionsInterface.php index 9d73bfa5..a20e624d 100644 --- a/src/Actions/Contracts/PriceRampActionsInterface.php +++ b/src/Actions/Contracts/PriceRampActionsInterface.php @@ -47,8 +47,8 @@ * between?: mixed, * }, * business_entity_id?: array{ - * is_present?: mixed, * is?: mixed, + * is_present?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/PriceVariantActionsInterface.php b/src/Actions/Contracts/PriceVariantActionsInterface.php index 61a2947f..b28c0e11 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_present?: mixed, * is?: mixed, + * is_present?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/Contracts/SubscriptionActionsInterface.php b/src/Actions/Contracts/SubscriptionActionsInterface.php index 02c2303a..8d3f6e87 100644 --- a/src/Actions/Contracts/SubscriptionActionsInterface.php +++ b/src/Actions/Contracts/SubscriptionActionsInterface.php @@ -190,6 +190,7 @@ public function removeAdvanceInvoiceSchedule(string $id, array $params = [], arr * quantity?: int, * operation_type?: string, * id?: string, + * description?: string, * }>, * item_tiers?: array, * item_tiers?: array, * disposition_type?: string, * } $params Description of the parameters diff --git a/src/Actions/EstimateActions.php b/src/Actions/EstimateActions.php index 818828b1..7a5fc8ef 100644 --- a/src/Actions/EstimateActions.php +++ b/src/Actions/EstimateActions.php @@ -156,6 +156,7 @@ public function renewalEstimate(string $id, array $params = [], array $headers = * included_in_mrr?: bool, * item_price_id?: string, * quantity?: int, + * description?: string, * }>, * item_tiers?: array, * item_tiers?: array, * item_tiers?: arrayhttpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/gateway_request_logs/retrieve-a-gateway-request-log?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveGatewayRequestLogResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveGatewayRequestLogResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["gateway_request_logs",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("gatewayRequestLog") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveGatewayRequestLogResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/gateway_request_logs/list-gateway-request-logs?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * log_id?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * gateway?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * status_code?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * method?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * url?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * customer_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * invoice_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * transaction_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_method_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * gateway_credential_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_attempt_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_intent_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * operation_name?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * operation_type?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * source?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * invocation_time?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * response_received_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListGatewayRequestLogResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListGatewayRequestLogResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["gateway_request_logs"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("gatewayRequestLog") + ->withTelemetryOperation("list") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListGatewayRequestLogResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/GatewayWebhookLogActions.php b/src/Actions/GatewayWebhookLogActions.php new file mode 100644 index 00000000..1c2629e7 --- /dev/null +++ b/src/Actions/GatewayWebhookLogActions.php @@ -0,0 +1,185 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/gateway_webhook_logs/retrieve-a-gateway-webhook-log?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveGatewayWebhookLogResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveGatewayWebhookLogResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["gateway_webhook_logs",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("gatewayWebhookLog") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveGatewayWebhookLogResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/gateway_webhook_logs/list-gateway-webhook-logs?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * webhook_id?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * gateway?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * status_code?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * method?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * url?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * id_at_gateway?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * customer_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * invoice_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * transaction_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_method_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * gateway_credential_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_attempt_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * payment_intent_handle?: array{ + * in?: mixed, + * is_not?: mixed, + * not_in?: mixed, + * is?: mixed, + * }, + * received_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListGatewayWebhookLogResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListGatewayWebhookLogResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["gateway_webhook_logs"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("gatewayWebhookLog") + ->withTelemetryOperation("list") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListGatewayWebhookLogResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/HostedPageActions.php b/src/Actions/HostedPageActions.php index 8a6b1346..bcd58e61 100644 --- a/src/Actions/HostedPageActions.php +++ b/src/Actions/HostedPageActions.php @@ -397,12 +397,17 @@ public function events(array $params, array $headers = []): EventsHostedPageResp * ending_unit_in_decimal?: string, * price_in_decimal?: string, * }>, + * allowed_billing_frequencies?: array, * layout?: string, * business_entity_id?: string, * brand_id?: string, * redirect_url?: string, * coupon_ids?: array, - * } $params Description of the parameters + * show_billing_frequency_selector?: bool, + * } $params Description of the parameters * * @param array $headers * @return CheckoutGiftForItemsHostedPageResponse @@ -737,6 +742,10 @@ public function acceptQuote(array $params, array $headers = []): AcceptQuoteHost * operation?: string, * standard?: string, * }>, + * allowed_billing_frequencies?: array, * layout?: string, * business_entity_id?: string, * brand_id?: string, @@ -748,6 +757,7 @@ public function acceptQuote(array $params, array $headers = []): AcceptQuoteHost * redirect_url?: string, * cancel_url?: string, * pass_thru_content?: string, + * show_billing_frequency_selector?: bool, * allow_offline_payment_methods?: bool, * } $params Description of the parameters * @@ -898,6 +908,10 @@ public function claimGift(array $params, array $headers = []): ClaimGiftHostedPa * operation?: string, * standard?: string, * }>, + * allowed_billing_frequencies?: array, * layout?: string, * brand_id?: string, * mandatory_items_to_remove?: array, @@ -917,6 +931,7 @@ public function claimGift(array $params, array $headers = []): ClaimGiftHostedPa * redirect_url?: string, * cancel_url?: string, * pass_thru_content?: string, + * show_billing_frequency_selector?: bool, * allow_offline_payment_methods?: bool, * } $params Description of the parameters * diff --git a/src/Actions/InvoiceActions.php b/src/Actions/InvoiceActions.php index 7a9d92b5..03cd45e1 100644 --- a/src/Actions/InvoiceActions.php +++ b/src/Actions/InvoiceActions.php @@ -1005,6 +1005,8 @@ public function close(string $id, array $params = [], array $headers = []): Clos * @param array{ * credit_notes?: array, * comment?: string, * } $params Description of the parameters @@ -1324,6 +1326,7 @@ public function createForChargeItem(array $params, array $headers = []): CreateF * payment_source_id?: string, * auto_collection?: string, * net_term_days?: int, + * offline_payment_method?: string, * invoice_date?: int, * create_pending_invoice?: bool, * token_id?: string, diff --git a/src/Actions/ItemActions.php b/src/Actions/ItemActions.php index 9a2821db..2e459e5a 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_present?: mixed, * is?: mixed, + * is_present?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/ItemFamilyActions.php b/src/Actions/ItemFamilyActions.php index 7619d591..b2f019e0 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_present?: mixed, * is?: mixed, + * is_present?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/ItemPriceActions.php b/src/Actions/ItemPriceActions.php index 0195f4c2..f563f943 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_present?: mixed, * is?: mixed, + * is_present?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/OmnichannelSubscriptionActions.php b/src/Actions/OmnichannelSubscriptionActions.php index 1d86c810..b1d09d94 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, * between?: mixed, - * before?: mixed, * on?: mixed, - * after?: mixed, + * before?: mixed, * }, * purchased_at?: array{ + * after?: mixed, * between?: mixed, - * before?: mixed, * on?: mixed, - * after?: mixed, + * before?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/OrganizationDetailActions.php b/src/Actions/OrganizationDetailActions.php new file mode 100644 index 00000000..78e5e785 --- /dev/null +++ b/src/Actions/OrganizationDetailActions.php @@ -0,0 +1,151 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/organization_details/list-organization-details?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * business_entity_id?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListOrganizationDetailResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListOrganizationDetailResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["organization_details"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("organizationDetail") + ->withTelemetryOperation("list") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListOrganizationDetailResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/organization_details/update-organization-details?lang=php-v4 + * @param array{ + * organization_name?: string, + * email?: string, + * address_line1?: string, + * address_line2?: string, + * address_line3?: string, + * city?: string, + * state_code?: string, + * state?: string, + * zip?: string, + * country_code?: string, + * phone?: string, + * fax?: string, + * website?: string, + * is_vat_number_present?: bool, + * vat_number?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateOrganizationDetailResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreateOrganizationDetailResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["organization_details"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("organizationDetail") + ->withTelemetryOperation("create") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CreateOrganizationDetailResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/organization_details/retrieve-organization-details?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveOrganizationDetailResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveOrganizationDetailResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["organization_details",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("organizationDetail") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveOrganizationDetailResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/PriceRampActions.php b/src/Actions/PriceRampActions.php index 4711fb12..86523940 100644 --- a/src/Actions/PriceRampActions.php +++ b/src/Actions/PriceRampActions.php @@ -60,8 +60,8 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * between?: mixed, * }, * business_entity_id?: array{ - * is_present?: mixed, * is?: mixed, + * is_present?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/PriceVariantActions.php b/src/Actions/PriceVariantActions.php index c89292c8..b3715575 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_present?: mixed, * is?: mixed, + * is_present?: mixed, * }, * include_site_level_resources?: array{ * is?: mixed, diff --git a/src/Actions/SubscriptionActions.php b/src/Actions/SubscriptionActions.php index b399b821..5be4bd69 100644 --- a/src/Actions/SubscriptionActions.php +++ b/src/Actions/SubscriptionActions.php @@ -223,6 +223,7 @@ public function removeAdvanceInvoiceSchedule(string $id, array $params = [], arr * quantity?: int, * operation_type?: string, * id?: string, + * description?: string, * }>, * item_tiers?: array, * item_tiers?: array, * disposition_type?: string, * } $params Description of the parameters diff --git a/src/ChargebeeClient.php b/src/ChargebeeClient.php index f1bf3ebc..55123dc9 100644 --- a/src/ChargebeeClient.php +++ b/src/ChargebeeClient.php @@ -44,8 +44,6 @@ 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; @@ -62,6 +60,10 @@ use Chargebee\Actions\ExportActions; use Chargebee\Actions\Contracts\FeatureActionsInterface; use Chargebee\Actions\FeatureActions; +use Chargebee\Actions\Contracts\GatewayRequestLogActionsInterface; +use Chargebee\Actions\GatewayRequestLogActions; +use Chargebee\Actions\Contracts\GatewayWebhookLogActionsInterface; +use Chargebee\Actions\GatewayWebhookLogActions; use Chargebee\Actions\Contracts\GiftActionsInterface; use Chargebee\Actions\GiftActions; use Chargebee\Actions\Contracts\GrantBlockActionsInterface; @@ -102,6 +104,8 @@ use Chargebee\Actions\OmnichannelSubscriptionItemActions; use Chargebee\Actions\Contracts\OrderActionsInterface; use Chargebee\Actions\OrderActions; +use Chargebee\Actions\Contracts\OrganizationDetailActionsInterface; +use Chargebee\Actions\OrganizationDetailActions; use Chargebee\Actions\Contracts\PaymentIntentActionsInterface; use Chargebee\Actions\PaymentIntentActions; use Chargebee\Actions\Contracts\PaymentScheduleActionsInterface; @@ -339,10 +343,6 @@ 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); } @@ -375,6 +375,14 @@ public function feature() :FeatureActionsInterface { return new FeatureActions($this->httpClientFactory, $this->env); } + public function gatewayRequestLog() :GatewayRequestLogActionsInterface { + return new GatewayRequestLogActions($this->httpClientFactory, $this->env); + } + + public function gatewayWebhookLog() :GatewayWebhookLogActionsInterface { + return new GatewayWebhookLogActions($this->httpClientFactory, $this->env); + } + public function gift() :GiftActionsInterface { return new GiftActions($this->httpClientFactory, $this->env); } @@ -455,6 +463,10 @@ public function order() :OrderActionsInterface { return new OrderActions($this->httpClientFactory, $this->env); } + public function organizationDetail() :OrganizationDetailActionsInterface { + return new OrganizationDetailActions($this->httpClientFactory, $this->env); + } + public function paymentIntent() :PaymentIntentActionsInterface { return new PaymentIntentActions($this->httpClientFactory, $this->env); } diff --git a/src/Enums/EnabledEvents.php b/src/Enums/EnabledEvents.php index e0c3cca6..7d328d6c 100644 --- a/src/Enums/EnabledEvents.php +++ b/src/Enums/EnabledEvents.php @@ -169,6 +169,8 @@ enum EnabledEvents : string { case CUSTOMER_BUSINESS_ENTITY_CHANGED = "customer_business_entity_changed"; case SUBSCRIPTION_BUSINESS_ENTITY_CHANGED = "subscription_business_entity_changed"; case PAYMENT_SOURCE_BUSINESS_ENTITY_CHANGED = "payment_source_business_entity_changed"; + case ORGANIZATION_DETAILS_CREATED = "organization_details_created"; + case ORGANIZATION_DETAILS_UPDATED = "organization_details_updated"; case PURCHASE_CREATED = "purchase_created"; case VOUCHER_CREATED = "voucher_created"; case VOUCHER_EXPIRED = "voucher_expired"; diff --git a/src/Enums/EventType.php b/src/Enums/EventType.php index a897c5a1..8112a910 100644 --- a/src/Enums/EventType.php +++ b/src/Enums/EventType.php @@ -168,6 +168,8 @@ enum EventType : string { case CUSTOMER_BUSINESS_ENTITY_CHANGED = "customer_business_entity_changed"; case SUBSCRIPTION_BUSINESS_ENTITY_CHANGED = "subscription_business_entity_changed"; case PAYMENT_SOURCE_BUSINESS_ENTITY_CHANGED = "payment_source_business_entity_changed"; + case ORGANIZATION_DETAILS_CREATED = "organization_details_created"; + case ORGANIZATION_DETAILS_UPDATED = "organization_details_updated"; case PURCHASE_CREATED = "purchase_created"; case VOUCHER_CREATED = "voucher_created"; case VOUCHER_EXPIRED = "voucher_expired"; diff --git a/src/Enums/PaymentMethod.php b/src/Enums/PaymentMethod.php index 1cb22c5e..5b89c823 100644 --- a/src/Enums/PaymentMethod.php +++ b/src/Enums/PaymentMethod.php @@ -8,12 +8,6 @@ enum PaymentMethod : string { case BANK_TRANSFER = "bank_transfer"; case OTHER = "other"; case CUSTOM = "custom"; - case TAMARA = "tamara"; - case QPAY = "qpay"; - case BLIK = "blik"; - case FPX = "fpx"; - case WERO = "wero"; - case P24 = "p24"; case CHARGEBACK = "chargeback"; case CARD = "card"; case AMAZON_PAYMENTS = "amazon_payments"; @@ -69,6 +63,8 @@ enum PaymentMethod : string { case PROMPTPAY = "promptpay"; case DANA = "dana"; case TOUCH_N_GO = "touch_n_go"; + case TAMARA = "tamara"; + case QPAY = "qpay"; case OVO = "ovo"; case MOMO = "momo"; case MERCADO_PAGO = "mercado_pago"; @@ -76,6 +72,10 @@ enum PaymentMethod : string { case NUPAY = "nupay"; case PICPAY = "picpay"; case THAI_QR = "thai_qr"; + case BLIK = "blik"; + case FPX = "fpx"; + case WERO = "wero"; + case P24 = "p24"; case AFFIRM_PAY = "affirm_pay"; case RAKUTEN_PAY = "rakuten_pay"; /* diff --git a/src/Resources/BillingLineItem/BillingLineItem.php b/src/Resources/BillingLineItem/BillingLineItem.php new file mode 100644 index 00000000..c8a2b915 --- /dev/null +++ b/src/Resources/BillingLineItem/BillingLineItem.php @@ -0,0 +1,76 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "invoice_number" , "quantity" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $invoice_number, + ?float $quantity, + ) + { + $this->id = $id; + $this->invoice_number = $invoice_number; + $this->quantity = $quantity; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['invoice_number'] ?? null, + $resourceAttributes['quantity'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'invoice_number' => $this->invoice_number, + 'quantity' => $this->quantity, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/BillingMetadata/BillingMetadata.php b/src/Resources/BillingMetadata/BillingMetadata.php new file mode 100644 index 00000000..8d376691 --- /dev/null +++ b/src/Resources/BillingMetadata/BillingMetadata.php @@ -0,0 +1,76 @@ + $line_items + */ + public ?array $line_items; + + /** + * @var array $knownFields + */ + protected static array $knownFields = [ "item_price_id" , "line_items" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $item_price_id, + ?array $line_items, + ) + { + $this->item_price_id = $item_price_id; + $this->line_items = $line_items; + } + + public static function from(array $resourceAttributes): self + { + $line_items = array_map(fn (array $result): \Chargebee\Resources\BillingLineItem\BillingLineItem => \Chargebee\Resources\BillingLineItem\BillingLineItem::from( + $result + ), $resourceAttributes['line_items'] ?? []); + + $returnData = new self( $resourceAttributes['item_price_id'] ?? null, + $line_items, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['item_price_id' => $this->item_price_id, + + + ], function ($value) { + return $value !== null; + }); + + + + if($this->line_items !== []){ + $data['line_items'] = array_map( + fn (\Chargebee\Resources\BillingLineItem\BillingLineItem $line_items): array => $line_items->toArray(), + $this->line_items + ); + } + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Content/Content.php b/src/Resources/Content/Content.php index 96b0ef24..2a70cca8 100644 --- a/src/Resources/Content/Content.php +++ b/src/Resources/Content/Content.php @@ -13,6 +13,8 @@ use Chargebee\Resources\AttachedItem\AttachedItem; use Chargebee\Resources\Attribute\Attribute; use Chargebee\Resources\BillingConfiguration\BillingConfiguration; +use Chargebee\Resources\BillingLineItem\BillingLineItem; +use Chargebee\Resources\BillingMetadata\BillingMetadata; use Chargebee\Resources\Brand\Brand; use Chargebee\Resources\BusinessEntity\BusinessEntity; use Chargebee\Resources\BusinessEntityTransfer\BusinessEntityTransfer; @@ -62,6 +64,8 @@ use Chargebee\Resources\FilterCondition\FilterCondition; use Chargebee\Resources\GatewayErrorDetail\GatewayErrorDetail; use Chargebee\Resources\GatewayPaymentMethodToken\GatewayPaymentMethodToken; +use Chargebee\Resources\GatewayRequestLog\GatewayRequestLog; +use Chargebee\Resources\GatewayWebhookLog\GatewayWebhookLog; use Chargebee\Resources\Gift\Gift; use Chargebee\Resources\GrantBlock\GrantBlock; use Chargebee\Resources\GroupByAttribute\GroupByAttribute; @@ -97,6 +101,7 @@ use Chargebee\Resources\OmnichannelSubscriptionItemScheduledChange\OmnichannelSubscriptionItemScheduledChange; use Chargebee\Resources\OmnichannelTransaction\OmnichannelTransaction; use Chargebee\Resources\Order\Order; +use Chargebee\Resources\OrganizationDetail\OrganizationDetail; use Chargebee\Resources\PaymentIntent\PaymentIntent; use Chargebee\Resources\PaymentReferenceNumber\PaymentReferenceNumber; use Chargebee\Resources\PaymentSchedule\PaymentSchedule; @@ -222,6 +227,18 @@ class Content { */ public ?BillingConfiguration $billingconfiguration; + /** + * + * @var ?BillingLineItem $billinglineitem + */ + public ?BillingLineItem $billinglineitem; + + /** + * + * @var ?BillingMetadata $billingmetadata + */ + public ?BillingMetadata $billingmetadata; + /** * * @var ?Brand $brand @@ -516,6 +533,18 @@ class Content { */ public ?GatewayPaymentMethodToken $gatewaypaymentmethodtoken; + /** + * + * @var ?GatewayRequestLog $gatewayrequestlog + */ + public ?GatewayRequestLog $gatewayrequestlog; + + /** + * + * @var ?GatewayWebhookLog $gatewaywebhooklog + */ + public ?GatewayWebhookLog $gatewaywebhooklog; + /** * * @var ?Gift $gift @@ -726,6 +755,12 @@ class Content { */ public ?Order $order; + /** + * + * @var ?OrganizationDetail $organizationdetail + */ + public ?OrganizationDetail $organizationdetail; + /** * * @var ?PaymentIntent $paymentintent @@ -1035,7 +1070,7 @@ class Content { /** * @var array $knownFields */ - 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" ]; + 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" , "billing_line_item" , "billing_metadata" , "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" , "gateway_request_log" , "gateway_webhook_log" , "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" , "organization_detail" , "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 @@ -1056,6 +1091,8 @@ private function __construct( ?AttachedItem $attacheditem, ?Attribute $attribute, ?BillingConfiguration $billingconfiguration, + ?BillingLineItem $billinglineitem, + ?BillingMetadata $billingmetadata, ?Brand $brand, ?BusinessEntity $businessentity, ?BusinessEntityTransfer $businessentitytransfer, @@ -1105,6 +1142,8 @@ private function __construct( ?FilterCondition $filtercondition, ?GatewayErrorDetail $gatewayerrordetail, ?GatewayPaymentMethodToken $gatewaypaymentmethodtoken, + ?GatewayRequestLog $gatewayrequestlog, + ?GatewayWebhookLog $gatewaywebhooklog, ?Gift $gift, ?GrantBlock $grantblock, ?GroupByAttribute $groupbyattribute, @@ -1140,6 +1179,7 @@ private function __construct( ?OmnichannelSubscriptionItemScheduledChange $omnichannelsubscriptionitemscheduledchange, ?OmnichannelTransaction $omnichanneltransaction, ?Order $order, + ?OrganizationDetail $organizationdetail, ?PaymentIntent $paymentintent, ?PaymentReferenceNumber $paymentreferencenumber, ?PaymentSchedule $paymentschedule, @@ -1205,6 +1245,8 @@ private function __construct( $this->attacheditem = $attacheditem; $this->attribute = $attribute; $this->billingconfiguration = $billingconfiguration; + $this->billinglineitem = $billinglineitem; + $this->billingmetadata = $billingmetadata; $this->brand = $brand; $this->businessentity = $businessentity; $this->businessentitytransfer = $businessentitytransfer; @@ -1254,6 +1296,8 @@ private function __construct( $this->filtercondition = $filtercondition; $this->gatewayerrordetail = $gatewayerrordetail; $this->gatewaypaymentmethodtoken = $gatewaypaymentmethodtoken; + $this->gatewayrequestlog = $gatewayrequestlog; + $this->gatewaywebhooklog = $gatewaywebhooklog; $this->gift = $gift; $this->grantblock = $grantblock; $this->groupbyattribute = $groupbyattribute; @@ -1289,6 +1333,7 @@ private function __construct( $this->omnichannelsubscriptionitemscheduledchange = $omnichannelsubscriptionitemscheduledchange; $this->omnichanneltransaction = $omnichanneltransaction; $this->order = $order; + $this->organizationdetail = $organizationdetail; $this->paymentintent = $paymentintent; $this->paymentreferencenumber = $paymentreferencenumber; $this->paymentschedule = $paymentschedule; @@ -1356,6 +1401,8 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['attached_item']) ? AttachedItem::from($resourceAttributes['attached_item']) : null, isset($resourceAttributes['attribute']) ? Attribute::from($resourceAttributes['attribute']) : null, isset($resourceAttributes['billing_configuration']) ? BillingConfiguration::from($resourceAttributes['billing_configuration']) : null, + isset($resourceAttributes['billing_line_item']) ? BillingLineItem::from($resourceAttributes['billing_line_item']) : null, + isset($resourceAttributes['billing_metadata']) ? BillingMetadata::from($resourceAttributes['billing_metadata']) : null, isset($resourceAttributes['brand']) ? Brand::from($resourceAttributes['brand']) : null, isset($resourceAttributes['business_entity']) ? BusinessEntity::from($resourceAttributes['business_entity']) : null, isset($resourceAttributes['business_entity_transfer']) ? BusinessEntityTransfer::from($resourceAttributes['business_entity_transfer']) : null, @@ -1405,6 +1452,8 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['filter_condition']) ? FilterCondition::from($resourceAttributes['filter_condition']) : null, isset($resourceAttributes['gateway_error_detail']) ? GatewayErrorDetail::from($resourceAttributes['gateway_error_detail']) : null, isset($resourceAttributes['gateway_payment_method_token']) ? GatewayPaymentMethodToken::from($resourceAttributes['gateway_payment_method_token']) : null, + isset($resourceAttributes['gateway_request_log']) ? GatewayRequestLog::from($resourceAttributes['gateway_request_log']) : null, + isset($resourceAttributes['gateway_webhook_log']) ? GatewayWebhookLog::from($resourceAttributes['gateway_webhook_log']) : 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, @@ -1440,6 +1489,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['omnichannel_subscription_item_scheduled_change']) ? OmnichannelSubscriptionItemScheduledChange::from($resourceAttributes['omnichannel_subscription_item_scheduled_change']) : null, isset($resourceAttributes['omnichannel_transaction']) ? OmnichannelTransaction::from($resourceAttributes['omnichannel_transaction']) : null, isset($resourceAttributes['order']) ? Order::from($resourceAttributes['order']) : null, + isset($resourceAttributes['organization_detail']) ? OrganizationDetail::from($resourceAttributes['organization_detail']) : null, isset($resourceAttributes['payment_intent']) ? PaymentIntent::from($resourceAttributes['payment_intent']) : null, isset($resourceAttributes['payment_reference_number']) ? PaymentReferenceNumber::from($resourceAttributes['payment_reference_number']) : null, isset($resourceAttributes['payment_schedule']) ? PaymentSchedule::from($resourceAttributes['payment_schedule']) : null, @@ -1643,6 +1693,11 @@ public function toArray(): array + + + + + @@ -1690,6 +1745,12 @@ public function toArray(): array if($this->billingconfiguration instanceof BillingConfiguration){ $data['billing_configuration'] = $this->billingconfiguration->toArray(); } + if($this->billinglineitem instanceof BillingLineItem){ + $data['billing_line_item'] = $this->billinglineitem->toArray(); + } + if($this->billingmetadata instanceof BillingMetadata){ + $data['billing_metadata'] = $this->billingmetadata->toArray(); + } if($this->brand instanceof Brand){ $data['brand'] = $this->brand->toArray(); } @@ -1837,6 +1898,12 @@ public function toArray(): array if($this->gatewaypaymentmethodtoken instanceof GatewayPaymentMethodToken){ $data['gateway_payment_method_token'] = $this->gatewaypaymentmethodtoken->toArray(); } + if($this->gatewayrequestlog instanceof GatewayRequestLog){ + $data['gateway_request_log'] = $this->gatewayrequestlog->toArray(); + } + if($this->gatewaywebhooklog instanceof GatewayWebhookLog){ + $data['gateway_webhook_log'] = $this->gatewaywebhooklog->toArray(); + } if($this->gift instanceof Gift){ $data['gift'] = $this->gift->toArray(); } @@ -1942,6 +2009,9 @@ public function toArray(): array if($this->order instanceof Order){ $data['order'] = $this->order->toArray(); } + if($this->organizationdetail instanceof OrganizationDetail){ + $data['organization_detail'] = $this->organizationdetail->toArray(); + } if($this->paymentintent instanceof PaymentIntent){ $data['payment_intent'] = $this->paymentintent->toArray(); } diff --git a/src/Resources/Discount/Discount.php b/src/Resources/Discount/Discount.php index 64da030b..7fc345dd 100644 --- a/src/Resources/Discount/Discount.php +++ b/src/Resources/Discount/Discount.php @@ -15,6 +15,12 @@ class Discount { */ public ?string $invoice_name; + /** + * + * @var ?string $description + */ + public ?string $description; + /** * * @var ?float $percentage @@ -114,7 +120,7 @@ class Discount { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "invoice_name" , "percentage" , "amount" , "quantity" , "currency_code" , "period" , "included_in_mrr" , "item_price_id" , "created_at" , "apply_till" , "applied_count" , "coupon_id" , "index" ]; + protected static array $knownFields = [ "id" , "invoice_name" , "description" , "percentage" , "amount" , "quantity" , "currency_code" , "period" , "included_in_mrr" , "item_price_id" , "created_at" , "apply_till" , "applied_count" , "coupon_id" , "index" ]; /** * dynamic properties for resources @@ -125,6 +131,7 @@ class Discount { private function __construct( ?string $id, ?string $invoice_name, + ?string $description, ?float $percentage, ?int $amount, ?int $quantity, @@ -145,6 +152,7 @@ private function __construct( { $this->id = $id; $this->invoice_name = $invoice_name; + $this->description = $description; $this->percentage = $percentage; $this->amount = $amount; $this->quantity = $quantity; @@ -167,6 +175,7 @@ public static function from(array $resourceAttributes): self { $returnData = new self( $resourceAttributes['id'] ?? null, $resourceAttributes['invoice_name'] ?? null, + $resourceAttributes['description'] ?? null, $resourceAttributes['percentage'] ?? null, $resourceAttributes['amount'] ?? null, $resourceAttributes['quantity'] ?? null, @@ -199,6 +208,7 @@ public function toArray(): array $data = array_filter(['id' => $this->id, 'invoice_name' => $this->invoice_name, + 'description' => $this->description, 'percentage' => $this->percentage, 'amount' => $this->amount, 'quantity' => $this->quantity, diff --git a/src/Resources/GatewayRequestLog/GatewayRequestLog.php b/src/Resources/GatewayRequestLog/GatewayRequestLog.php new file mode 100644 index 00000000..c6ba4270 --- /dev/null +++ b/src/Resources/GatewayRequestLog/GatewayRequestLog.php @@ -0,0 +1,296 @@ + $knownFields + */ + protected static array $knownFields = [ "log_id" , "url" , "status_code" , "method" , "request_body" , "response_body" , "request_headers" , "response_headers" , "gateway" , "customer_handle" , "invoice_handle" , "transaction_handle" , "payment_method_handle" , "gateway_credential_handle" , "payment_attempt_handle" , "payment_intent_handle" , "payment_method_name" , "operation_name" , "operation_type" , "action_type" , "source" , "trace_id_hash" , "invocation_time" , "response_received_at" , "response_time" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $log_id, + ?string $url, + ?string $status_code, + ?string $method, + ?string $request_body, + ?string $response_body, + ?string $request_headers, + ?string $response_headers, + ?string $gateway, + ?string $customer_handle, + ?string $invoice_handle, + ?string $transaction_handle, + ?string $payment_method_handle, + ?string $gateway_credential_handle, + ?string $payment_attempt_handle, + ?string $payment_intent_handle, + ?string $payment_method_name, + ?string $operation_name, + ?string $operation_type, + ?string $action_type, + ?string $source, + ?string $trace_id_hash, + ?int $invocation_time, + ?int $response_received_at, + ?int $response_time, + ) + { + $this->log_id = $log_id; + $this->url = $url; + $this->status_code = $status_code; + $this->method = $method; + $this->request_body = $request_body; + $this->response_body = $response_body; + $this->request_headers = $request_headers; + $this->response_headers = $response_headers; + $this->gateway = $gateway; + $this->customer_handle = $customer_handle; + $this->invoice_handle = $invoice_handle; + $this->transaction_handle = $transaction_handle; + $this->payment_method_handle = $payment_method_handle; + $this->gateway_credential_handle = $gateway_credential_handle; + $this->payment_attempt_handle = $payment_attempt_handle; + $this->payment_intent_handle = $payment_intent_handle; + $this->payment_method_name = $payment_method_name; + $this->operation_name = $operation_name; + $this->operation_type = $operation_type; + $this->action_type = $action_type; + $this->source = $source; + $this->trace_id_hash = $trace_id_hash; + $this->invocation_time = $invocation_time; + $this->response_received_at = $response_received_at; + $this->response_time = $response_time; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['log_id'] ?? null, + $resourceAttributes['url'] ?? null, + $resourceAttributes['status_code'] ?? null, + $resourceAttributes['method'] ?? null, + $resourceAttributes['request_body'] ?? null, + $resourceAttributes['response_body'] ?? null, + $resourceAttributes['request_headers'] ?? null, + $resourceAttributes['response_headers'] ?? null, + $resourceAttributes['gateway'] ?? null, + $resourceAttributes['customer_handle'] ?? null, + $resourceAttributes['invoice_handle'] ?? null, + $resourceAttributes['transaction_handle'] ?? null, + $resourceAttributes['payment_method_handle'] ?? null, + $resourceAttributes['gateway_credential_handle'] ?? null, + $resourceAttributes['payment_attempt_handle'] ?? null, + $resourceAttributes['payment_intent_handle'] ?? null, + $resourceAttributes['payment_method_name'] ?? null, + $resourceAttributes['operation_name'] ?? null, + $resourceAttributes['operation_type'] ?? null, + $resourceAttributes['action_type'] ?? null, + $resourceAttributes['source'] ?? null, + $resourceAttributes['trace_id_hash'] ?? null, + $resourceAttributes['invocation_time'] ?? null, + $resourceAttributes['response_received_at'] ?? null, + $resourceAttributes['response_time'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['log_id' => $this->log_id, + 'url' => $this->url, + 'status_code' => $this->status_code, + 'method' => $this->method, + 'request_body' => $this->request_body, + 'response_body' => $this->response_body, + 'request_headers' => $this->request_headers, + 'response_headers' => $this->response_headers, + 'gateway' => $this->gateway, + 'customer_handle' => $this->customer_handle, + 'invoice_handle' => $this->invoice_handle, + 'transaction_handle' => $this->transaction_handle, + 'payment_method_handle' => $this->payment_method_handle, + 'gateway_credential_handle' => $this->gateway_credential_handle, + 'payment_attempt_handle' => $this->payment_attempt_handle, + 'payment_intent_handle' => $this->payment_intent_handle, + 'payment_method_name' => $this->payment_method_name, + 'operation_name' => $this->operation_name, + 'operation_type' => $this->operation_type, + 'action_type' => $this->action_type, + 'source' => $this->source, + 'trace_id_hash' => $this->trace_id_hash, + 'invocation_time' => $this->invocation_time, + 'response_received_at' => $this->response_received_at, + 'response_time' => $this->response_time, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/GatewayWebhookLog/GatewayWebhookLog.php b/src/Resources/GatewayWebhookLog/GatewayWebhookLog.php new file mode 100644 index 00000000..a6db5908 --- /dev/null +++ b/src/Resources/GatewayWebhookLog/GatewayWebhookLog.php @@ -0,0 +1,246 @@ + $knownFields + */ + protected static array $knownFields = [ "webhook_id" , "url" , "method" , "status_code" , "gateway" , "id_at_gateway" , "customer_handle" , "invoice_handle" , "transaction_handle" , "payment_method_handle" , "gateway_credential_handle" , "payment_attempt_handle" , "payment_intent_handle" , "payment_method_name" , "request_body" , "response_body" , "request_headers" , "response_headers" , "received_at" , "response_time" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $webhook_id, + ?string $url, + ?string $method, + ?string $status_code, + ?string $gateway, + ?string $id_at_gateway, + ?string $customer_handle, + ?string $invoice_handle, + ?string $transaction_handle, + ?string $payment_method_handle, + ?string $gateway_credential_handle, + ?string $payment_attempt_handle, + ?string $payment_intent_handle, + ?string $payment_method_name, + ?string $request_body, + ?string $response_body, + ?string $request_headers, + ?string $response_headers, + ?int $received_at, + ?int $response_time, + ) + { + $this->webhook_id = $webhook_id; + $this->url = $url; + $this->method = $method; + $this->status_code = $status_code; + $this->gateway = $gateway; + $this->id_at_gateway = $id_at_gateway; + $this->customer_handle = $customer_handle; + $this->invoice_handle = $invoice_handle; + $this->transaction_handle = $transaction_handle; + $this->payment_method_handle = $payment_method_handle; + $this->gateway_credential_handle = $gateway_credential_handle; + $this->payment_attempt_handle = $payment_attempt_handle; + $this->payment_intent_handle = $payment_intent_handle; + $this->payment_method_name = $payment_method_name; + $this->request_body = $request_body; + $this->response_body = $response_body; + $this->request_headers = $request_headers; + $this->response_headers = $response_headers; + $this->received_at = $received_at; + $this->response_time = $response_time; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['webhook_id'] ?? null, + $resourceAttributes['url'] ?? null, + $resourceAttributes['method'] ?? null, + $resourceAttributes['status_code'] ?? null, + $resourceAttributes['gateway'] ?? null, + $resourceAttributes['id_at_gateway'] ?? null, + $resourceAttributes['customer_handle'] ?? null, + $resourceAttributes['invoice_handle'] ?? null, + $resourceAttributes['transaction_handle'] ?? null, + $resourceAttributes['payment_method_handle'] ?? null, + $resourceAttributes['gateway_credential_handle'] ?? null, + $resourceAttributes['payment_attempt_handle'] ?? null, + $resourceAttributes['payment_intent_handle'] ?? null, + $resourceAttributes['payment_method_name'] ?? null, + $resourceAttributes['request_body'] ?? null, + $resourceAttributes['response_body'] ?? null, + $resourceAttributes['request_headers'] ?? null, + $resourceAttributes['response_headers'] ?? null, + $resourceAttributes['received_at'] ?? null, + $resourceAttributes['response_time'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['webhook_id' => $this->webhook_id, + 'url' => $this->url, + 'method' => $this->method, + 'status_code' => $this->status_code, + 'gateway' => $this->gateway, + 'id_at_gateway' => $this->id_at_gateway, + 'customer_handle' => $this->customer_handle, + 'invoice_handle' => $this->invoice_handle, + 'transaction_handle' => $this->transaction_handle, + 'payment_method_handle' => $this->payment_method_handle, + 'gateway_credential_handle' => $this->gateway_credential_handle, + 'payment_attempt_handle' => $this->payment_attempt_handle, + 'payment_intent_handle' => $this->payment_intent_handle, + 'payment_method_name' => $this->payment_method_name, + 'request_body' => $this->request_body, + 'response_body' => $this->response_body, + 'request_headers' => $this->request_headers, + 'response_headers' => $this->response_headers, + 'received_at' => $this->received_at, + 'response_time' => $this->response_time, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/GrantBlock/BillingMetadata.php b/src/Resources/GrantBlock/BillingMetadata.php new file mode 100644 index 00000000..09adf75c --- /dev/null +++ b/src/Resources/GrantBlock/BillingMetadata.php @@ -0,0 +1,76 @@ + $line_items + */ + public ?array $line_items; + + /** + * @var array $knownFields + */ + protected static array $knownFields = [ "item_price_id" , "line_items" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $item_price_id, + ?array $line_items, + ) + { + $this->item_price_id = $item_price_id; + $this->line_items = $line_items; + } + + public static function from(array $resourceAttributes): self + { + $line_items = array_map(fn (array $result): \Chargebee\Resources\BillingLineItem\BillingLineItem => \Chargebee\Resources\BillingLineItem\BillingLineItem::from( + $result + ), $resourceAttributes['line_items'] ?? []); + + $returnData = new self( $resourceAttributes['item_price_id'] ?? null, + $line_items, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['item_price_id' => $this->item_price_id, + + + ], function ($value) { + return $value !== null; + }); + + + + if($this->line_items !== []){ + $data['line_items'] = array_map( + fn (\Chargebee\Resources\BillingLineItem\BillingLineItem $line_items): array => $line_items->toArray(), + $this->line_items + ); + } + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/GrantBlock/GrantBlock.php b/src/Resources/GrantBlock/GrantBlock.php index 96aba4e9..2c2691c8 100644 --- a/src/Resources/GrantBlock/GrantBlock.php +++ b/src/Resources/GrantBlock/GrantBlock.php @@ -111,6 +111,12 @@ class GrantBlock { */ public ?OverdraftBlockBalance $overdraft_block_balance; + /** + * + * @var ?BillingMetadata $billing_metadata + */ + public ?BillingMetadata $billing_metadata; + /** * * @var mixed $metadata @@ -144,7 +150,7 @@ class GrantBlock { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "subscription_id" , "unit_id" , "granted_amount" , "effective_from" , "expires_at" , "balance" , "hold_amount" , "used_amount" , "expired_amount" , "rolled_over_amount" , "voided_amount" , "origin_grant_block_id" , "created_at" , "modified_at" , "resource_version" , "provisioned_block_balance" , "overdraft_block_balance" , "metadata" ]; + protected static array $knownFields = [ "id" , "subscription_id" , "unit_id" , "granted_amount" , "effective_from" , "expires_at" , "balance" , "hold_amount" , "used_amount" , "expired_amount" , "rolled_over_amount" , "voided_amount" , "origin_grant_block_id" , "created_at" , "modified_at" , "resource_version" , "provisioned_block_balance" , "overdraft_block_balance" , "billing_metadata" , "metadata" ]; /** * dynamic properties for resources @@ -171,6 +177,7 @@ private function __construct( ?int $resource_version, ?ProvisionedBlockBalance $provisioned_block_balance, ?OverdraftBlockBalance $overdraft_block_balance, + ?BillingMetadata $billing_metadata, mixed $metadata, ?\Chargebee\Enums\Status $status, ?\Chargebee\Resources\GrantBlock\Enums\UnitType $unit_type, @@ -196,6 +203,7 @@ private function __construct( $this->resource_version = $resource_version; $this->provisioned_block_balance = $provisioned_block_balance; $this->overdraft_block_balance = $overdraft_block_balance; + $this->billing_metadata = $billing_metadata; $this->metadata = $metadata; $this->status = $status; $this->unit_type = $unit_type; @@ -223,6 +231,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['resource_version'] ?? null, isset($resourceAttributes['provisioned_block_balance']) ? ProvisionedBlockBalance::from($resourceAttributes['provisioned_block_balance']) : null, isset($resourceAttributes['overdraft_block_balance']) ? OverdraftBlockBalance::from($resourceAttributes['overdraft_block_balance']) : null, + isset($resourceAttributes['billing_metadata']) ? BillingMetadata::from($resourceAttributes['billing_metadata']) : null, $resourceAttributes['metadata'] ?? null, @@ -260,6 +269,7 @@ public function toArray(): array 'resource_version' => $this->resource_version, + 'metadata' => $this->metadata, 'status' => $this->status?->value, @@ -281,6 +291,9 @@ public function toArray(): array if($this->overdraft_block_balance instanceof OverdraftBlockBalance){ $data['overdraft_block_balance'] = $this->overdraft_block_balance->toArray(); } + if($this->billing_metadata instanceof BillingMetadata){ + $data['billing_metadata'] = $this->billing_metadata->toArray(); + } diff --git a/src/Resources/Invoice/Invoice.php b/src/Resources/Invoice/Invoice.php index a0fa887e..9789b255 100644 --- a/src/Resources/Invoice/Invoice.php +++ b/src/Resources/Invoice/Invoice.php @@ -424,6 +424,12 @@ class Invoice extends SupportsCustomFields { */ public ?\Chargebee\Enums\PriceType $price_type; + /** + * + * @var ?\Chargebee\Enums\OfflinePaymentMethod $offline_payment_method + */ + public ?\Chargebee\Enums\OfflinePaymentMethod $offline_payment_method; + /** * * @var ?\Chargebee\Enums\Channel $channel @@ -524,6 +530,7 @@ private function __construct( ?string $brand_id, ?SiteDetailsAtCreation $site_details_at_creation, ?\Chargebee\Enums\PriceType $price_type, + ?\Chargebee\Enums\OfflinePaymentMethod $offline_payment_method, ?\Chargebee\Enums\Channel $channel, ?\Chargebee\Resources\Invoice\Enums\Status $status, ?\Chargebee\Resources\Invoice\Enums\DunningStatus $dunning_status, @@ -599,6 +606,7 @@ private function __construct( $this->brand_id = $brand_id; $this->site_details_at_creation = $site_details_at_creation; $this->price_type = $price_type; + $this->offline_payment_method = $offline_payment_method; $this->channel = $channel; $this->status = $status; $this->dunning_status = $dunning_status; @@ -747,6 +755,8 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['price_type']) ? \Chargebee\Enums\PriceType::tryFromValue($resourceAttributes['price_type']) : null, + isset($resourceAttributes['offline_payment_method']) ? \Chargebee\Enums\OfflinePaymentMethod::tryFromValue($resourceAttributes['offline_payment_method']) : null, + isset($resourceAttributes['channel']) ? \Chargebee\Enums\Channel::tryFromValue($resourceAttributes['channel']) : null, isset($resourceAttributes['status']) ? \Chargebee\Resources\Invoice\Enums\Status::tryFromValue($resourceAttributes['status']) : null, @@ -837,6 +847,8 @@ public function toArray(): array 'price_type' => $this->price_type?->value, + 'offline_payment_method' => $this->offline_payment_method?->value, + 'channel' => $this->channel?->value, 'status' => $this->status?->value, diff --git a/src/Resources/OrganizationDetail/OrganizationDetail.php b/src/Resources/OrganizationDetail/OrganizationDetail.php new file mode 100644 index 00000000..38c54a28 --- /dev/null +++ b/src/Resources/OrganizationDetail/OrganizationDetail.php @@ -0,0 +1,236 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "organization_name" , "email" , "address_line1" , "address_line2" , "address_line3" , "city" , "state_code" , "state" , "country_code" , "zip" , "phone" , "fax" , "website" , "is_vat_number_present" , "vat_number" , "resource_version" , "updated_at" , "business_entity_id" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $organization_name, + ?string $email, + ?string $address_line1, + ?string $address_line2, + ?string $address_line3, + ?string $city, + ?string $state_code, + ?string $state, + ?string $country_code, + ?string $zip, + ?string $phone, + ?string $fax, + ?string $website, + ?bool $is_vat_number_present, + ?string $vat_number, + ?int $resource_version, + ?int $updated_at, + ?string $business_entity_id, + ) + { + $this->id = $id; + $this->organization_name = $organization_name; + $this->email = $email; + $this->address_line1 = $address_line1; + $this->address_line2 = $address_line2; + $this->address_line3 = $address_line3; + $this->city = $city; + $this->state_code = $state_code; + $this->state = $state; + $this->country_code = $country_code; + $this->zip = $zip; + $this->phone = $phone; + $this->fax = $fax; + $this->website = $website; + $this->is_vat_number_present = $is_vat_number_present; + $this->vat_number = $vat_number; + $this->resource_version = $resource_version; + $this->updated_at = $updated_at; + $this->business_entity_id = $business_entity_id; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['organization_name'] ?? null, + $resourceAttributes['email'] ?? null, + $resourceAttributes['address_line1'] ?? null, + $resourceAttributes['address_line2'] ?? null, + $resourceAttributes['address_line3'] ?? null, + $resourceAttributes['city'] ?? null, + $resourceAttributes['state_code'] ?? null, + $resourceAttributes['state'] ?? null, + $resourceAttributes['country_code'] ?? null, + $resourceAttributes['zip'] ?? null, + $resourceAttributes['phone'] ?? null, + $resourceAttributes['fax'] ?? null, + $resourceAttributes['website'] ?? null, + $resourceAttributes['is_vat_number_present'] ?? null, + $resourceAttributes['vat_number'] ?? null, + $resourceAttributes['resource_version'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['business_entity_id'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'organization_name' => $this->organization_name, + 'email' => $this->email, + 'address_line1' => $this->address_line1, + 'address_line2' => $this->address_line2, + 'address_line3' => $this->address_line3, + 'city' => $this->city, + 'state_code' => $this->state_code, + 'state' => $this->state, + 'country_code' => $this->country_code, + 'zip' => $this->zip, + 'phone' => $this->phone, + 'fax' => $this->fax, + 'website' => $this->website, + 'is_vat_number_present' => $this->is_vat_number_present, + 'vat_number' => $this->vat_number, + 'resource_version' => $this->resource_version, + 'updated_at' => $this->updated_at, + 'business_entity_id' => $this->business_entity_id, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Subscription/Discount.php b/src/Resources/Subscription/Discount.php index 37e3c3cd..f05b7968 100644 --- a/src/Resources/Subscription/Discount.php +++ b/src/Resources/Subscription/Discount.php @@ -15,6 +15,12 @@ class Discount { */ public ?string $invoice_name; + /** + * + * @var ?string $description + */ + public ?string $description; + /** * * @var ?string $type @@ -114,7 +120,7 @@ class Discount { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "invoice_name" , "type" , "percentage" , "amount" , "quantity" , "currency_code" , "duration_type" , "period" , "period_unit" , "included_in_mrr" , "apply_on" , "item_price_id" , "created_at" , "apply_till" , "applied_count" , "coupon_id" , "index" ]; + protected static array $knownFields = [ "id" , "invoice_name" , "description" , "type" , "percentage" , "amount" , "quantity" , "currency_code" , "duration_type" , "period" , "period_unit" , "included_in_mrr" , "apply_on" , "item_price_id" , "created_at" , "apply_till" , "applied_count" , "coupon_id" , "index" ]; /** * dynamic properties for resources @@ -125,6 +131,7 @@ class Discount { private function __construct( ?string $id, ?string $invoice_name, + ?string $description, ?string $type, ?float $percentage, ?int $amount, @@ -145,6 +152,7 @@ private function __construct( { $this->id = $id; $this->invoice_name = $invoice_name; + $this->description = $description; $this->type = $type; $this->percentage = $percentage; $this->amount = $amount; @@ -167,6 +175,7 @@ public static function from(array $resourceAttributes): self { $returnData = new self( $resourceAttributes['id'] ?? null, $resourceAttributes['invoice_name'] ?? null, + $resourceAttributes['description'] ?? null, $resourceAttributes['type'] ?? null, $resourceAttributes['percentage'] ?? null, $resourceAttributes['amount'] ?? null, @@ -195,6 +204,7 @@ public function toArray(): array $data = array_filter(['id' => $this->id, 'invoice_name' => $this->invoice_name, + 'description' => $this->description, 'type' => $this->type, 'percentage' => $this->percentage, 'amount' => $this->amount, diff --git a/src/Responses/GatewayRequestLogResponse/ListGatewayRequestLogResponse.php b/src/Responses/GatewayRequestLogResponse/ListGatewayRequestLogResponse.php new file mode 100644 index 00000000..3d920503 --- /dev/null +++ b/src/Responses/GatewayRequestLogResponse/ListGatewayRequestLogResponse.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): ListGatewayRequestLogResponseListObject { + return new ListGatewayRequestLogResponseListObject( + isset($result['gateway_request_log']) ? GatewayRequestLog::from($result['gateway_request_log']) : 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/GatewayRequestLogResponse/ListGatewayRequestLogResponseListObject.php b/src/Responses/GatewayRequestLogResponse/ListGatewayRequestLogResponseListObject.php new file mode 100644 index 00000000..eea3a97a --- /dev/null +++ b/src/Responses/GatewayRequestLogResponse/ListGatewayRequestLogResponseListObject.php @@ -0,0 +1,14 @@ +gateway_request_log = $gateway_request_log; + } +} diff --git a/src/Responses/GatewayRequestLogResponse/RetrieveGatewayRequestLogResponse.php b/src/Responses/GatewayRequestLogResponse/RetrieveGatewayRequestLogResponse.php new file mode 100644 index 00000000..caae2639 --- /dev/null +++ b/src/Responses/GatewayRequestLogResponse/RetrieveGatewayRequestLogResponse.php @@ -0,0 +1,45 @@ +gateway_request_log = $gateway_request_log; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['gateway_request_log']) ? GatewayRequestLog::from($resourceAttributes['gateway_request_log']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->gateway_request_log instanceof GatewayRequestLog){ + $data['gateway_request_log'] = $this->gateway_request_log->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/GatewayWebhookLogResponse/ListGatewayWebhookLogResponse.php b/src/Responses/GatewayWebhookLogResponse/ListGatewayWebhookLogResponse.php new file mode 100644 index 00000000..34aa2fe5 --- /dev/null +++ b/src/Responses/GatewayWebhookLogResponse/ListGatewayWebhookLogResponse.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): ListGatewayWebhookLogResponseListObject { + return new ListGatewayWebhookLogResponseListObject( + isset($result['gateway_webhook_log']) ? GatewayWebhookLog::from($result['gateway_webhook_log']) : 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/GatewayWebhookLogResponse/ListGatewayWebhookLogResponseListObject.php b/src/Responses/GatewayWebhookLogResponse/ListGatewayWebhookLogResponseListObject.php new file mode 100644 index 00000000..2d576ebe --- /dev/null +++ b/src/Responses/GatewayWebhookLogResponse/ListGatewayWebhookLogResponseListObject.php @@ -0,0 +1,14 @@ +gateway_webhook_log = $gateway_webhook_log; + } +} diff --git a/src/Responses/GatewayWebhookLogResponse/RetrieveGatewayWebhookLogResponse.php b/src/Responses/GatewayWebhookLogResponse/RetrieveGatewayWebhookLogResponse.php new file mode 100644 index 00000000..578910cd --- /dev/null +++ b/src/Responses/GatewayWebhookLogResponse/RetrieveGatewayWebhookLogResponse.php @@ -0,0 +1,45 @@ +gateway_webhook_log = $gateway_webhook_log; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['gateway_webhook_log']) ? GatewayWebhookLog::from($resourceAttributes['gateway_webhook_log']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->gateway_webhook_log instanceof GatewayWebhookLog){ + $data['gateway_webhook_log'] = $this->gateway_webhook_log->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/OrganizationDetailResponse/CreateOrganizationDetailResponse.php b/src/Responses/OrganizationDetailResponse/CreateOrganizationDetailResponse.php new file mode 100644 index 00000000..8db02eae --- /dev/null +++ b/src/Responses/OrganizationDetailResponse/CreateOrganizationDetailResponse.php @@ -0,0 +1,45 @@ +organization_detail = $organization_detail; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['organization_detail']) ? OrganizationDetail::from($resourceAttributes['organization_detail']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->organization_detail instanceof OrganizationDetail){ + $data['organization_detail'] = $this->organization_detail->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/OrganizationDetailResponse/ListOrganizationDetailResponse.php b/src/Responses/OrganizationDetailResponse/ListOrganizationDetailResponse.php new file mode 100644 index 00000000..3c60c186 --- /dev/null +++ b/src/Responses/OrganizationDetailResponse/ListOrganizationDetailResponse.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): ListOrganizationDetailResponseListObject { + return new ListOrganizationDetailResponseListObject( + isset($result['organization_detail']) ? OrganizationDetail::from($result['organization_detail']) : 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/OrganizationDetailResponse/ListOrganizationDetailResponseListObject.php b/src/Responses/OrganizationDetailResponse/ListOrganizationDetailResponseListObject.php new file mode 100644 index 00000000..8b893a83 --- /dev/null +++ b/src/Responses/OrganizationDetailResponse/ListOrganizationDetailResponseListObject.php @@ -0,0 +1,14 @@ +organization_detail = $organization_detail; + } +} diff --git a/src/Responses/OrganizationDetailResponse/RetrieveOrganizationDetailResponse.php b/src/Responses/OrganizationDetailResponse/RetrieveOrganizationDetailResponse.php new file mode 100644 index 00000000..5ff7bb9e --- /dev/null +++ b/src/Responses/OrganizationDetailResponse/RetrieveOrganizationDetailResponse.php @@ -0,0 +1,45 @@ +organization_detail = $organization_detail; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['organization_detail']) ? OrganizationDetail::from($resourceAttributes['organization_detail']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->organization_detail instanceof OrganizationDetail){ + $data['organization_detail'] = $this->organization_detail->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Version.php b/src/Version.php index fe2be066..e25c77b8 100644 --- a/src/Version.php +++ b/src/Version.php @@ -4,7 +4,7 @@ final class Version { - const VERSION = '4.28.0'; + const VERSION = '4.29.0'; } ?> \ No newline at end of file