diff --git a/CHANGELOG.md b/CHANGELOG.md index 0436ef79..083d9ee7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,57 @@ +### v4.19.0 (2026-03-27) +* * * +### New Resources: +- [`Alert`](https://apidocs.chargebee.com/docs/api/alerts) has been added. +- [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses) has been added. +- [`CpqQuoteSignature`](https://apidocs.chargebee.com/docs/api/cpq_quote_signatures) has been added. + + +### New Actions: +- [`update_a_quote_signature_status`](https://apidocs.chargebee.com/docs/api/quotes/update-a-quote-signature-status) has been added to [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`update_a_quote_signature`](https://apidocs.chargebee.com/docs/api/quotes/update-a-quote-signature) has been added to [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`retrieve_a_quote_signature_signed_pdf`](https://apidocs.chargebee.com/docs/api/quotes/retrieve-a-quote-signature-signed-pdf) has been added to [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`retrieve_a_quote_signature`](https://apidocs.chargebee.com/docs/api/quotes/retrieve-a-quote-signature) has been added to [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`create_a_quote_signature`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-signature) has been added to [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`refresh_a_quote_signature_link`](https://apidocs.chargebee.com/docs/api/quotes/refresh-a-quote-signature-link) has been added to [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + +### New Attributes: +- [`reference_id`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#reference_id) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`provider_references`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#provider_references) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`created_at`](https://apidocs.chargebee.com/docs/api/unbilled_charges/unbilled-charge-object#created_at) has been added to [`UnbilledCharge`](https://apidocs.chargebee.com/docs/api/unbilled_charges). + + +### New Parameters: +- [`include_usage_charges`](https://apidocs.chargebee.com/docs/api/estimates/upcoming-invoices-estimate#include_usage_charges) has been added as query parameter to [`upcoming_invoices_estimate`](https://apidocs.chargebee.com/docs/api/estimates/upcoming-invoices-estimate) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`business_entity_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/manage-payment-sources#business_entity_id) has been added as request body parameter to [`manage_payment_sources`](https://apidocs.chargebee.com/docs/api/hosted_pages/manage-payment-sources) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`cpq_quote_signature`](https://apidocs.chargebee.com/docs/api/quotes/update-a-quote-signature-status#cpq_quote_signature) has been added as request body parameter to [`update_a_quote_signature_status`](https://apidocs.chargebee.com/docs/api/quotes/update-a-quote-signature-status) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`gateway_account_id`](https://apidocs.chargebee.com/docs/api/virtual_bank_accounts/create-a-virtual-bank-account#gateway_account_id) has been added as request body parameter to [`create_a_virtual_bank_account`](https://apidocs.chargebee.com/docs/api/virtual_bank_accounts/create-a-virtual-bank-account) in [`VirtualBankAccount`](https://apidocs.chargebee.com/docs/api/virtual_bank_accounts). +- [`gateway_account_id`](https://apidocs.chargebee.com/docs/api/virtual_bank_accounts/create-a-virtual-bank-account-using-permanent-token#gateway_account_id) has been added as request body parameter to [`create_a_virtual_bank_account_using_permanent_token`](https://apidocs.chargebee.com/docs/api/virtual_bank_accounts/create-a-virtual-bank-account-using-permanent-token) in [`VirtualBankAccount`](https://apidocs.chargebee.com/docs/api/virtual_bank_accounts). + + +### New Events: +- [`alert_status_changed`](https://apidocs.chargebee.com/docs/api/events/webhook/alert_status_changed) has been added. + + +### New Enums: +- `alert_status` has been added as a new value enum `EntityType`. +- `alert_status_changed` has been added as a new value enum `EventType`. +- `pix` has been added as a new value enum `PaymentMethod`. +- `pix` has been added as a new value enum `PaymentMethodType`. +- `pix` and `usage_exceeded` have been added as new values enum `Type`. +- `enabled` and `disabled` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/alerts/alert-object#status) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `global` and `subscription` have been added as new values to enum attribute [`scope`](https://apidocs.chargebee.com/docs/api/alerts/alert-object#scope) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `draft`, `active`, `signed`, `expired`, `cancelled`, and `declined` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/cpq_quote_signatures/cpq-quote-signature-object#status) in [`CpqQuoteSignature`](https://apidocs.chargebee.com/docs/api/cpq_quote_signatures). +- `esign_and_pay`, `esign`, and `pay` have been added as new values to enum attribute [`customer_acceptance_method`](https://apidocs.chargebee.com/docs/api/cpq_quote_signatures/cpq-quote-signature-object#customer_acceptance_method) in [`CpqQuoteSignature`](https://apidocs.chargebee.com/docs/api/cpq_quote_signatures). +- `consolidated` and `detailed` have been added as new values to enum attribute [`quote_type`](https://apidocs.chargebee.com/docs/api/cpq_quote_signatures/cpq-quote-signature-object#quote_type) in [`CpqQuoteSignature`](https://apidocs.chargebee.com/docs/api/cpq_quote_signatures). +- `pix` has been added as a new value to enum attribute [`payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `pix` has been added as a new value to enum attribute [`active_payment_attempt.payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#active_payment_attempt_payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `pix` has been added as a new value to enum request body parameter `payment_method_type` in [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `pix` has been added as a new value to enum request body parameter `payment_method_type` in [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `expired`, `declined`, `draft`, `active`, `signed`, and `cancelled` have been added as new values to enum request body parameter `cpq_quote_signature.status` in [`update_a_quote_signature_status`](https://apidocs.chargebee.com/docs/api/quotes/update-a-quote-signature-status) of [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + + ### v4.18.0 (2025-03-03) * * * ### PSR-18 / PSR-17 HTTP client injection (backward compatible): diff --git a/VERSION b/VERSION index b30c4dcb..a69aa5a4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.18.0 +4.19.0 diff --git a/src/Actions/Contracts/CouponActionsInterface.php b/src/Actions/Contracts/CouponActionsInterface.php index 79ac6006..96c89dbb 100644 --- a/src/Actions/Contracts/CouponActionsInterface.php +++ b/src/Actions/Contracts/CouponActionsInterface.php @@ -86,8 +86,8 @@ * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/EntitlementActionsInterface.php b/src/Actions/Contracts/EntitlementActionsInterface.php index a0f27658..398ae8ba 100644 --- a/src/Actions/Contracts/EntitlementActionsInterface.php +++ b/src/Actions/Contracts/EntitlementActionsInterface.php @@ -18,16 +18,16 @@ * limit?: int, * offset?: string, * feature_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_type?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * include_drafts?: bool, * embed?: string, diff --git a/src/Actions/Contracts/EstimateActionsInterface.php b/src/Actions/Contracts/EstimateActionsInterface.php index c16d547f..8cee44d9 100644 --- a/src/Actions/Contracts/EstimateActionsInterface.php +++ b/src/Actions/Contracts/EstimateActionsInterface.php @@ -531,7 +531,9 @@ public function updateSubscriptionForItems(array $params, array $headers = []): /** * @see https://apidocs.chargebee.com/docs/api/estimates/upcoming-invoices-estimate?lang=php-v4 - * + * @param array{ + * include_usage_charges?: bool, + * } $params Description of the parameters * @param string $id * @param array $headers * @return UpcomingInvoicesEstimateEstimateResponse @@ -541,7 +543,7 @@ public function updateSubscriptionForItems(array $params, array $headers = []): * @throws InvalidRequestException * @throws Exception */ - public function upcomingInvoicesEstimate(string $id, array $headers = []): UpcomingInvoicesEstimateEstimateResponse; + public function upcomingInvoicesEstimate(string $id, array $params = [], array $headers = []): UpcomingInvoicesEstimateEstimateResponse; /** * @see https://apidocs.chargebee.com/docs/api/estimates/regenerate-invoice-estimate?lang=php-v4 diff --git a/src/Actions/Contracts/ExportActionsInterface.php b/src/Actions/Contracts/ExportActionsInterface.php index 35c8546e..4909437e 100644 --- a/src/Actions/Contracts/ExportActionsInterface.php +++ b/src/Actions/Contracts/ExportActionsInterface.php @@ -1602,8 +1602,8 @@ public function creditNotes(array $params = [], array $headers = []): CreditNote * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/HostedPageActionsInterface.php b/src/Actions/Contracts/HostedPageActionsInterface.php index 940315c5..f542b1d6 100644 --- a/src/Actions/Contracts/HostedPageActionsInterface.php +++ b/src/Actions/Contracts/HostedPageActionsInterface.php @@ -742,7 +742,8 @@ public function retrieve(string $id, array $headers = []): RetrieveHostedPageRes * gateway?: string, * gateway_account_id?: string, * }, - * redirect_url?: string, + * business_entity_id?: string, + * redirect_url?: string, * } $params Description of the parameters * * @param array $headers diff --git a/src/Actions/Contracts/InvoiceActionsInterface.php b/src/Actions/Contracts/InvoiceActionsInterface.php index 63fc9bd2..5e1f46f7 100644 --- a/src/Actions/Contracts/InvoiceActionsInterface.php +++ b/src/Actions/Contracts/InvoiceActionsInterface.php @@ -1238,13 +1238,13 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] * offset?: string, * payment_reference_number?: array{ * number?: array{ - * in?: string, - * is?: string, + * is?: string, + * in?: string, * }, * }, * id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/QuoteActionsInterface.php b/src/Actions/Contracts/QuoteActionsInterface.php index 6117d9b0..fe41f710 100644 --- a/src/Actions/Contracts/QuoteActionsInterface.php +++ b/src/Actions/Contracts/QuoteActionsInterface.php @@ -2,25 +2,31 @@ namespace Chargebee\Actions\Contracts; use Chargebee\Responses\QuoteResponse\EditUpdateSubscriptionQuoteForItemsQuoteResponse; -use Chargebee\Responses\QuoteResponse\EditCreateSubForCustomerQuoteQuoteResponse; -use Chargebee\Responses\QuoteResponse\EditCreateSubCustomerQuoteForItemsQuoteResponse; use Chargebee\Responses\QuoteResponse\ConvertQuoteResponse; +use Chargebee\Responses\QuoteResponse\EditCreateSubCustomerQuoteForItemsQuoteResponse; use Chargebee\Responses\QuoteResponse\CreateSubForCustomerQuoteQuoteResponse; use Chargebee\Responses\QuoteResponse\ListQuoteResponse; use Chargebee\Responses\QuoteResponse\PdfQuoteResponse; -use Chargebee\Responses\QuoteResponse\CreateSubItemsForCustomerQuoteQuoteResponse; use Chargebee\Responses\QuoteResponse\RetrieveQuoteResponse; +use Chargebee\Responses\QuoteResponse\RetrieveSignedPdfQuoteResponse; +use Chargebee\Responses\QuoteResponse\DeleteQuoteResponse; +use Chargebee\Responses\QuoteResponse\CreateForOnetimeChargesQuoteResponse; +use Chargebee\Responses\QuoteResponse\QuoteLineGroupsForQuoteQuoteResponse; +use Chargebee\Responses\QuoteResponse\UpdateSignatureStatusQuoteResponse; +use Chargebee\Responses\QuoteResponse\ExtendExpiryDateQuoteResponse; +use Chargebee\Responses\QuoteResponse\EditCreateSubForCustomerQuoteQuoteResponse; +use Chargebee\Responses\QuoteResponse\RefreshSignatureLinkQuoteResponse; +use Chargebee\Responses\QuoteResponse\CreateSubItemsForCustomerQuoteQuoteResponse; use Chargebee\Responses\QuoteResponse\UpdateStatusQuoteResponse; use Chargebee\Responses\QuoteResponse\EditForChargeItemsAndChargesQuoteResponse; -use Chargebee\Responses\QuoteResponse\DeleteQuoteResponse; use Chargebee\Responses\QuoteResponse\UpdateSubscriptionQuoteQuoteResponse; -use Chargebee\Responses\QuoteResponse\CreateForOnetimeChargesQuoteResponse; use Chargebee\Responses\QuoteResponse\EditOneTimeQuoteQuoteResponse; use Chargebee\Responses\QuoteResponse\CreateForChargeItemsAndChargesQuoteResponse; use Chargebee\Responses\QuoteResponse\UpdateSubscriptionQuoteForItemsQuoteResponse; -use Chargebee\Responses\QuoteResponse\QuoteLineGroupsForQuoteQuoteResponse; +use Chargebee\Responses\QuoteResponse\UpdateSignatureQuoteResponse; +use Chargebee\Responses\QuoteResponse\RetrieveSignatureQuoteResponse; use Chargebee\Responses\QuoteResponse\EditUpdateSubscriptionQuoteQuoteResponse; -use Chargebee\Responses\QuoteResponse\ExtendExpiryDateQuoteResponse; +use Chargebee\Responses\QuoteResponse\CreateSignatureQuoteResponse; use Exception; use Chargebee\Exceptions\PaymentException; use Chargebee\Exceptions\OperationFailedException; @@ -154,14 +160,343 @@ public function createSubItemsForCustomerQuote(string $id, array $params, array * * @param string $id * @param array $headers - * @return RetrieveQuoteResponse + * @return RetrieveQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveQuoteResponse; + + /** + * + * @param array{ + * cpq_quote_signature?: array{ + * status?: string, + * }, + * } $params Description of the parameters + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. + * @param array $headers + * @return UpdateSignatureStatusQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateSignatureStatus(string $id, array $params = [], array $headers = []): UpdateSignatureStatusQuoteResponse; + + /** + * + * + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. + * @param array $headers + * @return UpdateSignatureQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateSignature(string $id, array $headers = []): UpdateSignatureQuoteResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/update-quote-status?lang=php-v4 + * @param array{ + * status?: string, + * comment?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateStatusQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateStatus(string $id, array $params, array $headers = []): UpdateStatusQuoteResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/extend-expiry-date?lang=php-v4 + * @param array{ + * valid_till?: int, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ExtendExpiryDateQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function extendExpiryDate(string $id, array $params, array $headers = []): ExtendExpiryDateQuoteResponse; + + /** + * + * + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. + * @param array $headers + * @return RetrieveSignedPdfQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieveSignedPdf(string $id, array $headers = []): RetrieveSignedPdfQuoteResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items?lang=php-v4 + * @param array{ + * subscription?: array{ + * setup_fee?: int, + * start_date?: int, + * trial_end?: int, + * coupon?: string, + * auto_collection?: string, + * offline_payment_method?: string, + * contract_term_billing_cycle_on_renewal?: int, + * }, + * billing_address?: array{ + * first_name?: string, + * last_name?: string, + * email?: string, + * company?: string, + * phone?: string, + * line1?: string, + * line2?: string, + * line3?: string, + * city?: string, + * state_code?: string, + * state?: string, + * zip?: string, + * country?: string, + * validation_status?: string, + * }, + * shipping_address?: array{ + * first_name?: string, + * last_name?: string, + * email?: string, + * company?: string, + * phone?: string, + * line1?: string, + * line2?: string, + * line3?: string, + * city?: string, + * state_code?: string, + * state?: string, + * zip?: string, + * country?: string, + * validation_status?: string, + * }, + * customer?: array{ + * vat_number?: string, + * vat_number_prefix?: string, + * registered_for_gst?: bool, + * }, + * contract_term?: array{ + * action_at_term_end?: string, + * cancellation_cutoff_period?: int, + * }, + * subscription_items?: array, + * discounts?: array, + * item_tiers?: array, + * coupons?: array, + * notes?: string, + * expires_at?: int, + * mandatory_items_to_remove?: array, + * replace_items_list?: bool, + * billing_cycles?: int, + * terms_to_charge?: int, + * reactivate_from?: int, + * billing_alignment_mode?: string, + * coupon_ids?: array, + * replace_coupon_list?: bool, + * change_option?: string, + * changes_scheduled_at?: int, + * force_term_reset?: bool, + * reactivate?: bool, + * net_term_days?: int, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return EditUpdateSubscriptionQuoteForItemsQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function editUpdateSubscriptionQuoteForItems(string $id, array $params, array $headers = []): EditUpdateSubscriptionQuoteForItemsQuoteResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/list-quotes?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * include_deleted?: bool, + * id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * customer_id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * subscription_id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * is_present?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * status?: array{ + * is?: mixed, + * is_not?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * date?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * updated_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 ListQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListQuoteResponse; + + /** + * + * + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. + * @param array $headers + * @return RetrieveSignatureQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieveSignature(string $id, array $headers = []): RetrieveSignatureQuoteResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/convert-a-quote?lang=php-v4 + * @param array{ + * subscription?: array{ + * id?: string, + * auto_collection?: string, + * po_number?: string, + * auto_close_invoices?: bool, + * }, + * invoice_date?: int, + * invoice_immediately?: bool, + * create_pending_invoices?: bool, + * first_invoice_pending?: bool, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ConvertQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function convert(string $id, array $params = [], array $headers = []): ConvertQuoteResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/delete-a-quote?lang=php-v4 + * @param array{ + * comment?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return DeleteQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function retrieve(string $id, array $headers = []): RetrieveQuoteResponse; + public function delete(string $id, array $params = [], array $headers = []): DeleteQuoteResponse; /** * @see https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items?lang=php-v4 @@ -281,23 +616,6 @@ public function retrieve(string $id, array $headers = []): RetrieveQuoteResponse */ public function editCreateSubCustomerQuoteForItems(string $id, array $params, array $headers = []): EditCreateSubCustomerQuoteForItemsQuoteResponse; - /** - * @see https://apidocs.chargebee.com/docs/api/quotes/update-quote-status?lang=php-v4 - * @param array{ - * status?: string, - * comment?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return UpdateStatusQuoteResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function updateStatus(string $id, array $params, array $headers = []): UpdateStatusQuoteResponse; - /** * @see https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items?lang=php-v4 * @param array{ @@ -446,22 +764,6 @@ public function updateSubscriptionQuoteForItems(array $params, array $headers = */ public function quoteLineGroupsForQuote(string $id, array $params = [], array $headers = []): QuoteLineGroupsForQuoteQuoteResponse; - /** - * @see https://apidocs.chargebee.com/docs/api/quotes/extend-expiry-date?lang=php-v4 - * @param array{ - * valid_till?: int, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return ExtendExpiryDateQuoteResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function extendExpiryDate(string $id, array $params, array $headers = []): ExtendExpiryDateQuoteResponse; - /** * @see https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-charge-items-and-charges?lang=php-v4 * @param array{ @@ -556,195 +858,34 @@ public function extendExpiryDate(string $id, array $params, array $headers = []) public function editForChargeItemsAndCharges(string $id, array $params, array $headers = []): EditForChargeItemsAndChargesQuoteResponse; /** - * @see https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items?lang=php-v4 - * @param array{ - * subscription?: array{ - * setup_fee?: int, - * start_date?: int, - * trial_end?: int, - * coupon?: string, - * auto_collection?: string, - * offline_payment_method?: string, - * contract_term_billing_cycle_on_renewal?: int, - * }, - * billing_address?: array{ - * first_name?: string, - * last_name?: string, - * email?: string, - * company?: string, - * phone?: string, - * line1?: string, - * line2?: string, - * line3?: string, - * city?: string, - * state_code?: string, - * state?: string, - * zip?: string, - * country?: string, - * validation_status?: string, - * }, - * shipping_address?: array{ - * first_name?: string, - * last_name?: string, - * email?: string, - * company?: string, - * phone?: string, - * line1?: string, - * line2?: string, - * line3?: string, - * city?: string, - * state_code?: string, - * state?: string, - * zip?: string, - * country?: string, - * validation_status?: string, - * }, - * customer?: array{ - * vat_number?: string, - * vat_number_prefix?: string, - * registered_for_gst?: bool, - * }, - * contract_term?: array{ - * action_at_term_end?: string, - * cancellation_cutoff_period?: int, - * }, - * subscription_items?: array, - * discounts?: array, - * item_tiers?: array, - * coupons?: array, - * notes?: string, - * expires_at?: int, - * mandatory_items_to_remove?: array, - * replace_items_list?: bool, - * billing_cycles?: int, - * terms_to_charge?: int, - * reactivate_from?: int, - * billing_alignment_mode?: string, - * coupon_ids?: array, - * replace_coupon_list?: bool, - * change_option?: string, - * changes_scheduled_at?: int, - * force_term_reset?: bool, - * reactivate?: bool, - * net_term_days?: int, - * } $params Description of the parameters + * + * * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers - * @return EditUpdateSubscriptionQuoteForItemsQuoteResponse + * @return CreateSignatureQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function editUpdateSubscriptionQuoteForItems(string $id, array $params, array $headers = []): EditUpdateSubscriptionQuoteForItemsQuoteResponse; + public function createSignature(string $id, array $headers = []): CreateSignatureQuoteResponse; /** - * @see https://apidocs.chargebee.com/docs/api/quotes/list-quotes?lang=php-v4 - * @param array{ - * limit?: int, - * offset?: string, - * include_deleted?: bool, - * id?: array{ - * is?: mixed, - * is_not?: mixed, - * starts_with?: mixed, - * in?: mixed, - * not_in?: mixed, - * }, - * customer_id?: array{ - * is?: mixed, - * is_not?: mixed, - * starts_with?: mixed, - * in?: mixed, - * not_in?: mixed, - * }, - * subscription_id?: array{ - * is?: mixed, - * is_not?: mixed, - * starts_with?: mixed, - * is_present?: mixed, - * in?: mixed, - * not_in?: mixed, - * }, - * status?: array{ - * is?: mixed, - * is_not?: mixed, - * in?: mixed, - * not_in?: mixed, - * }, - * date?: array{ - * after?: mixed, - * before?: mixed, - * on?: mixed, - * between?: mixed, - * }, - * updated_at?: array{ - * after?: mixed, - * before?: mixed, - * on?: mixed, - * between?: mixed, - * }, - * sort_by?: array{ - * asc?: string, - * desc?: string, - * }, - * } $params Description of the parameters * + * + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers - * @return ListQuoteResponse + * @return RefreshSignatureLinkQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function all(array $params = [], array $headers = []): ListQuoteResponse; + public function refreshSignatureLink(string $id, array $headers = []): RefreshSignatureLinkQuoteResponse; /** * @see https://apidocs.chargebee.com/docs/api/quotes/retrieve-quote-as-pdf?lang=php-v4 @@ -763,31 +904,6 @@ public function all(array $params = [], array $headers = []): ListQuoteResponse; */ public function pdf(string $id, array $params = [], array $headers = []): PdfQuoteResponse; - /** - * @see https://apidocs.chargebee.com/docs/api/quotes/convert-a-quote?lang=php-v4 - * @param array{ - * subscription?: array{ - * id?: string, - * auto_collection?: string, - * po_number?: string, - * auto_close_invoices?: bool, - * }, - * invoice_date?: int, - * invoice_immediately?: bool, - * create_pending_invoices?: bool, - * first_invoice_pending?: bool, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return ConvertQuoteResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function convert(string $id, array $params = [], array $headers = []): ConvertQuoteResponse; - /** * @see https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-charge-and-charge-items?lang=php-v4 * @param array{ @@ -883,22 +999,6 @@ public function convert(string $id, array $params = [], array $headers = []): Co */ public function createForChargeItemsAndCharges(array $params, array $headers = []): CreateForChargeItemsAndChargesQuoteResponse; - /** - * @see https://apidocs.chargebee.com/docs/api/quotes/delete-a-quote?lang=php-v4 - * @param array{ - * comment?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return DeleteQuoteResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function delete(string $id, array $params = [], array $headers = []): DeleteQuoteResponse; - /** * @see https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-one-time-charges?lang=php-v4 * @param array{ diff --git a/src/Actions/Contracts/RampActionsInterface.php b/src/Actions/Contracts/RampActionsInterface.php index 1f9eccce..c8a18bba 100644 --- a/src/Actions/Contracts/RampActionsInterface.php +++ b/src/Actions/Contracts/RampActionsInterface.php @@ -110,12 +110,12 @@ public function createForSubscription(string $id, array $params, array $headers * offset?: string, * include_deleted?: bool, * status?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * subscription_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * effective_from?: array{ * after?: mixed, diff --git a/src/Actions/Contracts/UsageChargeActionsInterface.php b/src/Actions/Contracts/UsageChargeActionsInterface.php index bab2ed9b..08cdb59c 100644 --- a/src/Actions/Contracts/UsageChargeActionsInterface.php +++ b/src/Actions/Contracts/UsageChargeActionsInterface.php @@ -12,7 +12,7 @@ { /** - * + * @see https://apidocs.chargebee.com/docs/api/usage_charges/retrieve-usage-charges-for-a-subscription?lang=php-v4 * @param array{ * limit?: int, * offset?: string, @@ -21,7 +21,6 @@ * }, * } $params Description of the parameters * @param string $id - * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers * @return RetrieveUsageChargesForSubscriptionUsageChargeResponse * @throws PaymentException diff --git a/src/Actions/Contracts/UsageSummaryActionsInterface.php b/src/Actions/Contracts/UsageSummaryActionsInterface.php index 9ee4f050..688278a5 100644 --- a/src/Actions/Contracts/UsageSummaryActionsInterface.php +++ b/src/Actions/Contracts/UsageSummaryActionsInterface.php @@ -12,7 +12,7 @@ { /** - * + * @see https://apidocs.chargebee.com/docs/api/usage_summaries/retrieve-usage-summary-for-a-subscription?lang=php-v4 * @param array{ * limit?: int, * offset?: string, @@ -22,7 +22,6 @@ * timeframe_end?: int, * } $params Description of the parameters * @param string $id - * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers * @return RetrieveUsageSummaryForSubscriptionUsageSummaryResponse * @throws PaymentException diff --git a/src/Actions/CouponActions.php b/src/Actions/CouponActions.php index 9cdfe0ca..bcfab703 100644 --- a/src/Actions/CouponActions.php +++ b/src/Actions/CouponActions.php @@ -99,8 +99,8 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/EntitlementActions.php b/src/Actions/EntitlementActions.php index 6602900d..ebee27f0 100644 --- a/src/Actions/EntitlementActions.php +++ b/src/Actions/EntitlementActions.php @@ -31,16 +31,16 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * limit?: int, * offset?: string, * feature_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_type?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * include_drafts?: bool, * embed?: string, diff --git a/src/Actions/EstimateActions.php b/src/Actions/EstimateActions.php index 4e5d1a3e..155a831d 100644 --- a/src/Actions/EstimateActions.php +++ b/src/Actions/EstimateActions.php @@ -688,7 +688,9 @@ public function updateSubscriptionForItems(array $params, array $headers = []): /** * @see https://apidocs.chargebee.com/docs/api/estimates/upcoming-invoices-estimate?lang=php-v4 - * + * @param array{ + * include_usage_charges?: bool, + * } $params Description of the parameters * @param string $id * @param array $headers * @return UpcomingInvoicesEstimateEstimateResponse @@ -698,7 +700,7 @@ public function updateSubscriptionForItems(array $params, array $headers = []): * @throws InvalidRequestException * @throws Exception */ - public function upcomingInvoicesEstimate(string $id, array $headers = []): UpcomingInvoicesEstimateEstimateResponse + public function upcomingInvoicesEstimate(string $id, array $params = [], array $headers = []): UpcomingInvoicesEstimateEstimateResponse { $jsonKeys = [ ]; @@ -710,6 +712,7 @@ public function upcomingInvoicesEstimate(string $id, array $headers = []): Upcom ->withSubDomain(null) ->withJsonKeys($jsonKeys) ->withHeaders($headers) + ->withParams($params) ->build(); $apiRequester = new APIRequester($this->httpClientFactory, $this->env); $respObject = $apiRequester->makeRequest($payload); diff --git a/src/Actions/ExportActions.php b/src/Actions/ExportActions.php index 9117c8cb..b9035866 100644 --- a/src/Actions/ExportActions.php +++ b/src/Actions/ExportActions.php @@ -1828,8 +1828,8 @@ public function creditNotes(array $params = [], array $headers = []): CreditNote * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/HostedPageActions.php b/src/Actions/HostedPageActions.php index bf8a7f60..b147c8bc 100644 --- a/src/Actions/HostedPageActions.php +++ b/src/Actions/HostedPageActions.php @@ -1058,7 +1058,8 @@ public function retrieve(string $id, array $headers = []): RetrieveHostedPageRes * gateway?: string, * gateway_account_id?: string, * }, - * redirect_url?: string, + * business_entity_id?: string, + * redirect_url?: string, * } $params Description of the parameters * * @param array $headers diff --git a/src/Actions/InvoiceActions.php b/src/Actions/InvoiceActions.php index a2278724..19f3a990 100644 --- a/src/Actions/InvoiceActions.php +++ b/src/Actions/InvoiceActions.php @@ -1770,13 +1770,13 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] * offset?: string, * payment_reference_number?: array{ * number?: array{ - * in?: string, - * is?: string, + * is?: string, + * in?: string, * }, * }, * id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/QuoteActions.php b/src/Actions/QuoteActions.php index 6cf0ba9d..2690fe7f 100644 --- a/src/Actions/QuoteActions.php +++ b/src/Actions/QuoteActions.php @@ -2,27 +2,33 @@ namespace Chargebee\Actions; use Chargebee\Responses\QuoteResponse\EditUpdateSubscriptionQuoteForItemsQuoteResponse; -use Chargebee\Responses\QuoteResponse\EditCreateSubForCustomerQuoteQuoteResponse; -use Chargebee\Responses\QuoteResponse\EditCreateSubCustomerQuoteForItemsQuoteResponse; use Chargebee\Responses\QuoteResponse\ConvertQuoteResponse; +use Chargebee\Responses\QuoteResponse\EditCreateSubCustomerQuoteForItemsQuoteResponse; use Chargebee\Responses\QuoteResponse\CreateSubForCustomerQuoteQuoteResponse; use Chargebee\Responses\QuoteResponse\ListQuoteResponse; use Chargebee\Responses\QuoteResponse\PdfQuoteResponse; use Chargebee\Actions\Contracts\QuoteActionsInterface; -use Chargebee\Responses\QuoteResponse\CreateSubItemsForCustomerQuoteQuoteResponse; use Chargebee\Responses\QuoteResponse\RetrieveQuoteResponse; +use Chargebee\Responses\QuoteResponse\RetrieveSignedPdfQuoteResponse; +use Chargebee\Responses\QuoteResponse\DeleteQuoteResponse; +use Chargebee\Responses\QuoteResponse\CreateForOnetimeChargesQuoteResponse; +use Chargebee\Responses\QuoteResponse\QuoteLineGroupsForQuoteQuoteResponse; +use Chargebee\Responses\QuoteResponse\UpdateSignatureStatusQuoteResponse; +use Chargebee\Responses\QuoteResponse\ExtendExpiryDateQuoteResponse; +use Chargebee\Responses\QuoteResponse\EditCreateSubForCustomerQuoteQuoteResponse; +use Chargebee\Responses\QuoteResponse\RefreshSignatureLinkQuoteResponse; +use Chargebee\Responses\QuoteResponse\CreateSubItemsForCustomerQuoteQuoteResponse; use Chargebee\Responses\QuoteResponse\UpdateStatusQuoteResponse; use Chargebee\ValueObjects\Encoders\ListParamEncoder; use Chargebee\Responses\QuoteResponse\EditForChargeItemsAndChargesQuoteResponse; -use Chargebee\Responses\QuoteResponse\DeleteQuoteResponse; use Chargebee\Responses\QuoteResponse\UpdateSubscriptionQuoteQuoteResponse; -use Chargebee\Responses\QuoteResponse\CreateForOnetimeChargesQuoteResponse; use Chargebee\Responses\QuoteResponse\EditOneTimeQuoteQuoteResponse; use Chargebee\Responses\QuoteResponse\CreateForChargeItemsAndChargesQuoteResponse; use Chargebee\Responses\QuoteResponse\UpdateSubscriptionQuoteForItemsQuoteResponse; -use Chargebee\Responses\QuoteResponse\QuoteLineGroupsForQuoteQuoteResponse; +use Chargebee\Responses\QuoteResponse\UpdateSignatureQuoteResponse; +use Chargebee\Responses\QuoteResponse\RetrieveSignatureQuoteResponse; use Chargebee\Responses\QuoteResponse\EditUpdateSubscriptionQuoteQuoteResponse; -use Chargebee\Responses\QuoteResponse\ExtendExpiryDateQuoteResponse; +use Chargebee\Responses\QuoteResponse\CreateSignatureQuoteResponse; use Chargebee\ValueObjects\Encoders\URLFormEncoder; use Chargebee\ValueObjects\Transporters\ChargebeePayload; use Chargebee\ValueObjects\APIRequester; @@ -211,129 +217,30 @@ public function retrieve(string $id, array $headers = []): RetrieveQuoteResponse } /** - * @see https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items?lang=php-v4 + * @see https://apidocs.chargebee.com/docs/api/quotes/update-a-quote-signature-status?lang=php-v4 * @param array{ - * subscription?: array{ - * id?: string, - * po_number?: string, - * trial_end?: int, - * setup_fee?: int, - * start_date?: int, - * offline_payment_method?: string, - * contract_term_billing_cycle_on_renewal?: int, - * free_period?: int, - * free_period_unit?: string, - * }, - * shipping_address?: array{ - * first_name?: string, - * last_name?: string, - * email?: string, - * company?: string, - * phone?: string, - * line1?: string, - * line2?: string, - * line3?: string, - * city?: string, - * state_code?: string, - * state?: string, - * zip?: string, - * country?: string, - * validation_status?: string, - * }, - * contract_term?: array{ - * action_at_term_end?: string, - * cancellation_cutoff_period?: int, - * }, - * billing_address?: array{ - * first_name?: string, - * last_name?: string, - * email?: string, - * company?: string, - * phone?: string, - * line1?: string, - * line2?: string, - * line3?: string, - * city?: string, - * state_code?: string, - * state?: string, - * zip?: string, - * country?: string, - * validation_status?: string, + * cpq_quote_signature?: array{ + * status?: string, * }, - * subscription_items?: array, - * discounts?: array, - * item_tiers?: array, - * coupons?: array, - * notes?: string, - * expires_at?: int, - * billing_cycles?: int, - * mandatory_items_to_remove?: array, - * terms_to_charge?: int, - * billing_alignment_mode?: string, - * coupon_ids?: array, - * billing_start_option?: string, - * net_term_days?: int, - * } $params Description of the parameters + * } $params Description of the parameters * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers - * @return EditCreateSubCustomerQuoteForItemsQuoteResponse + * @return UpdateSignatureStatusQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function editCreateSubCustomerQuoteForItems(string $id, array $params, array $headers = []): EditCreateSubCustomerQuoteForItemsQuoteResponse + public function updateSignatureStatus(string $id, array $params = [], array $headers = []): UpdateSignatureStatusQuoteResponse { $jsonKeys = [ ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) ->withHttpMethod("post") - ->withUriPaths(["quotes",$id,"edit_create_subscription_quote_for_items"]) + ->withUriPaths(["quotes",$id,"update_signature_status"]) ->withParamEncoder( new URLFormEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) @@ -343,7 +250,39 @@ public function editCreateSubCustomerQuoteForItems(string $id, array $params, ar ->build(); $apiRequester = new APIRequester($this->httpClientFactory, $this->env); $respObject = $apiRequester->makeRequest($payload); - return EditCreateSubCustomerQuoteForItemsQuoteResponse::from($respObject->data, $respObject->headers); + return UpdateSignatureStatusQuoteResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/update-a-quote-signature?lang=php-v4 + * + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. + * @param array $headers + * @return UpdateSignatureQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateSignature(string $id, array $headers = []): UpdateSignatureQuoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["quotes",$id,"update_signature"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateSignatureQuoteResponse::from($respObject->data, $respObject->headers); } /** @@ -382,10 +321,75 @@ public function updateStatus(string $id, array $params, array $headers = []): Up } /** - * @see https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items?lang=php-v4 + * @see https://apidocs.chargebee.com/docs/api/quotes/extend-expiry-date?lang=php-v4 + * @param array{ + * valid_till?: int, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ExtendExpiryDateQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function extendExpiryDate(string $id, array $params, array $headers = []): ExtendExpiryDateQuoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["quotes",$id,"extend_expiry_date"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ExtendExpiryDateQuoteResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/retrieve-a-quote-signature-signed-pdf?lang=php-v4 + * + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. + * @param array $headers + * @return RetrieveSignedPdfQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieveSignedPdf(string $id, array $headers = []): RetrieveSignedPdfQuoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["quotes",$id,"retrieve_signed_pdf"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveSignedPdfQuoteResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items?lang=php-v4 * @param array{ * subscription?: array{ - * id?: string, * setup_fee?: int, * start_date?: int, * trial_end?: int, @@ -484,7 +488,6 @@ public function updateStatus(string $id, array $params, array $headers = []): Up * start_date?: int, * end_date?: int, * }>, - * name?: string, * notes?: string, * expires_at?: int, * mandatory_items_to_remove?: array, @@ -501,23 +504,23 @@ public function updateStatus(string $id, array $params, array $headers = []): Up * reactivate?: bool, * net_term_days?: int, * } $params Description of the parameters - * + * @param string $id * @param array $headers - * @return UpdateSubscriptionQuoteForItemsQuoteResponse + * @return EditUpdateSubscriptionQuoteForItemsQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function updateSubscriptionQuoteForItems(array $params, array $headers = []): UpdateSubscriptionQuoteForItemsQuoteResponse + public function editUpdateSubscriptionQuoteForItems(string $id, array $params, array $headers = []): EditUpdateSubscriptionQuoteForItemsQuoteResponse { $jsonKeys = [ ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) ->withHttpMethod("post") - ->withUriPaths(["quotes","update_subscription_quote_for_items"]) + ->withUriPaths(["quotes",$id,"edit_update_subscription_quote_for_items"]) ->withParamEncoder( new URLFormEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) @@ -527,65 +530,150 @@ public function updateSubscriptionQuoteForItems(array $params, array $headers = ->build(); $apiRequester = new APIRequester($this->httpClientFactory, $this->env); $respObject = $apiRequester->makeRequest($payload); - return UpdateSubscriptionQuoteForItemsQuoteResponse::from($respObject->data, $respObject->headers); + return EditUpdateSubscriptionQuoteForItemsQuoteResponse::from($respObject->data, $respObject->headers); } /** - * @see https://apidocs.chargebee.com/docs/api/quotes/list-quote-line-groups?lang=php-v4 + * @see https://apidocs.chargebee.com/docs/api/quotes/list-quotes?lang=php-v4 * @param array{ * limit?: int, * offset?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return QuoteLineGroupsForQuoteQuoteResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function quoteLineGroupsForQuote(string $id, array $params = [], array $headers = []): QuoteLineGroupsForQuoteQuoteResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("get") - ->withUriPaths(["quotes",$id,"quote_line_groups"]) - ->withParamEncoder(new ListParamEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return QuoteLineGroupsForQuoteQuoteResponse::from($respObject->data, $respObject->headers); - } - - /** - * @see https://apidocs.chargebee.com/docs/api/quotes/extend-expiry-date?lang=php-v4 + * include_deleted?: bool, + * id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * customer_id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * subscription_id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * is_present?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * status?: array{ + * is?: mixed, + * is_not?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * date?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * updated_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 ListQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListQuoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["quotes"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListQuoteResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/retrieve-a-quote-signature?lang=php-v4 + * + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. + * @param array $headers + * @return RetrieveSignatureQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieveSignature(string $id, array $headers = []): RetrieveSignatureQuoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["quotes",$id,"retrieve_signature"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveSignatureQuoteResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/convert-a-quote?lang=php-v4 * @param array{ - * valid_till?: int, + * subscription?: array{ + * id?: string, + * auto_collection?: string, + * po_number?: string, + * auto_close_invoices?: bool, + * }, + * invoice_date?: int, + * invoice_immediately?: bool, + * create_pending_invoices?: bool, + * first_invoice_pending?: bool, * } $params Description of the parameters * @param string $id * @param array $headers - * @return ExtendExpiryDateQuoteResponse + * @return ConvertQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function extendExpiryDate(string $id, array $params, array $headers = []): ExtendExpiryDateQuoteResponse + public function convert(string $id, array $params = [], array $headers = []): ConvertQuoteResponse { $jsonKeys = [ ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) ->withHttpMethod("post") - ->withUriPaths(["quotes",$id,"extend_expiry_date"]) + ->withUriPaths(["quotes",$id,"convert"]) ->withParamEncoder( new URLFormEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) @@ -595,13 +683,58 @@ public function extendExpiryDate(string $id, array $params, array $headers = []) ->build(); $apiRequester = new APIRequester($this->httpClientFactory, $this->env); $respObject = $apiRequester->makeRequest($payload); - return ExtendExpiryDateQuoteResponse::from($respObject->data, $respObject->headers); + return ConvertQuoteResponse::from($respObject->data, $respObject->headers); } /** - * @see https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-charge-items-and-charges?lang=php-v4 + * @see https://apidocs.chargebee.com/docs/api/quotes/delete-a-quote?lang=php-v4 * @param array{ - * billing_address?: array{ + * comment?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return DeleteQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $params = [], array $headers = []): DeleteQuoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["quotes",$id,"delete"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return DeleteQuoteResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items?lang=php-v4 + * @param array{ + * subscription?: array{ + * id?: string, + * po_number?: string, + * trial_end?: int, + * setup_fee?: int, + * start_date?: int, + * offline_payment_method?: string, + * contract_term_billing_cycle_on_renewal?: int, + * free_period?: int, + * free_period_unit?: string, + * }, + * shipping_address?: array{ * first_name?: string, * last_name?: string, * email?: string, @@ -617,7 +750,11 @@ public function extendExpiryDate(string $id, array $params, array $headers = []) * country?: string, * validation_status?: string, * }, - * shipping_address?: array{ + * contract_term?: array{ + * action_at_term_end?: string, + * cancellation_cutoff_period?: int, + * }, + * billing_address?: array{ * first_name?: string, * last_name?: string, * email?: string, @@ -633,13 +770,35 @@ public function extendExpiryDate(string $id, array $params, array $headers = []) * country?: string, * validation_status?: string, * }, - * item_prices?: array, + * discounts?: array, * item_tiers?: array, - * charges?: array, + * notes?: string, + * expires_at?: int, + * billing_cycles?: int, + * mandatory_items_to_remove?: array, + * terms_to_charge?: int, + * billing_alignment_mode?: string, + * coupon_ids?: array, + * billing_start_option?: string, + * net_term_days?: int, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return EditCreateSubCustomerQuoteForItemsQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function editCreateSubCustomerQuoteForItems(string $id, array $params, array $headers = []): EditCreateSubCustomerQuoteForItemsQuoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["quotes",$id,"edit_create_subscription_quote_for_items"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return EditCreateSubCustomerQuoteForItemsQuoteResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items?lang=php-v4 + * @param array{ + * subscription?: array{ + * id?: string, + * setup_fee?: int, + * start_date?: int, + * trial_end?: int, + * coupon?: string, + * auto_collection?: string, + * offline_payment_method?: string, + * contract_term_billing_cycle_on_renewal?: int, + * }, + * billing_address?: array{ + * first_name?: string, + * last_name?: string, + * email?: string, + * company?: string, + * phone?: string, + * line1?: string, + * line2?: string, + * line3?: string, + * city?: string, + * state_code?: string, + * state?: string, + * zip?: string, + * country?: string, + * validation_status?: string, + * }, + * shipping_address?: array{ + * first_name?: string, + * last_name?: string, + * email?: string, + * company?: string, + * phone?: string, + * line1?: string, + * line2?: string, + * line3?: string, + * city?: string, + * state_code?: string, + * state?: string, + * zip?: string, + * country?: string, + * validation_status?: string, + * }, + * customer?: array{ + * vat_number?: string, + * vat_number_prefix?: string, + * registered_for_gst?: bool, + * }, + * contract_term?: array{ + * action_at_term_end?: string, + * cancellation_cutoff_period?: int, + * }, + * subscription_items?: array, * discounts?: array, - * tax_providers_fields?: array, - * po_number?: string, + * coupons?: array, + * name?: string, * notes?: string, * expires_at?: int, - * currency_code?: string, - * coupon?: string, + * mandatory_items_to_remove?: array, + * replace_items_list?: bool, + * billing_cycles?: int, + * terms_to_charge?: int, + * reactivate_from?: int, + * billing_alignment_mode?: string, * coupon_ids?: array, - * } $params Description of the parameters + * replace_coupon_list?: bool, + * change_option?: string, + * changes_scheduled_at?: int, + * force_term_reset?: bool, + * reactivate?: bool, + * net_term_days?: int, + * } $params Description of the parameters + * + * @param array $headers + * @return UpdateSubscriptionQuoteForItemsQuoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateSubscriptionQuoteForItems(array $params, array $headers = []): UpdateSubscriptionQuoteForItemsQuoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["quotes","update_subscription_quote_for_items"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateSubscriptionQuoteForItemsQuoteResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/quotes/list-quote-line-groups?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * } $params Description of the parameters * @param string $id * @param array $headers - * @return EditForChargeItemsAndChargesQuoteResponse + * @return QuoteLineGroupsForQuoteQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function editForChargeItemsAndCharges(string $id, array $params, array $headers = []): EditForChargeItemsAndChargesQuoteResponse + public function quoteLineGroupsForQuote(string $id, array $params = [], array $headers = []): QuoteLineGroupsForQuoteQuoteResponse { $jsonKeys = [ ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) - ->withHttpMethod("post") - ->withUriPaths(["quotes",$id,"edit_for_charge_items_and_charges"]) - ->withParamEncoder( new URLFormEncoder()) + ->withHttpMethod("get") + ->withUriPaths(["quotes",$id,"quote_line_groups"]) + ->withParamEncoder(new ListParamEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) ->withHeaders($headers) ->withParams($params) - ->withIdempotent(true) ->build(); $apiRequester = new APIRequester($this->httpClientFactory, $this->env); $respObject = $apiRequester->makeRequest($payload); - return EditForChargeItemsAndChargesQuoteResponse::from($respObject->data, $respObject->headers); + return QuoteLineGroupsForQuoteQuoteResponse::from($respObject->data, $respObject->headers); } /** - * @see https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items?lang=php-v4 + * @see https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-charge-items-and-charges?lang=php-v4 * @param array{ - * subscription?: array{ - * setup_fee?: int, - * start_date?: int, - * trial_end?: int, - * coupon?: string, - * auto_collection?: string, - * offline_payment_method?: string, - * contract_term_billing_cycle_on_renewal?: int, - * }, - * billing_address?: array{ + * billing_address?: array{ * first_name?: string, * last_name?: string, * email?: string, @@ -753,46 +1074,13 @@ public function editForChargeItemsAndCharges(string $id, array $params, array $h * country?: string, * validation_status?: string, * }, - * customer?: array{ - * vat_number?: string, - * vat_number_prefix?: string, - * registered_for_gst?: bool, - * }, - * contract_term?: array{ - * action_at_term_end?: string, - * cancellation_cutoff_period?: int, - * }, - * subscription_items?: array, - * discounts?: array, * item_tiers?: array, - * coupons?: array, + * discounts?: array, + * tax_providers_fields?: array, + * po_number?: string, * notes?: string, * expires_at?: int, - * mandatory_items_to_remove?: array, - * replace_items_list?: bool, - * billing_cycles?: int, - * terms_to_charge?: int, - * reactivate_from?: int, - * billing_alignment_mode?: string, + * currency_code?: string, + * coupon?: string, * coupon_ids?: array, - * replace_coupon_list?: bool, - * change_option?: string, - * changes_scheduled_at?: int, - * force_term_reset?: bool, - * reactivate?: bool, - * net_term_days?: int, - * } $params Description of the parameters + * } $params Description of the parameters * @param string $id * @param array $headers - * @return EditUpdateSubscriptionQuoteForItemsQuoteResponse + * @return EditForChargeItemsAndChargesQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function editUpdateSubscriptionQuoteForItems(string $id, array $params, array $headers = []): EditUpdateSubscriptionQuoteForItemsQuoteResponse + public function editForChargeItemsAndCharges(string $id, array $params, array $headers = []): EditForChargeItemsAndChargesQuoteResponse { $jsonKeys = [ ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) ->withHttpMethod("post") - ->withUriPaths(["quotes",$id,"edit_update_subscription_quote_for_items"]) + ->withUriPaths(["quotes",$id,"edit_for_charge_items_and_charges"]) ->withParamEncoder( new URLFormEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) @@ -853,154 +1147,96 @@ public function editUpdateSubscriptionQuoteForItems(string $id, array $params, a ->build(); $apiRequester = new APIRequester($this->httpClientFactory, $this->env); $respObject = $apiRequester->makeRequest($payload); - return EditUpdateSubscriptionQuoteForItemsQuoteResponse::from($respObject->data, $respObject->headers); + return EditForChargeItemsAndChargesQuoteResponse::from($respObject->data, $respObject->headers); } /** - * @see https://apidocs.chargebee.com/docs/api/quotes/list-quotes?lang=php-v4 - * @param array{ - * limit?: int, - * offset?: string, - * include_deleted?: bool, - * id?: array{ - * is?: mixed, - * is_not?: mixed, - * starts_with?: mixed, - * in?: mixed, - * not_in?: mixed, - * }, - * customer_id?: array{ - * is?: mixed, - * is_not?: mixed, - * starts_with?: mixed, - * in?: mixed, - * not_in?: mixed, - * }, - * subscription_id?: array{ - * is?: mixed, - * is_not?: mixed, - * starts_with?: mixed, - * is_present?: mixed, - * in?: mixed, - * not_in?: mixed, - * }, - * status?: array{ - * is?: mixed, - * is_not?: mixed, - * in?: mixed, - * not_in?: mixed, - * }, - * date?: array{ - * after?: mixed, - * before?: mixed, - * on?: mixed, - * between?: mixed, - * }, - * updated_at?: array{ - * after?: mixed, - * before?: mixed, - * on?: mixed, - * between?: mixed, - * }, - * sort_by?: array{ - * asc?: string, - * desc?: string, - * }, - * } $params Description of the parameters + * @see https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-signature?lang=php-v4 * + * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers - * @return ListQuoteResponse + * @return CreateSignatureQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function all(array $params = [], array $headers = []): ListQuoteResponse + public function createSignature(string $id, array $headers = []): CreateSignatureQuoteResponse { $jsonKeys = [ ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) - ->withHttpMethod("get") - ->withUriPaths(["quotes"]) - ->withParamEncoder(new ListParamEncoder()) + ->withHttpMethod("post") + ->withUriPaths(["quotes",$id,"create_signature"]) + ->withParamEncoder( new URLFormEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) ->withHeaders($headers) - ->withParams($params) + ->withIdempotent(true) ->build(); $apiRequester = new APIRequester($this->httpClientFactory, $this->env); $respObject = $apiRequester->makeRequest($payload); - return ListQuoteResponse::from($respObject->data, $respObject->headers); + return CreateSignatureQuoteResponse::from($respObject->data, $respObject->headers); } /** - * @see https://apidocs.chargebee.com/docs/api/quotes/retrieve-quote-as-pdf?lang=php-v4 - * @param array{ - * consolidated_view?: bool, - * disposition_type?: string, - * } $params Description of the parameters + * @see https://apidocs.chargebee.com/docs/api/quotes/refresh-a-quote-signature-link?lang=php-v4 + * * @param string $id + * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers - * @return PdfQuoteResponse + * @return RefreshSignatureLinkQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function pdf(string $id, array $params = [], array $headers = []): PdfQuoteResponse + public function refreshSignatureLink(string $id, array $headers = []): RefreshSignatureLinkQuoteResponse { $jsonKeys = [ ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) ->withHttpMethod("post") - ->withUriPaths(["quotes",$id,"pdf"]) + ->withUriPaths(["quotes",$id,"refresh_signature_link"]) ->withParamEncoder( new URLFormEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) ->withHeaders($headers) - ->withParams($params) ->withIdempotent(true) ->build(); $apiRequester = new APIRequester($this->httpClientFactory, $this->env); $respObject = $apiRequester->makeRequest($payload); - return PdfQuoteResponse::from($respObject->data, $respObject->headers); + return RefreshSignatureLinkQuoteResponse::from($respObject->data, $respObject->headers); } /** - * @see https://apidocs.chargebee.com/docs/api/quotes/convert-a-quote?lang=php-v4 + * @see https://apidocs.chargebee.com/docs/api/quotes/retrieve-quote-as-pdf?lang=php-v4 * @param array{ - * subscription?: array{ - * id?: string, - * auto_collection?: string, - * po_number?: string, - * auto_close_invoices?: bool, - * }, - * invoice_date?: int, - * invoice_immediately?: bool, - * create_pending_invoices?: bool, - * first_invoice_pending?: bool, + * consolidated_view?: bool, + * disposition_type?: string, * } $params Description of the parameters * @param string $id * @param array $headers - * @return ConvertQuoteResponse + * @return PdfQuoteResponse * @throws PaymentException * @throws OperationFailedException * @throws APIError * @throws InvalidRequestException * @throws Exception */ - public function convert(string $id, array $params = [], array $headers = []): ConvertQuoteResponse + public function pdf(string $id, array $params = [], array $headers = []): PdfQuoteResponse { $jsonKeys = [ ]; $payload = ChargebeePayload::builder() ->withEnvironment($this->env) ->withHttpMethod("post") - ->withUriPaths(["quotes",$id,"convert"]) + ->withUriPaths(["quotes",$id,"pdf"]) ->withParamEncoder( new URLFormEncoder()) ->withSubDomain(null) ->withJsonKeys($jsonKeys) @@ -1010,7 +1246,7 @@ public function convert(string $id, array $params = [], array $headers = []): Co ->build(); $apiRequester = new APIRequester($this->httpClientFactory, $this->env); $respObject = $apiRequester->makeRequest($payload); - return ConvertQuoteResponse::from($respObject->data, $respObject->headers); + return PdfQuoteResponse::from($respObject->data, $respObject->headers); } /** @@ -1126,40 +1362,6 @@ public function createForChargeItemsAndCharges(array $params, array $headers = [ return CreateForChargeItemsAndChargesQuoteResponse::from($respObject->data, $respObject->headers); } - /** - * @see https://apidocs.chargebee.com/docs/api/quotes/delete-a-quote?lang=php-v4 - * @param array{ - * comment?: string, - * } $params Description of the parameters - * @param string $id - * @param array $headers - * @return DeleteQuoteResponse - * @throws PaymentException - * @throws OperationFailedException - * @throws APIError - * @throws InvalidRequestException - * @throws Exception - */ - public function delete(string $id, array $params = [], array $headers = []): DeleteQuoteResponse - { - $jsonKeys = [ - ]; - $payload = ChargebeePayload::builder() - ->withEnvironment($this->env) - ->withHttpMethod("post") - ->withUriPaths(["quotes",$id,"delete"]) - ->withParamEncoder( new URLFormEncoder()) - ->withSubDomain(null) - ->withJsonKeys($jsonKeys) - ->withHeaders($headers) - ->withParams($params) - ->withIdempotent(true) - ->build(); - $apiRequester = new APIRequester($this->httpClientFactory, $this->env); - $respObject = $apiRequester->makeRequest($payload); - return DeleteQuoteResponse::from($respObject->data, $respObject->headers); - } - /** * @see https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-one-time-charges?lang=php-v4 * @param array{ diff --git a/src/Actions/RampActions.php b/src/Actions/RampActions.php index 9be5910d..1eb86739 100644 --- a/src/Actions/RampActions.php +++ b/src/Actions/RampActions.php @@ -157,12 +157,12 @@ public function createForSubscription(string $id, array $params, array $headers * offset?: string, * include_deleted?: bool, * status?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * subscription_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * effective_from?: array{ * after?: mixed, diff --git a/src/Actions/UsageChargeActions.php b/src/Actions/UsageChargeActions.php index ea84a57b..51d34eb0 100644 --- a/src/Actions/UsageChargeActions.php +++ b/src/Actions/UsageChargeActions.php @@ -34,7 +34,6 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * }, * } $params Description of the parameters * @param string $id - * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers * @return RetrieveUsageChargesForSubscriptionUsageChargeResponse * @throws PaymentException diff --git a/src/Actions/UsageSummaryActions.php b/src/Actions/UsageSummaryActions.php index e9e042e9..f3d9f655 100644 --- a/src/Actions/UsageSummaryActions.php +++ b/src/Actions/UsageSummaryActions.php @@ -35,7 +35,6 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * timeframe_end?: int, * } $params Description of the parameters * @param string $id - * @deprecated This method is deprecated and will be removed in a future version. * @param array $headers * @return RetrieveUsageSummaryForSubscriptionUsageSummaryResponse * @throws PaymentException diff --git a/src/Enums/AlertStatus.php b/src/Enums/AlertStatus.php new file mode 100644 index 00000000..bebebb97 --- /dev/null +++ b/src/Enums/AlertStatus.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Enums/EnabledEvents.php b/src/Enums/EnabledEvents.php new file mode 100644 index 00000000..884307b7 --- /dev/null +++ b/src/Enums/EnabledEvents.php @@ -0,0 +1,238 @@ + \ No newline at end of file diff --git a/src/Enums/EntityType.php b/src/Enums/EntityType.php index c7b4a06a..751d1539 100644 --- a/src/Enums/EntityType.php +++ b/src/Enums/EntityType.php @@ -43,6 +43,7 @@ enum EntityType : string { case USAGE_FILE = "usage_file"; case BUSINESS_RULE = "business_rule"; case RULESET = "ruleset"; + case ALERT_STATUS = "alert_status"; case CHARGE = "charge"; case UNKNOWN = "unknown"; diff --git a/src/Enums/EventType.php b/src/Enums/EventType.php index a580a8a2..a969ea4a 100644 --- a/src/Enums/EventType.php +++ b/src/Enums/EventType.php @@ -213,6 +213,7 @@ enum EventType : string { case OMNICHANNEL_SUBSCRIPTION_ITEM_PAUSE_SCHEDULED = "omnichannel_subscription_item_pause_scheduled"; case OMNICHANNEL_SUBSCRIPTION_MOVED_IN = "omnichannel_subscription_moved_in"; case OMNICHANNEL_TRANSACTION_CREATED = "omnichannel_transaction_created"; + case ALERT_STATUS_CHANGED = "alert_status_changed"; case PLAN_CREATED = "plan_created"; case PLAN_UPDATED = "plan_updated"; case PLAN_DELETED = "plan_deleted"; diff --git a/src/Enums/PaymentMethod.php b/src/Enums/PaymentMethod.php index c012c293..433b20fa 100644 --- a/src/Enums/PaymentMethod.php +++ b/src/Enums/PaymentMethod.php @@ -45,6 +45,7 @@ enum PaymentMethod : string { case NAVER_PAY = "naver_pay"; case REVOLUT_PAY = "revolut_pay"; case CASH_APP_PAY = "cash_app_pay"; + case PIX = "pix"; /* * @depcreated */ diff --git a/src/Enums/PaymentMethodType.php b/src/Enums/PaymentMethodType.php index 8237fbb4..8ce18b01 100644 --- a/src/Enums/PaymentMethodType.php +++ b/src/Enums/PaymentMethodType.php @@ -37,6 +37,7 @@ enum PaymentMethodType : string { case NAVER_PAY = "naver_pay"; case REVOLUT_PAY = "revolut_pay"; case CASH_APP_PAY = "cash_app_pay"; + case PIX = "pix"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Enums/Type.php b/src/Enums/Type.php index 656cb20d..9e37802a 100644 --- a/src/Enums/Type.php +++ b/src/Enums/Type.php @@ -37,9 +37,11 @@ enum Type : string { case NAVER_PAY = "naver_pay"; case REVOLUT_PAY = "revolut_pay"; case CASH_APP_PAY = "cash_app_pay"; + case PIX = "pix"; case FREE_TRIAL = "free_trial"; case PAY_UP_FRONT = "pay_up_front"; case PAY_AS_YOU_GO = "pay_as_you_go"; + case USAGE_EXCEEDED = "usage_exceeded"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/Alert/Alert.php b/src/Resources/Alert/Alert.php new file mode 100644 index 00000000..cec5ddaa --- /dev/null +++ b/src/Resources/Alert/Alert.php @@ -0,0 +1,172 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "name" , "description" , "metered_feature_id" , "subscription_id" , "alarm_triggered_at" , "meta" , "created_at" , "updated_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $name, + ?string $description, + ?string $metered_feature_id, + ?string $subscription_id, + ?int $alarm_triggered_at, + ?string $meta, + ?int $created_at, + ?int $updated_at, + ?\Chargebee\Enums\Type $type, + ?\Chargebee\Resources\Alert\Enums\Status $status, + ?\Chargebee\Resources\Alert\Enums\Scope $scope, + ) + { + $this->id = $id; + $this->name = $name; + $this->description = $description; + $this->metered_feature_id = $metered_feature_id; + $this->subscription_id = $subscription_id; + $this->alarm_triggered_at = $alarm_triggered_at; + $this->meta = $meta; + $this->created_at = $created_at; + $this->updated_at = $updated_at; + $this->type = $type; + $this->status = $status; + $this->scope = $scope; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['name'] ?? null, + $resourceAttributes['description'] ?? null, + $resourceAttributes['metered_feature_id'] ?? null, + $resourceAttributes['subscription_id'] ?? null, + $resourceAttributes['alarm_triggered_at'] ?? null, + $resourceAttributes['meta'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + + + isset($resourceAttributes['type']) ? \Chargebee\Enums\Type::tryFromValue($resourceAttributes['type']) : null, + + isset($resourceAttributes['status']) ? \Chargebee\Resources\Alert\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + isset($resourceAttributes['scope']) ? \Chargebee\Resources\Alert\Enums\Scope::tryFromValue($resourceAttributes['scope']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'name' => $this->name, + 'description' => $this->description, + 'metered_feature_id' => $this->metered_feature_id, + 'subscription_id' => $this->subscription_id, + 'alarm_triggered_at' => $this->alarm_triggered_at, + 'meta' => $this->meta, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + + 'type' => $this->type?->value, + + 'status' => $this->status?->value, + + 'scope' => $this->scope?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Alert/Enums/Scope.php b/src/Resources/Alert/Enums/Scope.php new file mode 100644 index 00000000..08d6fda8 --- /dev/null +++ b/src/Resources/Alert/Enums/Scope.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/Alert/Enums/Status.php b/src/Resources/Alert/Enums/Status.php new file mode 100644 index 00000000..326df62f --- /dev/null +++ b/src/Resources/Alert/Enums/Status.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/AlertStatus/AlertStatus.php b/src/Resources/AlertStatus/AlertStatus.php new file mode 100644 index 00000000..ce051407 --- /dev/null +++ b/src/Resources/AlertStatus/AlertStatus.php @@ -0,0 +1,88 @@ + $knownFields + */ + protected static array $knownFields = [ "alert_id" , "subscription_id" , "alarm_triggered_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $alert_id, + ?string $subscription_id, + ?int $alarm_triggered_at, + ?\Chargebee\Enums\AlertStatus $alert_status, + ) + { + $this->alert_id = $alert_id; + $this->subscription_id = $subscription_id; + $this->alarm_triggered_at = $alarm_triggered_at; + $this->alert_status = $alert_status; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['alert_id'] ?? null, + $resourceAttributes['subscription_id'] ?? null, + $resourceAttributes['alarm_triggered_at'] ?? null, + + + isset($resourceAttributes['alert_status']) ? \Chargebee\Enums\AlertStatus::tryFromValue($resourceAttributes['alert_status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['alert_id' => $this->alert_id, + 'subscription_id' => $this->subscription_id, + 'alarm_triggered_at' => $this->alarm_triggered_at, + + 'alert_status' => $this->alert_status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Content/Content.php b/src/Resources/Content/Content.php index 003e872d..992bfac0 100644 --- a/src/Resources/Content/Content.php +++ b/src/Resources/Content/Content.php @@ -4,6 +4,8 @@ use Chargebee\Resources\Addon\Addon; use Chargebee\Resources\Address\Address; use Chargebee\Resources\AdvanceInvoiceSchedule\AdvanceInvoiceSchedule; +use Chargebee\Resources\Alert\Alert; +use Chargebee\Resources\AlertStatus\AlertStatus; use Chargebee\Resources\AttachedItem\AttachedItem; use Chargebee\Resources\Attribute\Attribute; use Chargebee\Resources\BillingConfiguration\BillingConfiguration; @@ -18,6 +20,7 @@ use Chargebee\Resources\Coupon\Coupon; use Chargebee\Resources\CouponCode\CouponCode; use Chargebee\Resources\CouponSet\CouponSet; +use Chargebee\Resources\CpqQuoteSignature\CpqQuoteSignature; use Chargebee\Resources\CreditNote\CreditNote; use Chargebee\Resources\CreditNoteEstimate\CreditNoteEstimate; use Chargebee\Resources\Currency\Currency; @@ -123,6 +126,18 @@ class Content { */ public ?AdvanceInvoiceSchedule $advanceinvoiceschedule; + /** + * + * @var ?Alert $alert + */ + public ?Alert $alert; + + /** + * + * @var ?AlertStatus $alertstatus + */ + public ?AlertStatus $alertstatus; + /** * * @var ?AttachedItem $attacheditem @@ -207,6 +222,12 @@ class Content { */ public ?CouponSet $couponset; + /** + * + * @var ?CpqQuoteSignature $cpqquotesignature + */ + public ?CpqQuoteSignature $cpqquotesignature; + /** * * @var ?CreditNote $creditnote @@ -720,7 +741,7 @@ class Content { /** * @var array $knownFields */ - protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "credit_note" , "credit_note_estimate" , "currency" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "download" , "einvoice" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "gateway_error_detail" , "gift" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "metadata" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "purchase" , "quote" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "virtual_bank_account" , "webhook_endpoint" ]; + protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "currency" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "download" , "einvoice" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "gateway_error_detail" , "gift" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "metadata" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "purchase" , "quote" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "virtual_bank_account" , "webhook_endpoint" ]; /** * dynamic properties for resources @@ -732,6 +753,8 @@ private function __construct( ?Addon $addon, ?Address $address, ?AdvanceInvoiceSchedule $advanceinvoiceschedule, + ?Alert $alert, + ?AlertStatus $alertstatus, ?AttachedItem $attacheditem, ?Attribute $attribute, ?BillingConfiguration $billingconfiguration, @@ -746,6 +769,7 @@ private function __construct( ?Coupon $coupon, ?CouponCode $couponcode, ?CouponSet $couponset, + ?CpqQuoteSignature $cpqquotesignature, ?CreditNote $creditnote, ?CreditNoteEstimate $creditnoteestimate, ?Currency $currency, @@ -836,6 +860,8 @@ private function __construct( $this->addon = $addon; $this->address = $address; $this->advanceinvoiceschedule = $advanceinvoiceschedule; + $this->alert = $alert; + $this->alertstatus = $alertstatus; $this->attacheditem = $attacheditem; $this->attribute = $attribute; $this->billingconfiguration = $billingconfiguration; @@ -850,6 +876,7 @@ private function __construct( $this->coupon = $coupon; $this->couponcode = $couponcode; $this->couponset = $couponset; + $this->cpqquotesignature = $cpqquotesignature; $this->creditnote = $creditnote; $this->creditnoteestimate = $creditnoteestimate; $this->currency = $currency; @@ -942,6 +969,8 @@ public static function from(array $resourceAttributes): self $returnData = new self( isset($resourceAttributes['addon']) ? Addon::from($resourceAttributes['addon']) : null, isset($resourceAttributes['address']) ? Address::from($resourceAttributes['address']) : null, isset($resourceAttributes['advance_invoice_schedule']) ? AdvanceInvoiceSchedule::from($resourceAttributes['advance_invoice_schedule']) : null, + isset($resourceAttributes['alert']) ? Alert::from($resourceAttributes['alert']) : null, + isset($resourceAttributes['alert_status']) ? AlertStatus::from($resourceAttributes['alert_status']) : null, isset($resourceAttributes['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, @@ -956,6 +985,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['coupon']) ? Coupon::from($resourceAttributes['coupon']) : null, isset($resourceAttributes['coupon_code']) ? CouponCode::from($resourceAttributes['coupon_code']) : null, isset($resourceAttributes['coupon_set']) ? CouponSet::from($resourceAttributes['coupon_set']) : null, + isset($resourceAttributes['cpq_quote_signature']) ? CpqQuoteSignature::from($resourceAttributes['cpq_quote_signature']) : null, isset($resourceAttributes['credit_note']) ? CreditNote::from($resourceAttributes['credit_note']) : null, isset($resourceAttributes['credit_note_estimate']) ? CreditNoteEstimate::from($resourceAttributes['credit_note_estimate']) : null, isset($resourceAttributes['currency']) ? Currency::from($resourceAttributes['currency']) : null, @@ -1150,6 +1180,9 @@ public function toArray(): array + + + @@ -1168,6 +1201,12 @@ public function toArray(): array if($this->advanceinvoiceschedule instanceof AdvanceInvoiceSchedule){ $data['advance_invoice_schedule'] = $this->advanceinvoiceschedule->toArray(); } + if($this->alert instanceof Alert){ + $data['alert'] = $this->alert->toArray(); + } + if($this->alertstatus instanceof AlertStatus){ + $data['alert_status'] = $this->alertstatus->toArray(); + } if($this->attacheditem instanceof AttachedItem){ $data['attached_item'] = $this->attacheditem->toArray(); } @@ -1210,6 +1249,9 @@ public function toArray(): array if($this->couponset instanceof CouponSet){ $data['coupon_set'] = $this->couponset->toArray(); } + if($this->cpqquotesignature instanceof CpqQuoteSignature){ + $data['cpq_quote_signature'] = $this->cpqquotesignature->toArray(); + } if($this->creditnote instanceof CreditNote){ $data['credit_note'] = $this->creditnote->toArray(); } diff --git a/src/Resources/CpqQuoteSignature/CpqQuoteSignature.php b/src/Resources/CpqQuoteSignature/CpqQuoteSignature.php new file mode 100644 index 00000000..67b0cd47 --- /dev/null +++ b/src/Resources/CpqQuoteSignature/CpqQuoteSignature.php @@ -0,0 +1,172 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "name" , "document_name" , "expires_at" , "timezone" , "provider_request_id" , "provider_document_id" , "created_at" , "modified_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $name, + ?string $document_name, + ?int $expires_at, + ?string $timezone, + ?string $provider_request_id, + ?string $provider_document_id, + ?int $created_at, + ?int $modified_at, + ?\Chargebee\Resources\CpqQuoteSignature\Enums\Status $status, + ?\Chargebee\Resources\CpqQuoteSignature\Enums\CustomerAcceptanceMethod $customer_acceptance_method, + ?\Chargebee\Resources\CpqQuoteSignature\Enums\QuoteType $quote_type, + ) + { + $this->id = $id; + $this->name = $name; + $this->document_name = $document_name; + $this->expires_at = $expires_at; + $this->timezone = $timezone; + $this->provider_request_id = $provider_request_id; + $this->provider_document_id = $provider_document_id; + $this->created_at = $created_at; + $this->modified_at = $modified_at; + $this->status = $status; + $this->customer_acceptance_method = $customer_acceptance_method; + $this->quote_type = $quote_type; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['name'] ?? null, + $resourceAttributes['document_name'] ?? null, + $resourceAttributes['expires_at'] ?? null, + $resourceAttributes['timezone'] ?? null, + $resourceAttributes['provider_request_id'] ?? null, + $resourceAttributes['provider_document_id'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['modified_at'] ?? null, + + + isset($resourceAttributes['status']) ? \Chargebee\Resources\CpqQuoteSignature\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + isset($resourceAttributes['customer_acceptance_method']) ? \Chargebee\Resources\CpqQuoteSignature\Enums\CustomerAcceptanceMethod::tryFromValue($resourceAttributes['customer_acceptance_method']) : null, + + isset($resourceAttributes['quote_type']) ? \Chargebee\Resources\CpqQuoteSignature\Enums\QuoteType::tryFromValue($resourceAttributes['quote_type']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'name' => $this->name, + 'document_name' => $this->document_name, + 'expires_at' => $this->expires_at, + 'timezone' => $this->timezone, + 'provider_request_id' => $this->provider_request_id, + 'provider_document_id' => $this->provider_document_id, + 'created_at' => $this->created_at, + 'modified_at' => $this->modified_at, + + 'status' => $this->status?->value, + + 'customer_acceptance_method' => $this->customer_acceptance_method?->value, + + 'quote_type' => $this->quote_type?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/CpqQuoteSignature/Enums/CustomerAcceptanceMethod.php b/src/Resources/CpqQuoteSignature/Enums/CustomerAcceptanceMethod.php new file mode 100644 index 00000000..99b02929 --- /dev/null +++ b/src/Resources/CpqQuoteSignature/Enums/CustomerAcceptanceMethod.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/src/Resources/CpqQuoteSignature/Enums/QuoteType.php b/src/Resources/CpqQuoteSignature/Enums/QuoteType.php new file mode 100644 index 00000000..344b6c0c --- /dev/null +++ b/src/Resources/CpqQuoteSignature/Enums/QuoteType.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/CpqQuoteSignature/Enums/Status.php b/src/Resources/CpqQuoteSignature/Enums/Status.php new file mode 100644 index 00000000..c94eafa5 --- /dev/null +++ b/src/Resources/CpqQuoteSignature/Enums/Status.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/src/Resources/CreditNote/Einvoice.php b/src/Resources/CreditNote/Einvoice.php index 65332e63..d3bb7cfb 100644 --- a/src/Resources/CreditNote/Einvoice.php +++ b/src/Resources/CreditNote/Einvoice.php @@ -9,6 +9,12 @@ class Einvoice { */ public ?string $id; + /** + * + * @var ?string $reference_id + */ + public ?string $reference_id; + /** * * @var ?string $reference_number @@ -27,10 +33,16 @@ class Einvoice { */ public ?string $message; + /** + * + * @var mixed $provider_references + */ + public mixed $provider_references; + /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "reference_number" , "status" , "message" ]; + protected static array $knownFields = [ "id" , "reference_id" , "reference_number" , "status" , "message" , "provider_references" ]; /** * dynamic properties for resources @@ -40,23 +52,29 @@ class Einvoice { private function __construct( ?string $id, + ?string $reference_id, ?string $reference_number, ?string $status, ?string $message, + mixed $provider_references, ) { $this->id = $id; + $this->reference_id = $reference_id; $this->reference_number = $reference_number; $this->status = $status; - $this->message = $message; + $this->message = $message; + $this->provider_references = $provider_references; } public static function from(array $resourceAttributes): self { $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['reference_id'] ?? null, $resourceAttributes['reference_number'] ?? null, $resourceAttributes['status'] ?? null, $resourceAttributes['message'] ?? null, + $resourceAttributes['provider_references'] ?? null, ); @@ -68,9 +86,11 @@ public function toArray(): array { $data = array_filter(['id' => $this->id, + 'reference_id' => $this->reference_id, 'reference_number' => $this->reference_number, 'status' => $this->status, 'message' => $this->message, + 'provider_references' => $this->provider_references, ], function ($value) { return $value !== null; diff --git a/src/Resources/Einvoice/Einvoice.php b/src/Resources/Einvoice/Einvoice.php index d95bdc37..e27f1aee 100644 --- a/src/Resources/Einvoice/Einvoice.php +++ b/src/Resources/Einvoice/Einvoice.php @@ -9,6 +9,12 @@ class Einvoice { */ public ?string $id; + /** + * + * @var ?string $reference_id + */ + public ?string $reference_id; + /** * * @var ?string $reference_number @@ -21,6 +27,12 @@ class Einvoice { */ public ?string $message; + /** + * + * @var mixed $provider_references + */ + public mixed $provider_references; + /** * * @var ?\Chargebee\Resources\Einvoice\Enums\Status $status @@ -30,7 +42,7 @@ class Einvoice { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "reference_number" , "message" ]; + protected static array $knownFields = [ "id" , "reference_id" , "reference_number" , "message" , "provider_references" ]; /** * dynamic properties for resources @@ -40,22 +52,28 @@ class Einvoice { private function __construct( ?string $id, + ?string $reference_id, ?string $reference_number, ?string $message, + mixed $provider_references, ?\Chargebee\Resources\Einvoice\Enums\Status $status, ) { $this->id = $id; + $this->reference_id = $reference_id; $this->reference_number = $reference_number; - $this->message = $message; + $this->message = $message; + $this->provider_references = $provider_references; $this->status = $status; } public static function from(array $resourceAttributes): self { $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['reference_id'] ?? null, $resourceAttributes['reference_number'] ?? null, $resourceAttributes['message'] ?? null, + $resourceAttributes['provider_references'] ?? null, isset($resourceAttributes['status']) ? \Chargebee\Resources\Einvoice\Enums\Status::tryFromValue($resourceAttributes['status']) : null, @@ -69,8 +87,10 @@ public function toArray(): array { $data = array_filter(['id' => $this->id, + 'reference_id' => $this->reference_id, 'reference_number' => $this->reference_number, 'message' => $this->message, + 'provider_references' => $this->provider_references, 'status' => $this->status?->value, diff --git a/src/Resources/Invoice/Einvoice.php b/src/Resources/Invoice/Einvoice.php index b08b35d0..acdceebe 100644 --- a/src/Resources/Invoice/Einvoice.php +++ b/src/Resources/Invoice/Einvoice.php @@ -9,6 +9,12 @@ class Einvoice { */ public ?string $id; + /** + * + * @var ?string $reference_id + */ + public ?string $reference_id; + /** * * @var ?string $reference_number @@ -27,10 +33,16 @@ class Einvoice { */ public ?string $message; + /** + * + * @var mixed $provider_references + */ + public mixed $provider_references; + /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "reference_number" , "status" , "message" ]; + protected static array $knownFields = [ "id" , "reference_id" , "reference_number" , "status" , "message" , "provider_references" ]; /** * dynamic properties for resources @@ -40,23 +52,29 @@ class Einvoice { private function __construct( ?string $id, + ?string $reference_id, ?string $reference_number, ?string $status, ?string $message, + mixed $provider_references, ) { $this->id = $id; + $this->reference_id = $reference_id; $this->reference_number = $reference_number; $this->status = $status; - $this->message = $message; + $this->message = $message; + $this->provider_references = $provider_references; } public static function from(array $resourceAttributes): self { $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['reference_id'] ?? null, $resourceAttributes['reference_number'] ?? null, $resourceAttributes['status'] ?? null, $resourceAttributes['message'] ?? null, + $resourceAttributes['provider_references'] ?? null, ); @@ -68,9 +86,11 @@ public function toArray(): array { $data = array_filter(['id' => $this->id, + 'reference_id' => $this->reference_id, 'reference_number' => $this->reference_number, 'status' => $this->status, 'message' => $this->message, + 'provider_references' => $this->provider_references, ], function ($value) { return $value !== null; diff --git a/src/Resources/PaymentIntent/Enums/PaymentMethodType.php b/src/Resources/PaymentIntent/Enums/PaymentMethodType.php index ff6a9d26..5ccc6945 100644 --- a/src/Resources/PaymentIntent/Enums/PaymentMethodType.php +++ b/src/Resources/PaymentIntent/Enums/PaymentMethodType.php @@ -35,6 +35,7 @@ enum PaymentMethodType : string { case CASH_APP_PAY = "cash_app_pay"; case WECHAT_PAY = "wechat_pay"; case ALIPAY = "alipay"; + case PIX = "pix"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/UnbilledCharge/UnbilledCharge.php b/src/Resources/UnbilledCharge/UnbilledCharge.php index 91c65bb9..78caddc7 100644 --- a/src/Resources/UnbilledCharge/UnbilledCharge.php +++ b/src/Resources/UnbilledCharge/UnbilledCharge.php @@ -105,6 +105,12 @@ class UnbilledCharge { */ public ?string $amount_in_decimal; + /** + * + * @var ?int $created_at + */ + public ?int $created_at; + /** * * @var ?int $updated_at @@ -150,7 +156,7 @@ class UnbilledCharge { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "customer_id" , "subscription_id" , "date_from" , "date_to" , "unit_amount" , "quantity" , "amount" , "currency_code" , "discount_amount" , "description" , "entity_id" , "is_voided" , "voided_at" , "unit_amount_in_decimal" , "quantity_in_decimal" , "amount_in_decimal" , "updated_at" , "tiers" , "is_advance_charge" , "business_entity_id" , "deleted" ]; + protected static array $knownFields = [ "id" , "customer_id" , "subscription_id" , "date_from" , "date_to" , "unit_amount" , "quantity" , "amount" , "currency_code" , "discount_amount" , "description" , "entity_id" , "is_voided" , "voided_at" , "unit_amount_in_decimal" , "quantity_in_decimal" , "amount_in_decimal" , "created_at" , "updated_at" , "tiers" , "is_advance_charge" , "business_entity_id" , "deleted" ]; /** * dynamic properties for resources @@ -176,6 +182,7 @@ private function __construct( ?string $unit_amount_in_decimal, ?string $quantity_in_decimal, ?string $amount_in_decimal, + ?int $created_at, ?int $updated_at, ?array $tiers, ?bool $is_advance_charge, @@ -202,6 +209,7 @@ private function __construct( $this->unit_amount_in_decimal = $unit_amount_in_decimal; $this->quantity_in_decimal = $quantity_in_decimal; $this->amount_in_decimal = $amount_in_decimal; + $this->created_at = $created_at; $this->updated_at = $updated_at; $this->tiers = $tiers; $this->is_advance_charge = $is_advance_charge; @@ -234,6 +242,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['unit_amount_in_decimal'] ?? null, $resourceAttributes['quantity_in_decimal'] ?? null, $resourceAttributes['amount_in_decimal'] ?? null, + $resourceAttributes['created_at'] ?? null, $resourceAttributes['updated_at'] ?? null, $tiers, $resourceAttributes['is_advance_charge'] ?? null, @@ -270,6 +279,7 @@ public function toArray(): array 'unit_amount_in_decimal' => $this->unit_amount_in_decimal, 'quantity_in_decimal' => $this->quantity_in_decimal, 'amount_in_decimal' => $this->amount_in_decimal, + 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'is_advance_charge' => $this->is_advance_charge, diff --git a/src/Responses/QuoteResponse/CreateSignatureQuoteResponse.php b/src/Responses/QuoteResponse/CreateSignatureQuoteResponse.php new file mode 100644 index 00000000..064f611a --- /dev/null +++ b/src/Responses/QuoteResponse/CreateSignatureQuoteResponse.php @@ -0,0 +1,45 @@ +cpq_quote_signature = $cpq_quote_signature; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['cpq_quote_signature']) ? CpqQuoteSignature::from($resourceAttributes['cpq_quote_signature']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->cpq_quote_signature instanceof CpqQuoteSignature){ + $data['cpq_quote_signature'] = $this->cpq_quote_signature->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/QuoteResponse/RefreshSignatureLinkQuoteResponse.php b/src/Responses/QuoteResponse/RefreshSignatureLinkQuoteResponse.php new file mode 100644 index 00000000..fb2bb2e1 --- /dev/null +++ b/src/Responses/QuoteResponse/RefreshSignatureLinkQuoteResponse.php @@ -0,0 +1,45 @@ +cpq_quote_signature = $cpq_quote_signature; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['cpq_quote_signature']) ? CpqQuoteSignature::from($resourceAttributes['cpq_quote_signature']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->cpq_quote_signature instanceof CpqQuoteSignature){ + $data['cpq_quote_signature'] = $this->cpq_quote_signature->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/QuoteResponse/RetrieveSignatureQuoteResponse.php b/src/Responses/QuoteResponse/RetrieveSignatureQuoteResponse.php new file mode 100644 index 00000000..8d5adb5b --- /dev/null +++ b/src/Responses/QuoteResponse/RetrieveSignatureQuoteResponse.php @@ -0,0 +1,45 @@ +cpq_quote_signature = $cpq_quote_signature; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['cpq_quote_signature']) ? CpqQuoteSignature::from($resourceAttributes['cpq_quote_signature']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->cpq_quote_signature instanceof CpqQuoteSignature){ + $data['cpq_quote_signature'] = $this->cpq_quote_signature->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/QuoteResponse/RetrieveSignedPdfQuoteResponse.php b/src/Responses/QuoteResponse/RetrieveSignedPdfQuoteResponse.php new file mode 100644 index 00000000..1599fc46 --- /dev/null +++ b/src/Responses/QuoteResponse/RetrieveSignedPdfQuoteResponse.php @@ -0,0 +1,45 @@ +download = $download; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['download']) ? Download::from($resourceAttributes['download']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->download instanceof Download){ + $data['download'] = $this->download->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/QuoteResponse/UpdateSignatureQuoteResponse.php b/src/Responses/QuoteResponse/UpdateSignatureQuoteResponse.php new file mode 100644 index 00000000..167d7679 --- /dev/null +++ b/src/Responses/QuoteResponse/UpdateSignatureQuoteResponse.php @@ -0,0 +1,45 @@ +cpq_quote_signature = $cpq_quote_signature; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['cpq_quote_signature']) ? CpqQuoteSignature::from($resourceAttributes['cpq_quote_signature']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->cpq_quote_signature instanceof CpqQuoteSignature){ + $data['cpq_quote_signature'] = $this->cpq_quote_signature->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/QuoteResponse/UpdateSignatureStatusQuoteResponse.php b/src/Responses/QuoteResponse/UpdateSignatureStatusQuoteResponse.php new file mode 100644 index 00000000..acbf15f5 --- /dev/null +++ b/src/Responses/QuoteResponse/UpdateSignatureStatusQuoteResponse.php @@ -0,0 +1,45 @@ +cpq_quote_signature = $cpq_quote_signature; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['cpq_quote_signature']) ? CpqQuoteSignature::from($resourceAttributes['cpq_quote_signature']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->cpq_quote_signature instanceof CpqQuoteSignature){ + $data['cpq_quote_signature'] = $this->cpq_quote_signature->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Version.php b/src/Version.php index a31d3daa..fa4fd2d2 100644 --- a/src/Version.php +++ b/src/Version.php @@ -4,7 +4,7 @@ final class Version { - const VERSION = '4.18.0'; + const VERSION = '4.19.0'; } ?> \ No newline at end of file