diff --git a/CHANGELOG.md b/CHANGELOG.md index f39b091e..110c051b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,54 @@ +### v4.26.0 (2026-08-12) +* * * +### New Resources: +- [`GatewayPaymentMethodToken`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens) has been added. +- [`OmnichannelSubscriptionItemMetric`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_item_metrics) has been added. +- [`VaultedPaymentMethod`](https://apidocs.chargebee.com/docs/api/vaulted_payment_methods) has been added. + + +### New Actions: +- [`update_credit_note_details`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) has been added to [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). + + +### New Attributes: +- [`vault_token`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#vault_token) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). + + +### New Parameters: +- [`updated_at.between`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at_between) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`updated_at.on`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at_on) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`purchased_at.between`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at_between) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`purchased_at.on`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at_on) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`limit`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#limit) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`offset`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#offset) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`include_deleted`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#include_deleted) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`comment`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details#comment) has been added as request body parameter to [`update_credit_note_details`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`ramp`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps#ramp) has been added as request body parameter to [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`export_type`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps#export_type) has been added as request body parameter to [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items#subscription_items_description) has been added as request body parameter to [`create_a_quote_for_a_new_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items#subscription_items_description) has been added as request body parameter to [`edit_update_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items#subscription_items_description) has been added as request body parameter to [`edit_create_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items#subscription_items_description) has been added as request body parameter to [`create_a_quote_for_update_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + +### New Events: +- [`vault_token_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_updated) has been added. +- [`vault_token_deleted`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_deleted) has been added. +- [`omnichannel_subscription_item_mrr_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/omnichannel_subscription_item_mrr_updated) has been added. +- [`vault_token_created`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_created) has been added. + + +### New Enums: +- `omnichannel_subscription_item_metric` has been added as a new value enum `EntityType`. +- `omnichannel_subscription_item_mrr_updated`, `vault_token_created`, `vault_token_updated`, and `vault_token_deleted` have been added as new values enum `EventType`. +- `chargebee`, `chargebee_payments`, `adyen`, `stripe`, `wepay`, `braintree`, `authorize_net`, `paypal_pro`, `pin`, `eway`, `eway_rapid`, `worldpay`, `balanced_payments`, `beanstream`, `bluepay`, `elavon`, `first_data_global`, `hdfc`, `migs`, `nmi`, `ogone`, `paymill`, `paypal_payflow_pro`, `sage_pay`, `tco`, `wirecard`, `amazon_payments`, `paypal_express_checkout`, `gocardless`, `orbital`, `moneris_us`, `moneris`, `bluesnap`, `cybersource`, `vantiv`, `checkout_com`, `paypal`, `ingenico_direct`, `exact`, `mollie`, `quickbooks`, `razorpay`, `global_payments`, `bank_of_america`, `ecentric`, `metrics_global`, `windcave`, `pay_com`, `ebanx`, `dlocal`, `nuvei`, `solidgate`, `paystack`, `jp_morgan`, `deutsche_bank`, `ezidebit`, `twikey`, `tempus`, `moyasar`, `payway`, and `not_applicable` have been added as new values enum `GatewayName`. +- `active`, `inactive`, and `pending_verification` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens/gateway-payment-method-token-object#status) in [`GatewayPaymentMethodToken`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens). +- `payment_method_helper`, `card_components`, `checkout`, `collect_now`, `portal`, and `payment_components` have been added as new values to enum attribute [`payment_intent_metadata.source`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_intent_metadata_source) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). + + + ### v4.25.1 (2026-08-11) * * * ### Bug Fixes: diff --git a/VERSION b/VERSION index 72e19f2f..06edb387 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.25.1 +4.26.0 diff --git a/src/Actions/Contracts/CouponActionsInterface.php b/src/Actions/Contracts/CouponActionsInterface.php index 79ac6006..96c89dbb 100644 --- a/src/Actions/Contracts/CouponActionsInterface.php +++ b/src/Actions/Contracts/CouponActionsInterface.php @@ -86,8 +86,8 @@ * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/CreditNoteActionsInterface.php b/src/Actions/Contracts/CreditNoteActionsInterface.php index 672a641e..8c21c574 100644 --- a/src/Actions/Contracts/CreditNoteActionsInterface.php +++ b/src/Actions/Contracts/CreditNoteActionsInterface.php @@ -8,6 +8,7 @@ use Chargebee\Responses\CreditNoteResponse\VoidCreditNoteCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\CreateCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\DownloadEinvoiceCreditNoteResponse; +use Chargebee\Responses\CreditNoteResponse\UpdateCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\RemoveTaxWithheldRefundCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\CreditNotesForCustomerCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\RetrieveCreditNoteResponse; @@ -447,6 +448,22 @@ public function all(array $params = [], array $headers = []): ListCreditNoteResp */ public function create(array $params, array $headers = []): CreateCreditNoteResponse; + /** + * @see https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details?lang=php-v4 + * @param array{ + * comment?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateCreditNoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params = [], array $headers = []): UpdateCreditNoteResponse; + /** * @see https://apidocs.chargebee.com/docs/api/credit_notes/download-e-invoice-for-credit-note?lang=php-v4 * diff --git a/src/Actions/Contracts/CreditUnitActionsInterface.php b/src/Actions/Contracts/CreditUnitActionsInterface.php index c421db6a..d787ad09 100644 --- a/src/Actions/Contracts/CreditUnitActionsInterface.php +++ b/src/Actions/Contracts/CreditUnitActionsInterface.php @@ -21,12 +21,12 @@ * limit?: int, * offset?: string, * status?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/EntitlementActionsInterface.php b/src/Actions/Contracts/EntitlementActionsInterface.php index a0f27658..398ae8ba 100644 --- a/src/Actions/Contracts/EntitlementActionsInterface.php +++ b/src/Actions/Contracts/EntitlementActionsInterface.php @@ -18,16 +18,16 @@ * limit?: int, * offset?: string, * feature_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_type?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * include_drafts?: bool, * embed?: string, diff --git a/src/Actions/Contracts/ExportActionsInterface.php b/src/Actions/Contracts/ExportActionsInterface.php index 1b86222f..2c7b112c 100644 --- a/src/Actions/Contracts/ExportActionsInterface.php +++ b/src/Actions/Contracts/ExportActionsInterface.php @@ -9,6 +9,7 @@ use Chargebee\Responses\ExportResponse\CreditNotesExportResponse; use Chargebee\Responses\ExportResponse\CouponsExportResponse; use Chargebee\Responses\ExportResponse\SubscriptionsExportResponse; +use Chargebee\Responses\ExportResponse\RampsExportResponse; use Chargebee\Responses\ExportResponse\OrdersExportResponse; use Chargebee\Responses\ExportResponse\PlansExportResponse; use Chargebee\Responses\ExportResponse\AttachedItemsExportResponse; @@ -326,6 +327,44 @@ public function attachedItems(array $params = [], array $headers = []): Attached */ public function transactions(array $params = [], array $headers = []): TransactionsExportResponse; + /** + * @see https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps?lang=php-v4 + * @param array{ + * ramp?: array{ + * status?: array{ + * is?: string, + * in?: string, + * }, + * subscription_id?: array{ + * is?: string, + * in?: string, + * }, + * effective_from?: array{ + * after?: string, + * before?: string, + * on?: string, + * between?: string, + * }, + * updated_at?: array{ + * after?: string, + * before?: string, + * on?: string, + * between?: string, + * }, + * }, + * export_type?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return RampsExportResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function ramps(array $params = [], array $headers = []): RampsExportResponse; + /** * @see https://apidocs.chargebee.com/docs/api/exports/export-differential-price?lang=php-v4 * @param array{ @@ -1602,8 +1641,8 @@ public function creditNotes(array $params = [], array $headers = []): CreditNote * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/InvoiceActionsInterface.php b/src/Actions/Contracts/InvoiceActionsInterface.php index 12496a82..d0324008 100644 --- a/src/Actions/Contracts/InvoiceActionsInterface.php +++ b/src/Actions/Contracts/InvoiceActionsInterface.php @@ -1244,13 +1244,13 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] * offset?: string, * payment_reference_number?: array{ * number?: array{ - * in?: string, - * is?: string, + * is?: string, + * in?: string, * }, * }, * id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/LedgerOperationActionsInterface.php b/src/Actions/Contracts/LedgerOperationActionsInterface.php index b6113808..862dc17d 100644 --- a/src/Actions/Contracts/LedgerOperationActionsInterface.php +++ b/src/Actions/Contracts/LedgerOperationActionsInterface.php @@ -117,8 +117,8 @@ public function authorize(array $params, array $headers = []): AuthorizeLedgerOp * between?: mixed, * }, * type?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php b/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php index 802e5ab6..2d2704b3 100644 --- a/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php +++ b/src/Actions/Contracts/OmnichannelSubscriptionActionsInterface.php @@ -107,12 +107,16 @@ public function omnichannelTransactionsForOmnichannelSubscription(string $id, ar * not_in?: mixed, * }, * updated_at?: array{ - * before?: mixed, * after?: mixed, + * before?: mixed, + * between?: mixed, + * on?: mixed, * }, * purchased_at?: array{ - * before?: mixed, * after?: mixed, + * before?: mixed, + * between?: mixed, + * on?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/Contracts/PaymentSourceActionsInterface.php b/src/Actions/Contracts/PaymentSourceActionsInterface.php index aa39ba0c..5df49f3e 100644 --- a/src/Actions/Contracts/PaymentSourceActionsInterface.php +++ b/src/Actions/Contracts/PaymentSourceActionsInterface.php @@ -1,6 +1,7 @@ $headers + * @return ListGatewayTokensForPaymentSourcePaymentSourceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listGatewayTokensForPaymentSource(string $id, array $params = [], array $headers = []): ListGatewayTokensForPaymentSourcePaymentSourceResponse; + /** * @see https://apidocs.chargebee.com/docs/api/payment_sources/verify-bank-account-payment-source?lang=php-v4 * @param array{ diff --git a/src/Actions/Contracts/QuoteActionsInterface.php b/src/Actions/Contracts/QuoteActionsInterface.php index 9c0f3e57..a7aeaedc 100644 --- a/src/Actions/Contracts/QuoteActionsInterface.php +++ b/src/Actions/Contracts/QuoteActionsInterface.php @@ -101,6 +101,7 @@ * charge_on_option?: string, * start_date?: int, * end_date?: int, + * description?: string, * ramp_tier_id?: string, * }>, * discounts?: array, * discounts?: array, * discounts?: array, * discounts?: array $headers + * @return RetrieveVaultedPaymentMethodResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveVaultedPaymentMethodResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/CouponActions.php b/src/Actions/CouponActions.php index 6bdeda1a..75e7d556 100644 --- a/src/Actions/CouponActions.php +++ b/src/Actions/CouponActions.php @@ -99,8 +99,8 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/CreditNoteActions.php b/src/Actions/CreditNoteActions.php index d7be5867..e84f4452 100644 --- a/src/Actions/CreditNoteActions.php +++ b/src/Actions/CreditNoteActions.php @@ -10,6 +10,7 @@ use Chargebee\Responses\CreditNoteResponse\CreateCreditNoteResponse; use Chargebee\ValueObjects\Encoders\ListParamEncoder; use Chargebee\Responses\CreditNoteResponse\DownloadEinvoiceCreditNoteResponse; +use Chargebee\Responses\CreditNoteResponse\UpdateCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\RemoveTaxWithheldRefundCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\CreditNotesForCustomerCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\RetrieveCreditNoteResponse; @@ -657,6 +658,42 @@ public function create(array $params, array $headers = []): CreateCreditNoteResp return CreateCreditNoteResponse::from($respObject->data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details?lang=php-v4 + * @param array{ + * comment?: string, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateCreditNoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params = [], array $headers = []): UpdateCreditNoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["credit_notes",$id,"update"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("creditNote") + ->withTelemetryOperation("update") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateCreditNoteResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/credit_notes/download-e-invoice-for-credit-note?lang=php-v4 * diff --git a/src/Actions/CreditUnitActions.php b/src/Actions/CreditUnitActions.php index 0220eb0e..5a78f9ff 100644 --- a/src/Actions/CreditUnitActions.php +++ b/src/Actions/CreditUnitActions.php @@ -34,12 +34,12 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * limit?: int, * offset?: string, * status?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/EntitlementActions.php b/src/Actions/EntitlementActions.php index d83d96c2..ac18aadc 100644 --- a/src/Actions/EntitlementActions.php +++ b/src/Actions/EntitlementActions.php @@ -31,16 +31,16 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * limit?: int, * offset?: string, * feature_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_type?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * entity_id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * include_drafts?: bool, * embed?: string, diff --git a/src/Actions/ExportActions.php b/src/Actions/ExportActions.php index 78cda91f..16baac05 100644 --- a/src/Actions/ExportActions.php +++ b/src/Actions/ExportActions.php @@ -9,6 +9,7 @@ use Chargebee\Responses\ExportResponse\CreditNotesExportResponse; use Chargebee\Responses\ExportResponse\CouponsExportResponse; use Chargebee\Responses\ExportResponse\SubscriptionsExportResponse; +use Chargebee\Responses\ExportResponse\RampsExportResponse; use Chargebee\Responses\ExportResponse\OrdersExportResponse; use Chargebee\Responses\ExportResponse\PlansExportResponse; use Chargebee\Responses\ExportResponse\AttachedItemsExportResponse; @@ -398,6 +399,64 @@ public function transactions(array $params = [], array $headers = []): Transacti return TransactionsExportResponse::from($respObject->data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps?lang=php-v4 + * @param array{ + * ramp?: array{ + * status?: array{ + * is?: string, + * in?: string, + * }, + * subscription_id?: array{ + * is?: string, + * in?: string, + * }, + * effective_from?: array{ + * after?: string, + * before?: string, + * on?: string, + * between?: string, + * }, + * updated_at?: array{ + * after?: string, + * before?: string, + * on?: string, + * between?: string, + * }, + * }, + * export_type?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return RampsExportResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function ramps(array $params = [], array $headers = []): RampsExportResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["exports","ramps"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("export") + ->withTelemetryOperation("ramps") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RampsExportResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/exports/export-differential-price?lang=php-v4 * @param array{ @@ -1852,8 +1911,8 @@ public function creditNotes(array $params = [], array $headers = []): CreditNote * not_in?: mixed, * }, * applicable_item_price_ids?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/InvoiceActions.php b/src/Actions/InvoiceActions.php index c1023e6c..52146297 100644 --- a/src/Actions/InvoiceActions.php +++ b/src/Actions/InvoiceActions.php @@ -1834,13 +1834,13 @@ public function removeTaxWithheld(string $id, array $params, array $headers = [] * offset?: string, * payment_reference_number?: array{ * number?: array{ - * in?: string, - * is?: string, + * is?: string, + * in?: string, * }, * }, * id?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * } $params Description of the parameters * diff --git a/src/Actions/LedgerOperationActions.php b/src/Actions/LedgerOperationActions.php index 35ec570c..689e7578 100644 --- a/src/Actions/LedgerOperationActions.php +++ b/src/Actions/LedgerOperationActions.php @@ -219,8 +219,8 @@ public function authorize(array $params, array $headers = []): AuthorizeLedgerOp * between?: mixed, * }, * type?: array{ - * in?: mixed, * is?: mixed, + * in?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/OmnichannelSubscriptionActions.php b/src/Actions/OmnichannelSubscriptionActions.php index 884f803d..4b9121c0 100644 --- a/src/Actions/OmnichannelSubscriptionActions.php +++ b/src/Actions/OmnichannelSubscriptionActions.php @@ -177,12 +177,16 @@ public function omnichannelTransactionsForOmnichannelSubscription(string $id, ar * not_in?: mixed, * }, * updated_at?: array{ - * before?: mixed, * after?: mixed, + * before?: mixed, + * between?: mixed, + * on?: mixed, * }, * purchased_at?: array{ - * before?: mixed, * after?: mixed, + * before?: mixed, + * between?: mixed, + * on?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/PaymentSourceActions.php b/src/Actions/PaymentSourceActions.php index f6d69c43..1a960045 100644 --- a/src/Actions/PaymentSourceActions.php +++ b/src/Actions/PaymentSourceActions.php @@ -1,6 +1,7 @@ data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * include_deleted?: bool, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ListGatewayTokensForPaymentSourcePaymentSourceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listGatewayTokensForPaymentSource(string $id, array $params = [], array $headers = []): ListGatewayTokensForPaymentSourcePaymentSourceResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["payment_sources",$id,"gateway_payment_method_tokens"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("paymentSource") + ->withTelemetryOperation("listGatewayTokensForPaymentSource") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListGatewayTokensForPaymentSourcePaymentSourceResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/payment_sources/verify-bank-account-payment-source?lang=php-v4 * @param array{ diff --git a/src/Actions/QuoteActions.php b/src/Actions/QuoteActions.php index fedce707..384b60ca 100644 --- a/src/Actions/QuoteActions.php +++ b/src/Actions/QuoteActions.php @@ -114,6 +114,7 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * charge_on_option?: string, * start_date?: int, * end_date?: int, + * description?: string, * ramp_tier_id?: string, * }>, * discounts?: array, * discounts?: array, * discounts?: array, * discounts?: arrayhttpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/vaulted_payment_methods/retrieve-vaulted-payment-method?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveVaultedPaymentMethodResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveVaultedPaymentMethodResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["vaulted_payment_methods",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("vaultedPaymentMethod") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveVaultedPaymentMethodResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/ChargebeeClient.php b/src/ChargebeeClient.php index c2bf088a..7a6da79e 100644 --- a/src/ChargebeeClient.php +++ b/src/ChargebeeClient.php @@ -144,6 +144,8 @@ use Chargebee\Actions\UsageFileActions; use Chargebee\Actions\Contracts\UsageSummaryActionsInterface; use Chargebee\Actions\UsageSummaryActions; +use Chargebee\Actions\Contracts\VaultedPaymentMethodActionsInterface; +use Chargebee\Actions\VaultedPaymentMethodActions; use Chargebee\Actions\Contracts\VirtualBankAccountActionsInterface; use Chargebee\Actions\VirtualBankAccountActions; use Chargebee\Actions\Contracts\WebhookEndpointActionsInterface; @@ -515,6 +517,10 @@ public function usageSummary() :UsageSummaryActionsInterface { return new UsageSummaryActions($this->httpClientFactory, $this->env); } + public function vaultedPaymentMethod() :VaultedPaymentMethodActionsInterface { + return new VaultedPaymentMethodActions($this->httpClientFactory, $this->env); + } + public function virtualBankAccount() :VirtualBankAccountActionsInterface { return new VirtualBankAccountActions($this->httpClientFactory, $this->env); } diff --git a/src/Enums/EnabledEvents.php b/src/Enums/EnabledEvents.php index 0826060b..0e4537ab 100644 --- a/src/Enums/EnabledEvents.php +++ b/src/Enums/EnabledEvents.php @@ -226,10 +226,14 @@ enum EnabledEvents : string { case ALERT_STATUS_CHANGED = "alert_status_changed"; case OMNICHANNEL_SUBSCRIPTION_ITEM_UPDATED = "omnichannel_subscription_item_updated"; case OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED = "omnichannel_subscription_item_recovered"; + case OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED = "omnichannel_subscription_item_mrr_updated"; case LEDGER_ACCOUNT_BALANCE_UPDATED = "ledger_account_balance_updated"; case GRANT_BLOCKS_CREATED = "grant_blocks_created"; case GRANT_BLOCKS_UPDATED = "grant_blocks_updated"; case LEDGER_UPDATED = "ledger_updated"; + case VAULT_TOKEN_CREATED = "vault_token_created"; + case VAULT_TOKEN_UPDATED = "vault_token_updated"; + case VAULT_TOKEN_DELETED = "vault_token_deleted"; case PLAN_CREATED = "plan_created"; case PLAN_UPDATED = "plan_updated"; case PLAN_DELETED = "plan_deleted"; diff --git a/src/Enums/EntityType.php b/src/Enums/EntityType.php index 43b69fbd..7c3ac5ae 100644 --- a/src/Enums/EntityType.php +++ b/src/Enums/EntityType.php @@ -45,6 +45,7 @@ enum EntityType : string { case BUSINESS_RULE = "business_rule"; case RULESET = "ruleset"; case ALERT_STATUS = "alert_status"; + case OMNICHANNEL_SUBSCRIPTION_ITEM_METRIC = "omnichannel_subscription_item_metric"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Enums/EventType.php b/src/Enums/EventType.php index bb9b3c29..d0b24f0f 100644 --- a/src/Enums/EventType.php +++ b/src/Enums/EventType.php @@ -217,10 +217,14 @@ enum EventType : string { case ALERT_STATUS_CHANGED = "alert_status_changed"; case OMNICHANNEL_SUBSCRIPTION_ITEM_UPDATED = "omnichannel_subscription_item_updated"; case OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED = "omnichannel_subscription_item_recovered"; + case OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED = "omnichannel_subscription_item_mrr_updated"; case LEDGER_ACCOUNT_BALANCE_UPDATED = "ledger_account_balance_updated"; case GRANT_BLOCKS_CREATED = "grant_blocks_created"; case GRANT_BLOCKS_UPDATED = "grant_blocks_updated"; case LEDGER_UPDATED = "ledger_updated"; + case VAULT_TOKEN_CREATED = "vault_token_created"; + case VAULT_TOKEN_UPDATED = "vault_token_updated"; + case VAULT_TOKEN_DELETED = "vault_token_deleted"; case PLAN_CREATED = "plan_created"; case PLAN_UPDATED = "plan_updated"; case PLAN_DELETED = "plan_deleted"; diff --git a/src/Enums/GatewayName.php b/src/Enums/GatewayName.php new file mode 100644 index 00000000..f7d70a18 --- /dev/null +++ b/src/Enums/GatewayName.php @@ -0,0 +1,73 @@ + \ No newline at end of file diff --git a/src/Resources/Content/Content.php b/src/Resources/Content/Content.php index 05cee5bf..3bb9c525 100644 --- a/src/Resources/Content/Content.php +++ b/src/Resources/Content/Content.php @@ -42,6 +42,7 @@ use Chargebee\Resources\Feature\Feature; use Chargebee\Resources\FilterCondition\FilterCondition; use Chargebee\Resources\GatewayErrorDetail\GatewayErrorDetail; +use Chargebee\Resources\GatewayPaymentMethodToken\GatewayPaymentMethodToken; use Chargebee\Resources\Gift\Gift; use Chargebee\Resources\GrantBlock\GrantBlock; use Chargebee\Resources\Hierarchy\Hierarchy; @@ -70,6 +71,7 @@ use Chargebee\Resources\OmnichannelOneTimeOrderItem\OmnichannelOneTimeOrderItem; use Chargebee\Resources\OmnichannelSubscription\OmnichannelSubscription; use Chargebee\Resources\OmnichannelSubscriptionItem\OmnichannelSubscriptionItem; +use Chargebee\Resources\OmnichannelSubscriptionItemMetric\OmnichannelSubscriptionItemMetric; use Chargebee\Resources\OmnichannelSubscriptionItemOffer\OmnichannelSubscriptionItemOffer; use Chargebee\Resources\OmnichannelSubscriptionItemScheduledChange\OmnichannelSubscriptionItemScheduledChange; use Chargebee\Resources\OmnichannelTransaction\OmnichannelTransaction; @@ -116,6 +118,7 @@ use Chargebee\Resources\UsageEvent\UsageEvent; use Chargebee\Resources\UsageFile\UsageFile; use Chargebee\Resources\UsageSummary\UsageSummary; +use Chargebee\Resources\VaultedPaymentMethod\VaultedPaymentMethod; use Chargebee\Resources\VirtualBankAccount\VirtualBankAccount; use Chargebee\Resources\WebhookEndpoint\WebhookEndpoint; @@ -366,6 +369,12 @@ class Content { */ public ?GatewayErrorDetail $gatewayerrordetail; + /** + * + * @var ?GatewayPaymentMethodToken $gatewaypaymentmethodtoken + */ + public ?GatewayPaymentMethodToken $gatewaypaymentmethodtoken; + /** * * @var ?Gift $gift @@ -534,6 +543,12 @@ class Content { */ public ?OmnichannelSubscriptionItem $omnichannelsubscriptionitem; + /** + * + * @var ?OmnichannelSubscriptionItemMetric $omnichannelsubscriptionitemmetric + */ + public ?OmnichannelSubscriptionItemMetric $omnichannelsubscriptionitemmetric; + /** * * @var ?OmnichannelSubscriptionItemOffer $omnichannelsubscriptionitemoffer @@ -810,6 +825,12 @@ class Content { */ public ?UsageSummary $usagesummary; + /** + * + * @var ?VaultedPaymentMethod $vaultedpaymentmethod + */ + public ?VaultedPaymentMethod $vaultedpaymentmethod; + /** * * @var ?VirtualBankAccount $virtualbankaccount @@ -825,7 +846,7 @@ class Content { /** * @var array $knownFields */ - protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "async_response" , "async_response_list" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "column_definition" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "credit_unit" , "currency" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "download" , "einvoice" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "filter_condition" , "gateway_error_detail" , "gift" , "grant_block" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "ledger_account_balance" , "ledger_entry" , "ledger_operation" , "metadata" , "meter" , "metered_feature" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "promotional_grant" , "purchase" , "quote" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "virtual_bank_account" , "webhook_endpoint" ]; + protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "async_response" , "async_response_list" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "column_definition" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "credit_unit" , "currency" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "download" , "einvoice" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "filter_condition" , "gateway_error_detail" , "gateway_payment_method_token" , "gift" , "grant_block" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "ledger_account_balance" , "ledger_entry" , "ledger_operation" , "metadata" , "meter" , "metered_feature" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_metric" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "promotional_grant" , "purchase" , "quote" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "vaulted_payment_method" , "virtual_bank_account" , "webhook_endpoint" ]; /** * dynamic properties for resources @@ -875,6 +896,7 @@ private function __construct( ?Feature $feature, ?FilterCondition $filtercondition, ?GatewayErrorDetail $gatewayerrordetail, + ?GatewayPaymentMethodToken $gatewaypaymentmethodtoken, ?Gift $gift, ?GrantBlock $grantblock, ?Hierarchy $hierarchy, @@ -903,6 +925,7 @@ private function __construct( ?OmnichannelOneTimeOrderItem $omnichannelonetimeorderitem, ?OmnichannelSubscription $omnichannelsubscription, ?OmnichannelSubscriptionItem $omnichannelsubscriptionitem, + ?OmnichannelSubscriptionItemMetric $omnichannelsubscriptionitemmetric, ?OmnichannelSubscriptionItemOffer $omnichannelsubscriptionitemoffer, ?OmnichannelSubscriptionItemScheduledChange $omnichannelsubscriptionitemscheduledchange, ?OmnichannelTransaction $omnichanneltransaction, @@ -949,6 +972,7 @@ private function __construct( ?UsageEvent $usageevent, ?UsageFile $usagefile, ?UsageSummary $usagesummary, + ?VaultedPaymentMethod $vaultedpaymentmethod, ?VirtualBankAccount $virtualbankaccount, ?WebhookEndpoint $webhookendpoint, ) @@ -994,6 +1018,7 @@ private function __construct( $this->feature = $feature; $this->filtercondition = $filtercondition; $this->gatewayerrordetail = $gatewayerrordetail; + $this->gatewaypaymentmethodtoken = $gatewaypaymentmethodtoken; $this->gift = $gift; $this->grantblock = $grantblock; $this->hierarchy = $hierarchy; @@ -1022,6 +1047,7 @@ private function __construct( $this->omnichannelonetimeorderitem = $omnichannelonetimeorderitem; $this->omnichannelsubscription = $omnichannelsubscription; $this->omnichannelsubscriptionitem = $omnichannelsubscriptionitem; + $this->omnichannelsubscriptionitemmetric = $omnichannelsubscriptionitemmetric; $this->omnichannelsubscriptionitemoffer = $omnichannelsubscriptionitemoffer; $this->omnichannelsubscriptionitemscheduledchange = $omnichannelsubscriptionitemscheduledchange; $this->omnichanneltransaction = $omnichanneltransaction; @@ -1068,6 +1094,7 @@ private function __construct( $this->usageevent = $usageevent; $this->usagefile = $usagefile; $this->usagesummary = $usagesummary; + $this->vaultedpaymentmethod = $vaultedpaymentmethod; $this->virtualbankaccount = $virtualbankaccount; $this->webhookendpoint = $webhookendpoint; } @@ -1115,6 +1142,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['feature']) ? Feature::from($resourceAttributes['feature']) : null, isset($resourceAttributes['filter_condition']) ? FilterCondition::from($resourceAttributes['filter_condition']) : null, isset($resourceAttributes['gateway_error_detail']) ? GatewayErrorDetail::from($resourceAttributes['gateway_error_detail']) : null, + isset($resourceAttributes['gateway_payment_method_token']) ? GatewayPaymentMethodToken::from($resourceAttributes['gateway_payment_method_token']) : null, isset($resourceAttributes['gift']) ? Gift::from($resourceAttributes['gift']) : null, isset($resourceAttributes['grant_block']) ? GrantBlock::from($resourceAttributes['grant_block']) : null, isset($resourceAttributes['hierarchy']) ? Hierarchy::from($resourceAttributes['hierarchy']) : null, @@ -1143,6 +1171,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['omnichannel_one_time_order_item']) ? OmnichannelOneTimeOrderItem::from($resourceAttributes['omnichannel_one_time_order_item']) : null, isset($resourceAttributes['omnichannel_subscription']) ? OmnichannelSubscription::from($resourceAttributes['omnichannel_subscription']) : null, isset($resourceAttributes['omnichannel_subscription_item']) ? OmnichannelSubscriptionItem::from($resourceAttributes['omnichannel_subscription_item']) : null, + isset($resourceAttributes['omnichannel_subscription_item_metric']) ? OmnichannelSubscriptionItemMetric::from($resourceAttributes['omnichannel_subscription_item_metric']) : null, isset($resourceAttributes['omnichannel_subscription_item_offer']) ? OmnichannelSubscriptionItemOffer::from($resourceAttributes['omnichannel_subscription_item_offer']) : null, isset($resourceAttributes['omnichannel_subscription_item_scheduled_change']) ? OmnichannelSubscriptionItemScheduledChange::from($resourceAttributes['omnichannel_subscription_item_scheduled_change']) : null, isset($resourceAttributes['omnichannel_transaction']) ? OmnichannelTransaction::from($resourceAttributes['omnichannel_transaction']) : null, @@ -1189,6 +1218,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['usage_event']) ? UsageEvent::from($resourceAttributes['usage_event']) : null, isset($resourceAttributes['usage_file']) ? UsageFile::from($resourceAttributes['usage_file']) : null, isset($resourceAttributes['usage_summary']) ? UsageSummary::from($resourceAttributes['usage_summary']) : null, + isset($resourceAttributes['vaulted_payment_method']) ? VaultedPaymentMethod::from($resourceAttributes['vaulted_payment_method']) : null, isset($resourceAttributes['virtual_bank_account']) ? VirtualBankAccount::from($resourceAttributes['virtual_bank_account']) : null, isset($resourceAttributes['webhook_endpoint']) ? WebhookEndpoint::from($resourceAttributes['webhook_endpoint']) : null, @@ -1315,6 +1345,9 @@ public function toArray(): array + + + @@ -1447,6 +1480,9 @@ public function toArray(): array if($this->gatewayerrordetail instanceof GatewayErrorDetail){ $data['gateway_error_detail'] = $this->gatewayerrordetail->toArray(); } + if($this->gatewaypaymentmethodtoken instanceof GatewayPaymentMethodToken){ + $data['gateway_payment_method_token'] = $this->gatewaypaymentmethodtoken->toArray(); + } if($this->gift instanceof Gift){ $data['gift'] = $this->gift->toArray(); } @@ -1531,6 +1567,9 @@ public function toArray(): array if($this->omnichannelsubscriptionitem instanceof OmnichannelSubscriptionItem){ $data['omnichannel_subscription_item'] = $this->omnichannelsubscriptionitem->toArray(); } + if($this->omnichannelsubscriptionitemmetric instanceof OmnichannelSubscriptionItemMetric){ + $data['omnichannel_subscription_item_metric'] = $this->omnichannelsubscriptionitemmetric->toArray(); + } if($this->omnichannelsubscriptionitemoffer instanceof OmnichannelSubscriptionItemOffer){ $data['omnichannel_subscription_item_offer'] = $this->omnichannelsubscriptionitemoffer->toArray(); } @@ -1669,6 +1708,9 @@ public function toArray(): array if($this->usagesummary instanceof UsageSummary){ $data['usage_summary'] = $this->usagesummary->toArray(); } + if($this->vaultedpaymentmethod instanceof VaultedPaymentMethod){ + $data['vaulted_payment_method'] = $this->vaultedpaymentmethod->toArray(); + } if($this->virtualbankaccount instanceof VirtualBankAccount){ $data['virtual_bank_account'] = $this->virtualbankaccount->toArray(); } diff --git a/src/Resources/GatewayPaymentMethodToken/Enums/Status.php b/src/Resources/GatewayPaymentMethodToken/Enums/Status.php new file mode 100644 index 00000000..ed9d7204 --- /dev/null +++ b/src/Resources/GatewayPaymentMethodToken/Enums/Status.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php b/src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php new file mode 100644 index 00000000..8f9f8bfe --- /dev/null +++ b/src/Resources/GatewayPaymentMethodToken/GatewayPaymentMethodToken.php @@ -0,0 +1,130 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "gateway_account_id" , "gateway_customer_id" , "gateway_token" , "created_at" , "updated_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $gateway_account_id, + ?string $gateway_customer_id, + ?string $gateway_token, + ?int $created_at, + ?int $updated_at, + ?\Chargebee\Enums\GatewayName $gateway_name, + ?\Chargebee\Resources\GatewayPaymentMethodToken\Enums\Status $status, + ) + { + $this->id = $id; + $this->gateway_account_id = $gateway_account_id; + $this->gateway_customer_id = $gateway_customer_id; + $this->gateway_token = $gateway_token; + $this->created_at = $created_at; + $this->updated_at = $updated_at; + $this->gateway_name = $gateway_name; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['gateway_account_id'] ?? null, + $resourceAttributes['gateway_customer_id'] ?? null, + $resourceAttributes['gateway_token'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + + + isset($resourceAttributes['gateway_name']) ? \Chargebee\Enums\GatewayName::tryFromValue($resourceAttributes['gateway_name']) : null, + + isset($resourceAttributes['status']) ? \Chargebee\Resources\GatewayPaymentMethodToken\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'gateway_account_id' => $this->gateway_account_id, + 'gateway_customer_id' => $this->gateway_customer_id, + 'gateway_token' => $this->gateway_token, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + + 'gateway_name' => $this->gateway_name?->value, + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/OmnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.php b/src/Resources/OmnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.php new file mode 100644 index 00000000..c0fca60b --- /dev/null +++ b/src/Resources/OmnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.php @@ -0,0 +1,156 @@ + $knownFields + */ + protected static array $knownFields = [ "customer_id" , "omnichannel_subscription_id" , "omnichannel_subscription_item_id" , "item_id_at_source" , "mrr_currency" , "mrr_units" , "mrr_nanos" , "effective_from" , "calculated_at" , "created_at" , "resource_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $customer_id, + ?string $omnichannel_subscription_id, + ?string $omnichannel_subscription_item_id, + ?string $item_id_at_source, + ?string $mrr_currency, + ?int $mrr_units, + ?int $mrr_nanos, + ?int $effective_from, + ?int $calculated_at, + ?int $created_at, + ?int $resource_version, + ) + { + $this->customer_id = $customer_id; + $this->omnichannel_subscription_id = $omnichannel_subscription_id; + $this->omnichannel_subscription_item_id = $omnichannel_subscription_item_id; + $this->item_id_at_source = $item_id_at_source; + $this->mrr_currency = $mrr_currency; + $this->mrr_units = $mrr_units; + $this->mrr_nanos = $mrr_nanos; + $this->effective_from = $effective_from; + $this->calculated_at = $calculated_at; + $this->created_at = $created_at; + $this->resource_version = $resource_version; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['omnichannel_subscription_id'] ?? null, + $resourceAttributes['omnichannel_subscription_item_id'] ?? null, + $resourceAttributes['item_id_at_source'] ?? null, + $resourceAttributes['mrr_currency'] ?? null, + $resourceAttributes['mrr_units'] ?? null, + $resourceAttributes['mrr_nanos'] ?? null, + $resourceAttributes['effective_from'] ?? null, + $resourceAttributes['calculated_at'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['customer_id' => $this->customer_id, + 'omnichannel_subscription_id' => $this->omnichannel_subscription_id, + 'omnichannel_subscription_item_id' => $this->omnichannel_subscription_item_id, + 'item_id_at_source' => $this->item_id_at_source, + 'mrr_currency' => $this->mrr_currency, + 'mrr_units' => $this->mrr_units, + 'mrr_nanos' => $this->mrr_nanos, + 'effective_from' => $this->effective_from, + 'calculated_at' => $this->calculated_at, + 'created_at' => $this->created_at, + 'resource_version' => $this->resource_version, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/PaymentIntent/Enums/PaymentIntentMetadataSource.php b/src/Resources/PaymentIntent/Enums/PaymentIntentMetadataSource.php index 91f8aaaa..b4ec7969 100644 --- a/src/Resources/PaymentIntent/Enums/PaymentIntentMetadataSource.php +++ b/src/Resources/PaymentIntent/Enums/PaymentIntentMetadataSource.php @@ -3,16 +3,12 @@ namespace Chargebee\Resources\PaymentIntent\Enums; enum PaymentIntentMetadataSource : string { - case CB_JS = "cb_js"; - case COMPONENTS_FIELDS = "components_fields"; - case CHECKOUT_V3 = "checkout_v3"; - case PAYNOW_V3 = "paynow_v3"; - case PORTAL_V3 = "portal_v3"; - case GIFT_V3 = "gift_v3"; - case CHECKOUT_V4 = "checkout_v4"; - case PAYMENT_COMPONENT = "payment_component"; - case PC_INAPP_V4 = "pc_inapp_v4"; - case PC_FPC_V4 = "pc_fpc_v4"; + case PAYMENT_METHOD_HELPER = "payment_method_helper"; + case CARD_COMPONENTS = "card_components"; + case CHECKOUT = "checkout"; + case COLLECT_NOW = "collect_now"; + case PORTAL = "portal"; + case PAYMENT_COMPONENTS = "payment_components"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/PaymentSource/PaymentSource.php b/src/Resources/PaymentSource/PaymentSource.php index 4e7bc8b9..43f04f19 100644 --- a/src/Resources/PaymentSource/PaymentSource.php +++ b/src/Resources/PaymentSource/PaymentSource.php @@ -117,6 +117,12 @@ class PaymentSource { */ public ?array $mandates; + /** + * + * @var mixed $vault_token + */ + public mixed $vault_token; + /** * * @var ?bool $deleted @@ -150,7 +156,7 @@ class PaymentSource { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "resource_version" , "updated_at" , "created_at" , "customer_id" , "reference_id" , "gateway_account_id" , "ip_address" , "issuing_country" , "card" , "bank_account" , "boleto" , "billing_address" , "amazon_payment" , "upi" , "paypal" , "venmo" , "klarna_pay_now" , "mandates" , "deleted" , "business_entity_id" ]; + protected static array $knownFields = [ "id" , "resource_version" , "updated_at" , "created_at" , "customer_id" , "reference_id" , "gateway_account_id" , "ip_address" , "issuing_country" , "card" , "bank_account" , "boleto" , "billing_address" , "amazon_payment" , "upi" , "paypal" , "venmo" , "klarna_pay_now" , "mandates" , "vault_token" , "deleted" , "business_entity_id" ]; /** * dynamic properties for resources @@ -178,6 +184,7 @@ private function __construct( ?Venmo $venmo, ?KlarnaPayNow $klarna_pay_now, ?array $mandates, + mixed $vault_token, ?bool $deleted, ?string $business_entity_id, ?\Chargebee\Enums\Type $type, @@ -204,6 +211,7 @@ private function __construct( $this->venmo = $venmo; $this->klarna_pay_now = $klarna_pay_now; $this->mandates = $mandates; + $this->vault_token = $vault_token; $this->deleted = $deleted; $this->business_entity_id = $business_entity_id; $this->type = $type; @@ -236,6 +244,7 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['venmo']) ? Venmo::from($resourceAttributes['venmo']) : null, isset($resourceAttributes['klarna_pay_now']) ? KlarnaPayNow::from($resourceAttributes['klarna_pay_now']) : null, $mandates, + $resourceAttributes['vault_token'] ?? null, $resourceAttributes['deleted'] ?? null, $resourceAttributes['business_entity_id'] ?? null, @@ -273,6 +282,7 @@ public function toArray(): array + 'vault_token' => $this->vault_token, 'deleted' => $this->deleted, 'business_entity_id' => $this->business_entity_id, diff --git a/src/Resources/QuotedRamp/LineItem.php b/src/Resources/QuotedRamp/LineItem.php index e5549670..f2cee5f9 100644 --- a/src/Resources/QuotedRamp/LineItem.php +++ b/src/Resources/QuotedRamp/LineItem.php @@ -177,10 +177,16 @@ class LineItem { */ public ?string $net_amount_per_billing_cycle_in_decimal; + /** + * + * @var ?string $description + */ + public ?string $description; + /** * @var array $knownFields */ - protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "metered_quantity" , "unit_price" , "unit_price_in_decimal" , "amount" , "amount_in_decimal" , "billing_period" , "billing_period_unit" , "free_quantity" , "free_quantity_in_decimal" , "billing_cycles" , "service_period_days" , "charge_on_event" , "charge_once" , "charge_on_option" , "start_date" , "end_date" , "ramp_tier_id" , "discount_per_billing_cycle" , "discount_per_billing_cycle_in_decimal" , "item_level_discount_per_billing_cycle" , "item_level_discount_per_billing_cycle_in_decimal" , "amount_per_billing_cycle" , "amount_per_billing_cycle_in_decimal" , "net_amount_per_billing_cycle" , "net_amount_per_billing_cycle_in_decimal" ]; + protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "metered_quantity" , "unit_price" , "unit_price_in_decimal" , "amount" , "amount_in_decimal" , "billing_period" , "billing_period_unit" , "free_quantity" , "free_quantity_in_decimal" , "billing_cycles" , "service_period_days" , "charge_on_event" , "charge_once" , "charge_on_option" , "start_date" , "end_date" , "ramp_tier_id" , "discount_per_billing_cycle" , "discount_per_billing_cycle_in_decimal" , "item_level_discount_per_billing_cycle" , "item_level_discount_per_billing_cycle_in_decimal" , "amount_per_billing_cycle" , "amount_per_billing_cycle_in_decimal" , "net_amount_per_billing_cycle" , "net_amount_per_billing_cycle_in_decimal" , "description" ]; /** * dynamic properties for resources @@ -218,6 +224,7 @@ private function __construct( ?string $amount_per_billing_cycle_in_decimal, ?int $net_amount_per_billing_cycle, ?string $net_amount_per_billing_cycle_in_decimal, + ?string $description, ) { $this->item_price_id = $item_price_id; @@ -248,7 +255,8 @@ private function __construct( $this->amount_per_billing_cycle = $amount_per_billing_cycle; $this->amount_per_billing_cycle_in_decimal = $amount_per_billing_cycle_in_decimal; $this->net_amount_per_billing_cycle = $net_amount_per_billing_cycle; - $this->net_amount_per_billing_cycle_in_decimal = $net_amount_per_billing_cycle_in_decimal; + $this->net_amount_per_billing_cycle_in_decimal = $net_amount_per_billing_cycle_in_decimal; + $this->description = $description; } public static function from(array $resourceAttributes): self @@ -282,6 +290,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['amount_per_billing_cycle_in_decimal'] ?? null, $resourceAttributes['net_amount_per_billing_cycle'] ?? null, $resourceAttributes['net_amount_per_billing_cycle_in_decimal'] ?? null, + $resourceAttributes['description'] ?? null, ); @@ -321,6 +330,7 @@ public function toArray(): array 'amount_per_billing_cycle_in_decimal' => $this->amount_per_billing_cycle_in_decimal, 'net_amount_per_billing_cycle' => $this->net_amount_per_billing_cycle, 'net_amount_per_billing_cycle_in_decimal' => $this->net_amount_per_billing_cycle_in_decimal, + 'description' => $this->description, ], function ($value) { return $value !== null; diff --git a/src/Resources/VaultedPaymentMethod/VaultedPaymentMethod.php b/src/Resources/VaultedPaymentMethod/VaultedPaymentMethod.php new file mode 100644 index 00000000..0de6d7c4 --- /dev/null +++ b/src/Resources/VaultedPaymentMethod/VaultedPaymentMethod.php @@ -0,0 +1,96 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "customer_id" , "credit_card_id" , "created_at" , "modified_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $customer_id, + ?string $credit_card_id, + ?int $created_at, + ?int $modified_at, + ) + { + $this->id = $id; + $this->customer_id = $customer_id; + $this->credit_card_id = $credit_card_id; + $this->created_at = $created_at; + $this->modified_at = $modified_at; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['credit_card_id'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['modified_at'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'customer_id' => $this->customer_id, + 'credit_card_id' => $this->credit_card_id, + 'created_at' => $this->created_at, + 'modified_at' => $this->modified_at, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/CreditNoteResponse/UpdateCreditNoteResponse.php b/src/Responses/CreditNoteResponse/UpdateCreditNoteResponse.php new file mode 100644 index 00000000..223e023a --- /dev/null +++ b/src/Responses/CreditNoteResponse/UpdateCreditNoteResponse.php @@ -0,0 +1,45 @@ +credit_note = $credit_note; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['credit_note']) ? CreditNote::from($resourceAttributes['credit_note']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->credit_note instanceof CreditNote){ + $data['credit_note'] = $this->credit_note->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/ExportResponse/RampsExportResponse.php b/src/Responses/ExportResponse/RampsExportResponse.php new file mode 100644 index 00000000..401058c3 --- /dev/null +++ b/src/Responses/ExportResponse/RampsExportResponse.php @@ -0,0 +1,45 @@ +export = $export; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['export']) ? Export::from($resourceAttributes['export']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->export instanceof Export){ + $data['export'] = $this->export->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponse.php b/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponse.php new file mode 100644 index 00000000..bbde2983 --- /dev/null +++ b/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject { + return new ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject( + isset($result['gateway_payment_method_token']) ? GatewayPaymentMethodToken::from($result['gateway_payment_method_token']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject.php b/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject.php new file mode 100644 index 00000000..ec02e9c1 --- /dev/null +++ b/src/Responses/PaymentSourceResponse/ListGatewayTokensForPaymentSourcePaymentSourceResponseListObject.php @@ -0,0 +1,14 @@ +gateway_payment_method_token = $gateway_payment_method_token; + } +} diff --git a/src/Responses/VaultedPaymentMethodResponse/RetrieveVaultedPaymentMethodResponse.php b/src/Responses/VaultedPaymentMethodResponse/RetrieveVaultedPaymentMethodResponse.php new file mode 100644 index 00000000..cae54ee2 --- /dev/null +++ b/src/Responses/VaultedPaymentMethodResponse/RetrieveVaultedPaymentMethodResponse.php @@ -0,0 +1,45 @@ +vaulted_payment_method = $vaulted_payment_method; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['vaulted_payment_method']) ? VaultedPaymentMethod::from($resourceAttributes['vaulted_payment_method']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->vaulted_payment_method instanceof VaultedPaymentMethod){ + $data['vaulted_payment_method'] = $this->vaulted_payment_method->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Version.php b/src/Version.php index aa6a6013..fa9c78f3 100644 --- a/src/Version.php +++ b/src/Version.php @@ -4,7 +4,7 @@ final class Version { - const VERSION = '4.25.1'; + const VERSION = '4.26.0'; } ?> \ No newline at end of file