From 10ba68d411a0b1c41fc669bfad5101df54467f08 Mon Sep 17 00:00:00 2001 From: maxio-sdk Date: Thu, 17 Jul 2025 11:10:12 +0000 Subject: [PATCH 01/14] Automated commit message --- README.md | 141 ++++---- composer.json | 3 +- doc/api-exception.md | 8 +- doc/auth/basic-authentication.md | 3 + doc/client.md | 29 +- doc/controllers/api-exports.md | 12 +- doc/controllers/component-price-points.md | 8 +- doc/controllers/components.md | 20 +- doc/controllers/coupons.md | 12 +- doc/controllers/custom-fields.md | 16 +- doc/controllers/customers.md | 4 +- .../events-based-billing-segments.md | 4 +- doc/controllers/events.md | 18 +- doc/controllers/insights.md | 10 +- doc/controllers/invoices.md | 98 ++---- doc/controllers/offers.md | 4 +- doc/controllers/payment-profiles.md | 12 +- doc/controllers/product-families.md | 4 +- doc/controllers/product-price-points.md | 8 +- doc/controllers/products.md | 4 +- doc/controllers/proforma-invoices.md | 30 +- doc/controllers/reason-codes.md | 10 +- doc/controllers/sales-commissions.md | 18 +- doc/controllers/sites.md | 6 +- doc/controllers/subscription-components.md | 12 +- .../subscription-group-invoice-account.md | 4 +- doc/controllers/subscription-groups.md | 4 +- .../subscription-invoice-account.md | 84 ++++- doc/controllers/subscription-notes.md | 4 +- doc/controllers/subscription-status.md | 4 +- doc/controllers/subscriptions.md | 57 +--- doc/controllers/webhooks.md | 4 +- doc/http-request.md | 8 +- doc/http-response.md | 8 +- doc/models/apple-pay-payment-profile.md | 2 + doc/models/bank-account-payment-profile.md | 4 +- doc/models/chargify-ebb.md | 2 +- doc/models/component.md | 1 + doc/models/coupon-request.md | 4 +- doc/models/create-component-price-point.md | 2 +- doc/models/create-or-update-product.md | 2 +- ...ate-prepaid-usage-component-price-point.md | 2 +- doc/models/create-product-price-point.md | 2 +- doc/models/create-subscription-request.md | 1 + doc/models/create-subscription.md | 12 +- doc/models/credit-card-payment-profile.md | 2 + doc/models/ebb-component.md | 2 +- doc/models/group-billing.md | 6 +- doc/models/issue-invoice-request.md | 2 +- doc/models/list-components-filter.md | 2 +- doc/models/list-coupons-filter.md | 2 +- doc/models/list-mrr-filter.md | 2 +- doc/models/list-products-filter.md | 2 +- doc/models/list-service-credits-response.md | 36 ++ .../list-subscription-components-filter.md | 2 +- ...subscription-components-for-site-filter.md | 2 +- doc/models/metered-component.md | 2 +- doc/models/on-off-component.md | 2 +- doc/models/override-subscription.md | 2 +- doc/models/paypal-payment-profile.md | 2 + .../prepaid-product-price-point-filter.md | 2 +- doc/models/prepaid-usage-component.md | 2 +- doc/models/quantity-based-component.md | 2 +- doc/models/reactivation-billing.md | 2 +- doc/models/service-credit-1.md | 32 ++ doc/models/subscription-filter.md | 2 +- doc/models/subscription-group-credit-card.md | 15 +- .../subscription-migration-preview-options.md | 8 +- doc/models/subscription-product-migration.md | 8 +- doc/models/tax-configuration.md | 2 +- doc/models/update-subscription-request.md | 1 + doc/models/update-subscription.md | 4 + doc/proxy-configuration-builder.md | 38 +++ src/AdvancedBillingClient.php | 25 +- src/AdvancedBillingClientBuilder.php | 7 + src/ConfigurationDefaults.php | 10 +- src/ConfigurationInterface.php | 6 + src/Controllers/CouponsController.php | 8 +- src/Controllers/CustomFieldsController.php | 2 +- src/Controllers/InsightsController.php | 2 +- src/Controllers/InvoicesController.php | 57 +--- src/Controllers/PaymentProfilesController.php | 2 + src/Controllers/ProductFamiliesController.php | 2 +- src/Controllers/ReasonCodesController.php | 6 +- .../SubscriptionInvoiceAccountController.php | 58 ++++ src/Controllers/SubscriptionsController.php | 47 +-- src/Models/ApplePayPaymentProfile.php | 61 ++++ src/Models/BankAccountPaymentProfile.php | 61 ++++ .../ApplePayPaymentProfileBuilder.php | 22 ++ .../BankAccountPaymentProfileBuilder.php | 22 ++ src/Models/Builders/ComponentBuilder.php | 11 + .../Builders/CreateSubscriptionBuilder.php | 11 + .../CreditCardPaymentProfileBuilder.php | 22 ++ .../ListServiceCreditsResponseBuilder.php | 72 ++++ .../Builders/PaypalPaymentProfileBuilder.php | 22 ++ src/Models/Builders/ServiceCredit1Builder.php | 157 +++++++++ .../SubscriptionGroupCreditCardBuilder.php | 66 ++-- .../Builders/UpdateSubscriptionBuilder.php | 33 ++ src/Models/Component.php | 29 ++ src/Models/CouponRequest.php | 16 +- src/Models/CreateSubscription.php | 89 +++-- src/Models/CreditCardPaymentProfile.php | 61 ++++ src/Models/ListServiceCreditsResponse.php | 105 ++++++ src/Models/OverrideSubscription.php | 6 +- src/Models/PaypalPaymentProfile.php | 61 ++++ src/Models/ServiceCredit1.php | 322 ++++++++++++++++++ src/Models/SubscriptionGroupCreditCard.php | 214 ++++++------ src/Models/UpdateSubscription.php | 121 +++++++ src/Proxy/ProxyConfigurationBuilder.php | 91 +++++ 109 files changed, 2149 insertions(+), 649 deletions(-) create mode 100644 doc/models/list-service-credits-response.md create mode 100644 doc/models/service-credit-1.md create mode 100644 doc/proxy-configuration-builder.md create mode 100644 src/Models/Builders/ListServiceCreditsResponseBuilder.php create mode 100644 src/Models/Builders/ServiceCredit1Builder.php create mode 100644 src/Models/ListServiceCreditsResponse.php create mode 100644 src/Models/ServiceCredit1.php create mode 100644 src/Proxy/ProxyConfigurationBuilder.php diff --git a/README.md b/README.md index a1464603..06abb2f3 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,21 @@ ## Introduction Maxio Advanced Billing (formerly Chargify) provides an HTTP-based API that conforms to the principles of REST. -One of the many reasons to use Advanced Billing is the immense feature set and surrounding community [client libraries](page:development-tools/client-libraries). -The Maxio API returns JSON responses as the primary and recommended format, but XML is also provided as a backwards compatible option for Merchants who require it. +One of the many reasons to use Advanced Billing is the immense feature set and [client libraries](page:development-tools/client-libraries). +The Maxio API returns JSON responses as the primary and recommended format, but XML is also provided as a backwards compatible option for merchants who require it. ### Steps to make your first Maxio Advanced Billing API call 1. [Sign-up](https://app.chargify.com/signup/maxio-billing-sandbox) or [log-in](https://app.chargify.com/login.html) to your [test site](https://maxio.zendesk.com/hc/en-us/articles/24250712113165-Testing-Overview) account. -2. [Setup and configure authentication](https://maxio.zendesk.com/hc/en-us/articles/24294819360525-API-Keys) credentials. -3. Submit your API request and try it out. -4. Verify results through response. -5. Test our integrations. +2. [Setup authentication](https://maxio.zendesk.com/hc/en-us/articles/24294819360525-API-Keys) credentials. +3. [Submit an API request and verify the response](page:development-tools/client-libraries#make-your-first-maxio-advanced-billing-api-request). +4. Test the Advanced Billing [integrations](https://www.maxio.com/integrations). -We strongly suggest exploring the developer portal, our [integrations](https://www.maxio.com/integrations) and the API guide, as well as the entire set of application-based documentation to aid in your discovery of the product. +Next, you can explore [authentication methods](page:introduction/authentication), [basic concepts](page:introduction/basic-concepts/connected-sites) for interacting with Advanced Billing via the API, and the entire set of [application-based documentation](https://docs.maxio.com/hc/en-us) to aid in your discovery of the product. -#### Example +#### Request Example -The following example uses the curl command-line tool to execute API requests. +The following example uses the curl command-line tool to make an API request. **Request** @@ -30,44 +29,49 @@ curl -u :x -H Accept:application/json -H Content-Type:application/json Run the following command to install the package and automatically add the dependency to your composer.json file: ```bash -composer require "maxio/advanced-billing-sdk:6.1.0" +composer require "maxio/advanced-billing-sdk:7.0.0" ``` Or add it to the composer.json file manually as given below: ```json "require": { - "maxio/advanced-billing-sdk": "6.1.0" + "maxio/advanced-billing-sdk": "7.0.0" } ``` You can also view the package at: -https://packagist.org/packages/maxio/advanced-billing-sdk#6.1.0 +https://packagist.org/packages/maxio/advanced-billing-sdk#7.0.0 ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `site` | `string` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| `environment` | `Environment` | The API environment.
**Default: `Environment.US`** | -| `timeout` | `int` | Timeout for API calls in seconds.
*Default*: `120` | -| `enableRetries` | `bool` | Whether to enable retries and backoff feature.
*Default*: `false` | -| `numberOfRetries` | `int` | The number of retries to make.
*Default*: `0` | -| `retryInterval` | `float` | The retry time interval between the endpoint calls.
*Default*: `1` | -| `backOffFactor` | `float` | Exponential backoff factor to increase interval between retries.
*Default*: `2` | -| `maximumRetryWaitTime` | `int` | The maximum wait time in seconds for overall retrying requests.
*Default*: `0` | -| `retryOnTimeout` | `bool` | Whether to retry on request timeout.
*Default*: `true` | -| `httpStatusCodesToRetry` | `array` | Http status codes to retry against.
*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524` | -| `httpMethodsToRetry` | `array` | Http methods to retry against.
*Default*: `'GET', 'PUT'` | -| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/auth/basic-authentication.md) | The Credentials Setter for Basic Authentication | +| site | `string` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | +| environment | `Environment` | The API environment.
**Default: `Environment.US`** | +| timeout | `int` | Timeout for API calls in seconds.
*Default*: `120` | +| enableRetries | `bool` | Whether to enable retries and backoff feature.
*Default*: `false` | +| numberOfRetries | `int` | The number of retries to make.
*Default*: `0` | +| retryInterval | `float` | The retry time interval between the endpoint calls.
*Default*: `1` | +| backOffFactor | `float` | Exponential backoff factor to increase interval between retries.
*Default*: `2` | +| maximumRetryWaitTime | `int` | The maximum wait time in seconds for overall retrying requests.
*Default*: `0` | +| retryOnTimeout | `bool` | Whether to retry on request timeout.
*Default*: `true` | +| httpStatusCodesToRetry | `array` | Http status codes to retry against.
*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524` | +| httpMethodsToRetry | `array` | Http methods to retry against.
*Default*: `'GET', 'PUT'` | +| proxyConfiguration | [`ProxyConfigurationBuilder`](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/proxy-configuration-builder.md) | Represents the proxy configurations for API calls | +| basicAuthCredentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/auth/basic-authentication.md) | The Credentials Setter for Basic Authentication | The API client can be initialized as follows: ```php +use AdvancedBillingLib\Environment; +use AdvancedBillingLib\Authentication\BasicAuthCredentialsBuilder; +use AdvancedBillingLib\AdvancedBillingClientBuilder; + $client = AdvancedBillingClientBuilder::init() ->basicAuthCredentials( BasicAuthCredentialsBuilder::init( @@ -95,46 +99,55 @@ The SDK can be configured to use a different environment for making API calls. A This API uses the following authentication schemes. -* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/subscription-products.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/controllers/webhooks.md) - -## Classes Documentation - -* [ApiException](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/api-exception.md) -* [HttpRequest](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/http-request.md) -* [HttpResponse](https://www.github.com/maxio-com/ab-php-sdk/tree/6.1.0/doc/http-response.md) +* [API Exports](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/subscription-products.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/controllers/webhooks.md) + +## SDK Infrastructure + +### Configuration + +* [ProxyConfigurationBuilder](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/proxy-configuration-builder.md) + +### HTTP + +* [HttpRequest](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/http-response.md) + +### Utilities + +* [ApiException](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.0/doc/api-exception.md) diff --git a/composer.json b/composer.json index 7b41a8f5..e6c7d5de 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,8 @@ "require": { "php": "^7.2 || ^8.0", "ext-json": "*", - "apimatic/unirest-php": "^4.0.0", + "ext-curl": "*", + "apimatic/unirest-php": "^4.0.6", "apimatic/core-interfaces": "~0.1.5", "apimatic/core": "~0.3.13" }, diff --git a/doc/api-exception.md b/doc/api-exception.md index 4e41ae07..9dbd569f 100644 --- a/doc/api-exception.md +++ b/doc/api-exception.md @@ -1,13 +1,13 @@ # ApiException -Thrown when there is a network error or HTTP response status code is not okay. +Thrown when there is a network error or HTTP response status code is not okay. It also extends [Exception](https://www.php.net/manual/en/class.exception.php) that provides it with methods like `getMessage()`, `getCode()`, etc. ## Methods | Name | Type | Description | | --- | --- | --- | -| getHttpRequest() | [`HttpRequest`](http-request.md) | Returns the HTTP request. | -| getHttpResponse() | ?[`HttpResponse`](http-response.md) | Returns the HTTP response. | -| hasResponse() | bool | Is the response available? | +| `getHttpRequest()` | [`HttpRequest`](../doc/http-request.md) | Returns the HTTP request. | +| `getHttpResponse()` | [`?HttpResponse`](../doc/http-response.md) | Returns the HTTP response. | +| `hasResponse()` | `bool` | Is the response available? | diff --git a/doc/auth/basic-authentication.md b/doc/auth/basic-authentication.md index 185a8236..84a30e18 100644 --- a/doc/auth/basic-authentication.md +++ b/doc/auth/basic-authentication.md @@ -23,6 +23,9 @@ Documentation for accessing and setting credentials for BasicAuth. You must provide credentials in the client as shown in the following code snippet. ```php +use AdvancedBillingLib\Authentication\BasicAuthCredentialsBuilder; +use AdvancedBillingLib\AdvancedBillingClientBuilder; + $client = AdvancedBillingClientBuilder::init() ->basicAuthCredentials( BasicAuthCredentialsBuilder::init( diff --git a/doc/client.md b/doc/client.md index 4a955224..e224d5d7 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,22 +5,27 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `site` | `string` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| `environment` | `Environment` | The API environment.
**Default: `Environment.US`** | -| `timeout` | `int` | Timeout for API calls in seconds.
*Default*: `120` | -| `enableRetries` | `bool` | Whether to enable retries and backoff feature.
*Default*: `false` | -| `numberOfRetries` | `int` | The number of retries to make.
*Default*: `0` | -| `retryInterval` | `float` | The retry time interval between the endpoint calls.
*Default*: `1` | -| `backOffFactor` | `float` | Exponential backoff factor to increase interval between retries.
*Default*: `2` | -| `maximumRetryWaitTime` | `int` | The maximum wait time in seconds for overall retrying requests.
*Default*: `0` | -| `retryOnTimeout` | `bool` | Whether to retry on request timeout.
*Default*: `true` | -| `httpStatusCodesToRetry` | `array` | Http status codes to retry against.
*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524` | -| `httpMethodsToRetry` | `array` | Http methods to retry against.
*Default*: `'GET', 'PUT'` | -| `basicAuthCredentials` | [`BasicAuthCredentials`](auth/basic-authentication.md) | The Credentials Setter for Basic Authentication | +| site | `string` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | +| environment | `Environment` | The API environment.
**Default: `Environment.US`** | +| timeout | `int` | Timeout for API calls in seconds.
*Default*: `120` | +| enableRetries | `bool` | Whether to enable retries and backoff feature.
*Default*: `false` | +| numberOfRetries | `int` | The number of retries to make.
*Default*: `0` | +| retryInterval | `float` | The retry time interval between the endpoint calls.
*Default*: `1` | +| backOffFactor | `float` | Exponential backoff factor to increase interval between retries.
*Default*: `2` | +| maximumRetryWaitTime | `int` | The maximum wait time in seconds for overall retrying requests.
*Default*: `0` | +| retryOnTimeout | `bool` | Whether to retry on request timeout.
*Default*: `true` | +| httpStatusCodesToRetry | `array` | Http status codes to retry against.
*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524` | +| httpMethodsToRetry | `array` | Http methods to retry against.
*Default*: `'GET', 'PUT'` | +| proxyConfiguration | [`ProxyConfigurationBuilder`](../doc/proxy-configuration-builder.md) | Represents the proxy configurations for API calls | +| basicAuthCredentials | [`BasicAuthCredentials`](auth/basic-authentication.md) | The Credentials Setter for Basic Authentication | The API client can be initialized as follows: ```php +use AdvancedBillingLib\Environment; +use AdvancedBillingLib\Authentication\BasicAuthCredentialsBuilder; +use AdvancedBillingLib\AdvancedBillingClientBuilder; + $client = AdvancedBillingClientBuilder::init() ->basicAuthCredentials( BasicAuthCredentialsBuilder::init( diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index 9b44fd03..f2fe1cfb 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -36,8 +36,8 @@ function listExportedProformaInvoices(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `batchId` | `string` | Template, Required | Id of a Batch Job. | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
**Default**: `100`
**Constraints**: `>= 1`, `<= 10000` | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.

**Default**: `100`

**Constraints**: `>= 1`, `<= 10000` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | ## Response Type @@ -77,8 +77,8 @@ function listExportedInvoices(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `batchId` | `string` | Template, Required | Id of a Batch Job. | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
**Default**: `100`
**Constraints**: `>= 1`, `<= 10000` | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.

**Default**: `100`

**Constraints**: `>= 1`, `<= 10000` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | ## Response Type @@ -118,8 +118,8 @@ function listExportedSubscriptions(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `batchId` | `string` | Template, Required | Id of a Batch Job. | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
**Default**: `100`
**Constraints**: `>= 1`, `<= 10000` | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.

**Default**: `100`

**Constraints**: `>= 1`, `<= 10000` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | ## Response Type diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 421352dd..59077bcc 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -177,8 +177,8 @@ function listComponentPricePoints(array $options): ComponentPricePointsResponse | --- | --- | --- | --- | | `componentId` | `int` | Template, Required | The Advanced Billing id of the component | | `currencyPrices` | `?bool` | Query, Optional | Include an array of currency price data | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filterType` | [`?(string(PricePointType)[])`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | ## Response Type @@ -800,8 +800,8 @@ function listAllComponentPricePoints(array $options): ListComponentsPricePointsR | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `mInclude` | [`?string(ListComponentsPricePointsInclude)`](../../doc/models/list-components-price-points-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include=currency_prices`. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`?string(SortingDirection)`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `filter` | [`?ListPricePointsFilter`](../../doc/models/list-price-points-filter.md) | Query, Optional | Filter to use for List PricePoints operations | diff --git a/doc/controllers/components.md b/doc/controllers/components.md index bd65b01e..f25be46f 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -677,7 +677,7 @@ function readComponent(int $productFamilyId, string $componentId): ComponentResp | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `productFamilyId` | `int` | Template, Required | The Advanced Billing id of the product family to which the component belongs | -| `componentId` | `string` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`
**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | +| `componentId` | `string` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`

**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | ## Response Type @@ -721,7 +721,8 @@ $result = $componentsController->readComponent( "downgrade_credit": null, "created_at": "2019-08-02T05:54:53-04:00", "default_price_point_name": "Original", - "product_family_name": "Chargify" + "product_family_name": "Chargify", + "product_family_handle": "chargify" } } ``` @@ -746,7 +747,7 @@ function updateProductFamilyComponent( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `productFamilyId` | `int` | Template, Required | The Advanced Billing id of the product family to which the component belongs | -| `componentId` | `string` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`
**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | +| `componentId` | `string` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`

**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | | `body` | [`?UpdateComponentRequest`](../../doc/models/update-component-request.md) | Body, Optional | - | ## Response Type @@ -823,7 +824,7 @@ function archiveComponent(int $productFamilyId, string $componentId): Component | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `productFamilyId` | `int` | Template, Required | The Advanced Billing id of the product family to which the component belongs | -| `componentId` | `string` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`
**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | +| `componentId` | `string` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`

**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | ## Response Type @@ -893,8 +894,8 @@ function listComponents(array $options): array | `startDatetime` | `?string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `endDatetime` | `?string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional | | `includeArchived` | `?bool` | Query, Optional | Include archived items | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`?ListComponentsFilter`](../../doc/models/list-components-filter.md) | Query, Optional | Filter to use for List Components operations | ## Response Type @@ -960,6 +961,7 @@ $result = $componentsController->listComponents($collect); "created_at": "2019-08-01T09:35:38-04:00", "default_price_point_name": "Original", "product_family_name": "Chargify", + "product_family_handle": "chargify", "use_site_exchange_rate": true } }, @@ -986,6 +988,7 @@ $result = $componentsController->listComponents($collect); "created_at": "2019-08-01T09:35:37-04:00", "default_price_point_name": "Original", "product_family_name": "Chargify", + "product_family_handle": "chargify", "use_site_exchange_rate": true } }, @@ -1012,6 +1015,7 @@ $result = $componentsController->listComponents($collect); "created_at": "2019-08-01T09:35:38-04:00", "default_price_point_name": "Original", "product_family_name": "Chargify", + "product_family_handle": "chargify", "use_site_exchange_rate": true } } @@ -1108,8 +1112,8 @@ function listComponentsForProductFamily(array $options): array | --- | --- | --- | --- | | `productFamilyId` | `int` | Template, Required | The Advanced Billing id of the product family | | `includeArchived` | `?bool` | Query, Optional | Include archived items. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`?ListComponentsFilter`](../../doc/models/list-components-filter.md) | Query, Optional | Filter to use for List Components operations | | `dateField` | [`?string(BasicDateField)`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=created_at`. | | `endDate` | `?string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 3727e2e6..de77b2ac 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -123,8 +123,8 @@ function listCouponsForProductFamily(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `productFamilyId` | `int` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `30`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | | `filter` | [`?ListCouponsFilter`](../../doc/models/list-coupons-filter.md) | Query, Optional | Filter to use for List Coupons operations | | `currencyPrices` | `?bool` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. Use in query `currency_prices=true`. | @@ -549,8 +549,8 @@ function listCoupons(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `30`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | | `filter` | [`?ListCouponsFilter`](../../doc/models/list-coupons-filter.md) | Query, Optional | Filter to use for List Coupons operations | | `currencyPrices` | `?bool` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. Use in query `currency_prices=true`. | @@ -948,8 +948,8 @@ function listCouponSubcodes(array $options): CouponSubcodes | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `couponId` | `int` | Template, Required | The Advanced Billing id of the coupon | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type diff --git a/doc/controllers/custom-fields.md b/doc/controllers/custom-fields.md index 0ff072f9..2be11983 100644 --- a/doc/controllers/custom-fields.md +++ b/doc/controllers/custom-fields.md @@ -42,7 +42,7 @@ Each site is limited to 100 unique Metafields (i.e. keys, or names) per resource ### Metafields "On-the-Fly" -It is possible to create Metafields “on the fly” when you create your Metadata – if a non-existant name is passed when creating Metadata, a Metafield for that key will be automatically created. The Metafield API, however, gives you more control over your “keys”. +It is possible to create Metafields “on the fly” when you create your Metadata – if a non-existent name is passed when creating Metadata, a Metafield for that key will be automatically created. The Metafield API, however, gives you more control over your “keys”. ### Metafield Scope Warning @@ -145,8 +145,8 @@ function listMetafields(array $options): ListMetafieldsResponse | --- | --- | --- | --- | | `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | | `name` | `?string` | Query, Optional | filter by the name of the metafield | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`?string(SortingDirection)`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | ## Response Type @@ -357,8 +357,8 @@ function listMetadata(array $options): PaginatedMetadata | --- | --- | --- | --- | | `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | | `resourceId` | `int` | Template, Required | The Advanced Billing id of the customer or the subscription for which the metadata applies | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type @@ -506,15 +506,15 @@ function listMetadataForResourceType(array $options): PaginatedMetadata | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `dateField` | [`?string(BasicDateField)`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | | `startDate` | `?DateTime` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `endDate` | `?DateTime` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | | `startDatetime` | `?DateTime` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `endDatetime` | `?DateTime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | | `withDeleted` | `?bool` | Query, Optional | Allow to fetch deleted metadata. | -| `resourceIds` | `?(int[])` | Query, Optional | Allow to fetch metadata for multiple records based on provided ids. Use in query: `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`.
**Constraints**: *Maximum Items*: `50` | +| `resourceIds` | `?(int[])` | Query, Optional | Allow to fetch metadata for multiple records based on provided ids. Use in query: `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`.

**Constraints**: *Maximum Items*: `50` | | `direction` | [`?string(SortingDirection)`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | ## Response Type diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index 8c12c959..4ac36506 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -155,8 +155,8 @@ function listCustomers(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `direction` | [`?string(SortingDirection)`](../../doc/models/sorting-direction.md) | Query, Optional | Direction to sort customers by time of creation | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 50. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `50`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 50. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `50`

**Constraints**: `<= 200` | | `dateField` | [`?string(BasicDateField)`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `date_field=created_at`. | | `startDate` | `?string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `endDate` | `?string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index f529019a..000e99eb 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -112,8 +112,8 @@ function listSegmentsForPricePoint(array $options): ListSegmentsResponse | --- | --- | --- | --- | | `componentId` | `string` | Template, Required | ID or Handle for the Component | | `pricePointId` | `string` | Template, Required | ID or Handle for the Price Point belonging to the Component | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `30`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | | `filter` | [`?ListSegmentsFilter`](../../doc/models/list-segments-filter.md) | Query, Optional | Filter to use for List Segments for a Price Point operation | ## Response Type diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 6cc283a6..bfbcf1cf 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -94,11 +94,11 @@ function listEvents(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `sinceId` | `?int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `maxId` | `?int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `Direction::DESC` | +| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `Direction::DESC` | | `filter` | [`?(string(EventKey)[])`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | | `dateField` | [`?string(ListEventsDateField)`](../../doc/models/list-events-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | | `startDate` | `?string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | @@ -213,11 +213,11 @@ function listSubscriptionEvents(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `sinceId` | `?int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `maxId` | `?int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `Direction::DESC` | +| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `Direction::DESC` | | `filter` | [`?(string(EventKey)[])`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | ## Response Type @@ -297,11 +297,11 @@ function readEventsCount(array $options): CountResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `sinceId` | `?int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `maxId` | `?int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `Direction::DESC` | +| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `Direction::DESC` | | `filter` | [`?(string(EventKey)[])`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | ## Response Type diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index 33a62863..d19dd622 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -22,7 +22,7 @@ The Stats API is a very basic view of some Site-level stats. This API call only ## Stats Documentation -There currently is not a complimentary matching set of documentation that compliments this endpoint. However, each Site's dashboard will reflect the summary of information provided in the Stats reposnse. +There currently is not a complimentary matching set of documentation that compliments this endpoint. However, each Site's dashboard will reflect the summary of information provided in the Stats response. ``` https://subdomain.chargify.com/dashboard @@ -148,8 +148,8 @@ function listMrrMovements(array $options): ListMRRResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `?int` | Query, Optional | optionally filter results by subscription | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 50; any per_page value over 50 will be changed to 50.
Use in query `per_page=20`.
**Default**: `10`
**Constraints**: `<= 50` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 50; any per_page value over 50 will be changed to 50.
Use in query `per_page=20`.

**Default**: `10`

**Constraints**: `<= 50` | | `direction` | [`?string(SortingDirection)`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | ## Response Type @@ -236,8 +236,8 @@ function listMrrPerSubscription(array $options): SubscriptionMRRResponse | --- | --- | --- | --- | | `filter` | [`?ListMrrFilter`](../../doc/models/list-mrr-filter.md) | Query, Optional | Filter to use for List MRR per subscription operation | | `atTime` | `?string` | Query, Optional | Submit a timestamp in ISO8601 format to request MRR for a historic time. Use in query: `at_time=2022-01-10T10:00:00-05:00`. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | Controls the order in which results are returned. Records are ordered by subscription_id in ascending order by default. Use in query `direction=desc`. | ## Response Type diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 7f52b15c..874c47a7 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -101,23 +101,24 @@ function listInvoices(array $options): ListInvoicesResponse | `status` | [`?string(InvoiceStatus)`](../../doc/models/invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | | `subscriptionId` | `?int` | Query, Optional | The subscription's ID. | | `subscriptionGroupUid` | `?string` | Query, Optional | The UID of the subscription group you want to fetch consolidated invoices for. This will return a paginated list of consolidated invoices for the specified group. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.
**Default**: `Direction::DESC` | -| `lineItems` | `?bool` | Query, Optional | Include line items data
**Default**: `false` | -| `discounts` | `?bool` | Query, Optional | Include discounts data
**Default**: `false` | -| `taxes` | `?bool` | Query, Optional | Include taxes data
**Default**: `false` | -| `credits` | `?bool` | Query, Optional | Include credits data
**Default**: `false` | -| `payments` | `?bool` | Query, Optional | Include payments data
**Default**: `false` | -| `customFields` | `?bool` | Query, Optional | Include custom fields data
**Default**: `false` | -| `refunds` | `?bool` | Query, Optional | Include refunds data
**Default**: `false` | -| `dateField` | [`?string(InvoiceDateField)`](../../doc/models/invoice-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.
**Default**: `InvoiceDateField::DUE_DATE` | +| `consolidationLevel` | `?string` | Query, Optional | The consolidation level of the invoice. Allowed Values: none, parent, child or comma-separated lists of thereof, e.g. none,parent. | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `Direction::DESC` | +| `lineItems` | `?bool` | Query, Optional | Include line items data

**Default**: `false` | +| `discounts` | `?bool` | Query, Optional | Include discounts data

**Default**: `false` | +| `taxes` | `?bool` | Query, Optional | Include taxes data

**Default**: `false` | +| `credits` | `?bool` | Query, Optional | Include credits data

**Default**: `false` | +| `payments` | `?bool` | Query, Optional | Include payments data

**Default**: `false` | +| `customFields` | `?bool` | Query, Optional | Include custom fields data

**Default**: `false` | +| `refunds` | `?bool` | Query, Optional | Include refunds data

**Default**: `false` | +| `dateField` | [`?string(InvoiceDateField)`](../../doc/models/invoice-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.

**Default**: `InvoiceDateField::DUE_DATE` | | `startDatetime` | `?string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Allowed to be used only along with date_field set to created_at or updated_at. | | `endDatetime` | `?string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Allowed to be used only along with date_field set to created_at or updated_at. | | `customerIds` | `?(int[])` | Query, Optional | Allows fetching invoices with matching customer id based on provided values. Use in query `customer_ids=1,2,3`. | | `number` | `?(string[])` | Query, Optional | Allows fetching invoices with matching invoice number based on provided values. Use in query `number=1234,1235`. | | `productIds` | `?(int[])` | Query, Optional | Allows fetching invoices with matching line items product ids based on provided values. Use in query `product_ids=23,34`. | -| `sort` | [`?string(InvoiceSortField)`](../../doc/models/invoice-sort-field.md) | Query, Optional | Allows specification of the order of the returned list. Use in query `sort=total_amount`.
**Default**: `InvoiceSortField::NUMBER` | +| `sort` | [`?string(InvoiceSortField)`](../../doc/models/invoice-sort-field.md) | Query, Optional | Allows specification of the order of the returned list. Use in query `sort=total_amount`.

**Default**: `InvoiceSortField::NUMBER` | ## Response Type @@ -571,7 +572,8 @@ $result = $invoicesController->readInvoice($uid); "type": "credit_card" }, "transaction_id": 253028955, - "prepayment": false + "prepayment": false, + "received_on": "2018-07-26" } ], "public_url": "https://www.chargifypay.com/invoice/inv_8jzrw74xq8kxr?token=fb6kpjz5rcr2vttyjs4rcv6y" @@ -616,8 +618,8 @@ function listInvoiceEvents(array $options): ListInvoiceEventsResponse | --- | --- | --- | --- | | `sinceDate` | `?string` | Query, Optional | The timestamp in a format `YYYY-MM-DD T HH:MM:SS Z`, or `YYYY-MM-DD`(in this case, it returns data from the beginning of the day). of the event from which you want to start the search. All the events before the `since_date` timestamp are not returned in the response. | | `sinceId` | `?int` | Query, Optional | The ID of the event from which you want to start the search(ID is not included. e.g. if ID is set to 2, then all events with ID 3 and more will be shown) This parameter is not used if since_date is defined. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
**Default**: `100` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.

**Default**: `100` | | `invoiceUid` | `?string` | Query, Optional | Providing an invoice_uid allows for scoping of the invoice events to a single invoice or credit note. | | `withChangeInvoiceStatus` | `?string` | Query, Optional | Use this parameter if you want to fetch also invoice events with change_invoice_status type. | | `eventTypes` | [`?(string(InvoiceEventType)[])`](../../doc/models/invoice-event-type.md) | Query, Optional | Filter results by event_type. Supply a comma separated list of event types (listed above). Use in query: `event_types=void_invoice,void_remainder`. | @@ -1023,51 +1025,7 @@ $result = $invoicesController->listInvoiceEvents($collect); # Record Payment for Invoice -This API call should be used when you want to record a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment endpoint. - -## Create a Payment from the existing payment profile - -In order to apply a payment to an invoice using an existing payment profile, specify `type` as `payment`, the amount less than the invoice total, and the customer's `payment_profile_id`. The ID of a payment profile might be retrieved via the Payment Profiles API endpoint. - -``` -{ - "type": "payment", - "payment": { - "amount": 10.00, - "payment_profile_id": 123 - } -} -``` - -## Create a Payment from the Subscription's Prepayment Account - -In order apply a prepayment to an invoice, specify the `type` as `prepayment`, and also the `amount`. - -``` -{ - "type": "prepayment", - "payment": { - "amount": 10.00 - } -} -``` - -Note that the `amount` must be less than or equal to the Subscription's Prepayment account balance. - -## Create a Payment from the Subscription's Service Credit Account - -In order to apply a service credit to an invoice, specify the `type` as `service_credit`, and also the `amount`: - -``` -{ - "type": "service_credit", - "payment": { - "amount": 10.00 - } -} -``` - -Note that Advanced Billing will attempt to fully pay the invoice's `due_amount` from the Subscription's Service Credit account. At this time, partial payments from a Service Credit Account are only allowed for consolidated invoices (subscription groups). Therefore, for normal invoices the Service Credit account balance must be greater than or equal to the invoice's `due_amount`. +Applies a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment endpoint. ```php function recordPaymentForInvoice(string $uid, ?CreateInvoicePaymentRequest $body = null): Invoice @@ -1230,13 +1188,13 @@ function listCreditNotes(array $options): ListCreditNotesResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `?int` | Query, Optional | The subscription's Advanced Billing id | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `lineItems` | `?bool` | Query, Optional | Include line items data
**Default**: `false` | -| `discounts` | `?bool` | Query, Optional | Include discounts data
**Default**: `false` | -| `taxes` | `?bool` | Query, Optional | Include taxes data
**Default**: `false` | -| `refunds` | `?bool` | Query, Optional | Include refunds data
**Default**: `false` | -| `applications` | `?bool` | Query, Optional | Include applications data
**Default**: `false` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `lineItems` | `?bool` | Query, Optional | Include line items data

**Default**: `false` | +| `discounts` | `?bool` | Query, Optional | Include discounts data

**Default**: `false` | +| `taxes` | `?bool` | Query, Optional | Include taxes data

**Default**: `false` | +| `refunds` | `?bool` | Query, Optional | Include refunds data

**Default**: `false` | +| `applications` | `?bool` | Query, Optional | Include applications data

**Default**: `false` | ## Response Type @@ -2075,9 +2033,9 @@ function listConsolidatedInvoiceSegments(array $options): ConsolidatedInvoice | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `invoiceUid` | `string` | Template, Required | The unique identifier of the consolidated invoice | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | Sort direction of the returned segments.
**Default**: `Direction::ASC` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | Sort direction of the returned segments.

**Default**: `Direction::ASC` | ## Response Type diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index 2ef3d538..e5514721 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -138,8 +138,8 @@ function listOffers(array $options): ListOffersResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `includeArchived` | `?bool` | Query, Optional | Include archived products. Use in query: `include_archived=true`. | ## Response Type diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index dc8dd229..336ca1b8 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -380,8 +380,8 @@ function listPaymentProfiles(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `customerId` | `?int` | Query, Optional | The ID of the customer for which you wish to list payment profiles | ## Response Type @@ -408,6 +408,8 @@ $result = $paymentProfilesController->listPaymentProfiles($collect); "id": 10089892, "first_name": "Chester", "last_name": "Tester", + "created_at": "2025-01-01T00:00:00-05:00", + "updated_at": "2025-01-01T00:00:00-05:00", "customer_id": 14543792, "current_vault": "bogus", "vault_token": "0011223344", @@ -434,6 +436,8 @@ $result = $paymentProfilesController->listPaymentProfiles($collect); "id": 10188522, "first_name": "Frankie", "last_name": "Tester", + "created_at": "2025-01-01T00:00:00-05:00", + "updated_at": "2025-01-01T00:00:00-05:00", "customer_id": 14543712, "current_vault": "bogus", "vault_token": "123456789", @@ -475,6 +479,8 @@ Example response for Bank Account: "id": 10089892, "first_name": "Chester", "last_name": "Tester", + "created_at": "2025-01-01T00:00:00-05:00", + "updated_at": "2025-01-01T00:00:00-05:00", "customer_id": 14543792, "current_vault": "bogus", "vault_token": "0011223344", @@ -531,6 +537,8 @@ $result = $paymentProfilesController->readPaymentProfile($paymentProfileId); "card_type": "bogus", "expiration_month": 1, "expiration_year": 2022, + "created_at": "2025-01-01T00:00:00-05:00", + "updated_at": "2025-01-01T00:00:00-05:00", "customer_id": 14543792, "current_vault": "bogus", "vault_token": "1", diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index 25b48fc3..3e3b8bf3 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -29,8 +29,8 @@ function listProductsForProductFamily(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `productFamilyId` | `string` | Template, Required | Either the product family's id or its handle prefixed with `handle:` | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `dateField` | [`?string(BasicDateField)`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `date_field=created_at`. | | `filter` | [`?ListProductsFilter`](../../doc/models/list-products-filter.md) | Query, Optional | Filter to use for List Products operations | | `startDate` | `?DateTime` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index fb8c1f58..3cbf4730 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -122,8 +122,8 @@ function listProductPricePoints(array $options): ListProductPricePointsResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `productId` | int\|string | Template, Required | This is a container for one-of cases. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
**Default**: `10`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.

**Default**: `10`

**Constraints**: `<= 200` | | `currencyPrices` | `?bool` | Query, Optional | When fetching a product's price points, if you have defined multiple currencies at the site level, you can optionally pass the ?currency_prices=true query param to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | | `filterType` | [`?(string(PricePointType)[])`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | | `archived` | `?bool` | Query, Optional | Set to include archived price points in the response. | @@ -804,8 +804,8 @@ function listAllProductPricePoints(array $options): ListProductPricePointsRespon | `direction` | [`?string(SortingDirection)`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `filter` | [`?ListPricePointsFilter`](../../doc/models/list-price-points-filter.md) | Query, Optional | Filter to use for List PricePoints operations | | `mInclude` | [`?string(ListProductsPricePointsInclude)`](../../doc/models/list-products-price-points-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include=currency_prices`. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type diff --git a/doc/controllers/products.md b/doc/controllers/products.md index f5b0ae95..87ff08b1 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -474,8 +474,8 @@ function listProducts(array $options): array | `endDatetime` | `?DateTime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. | | `startDate` | `?DateTime` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `startDatetime` | `?DateTime` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `includeArchived` | `?bool` | Query, Optional | Include archived products. Use in query: `include_archived=true`. | | `mInclude` | [`?string(ListProductsInclude)`](../../doc/models/list-products-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index ff9c325b..703ac351 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -75,12 +75,12 @@ function listSubscriptionGroupProformaInvoices(array $options): ListProformaInvo | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `uid` | `string` | Template, Required | The uid of the subscription group | -| `lineItems` | `?bool` | Query, Optional | Include line items data
**Default**: `false` | -| `discounts` | `?bool` | Query, Optional | Include discounts data
**Default**: `false` | -| `taxes` | `?bool` | Query, Optional | Include taxes data
**Default**: `false` | -| `credits` | `?bool` | Query, Optional | Include credits data
**Default**: `false` | -| `payments` | `?bool` | Query, Optional | Include payments data
**Default**: `false` | -| `customFields` | `?bool` | Query, Optional | Include custom fields data
**Default**: `false` | +| `lineItems` | `?bool` | Query, Optional | Include line items data

**Default**: `false` | +| `discounts` | `?bool` | Query, Optional | Include discounts data

**Default**: `false` | +| `taxes` | `?bool` | Query, Optional | Include taxes data

**Default**: `false` | +| `credits` | `?bool` | Query, Optional | Include credits data

**Default**: `false` | +| `payments` | `?bool` | Query, Optional | Include payments data

**Default**: `false` | +| `customFields` | `?bool` | Query, Optional | Include custom fields data

**Default**: `false` | ## Response Type @@ -201,15 +201,15 @@ function listProformaInvoices(array $options): ListProformaInvoicesResponse | `startDate` | `?string` | Query, Optional | The beginning date range for the invoice's Due Date, in the YYYY-MM-DD format. | | `endDate` | `?string` | Query, Optional | The ending date range for the invoice's Due Date, in the YYYY-MM-DD format. | | `status` | [`?string(ProformaInvoiceStatus)`](../../doc/models/proforma-invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.
**Default**: `Direction::DESC` | -| `lineItems` | `?bool` | Query, Optional | Include line items data
**Default**: `false` | -| `discounts` | `?bool` | Query, Optional | Include discounts data
**Default**: `false` | -| `taxes` | `?bool` | Query, Optional | Include taxes data
**Default**: `false` | -| `credits` | `?bool` | Query, Optional | Include credits data
**Default**: `false` | -| `payments` | `?bool` | Query, Optional | Include payments data
**Default**: `false` | -| `customFields` | `?bool` | Query, Optional | Include custom fields data
**Default**: `false` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `direction` | [`?string(Direction)`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `Direction::DESC` | +| `lineItems` | `?bool` | Query, Optional | Include line items data

**Default**: `false` | +| `discounts` | `?bool` | Query, Optional | Include discounts data

**Default**: `false` | +| `taxes` | `?bool` | Query, Optional | Include taxes data

**Default**: `false` | +| `credits` | `?bool` | Query, Optional | Include credits data

**Default**: `false` | +| `payments` | `?bool` | Query, Optional | Include payments data

**Default**: `false` | +| `customFields` | `?bool` | Query, Optional | Include custom fields data

**Default**: `false` | ## Response Type diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index 6fb5be69..22d9272a 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -21,7 +21,7 @@ $reasonCodesController = $client->getReasonCodesController(); # Reason Codes Intro -ReasonCodes are a way to gain a high level view of why your customers are cancelling the subcription to your product or service. +ReasonCodes are a way to gain a high level view of why your customers are cancelling the subscription to your product or service. Add a set of churn reason codes to be displayed in-app and/or the Maxio Billing Portal. As your subscribers decide to cancel their subscription, learn why they decided to cancel. @@ -83,8 +83,8 @@ function listReasonCodes(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type @@ -121,7 +121,7 @@ $result = $reasonCodesController->listReasonCodes($collect); "id": 1, "site_id": 2, "code": "CH1", - "description": "This doesnt meet my needs", + "description": "This does not meet my needs", "position": 2, "created_at": "2017-02-16T16:48:45-05:00", "updated_at": "2017-02-17T16:29:59-05:00" @@ -218,7 +218,7 @@ $result = $reasonCodesController->updateReasonCode($reasonCodeId); # Delete Reason Code -This method gives a merchant the option to delete one reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversable. +This method gives a merchant the option to delete one reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversible. ```php function deleteReasonCode(int $reasonCodeId): OkResponse diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index b0c19b22..83d4b39e 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -36,10 +36,10 @@ function listSalesCommissionSettings(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `sellerId` | `string` | Template, Required | The Chargify id of your seller account | -| `authorization` | `?string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
**Default**: `'Bearer <>'` | +| `authorization` | `?string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `'Bearer <>'` | | `liveMode` | `?bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.
**Default**: `100` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.

**Default**: `100` | ## Response Type @@ -114,10 +114,10 @@ function listSalesReps(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `sellerId` | `string` | Template, Required | The Chargify id of your seller account | -| `authorization` | `?string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
**Default**: `'Bearer <>'` | +| `authorization` | `?string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `'Bearer <>'` | | `liveMode` | `?bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.
**Default**: `100` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.

**Default**: `100` | ## Response Type @@ -249,10 +249,10 @@ function readSalesRep( | --- | --- | --- | --- | | `sellerId` | `string` | Template, Required | The Chargify id of your seller account | | `salesRepId` | `string` | Template, Required | The Advanced Billing id of sales rep. | -| `authorization` | `?string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
**Default**: `'Bearer <>'` | +| `authorization` | `?string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `'Bearer <>'` | | `liveMode` | `?bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.
**Default**: `100` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.

**Default**: `100` | ## Response Type diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index 7f25dfdd..c81c87b5 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -114,7 +114,7 @@ function clearSite(?string $cleanupScope = CleanupScope::ALL): void | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `cleanupScope` | [`?string(CleanupScope)`](../../doc/models/cleanup-scope.md) | Query, Optional | `all`: Will clear all products, customers, and related subscriptions from the site.
`customers`: Will clear only customers and related subscriptions (leaving the products untouched) for the site.
Revenue will also be reset to 0.
Use in query `cleanup_scope=all`.
**Default**: `CleanupScope::ALL` | +| `cleanupScope` | [`?string(CleanupScope)`](../../doc/models/cleanup-scope.md) | Query, Optional | `all`: Will clear all products, customers, and related subscriptions from the site.
`customers`: Will clear only customers and related subscriptions (leaving the products untouched) for the site.
Revenue will also be reset to 0.
Use in query `cleanup_scope=all`.

**Default**: `CleanupScope::ALL` | ## Response Type @@ -141,8 +141,8 @@ function listChargifyJsPublicKeys(array $options): ListPublicKeysResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index a73d9410..76592cb8 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -561,7 +561,7 @@ function listAllocations(int $subscriptionId, int $componentId, ?int $page = 1): | --- | --- | --- | --- | | `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | | `componentId` | `int` | Template, Required | The Advanced Billing id of the component | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | ## Response Type @@ -1194,8 +1194,8 @@ function listUsages(array $options): array | `maxId` | `?int` | Query, Optional | Returns usages with an id less than or equal to the one specified | | `sinceDate` | `?DateTime` | Query, Optional | Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified. | | `untilDate` | `?DateTime` | Query, Optional | Returns usages with a created_at date less than or equal to midnight (12:00 AM) on the date specified. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type @@ -1468,8 +1468,8 @@ function listSubscriptionComponentsForSite(array $options): ListSubscriptionComp | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `sort` | [`?string(ListSubscriptionComponentsSort)`](../../doc/models/list-subscription-components-sort.md) | Query, Optional | The attribute by which to sort. Use in query: `sort=updated_at`. | | `direction` | [`?string(SortingDirection)`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `filter` | [`?ListSubscriptionComponentsForSiteFilter`](../../doc/models/list-subscription-components-for-site-filter.md) | Query, Optional | Filter to use for List Subscription Components For Site operation | @@ -1478,7 +1478,7 @@ function listSubscriptionComponentsForSite(array $options): ListSubscriptionComp | `startDatetime` | `?string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `start_datetime=2022-07-01 09:00:05`. | | `endDate` | `?string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `end_date=2011-12-16`. | | `endDatetime` | `?string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-07-01 09:00:05`. | -| `subscriptionIds` | `?(int[])` | Query, Optional | Allows fetching components allocation with matching subscription id based on provided ids. Use in query `subscription_ids=1,2,3`.
**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `200` | +| `subscriptionIds` | `?(int[])` | Query, Optional | Allows fetching components allocation with matching subscription id based on provided ids. Use in query `subscription_ids=1,2,3`.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `200` | | `pricePointIds` | [`?string(IncludeNotNull)`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching components allocation only if price point id is present. Use in query `price_point_ids=not_null`. | | `productFamilyIds` | `?(int[])` | Query, Optional | Allows fetching components allocation with matching product family id based on provided ids. Use in query `product_family_ids=1,2,3`. | | `mInclude` | [`?string(ListSubscriptionComponentsInclude)`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription,historic_usages`. | diff --git a/doc/controllers/subscription-group-invoice-account.md b/doc/controllers/subscription-group-invoice-account.md index cf1f9a46..50026556 100644 --- a/doc/controllers/subscription-group-invoice-account.md +++ b/doc/controllers/subscription-group-invoice-account.md @@ -78,8 +78,8 @@ function listPrepaymentsForSubscriptionGroup(array $options): ListSubscriptionGr | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `uid` | `string` | Template, Required | The uid of the subscription group | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`?ListPrepaymentsFilter`](../../doc/models/list-prepayments-filter.md) | Query, Optional | Filter to use for List Prepayments operations | ## Response Type diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 5e8cd163..d0b87736 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -165,8 +165,8 @@ function listSubscriptionGroups(array $options): ListSubscriptionGroupsResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `mInclude` | [`?(string(SubscriptionGroupsListInclude)[])`](../../doc/models/subscription-groups-list-include.md) | Query, Optional | A list of additional information to include in the response. The following values are supported:

- `account_balances`: Account balance information for the subscription groups. Use in query: `include[]=account_balances` | ## Response Type diff --git a/doc/controllers/subscription-invoice-account.md b/doc/controllers/subscription-invoice-account.md index e6c4a475..45986969 100644 --- a/doc/controllers/subscription-invoice-account.md +++ b/doc/controllers/subscription-invoice-account.md @@ -15,6 +15,7 @@ $subscriptionInvoiceAccountController = $client->getSubscriptionInvoiceAccountCo * [List Prepayments](../../doc/controllers/subscription-invoice-account.md#list-prepayments) * [Issue Service Credit](../../doc/controllers/subscription-invoice-account.md#issue-service-credit) * [Deduct Service Credit](../../doc/controllers/subscription-invoice-account.md#deduct-service-credit) +* [List Service Credits](../../doc/controllers/subscription-invoice-account.md#list-service-credits) * [Refund Prepayment](../../doc/controllers/subscription-invoice-account.md#refund-prepayment) @@ -126,8 +127,8 @@ function listPrepayments(array $options): PrepaymentsResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`?ListPrepaymentsFilter`](../../doc/models/list-prepayments-filter.md) | Query, Optional | Filter to use for List Prepayments operations | ## Response Type @@ -279,6 +280,85 @@ $subscriptionInvoiceAccountController->deductServiceCredit( | 422 | Unprocessable Entity (WebDAV) | `ApiException` | +# List Service Credits + +This request will list a subscription's service credits. + +```php +function listServiceCredits( + int $subscriptionId, + ?int $page = 1, + ?int $perPage = 20, + ?string $direction = null +): ListServiceCreditsResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `direction` | [`?string(SortingDirection)`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | + +## Response Type + +[`ListServiceCreditsResponse`](../../doc/models/list-service-credits-response.md) + +## Example Usage + +```php +$subscriptionId = 222; + +$page = 2; + +$perPage = 50; + +$result = $subscriptionInvoiceAccountController->listServiceCredits( + $subscriptionId, + $page, + $perPage +); +``` + +## Example Response *(as JSON)* + +```json +{ + "service_credits": [ + { + "id": 68, + "amount_in_cents": 2200, + "ending_balance_in_cents": 1100, + "entry_type": "Debit", + "memo": "Service credit memo", + "invoice_uid": "inv_brntdvmmqxc3j", + "remaining_balance_in_cents": 1100, + "created_at": "2025-04-01T09:54:49-04:00" + }, + { + "id": 67, + "amount_in_cents": 3300, + "ending_balance_in_cents": 3300, + "entry_type": "Credit", + "memo": "Service credit memo", + "invoice_uid": null, + "remaining_balance_in_cents": 1100, + "created_at": "2025-03-05T16:06:08-05:00" + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiException` | +| 422 | Unprocessable Entity | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + # Refund Prepayment This endpoint will refund, completely or partially, a particular prepayment applied to a subscription. The `prepayment_id` will be the account transaction ID of the original payment. The prepayment must have some amount remaining in order to be refunded. diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index fd046a1c..c03cb476 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -85,8 +85,8 @@ function listSubscriptionNotes(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 236219ea..c6a7020d 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -386,7 +386,7 @@ function resumeSubscription( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `calendarBillingResumptionCharge` | [`?string(ResumptionCharge)`](../../doc/models/resumption-charge.md) | Query, Optional | (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled
**Default**: `ResumptionCharge::PRORATED` | +| `calendarBillingResumptionCharge` | [`?string(ResumptionCharge)`](../../doc/models/resumption-charge.md) | Query, Optional | (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled

**Default**: `ResumptionCharge::PRORATED` | ## Response Type @@ -397,7 +397,7 @@ function resumeSubscription( ```php $subscriptionId = 222; -Liquid error: Value cannot be null. (Parameter 'key')$result = Liquid error: Value cannot be null. (Parameter 'key')$subscriptionStatusController->resumeSubscription($subscriptionId); +Liquid error: Value cannot be null. (Parameter 'key')$result = $subscriptionStatusController->resumeSubscription(Liquid error: Value cannot be null. (Parameter 'key')$subscriptionId); ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index aa6e743a..98bcdb38 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -164,42 +164,6 @@ If you already have a customer and card stored in your payment gateway, you may } ``` -## Subscription with Credit Card - -```json -"subscription": { - "product_handle": "basic", - "customer_attributes": { - "first_name": "Joe", - "last_name": "Blow", - "email": "joe@example.com", - "zip": "02120", - "state": "MA", - "reference": "XYZ", - "phone": "(617) 111 - 0000", - "organization": "Acme", - "country": "US", - "city": "Boston", - "address_2": null, - "address": "123 Mass Ave." - }, - "credit_card_attributes": { - "last_name": "Smith", - "first_name": "Joe", - "full_number": "4111111111111111", - "expiration_year": "2021", - "expiration_month": "1", - "card_type": "visa", - "billing_zip": "02120", - "billing_state": "MA", - "billing_country": "US", - "billing_city": "Boston", - "billing_address_2": null, - "billing_address": "123 Mass Ave." - } -} -``` - ## Subscription with ACH as Payment Profile ```json @@ -890,12 +854,13 @@ function listSubscriptions(array $options): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `state` | [`?string(SubscriptionStateFilter)`](../../doc/models/subscription-state-filter.md) | Query, Optional | The current state of the subscription | | `product` | `?int` | Query, Optional | The product id of the subscription. (Note that the product handle cannot be used.) | | `productPricePointId` | `?int` | Query, Optional | The ID of the product price point. If supplied, product is required | | `coupon` | `?int` | Query, Optional | The numeric id of the coupon currently applied to the subscription. (This can be found in the URL when editing a coupon. Note that the coupon code cannot be used.) | +| `couponCode` | `?string` | Query, Optional | The coupon code currently applied to the subscription | | `dateField` | [`?string(SubscriptionDateField)`](../../doc/models/subscription-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. Allowed Values: , current_period_ends_at, current_period_starts_at, created_at, activated_at, canceled_at, expires_at, trial_started_at, trial_ended_at, updated_at | | `startDate` | `?DateTime` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. Use in query `start_date=2022-07-01`. | | `endDate` | `?DateTime` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `end_date=2022-08-01`. | @@ -903,7 +868,7 @@ function listSubscriptions(array $options): array | `endDatetime` | `?DateTime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns subscriptions with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-08-01 10:00:05`. | | `metadata` | `?array` | Query, Optional | The value of the metadata field specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value`. | | `direction` | [`?string(SortingDirection)`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `sort` | [`?string(SubscriptionSort)`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort
**Default**: `SubscriptionSort::SIGNUP_DATE` | +| `sort` | [`?string(SubscriptionSort)`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort

**Default**: `SubscriptionSort::SIGNUP_DATE` | | `mInclude` | [`?(string(SubscriptionListInclude)[])`](../../doc/models/subscription-list-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include[]=self_service_page_token`. | ## Response Type @@ -996,14 +961,8 @@ $subscriptionId = 222; $body = UpdateSubscriptionRequestBuilder::init( UpdateSubscriptionBuilder::init() - ->creditCardAttributes( - CreditCardAttributesBuilder::init() - ->fullNumber('4111111111111111') - ->expirationMonth('10') - ->expirationYear('2030') - ->build() - ) ->nextBillingAt(DateTimeHelper::fromRfc3339DateTime('2010-08-06T15:34:00Z')) + ->paymentCollectionMethod('remittance') ->build() )->build(); @@ -1525,11 +1484,11 @@ $result = $subscriptionsController->updatePrepaidSubscriptionConfiguration( The Chargify API allows you to preview a subscription by POSTing the same JSON or XML as for a subscription creation. -The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. For more information, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). +The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. -## Side effects +A subscription will not be created by utilizing this endpoint; it is meant to serve as a prediction. -A subscription will not be created by sending a POST to this endpoint. It is meant to serve as a prediction. +For more information, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Taxable Subscriptions diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index 052444f3..48f66a19 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -46,8 +46,8 @@ function listWebhooks(array $options): array | `status` | [`?string(WebhookStatus)`](../../doc/models/webhook-status.md) | Query, Optional | Webhooks with matching status would be returned. | | `sinceDate` | `?string` | Query, Optional | Format YYYY-MM-DD. Returns Webhooks with the created_at date greater than or equal to the one specified. | | `untilDate` | `?string` | Query, Optional | Format YYYY-MM-DD. Returns Webhooks with the created_at date less than or equal to the one specified. | -| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `?int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `perPage` | `?int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `order` | [`?string(WebhookOrder)`](../../doc/models/webhook-order.md) | Query, Optional | The order in which the Webhooks are returned. | | `subscription` | `?int` | Query, Optional | The Advanced Billing id of a subscription you'd like to filter for | diff --git a/doc/http-request.md b/doc/http-request.md index 065d652b..b2849484 100644 --- a/doc/http-request.md +++ b/doc/http-request.md @@ -7,8 +7,8 @@ Represents a single Http Request. | Name | Type | Description | | --- | --- | --- | -| getHttpMethod() | string | The HTTP method of the request. | -| getQueryUrl() | string | The endpoint URL for the API request. | -| getHeaders() | array | Request headers. | -| getParameters() | array | Input parameters for the body. | +| `getHttpMethod()` | `string` | The HTTP method of the request. | +| `getQueryUrl()` | `string` | The endpoint URL for the API request. | +| `getHeaders()` | `array` | Request headers. | +| `getParameters()` | `array` | Input parameters for the body. | diff --git a/doc/http-response.md b/doc/http-response.md index e7bdfc98..32f858c0 100644 --- a/doc/http-response.md +++ b/doc/http-response.md @@ -1,13 +1,13 @@ # HttpResponse -Http response received. +Represents a single Http Response. ## Methods | Name | Type | Description | | --- | --- | --- | -| getStatusCode() | int | The status code of the response. | -| getHeaders() | array | Response headers. | -| getRawBody() | string | Raw body of the response. | +| `getStatusCode()` | `int` | The status code of the response. | +| `getHeaders()` | `array` | Response headers. | +| `getRawBody()` | `string` | Raw body of the response. | diff --git a/doc/models/apple-pay-payment-profile.md b/doc/models/apple-pay-payment-profile.md index 683ebd13..61820fb0 100644 --- a/doc/models/apple-pay-payment-profile.md +++ b/doc/models/apple-pay-payment-profile.md @@ -25,6 +25,8 @@ | `paymentType` | [`string(PaymentType)`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType::APPLE_PAY` | getPaymentType(): string | setPaymentType(string paymentType): void | | `siteGatewaySettingId` | `?int` | Optional | - | getSiteGatewaySettingId(): ?int | setSiteGatewaySettingId(?int siteGatewaySettingId): void | | `gatewayHandle` | `?string` | Optional | - | getGatewayHandle(): ?string | setGatewayHandle(?string gatewayHandle): void | +| `createdAt` | `?DateTime` | Optional | A timestamp indicating when this payment profile was created | getCreatedAt(): ?\DateTime | setCreatedAt(?\DateTime createdAt): void | +| `updatedAt` | `?DateTime` | Optional | A timestamp indicating when this payment profile was last updated | getUpdatedAt(): ?\DateTime | setUpdatedAt(?\DateTime updatedAt): void | ## Example (as JSON) diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index 3e4fce3c..3d16f14d 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -28,9 +28,11 @@ | `bankAccountType` | [`?string(BankAccountType)`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | getBankAccountType(): ?string | setBankAccountType(?string bankAccountType): void | | `bankAccountHolderType` | [`?string(BankAccountHolderType)`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | getBankAccountHolderType(): ?string | setBankAccountHolderType(?string bankAccountHolderType): void | | `paymentType` | [`string(PaymentType)`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType::BANK_ACCOUNT` | getPaymentType(): string | setPaymentType(string paymentType): void | -| `verified` | `?bool` | Optional | denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account
**Default**: `false` | getVerified(): ?bool | setVerified(?bool verified): void | +| `verified` | `?bool` | Optional | denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account

**Default**: `false` | getVerified(): ?bool | setVerified(?bool verified): void | | `siteGatewaySettingId` | `?int` | Optional | - | getSiteGatewaySettingId(): ?int | setSiteGatewaySettingId(?int siteGatewaySettingId): void | | `gatewayHandle` | `?string` | Optional | - | getGatewayHandle(): ?string | setGatewayHandle(?string gatewayHandle): void | +| `createdAt` | `?DateTime` | Optional | A timestamp indicating when this payment profile was created | getCreatedAt(): ?\DateTime | setCreatedAt(?\DateTime createdAt): void | +| `updatedAt` | `?DateTime` | Optional | A timestamp indicating when this payment profile was last updated | getUpdatedAt(): ?\DateTime | setUpdatedAt(?\DateTime updatedAt): void | ## Example (as JSON) diff --git a/doc/models/chargify-ebb.md b/doc/models/chargify-ebb.md index 2a5d0465..611df3e0 100644 --- a/doc/models/chargify-ebb.md +++ b/doc/models/chargify-ebb.md @@ -12,7 +12,7 @@ | `timestamp` | `?DateTime` | Optional | This timestamp determines what billing period the event will be billed in. If your request payload does not include it, Chargify will add `chargify.timestamp` to the event payload and set the value to `now`. | getTimestamp(): ?\DateTime | setTimestamp(?\DateTime timestamp): void | | `id` | `?string` | Optional | A unique ID set by Chargify. Please note that this field is reserved. If `chargify.id` is present in the request payload, it will be overwritten. | getId(): ?string | setId(?string id): void | | `createdAt` | `?DateTime` | Optional | An ISO-8601 timestamp, set by Chargify at the time each event is recorded. Please note that this field is reserved. If `chargify.created_at` is present in the request payload, it will be overwritten. | getCreatedAt(): ?\DateTime | setCreatedAt(?\DateTime createdAt): void | -| `uniquenessToken` | `?string` | Optional | User-defined string scoped per-stream. Duplicate events within a stream will be silently ignored. Tokens expire after 31 days.
**Constraints**: *Maximum Length*: `64` | getUniquenessToken(): ?string | setUniquenessToken(?string uniquenessToken): void | +| `uniquenessToken` | `?string` | Optional | User-defined string scoped per-stream. Duplicate events within a stream will be silently ignored. Tokens expire after 31 days.

**Constraints**: *Maximum Length*: `64` | getUniquenessToken(): ?string | setUniquenessToken(?string uniquenessToken): void | | `subscriptionId` | `?int` | Optional | Id of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_id` if you configured `chargify.subscription_id` as Subscription Identifier in your Event Stream. | getSubscriptionId(): ?int | setSubscriptionId(?int subscriptionId): void | | `subscriptionReference` | `?string` | Optional | Reference of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_reference` if you configured `chargify.subscription_reference` as Subscription Identifier in your Event Stream. | getSubscriptionReference(): ?string | setSubscriptionReference(?string subscriptionReference): void | diff --git a/doc/models/component.md b/doc/models/component.md index 4b6b2c1a..3f93fd3f 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -17,6 +17,7 @@ | `unitPrice` | `?string` | Optional | The amount the customer will be charged per unit. This field is only populated for ‘per_unit’ pricing schemes, otherwise it may be null. | getUnitPrice(): ?string | setUnitPrice(?string unitPrice): void | | `productFamilyId` | `?int` | Optional | The id of the Product Family to which the Component belongs | getProductFamilyId(): ?int | setProductFamilyId(?int productFamilyId): void | | `productFamilyName` | `?string` | Optional | The name of the Product Family to which the Component belongs | getProductFamilyName(): ?string | setProductFamilyName(?string productFamilyName): void | +| `productFamilyHandle` | `?string` | Optional | The handle of the Product Family to which the Component belongs | getProductFamilyHandle(): ?string | setProductFamilyHandle(?string productFamilyHandle): void | | `pricePerUnitInCents` | `?int` | Optional | deprecated - use unit_price instead | getPricePerUnitInCents(): ?int | setPricePerUnitInCents(?int pricePerUnitInCents): void | | `kind` | [`?string(ComponentKind)`](../../doc/models/component-kind.md) | Optional | A handle for the component type | getKind(): ?string | setKind(?string kind): void | | `archived` | `?bool` | Optional | Boolean flag describing whether a component is archived or not. | getArchived(): ?bool | setArchived(?bool archived): void | diff --git a/doc/models/coupon-request.md b/doc/models/coupon-request.md index e1cf8961..4b293cc9 100644 --- a/doc/models/coupon-request.md +++ b/doc/models/coupon-request.md @@ -10,8 +10,8 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `coupon` | [`?CouponPayload`](../../doc/models/coupon-payload.md) | Optional | - | getCoupon(): ?CouponPayload | setCoupon(?CouponPayload coupon): void | -| `restrictedProducts` | `?array` | Optional | An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product | getRestrictedProducts(): ?array | setRestrictedProducts(?array restrictedProducts): void | -| `restrictedComponents` | `?array` | Optional | An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component | getRestrictedComponents(): ?array | setRestrictedComponents(?array restrictedComponents): void | +| `restrictedProducts` | `?array` | Optional | An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the product | getRestrictedProducts(): ?array | setRestrictedProducts(?array restrictedProducts): void | +| `restrictedComponents` | `?array` | Optional | An object where the keys are component IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the component | getRestrictedComponents(): ?array | setRestrictedComponents(?array restrictedComponents): void | ## Example (as JSON) diff --git a/doc/models/create-component-price-point.md b/doc/models/create-component-price-point.md index 71d2323f..be3119b7 100644 --- a/doc/models/create-component-price-point.md +++ b/doc/models/create-component-price-point.md @@ -13,7 +13,7 @@ | `handle` | `?string` | Optional | - | getHandle(): ?string | setHandle(?string handle): void | | `pricingScheme` | [`string(PricingScheme)`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | getPricingScheme(): string | setPricingScheme(string pricingScheme): void | | `prices` | [`Price[]`](../../doc/models/price.md) | Required | - | getPrices(): array | setPrices(array prices): void | -| `useSiteExchangeRate` | `?bool` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Setting not supported when creating price points in bulk.
**Default**: `true` | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | +| `useSiteExchangeRate` | `?bool` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Setting not supported when creating price points in bulk.

**Default**: `true` | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | | `taxIncluded` | `?bool` | Optional | Whether or not the price point includes tax. Setting not supported when creating price points in bulk. | getTaxIncluded(): ?bool | setTaxIncluded(?bool taxIncluded): void | | `interval` | `?int` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | getInterval(): ?int | setInterval(?int interval): void | | `intervalUnit` | [`?string(IntervalUnit)`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. | getIntervalUnit(): ?string | setIntervalUnit(?string intervalUnit): void | diff --git a/doc/models/create-or-update-product.md b/doc/models/create-or-update-product.md index 4412dfa2..4bdfd1d1 100644 --- a/doc/models/create-or-update-product.md +++ b/doc/models/create-or-update-product.md @@ -24,7 +24,7 @@ | `expirationInterval` | `?int` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. | getExpirationInterval(): ?int | setExpirationInterval(?int expirationInterval): void | | `expirationIntervalUnit` | [`?string(ExpirationIntervalUnit)`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product, either month, day or never | getExpirationIntervalUnit(): ?string | setExpirationIntervalUnit(?string expirationIntervalUnit): void | | `autoCreateSignupPage` | `?bool` | Optional | - | getAutoCreateSignupPage(): ?bool | setAutoCreateSignupPage(?bool autoCreateSignupPage): void | -| `taxCode` | `?string` | Optional | A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
**Constraints**: *Maximum Length*: `10` | getTaxCode(): ?string | setTaxCode(?string taxCode): void | +| `taxCode` | `?string` | Optional | A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.

**Constraints**: *Maximum Length*: `10` | getTaxCode(): ?string | setTaxCode(?string taxCode): void | ## Example (as JSON) diff --git a/doc/models/create-prepaid-usage-component-price-point.md b/doc/models/create-prepaid-usage-component-price-point.md index 075bbf37..98cf84bd 100644 --- a/doc/models/create-prepaid-usage-component-price-point.md +++ b/doc/models/create-prepaid-usage-component-price-point.md @@ -14,7 +14,7 @@ | `pricingScheme` | [`string(PricingScheme)`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | getPricingScheme(): string | setPricingScheme(string pricingScheme): void | | `prices` | [`Price[]`](../../doc/models/price.md) | Required | - | getPrices(): array | setPrices(array prices): void | | `overagePricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | getOveragePricing(): OveragePricing | setOveragePricing(OveragePricing overagePricing): void | -| `useSiteExchangeRate` | `?bool` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.
**Default**: `true` | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | +| `useSiteExchangeRate` | `?bool` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.

**Default**: `true` | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | | `rolloverPrepaidRemainder` | `?bool` | Optional | (only for prepaid usage components) Boolean which controls whether or not remaining units should be rolled over to the next period | getRolloverPrepaidRemainder(): ?bool | setRolloverPrepaidRemainder(?bool rolloverPrepaidRemainder): void | | `renewPrepaidAllocation` | `?bool` | Optional | (only for prepaid usage components) Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | getRenewPrepaidAllocation(): ?bool | setRenewPrepaidAllocation(?bool renewPrepaidAllocation): void | | `expirationInterval` | `?float` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire | getExpirationInterval(): ?float | setExpirationInterval(?float expirationInterval): void | diff --git a/doc/models/create-product-price-point.md b/doc/models/create-product-price-point.md index 495cb3a9..d9efc0f9 100644 --- a/doc/models/create-product-price-point.md +++ b/doc/models/create-product-price-point.md @@ -22,7 +22,7 @@ | `initialChargeAfterTrial` | `?bool` | Optional | - | getInitialChargeAfterTrial(): ?bool | setInitialChargeAfterTrial(?bool initialChargeAfterTrial): void | | `expirationInterval` | `?int` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | getExpirationInterval(): ?int | setExpirationInterval(?int expirationInterval): void | | `expirationIntervalUnit` | [`?string(ExpirationIntervalUnit)`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | getExpirationIntervalUnit(): ?string | setExpirationIntervalUnit(?string expirationIntervalUnit): void | -| `useSiteExchangeRate` | `?bool` | Optional | Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined.
**Default**: `true` | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | +| `useSiteExchangeRate` | `?bool` | Optional | Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined.

**Default**: `true` | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | ## Example (as JSON) diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index d6db5e61..d97191a6 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -16,6 +16,7 @@ ```json { "subscription": { + "defer_signup": false, "metafields": { "custom_field_name_1": "custom_field_value_1", "custom_field_name_2": "custom_field_value_2" diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index f6cbd146..a20e26b7 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -21,11 +21,12 @@ | `netTerms` | `?string` | Optional | (Optional) Default: null The number of days after renewal (on invoice billing) that a subscription is due. A value between 0 (due immediately) and 180. | getNetTerms(): ?string | setNetTerms(?string netTerms): void | | `customerId` | `?int` | Optional | The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. | getCustomerId(): ?int | setCustomerId(?int customerId): void | | `nextBillingAt` | `?DateTime` | Optional | (Optional) Set this attribute to a future date/time to sync imported subscriptions to your existing renewal schedule. See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format). If you provide a next_billing_at timestamp that is in the future, no trial or initial charges will be applied when you create the subscription. In fact, no payment will be captured at all. The first payment will be captured, according to the prices defined by the product, near the time specified by next_billing_at. If you do not provide a value for next_billing_at, any trial and/or initial charges will be assessed and charged at the time of subscription creation. If the card cannot be successfully charged, the subscription will not be created. See further notes in the section on Importing Subscriptions. | getNextBillingAt(): ?\DateTime | setNextBillingAt(?\DateTime nextBillingAt): void | -| `initialBillingAt` | `?DateTime` | Optional | (Optional) Set this attribute to a future date/time to create a subscription in the "Awaiting Signup" state, rather than "Active" or "Trialing". See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format). In the "Awaiting Signup" state, a subscription behaves like any other. It can be canceled, allocated to, had its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See further notes in the section on Delayed Signups. | getInitialBillingAt(): ?\DateTime | setInitialBillingAt(?\DateTime initialBillingAt): void | +| `initialBillingAt` | `?DateTime` | Optional | (Optional) Set this attribute to a future date/time to create a subscription in the Awaiting Signup state, rather than Active or Trialing. You can omit the initial_billing_at date to activate the subscription immediately. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time Formats. | getInitialBillingAt(): ?\DateTime | setInitialBillingAt(?\DateTime initialBillingAt): void | +| `deferSignup` | `?bool` | Optional | (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. Use this when you want to create a subscription that has an unknown first billing date. When the first billing date is known, update a subscription and set the `initial_billing_at` date. The subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | getDeferSignup(): ?bool | setDeferSignup(?bool deferSignup): void | | `storedCredentialTransactionId` | `?int` | Optional | For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. | getStoredCredentialTransactionId(): ?int | setStoredCredentialTransactionId(?int storedCredentialTransactionId): void | | `salesRepId` | `?int` | Optional | - | getSalesRepId(): ?int | setSalesRepId(?int salesRepId): void | | `paymentProfileId` | `?int` | Optional | The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id) | getPaymentProfileId(): ?int | setPaymentProfileId(?int paymentProfileId): void | -| `reference` | `?string` | Optional | The reference value (provided by your app) for the subscription itelf. | getReference(): ?string | setReference(?string reference): void | +| `reference` | `?string` | Optional | The reference value (provided by your app) for the subscription itself. | getReference(): ?string | setReference(?string reference): void | | `customerAttributes` | [`?CustomerAttributes`](../../doc/models/customer-attributes.md) | Optional | - | getCustomerAttributes(): ?CustomerAttributes | setCustomerAttributes(?CustomerAttributes customerAttributes): void | | `paymentProfileAttributes` | [`?PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | alias to credit_card_attributes | getPaymentProfileAttributes(): ?PaymentProfileAttributes | setPaymentProfileAttributes(?PaymentProfileAttributes paymentProfileAttributes): void | | `creditCardAttributes` | [`?PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | Credit Card data to create a new Subscription. Interchangeable with `payment_profile_attributes` property. | getCreditCardAttributes(): ?PaymentProfileAttributes | setCreditCardAttributes(?PaymentProfileAttributes creditCardAttributes): void | @@ -46,7 +47,7 @@ | `authorizerLastName` | `?string` | Optional | (Optional) The last name of the person authorizing the ACH agreement. | getAuthorizerLastName(): ?string | setAuthorizerLastName(?string authorizerLastName): void | | `calendarBillingFirstCharge` | `?string` | Optional | (Optional) One of “prorated” (the default – the prorated product price will be charged immediately), “immediate” (the full product price will be charged immediately), or “delayed” (the full product price will be charged with the first scheduled renewal). | getCalendarBillingFirstCharge(): ?string | setCalendarBillingFirstCharge(?string calendarBillingFirstCharge): void | | `reasonCode` | `?string` | Optional | (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to indicate why a subscription was canceled. | getReasonCode(): ?string | setReasonCode(?string reasonCode): void | -| `productChangeDelayed` | `?bool` | Optional | (Optional, used only for Delayed Product Change When set to true, indicates that a changed value for product_handle should schedule the product change to the next subscription renewal. | getProductChangeDelayed(): ?bool | setProductChangeDelayed(?bool productChangeDelayed): void | +| `productChangeDelayed` | `?bool` | Optional | (Optional) used only for Delayed Product Change When set to true, indicates that a changed value for product_handle should schedule the product change to the next subscription renewal. | getProductChangeDelayed(): ?bool | setProductChangeDelayed(?bool productChangeDelayed): void | | `offerId` | string\|int\|null | Optional | This is a container for one-of cases. | getOfferId(): | setOfferId( offerId): void | | `prepaidConfiguration` | [`?UpsertPrepaidConfiguration`](../../doc/models/upsert-prepaid-configuration.md) | Optional | - | getPrepaidConfiguration(): ?UpsertPrepaidConfiguration | setPrepaidConfiguration(?UpsertPrepaidConfiguration prepaidConfiguration): void | | `previousBillingAt` | `?DateTime` | Optional | Providing a previous_billing_at that is in the past will set the current_period_starts_at when the subscription is created. It will also set activated_at if not explicitly passed during the subscription import. Can only be used if next_billing_at is also passed. Using this option will allow you to set the period start for the subscription so mid period component allocations have the correct prorated amount. | getPreviousBillingAt(): ?\DateTime | setPreviousBillingAt(?\DateTime previousBillingAt): void | @@ -55,14 +56,15 @@ | `activatedAt` | `?DateTime` | Optional | - | getActivatedAt(): ?\DateTime | setActivatedAt(?\DateTime activatedAt): void | | `agreementAcceptance` | [`?AgreementAcceptance`](../../doc/models/agreement-acceptance.md) | Optional | Required when creating a subscription with Maxio Payments. | getAgreementAcceptance(): ?AgreementAcceptance | setAgreementAcceptance(?AgreementAcceptance agreementAcceptance): void | | `achAgreement` | [`?ACHAgreement`](../../doc/models/ach-agreement.md) | Optional | (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. | getAchAgreement(): ?ACHAgreement | setAchAgreement(?ACHAgreement achAgreement): void | -| `dunningCommunicationDelayEnabled` | `?bool` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute.
**Default**: `false` | getDunningCommunicationDelayEnabled(): ?bool | setDunningCommunicationDelayEnabled(?bool dunningCommunicationDelayEnabled): void | +| `dunningCommunicationDelayEnabled` | `?bool` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute.

**Default**: `false` | getDunningCommunicationDelayEnabled(): ?bool | setDunningCommunicationDelayEnabled(?bool dunningCommunicationDelayEnabled): void | | `dunningCommunicationDelayTimeZone` | `?string` | Optional | Time zone for the Dunning Communication Delay feature. | getDunningCommunicationDelayTimeZone(): ?string | setDunningCommunicationDelayTimeZone(?string dunningCommunicationDelayTimeZone): void | -| `skipBillingManifestTaxes` | `?bool` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests.
**Default**: `false` | getSkipBillingManifestTaxes(): ?bool | setSkipBillingManifestTaxes(?bool skipBillingManifestTaxes): void | +| `skipBillingManifestTaxes` | `?bool` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests.

**Default**: `false` | getSkipBillingManifestTaxes(): ?bool | setSkipBillingManifestTaxes(?bool skipBillingManifestTaxes): void | ## Example (as JSON) ```json { + "defer_signup": false, "metafields": { "custom_field_name_1": "custom_field_value_1", "custom_field_name_2": "custom_field_value_2" diff --git a/doc/models/credit-card-payment-profile.md b/doc/models/credit-card-payment-profile.md index 69cf00e1..3606cde5 100644 --- a/doc/models/credit-card-payment-profile.md +++ b/doc/models/credit-card-payment-profile.md @@ -31,6 +31,8 @@ | `chargifyToken` | `?string` | Optional | Token received after sending billing information using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | getChargifyToken(): ?string | setChargifyToken(?string chargifyToken): void | | `siteGatewaySettingId` | `?int` | Optional | - | getSiteGatewaySettingId(): ?int | setSiteGatewaySettingId(?int siteGatewaySettingId): void | | `gatewayHandle` | `?string` | Optional | An identifier of connected gateway. | getGatewayHandle(): ?string | setGatewayHandle(?string gatewayHandle): void | +| `createdAt` | `?DateTime` | Optional | A timestamp indicating when this payment profile was created | getCreatedAt(): ?\DateTime | setCreatedAt(?\DateTime createdAt): void | +| `updatedAt` | `?DateTime` | Optional | A timestamp indicating when this payment profile was last updated | getUpdatedAt(): ?\DateTime | setUpdatedAt(?\DateTime updatedAt): void | ## Example (as JSON) diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index 2db68ad4..a7cb5097 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -12,7 +12,7 @@ | `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | getName(): string | setName(string name): void | | `unitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | getUnitName(): string | setUnitName(string unitName): void | | `description` | `?string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | getDescription(): ?string | setDescription(?string description): void | -| `handle` | `?string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | getHandle(): ?string | setHandle(?string handle): void | +| `handle` | `?string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | getHandle(): ?string | setHandle(?string handle): void | | `taxable` | `?bool` | Optional | Boolean flag describing whether a component is taxable or not. | getTaxable(): ?bool | setTaxable(?bool taxable): void | | `pricingScheme` | [`string(PricingScheme)`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | getPricingScheme(): string | setPricingScheme(string pricingScheme): void | | `prices` | [`?(Price[])`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | getPrices(): ?array | setPrices(?array prices): void | diff --git a/doc/models/group-billing.md b/doc/models/group-billing.md index efefac40..71dc9405 100644 --- a/doc/models/group-billing.md +++ b/doc/models/group-billing.md @@ -11,9 +11,9 @@ Optional attributes related to billing date and accrual. Note: Only applicable f | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `accrue` | `?bool` | Optional | A flag indicating whether or not to accrue charges on the new subscription.
**Default**: `false` | getAccrue(): ?bool | setAccrue(?bool accrue): void | -| `alignDate` | `?bool` | Optional | A flag indicating whether or not to align the billing date of the new subscription with the billing date of the primary subscription of the hierarchy's default subscription group. Required to be true if prorate is also true.
**Default**: `false` | getAlignDate(): ?bool | setAlignDate(?bool alignDate): void | -| `prorate` | `?bool` | Optional | A flag indicating whether or not to prorate billing of the new subscription for the current period. A value of true is ignored unless align_date is also true.
**Default**: `false` | getProrate(): ?bool | setProrate(?bool prorate): void | +| `accrue` | `?bool` | Optional | A flag indicating whether or not to accrue charges on the new subscription.

**Default**: `false` | getAccrue(): ?bool | setAccrue(?bool accrue): void | +| `alignDate` | `?bool` | Optional | A flag indicating whether or not to align the billing date of the new subscription with the billing date of the primary subscription of the hierarchy's default subscription group. Required to be true if prorate is also true.

**Default**: `false` | getAlignDate(): ?bool | setAlignDate(?bool alignDate): void | +| `prorate` | `?bool` | Optional | A flag indicating whether or not to prorate billing of the new subscription for the current period. A value of true is ignored unless align_date is also true.

**Default**: `false` | getProrate(): ?bool | setProrate(?bool prorate): void | ## Example (as JSON) diff --git a/doc/models/issue-invoice-request.md b/doc/models/issue-invoice-request.md index bb8bb97b..809b416e 100644 --- a/doc/models/issue-invoice-request.md +++ b/doc/models/issue-invoice-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `onFailedPayment` | [`?string(FailedPaymentAction)`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).
**Default**: `FailedPaymentAction::LEAVE_OPEN_INVOICE` | getOnFailedPayment(): ?string | setOnFailedPayment(?string onFailedPayment): void | +| `onFailedPayment` | [`?string(FailedPaymentAction)`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).

**Default**: `FailedPaymentAction::LEAVE_OPEN_INVOICE` | getOnFailedPayment(): ?string | setOnFailedPayment(?string onFailedPayment): void | ## Example (as JSON) diff --git a/doc/models/list-components-filter.md b/doc/models/list-components-filter.md index cd6e4334..2d1ad2d9 100644 --- a/doc/models/list-components-filter.md +++ b/doc/models/list-components-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `ids` | `?(int[])` | Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | getIds(): ?array | setIds(?array ids): void | +| `ids` | `?(int[])` | Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | getIds(): ?array | setIds(?array ids): void | | `useSiteExchangeRate` | `?bool` | Optional | Allows fetching components with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | ## Example (as JSON) diff --git a/doc/models/list-coupons-filter.md b/doc/models/list-coupons-filter.md index 7ab97ea4..ec0a802d 100644 --- a/doc/models/list-coupons-filter.md +++ b/doc/models/list-coupons-filter.md @@ -14,7 +14,7 @@ | `endDate` | `?DateTime` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `filter[end_date]=2011-12-15`. | getEndDate(): ?\DateTime | setEndDate(?\DateTime endDate): void | | `startDatetime` | `?DateTime` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `filter[start_datetime]=2011-12-19T10:15:30+01:00`. | getStartDatetime(): ?\DateTime | setStartDatetime(?\DateTime startDatetime): void | | `endDatetime` | `?DateTime` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `filter[end_datetime]=2011-12-1T10:15:30+01:00`. | getEndDatetime(): ?\DateTime | setEndDatetime(?\DateTime endDatetime): void | -| `ids` | `?(int[])` | Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | getIds(): ?array | setIds(?array ids): void | +| `ids` | `?(int[])` | Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | getIds(): ?array | setIds(?array ids): void | | `codes` | `?(string[])` | Optional | Allows fetching coupons with matching codes based on provided values. Use in query `filter[codes]=free,free_trial`. | getCodes(): ?array | setCodes(?array codes): void | | `useSiteExchangeRate` | `?bool` | Optional | Allows fetching coupons with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | diff --git a/doc/models/list-mrr-filter.md b/doc/models/list-mrr-filter.md index 7606901a..4f15e9d4 100644 --- a/doc/models/list-mrr-filter.md +++ b/doc/models/list-mrr-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `subscriptionIds` | `?(int[])` | Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | getSubscriptionIds(): ?array | setSubscriptionIds(?array subscriptionIds): void | +| `subscriptionIds` | `?(int[])` | Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | getSubscriptionIds(): ?array | setSubscriptionIds(?array subscriptionIds): void | ## Example (as JSON) diff --git a/doc/models/list-products-filter.md b/doc/models/list-products-filter.md index 64733ed8..259c337d 100644 --- a/doc/models/list-products-filter.md +++ b/doc/models/list-products-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `ids` | `?(int[])` | Optional | Allows fetching products with matching id based on provided values. Use in query `filter[ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | getIds(): ?array | setIds(?array ids): void | +| `ids` | `?(int[])` | Optional | Allows fetching products with matching id based on provided values. Use in query `filter[ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | getIds(): ?array | setIds(?array ids): void | | `prepaidProductPricePoint` | [`?PrepaidProductPricePointFilter`](../../doc/models/prepaid-product-price-point-filter.md) | Optional | Allows fetching products only if a prepaid product price point is present or not. To use this filter you also have to include the following param in the request `include=prepaid_product_price_point`. Use in query `filter[prepaid_product_price_point][product_price_point_id]=not_null`. | getPrepaidProductPricePoint(): ?PrepaidProductPricePointFilter | setPrepaidProductPricePoint(?PrepaidProductPricePointFilter prepaidProductPricePoint): void | | `useSiteExchangeRate` | `?bool` | Optional | Allows fetching products with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | diff --git a/doc/models/list-service-credits-response.md b/doc/models/list-service-credits-response.md new file mode 100644 index 00000000..00db1c2f --- /dev/null +++ b/doc/models/list-service-credits-response.md @@ -0,0 +1,36 @@ + +# List Service Credits Response + +## Structure + +`ListServiceCreditsResponse` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `serviceCredits` | [`?(ServiceCredit1[])`](../../doc/models/service-credit-1.md) | Optional | - | getServiceCredits(): ?array | setServiceCredits(?array serviceCredits): void | + +## Example (as JSON) + +```json +{ + "service_credits": [ + { + "id": 224, + "amount_in_cents": 54, + "ending_balance_in_cents": 94, + "entry_type": "Credit", + "memo": "memo2" + }, + { + "id": 224, + "amount_in_cents": 54, + "ending_balance_in_cents": 94, + "entry_type": "Credit", + "memo": "memo2" + } + ] +} +``` + diff --git a/doc/models/list-subscription-components-filter.md b/doc/models/list-subscription-components-filter.md index 21585ab0..55df8022 100644 --- a/doc/models/list-subscription-components-filter.md +++ b/doc/models/list-subscription-components-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `currencies` | `?(string[])` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=EUR,USD`.
**Constraints**: *Minimum Items*: `1` | getCurrencies(): ?array | setCurrencies(?array currencies): void | +| `currencies` | `?(string[])` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=EUR,USD`.

**Constraints**: *Minimum Items*: `1` | getCurrencies(): ?array | setCurrencies(?array currencies): void | | `useSiteExchangeRate` | `?bool` | Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | ## Example (as JSON) diff --git a/doc/models/list-subscription-components-for-site-filter.md b/doc/models/list-subscription-components-for-site-filter.md index 73e76ae1..723d6472 100644 --- a/doc/models/list-subscription-components-for-site-filter.md +++ b/doc/models/list-subscription-components-for-site-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `currencies` | `?(string[])` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=USD,EUR`.
**Constraints**: *Minimum Items*: `1` | getCurrencies(): ?array | setCurrencies(?array currencies): void | +| `currencies` | `?(string[])` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=USD,EUR`.

**Constraints**: *Minimum Items*: `1` | getCurrencies(): ?array | setCurrencies(?array currencies): void | | `useSiteExchangeRate` | `?bool` | Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | | `subscription` | [`?SubscriptionFilter`](../../doc/models/subscription-filter.md) | Optional | Nested filter used for List Subscription Components For Site Filter | getSubscription(): ?SubscriptionFilter | setSubscription(?SubscriptionFilter subscription): void | diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index 8c8a8776..04ad5ed9 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -12,7 +12,7 @@ | `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | getName(): string | setName(string name): void | | `unitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | getUnitName(): string | setUnitName(string unitName): void | | `description` | `?string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | getDescription(): ?string | setDescription(?string description): void | -| `handle` | `?string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | getHandle(): ?string | setHandle(?string handle): void | +| `handle` | `?string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | getHandle(): ?string | setHandle(?string handle): void | | `taxable` | `?bool` | Optional | Boolean flag describing whether a component is taxable or not. | getTaxable(): ?bool | setTaxable(?bool taxable): void | | `pricingScheme` | [`string(PricingScheme)`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | getPricingScheme(): string | setPricingScheme(string pricingScheme): void | | `prices` | [`?(Price[])`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | getPrices(): ?array | setPrices(?array prices): void | diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index a33c6d79..661ed8d2 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | --- | --- | | `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | getName(): string | setName(string name): void | | `description` | `?string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | getDescription(): ?string | setDescription(?string description): void | -| `handle` | `?string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | getHandle(): ?string | setHandle(?string handle): void | +| `handle` | `?string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | getHandle(): ?string | setHandle(?string handle): void | | `taxable` | `?bool` | Optional | Boolean flag describing whether a component is taxable or not. | getTaxable(): ?bool | setTaxable(?bool taxable): void | | `upgradeCharge` | [`?string(CreditType)`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | getUpgradeCharge(): ?string | setUpgradeCharge(?string upgradeCharge): void | | `downgradeCredit` | [`?string(CreditType)`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | getDowngradeCredit(): ?string | setDowngradeCredit(?string downgradeCredit): void | diff --git a/doc/models/override-subscription.md b/doc/models/override-subscription.md index a099a79c..347885ba 100644 --- a/doc/models/override-subscription.md +++ b/doc/models/override-subscription.md @@ -12,7 +12,7 @@ | `activatedAt` | `?DateTime` | Optional | Can be used to record an external signup date. Chargify uses this field to record when a subscription first goes active (either at signup or at trial end). Only ISO8601 format is supported. | getActivatedAt(): ?\DateTime | setActivatedAt(?\DateTime activatedAt): void | | `canceledAt` | `?DateTime` | Optional | Can be used to record an external cancellation date. Chargify sets this field automatically when a subscription is canceled, whether by request or via dunning. Only ISO8601 format is supported. | getCanceledAt(): ?\DateTime | setCanceledAt(?\DateTime canceledAt): void | | `cancellationMessage` | `?string` | Optional | Can be used to record a reason for the original cancellation. | getCancellationMessage(): ?string | setCancellationMessage(?string cancellationMessage): void | -| `expiresAt` | `?DateTime` | Optional | Can be used to record an external expiration date. Chargify sets this field automatically when a subscription expires (ceases billing) after a prescribed amount of time. Only ISO8601 format is supported. | getExpiresAt(): ?\DateTime | setExpiresAt(?\DateTime expiresAt): void | +| `expiresAt` | `?DateTime` | Optional | Can be used to record an external expiration date. Chargify sets this field automatically when a subscription expires (ceases billing) after a prescribed amount of time. Only ISO8601 format is supported. This field is not supported when Multi-frequency is enabled for the Site. To change the Term End of a Subscription, use the Update Subscription endpoint. | getExpiresAt(): ?\DateTime | setExpiresAt(?\DateTime expiresAt): void | | `currentPeriodStartsAt` | `?DateTime` | Optional | Can only be used when a subscription is unbilled, which happens when a future initial billing date is passed at subscription creation. The value passed must be before the current date and time. Allows you to set when the period started so mid period component allocations have the correct proration. Only ISO8601 format is supported. | getCurrentPeriodStartsAt(): ?\DateTime | setCurrentPeriodStartsAt(?\DateTime currentPeriodStartsAt): void | ## Example (as JSON) diff --git a/doc/models/paypal-payment-profile.md b/doc/models/paypal-payment-profile.md index 2d9465b5..80019e1c 100644 --- a/doc/models/paypal-payment-profile.md +++ b/doc/models/paypal-payment-profile.md @@ -26,6 +26,8 @@ | `siteGatewaySettingId` | `?int` | Optional | - | getSiteGatewaySettingId(): ?int | setSiteGatewaySettingId(?int siteGatewaySettingId): void | | `gatewayHandle` | `?string` | Optional | - | getGatewayHandle(): ?string | setGatewayHandle(?string gatewayHandle): void | | `paypalEmail` | `?string` | Optional | - | getPaypalEmail(): ?string | setPaypalEmail(?string paypalEmail): void | +| `createdAt` | `?DateTime` | Optional | A timestamp indicating when this payment profile was created | getCreatedAt(): ?\DateTime | setCreatedAt(?\DateTime createdAt): void | +| `updatedAt` | `?DateTime` | Optional | A timestamp indicating when this payment profile was last updated | getUpdatedAt(): ?\DateTime | setUpdatedAt(?\DateTime updatedAt): void | ## Example (as JSON) diff --git a/doc/models/prepaid-product-price-point-filter.md b/doc/models/prepaid-product-price-point-filter.md index f0014175..9d90c0ed 100644 --- a/doc/models/prepaid-product-price-point-filter.md +++ b/doc/models/prepaid-product-price-point-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `productPricePointId` | `string` | Required, Constant | Passed as a parameter to list methods to return only non null values.
**Value**: `'not_null'` | getProductPricePointId(): string | setProductPricePointId(string productPricePointId): void | +| `productPricePointId` | `string` | Required, Constant | Passed as a parameter to list methods to return only non null values.

**Value**: `'not_null'` | getProductPricePointId(): string | setProductPricePointId(string productPricePointId): void | ## Example (as JSON) diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index a91aee11..c0d7cfbb 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -12,7 +12,7 @@ | `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | getName(): string | setName(string name): void | | `unitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | getUnitName(): string | setUnitName(string unitName): void | | `description` | `?string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | getDescription(): ?string | setDescription(?string description): void | -| `handle` | `?string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | getHandle(): ?string | setHandle(?string handle): void | +| `handle` | `?string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | getHandle(): ?string | setHandle(?string handle): void | | `taxable` | `?bool` | Optional | Boolean flag describing whether a component is taxable or not. | getTaxable(): ?bool | setTaxable(?bool taxable): void | | `pricingScheme` | [`string(PricingScheme)`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | getPricingScheme(): string | setPricingScheme(string pricingScheme): void | | `prices` | [`?(Price[])`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | getPrices(): ?array | setPrices(?array prices): void | diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index d31522c4..5b6ad5d6 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -12,7 +12,7 @@ | `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | getName(): string | setName(string name): void | | `unitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | getUnitName(): string | setUnitName(string unitName): void | | `description` | `?string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | getDescription(): ?string | setDescription(?string description): void | -| `handle` | `?string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | getHandle(): ?string | setHandle(?string handle): void | +| `handle` | `?string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | getHandle(): ?string | setHandle(?string handle): void | | `taxable` | `?bool` | Optional | Boolean flag describing whether a component is taxable or not. | getTaxable(): ?bool | setTaxable(?bool taxable): void | | `pricingScheme` | [`string(PricingScheme)`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | getPricingScheme(): string | setPricingScheme(string pricingScheme): void | | `prices` | [`?(Price[])`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | getPrices(): ?array | setPrices(?array prices): void | diff --git a/doc/models/reactivation-billing.md b/doc/models/reactivation-billing.md index d6a064f8..bcbd881d 100644 --- a/doc/models/reactivation-billing.md +++ b/doc/models/reactivation-billing.md @@ -11,7 +11,7 @@ These values are only applicable to subscriptions using calendar billing | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `reactivationCharge` | [`?string(ReactivationCharge)`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal
**Default**: `ReactivationCharge::PRORATED` | getReactivationCharge(): ?string | setReactivationCharge(?string reactivationCharge): void | +| `reactivationCharge` | [`?string(ReactivationCharge)`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal

**Default**: `ReactivationCharge::PRORATED` | getReactivationCharge(): ?string | setReactivationCharge(?string reactivationCharge): void | ## Example (as JSON) diff --git a/doc/models/service-credit-1.md b/doc/models/service-credit-1.md new file mode 100644 index 00000000..d63e9348 --- /dev/null +++ b/doc/models/service-credit-1.md @@ -0,0 +1,32 @@ + +# Service Credit 1 + +## Structure + +`ServiceCredit1` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `id` | `?int` | Optional | - | getId(): ?int | setId(?int id): void | +| `amountInCents` | `?int` | Optional | The amount in cents of the entry | getAmountInCents(): ?int | setAmountInCents(?int amountInCents): void | +| `endingBalanceInCents` | `?int` | Optional | The new balance for the credit account | getEndingBalanceInCents(): ?int | setEndingBalanceInCents(?int endingBalanceInCents): void | +| `entryType` | [`?string(ServiceCreditType)`](../../doc/models/service-credit-type.md) | Optional | The type of entry | getEntryType(): ?string | setEntryType(?string entryType): void | +| `memo` | `?string` | Optional | The memo attached to the entry | getMemo(): ?string | setMemo(?string memo): void | +| `invoiceUid` | `?string` | Optional | The invoice uid associated with the entry. Only present for debit entries | getInvoiceUid(): ?string | setInvoiceUid(?string invoiceUid): void | +| `remainingBalanceInCents` | `?int` | Optional | The remaining balance for the entry | getRemainingBalanceInCents(): ?int | setRemainingBalanceInCents(?int remainingBalanceInCents): void | +| `createdAt` | `?DateTime` | Optional | The date and time the entry was created | getCreatedAt(): ?\DateTime | setCreatedAt(?\DateTime createdAt): void | + +## Example (as JSON) + +```json +{ + "id": 174, + "amount_in_cents": 4, + "ending_balance_in_cents": 44, + "entry_type": "Credit", + "memo": "memo8" +} +``` + diff --git a/doc/models/subscription-filter.md b/doc/models/subscription-filter.md index 060565c3..a504bc72 100644 --- a/doc/models/subscription-filter.md +++ b/doc/models/subscription-filter.md @@ -11,7 +11,7 @@ Nested filter used for List Subscription Components For Site Filter | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `states` | [`?(string(SubscriptionStateFilter)[])`](../../doc/models/subscription-state-filter.md) | Optional | Allows fetching components allocations that belong to the subscription with matching states based on provided values. To use this filter you also have to include the following param in the request `include=subscription`. Use in query `filter[subscription][states]=active,canceled&include=subscription`.
**Constraints**: *Minimum Items*: `1` | getStates(): ?array | setStates(?array states): void | +| `states` | [`?(string(SubscriptionStateFilter)[])`](../../doc/models/subscription-state-filter.md) | Optional | Allows fetching components allocations that belong to the subscription with matching states based on provided values. To use this filter you also have to include the following param in the request `include=subscription`. Use in query `filter[subscription][states]=active,canceled&include=subscription`.

**Constraints**: *Minimum Items*: `1` | getStates(): ?array | setStates(?array states): void | | `dateField` | [`?string(SubscriptionListDateField)`](../../doc/models/subscription-list-date-field.md) | Optional | The type of filter you'd like to apply to your search. To use this filter you also have to include the following param in the request `include=subscription`. | getDateField(): ?string | setDateField(?string dateField): void | | `startDate` | `?DateTime` | Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components that belong to the subscription with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. To use this filter you also have to include the following param in the request `include=subscription`. | getStartDate(): ?\DateTime | setStartDate(?\DateTime startDate): void | | `endDate` | `?DateTime` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components that belong to the subscription with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. To use this filter you also have to include the following param in the request `include=subscription`. | getEndDate(): ?\DateTime | setEndDate(?\DateTime endDate): void | diff --git a/doc/models/subscription-group-credit-card.md b/doc/models/subscription-group-credit-card.md index c030edc5..0fc88fa4 100644 --- a/doc/models/subscription-group-credit-card.md +++ b/doc/models/subscription-group-credit-card.md @@ -9,9 +9,6 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `fullNumber` | string\|int\|null | Optional | This is a container for one-of cases. | getFullNumber(): | setFullNumber( fullNumber): void | -| `expirationMonth` | string\|int\|null | Optional | This is a container for one-of cases. | getExpirationMonth(): | setExpirationMonth( expirationMonth): void | -| `expirationYear` | string\|int\|null | Optional | This is a container for one-of cases. | getExpirationYear(): | setExpirationYear( expirationYear): void | | `chargifyToken` | `?string` | Optional | - | getChargifyToken(): ?string | setChargifyToken(?string chargifyToken): void | | `vaultToken` | `?string` | Optional | - | getVaultToken(): ?string | setVaultToken(?string vaultToken): void | | `currentVault` | [`?string(CreditCardVault)`](../../doc/models/credit-card-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | getCurrentVault(): ?string | setCurrentVault(?string currentVault): void | @@ -24,6 +21,9 @@ | `billingState` | `?string` | Optional | - | getBillingState(): ?string | setBillingState(?string billingState): void | | `billingZip` | `?string` | Optional | - | getBillingZip(): ?string | setBillingZip(?string billingZip): void | | `billingCountry` | `?string` | Optional | - | getBillingCountry(): ?string | setBillingCountry(?string billingCountry): void | +| `fullNumber` | string\|int\|null | Optional | This is a container for one-of cases. | getFullNumber(): | setFullNumber( fullNumber): void | +| `expirationMonth` | string\|int\|null | Optional | This is a container for one-of cases. | getExpirationMonth(): | setExpirationMonth( expirationMonth): void | +| `expirationYear` | string\|int\|null | Optional | This is a container for one-of cases. | getExpirationYear(): | setExpirationYear( expirationYear): void | | `lastFour` | `?string` | Optional | - | getLastFour(): ?string | setLastFour(?string lastFour): void | | `cardType` | [`?string(CardType)`](../../doc/models/card-type.md) | Optional | The type of card used. | getCardType(): ?string | setCardType(?string cardType): void | | `customerVaultToken` | `?string` | Optional | - | getCustomerVaultToken(): ?string | setCustomerVaultToken(?string customerVaultToken): void | @@ -34,11 +34,12 @@ ```json { - "full_number": 4111111111111111, "chargify_token": "tok_592nf92ng0sjd4300p", - "expiration_month": "String1", - "expiration_year": "String5", - "vault_token": "vault_token6" + "full_number": 4111111111111111, + "vault_token": "vault_token6", + "current_vault": "braintree_blue", + "gateway_handle": "gateway_handle6", + "first_name": "first_name4" } ``` diff --git a/doc/models/subscription-migration-preview-options.md b/doc/models/subscription-migration-preview-options.md index 207434e0..5b19e847 100644 --- a/doc/models/subscription-migration-preview-options.md +++ b/doc/models/subscription-migration-preview-options.md @@ -11,10 +11,10 @@ | --- | --- | --- | --- | --- | --- | | `productId` | `?int` | Optional | The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | getProductId(): ?int | setProductId(?int productId): void | | `productPricePointId` | `?int` | Optional | The ID of the specified product's price point. This can be passed to migrate to a non-default price point. | getProductPricePointId(): ?int | setProductPricePointId(?int productPricePointId): void | -| `includeTrial` | `?bool` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.
**Default**: `false` | getIncludeTrial(): ?bool | setIncludeTrial(?bool includeTrial): void | -| `includeInitialCharge` | `?bool` | Optional | If `true` is sent initial charges will be assessed.
**Default**: `false` | getIncludeInitialCharge(): ?bool | setIncludeInitialCharge(?bool includeInitialCharge): void | -| `includeCoupons` | `?bool` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.
**Default**: `true` | getIncludeCoupons(): ?bool | setIncludeCoupons(?bool includeCoupons): void | -| `preservePeriod` | `?bool` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.
**Default**: `false` | getPreservePeriod(): ?bool | setPreservePeriod(?bool preservePeriod): void | +| `includeTrial` | `?bool` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.

**Default**: `false` | getIncludeTrial(): ?bool | setIncludeTrial(?bool includeTrial): void | +| `includeInitialCharge` | `?bool` | Optional | If `true` is sent initial charges will be assessed.

**Default**: `false` | getIncludeInitialCharge(): ?bool | setIncludeInitialCharge(?bool includeInitialCharge): void | +| `includeCoupons` | `?bool` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.

**Default**: `true` | getIncludeCoupons(): ?bool | setIncludeCoupons(?bool includeCoupons): void | +| `preservePeriod` | `?bool` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.

**Default**: `false` | getPreservePeriod(): ?bool | setPreservePeriod(?bool preservePeriod): void | | `productHandle` | `?string` | Optional | The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | getProductHandle(): ?string | setProductHandle(?string productHandle): void | | `productPricePointHandle` | `?string` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | getProductPricePointHandle(): ?string | setProductPricePointHandle(?string productPricePointHandle): void | | `proration` | [`?Proration`](../../doc/models/proration.md) | Optional | - | getProration(): ?Proration | setProration(?Proration proration): void | diff --git a/doc/models/subscription-product-migration.md b/doc/models/subscription-product-migration.md index 83cd7fed..39d16eef 100644 --- a/doc/models/subscription-product-migration.md +++ b/doc/models/subscription-product-migration.md @@ -11,10 +11,10 @@ | --- | --- | --- | --- | --- | --- | | `productId` | `?int` | Optional | The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | getProductId(): ?int | setProductId(?int productId): void | | `productPricePointId` | `?int` | Optional | The ID of the specified product's price point. This can be passed to migrate to a non-default price point. | getProductPricePointId(): ?int | setProductPricePointId(?int productPricePointId): void | -| `includeTrial` | `?bool` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.
**Default**: `false` | getIncludeTrial(): ?bool | setIncludeTrial(?bool includeTrial): void | -| `includeInitialCharge` | `?bool` | Optional | If `true` is sent initial charges will be assessed.
**Default**: `false` | getIncludeInitialCharge(): ?bool | setIncludeInitialCharge(?bool includeInitialCharge): void | -| `includeCoupons` | `?bool` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.
**Default**: `true` | getIncludeCoupons(): ?bool | setIncludeCoupons(?bool includeCoupons): void | -| `preservePeriod` | `?bool` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.
**Default**: `false` | getPreservePeriod(): ?bool | setPreservePeriod(?bool preservePeriod): void | +| `includeTrial` | `?bool` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.

**Default**: `false` | getIncludeTrial(): ?bool | setIncludeTrial(?bool includeTrial): void | +| `includeInitialCharge` | `?bool` | Optional | If `true` is sent initial charges will be assessed.

**Default**: `false` | getIncludeInitialCharge(): ?bool | setIncludeInitialCharge(?bool includeInitialCharge): void | +| `includeCoupons` | `?bool` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.

**Default**: `true` | getIncludeCoupons(): ?bool | setIncludeCoupons(?bool includeCoupons): void | +| `preservePeriod` | `?bool` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.

**Default**: `false` | getPreservePeriod(): ?bool | setPreservePeriod(?bool preservePeriod): void | | `productHandle` | `?string` | Optional | The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | getProductHandle(): ?string | setProductHandle(?string productHandle): void | | `productPricePointHandle` | `?string` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | getProductPricePointHandle(): ?string | setProductPricePointHandle(?string productPricePointHandle): void | | `proration` | [`?Proration`](../../doc/models/proration.md) | Optional | - | getProration(): ?Proration | setProration(?Proration proration): void | diff --git a/doc/models/tax-configuration.md b/doc/models/tax-configuration.md index 8a13358e..9ba99785 100644 --- a/doc/models/tax-configuration.md +++ b/doc/models/tax-configuration.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | --- | --- | | `kind` | [`?string(TaxConfigurationKind)`](../../doc/models/tax-configuration-kind.md) | Optional | **Default**: `TaxConfigurationKind::CUSTOM` | getKind(): ?string | setKind(?string kind): void | | `destinationAddress` | [`?string(TaxDestinationAddress)`](../../doc/models/tax-destination-address.md) | Optional | - | getDestinationAddress(): ?string | setDestinationAddress(?string destinationAddress): void | -| `fullyConfigured` | `?bool` | Optional | Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Overview
**Default**: `false` | getFullyConfigured(): ?bool | setFullyConfigured(?bool fullyConfigured): void | +| `fullyConfigured` | `?bool` | Optional | Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Overview

**Default**: `false` | getFullyConfigured(): ?bool | setFullyConfigured(?bool fullyConfigured): void | ## Example (as JSON) diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md index daabed89..37024fd7 100644 --- a/doc/models/update-subscription-request.md +++ b/doc/models/update-subscription-request.md @@ -16,6 +16,7 @@ ```json { "subscription": { + "defer_signup": false, "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", "credit_card_attributes": { "full_number": "full_number2", diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md index b81ff2ed..0bec990f 100644 --- a/doc/models/update-subscription.md +++ b/doc/models/update-subscription.md @@ -16,7 +16,10 @@ | `nextProductId` | `?string` | Optional | Set to an empty string to cancel a delayed product change. | getNextProductId(): ?string | setNextProductId(?string nextProductId): void | | `nextProductPricePointId` | `?string` | Optional | - | getNextProductPricePointId(): ?string | setNextProductPricePointId(?string nextProductPricePointId): void | | `snapDay` | string([SnapDay](../../doc/models/snap-day.md))\|int\|null | Optional | This is a container for one-of cases. | getSnapDay(): | setSnapDay( snapDay): void | +| `initialBillingAt` | `?DateTime` | Optional | (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the `initial_billing_at` date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can omit the initial_billing_at date to activate the subscription immediately. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time formats. | getInitialBillingAt(): ?\DateTime | setInitialBillingAt(?\DateTime initialBillingAt): void | +| `deferSignup` | `?bool` | Optional | (Optional) Set this attribute to true to move the subscription from Awaiting Signup, to Awaiting Signup Date. Use this when you want to update a subscription that has an unknown initial billing date. When the first billing date is known, update a subscription to set the `initial_billing_at` date. The subscription moves to the awaiting signup with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | getDeferSignup(): ?bool | setDeferSignup(?bool deferSignup): void | | `nextBillingAt` | `?DateTime` | Optional | - | getNextBillingAt(): ?\DateTime | setNextBillingAt(?\DateTime nextBillingAt): void | +| `expiresAt` | `?DateTime` | Optional | Timestamp giving the expiration date of this subscription (if any). You may manually change the expiration date at any point during a subscription period. | getExpiresAt(): ?\DateTime | setExpiresAt(?\DateTime expiresAt): void | | `paymentCollectionMethod` | `?string` | Optional | - | getPaymentCollectionMethod(): ?string | setPaymentCollectionMethod(?string paymentCollectionMethod): void | | `receivesInvoiceEmails` | `?bool` | Optional | - | getReceivesInvoiceEmails(): ?bool | setReceivesInvoiceEmails(?bool receivesInvoiceEmails): void | | `netTerms` | string\|int\|null | Optional | This is a container for one-of cases. | getNetTerms(): | setNetTerms( netTerms): void | @@ -33,6 +36,7 @@ ```json { + "defer_signup": false, "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", "credit_card_attributes": { "full_number": "full_number2", diff --git a/doc/proxy-configuration-builder.md b/doc/proxy-configuration-builder.md new file mode 100644 index 00000000..92e54db9 --- /dev/null +++ b/doc/proxy-configuration-builder.md @@ -0,0 +1,38 @@ + +# ProxyConfigurationBuilder + +Represents the proxy server configurations for API calls. Create instance using `ProxyConfigurationBuilder::init('http://your.proxy.host')` + +## Methods + +| Name | Description | +| --- | --- | +| `address(string $address)` | Sets the proxy host address. Should be set during initialization via init() method. | +| `port(int $port)` | Sets the port used to connect to the proxy server. **Default port:** 0 | +| `tunnel(bool $tunnel)` | Enables or disables tunneling through the proxy server. **Default tunnel:** false | +| `auth(string $user , string $pass)` | Sets both username and password in a single method. **Default user:** '', **Default pass:** '' | +| `authMethod(string $authMethod)` | Sets the proxy authentication method. **Default authMethod:** CURLAUTH_BASIC | + +### Client Initialization with Proxy Configuration + +To configure the SDK to use a proxy server, initialize the proxy configuration during client setup as shown in the Usage Example. + +## Usage Example + +```php +proxyConfiguration( + ProxyConfigurationBuilder::init('http://localhost') + ->port(8080) + ->auth('username', 'password') + ->authMethod(CURLAUTH_BASIC) + ->tunnel(true) + ) + ->build(); +``` + diff --git a/src/AdvancedBillingClient.php b/src/AdvancedBillingClient.php index a053209c..1c3da975 100644 --- a/src/AdvancedBillingClient.php +++ b/src/AdvancedBillingClient.php @@ -44,6 +44,7 @@ use AdvancedBillingLib\Controllers\SubscriptionsController; use AdvancedBillingLib\Controllers\SubscriptionStatusController; use AdvancedBillingLib\Controllers\WebhooksController; +use AdvancedBillingLib\Proxy\ProxyConfigurationBuilder; use AdvancedBillingLib\Utils\CompatibilityConverter; use Core\ClientBuilder; use Core\Request\Parameters\TemplateParam; @@ -120,6 +121,8 @@ class AdvancedBillingClient implements ConfigurationInterface private $basicAuthManager; + private $proxyConfiguration; + private $config; private $client; @@ -134,11 +137,14 @@ public function __construct(array $config = []) { $this->config = array_merge(ConfigurationDefaults::_ALL, CoreHelper::clone($config)); $this->basicAuthManager = new BasicAuthManager($this->config); - $this->client = ClientBuilder::init(new HttpClient(Configuration::init($this))) + $this->proxyConfiguration = $this->config['proxyConfiguration'] ?? ConfigurationDefaults::PROXY_CONFIGURATION; + $this->client = ClientBuilder::init( + new HttpClient(Configuration::init($this)->proxyConfiguration($this->proxyConfiguration)) + ) ->converter(new CompatibilityConverter()) ->jsonHelper(ApiHelper::getJsonHelper()) ->apiCallback($this->config['httpCallback'] ?? null) - ->userAgent('AB SDK PHP:6.1.0 on OS {os-info}') + ->userAgent('AB SDK PHP:7.0.0 on OS {os-info}') ->globalConfig($this->getGlobalConfiguration()) ->globalErrors($this->getGlobalErrors()) ->serverUrls(self::ENVIRONMENT_MAP[$this->getEnvironment()], Server::PRODUCTION) @@ -165,7 +171,8 @@ public function toBuilder(): AdvancedBillingClientBuilder ->httpMethodsToRetry($this->getHttpMethodsToRetry()) ->environment($this->getEnvironment()) ->site($this->getSite()) - ->httpCallback($this->config['httpCallback'] ?? null); + ->httpCallback($this->config['httpCallback'] ?? null) + ->proxyConfiguration($this->getProxyConfigurationBuilder()); $basicAuth = $this->getBasicAuthCredentialsBuilder(); if ($basicAuth != null) { @@ -248,6 +255,18 @@ public function getBasicAuthCredentialsBuilder(): ?BasicAuthCredentialsBuilder ); } + /** + * Get the proxy configuration builder + */ + public function getProxyConfigurationBuilder(): ProxyConfigurationBuilder + { + return ProxyConfigurationBuilder::init($this->proxyConfiguration['address']) + ->port($this->proxyConfiguration['port']) + ->tunnel($this->proxyConfiguration['tunnel']) + ->auth($this->proxyConfiguration['auth']['user'], $this->proxyConfiguration['auth']['pass']) + ->authMethod($this->proxyConfiguration['auth']['method']); + } + /** * Get the client configuration as an associative array * diff --git a/src/AdvancedBillingClientBuilder.php b/src/AdvancedBillingClientBuilder.php index 303a93df..41d933b2 100644 --- a/src/AdvancedBillingClientBuilder.php +++ b/src/AdvancedBillingClientBuilder.php @@ -11,6 +11,7 @@ namespace AdvancedBillingLib; use AdvancedBillingLib\Authentication\BasicAuthCredentialsBuilder; +use AdvancedBillingLib\Proxy\ProxyConfigurationBuilder; use Core\Types\Sdk\CoreCallback; use Core\Utils\CoreHelper; @@ -129,6 +130,12 @@ public function httpCallback($httpCallback): self return $this; } + public function proxyConfiguration(ProxyConfigurationBuilder $proxyConfiguration): self + { + $this->config['proxyConfiguration'] = $proxyConfiguration->getConfiguration(); + return $this; + } + public function build(): AdvancedBillingClient { return new AdvancedBillingClient($this->config); diff --git a/src/ConfigurationDefaults.php b/src/ConfigurationDefaults.php index bbb2bedd..a513e692 100644 --- a/src/ConfigurationDefaults.php +++ b/src/ConfigurationDefaults.php @@ -41,6 +41,13 @@ class ConfigurationDefaults public const BASIC_AUTH_PASSWORD = ''; + public const PROXY_CONFIGURATION = [ + 'port' => 0, + 'tunnel' => false, + 'address' => '', + 'auth' => ['user' => '', 'pass' => '', 'method' => CURLAUTH_BASIC] + ]; + /** * @var array Associative list of all default configurations */ @@ -57,6 +64,7 @@ class ConfigurationDefaults 'environment' => self::ENVIRONMENT, 'site' => self::SITE, 'basicAuthUserName' => self::BASIC_AUTH_USER_NAME, - 'basicAuthPassword' => self::BASIC_AUTH_PASSWORD + 'basicAuthPassword' => self::BASIC_AUTH_PASSWORD, + 'proxyConfiguration' => self::PROXY_CONFIGURATION ]; } diff --git a/src/ConfigurationInterface.php b/src/ConfigurationInterface.php index 5a4fe2ca..bf88568e 100644 --- a/src/ConfigurationInterface.php +++ b/src/ConfigurationInterface.php @@ -11,6 +11,7 @@ namespace AdvancedBillingLib; use AdvancedBillingLib\Authentication\BasicAuthCredentialsBuilder; +use AdvancedBillingLib\Proxy\ProxyConfigurationBuilder; use CoreInterfaces\Http\HttpConfigurations; /** @@ -38,6 +39,11 @@ public function getBasicAuthCredentials(): BasicAuthCredentials; */ public function getBasicAuthCredentialsBuilder(): ?BasicAuthCredentialsBuilder; + /** + * Represents the proxy configurations for API calls. + */ + public function getProxyConfigurationBuilder(): ProxyConfigurationBuilder; + /** * Get the base uri for a given server in the current environment. * diff --git a/src/Controllers/CouponsController.php b/src/Controllers/CouponsController.php index 8120e5f0..1f558fe3 100644 --- a/src/Controllers/CouponsController.php +++ b/src/Controllers/CouponsController.php @@ -381,7 +381,13 @@ public function validateCoupon(string $code, ?int $productFamilyId = null): Coup ); $_resHandler = $this->responseHandler() - ->throwErrorOn('404', ErrorType::init('Not Found', SingleStringErrorResponseException::class)) + ->throwErrorOn( + '404', + ErrorType::initWithErrorTemplate( + 'Not Found: \'{$response.body}\'', + SingleStringErrorResponseException::class + ) + ) ->type(CouponResponse::class); return $this->execute($_reqBuilder, $_resHandler); diff --git a/src/Controllers/CustomFieldsController.php b/src/Controllers/CustomFieldsController.php index 29e839dd..f0861124 100644 --- a/src/Controllers/CustomFieldsController.php +++ b/src/Controllers/CustomFieldsController.php @@ -65,7 +65,7 @@ class CustomFieldsController extends BaseController * * ### Metafields "On-the-Fly" * - * It is possible to create Metafields “on the fly” when you create your Metadata – if a non-existant + * It is possible to create Metafields “on the fly” when you create your Metadata – if a non-existent * name is passed when creating Metadata, a Metafield for that key will be automatically created. The * Metafield API, however, gives you more control over your “keys”. * diff --git a/src/Controllers/InsightsController.php b/src/Controllers/InsightsController.php index ea8eaf10..bbec6aef 100644 --- a/src/Controllers/InsightsController.php +++ b/src/Controllers/InsightsController.php @@ -33,7 +33,7 @@ class InsightsController extends BaseController * * There currently is not a complimentary matching set of documentation that compliments this endpoint. * However, each Site's dashboard will reflect the summary of information provided in the Stats - * reposnse. + * response. * * ``` * https://subdomain.chargify.com/dashboard diff --git a/src/Controllers/InvoicesController.php b/src/Controllers/InvoicesController.php index cf5a494c..ae15e6b6 100644 --- a/src/Controllers/InvoicesController.php +++ b/src/Controllers/InvoicesController.php @@ -112,6 +112,7 @@ public function listInvoices(array $options): ListInvoicesResponse QueryParam::init('subscription_group_uid', $options) ->commaSeparated() ->extract('subscriptionGroupUid'), + QueryParam::init('consolidation_level', $options)->commaSeparated()->extract('consolidationLevel'), QueryParam::init('page', $options)->commaSeparated()->extract('page', 1), QueryParam::init('per_page', $options)->commaSeparated()->extract('perPage', 20), QueryParam::init('direction', $options) @@ -238,60 +239,8 @@ public function listInvoiceEvents(array $options): ListInvoiceEventsResponse } /** - * This API call should be used when you want to record a payment of a given type against a specific - * invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment - * endpoint. - * - * ## Create a Payment from the existing payment profile - * - * In order to apply a payment to an invoice using an existing payment profile, specify `type` as - * `payment`, the amount less than the invoice total, and the customer's `payment_profile_id`. The ID - * of a payment profile might be retrieved via the Payment Profiles API endpoint. - * - * ``` - * { - * "type": "payment", - * "payment": { - * "amount": 10.00, - * "payment_profile_id": 123 - * } - * } - * ``` - * - * ## Create a Payment from the Subscription's Prepayment Account - * - * In order apply a prepayment to an invoice, specify the `type` as `prepayment`, and also the `amount`. - * - * ``` - * { - * "type": "prepayment", - * "payment": { - * "amount": 10.00 - * } - * } - * ``` - * - * Note that the `amount` must be less than or equal to the Subscription's Prepayment account balance. - * - * ## Create a Payment from the Subscription's Service Credit Account - * - * In order to apply a service credit to an invoice, specify the `type` as `service_credit`, and also - * the `amount`: - * - * - * ``` - * { - * "type": "service_credit", - * "payment": { - * "amount": 10.00 - * } - * } - * ``` - * - * Note that Advanced Billing will attempt to fully pay the invoice's `due_amount` from the - * Subscription's Service Credit account. At this time, partial payments from a Service Credit Account - * are only allowed for consolidated invoices (subscription groups). Therefore, for normal invoices the - * Service Credit account balance must be greater than or equal to the invoice's `due_amount`. + * Applies a payment of a given type against a specific invoice. If you would like to apply a payment + * across multiple invoices, you can use the Bulk Payment endpoint. * * @param string $uid The unique identifier for the invoice, this does not refer to the public * facing invoice number. diff --git a/src/Controllers/PaymentProfilesController.php b/src/Controllers/PaymentProfilesController.php index fb749499..f2221e7a 100644 --- a/src/Controllers/PaymentProfilesController.php +++ b/src/Controllers/PaymentProfilesController.php @@ -439,6 +439,8 @@ public function listPaymentProfiles(array $options): array * "id": 10089892, * "first_name": "Chester", * "last_name": "Tester", + * "created_at": "2025-01-01T00:00:00-05:00", + * "updated_at": "2025-01-01T00:00:00-05:00", * "customer_id": 14543792, * "current_vault": "bogus", * "vault_token": "0011223344", diff --git a/src/Controllers/ProductFamiliesController.php b/src/Controllers/ProductFamiliesController.php index 7062db18..a25104f0 100644 --- a/src/Controllers/ProductFamiliesController.php +++ b/src/Controllers/ProductFamiliesController.php @@ -76,7 +76,7 @@ public function listProductsForProductFamily(array $options): array ); $_resHandler = $this->responseHandler() - ->throwErrorOn('404', ErrorType::init('Not Found')) + ->throwErrorOn('404', ErrorType::initWithErrorTemplate('Not Found:\'{$response.body}\'')) ->type(ProductResponse::class, 1); return $this->execute($_reqBuilder, $_resHandler); diff --git a/src/Controllers/ReasonCodesController.php b/src/Controllers/ReasonCodesController.php index 4d342f54..359f6adb 100644 --- a/src/Controllers/ReasonCodesController.php +++ b/src/Controllers/ReasonCodesController.php @@ -28,8 +28,8 @@ class ReasonCodesController extends BaseController /** * # Reason Codes Intro * - * ReasonCodes are a way to gain a high level view of why your customers are cancelling the subcription - * to your product or service. + * ReasonCodes are a way to gain a high level view of why your customers are cancelling the + * subscription to your product or service. * * Add a set of churn reason codes to be displayed in-app and/or the Maxio Billing Portal. As your * subscribers decide to cancel their subscription, learn why they decided to cancel. @@ -161,7 +161,7 @@ public function updateReasonCode(int $reasonCodeId, ?UpdateReasonCodeRequest $bo /** * This method gives a merchant the option to delete one reason code from the Churn Reason Codes. This - * code will be immediately removed. This action is not reversable. + * code will be immediately removed. This action is not reversible. * * @param int $reasonCodeId The Advanced Billing id of the reason code * diff --git a/src/Controllers/SubscriptionInvoiceAccountController.php b/src/Controllers/SubscriptionInvoiceAccountController.php index f13bfabf..6b2b6689 100644 --- a/src/Controllers/SubscriptionInvoiceAccountController.php +++ b/src/Controllers/SubscriptionInvoiceAccountController.php @@ -11,16 +11,19 @@ namespace AdvancedBillingLib\Controllers; use AdvancedBillingLib\Exceptions\ApiException; +use AdvancedBillingLib\Exceptions\ErrorListResponseException; use AdvancedBillingLib\Exceptions\RefundPrepaymentBaseErrorsResponseException; use AdvancedBillingLib\Models\AccountBalances; use AdvancedBillingLib\Models\CreatePrepaymentRequest; use AdvancedBillingLib\Models\CreatePrepaymentResponse; use AdvancedBillingLib\Models\DeductServiceCreditRequest; use AdvancedBillingLib\Models\IssueServiceCreditRequest; +use AdvancedBillingLib\Models\ListServiceCreditsResponse; use AdvancedBillingLib\Models\PrepaymentResponse; use AdvancedBillingLib\Models\PrepaymentsResponse; use AdvancedBillingLib\Models\RefundPrepaymentRequest; use AdvancedBillingLib\Models\ServiceCredit; +use AdvancedBillingLib\Models\SortingDirection; use Core\Request\Parameters\BodyParam; use Core\Request\Parameters\HeaderParam; use Core\Request\Parameters\QueryParam; @@ -200,6 +203,61 @@ public function deductServiceCredit(int $subscriptionId, ?DeductServiceCreditReq $this->execute($_reqBuilder, $_resHandler); } + /** + * This request will list a subscription's service credits. + * + * @param int $subscriptionId The Chargify id of the subscription + * @param int|null $page Result records are organized in pages. By default, the first page of + * results is displayed. The page parameter specifies a page number of results to fetch. + * You can start navigating through the pages to consume the results. You do this by + * passing in a page parameter. Retrieve the next page by adding ?page=2 to the query + * string. If there are no results to return, then an empty result set will be returned. + * Use in query `page=1`. + * @param int|null $perPage This parameter indicates how many records to fetch in each request. + * Default value is 20. The maximum allowed values is 200; any per_page value over 200 + * will be changed to 200. + * Use in query `per_page=200`. + * @param string|null $direction Controls the order in which results are returned. Use in query + * `direction=asc`. + * + * @return ListServiceCreditsResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function listServiceCredits( + int $subscriptionId, + ?int $page = 1, + ?int $perPage = 20, + ?string $direction = null + ): ListServiceCreditsResponse { + $_reqBuilder = $this->requestBuilder( + RequestMethod::GET, + '/subscriptions/{subscription_id}/service_credits/list.json' + ) + ->auth('BasicAuth') + ->parameters( + TemplateParam::init('subscription_id', $subscriptionId)->required(), + QueryParam::init('page', $page)->commaSeparated(), + QueryParam::init('per_page', $perPage)->commaSeparated(), + QueryParam::init('direction', $direction) + ->commaSeparated() + ->serializeBy([SortingDirection::class, 'checkValue']) + ); + + $_resHandler = $this->responseHandler() + ->throwErrorOn('404', ErrorType::initWithErrorTemplate('Not Found:\'{$response.body}\'')) + ->throwErrorOn( + '422', + ErrorType::initWithErrorTemplate( + 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', + ErrorListResponseException::class + ) + ) + ->type(ListServiceCreditsResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + /** * This endpoint will refund, completely or partially, a particular prepayment applied to a * subscription. The `prepayment_id` will be the account transaction ID of the original payment. The diff --git a/src/Controllers/SubscriptionsController.php b/src/Controllers/SubscriptionsController.php index e8904a0b..02afe2f9 100644 --- a/src/Controllers/SubscriptionsController.php +++ b/src/Controllers/SubscriptionsController.php @@ -235,42 +235,6 @@ class SubscriptionsController extends BaseController * } * ``` * - * ## Subscription with Credit Card - * - * ```json - * "subscription": { - * "product_handle": "basic", - * "customer_attributes": { - * "first_name": "Joe", - * "last_name": "Blow", - * "email": "joe@example.com", - * "zip": "02120", - * "state": "MA", - * "reference": "XYZ", - * "phone": "(617) 111 - 0000", - * "organization": "Acme", - * "country": "US", - * "city": "Boston", - * "address_2": null, - * "address": "123 Mass Ave." - * }, - * "credit_card_attributes": { - * "last_name": "Smith", - * "first_name": "Joe", - * "full_number": "4111111111111111", - * "expiration_year": "2021", - * "expiration_month": "1", - * "card_type": "visa", - * "billing_zip": "02120", - * "billing_state": "MA", - * "billing_country": "US", - * "billing_city": "Boston", - * "billing_address_2": null, - * "billing_address": "123 Mass Ave." - * } - * } - * ``` - * * ## Subscription with ACH as Payment Profile * * ```json @@ -949,6 +913,7 @@ public function listSubscriptions(array $options): array QueryParam::init('product', $options)->unIndexed()->extract('product'), QueryParam::init('product_price_point_id', $options)->unIndexed()->extract('productPricePointId'), QueryParam::init('coupon', $options)->unIndexed()->extract('coupon'), + QueryParam::init('coupon_code', $options)->unIndexed()->extract('couponCode'), QueryParam::init('date_field', $options) ->unIndexed() ->extract('dateField') @@ -1300,14 +1265,12 @@ public function updatePrepaidSubscriptionConfiguration( * The Chargify API allows you to preview a subscription by POSTing the same JSON or XML as for a * subscription creation. * - * The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. For - * more information, please see our documentation [here](https://maxio.zendesk.com/hc/en- - * us/articles/24252493695757-Subscriber-Interface-Overview). + * The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. * - * ## Side effects + * A subscription will not be created by utilizing this endpoint; it is meant to serve as a prediction. * - * A subscription will not be created by sending a POST to this endpoint. It is meant to serve as a - * prediction. + * For more information, please see our documentation [here](https://maxio.zendesk.com/hc/en- + * us/articles/24252493695757-Subscriber-Interface-Overview). * * ## Taxable Subscriptions * diff --git a/src/Models/ApplePayPaymentProfile.php b/src/Models/ApplePayPaymentProfile.php index 42482dd6..f146d9bb 100644 --- a/src/Models/ApplePayPaymentProfile.php +++ b/src/Models/ApplePayPaymentProfile.php @@ -11,6 +11,7 @@ namespace AdvancedBillingLib\Models; use AdvancedBillingLib\ApiHelper; +use AdvancedBillingLib\Utils\DateTimeHelper; use stdClass; class ApplePayPaymentProfile implements \JsonSerializable @@ -95,6 +96,16 @@ class ApplePayPaymentProfile implements \JsonSerializable */ private $gatewayHandle = []; + /** + * @var \DateTime|null + */ + private $createdAt; + + /** + * @var \DateTime|null + */ + private $updatedAt; + /** * @param string $paymentType */ @@ -523,6 +534,48 @@ public function unsetGatewayHandle(): void $this->gatewayHandle = []; } + /** + * Returns Created At. + * A timestamp indicating when this payment profile was created + */ + public function getCreatedAt(): ?\DateTime + { + return $this->createdAt; + } + + /** + * Sets Created At. + * A timestamp indicating when this payment profile was created + * + * @maps created_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setCreatedAt(?\DateTime $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * Returns Updated At. + * A timestamp indicating when this payment profile was last updated + */ + public function getUpdatedAt(): ?\DateTime + { + return $this->updatedAt; + } + + /** + * Sets Updated At. + * A timestamp indicating when this payment profile was last updated + * + * @maps updated_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setUpdatedAt(?\DateTime $updatedAt): void + { + $this->updatedAt = $updatedAt; + } + /** * Converts the ApplePayPaymentProfile object to a human-readable string representation. * @@ -549,6 +602,8 @@ public function __toString(): string 'paymentType' => $this->paymentType, 'siteGatewaySettingId' => $this->getSiteGatewaySettingId(), 'gatewayHandle' => $this->getGatewayHandle(), + 'createdAt' => $this->createdAt, + 'updatedAt' => $this->updatedAt, 'additionalProperties' => $this->additionalProperties ] ); @@ -640,6 +695,12 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->gatewayHandle)) { $json['gateway_handle'] = $this->gatewayHandle['value']; } + if (isset($this->createdAt)) { + $json['created_at'] = DateTimeHelper::toRfc3339DateTime($this->createdAt); + } + if (isset($this->updatedAt)) { + $json['updated_at'] = DateTimeHelper::toRfc3339DateTime($this->updatedAt); + } $json = array_merge($json, $this->additionalProperties); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; diff --git a/src/Models/BankAccountPaymentProfile.php b/src/Models/BankAccountPaymentProfile.php index c28a033f..6b24405d 100644 --- a/src/Models/BankAccountPaymentProfile.php +++ b/src/Models/BankAccountPaymentProfile.php @@ -11,6 +11,7 @@ namespace AdvancedBillingLib\Models; use AdvancedBillingLib\ApiHelper; +use AdvancedBillingLib\Utils\DateTimeHelper; use stdClass; class BankAccountPaymentProfile implements \JsonSerializable @@ -125,6 +126,16 @@ class BankAccountPaymentProfile implements \JsonSerializable */ private $gatewayHandle = []; + /** + * @var \DateTime|null + */ + private $createdAt; + + /** + * @var \DateTime|null + */ + private $updatedAt; + /** * @param string $maskedBankAccountNumber * @param string $paymentType @@ -694,6 +705,48 @@ public function unsetGatewayHandle(): void $this->gatewayHandle = []; } + /** + * Returns Created At. + * A timestamp indicating when this payment profile was created + */ + public function getCreatedAt(): ?\DateTime + { + return $this->createdAt; + } + + /** + * Sets Created At. + * A timestamp indicating when this payment profile was created + * + * @maps created_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setCreatedAt(?\DateTime $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * Returns Updated At. + * A timestamp indicating when this payment profile was last updated + */ + public function getUpdatedAt(): ?\DateTime + { + return $this->updatedAt; + } + + /** + * Sets Updated At. + * A timestamp indicating when this payment profile was last updated + * + * @maps updated_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setUpdatedAt(?\DateTime $updatedAt): void + { + $this->updatedAt = $updatedAt; + } + /** * Converts the BankAccountPaymentProfile object to a human-readable string representation. * @@ -726,6 +779,8 @@ public function __toString(): string 'verified' => $this->verified, 'siteGatewaySettingId' => $this->getSiteGatewaySettingId(), 'gatewayHandle' => $this->getGatewayHandle(), + 'createdAt' => $this->createdAt, + 'updatedAt' => $this->updatedAt, 'additionalProperties' => $this->additionalProperties ] ); @@ -833,6 +888,12 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->gatewayHandle)) { $json['gateway_handle'] = $this->gatewayHandle['value']; } + if (isset($this->createdAt)) { + $json['created_at'] = DateTimeHelper::toRfc3339DateTime($this->createdAt); + } + if (isset($this->updatedAt)) { + $json['updated_at'] = DateTimeHelper::toRfc3339DateTime($this->updatedAt); + } $json = array_merge($json, $this->additionalProperties); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; diff --git a/src/Models/Builders/ApplePayPaymentProfileBuilder.php b/src/Models/Builders/ApplePayPaymentProfileBuilder.php index 996e0176..546f7a8d 100644 --- a/src/Models/Builders/ApplePayPaymentProfileBuilder.php +++ b/src/Models/Builders/ApplePayPaymentProfileBuilder.php @@ -286,6 +286,28 @@ public function unsetGatewayHandle(): self return $this; } + /** + * Sets created at field. + * + * @param \DateTime|null $value + */ + public function createdAt(?\DateTime $value): self + { + $this->instance->setCreatedAt($value); + return $this; + } + + /** + * Sets updated at field. + * + * @param \DateTime|null $value + */ + public function updatedAt(?\DateTime $value): self + { + $this->instance->setUpdatedAt($value); + return $this; + } + /** * Add an additional property to this model. * diff --git a/src/Models/Builders/BankAccountPaymentProfileBuilder.php b/src/Models/Builders/BankAccountPaymentProfileBuilder.php index 79b708de..eb4fddd1 100644 --- a/src/Models/Builders/BankAccountPaymentProfileBuilder.php +++ b/src/Models/Builders/BankAccountPaymentProfileBuilder.php @@ -342,6 +342,28 @@ public function unsetGatewayHandle(): self return $this; } + /** + * Sets created at field. + * + * @param \DateTime|null $value + */ + public function createdAt(?\DateTime $value): self + { + $this->instance->setCreatedAt($value); + return $this; + } + + /** + * Sets updated at field. + * + * @param \DateTime|null $value + */ + public function updatedAt(?\DateTime $value): self + { + $this->instance->setUpdatedAt($value); + return $this; + } + /** * Add an additional property to this model. * diff --git a/src/Models/Builders/ComponentBuilder.php b/src/Models/Builders/ComponentBuilder.php index cbe06545..5808e872 100644 --- a/src/Models/Builders/ComponentBuilder.php +++ b/src/Models/Builders/ComponentBuilder.php @@ -154,6 +154,17 @@ public function productFamilyName(?string $value): self return $this; } + /** + * Sets product family handle field. + * + * @param string|null $value + */ + public function productFamilyHandle(?string $value): self + { + $this->instance->setProductFamilyHandle($value); + return $this; + } + /** * Sets price per unit in cents field. * diff --git a/src/Models/Builders/CreateSubscriptionBuilder.php b/src/Models/Builders/CreateSubscriptionBuilder.php index b2a1daf6..0a03002f 100644 --- a/src/Models/Builders/CreateSubscriptionBuilder.php +++ b/src/Models/Builders/CreateSubscriptionBuilder.php @@ -191,6 +191,17 @@ public function initialBillingAt(?\DateTime $value): self return $this; } + /** + * Sets defer signup field. + * + * @param bool|null $value + */ + public function deferSignup(?bool $value): self + { + $this->instance->setDeferSignup($value); + return $this; + } + /** * Sets stored credential transaction id field. * diff --git a/src/Models/Builders/CreditCardPaymentProfileBuilder.php b/src/Models/Builders/CreditCardPaymentProfileBuilder.php index 8835deb5..a4b1763c 100644 --- a/src/Models/Builders/CreditCardPaymentProfileBuilder.php +++ b/src/Models/Builders/CreditCardPaymentProfileBuilder.php @@ -361,6 +361,28 @@ public function unsetGatewayHandle(): self return $this; } + /** + * Sets created at field. + * + * @param \DateTime|null $value + */ + public function createdAt(?\DateTime $value): self + { + $this->instance->setCreatedAt($value); + return $this; + } + + /** + * Sets updated at field. + * + * @param \DateTime|null $value + */ + public function updatedAt(?\DateTime $value): self + { + $this->instance->setUpdatedAt($value); + return $this; + } + /** * Add an additional property to this model. * diff --git a/src/Models/Builders/ListServiceCreditsResponseBuilder.php b/src/Models/Builders/ListServiceCreditsResponseBuilder.php new file mode 100644 index 00000000..ae1ca1bf --- /dev/null +++ b/src/Models/Builders/ListServiceCreditsResponseBuilder.php @@ -0,0 +1,72 @@ +instance = $instance; + } + + /** + * Initializes a new List Service Credits Response Builder object. + */ + public static function init(): self + { + return new self(new ListServiceCreditsResponse()); + } + + /** + * Sets service credits field. + * + * @param ServiceCredit1[]|null $value + */ + public function serviceCredits(?array $value): self + { + $this->instance->setServiceCredits($value); + return $this; + } + + /** + * Add an additional property to this model. + * + * @param string $name Name of property. + * @param mixed $value Value of property. + */ + public function additionalProperty(string $name, $value): self + { + $this->instance->addAdditionalProperty($name, $value); + return $this; + } + + /** + * Initializes a new List Service Credits Response object. + */ + public function build(): ListServiceCreditsResponse + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/PaypalPaymentProfileBuilder.php b/src/Models/Builders/PaypalPaymentProfileBuilder.php index ec5a7198..d1c52e62 100644 --- a/src/Models/Builders/PaypalPaymentProfileBuilder.php +++ b/src/Models/Builders/PaypalPaymentProfileBuilder.php @@ -297,6 +297,28 @@ public function paypalEmail(?string $value): self return $this; } + /** + * Sets created at field. + * + * @param \DateTime|null $value + */ + public function createdAt(?\DateTime $value): self + { + $this->instance->setCreatedAt($value); + return $this; + } + + /** + * Sets updated at field. + * + * @param \DateTime|null $value + */ + public function updatedAt(?\DateTime $value): self + { + $this->instance->setUpdatedAt($value); + return $this; + } + /** * Add an additional property to this model. * diff --git a/src/Models/Builders/ServiceCredit1Builder.php b/src/Models/Builders/ServiceCredit1Builder.php new file mode 100644 index 00000000..24b775a9 --- /dev/null +++ b/src/Models/Builders/ServiceCredit1Builder.php @@ -0,0 +1,157 @@ +instance = $instance; + } + + /** + * Initializes a new Service Credit 1 Builder object. + */ + public static function init(): self + { + return new self(new ServiceCredit1()); + } + + /** + * Sets id field. + * + * @param int|null $value + */ + public function id(?int $value): self + { + $this->instance->setId($value); + return $this; + } + + /** + * Sets amount in cents field. + * + * @param int|null $value + */ + public function amountInCents(?int $value): self + { + $this->instance->setAmountInCents($value); + return $this; + } + + /** + * Sets ending balance in cents field. + * + * @param int|null $value + */ + public function endingBalanceInCents(?int $value): self + { + $this->instance->setEndingBalanceInCents($value); + return $this; + } + + /** + * Sets entry type field. + * + * @param string|null $value + */ + public function entryType(?string $value): self + { + $this->instance->setEntryType($value); + return $this; + } + + /** + * Sets memo field. + * + * @param string|null $value + */ + public function memo(?string $value): self + { + $this->instance->setMemo($value); + return $this; + } + + /** + * Sets invoice uid field. + * + * @param string|null $value + */ + public function invoiceUid(?string $value): self + { + $this->instance->setInvoiceUid($value); + return $this; + } + + /** + * Unsets invoice uid field. + */ + public function unsetInvoiceUid(): self + { + $this->instance->unsetInvoiceUid(); + return $this; + } + + /** + * Sets remaining balance in cents field. + * + * @param int|null $value + */ + public function remainingBalanceInCents(?int $value): self + { + $this->instance->setRemainingBalanceInCents($value); + return $this; + } + + /** + * Sets created at field. + * + * @param \DateTime|null $value + */ + public function createdAt(?\DateTime $value): self + { + $this->instance->setCreatedAt($value); + return $this; + } + + /** + * Add an additional property to this model. + * + * @param string $name Name of property. + * @param mixed $value Value of property. + */ + public function additionalProperty(string $name, $value): self + { + $this->instance->addAdditionalProperty($name, $value); + return $this; + } + + /** + * Initializes a new Service Credit 1 object. + */ + public function build(): ServiceCredit1 + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/SubscriptionGroupCreditCardBuilder.php b/src/Models/Builders/SubscriptionGroupCreditCardBuilder.php index 60488ba1..98030f6b 100644 --- a/src/Models/Builders/SubscriptionGroupCreditCardBuilder.php +++ b/src/Models/Builders/SubscriptionGroupCreditCardBuilder.php @@ -38,39 +38,6 @@ public static function init(): self return new self(new SubscriptionGroupCreditCard()); } - /** - * Sets full number field. - * - * @param string|int|null $value - */ - public function fullNumber($value): self - { - $this->instance->setFullNumber($value); - return $this; - } - - /** - * Sets expiration month field. - * - * @param string|int|null $value - */ - public function expirationMonth($value): self - { - $this->instance->setExpirationMonth($value); - return $this; - } - - /** - * Sets expiration year field. - * - * @param string|int|null $value - */ - public function expirationYear($value): self - { - $this->instance->setExpirationYear($value); - return $this; - } - /** * Sets chargify token field. * @@ -203,6 +170,39 @@ public function billingCountry(?string $value): self return $this; } + /** + * Sets full number field. + * + * @param string|int|null $value + */ + public function fullNumber($value): self + { + $this->instance->setFullNumber($value); + return $this; + } + + /** + * Sets expiration month field. + * + * @param string|int|null $value + */ + public function expirationMonth($value): self + { + $this->instance->setExpirationMonth($value); + return $this; + } + + /** + * Sets expiration year field. + * + * @param string|int|null $value + */ + public function expirationYear($value): self + { + $this->instance->setExpirationYear($value); + return $this; + } + /** * Sets last four field. * diff --git a/src/Models/Builders/UpdateSubscriptionBuilder.php b/src/Models/Builders/UpdateSubscriptionBuilder.php index 9762594a..ac3816ee 100644 --- a/src/Models/Builders/UpdateSubscriptionBuilder.php +++ b/src/Models/Builders/UpdateSubscriptionBuilder.php @@ -118,6 +118,28 @@ public function snapDay($value): self return $this; } + /** + * Sets initial billing at field. + * + * @param \DateTime|null $value + */ + public function initialBillingAt(?\DateTime $value): self + { + $this->instance->setInitialBillingAt($value); + return $this; + } + + /** + * Sets defer signup field. + * + * @param bool|null $value + */ + public function deferSignup(?bool $value): self + { + $this->instance->setDeferSignup($value); + return $this; + } + /** * Sets next billing at field. * @@ -129,6 +151,17 @@ public function nextBillingAt(?\DateTime $value): self return $this; } + /** + * Sets expires at field. + * + * @param \DateTime|null $value + */ + public function expiresAt(?\DateTime $value): self + { + $this->instance->setExpiresAt($value); + return $this; + } + /** * Sets payment collection method field. * diff --git a/src/Models/Component.php b/src/Models/Component.php index 5b33a14e..7bf1dd97 100644 --- a/src/Models/Component.php +++ b/src/Models/Component.php @@ -56,6 +56,11 @@ class Component implements \JsonSerializable */ private $productFamilyName; + /** + * @var string|null + */ + private $productFamilyHandle; + /** * @var array */ @@ -385,6 +390,26 @@ public function setProductFamilyName(?string $productFamilyName): void $this->productFamilyName = $productFamilyName; } + /** + * Returns Product Family Handle. + * The handle of the Product Family to which the Component belongs + */ + public function getProductFamilyHandle(): ?string + { + return $this->productFamilyHandle; + } + + /** + * Sets Product Family Handle. + * The handle of the Product Family to which the Component belongs + * + * @maps product_family_handle + */ + public function setProductFamilyHandle(?string $productFamilyHandle): void + { + $this->productFamilyHandle = $productFamilyHandle; + } + /** * Returns Price Per Unit in Cents. * deprecated - use unit_price instead @@ -1124,6 +1149,7 @@ public function __toString(): string 'unitPrice' => $this->getUnitPrice(), 'productFamilyId' => $this->productFamilyId, 'productFamilyName' => $this->productFamilyName, + 'productFamilyHandle' => $this->productFamilyHandle, 'pricePerUnitInCents' => $this->getPricePerUnitInCents(), 'kind' => $this->kind, 'archived' => $this->archived, @@ -1219,6 +1245,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->productFamilyName)) { $json['product_family_name'] = $this->productFamilyName; } + if (isset($this->productFamilyHandle)) { + $json['product_family_handle'] = $this->productFamilyHandle; + } if (!empty($this->pricePerUnitInCents)) { $json['price_per_unit_in_cents'] = $this->pricePerUnitInCents['value']; } diff --git a/src/Models/CouponRequest.php b/src/Models/CouponRequest.php index 485adb66..476e05ce 100644 --- a/src/Models/CouponRequest.php +++ b/src/Models/CouponRequest.php @@ -50,8 +50,8 @@ public function setCoupon(?CouponPayload $coupon): void /** * Returns Restricted Products. - * An object where the keys are product_ids and the values are booleans indicating if the coupon should - * be applicable to the product + * An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values are + * booleans indicating if the coupon should be applicable to the product * * @return array|null */ @@ -62,8 +62,8 @@ public function getRestrictedProducts(): ?array /** * Sets Restricted Products. - * An object where the keys are product_ids and the values are booleans indicating if the coupon should - * be applicable to the product + * An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values are + * booleans indicating if the coupon should be applicable to the product * * @maps restricted_products * @@ -76,8 +76,8 @@ public function setRestrictedProducts(?array $restrictedProducts): void /** * Returns Restricted Components. - * An object where the keys are component_ids and the values are booleans indicating if the coupon - * should be applicable to the component + * An object where the keys are component IDs or handles (prefixed with 'handle:'), and the values are + * booleans indicating if the coupon should be applicable to the component * * @return array|null */ @@ -88,8 +88,8 @@ public function getRestrictedComponents(): ?array /** * Sets Restricted Components. - * An object where the keys are component_ids and the values are booleans indicating if the coupon - * should be applicable to the component + * An object where the keys are component IDs or handles (prefixed with 'handle:'), and the values are + * booleans indicating if the coupon should be applicable to the component * * @maps restricted_components * diff --git a/src/Models/CreateSubscription.php b/src/Models/CreateSubscription.php index f2539ad4..7705065e 100644 --- a/src/Models/CreateSubscription.php +++ b/src/Models/CreateSubscription.php @@ -81,6 +81,11 @@ class CreateSubscription implements \JsonSerializable */ private $initialBillingAt; + /** + * @var bool|null + */ + private $deferSignup = false; + /** * @var int|null */ @@ -545,16 +550,16 @@ public function setNextBillingAt(?\DateTime $nextBillingAt): void /** * Returns Initial Billing At. - * (Optional) Set this attribute to a future date/time to create a subscription in the "Awaiting - * Signup" state, rather than "Active" or "Trialing". See the notes on “Date/Time Format” in our - * [subscription import documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213- - * Advanced-Billing-Subscription-Imports#date-format). In the "Awaiting Signup" state, a subscription - * behaves like any other. It can be canceled, allocated to, had its billing date changed. etc. When - * the initial_billing_at date hits, the subscription will transition to the expected state. If the - * product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees - * will be respected either before or after the trial, as configured on the price point. If the payment - * is due at the initial_billing_at and it fails the subscription will be immediately canceled. See - * further notes in the section on Delayed Signups. + * (Optional) Set this attribute to a future date/time to create a subscription in the Awaiting Signup + * state, rather than Active or Trialing. You can omit the initial_billing_at date to activate the + * subscription immediately. In the Awaiting Signup state, a subscription behaves like any other. It + * can be canceled, allocated to, or have its billing date changed. etc. When the initial_billing_at + * date hits, the subscription will transition to the expected state. If the product has a trial, the + * subscription will enter a trial, otherwise it will go active. Setup fees will be respected either + * before or after the trial, as configured on the price point. If the payment is due at the + * initial_billing_at and it fails the subscription will be immediately canceled. See the [subscription + * import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription- + * Imports#date-format) documentation for more information about Date/Time Formats. */ public function getInitialBillingAt(): ?\DateTime { @@ -563,16 +568,16 @@ public function getInitialBillingAt(): ?\DateTime /** * Sets Initial Billing At. - * (Optional) Set this attribute to a future date/time to create a subscription in the "Awaiting - * Signup" state, rather than "Active" or "Trialing". See the notes on “Date/Time Format” in our - * [subscription import documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213- - * Advanced-Billing-Subscription-Imports#date-format). In the "Awaiting Signup" state, a subscription - * behaves like any other. It can be canceled, allocated to, had its billing date changed. etc. When - * the initial_billing_at date hits, the subscription will transition to the expected state. If the - * product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees - * will be respected either before or after the trial, as configured on the price point. If the payment - * is due at the initial_billing_at and it fails the subscription will be immediately canceled. See - * further notes in the section on Delayed Signups. + * (Optional) Set this attribute to a future date/time to create a subscription in the Awaiting Signup + * state, rather than Active or Trialing. You can omit the initial_billing_at date to activate the + * subscription immediately. In the Awaiting Signup state, a subscription behaves like any other. It + * can be canceled, allocated to, or have its billing date changed. etc. When the initial_billing_at + * date hits, the subscription will transition to the expected state. If the product has a trial, the + * subscription will enter a trial, otherwise it will go active. Setup fees will be respected either + * before or after the trial, as configured on the price point. If the payment is due at the + * initial_billing_at and it fails the subscription will be immediately canceled. See the [subscription + * import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription- + * Imports#date-format) documentation for more information about Date/Time Formats. * * @maps initial_billing_at * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime @@ -582,6 +587,38 @@ public function setInitialBillingAt(?\DateTime $initialBillingAt): void $this->initialBillingAt = $initialBillingAt; } + /** + * Returns Defer Signup. + * (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. + * Use this when you want to create a subscription that has an unknown first billing date. When the + * first billing date is known, update a subscription and set the `initial_billing_at` date. The + * subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit + * the initial_billing_at date to activate the subscription immediately. See [Subscription + * States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for + * more information. + */ + public function getDeferSignup(): ?bool + { + return $this->deferSignup; + } + + /** + * Sets Defer Signup. + * (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. + * Use this when you want to create a subscription that has an unknown first billing date. When the + * first billing date is known, update a subscription and set the `initial_billing_at` date. The + * subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit + * the initial_billing_at date to activate the subscription immediately. See [Subscription + * States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for + * more information. + * + * @maps defer_signup + */ + public function setDeferSignup(?bool $deferSignup): void + { + $this->deferSignup = $deferSignup; + } + /** * Returns Stored Credential Transaction Id. * For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous @@ -654,7 +691,7 @@ public function setPaymentProfileId(?int $paymentProfileId): void /** * Returns Reference. - * The reference value (provided by your app) for the subscription itelf. + * The reference value (provided by your app) for the subscription itself. */ public function getReference(): ?string { @@ -663,7 +700,7 @@ public function getReference(): ?string /** * Sets Reference. - * The reference value (provided by your app) for the subscription itelf. + * The reference value (provided by your app) for the subscription itself. * * @maps reference */ @@ -1113,7 +1150,7 @@ public function setReasonCode(?string $reasonCode): void /** * Returns Product Change Delayed. - * (Optional, used only for Delayed Product Change When set to true, indicates that a changed value for + * (Optional) used only for Delayed Product Change When set to true, indicates that a changed value for * product_handle should schedule the product change to the next subscription renewal. */ public function getProductChangeDelayed(): ?bool @@ -1123,7 +1160,7 @@ public function getProductChangeDelayed(): ?bool /** * Sets Product Change Delayed. - * (Optional, used only for Delayed Product Change When set to true, indicates that a changed value for + * (Optional) used only for Delayed Product Change When set to true, indicates that a changed value for * product_handle should schedule the product change to the next subscription renewal. * * @maps product_change_delayed @@ -1410,6 +1447,7 @@ public function __toString(): string 'customerId' => $this->customerId, 'nextBillingAt' => $this->nextBillingAt, 'initialBillingAt' => $this->initialBillingAt, + 'deferSignup' => $this->deferSignup, 'storedCredentialTransactionId' => $this->storedCredentialTransactionId, 'salesRepId' => $this->salesRepId, 'paymentProfileId' => $this->paymentProfileId, @@ -1533,6 +1571,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->initialBillingAt)) { $json['initial_billing_at'] = DateTimeHelper::toRfc3339DateTime($this->initialBillingAt); } + if (isset($this->deferSignup)) { + $json['defer_signup'] = $this->deferSignup; + } if (isset($this->storedCredentialTransactionId)) { $json['stored_credential_transaction_id'] = $this->storedCredentialTransactionId; } diff --git a/src/Models/CreditCardPaymentProfile.php b/src/Models/CreditCardPaymentProfile.php index d30ead77..cd146bda 100644 --- a/src/Models/CreditCardPaymentProfile.php +++ b/src/Models/CreditCardPaymentProfile.php @@ -11,6 +11,7 @@ namespace AdvancedBillingLib\Models; use AdvancedBillingLib\ApiHelper; +use AdvancedBillingLib\Utils\DateTimeHelper; use stdClass; class CreditCardPaymentProfile implements \JsonSerializable @@ -125,6 +126,16 @@ class CreditCardPaymentProfile implements \JsonSerializable */ private $gatewayHandle = []; + /** + * @var \DateTime|null + */ + private $createdAt; + + /** + * @var \DateTime|null + */ + private $updatedAt; + /** * @param string $paymentType */ @@ -701,6 +712,48 @@ public function unsetGatewayHandle(): void $this->gatewayHandle = []; } + /** + * Returns Created At. + * A timestamp indicating when this payment profile was created + */ + public function getCreatedAt(): ?\DateTime + { + return $this->createdAt; + } + + /** + * Sets Created At. + * A timestamp indicating when this payment profile was created + * + * @maps created_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setCreatedAt(?\DateTime $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * Returns Updated At. + * A timestamp indicating when this payment profile was last updated + */ + public function getUpdatedAt(): ?\DateTime + { + return $this->updatedAt; + } + + /** + * Sets Updated At. + * A timestamp indicating when this payment profile was last updated + * + * @maps updated_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setUpdatedAt(?\DateTime $updatedAt): void + { + $this->updatedAt = $updatedAt; + } + /** * Converts the CreditCardPaymentProfile object to a human-readable string representation. * @@ -733,6 +786,8 @@ public function __toString(): string 'chargifyToken' => $this->chargifyToken, 'siteGatewaySettingId' => $this->getSiteGatewaySettingId(), 'gatewayHandle' => $this->getGatewayHandle(), + 'createdAt' => $this->createdAt, + 'updatedAt' => $this->updatedAt, 'additionalProperties' => $this->additionalProperties ] ); @@ -842,6 +897,12 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->gatewayHandle)) { $json['gateway_handle'] = $this->gatewayHandle['value']; } + if (isset($this->createdAt)) { + $json['created_at'] = DateTimeHelper::toRfc3339DateTime($this->createdAt); + } + if (isset($this->updatedAt)) { + $json['updated_at'] = DateTimeHelper::toRfc3339DateTime($this->updatedAt); + } $json = array_merge($json, $this->additionalProperties); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; diff --git a/src/Models/ListServiceCreditsResponse.php b/src/Models/ListServiceCreditsResponse.php new file mode 100644 index 00000000..44924c19 --- /dev/null +++ b/src/Models/ListServiceCreditsResponse.php @@ -0,0 +1,105 @@ +serviceCredits; + } + + /** + * Sets Service Credits. + * + * @maps service_credits + * + * @param ServiceCredit1[]|null $serviceCredits + */ + public function setServiceCredits(?array $serviceCredits): void + { + $this->serviceCredits = $serviceCredits; + } + + /** + * Converts the ListServiceCreditsResponse object to a human-readable string representation. + * + * @return string The string representation of the ListServiceCreditsResponse object. + */ + public function __toString(): string + { + return ApiHelper::stringify( + 'ListServiceCreditsResponse', + ['serviceCredits' => $this->serviceCredits, 'additionalProperties' => $this->additionalProperties] + ); + } + + private $additionalProperties = []; + + /** + * Add an additional property to this model. + * + * @param string $name Name of property. + * @param mixed $value Value of property. + */ + public function addAdditionalProperty(string $name, $value) + { + $this->additionalProperties[$name] = $value; + } + + /** + * Find an additional property by name in this model or false if property does not exist. + * + * @param string $name Name of property. + * + * @return mixed|false Value of the property. + */ + public function findAdditionalProperty(string $name) + { + if (isset($this->additionalProperties[$name])) { + return $this->additionalProperties[$name]; + } + return false; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + if (isset($this->serviceCredits)) { + $json['service_credits'] = $this->serviceCredits; + } + $json = array_merge($json, $this->additionalProperties); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/OverrideSubscription.php b/src/Models/OverrideSubscription.php index b7c47fd9..2f8bd22c 100644 --- a/src/Models/OverrideSubscription.php +++ b/src/Models/OverrideSubscription.php @@ -111,7 +111,8 @@ public function setCancellationMessage(?string $cancellationMessage): void * Returns Expires At. * Can be used to record an external expiration date. Chargify sets this field automatically when a * subscription expires (ceases billing) after a prescribed amount of time. Only ISO8601 format is - * supported. + * supported. This field is not supported when Multi-frequency is enabled for the Site. To change the + * Term End of a Subscription, use the Update Subscription endpoint. */ public function getExpiresAt(): ?\DateTime { @@ -122,7 +123,8 @@ public function getExpiresAt(): ?\DateTime * Sets Expires At. * Can be used to record an external expiration date. Chargify sets this field automatically when a * subscription expires (ceases billing) after a prescribed amount of time. Only ISO8601 format is - * supported. + * supported. This field is not supported when Multi-frequency is enabled for the Site. To change the + * Term End of a Subscription, use the Update Subscription endpoint. * * @maps expires_at * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime diff --git a/src/Models/PaypalPaymentProfile.php b/src/Models/PaypalPaymentProfile.php index 922087ea..f979a8aa 100644 --- a/src/Models/PaypalPaymentProfile.php +++ b/src/Models/PaypalPaymentProfile.php @@ -11,6 +11,7 @@ namespace AdvancedBillingLib\Models; use AdvancedBillingLib\ApiHelper; +use AdvancedBillingLib\Utils\DateTimeHelper; use stdClass; class PaypalPaymentProfile implements \JsonSerializable @@ -100,6 +101,16 @@ class PaypalPaymentProfile implements \JsonSerializable */ private $paypalEmail; + /** + * @var \DateTime|null + */ + private $createdAt; + + /** + * @var \DateTime|null + */ + private $updatedAt; + /** * @param string $paymentType */ @@ -546,6 +557,48 @@ public function setPaypalEmail(?string $paypalEmail): void $this->paypalEmail = $paypalEmail; } + /** + * Returns Created At. + * A timestamp indicating when this payment profile was created + */ + public function getCreatedAt(): ?\DateTime + { + return $this->createdAt; + } + + /** + * Sets Created At. + * A timestamp indicating when this payment profile was created + * + * @maps created_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setCreatedAt(?\DateTime $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * Returns Updated At. + * A timestamp indicating when this payment profile was last updated + */ + public function getUpdatedAt(): ?\DateTime + { + return $this->updatedAt; + } + + /** + * Sets Updated At. + * A timestamp indicating when this payment profile was last updated + * + * @maps updated_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setUpdatedAt(?\DateTime $updatedAt): void + { + $this->updatedAt = $updatedAt; + } + /** * Converts the PaypalPaymentProfile object to a human-readable string representation. * @@ -573,6 +626,8 @@ public function __toString(): string 'siteGatewaySettingId' => $this->getSiteGatewaySettingId(), 'gatewayHandle' => $this->getGatewayHandle(), 'paypalEmail' => $this->paypalEmail, + 'createdAt' => $this->createdAt, + 'updatedAt' => $this->updatedAt, 'additionalProperties' => $this->additionalProperties ] ); @@ -667,6 +722,12 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->paypalEmail)) { $json['paypal_email'] = $this->paypalEmail; } + if (isset($this->createdAt)) { + $json['created_at'] = DateTimeHelper::toRfc3339DateTime($this->createdAt); + } + if (isset($this->updatedAt)) { + $json['updated_at'] = DateTimeHelper::toRfc3339DateTime($this->updatedAt); + } $json = array_merge($json, $this->additionalProperties); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; diff --git a/src/Models/ServiceCredit1.php b/src/Models/ServiceCredit1.php new file mode 100644 index 00000000..8f2dee53 --- /dev/null +++ b/src/Models/ServiceCredit1.php @@ -0,0 +1,322 @@ +id; + } + + /** + * Sets Id. + * + * @maps id + */ + public function setId(?int $id): void + { + $this->id = $id; + } + + /** + * Returns Amount in Cents. + * The amount in cents of the entry + */ + public function getAmountInCents(): ?int + { + return $this->amountInCents; + } + + /** + * Sets Amount in Cents. + * The amount in cents of the entry + * + * @maps amount_in_cents + */ + public function setAmountInCents(?int $amountInCents): void + { + $this->amountInCents = $amountInCents; + } + + /** + * Returns Ending Balance in Cents. + * The new balance for the credit account + */ + public function getEndingBalanceInCents(): ?int + { + return $this->endingBalanceInCents; + } + + /** + * Sets Ending Balance in Cents. + * The new balance for the credit account + * + * @maps ending_balance_in_cents + */ + public function setEndingBalanceInCents(?int $endingBalanceInCents): void + { + $this->endingBalanceInCents = $endingBalanceInCents; + } + + /** + * Returns Entry Type. + * The type of entry + */ + public function getEntryType(): ?string + { + return $this->entryType; + } + + /** + * Sets Entry Type. + * The type of entry + * + * @maps entry_type + * @factory \AdvancedBillingLib\Models\ServiceCreditType::checkValue + */ + public function setEntryType(?string $entryType): void + { + $this->entryType = $entryType; + } + + /** + * Returns Memo. + * The memo attached to the entry + */ + public function getMemo(): ?string + { + return $this->memo; + } + + /** + * Sets Memo. + * The memo attached to the entry + * + * @maps memo + */ + public function setMemo(?string $memo): void + { + $this->memo = $memo; + } + + /** + * Returns Invoice Uid. + * The invoice uid associated with the entry. Only present for debit entries + */ + public function getInvoiceUid(): ?string + { + if (count($this->invoiceUid) == 0) { + return null; + } + return $this->invoiceUid['value']; + } + + /** + * Sets Invoice Uid. + * The invoice uid associated with the entry. Only present for debit entries + * + * @maps invoice_uid + */ + public function setInvoiceUid(?string $invoiceUid): void + { + $this->invoiceUid['value'] = $invoiceUid; + } + + /** + * Unsets Invoice Uid. + * The invoice uid associated with the entry. Only present for debit entries + */ + public function unsetInvoiceUid(): void + { + $this->invoiceUid = []; + } + + /** + * Returns Remaining Balance in Cents. + * The remaining balance for the entry + */ + public function getRemainingBalanceInCents(): ?int + { + return $this->remainingBalanceInCents; + } + + /** + * Sets Remaining Balance in Cents. + * The remaining balance for the entry + * + * @maps remaining_balance_in_cents + */ + public function setRemainingBalanceInCents(?int $remainingBalanceInCents): void + { + $this->remainingBalanceInCents = $remainingBalanceInCents; + } + + /** + * Returns Created At. + * The date and time the entry was created + */ + public function getCreatedAt(): ?\DateTime + { + return $this->createdAt; + } + + /** + * Sets Created At. + * The date and time the entry was created + * + * @maps created_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setCreatedAt(?\DateTime $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * Converts the ServiceCredit1 object to a human-readable string representation. + * + * @return string The string representation of the ServiceCredit1 object. + */ + public function __toString(): string + { + return ApiHelper::stringify( + 'ServiceCredit1', + [ + 'id' => $this->id, + 'amountInCents' => $this->amountInCents, + 'endingBalanceInCents' => $this->endingBalanceInCents, + 'entryType' => $this->entryType, + 'memo' => $this->memo, + 'invoiceUid' => $this->getInvoiceUid(), + 'remainingBalanceInCents' => $this->remainingBalanceInCents, + 'createdAt' => $this->createdAt, + 'additionalProperties' => $this->additionalProperties + ] + ); + } + + private $additionalProperties = []; + + /** + * Add an additional property to this model. + * + * @param string $name Name of property. + * @param mixed $value Value of property. + */ + public function addAdditionalProperty(string $name, $value) + { + $this->additionalProperties[$name] = $value; + } + + /** + * Find an additional property by name in this model or false if property does not exist. + * + * @param string $name Name of property. + * + * @return mixed|false Value of the property. + */ + public function findAdditionalProperty(string $name) + { + if (isset($this->additionalProperties[$name])) { + return $this->additionalProperties[$name]; + } + return false; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + if (isset($this->id)) { + $json['id'] = $this->id; + } + if (isset($this->amountInCents)) { + $json['amount_in_cents'] = $this->amountInCents; + } + if (isset($this->endingBalanceInCents)) { + $json['ending_balance_in_cents'] = $this->endingBalanceInCents; + } + if (isset($this->entryType)) { + $json['entry_type'] = ServiceCreditType::checkValue($this->entryType); + } + if (isset($this->memo)) { + $json['memo'] = $this->memo; + } + if (!empty($this->invoiceUid)) { + $json['invoice_uid'] = $this->invoiceUid['value']; + } + if (isset($this->remainingBalanceInCents)) { + $json['remaining_balance_in_cents'] = $this->remainingBalanceInCents; + } + if (isset($this->createdAt)) { + $json['created_at'] = DateTimeHelper::toRfc3339DateTime($this->createdAt); + } + $json = array_merge($json, $this->additionalProperties); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/SubscriptionGroupCreditCard.php b/src/Models/SubscriptionGroupCreditCard.php index 6390e76d..5675e515 100644 --- a/src/Models/SubscriptionGroupCreditCard.php +++ b/src/Models/SubscriptionGroupCreditCard.php @@ -15,21 +15,6 @@ class SubscriptionGroupCreditCard implements \JsonSerializable { - /** - * @var string|int|null - */ - private $fullNumber; - - /** - * @var string|int|null - */ - private $expirationMonth; - - /** - * @var string|int|null - */ - private $expirationYear; - /** * @var string|null */ @@ -91,98 +76,44 @@ class SubscriptionGroupCreditCard implements \JsonSerializable private $billingCountry; /** - * @var string|null + * @var string|int|null */ - private $lastFour; + private $fullNumber; /** - * @var string|null + * @var string|int|null */ - private $cardType; + private $expirationMonth; /** - * @var string|null + * @var string|int|null */ - private $customerVaultToken; + private $expirationYear; /** * @var string|null */ - private $cvv; + private $lastFour; /** * @var string|null */ - private $paymentType; - - /** - * Returns Full Number. - * - * @return string|int|null - */ - public function getFullNumber() - { - return $this->fullNumber; - } - - /** - * Sets Full Number. - * - * @maps full_number - * @mapsBy anyOf(oneOf(string,int),null) - * - * @param string|int|null $fullNumber - */ - public function setFullNumber($fullNumber): void - { - $this->fullNumber = $fullNumber; - } - - /** - * Returns Expiration Month. - * - * @return string|int|null - */ - public function getExpirationMonth() - { - return $this->expirationMonth; - } + private $cardType; /** - * Sets Expiration Month. - * - * @maps expiration_month - * @mapsBy anyOf(oneOf(string,int),null) - * - * @param string|int|null $expirationMonth + * @var string|null */ - public function setExpirationMonth($expirationMonth): void - { - $this->expirationMonth = $expirationMonth; - } + private $customerVaultToken; /** - * Returns Expiration Year. - * - * @return string|int|null + * @var string|null */ - public function getExpirationYear() - { - return $this->expirationYear; - } + private $cvv; /** - * Sets Expiration Year. - * - * @maps expiration_year - * @mapsBy anyOf(oneOf(string,int),null) - * - * @param string|int|null $expirationYear + * @var string|null */ - public function setExpirationYear($expirationYear): void - { - $this->expirationYear = $expirationYear; - } + private $paymentType; /** * Returns Chargify Token. @@ -403,6 +334,75 @@ public function setBillingCountry(?string $billingCountry): void $this->billingCountry = $billingCountry; } + /** + * Returns Full Number. + * + * @return string|int|null + */ + public function getFullNumber() + { + return $this->fullNumber; + } + + /** + * Sets Full Number. + * + * @maps full_number + * @mapsBy anyOf(oneOf(string,int),null) + * + * @param string|int|null $fullNumber + */ + public function setFullNumber($fullNumber): void + { + $this->fullNumber = $fullNumber; + } + + /** + * Returns Expiration Month. + * + * @return string|int|null + */ + public function getExpirationMonth() + { + return $this->expirationMonth; + } + + /** + * Sets Expiration Month. + * + * @maps expiration_month + * @mapsBy anyOf(oneOf(string,int),null) + * + * @param string|int|null $expirationMonth + */ + public function setExpirationMonth($expirationMonth): void + { + $this->expirationMonth = $expirationMonth; + } + + /** + * Returns Expiration Year. + * + * @return string|int|null + */ + public function getExpirationYear() + { + return $this->expirationYear; + } + + /** + * Sets Expiration Year. + * + * @maps expiration_year + * @mapsBy anyOf(oneOf(string,int),null) + * + * @param string|int|null $expirationYear + */ + public function setExpirationYear($expirationYear): void + { + $this->expirationYear = $expirationYear; + } + /** * Returns Last Four. */ @@ -506,9 +506,6 @@ public function __toString(): string return ApiHelper::stringify( 'SubscriptionGroupCreditCard', [ - 'fullNumber' => $this->fullNumber, - 'expirationMonth' => $this->expirationMonth, - 'expirationYear' => $this->expirationYear, 'chargifyToken' => $this->chargifyToken, 'vaultToken' => $this->vaultToken, 'currentVault' => $this->currentVault, @@ -521,6 +518,9 @@ public function __toString(): string 'billingState' => $this->billingState, 'billingZip' => $this->billingZip, 'billingCountry' => $this->billingCountry, + 'fullNumber' => $this->fullNumber, + 'expirationMonth' => $this->expirationMonth, + 'expirationYear' => $this->expirationYear, 'lastFour' => $this->lastFour, 'cardType' => $this->cardType, 'customerVaultToken' => $this->customerVaultToken, @@ -571,27 +571,6 @@ public function findAdditionalProperty(string $name) public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; - if (isset($this->fullNumber)) { - $json['full_number'] = - ApiHelper::getJsonHelper()->verifyTypes( - $this->fullNumber, - 'anyOf(oneOf(string,int),null)' - ); - } - if (isset($this->expirationMonth)) { - $json['expiration_month'] = - ApiHelper::getJsonHelper()->verifyTypes( - $this->expirationMonth, - 'anyOf(oneOf(string,int),null)' - ); - } - if (isset($this->expirationYear)) { - $json['expiration_year'] = - ApiHelper::getJsonHelper()->verifyTypes( - $this->expirationYear, - 'anyOf(oneOf(string,int),null)' - ); - } if (isset($this->chargifyToken)) { $json['chargify_token'] = $this->chargifyToken; } @@ -628,6 +607,27 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->billingCountry)) { $json['billing_country'] = $this->billingCountry; } + if (isset($this->fullNumber)) { + $json['full_number'] = + ApiHelper::getJsonHelper()->verifyTypes( + $this->fullNumber, + 'anyOf(oneOf(string,int),null)' + ); + } + if (isset($this->expirationMonth)) { + $json['expiration_month'] = + ApiHelper::getJsonHelper()->verifyTypes( + $this->expirationMonth, + 'anyOf(oneOf(string,int),null)' + ); + } + if (isset($this->expirationYear)) { + $json['expiration_year'] = + ApiHelper::getJsonHelper()->verifyTypes( + $this->expirationYear, + 'anyOf(oneOf(string,int),null)' + ); + } if (isset($this->lastFour)) { $json['last_four'] = $this->lastFour; } diff --git a/src/Models/UpdateSubscription.php b/src/Models/UpdateSubscription.php index ed2f7d14..02eff1e8 100644 --- a/src/Models/UpdateSubscription.php +++ b/src/Models/UpdateSubscription.php @@ -51,11 +51,26 @@ class UpdateSubscription implements \JsonSerializable */ private $snapDay; + /** + * @var \DateTime|null + */ + private $initialBillingAt; + + /** + * @var bool|null + */ + private $deferSignup = false; + /** * @var \DateTime|null */ private $nextBillingAt; + /** + * @var \DateTime|null + */ + private $expiresAt; + /** * @var string|null */ @@ -251,6 +266,77 @@ public function setSnapDay($snapDay): void $this->snapDay = $snapDay; } + /** + * Returns Initial Billing At. + * (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup + * Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. + * It can be canceled, allocated to, or have its billing date changed. etc. When the + * `initial_billing_at` date hits, the subscription will transition to the expected state. If the + * product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees + * will be respected either before or after the trial, as configured on the price point. If the payment + * is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can + * omit the initial_billing_at date to activate the subscription immediately. See the [subscription + * import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription- + * Imports#date-format) documentation for more information about Date/Time formats. + */ + public function getInitialBillingAt(): ?\DateTime + { + return $this->initialBillingAt; + } + + /** + * Sets Initial Billing At. + * (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup + * Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. + * It can be canceled, allocated to, or have its billing date changed. etc. When the + * `initial_billing_at` date hits, the subscription will transition to the expected state. If the + * product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees + * will be respected either before or after the trial, as configured on the price point. If the payment + * is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can + * omit the initial_billing_at date to activate the subscription immediately. See the [subscription + * import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription- + * Imports#date-format) documentation for more information about Date/Time formats. + * + * @maps initial_billing_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setInitialBillingAt(?\DateTime $initialBillingAt): void + { + $this->initialBillingAt = $initialBillingAt; + } + + /** + * Returns Defer Signup. + * (Optional) Set this attribute to true to move the subscription from Awaiting Signup, to Awaiting + * Signup Date. Use this when you want to update a subscription that has an unknown initial billing + * date. When the first billing date is known, update a subscription to set the `initial_billing_at` + * date. The subscription moves to the awaiting signup with a scheduled initial billing date. You can + * omit the initial_billing_at date to activate the subscription immediately. See [Subscription + * States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for + * more information. + */ + public function getDeferSignup(): ?bool + { + return $this->deferSignup; + } + + /** + * Sets Defer Signup. + * (Optional) Set this attribute to true to move the subscription from Awaiting Signup, to Awaiting + * Signup Date. Use this when you want to update a subscription that has an unknown initial billing + * date. When the first billing date is known, update a subscription to set the `initial_billing_at` + * date. The subscription moves to the awaiting signup with a scheduled initial billing date. You can + * omit the initial_billing_at date to activate the subscription immediately. See [Subscription + * States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for + * more information. + * + * @maps defer_signup + */ + public function setDeferSignup(?bool $deferSignup): void + { + $this->deferSignup = $deferSignup; + } + /** * Returns Next Billing At. */ @@ -270,6 +356,29 @@ public function setNextBillingAt(?\DateTime $nextBillingAt): void $this->nextBillingAt = $nextBillingAt; } + /** + * Returns Expires At. + * Timestamp giving the expiration date of this subscription (if any). You may manually change the + * expiration date at any point during a subscription period. + */ + public function getExpiresAt(): ?\DateTime + { + return $this->expiresAt; + } + + /** + * Sets Expires At. + * Timestamp giving the expiration date of this subscription (if any). You may manually change the + * expiration date at any point during a subscription period. + * + * @maps expires_at + * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setExpiresAt(?\DateTime $expiresAt): void + { + $this->expiresAt = $expiresAt; + } + /** * Returns Payment Collection Method. */ @@ -524,7 +633,10 @@ public function __toString(): string 'nextProductId' => $this->nextProductId, 'nextProductPricePointId' => $this->nextProductPricePointId, 'snapDay' => $this->snapDay, + 'initialBillingAt' => $this->initialBillingAt, + 'deferSignup' => $this->deferSignup, 'nextBillingAt' => $this->nextBillingAt, + 'expiresAt' => $this->expiresAt, 'paymentCollectionMethod' => $this->paymentCollectionMethod, 'receivesInvoiceEmails' => $this->receivesInvoiceEmails, 'netTerms' => $this->netTerms, @@ -609,9 +721,18 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) ] ); } + if (isset($this->initialBillingAt)) { + $json['initial_billing_at'] = DateTimeHelper::toRfc3339DateTime($this->initialBillingAt); + } + if (isset($this->deferSignup)) { + $json['defer_signup'] = $this->deferSignup; + } if (isset($this->nextBillingAt)) { $json['next_billing_at'] = DateTimeHelper::toRfc3339DateTime($this->nextBillingAt); } + if (isset($this->expiresAt)) { + $json['expires_at'] = DateTimeHelper::toRfc3339DateTime($this->expiresAt); + } if (isset($this->paymentCollectionMethod)) { $json['payment_collection_method'] = $this->paymentCollectionMethod; } diff --git a/src/Proxy/ProxyConfigurationBuilder.php b/src/Proxy/ProxyConfigurationBuilder.php new file mode 100644 index 00000000..62b87723 --- /dev/null +++ b/src/Proxy/ProxyConfigurationBuilder.php @@ -0,0 +1,91 @@ +address = $address; + } + + /** + * Create an instance of ProxyConfigurationBuilder + */ + public static function init(string $address): self + { + return new self($address); + } + + /** + * Set proxy authentication method + */ + public function tunnel(bool $tunnel): self + { + $this->tunnel = $tunnel; + return $this; + } + + /** + * Set the proxy address + */ + public function address(string $address): self + { + $this->address = $address; + return $this; + } + + /** + * Set the proxy port + */ + public function port(int $port): self + { + $this->port = $port; + return $this; + } + + /** + * Set proxy authentication method + */ + public function authMethod(string $authMethod): self + { + $this->authMethod = $authMethod; + return $this; + } + + /** + * Set proxy username and password + */ + public function auth(string $user, string $pass): self + { + $this->user = $user; + $this->pass = $pass; + return $this; + } + + public function getConfiguration(): array + { + return [ + 'port' => $this->port, + 'tunnel' => $this->tunnel, + 'address' => $this->address, + 'auth' => ['user' => '$this->user', 'pass' => '$this->pass', 'method' => $this->authMethod] + ]; + } +} From ac3df7c8762e98e17a029818523a7f543556b6d3 Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Thu, 17 Jul 2025 13:45:12 +0200 Subject: [PATCH 02/14] Update composer lock --- composer.lock | 180 ++++++++++++++++++++++++++------------------------ 1 file changed, 95 insertions(+), 85 deletions(-) diff --git a/composer.lock b/composer.lock index 3a24a0c4..28083760 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d7ccb2f1a1dfaaa9f6337d539afdc9a7", + "content-hash": "9ff353696908373be940a372db0d43da", "packages": [ { "name": "apimatic/core", - "version": "0.3.13", + "version": "0.3.14", "source": { "type": "git", "url": "https://github.com/apimatic/core-lib-php.git", - "reference": "944678aa7017457daacd9750b96962fb693ea81a" + "reference": "c3eaad6cf0c00b793ce6d9bee8b87176247da582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/944678aa7017457daacd9750b96962fb693ea81a", - "reference": "944678aa7017457daacd9750b96962fb693ea81a", + "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/c3eaad6cf0c00b793ce6d9bee8b87176247da582", + "reference": "c3eaad6cf0c00b793ce6d9bee8b87176247da582", "shasum": "" }, "require": { @@ -56,9 +56,9 @@ ], "support": { "issues": "https://github.com/apimatic/core-lib-php/issues", - "source": "https://github.com/apimatic/core-lib-php/tree/0.3.13" + "source": "https://github.com/apimatic/core-lib-php/tree/0.3.14" }, - "time": "2024-12-18T08:29:12+00:00" + "time": "2025-02-27T06:03:30+00:00" }, { "name": "apimatic/core-interfaces", @@ -159,16 +159,16 @@ }, { "name": "apimatic/unirest-php", - "version": "4.0.5", + "version": "4.0.7", "source": { "type": "git", "url": "https://github.com/apimatic/unirest-php.git", - "reference": "e16754010c16be5473289470f129d87a0f41b55e" + "reference": "bdfd5f27c105772682c88ed671683f1bd93f4a3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/unirest-php/zipball/e16754010c16be5473289470f129d87a0f41b55e", - "reference": "e16754010c16be5473289470f129d87a0f41b55e", + "url": "https://api.github.com/repos/apimatic/unirest-php/zipball/bdfd5f27c105772682c88ed671683f1bd93f4a3c", + "reference": "bdfd5f27c105772682c88ed671683f1bd93f4a3c", "shasum": "" }, "require": { @@ -218,9 +218,9 @@ "support": { "email": "opensource@apimatic.io", "issues": "https://github.com/apimatic/unirest-php/issues", - "source": "https://github.com/apimatic/unirest-php/tree/4.0.5" + "source": "https://github.com/apimatic/unirest-php/tree/4.0.7" }, - "time": "2023-04-25T14:19:45+00:00" + "time": "2025-06-17T09:09:48+00:00" }, { "name": "php-jsonpointer/php-jsonpointer", @@ -558,26 +558,29 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.4", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=13" + }, "require-dev": { - "doctrine/coding-standard": "^9 || ^12", - "phpstan/phpstan": "1.4.10 || 2.0.3", + "doctrine/coding-standard": "^9 || ^12 || ^13", + "phpstan/phpstan": "1.4.10 || 2.1.11", "phpstan/phpstan-phpunit": "^1.0 || ^2", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", "psr/log": "^1 || ^2 || ^3" }, "suggest": { @@ -597,9 +600,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.4" + "source": "https://github.com/doctrine/deprecations/tree/1.1.5" }, - "time": "2024-12-07T21:18:45+00:00" + "time": "2025-04-07T20:06:18+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -877,16 +880,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.1", + "version": "5.6.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" + "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", - "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62", + "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62", "shasum": "" }, "require": { @@ -935,9 +938,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2" }, - "time": "2024-12-07T09:39:29+00:00" + "time": "2025-04-13T19:20:35+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -999,16 +1002,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.0.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" + "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", - "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/b9e61a61e39e02dd90944e9115241c7f7e76bfd8", + "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8", "shasum": "" }, "require": { @@ -1040,9 +1043,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.2.0" }, - "time": "2024-10-13T11:29:49+00:00" + "time": "2025-07-13T07:04:09+00:00" }, { "name": "psr/container", @@ -1165,16 +1168,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.11.2", + "version": "3.13.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079" + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1368f4a58c3c52114b86b1abe8f4098869cb0079", - "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c", + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c", "shasum": "" }, "require": { @@ -1239,29 +1242,34 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-12-11T16:04:26+00:00" + "time": "2025-06-17T22:17:01+00:00" }, { "name": "symfony/console", - "version": "v7.2.1", + "version": "v7.3.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" + "reference": "9e27aecde8f506ba0fd1d9989620c04a87697101" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", - "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "url": "https://api.github.com/repos/symfony/console/zipball/9e27aecde8f506ba0fd1d9989620c04a87697101", + "reference": "9e27aecde8f506ba0fd1d9989620c04a87697101", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0" + "symfony/string": "^7.2" }, "conflict": { "symfony/dependency-injection": "<6.4", @@ -1318,7 +1326,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.1" + "source": "https://github.com/symfony/console/tree/v7.3.1" }, "funding": [ { @@ -1334,20 +1342,20 @@ "type": "tidelift" } ], - "time": "2024-12-11T03:49:26+00:00" + "time": "2025-06-27T19:55:54+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.1", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", - "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", "shasum": "" }, "require": { @@ -1360,7 +1368,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { @@ -1385,7 +1393,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" }, "funding": [ { @@ -1401,11 +1409,11 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -1464,7 +1472,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -1484,7 +1492,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -1542,7 +1550,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" }, "funding": [ { @@ -1562,7 +1570,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -1623,7 +1631,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" }, "funding": [ { @@ -1643,19 +1651,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -1703,7 +1712,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -1719,20 +1728,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { @@ -1783,7 +1792,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" }, "funding": [ { @@ -1799,20 +1808,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-01-02T08:10:11+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.5.1", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", - "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", "shasum": "" }, "require": { @@ -1830,7 +1839,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { @@ -1866,7 +1875,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" }, "funding": [ { @@ -1882,20 +1891,20 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2025-04-25T09:37:31+00:00" }, { "name": "symfony/string", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" + "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", + "url": "https://api.github.com/repos/symfony/string/zipball/f3570b8c61ca887a9e2938e85cb6458515d2b125", + "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125", "shasum": "" }, "require": { @@ -1953,7 +1962,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.2.0" + "source": "https://github.com/symfony/string/tree/v7.3.0" }, "funding": [ { @@ -1969,7 +1978,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:26+00:00" + "time": "2025-04-20T20:19:01+00:00" }, { "name": "tysonandre/var_representation_polyfill", @@ -2099,7 +2108,8 @@ "prefer-lowest": false, "platform": { "php": "^7.2 || ^8.0", - "ext-json": "*" + "ext-json": "*", + "ext-curl": "*" }, "platform-dev": {}, "plugin-api-version": "2.6.0" From 7ceb166a7b1a0975cea53626964f2aff785eb0b1 Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Thu, 17 Jul 2025 15:28:30 +0200 Subject: [PATCH 03/14] Align test dependencies --- tests/composer.json | 6 +-- tests/composer.lock | 116 ++++++++++++++++++++++---------------------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/tests/composer.json b/tests/composer.json index 5ebcd40f..fce6f3a3 100755 --- a/tests/composer.json +++ b/tests/composer.json @@ -7,9 +7,9 @@ "require": { "php": "^7.2 || ^8.0", "ext-json": "*", - "apimatic/unirest-php": "^4.0.0", - "apimatic/core-interfaces": "~0.1.4", - "apimatic/core": "~0.3.8" + "apimatic/unirest-php": "^4.0.6", + "apimatic/core-interfaces": "~0.1.5", + "apimatic/core": "~0.3.13" }, "autoload": { "psr-4": { diff --git a/tests/composer.lock b/tests/composer.lock index 68de19a9..409ed31a 100644 --- a/tests/composer.lock +++ b/tests/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "704eca0bcb5eac13feb8a9db940491d2", + "content-hash": "2b9976ef2ab6af252c1b6bd910a215a8", "packages": [ { "name": "apimatic/core", - "version": "0.3.10", + "version": "0.3.14", "source": { "type": "git", "url": "https://github.com/apimatic/core-lib-php.git", - "reference": "8c111790b8d6f67812ba651ebb9513b5233863d0" + "reference": "c3eaad6cf0c00b793ce6d9bee8b87176247da582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/8c111790b8d6f67812ba651ebb9513b5233863d0", - "reference": "8c111790b8d6f67812ba651ebb9513b5233863d0", + "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/c3eaad6cf0c00b793ce6d9bee8b87176247da582", + "reference": "c3eaad6cf0c00b793ce6d9bee8b87176247da582", "shasum": "" }, "require": { @@ -32,7 +32,7 @@ "psr/log": "^1.1.4 || ^2.0.0 || ^3.0.0" }, "require-dev": { - "phan/phan": "5.4.2", + "phan/phan": "5.4.5", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", "squizlabs/php_codesniffer": "^3.5" }, @@ -56,9 +56,9 @@ ], "support": { "issues": "https://github.com/apimatic/core-lib-php/issues", - "source": "https://github.com/apimatic/core-lib-php/tree/0.3.10" + "source": "https://github.com/apimatic/core-lib-php/tree/0.3.14" }, - "time": "2024-05-30T06:32:24+00:00" + "time": "2025-02-27T06:03:30+00:00" }, { "name": "apimatic/core-interfaces", @@ -105,16 +105,16 @@ }, { "name": "apimatic/jsonmapper", - "version": "3.1.4", + "version": "3.1.6", "source": { "type": "git", "url": "https://github.com/apimatic/jsonmapper.git", - "reference": "407b455d2adda2efa51a44b99400389fbee0394e" + "reference": "c6cc21bd56bfe5d5822bbd08f514be465c0b24e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/jsonmapper/zipball/407b455d2adda2efa51a44b99400389fbee0394e", - "reference": "407b455d2adda2efa51a44b99400389fbee0394e", + "url": "https://api.github.com/repos/apimatic/jsonmapper/zipball/c6cc21bd56bfe5d5822bbd08f514be465c0b24e7", + "reference": "c6cc21bd56bfe5d5822bbd08f514be465c0b24e7", "shasum": "" }, "require": { @@ -153,22 +153,22 @@ "support": { "email": "mehdi.jaffery@apimatic.io", "issues": "https://github.com/apimatic/jsonmapper/issues", - "source": "https://github.com/apimatic/jsonmapper/tree/3.1.4" + "source": "https://github.com/apimatic/jsonmapper/tree/3.1.6" }, - "time": "2024-06-11T11:48:30+00:00" + "time": "2024-11-28T09:15:32+00:00" }, { "name": "apimatic/unirest-php", - "version": "4.0.5", + "version": "4.0.7", "source": { "type": "git", "url": "https://github.com/apimatic/unirest-php.git", - "reference": "e16754010c16be5473289470f129d87a0f41b55e" + "reference": "bdfd5f27c105772682c88ed671683f1bd93f4a3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/unirest-php/zipball/e16754010c16be5473289470f129d87a0f41b55e", - "reference": "e16754010c16be5473289470f129d87a0f41b55e", + "url": "https://api.github.com/repos/apimatic/unirest-php/zipball/bdfd5f27c105772682c88ed671683f1bd93f4a3c", + "reference": "bdfd5f27c105772682c88ed671683f1bd93f4a3c", "shasum": "" }, "require": { @@ -218,9 +218,9 @@ "support": { "email": "opensource@apimatic.io", "issues": "https://github.com/apimatic/unirest-php/issues", - "source": "https://github.com/apimatic/unirest-php/tree/4.0.5" + "source": "https://github.com/apimatic/unirest-php/tree/4.0.7" }, - "time": "2023-04-25T14:19:45+00:00" + "time": "2025-06-17T09:09:48+00:00" }, { "name": "php-jsonpointer/php-jsonpointer", @@ -280,16 +280,16 @@ }, { "name": "psr/log", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -324,9 +324,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-07-14T16:46:02+00:00" + "time": "2024-09-11T13:17:53+00:00" } ], "packages-dev": [ @@ -402,16 +402,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.13.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "faed855a7b5f4d4637717c2b3863e277116beb36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/faed855a7b5f4d4637717c2b3863e277116beb36", + "reference": "faed855a7b5f4d4637717c2b3863e277116beb36", "shasum": "" }, "require": { @@ -450,7 +450,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.3" }, "funding": [ { @@ -458,20 +458,20 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2025-07-05T12:25:42+00:00" }, { "name": "nikic/php-parser", - "version": "v5.0.2", + "version": "v5.5.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + "reference": "ae59794362fe85e051a58ad36b289443f57be7a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ae59794362fe85e051a58ad36b289443f57be7a9", + "reference": "ae59794362fe85e051a58ad36b289443f57be7a9", "shasum": "" }, "require": { @@ -482,7 +482,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -514,9 +514,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.5.0" }, - "time": "2024-03-05T20:51:40+00:00" + "time": "2025-05-31T08:24:38+00:00" }, { "name": "phar-io/manifest", @@ -638,35 +638,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.31", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -675,7 +675,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -704,7 +704,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -712,7 +712,7 @@ "type": "github" } ], - "time": "2024-03-02T06:37:42+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2073,13 +2073,13 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": "^7.2 || ^8.0", "ext-json": "*" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } From 3fbb5a2f5f4ed20149f0fd3c0bf1e254177b8c72 Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Fri, 18 Jul 2025 10:50:29 +0200 Subject: [PATCH 04/14] Refactor cleanupSite.sh for improved readability and error handling --- cleanupSite.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cleanupSite.sh b/cleanupSite.sh index 47ae4ce5..f59c7a53 100755 --- a/cleanupSite.sh +++ b/cleanupSite.sh @@ -1,6 +1,10 @@ -auth=$(echo "$BASIC_AUTH_USERNAME":"$BASIC_AUTH_PASSWORD" | base64) +#!/bin/bash + +set -eo pipefail + +auth=$(echo "${BASIC_AUTH_USERNAME}":"${BASIC_AUTH_PASSWORD}" | base64) curl --request POST \ - --url https://"$SUB_DOMAIN"."$DOMAIN"/sites/clear_data.json \ - --header "Authorization: Basic $auth" \ - --header 'Content-Type: application/json' \ No newline at end of file + --url https://"${SUB_DOMAIN}"."${DOMAIN}"/sites/clear_data.json \ + --header "Authorization: Basic ${auth}" \ + --header "Content-Type: application/json" From 943a8d0c22614e41ca2600204a2e6b8b3832d644 Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Fri, 18 Jul 2025 18:08:51 +0200 Subject: [PATCH 05/14] Add createdAt and updatedAt fields to TestPaymentProfileFactory --- tests/TestFactory/TestPaymentProfileFactory.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/TestFactory/TestPaymentProfileFactory.php b/tests/TestFactory/TestPaymentProfileFactory.php index 657a67f3..432f6625 100644 --- a/tests/TestFactory/TestPaymentProfileFactory.php +++ b/tests/TestFactory/TestPaymentProfileFactory.php @@ -47,6 +47,8 @@ private function fromCreditCardPaymentProfile(CreditCardPaymentProfile $paymentP ->siteGatewaySettingId($paymentProfile->getSiteGatewaySettingId()) ->gatewayHandle($paymentProfile->getGatewayHandle()) ->billingCity($paymentProfile->getBillingCity()) + ->createdAt($paymentProfile->getCreatedAt()) + ->updatedAt($paymentProfile->getUpdatedAt()) ->build(); } From 2034bf3c34773c71e8bad09f679446f841fa7a92 Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Fri, 18 Jul 2025 18:20:14 +0200 Subject: [PATCH 06/14] Improve curl command in cleanupSite.sh for better readability and debugging --- cleanupSite.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cleanupSite.sh b/cleanupSite.sh index f59c7a53..adf72de0 100755 --- a/cleanupSite.sh +++ b/cleanupSite.sh @@ -2,9 +2,10 @@ set -eo pipefail -auth=$(echo "${BASIC_AUTH_USERNAME}":"${BASIC_AUTH_PASSWORD}" | base64) +auth=$(echo "${BASIC_AUTH_USERNAME}:${BASIC_AUTH_PASSWORD}" | base64) curl --request POST \ - --url https://"${SUB_DOMAIN}"."${DOMAIN}"/sites/clear_data.json \ + --url "https://${SUB_DOMAIN}.${DOMAIN}/sites/clear_data.json" \ --header "Authorization: Basic ${auth}" \ - --header "Content-Type: application/json" + --header "Content-Type: application/json" \ + --verbose From d11658ab4ce932a6b0db45320fb1cb8aeb1bc54d Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Fri, 18 Jul 2025 18:51:35 +0200 Subject: [PATCH 07/14] Ignore order_at field in subscription JSON assertions for incomplete documentation --- tests/Controllers/SubscriptionsControllerTestAssertions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Controllers/SubscriptionsControllerTestAssertions.php b/tests/Controllers/SubscriptionsControllerTestAssertions.php index d30abc82..9d968e16 100644 --- a/tests/Controllers/SubscriptionsControllerTestAssertions.php +++ b/tests/Controllers/SubscriptionsControllerTestAssertions.php @@ -30,6 +30,7 @@ public function assertExpectedSubscriptionReturned( // Removed because of modifying value on read. unset($expectedSubscriptionJson['updated_at']); unset($subscriptionJson['updated_at']); + unset($subscriptionJson['order_at']); // TODO: Ignore order_at for now because it's not fully documented $expectedSubscription->getCustomer()->unsetDefaultAutoRenewalProfileId(); $this->testCase::assertEquals($expectedSubscriptionJson, $subscriptionJson); From 7575a9638ed84591f106d142d562c96a392d643a Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Fri, 18 Jul 2025 18:57:07 +0200 Subject: [PATCH 08/14] Remove interval_unit from component JSON assertions and add productFamilyHandle to TestComponentFactory --- tests/Controllers/ComponentsControllerTestAssertions.php | 2 ++ tests/TestFactory/TestComponentFactory.php | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/Controllers/ComponentsControllerTestAssertions.php b/tests/Controllers/ComponentsControllerTestAssertions.php index 6a2fd331..cddf8f7c 100644 --- a/tests/Controllers/ComponentsControllerTestAssertions.php +++ b/tests/Controllers/ComponentsControllerTestAssertions.php @@ -21,6 +21,8 @@ public function assertQuantityBasedComponentCreated(Component $component, Compon unset($expectedComponentJson['updated_at']); unset($componentJson['updated_at']); + unset($componentJson['interval_unit']); + $this->testCase::assertEquals($expectedComponentJson, $componentJson); } diff --git a/tests/TestFactory/TestComponentFactory.php b/tests/TestFactory/TestComponentFactory.php index e1fd9ac9..7b28532b 100644 --- a/tests/TestFactory/TestComponentFactory.php +++ b/tests/TestFactory/TestComponentFactory.php @@ -33,6 +33,7 @@ public function createQuantityBasedComponent( ->handle(ComponentTestData::HANDLE) ->productFamilyId($productFamily->getId()) ->productFamilyName($productFamily->getName()) + ->productFamilyHandle($productFamily->getHandle()) ->pricePerUnitInCents(ComponentTestData::PRICE_PER_UNIT_IN_CENTS) ->kind(ComponentTestData::QUANTITY_BASED_COMPONENT_KIND) ->archived(ComponentTestData::ARCHIVED) From 7b6410790ca8be67ec22b3f7cc43f3163358833b Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Mon, 21 Jul 2025 11:32:14 +0200 Subject: [PATCH 09/14] Add additional properties for apply_on_setup_fee and apply_on_trial in TestCouponFactory --- tests/TestFactory/TestCouponFactory.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/TestFactory/TestCouponFactory.php b/tests/TestFactory/TestCouponFactory.php index e1275827..4d239023 100644 --- a/tests/TestFactory/TestCouponFactory.php +++ b/tests/TestFactory/TestCouponFactory.php @@ -51,6 +51,8 @@ public function create( ->applyOnCancelAtEndOfPeriod(CouponTestData::APPLY_ON_CANCEL_AT_END_OF_PERIOD) ->applyOnSubscriptionExpiration(CouponTestData::APPLY_ON_SUBSCRIPTION_EXPIRATION) ->couponRestrictions(CouponTestData::RESTRICTIONS) + ->additionalProperty('apply_on_setup_fee', true) + ->additionalProperty('apply_on_trial', true) ->build(); } } From 67b3cf45c93541302c10ef2e0ee9c326da7e7c30 Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Mon, 21 Jul 2025 11:49:59 +0200 Subject: [PATCH 10/14] Add productFamilyHandle to TestComponentFactory for improved component data --- tests/TestFactory/TestComponentFactory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/TestFactory/TestComponentFactory.php b/tests/TestFactory/TestComponentFactory.php index 7b28532b..5ecd2429 100644 --- a/tests/TestFactory/TestComponentFactory.php +++ b/tests/TestFactory/TestComponentFactory.php @@ -95,6 +95,7 @@ public function createOnOffComponent( ->handle(ComponentTestData::HANDLE) ->productFamilyId($productFamily->getId()) ->productFamilyName($productFamily->getName()) + ->productFamilyHandle($productFamily->getHandle()) ->pricePerUnitInCents(ComponentTestData::PRICE_PER_UNIT_IN_CENTS) ->kind(ComponentTestData::ON_OFF_COMPONENT_KIND) ->archived(ComponentTestData::ARCHIVED) From ad6c494ae8febb6ba8d930cc1d4cdb1c6cadd161 Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Mon, 21 Jul 2025 12:19:03 +0200 Subject: [PATCH 11/14] Handle dynamic timestamp fields in customer assertions and add additional properties in TestCustomerFactory --- .../Controllers/CustomersControllerTestAssertions.php | 11 ++++++++++- tests/TestFactory/TestCustomerFactory.php | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/Controllers/CustomersControllerTestAssertions.php b/tests/Controllers/CustomersControllerTestAssertions.php index 78f4b8f5..5c55cfb4 100644 --- a/tests/Controllers/CustomersControllerTestAssertions.php +++ b/tests/Controllers/CustomersControllerTestAssertions.php @@ -29,7 +29,16 @@ public function assertExpectedCustomerCreated( // unsetting reference because of its random value $expectedCustomer->unsetReference(); $customer->unsetReference(); - $this->testCase::assertEquals($expectedCustomer->jsonSerialize(), $customer->jsonSerialize()); + + // Handle dynamic timestamp fields by comparing JSON and unsetting them + $expectedCustomerJson = $expectedCustomer->jsonSerialize(); + $customerJson = $customer->jsonSerialize(); + + // Remove vat_validated_at because it's a dynamic timestamp + unset($expectedCustomerJson['vat_validated_at']); + unset($customerJson['vat_validated_at']); + + $this->testCase::assertEquals($expectedCustomerJson, $customerJson); } public function assertExpectedCustomerWasReturned(Customer $expectedCustomer, Customer $customer): void diff --git a/tests/TestFactory/TestCustomerFactory.php b/tests/TestFactory/TestCustomerFactory.php index 70904f25..980c4a26 100644 --- a/tests/TestFactory/TestCustomerFactory.php +++ b/tests/TestFactory/TestCustomerFactory.php @@ -44,6 +44,9 @@ public function create(int $id, DateTime $createdAt, DateTime $updatedAt): Custo ->salesforceId(null) ->defaultAutoRenewalProfileId(null) ->taxExemptReason(null) + ->additionalProperty('vat_country', null) + ->additionalProperty('vat_status', 'vat_invalid') + ->additionalProperty('business_type', null) ->build(); } } From de1f40a470a187a9797ecba47afa52d51867c26f Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Mon, 21 Jul 2025 12:27:27 +0200 Subject: [PATCH 12/14] Handle dynamic timestamp fields in payment profile assertions --- .../PaymentProfilesControllerTestAssertions.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/Controllers/PaymentProfilesControllerTestAssertions.php b/tests/Controllers/PaymentProfilesControllerTestAssertions.php index da0010d6..ac20b5e6 100644 --- a/tests/Controllers/PaymentProfilesControllerTestAssertions.php +++ b/tests/Controllers/PaymentProfilesControllerTestAssertions.php @@ -22,7 +22,17 @@ public function assertPaymentProfileCreated( CreditCardPaymentProfile|BankAccountPaymentProfile $paymentProfile ): void { - $this->testCase::assertEquals($expectedPaymentProfile, $paymentProfile); + // Handle dynamic timestamp fields by comparing JSON and unsetting them + $expectedPaymentProfileJson = $expectedPaymentProfile->jsonSerialize(); + $paymentProfileJson = $paymentProfile->jsonSerialize(); + + // Remove createdAt and updatedAt because they are dynamic timestamps + unset($expectedPaymentProfileJson['created_at']); + unset($paymentProfileJson['created_at']); + unset($expectedPaymentProfileJson['updated_at']); + unset($paymentProfileJson['updated_at']); + + $this->testCase::assertEquals($expectedPaymentProfileJson, $paymentProfileJson); } /** From b178e1a05e192c98c1c73c1764ef4befd016a5c3 Mon Sep 17 00:00:00 2001 From: Lukasz Bandzarewicz Date: Mon, 21 Jul 2025 14:32:40 +0200 Subject: [PATCH 13/14] Add instructions for running e2e tests locally in README.md --- tests/README.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..c081fe2e --- /dev/null +++ b/tests/README.md @@ -0,0 +1,91 @@ +## How to run e2e tests locally + +### Prerequisites + +- PHP 8.1 or higher +- Composer installed +- Advanced Billing Dev Container running +- Access to Acme Admin account + +### Setup Instructions + +1. **Start Advanced Billing in Dev Container** + - Ensure the dev container is running and accessible at `https://chargify.test` + +2. **Create a Test Site** + - Login as an Acme Admin + - Create a new site (e.g., `sdk-php-tests`) + - **Important**: Use a consistent site name as it will be used in your subdomain + +3. **Configure Multi-Currency Support** + - Navigate to: Site → Config → Settings → Multi-Currency + - Add at least one additional currency (required for some tests) + +4. **Generate API Key** + - Navigate to: Site → Config → Integration → New API Key + - Copy the generated API Key for use in environment variables + +5. **Set Environment Variables** + ```bash + export BASIC_AUTH_USERNAME="" + export BASIC_AUTH_PASSWORD="x" + export SUB_DOMAIN="sdk-php-tests" # Use your actual site name + export DOMAIN="chargify.test" + ``` + +6. **Apply Required Code Patches** + + **⚠️ IMPORTANT**: These patches are for local testing only. Do NOT commit them to git. + + Currently, PHP SDK does not allow to override the API base URL, therefore the following changes are required: + **Patch 1**: Update API base URL in `src/AdvancedBillingClient.php`: + ```diff + --- a/src/AdvancedBillingClient.php + +++ b/src/AdvancedBillingClient.php + @@ -679,8 +679,8 @@ class AdvancedBillingClient implements ConfigurationInterface + */ + private const ENVIRONMENT_MAP = [ + Environment::US => [ + - Server::PRODUCTION => 'https://{site}.chargify.com', + - Server::EBB => 'https://events.chargify.com/{site}' + + Server::PRODUCTION => 'https://{site}.chargify.test', + + Server::EBB => 'https://events.chargify.test/{site}' + ], + Environment::EU => [ + Server::PRODUCTION => 'https://{site}.ebilling.maxio.com', + ``` + + **Patch 2**: The `tests/phpunit.xml` should already have these settings, but verify: + ```xml + beStrictAboutOutputDuringTests="false" + convertDeprecationsToExceptions="false" + ``` + +### Running the Tests + +**⚠️ IMPORTANT**: After each time you run the tests locally, you need to restore the database to its original state by running [./cleanupSite.sh](../cleanupSite.sh) script from the root folder. + +Run the following commands in `tests` directory: + +1. **Install Dependencies** + ```bash + composer install + ``` + +2. **Run All E2E Tests** + ```bash + ./vendor/bin/phpunit + ``` + +3. **Run Specific Test Classes** + ```bash + ./vendor/bin/phpunit tests/Controllers/CustomersControllerTest.php + ./vendor/bin/phpunit tests/Controllers/PaymentProfilesControllerTest.php + ./vendor/bin/phpunit tests/Controllers/ComponentsControllerTest.php + ./vendor/bin/phpunit tests/Controllers/CouponsControllerTest.php + ``` + +4. **Run Tests with Verbose Output** + ```bash + ./vendor/bin/phpunit --verbose + ``` From c7617d289c6165da3dbb953f6102fc52c24402db Mon Sep 17 00:00:00 2001 From: maxio-sdk Date: Tue, 22 Jul 2025 12:06:29 +0000 Subject: [PATCH 14/14] Automated commit message --- doc/proxy-configuration-builder.md | 2 +- src/Proxy/ProxyConfigurationBuilder.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/proxy-configuration-builder.md b/doc/proxy-configuration-builder.md index 92e54db9..e588eacf 100644 --- a/doc/proxy-configuration-builder.md +++ b/doc/proxy-configuration-builder.md @@ -11,7 +11,7 @@ Represents the proxy server configurations for API calls. Create instance using | `port(int $port)` | Sets the port used to connect to the proxy server. **Default port:** 0 | | `tunnel(bool $tunnel)` | Enables or disables tunneling through the proxy server. **Default tunnel:** false | | `auth(string $user , string $pass)` | Sets both username and password in a single method. **Default user:** '', **Default pass:** '' | -| `authMethod(string $authMethod)` | Sets the proxy authentication method. **Default authMethod:** CURLAUTH_BASIC | +| `authMethod(int $authMethod)` | Sets the proxy authentication method. **Default authMethod:** CURLAUTH_BASIC | ### Client Initialization with Proxy Configuration diff --git a/src/Proxy/ProxyConfigurationBuilder.php b/src/Proxy/ProxyConfigurationBuilder.php index 62b87723..9e34d979 100644 --- a/src/Proxy/ProxyConfigurationBuilder.php +++ b/src/Proxy/ProxyConfigurationBuilder.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + namespace AdvancedBillingLib\Proxy; use AdvancedBillingLib\ConfigurationDefaults; @@ -63,7 +69,7 @@ public function port(int $port): self /** * Set proxy authentication method */ - public function authMethod(string $authMethod): self + public function authMethod(int $authMethod): self { $this->authMethod = $authMethod; return $this;