diff --git a/README.md b/README.md index ca79ded..b6cde1a 100644 --- a/README.md +++ b/README.md @@ -29,23 +29,23 @@ 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:7.0.1" +composer require "maxio/advanced-billing-sdk:8.0.0" ``` Or add it to the composer.json file manually as given below: ```json "require": { - "maxio/advanced-billing-sdk": "7.0.1" + "maxio/advanced-billing-sdk": "8.0.0" } ``` You can also view the package at: -https://packagist.org/packages/maxio/advanced-billing-sdk#7.0.1 +https://packagist.org/packages/maxio/advanced-billing-sdk#8.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/7.0.1/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/client.md) The following parameters are configurable for the API Client: @@ -62,8 +62,8 @@ The following parameters are configurable for the API Client: | 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.1/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.1/doc/auth/basic-authentication.md) | The Credentials Setter for Basic Authentication | +| proxyConfiguration | [`ProxyConfigurationBuilder`](https://www.github.com/maxio-com/ab-php-sdk/tree/8.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/8.0.0/doc/auth/basic-authentication.md) | The Credentials Setter for Basic Authentication | The API client can be initialized as follows: @@ -99,55 +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/7.0.1/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/subscription-products.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/subscription-products.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/controllers/webhooks.md) ## SDK Infrastructure ### Configuration -* [ProxyConfigurationBuilder](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/proxy-configuration-builder.md) +* [ProxyConfigurationBuilder](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/proxy-configuration-builder.md) ### HTTP -* [HttpRequest](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/http-request.md) -* [HttpResponse](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/http-response.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/http-response.md) ### Utilities -* [ApiException](https://www.github.com/maxio-com/ab-php-sdk/tree/7.0.1/doc/api-exception.md) +* [ApiException](https://www.github.com/maxio-com/ab-php-sdk/tree/8.0.0/doc/api-exception.md) diff --git a/composer.json b/composer.json index e6c7d5d..cfda0f7 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "ext-curl": "*", "apimatic/unirest-php": "^4.0.6", "apimatic/core-interfaces": "~0.1.5", - "apimatic/core": "~0.3.13" + "apimatic/core": "~0.3.16" }, "require-dev": { "squizlabs/php_codesniffer": "^3.5", diff --git a/composer.lock b/composer.lock index 2808376..c0d891f 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": "9ff353696908373be940a372db0d43da", + "content-hash": "ebdd0e069cd097d78df82da87c152e48", "packages": [ { "name": "apimatic/core", - "version": "0.3.14", + "version": "0.3.16", "source": { "type": "git", "url": "https://github.com/apimatic/core-lib-php.git", - "reference": "c3eaad6cf0c00b793ce6d9bee8b87176247da582" + "reference": "ae4ab4ca26a41be41718f33c703d67b7a767c07b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/c3eaad6cf0c00b793ce6d9bee8b87176247da582", - "reference": "c3eaad6cf0c00b793ce6d9bee8b87176247da582", + "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/ae4ab4ca26a41be41718f33c703d67b7a767c07b", + "reference": "ae4ab4ca26a41be41718f33c703d67b7a767c07b", "shasum": "" }, "require": { @@ -29,7 +29,8 @@ "ext-libxml": "*", "php": "^7.2 || ^8.0", "php-jsonpointer/php-jsonpointer": "^3.0.2", - "psr/log": "^1.1.4 || ^2.0.0 || ^3.0.0" + "psr/log": "^1.1.4 || ^2.0.0 || ^3.0.0", + "symfony/http-foundation": "^5.4 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { "phan/phan": "5.4.5", @@ -56,9 +57,9 @@ ], "support": { "issues": "https://github.com/apimatic/core-lib-php/issues", - "source": "https://github.com/apimatic/core-lib-php/tree/0.3.14" + "source": "https://github.com/apimatic/core-lib-php/tree/0.3.16" }, - "time": "2025-02-27T06:03:30+00:00" + "time": "2025-11-25T04:42:27+00:00" }, { "name": "apimatic/core-interfaces", @@ -105,16 +106,16 @@ }, { "name": "apimatic/jsonmapper", - "version": "3.1.6", + "version": "3.1.7", "source": { "type": "git", "url": "https://github.com/apimatic/jsonmapper.git", - "reference": "c6cc21bd56bfe5d5822bbd08f514be465c0b24e7" + "reference": "61e45f6021e4a4e07497be596b4787c3c6b39bea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/jsonmapper/zipball/c6cc21bd56bfe5d5822bbd08f514be465c0b24e7", - "reference": "c6cc21bd56bfe5d5822bbd08f514be465c0b24e7", + "url": "https://api.github.com/repos/apimatic/jsonmapper/zipball/61e45f6021e4a4e07497be596b4787c3c6b39bea", + "reference": "61e45f6021e4a4e07497be596b4787c3c6b39bea", "shasum": "" }, "require": { @@ -153,9 +154,9 @@ "support": { "email": "mehdi.jaffery@apimatic.io", "issues": "https://github.com/apimatic/jsonmapper/issues", - "source": "https://github.com/apimatic/jsonmapper/tree/3.1.6" + "source": "https://github.com/apimatic/jsonmapper/tree/3.1.7" }, - "time": "2024-11-28T09:15:32+00:00" + "time": "2025-11-06T14:43:04+00:00" }, { "name": "apimatic/unirest-php", @@ -327,6 +328,322 @@ "source": "https://github.com/php-fig/log/tree/3.0.2" }, "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:55:41+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v5.4.50", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "1a0706e8b8041046052ea2695eb8aeee04f97609" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/1a0706e8b8041046052ea2695eb8aeee04f97609", + "reference": "1a0706e8b8041046052ea2695eb8aeee04f97609", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "predis/predis": "^1.0|^2.0", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/rate-limiter": "^5.2|^6.0" + }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v5.4.50" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-11-03T12:58:48+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-23T08:48:59+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-01-02T08:10:11+00:00" } ], "packages-dev": [ @@ -411,16 +728,16 @@ }, { "name": "composer/semver", - "version": "3.4.3", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", "shasum": "" }, "require": { @@ -472,7 +789,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.3" + "source": "https://github.com/composer/semver/tree/3.4.4" }, "funding": [ { @@ -482,13 +799,9 @@ { "url": "https://github.com/composer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2024-09-19T14:15:21+00:00" + "time": "2025-08-20T19:15:30+00:00" }, { "name": "composer/xdebug-handler", @@ -880,16 +1193,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.2", + "version": "5.6.5", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62" + "reference": "90614c73d3800e187615e2dd236ad0e2a01bf761" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62", - "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/90614c73d3800e187615e2dd236ad0e2a01bf761", + "reference": "90614c73d3800e187615e2dd236ad0e2a01bf761", "shasum": "" }, "require": { @@ -938,22 +1251,22 @@ "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.2" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.5" }, - "time": "2025-04-13T19:20:35+00:00" + "time": "2025-11-27T19:50:05+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.10.0", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" + "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", - "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/92a98ada2b93d9b201a613cb5a33584dde25f195", + "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195", "shasum": "" }, "require": { @@ -996,22 +1309,22 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.12.0" }, - "time": "2024-11-09T15:12:26+00:00" + "time": "2025-11-21T15:09:14+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8" + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/b9e61a61e39e02dd90944e9115241c7f7e76bfd8", - "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495", + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495", "shasum": "" }, "require": { @@ -1043,9 +1356,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.2.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0" }, - "time": "2025-07-13T07:04:09+00:00" + "time": "2025-08-30T15:50:23+00:00" }, { "name": "psr/container", @@ -1168,16 +1481,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.13.2", + "version": "3.13.5", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5b5e3821314f947dd040c70f7992a64eac89025c" + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c", - "reference": "5b5e3821314f947dd040c70f7992a64eac89025c", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4", + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4", "shasum": "" }, "require": { @@ -1194,11 +1507,6 @@ "bin/phpcs" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -1248,51 +1556,52 @@ "type": "thanks_dev" } ], - "time": "2025-06-17T22:17:01+00:00" + "time": "2025-11-04T16:30:35+00:00" }, { "name": "symfony/console", - "version": "v7.3.1", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "9e27aecde8f506ba0fd1d9989620c04a87697101" + "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/9e27aecde8f506ba0fd1d9989620c04a87697101", - "reference": "9e27aecde8f506ba0fd1d9989620c04a87697101", + "url": "https://api.github.com/repos/symfony/console/zipball/c3ebc83d031b71c39da318ca8b7a07ecc67507ed", + "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^7.2" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.4|^6.0" }, "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/dotenv": "<6.4", - "symfony/event-dispatcher": "<6.4", - "symfony/lock": "<6.4", - "symfony/process": "<6.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/event-dispatcher": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^6.4|^7.0", - "symfony/messenger": "^6.4|^7.0", - "symfony/process": "^6.4|^7.0", - "symfony/stopwatch": "^6.4|^7.0", - "symfony/var-dumper": "^6.4|^7.0" + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, "type": "library", "autoload": { @@ -1321,79 +1630,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command-line", + "command line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.3.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2025-06-27T19:55:54+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.6.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", - "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.6-dev" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + "source": "https://github.com/symfony/console/tree/v6.0.19" }, "funding": [ { @@ -1409,11 +1651,11 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:21:43+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -1472,7 +1714,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" }, "funding": [ { @@ -1483,6 +1725,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -1492,16 +1738,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", "shasum": "" }, "require": { @@ -1550,7 +1796,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" }, "funding": [ { @@ -1561,16 +1807,20 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-06-27T09:58:17+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -1631,88 +1881,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.32.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "php": ">=7.2" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" }, "funding": [ { @@ -1724,83 +1893,7 @@ "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-12-23T08:48:59+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.32.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/nicolas-grekas", "type": "github" }, { @@ -1808,30 +1901,32 @@ "type": "tidelift" } ], - "time": "2025-01-02T08:10:11+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.6.0", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", - "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66", + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66", "shasum": "" }, "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" + "php": ">=8.0.2", + "psr/container": "^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" }, + "suggest": { + "symfony/service-implementation": "" + }, "type": "library", "extra": { "thanks": { @@ -1839,16 +1934,13 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.6-dev" + "dev-main": "3.0-dev" } }, "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1875,7 +1967,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.0.2" }, "funding": [ { @@ -1891,39 +1983,37 @@ "type": "tidelift" } ], - "time": "2025-04-25T09:37:31+00:00" + "time": "2022-05-30T19:17:58+00:00" }, { "name": "symfony/string", - "version": "v7.3.0", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125" + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f3570b8c61ca887a9e2938e85cb6458515d2b125", - "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125", + "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.5" + "symfony/translation-contracts": "<2.0" }, "require-dev": { - "symfony/emoji": "^7.1", - "symfony/error-handler": "^6.4|^7.0", - "symfony/http-client": "^6.4|^7.0", - "symfony/intl": "^6.4|^7.0", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", "autoload": { @@ -1962,7 +2052,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.3.0" + "source": "https://github.com/symfony/string/tree/v6.0.19" }, "funding": [ { @@ -1978,7 +2068,7 @@ "type": "tidelift" } ], - "time": "2025-04-20T20:19:01+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "tysonandre/var_representation_polyfill", @@ -2044,28 +2134,28 @@ }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68", + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68", "shasum": "" }, "require": { "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", "php": "^7.2 || ^8.0" }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { @@ -2096,9 +2186,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/1.12.1" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2025-10-29T15:56:20+00:00" } ], "aliases": [], @@ -2112,5 +2202,5 @@ "ext-curl": "*" }, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index ecc8e24..ca833b0 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -17,7 +17,7 @@ $advanceInvoiceController = $client->getAdvanceInvoiceController(); # Issue Advance Invoice -Generate an invoice in advance for a subscription's next renewal date. [Please see our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility on generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided. +Generate an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility on generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided. A subscription may only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists will return an error. That said, regeneration of the invoice may be forced with the params `force: true`, which will void an advance invoice if one exists and generate a new one. If no advance invoice exists, a new one will be generated. We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. @@ -96,7 +96,7 @@ $result = $advanceInvoiceController->readAdvanceInvoice($subscriptionId); # Void Advance Invoice Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. -A `reason` is required in order to void, and the invoice must have an open status. Voiding will cause any prepayments and credits that were applied to the invoice to be returned to the subscription. For a full overview of the impact of voiding, please [see our help docs](../../doc/models/invoice.md). +A `reason` is required in order to void, and the invoice must have an open status. Voiding will cause any prepayments and credits that were applied to the invoice to be returned to the subscription. For a full overview of the impact of voiding, [see our help docs](../../doc/models/invoice.md). ```php function voidAdvanceInvoice(int $subscriptionId, ?VoidInvoiceRequest $body = null): Invoice diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index f2fe1cf..e56d98a 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -49,7 +49,7 @@ function listExportedProformaInvoices(array $options): array $collect = [ 'batchId' => 'batch_id8', 'perPage' => 100, - 'page' => 2 + 'page' => 1 ]; $result = $aPIExportsController->listExportedProformaInvoices($collect); @@ -90,7 +90,7 @@ function listExportedInvoices(array $options): array $collect = [ 'batchId' => 'batch_id8', 'perPage' => 100, - 'page' => 2 + 'page' => 1 ]; $result = $aPIExportsController->listExportedInvoices($collect); @@ -131,7 +131,7 @@ function listExportedSubscriptions(array $options): array $collect = [ 'batchId' => 'batch_id8', 'perPage' => 100, - 'page' => 2 + 'page' => 1 ]; $result = $aPIExportsController->listExportedSubscriptions($collect); diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index bba92ac..87d5b6c 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -32,7 +32,7 @@ If your customer has been invited to the Billing Portal, then they will receive If you need to provide your customer their Management URL through other means, you can retrieve it via the API. Because the URL is cryptographically signed with a timestamp, it is not possible for merchants to generate the URL without requesting it from Advanced Billing. -In order to prevent abuse & overuse, we ask that you request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), please **do not** make an API request to Advanced Billing every time. +In order to prevent abuse & overuse, we ask that you request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), **do not** make an API request to Advanced Billing every time. ```php function enableBillingPortalForCustomer(int $customerId, ?int $autoInvite = null): CustomerResponse diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 72c4682..b47fd42 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -194,7 +194,7 @@ function listComponentPricePoints(array $options): ComponentPricePointsResponse ```php $collect = [ 'componentId' => 222, - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'filterType' => Liquid error: Value cannot be null. (Parameter 'key') ]; @@ -384,7 +384,7 @@ $result = $componentPricePointsController->bulkCreateComponentPricePoints( # Update Component Price Point -When updating a price point, it's prices can be updated as well by creating new prices or editing / removing existing ones. +When updating a price point, prices can be updated as well by creating new prices or editing / removing existing ones. Passing in a price bracket without an `id` will attempt to create a new price. @@ -819,7 +819,7 @@ function listAllComponentPricePoints(array $options): ListComponentsPricePointsR ```php $collect = [ 'mInclude' => ListComponentsPricePointsInclude::CURRENCY_PRICES, - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'filter' => ListPricePointsFilterBuilder::init() ->startDate(DateTimeHelper::fromSimpleDate('2011-12-17')) diff --git a/doc/controllers/components.md b/doc/controllers/components.md index 57ccb3f..05b1ef3 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -32,7 +32,7 @@ Metered components are used to bill for any type of unit that resets to 0 at the Note that this is different from recurring quantity-based components, which DO NOT reset to zero at the start of every billing period. If you want to bill for a quantity of something that does not change unless you change it, then you want quantity components, instead. -For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). ```php function createMeteredComponent( @@ -154,7 +154,7 @@ One-time quantity-based components are used to create ad hoc usage charges that The allocated quantity for one-time quantity-based components immediately gets reset back to zero after the allocation is made. -For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). ```php function createQuantityBasedComponent( @@ -270,7 +270,7 @@ This request will create a component definition of kind **on_off_component** und On/off components are used for any flat fee, recurring add on (think $99/month for tech support or a flat add on shipping fee). -For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). ```php function createOnOffComponent(string $productFamilyId, ?CreateOnOffComponent $body = null): ComponentResponse @@ -366,7 +366,7 @@ This request will create a component definition of kind **prepaid_usage_componen Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and we subsequently keep track of the usage against the amount purchased. -For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). ```php function createPrepaidUsageComponent( @@ -510,7 +510,7 @@ Event-based components are similar to other component types, in that you define So, instead of reporting usage directly for each component (as you would with metered components), the usage is derived from analysis of your events. -For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). ```php function createEventBasedComponent(string $productFamilyId, ?CreateEBBComponent $body = null): ComponentResponse @@ -907,7 +907,7 @@ function listComponents(array $options): array ```php $collect = [ 'dateField' => BasicDateField::UPDATED_AT, - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'filter' => ListComponentsFilterBuilder::init() ->ids( @@ -1130,7 +1130,7 @@ function listComponentsForProductFamily(array $options): array ```php $collect = [ 'productFamilyId' => 140, - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'filter' => ListComponentsFilterBuilder::init() ->ids( diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index de77b2a..b94be73 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -30,9 +30,9 @@ $couponsController = $client->getCouponsController(); ## Coupons Documentation -Coupons can be administered in the Advanced Billing application or created via API. Please view our section on [creating coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing-Deleting-Coupons) for more information. +Coupons can be administered in the Advanced Billing application or created via API. View our section on [creating coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing-Deleting-Coupons) for more information. -Additionally, for documentation on how to apply a coupon to a subscription within the Advanced Billing UI, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). +Additionally, for documentation on how to apply a coupon to a subscription within the Advanced Billing UI, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). ## Create Coupon @@ -112,8 +112,6 @@ $result = $couponsController->createCoupon( List coupons for a specific Product Family in a Site. -If the coupon 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. - ```php function listCouponsForProductFamily(array $options): array ``` @@ -137,7 +135,7 @@ function listCouponsForProductFamily(array $options): array ```php $collect = [ 'productFamilyId' => 140, - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'filter' => ListCouponsFilterBuilder::init() ->startDate(DateTimeHelper::fromSimpleDate('2011-12-17')) @@ -539,8 +537,6 @@ $result = $couponsController->archiveCoupon( You can retrieve a list of coupons. -If the coupon 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. - ```php function listCoupons(array $options): array ``` @@ -562,7 +558,7 @@ function listCoupons(array $options): array ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'filter' => ListCouponsFilterBuilder::init() ->startDate(DateTimeHelper::fromSimpleDate('2011-12-17')) @@ -650,8 +646,8 @@ function readCouponUsage(int $productFamilyId, int $couponId): array | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | -| `couponId` | `int` | Template, Required | The Advanced Billing id of the coupon | +| `productFamilyId` | `int` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs. | +| `couponId` | `int` | Template, Required | The Advanced Billing id of the coupon. | ## Response Type @@ -869,7 +865,7 @@ When creating a coupon subcode, you must specify a coupon to attach it to using Full documentation on how to create coupon subcodes in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes). -Additionally, for documentation on how to apply a coupon to a Subscription within the Advanced Billing UI, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). +Additionally, for documentation on how to apply a coupon to a Subscription within the Advanced Billing UI, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). ## Create Coupon Subcode @@ -960,7 +956,7 @@ function listCouponSubcodes(array $options): CouponSubcodes ```php $collect = [ 'couponId' => 162, - 'page' => 2, + 'page' => 1, 'perPage' => 50 ]; diff --git a/doc/controllers/custom-fields.md b/doc/controllers/custom-fields.md index 2be1198..2c8bead 100644 --- a/doc/controllers/custom-fields.md +++ b/doc/controllers/custom-fields.md @@ -23,30 +23,20 @@ $customFieldsController = $client->getCustomFieldsController(); # Create Metafields -## Custom Fields: Metafield Intro +Creates metafields on a Site for either the Subscriptions or Customers resource. -**Advanced Billing refers to Custom Fields in the API documentation as metafields and metadata.** Within the Advanced Billing UI, metadata and metafields are grouped together under the umbrella of "Custom Fields." All of our UI-based documentation that references custom fields will not cite the terminology metafields or metadata. +Metafields and their metadata are created in the Custom Fields configuration page on your Site. Metafields can be populated with metadata when you create them or later with the [Update Metafield](../../doc/controllers/custom-fields.md#update-metafield), [Create Metadata](../../doc/controllers/custom-fields.md#create-metadata), or [Update Metadata](../../doc/controllers/custom-fields.md#update-metadata) endpoints. The Create Metadata and Update Metadata endpoints allow you to add metafields and metadata values to a specific subscription or customer. -+ **Metafield is the custom field** -+ **Metadata is the data populating the custom field.** +Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for Subscriptions and another 100 for Customers. -Advanced Billing Metafields are used to add meaningful attributes to subscription and customer resources. Full documentation on how to create Custom Fields in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/sections/24266118312589-Custom-Fields). For additional documentation on how to record data within custom fields, please see our subscription-based documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24251701302925-Subscription-Summary-Custom-Fields-Tab). +> Note: After creating a metafield, the resource type cannot be modified. -Metafield are the place where you will set up your resource to accept additional data. It is scoped to the site instead of a specific customer or subscription. Think of it as the key, and Metadata as the value on every record. +In the UI and product documentation, metafields and metadata are called Custom Fields. -## Create Metafields +- Metafield is the custom field +- Metadata is the data populating the custom field. -Use this endpoint to create metafields for your Site. Metafields can be populated with metadata after the fact. - -Each site is limited to 100 unique Metafields (i.e. keys, or names) per resource. This means you can have 100 Metafields for Subscription and another 100 for Customer. - -### Metafields "On-the-Fly" - -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 - -If configuring metafields in the Admin UI or via the API, be careful sending updates to metafields with the scope attribute – **if a partial update is sent it will overwrite the current configuration**. +See [Custom Fields Reference](https://docs.maxio.com/hc/en-us/articles/24266140850573-Custom-Fields-Reference) and [Custom Fields Tab](https://maxio.zendesk.com/hc/en-us/articles/24251701302925-Subscription-Summary-Custom-Fields-Tab) for information on using Custom Fields in the Advanced Billing UI. ```php function createMetafields(string $resourceType, ?CreateMetafieldsRequest $body = null): array @@ -56,7 +46,7 @@ function createMetafields(string $resourceType, ?CreateMetafieldsRequest $body = | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | The resource type to which the metafields belong. | | `body` | [`?CreateMetafieldsRequest`](../../doc/models/create-metafields-request.md) | Body, Optional | - | ## Response Type @@ -73,8 +63,10 @@ $body = CreateMetafieldsRequestBuilder::init( ->name('Dropdown field') ->scope( MetafieldScopeBuilder::init() - ->publicShow(IncludeOption::INCLUDE_) - ->publicEdit(IncludeOption::INCLUDE_) + ->csv(IncludeOption::EXCLUDE) + ->invoices(IncludeOption::EXCLUDE) + ->statements(IncludeOption::EXCLUDE) + ->portal(IncludeOption::INCLUDE_) ->build() ) ->inputType(MetafieldInput::DROPDOWN) @@ -133,7 +125,7 @@ $result = $customFieldsController->createMetafields( # List Metafields -This endpoint lists metafields associated with a site. The metafield description and usage is contained in the response. +Lists the metafields and their associated details for a Site and resource type. You can filter the request to a specific metafield. ```php function listMetafields(array $options): ListMetafieldsResponse @@ -143,8 +135,8 @@ function listMetafields(array $options): ListMetafieldsResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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 | +| `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` | | `direction` | [`?string(SortingDirection)`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | @@ -158,7 +150,7 @@ function listMetafields(array $options): ListMetafieldsResponse ```php $collect = [ 'resourceType' => ResourceType::SUBSCRIPTIONS, - 'page' => 2, + 'page' => 1, 'perPage' => 50 ]; @@ -169,10 +161,10 @@ $result = $customFieldsController->listMetafields($collect); ```json { - "total_count": 0, - "current_page": 0, + "total_count": 1, + "current_page": 1, "total_pages": 0, - "per_page": 0, + "per_page": 50, "metafields": [ { "id": 0, @@ -196,7 +188,33 @@ $result = $customFieldsController->listMetafields($collect); # Update Metafield -Use the following method to update metafields for your Site. Metafields can be populated with metadata after the fact. +Updates metafields on your Site for a resource type. Depending on the request structure, you can update or add metafields and metadata to the Subscriptions or Customers resource. + +With this endpoint, you can: + +- Add metafields. If the metafield specified in current_name does not exist, a new metafield is added. + + > Note: Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for Subscriptions and another 100 for Customers. + +- Change the name of a metafield. + + > Note: To keep the metafield name the same and only update the metadata for the metafield, you must use the current metafield name in both the `current_name` and `name` parameters. + +- Change the input type for the metafield. For example, you can change a metafield input type from text to a dropdown. If you change the input type from text to a dropdown or radio, you must update the specific subscriptions or customers where the metafield was used to reflect the updated metafield and metadata. + +- Add metadata values to the existing metadata for a dropdown or radio metafield. + + > Note: Updates to metadata overwrite. To add one or more values, you must specify all metadata values including the new value you want to add. + +- Add new metadata to a dropdown or radio for a metafield that was created without metadata. + +- Remove metadata for a dropdown or radio for a metafield. + + > Note: Updates to metadata overwrite existing values. To remove one or more values, specify all metadata values except those you want to remove. + +- Add or update scope settings for a metafield. + + > Note: Scope changes overwrite existing settings. You must specify the complete scope, including the changes you want to make. ```php function updateMetafield(string $resourceType, ?UpdateMetafieldsRequest $body = null): array @@ -206,7 +224,7 @@ function updateMetafield(string $resourceType, ?UpdateMetafieldsRequest $body = | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | The resource type to which the metafields belong. | | `body` | [`?UpdateMetafieldsRequest`](../../doc/models/update-metafields-request.md) | Body, Optional | - | ## Response Type @@ -230,9 +248,7 @@ $result = $customFieldsController->updateMetafield($resourceType); # Delete Metafield -Use the following method to delete a metafield. This will remove the metafield from the Site. - -Additionally, this will remove the metafield and associated metadata with all Subscriptions on the Site. +Deletes a metafield from your Site. Removes the metafield and associated metadata from all Subscriptions or Customers resources on the Site. ```php function deleteMetafield(string $resourceType, ?string $name = null): void @@ -242,7 +258,7 @@ function deleteMetafield(string $resourceType, ?string $name = null): void | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | The resource type to which the metafields belong. | | `name` | `?string` | Query, Optional | The name of the metafield to be deleted | ## Response Type @@ -266,28 +282,11 @@ $customFieldsController->deleteMetafield($resourceType); # Create Metadata -## Custom Fields: Metadata Intro +Creates metadata and metafields for a specific subscription or customer, or updates metadata values of existing metafields for a subscription or customer. Metadata values are limited to 2 KB in size. -**Advanced Billing refers to Custom Fields in the API documentation as metafields and metadata.** Within the Advanced Billing UI, metadata and metafields are grouped together under the umbrella of "Custom Fields." All of our UI-based documentation that references custom fields will not cite the terminology metafields or metadata. +If you create metadata on a subscription or customer with a metafield that does not already exist, the metafield is created with the metadata you specify and it is always added as a text field. You can update the input_type for the metafield with the [Update Metafield](../../doc/controllers/custom-fields.md#update-metafield) endpoint. -+ **Metafield is the custom field** -+ **Metadata is the data populating the custom field.** - -Advanced Billing Metafields are used to add meaningful attributes to subscription and customer resources. Full documentation on how to create Custom Fields in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24266164865677-Custom-Fields-Overview). For additional documentation on how to record data within custom fields, please see our subscription-based documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24251701302925-Subscription-Summary-Custom-Fields-Tab) - -Metadata is associated to a customer or subscription, and corresponds to a Metafield. When creating a new metadata object for a given record, **if the metafield is not present it will be created**. - -## Metadata limits - -Metadata values are limited to 2kB in size. Additonally, there are limits on the number of unique metafields available per resource. - -## Create Metadata - -This method will create a metafield for the site on the fly if it does not already exist, and populate the metadata value. - -### Subscription or Customer Resource - -Please pay special attention to the resource you use when creating metadata. +> Note: Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for Subscriptions and another 100 for Customers. ```php function createMetadata(string $resourceType, int $resourceId, ?CreateMetadataRequest $body = null): array @@ -297,7 +296,7 @@ function createMetadata(string $resourceType, int $resourceId, ?CreateMetadataRe | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `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 | | `body` | [`?CreateMetadataRequest`](../../doc/models/create-metadata-request.md) | Body, Optional | - | @@ -341,11 +340,7 @@ $result = $customFieldsController->createMetadata( # List Metadata -This request will list all of the metadata belonging to a particular resource (ie. subscription, customer) that is specified. - -## Metadata Data - -This endpoint will also display the current stats of your metadata to use as a tool for pagination. +Lists metadata and metafields for a specific customer or subscription. ```php function listMetadata(array $options): PaginatedMetadata @@ -355,7 +350,7 @@ function listMetadata(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 | +| `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` | @@ -370,17 +365,42 @@ function listMetadata(array $options): PaginatedMetadata $collect = [ 'resourceType' => ResourceType::SUBSCRIPTIONS, 'resourceId' => 60, - 'page' => 2, + 'page' => 1, 'perPage' => 50 ]; $result = $customFieldsController->listMetadata($collect); ``` +## Example Response *(as JSON)* + +```json +{ + "total_count": 1, + "current_page": 1, + "total_pages": 1, + "per_page": 50, + "metadata": [ + { + "id": 77889911, + "value": "green", + "resource_id": 1234567, + "metafield_id": 112233, + "deleted_at": null, + "name": "Color" + } + ] +} +``` + # Update Metadata -This method allows you to update the existing metadata associated with a subscription or customer. +Updates metadata and metafields on the Site and the customer or subscription specified, and updates the metadata value on a subscription or customer. + +If you update metadata on a subscription or customer with a metafield that does not already exist, the metafield is created with the metadata you specify and it is always added as a text field to the Site and to the subscription or customer you specify. You can update the input_type for the metafield with the Update Metafield endpoint. + +Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for Subscription and another 100 for Customer. ```php function updateMetadata(string $resourceType, int $resourceId, ?UpdateMetadataRequest $body = null): array @@ -390,7 +410,7 @@ function updateMetadata(string $resourceType, int $resourceId, ?UpdateMetadataRe | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `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 | | `body` | [`?UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Optional | - | @@ -420,29 +440,7 @@ $result = $customFieldsController->updateMetadata( # Delete Metadata -This method removes the metadata from the subscriber/customer cited. - -## Query String Usage - -For instance if you wanted to delete the metadata for customer 99 named weight you would request: - -``` -https://acme.chargify.com/customers/99/metadata.json?name=weight -``` - -If you want to delete multiple metadata fields for a customer 99 named: `weight` and `age` you wrould request: - -``` -https://acme.chargify.com/customers/99/metadata.json?names[]=weight&names[]=age -``` - -## Successful Response - -For a success, there will be a code `200` and the plain text response `true`. - -## Unsuccessful Response - -When a failed response is encountered, you will receive a `404` response and the plain text response of `true`. +Deletes one or more metafields (and associated metadata) from the specified subscription or customer. ```php function deleteMetadata(string $resourceType, int $resourceId, ?string $name = null, ?array $names = null): void @@ -452,7 +450,7 @@ function deleteMetadata(string $resourceType, int $resourceId, ?string $name = n | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `resourceType` | [`string(ResourceType)`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `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 | | `name` | `?string` | Query, Optional | Name of field to be removed. | | `names` | `?(string[])` | Query, Optional | Names of fields to be removed. Use in query: `names[]=field1&names[]=my-field&names[]=another-field`. | @@ -483,19 +481,7 @@ $customFieldsController->deleteMetadata( # List Metadata for Resource Type -This method will provide you information on usage of metadata across your selected resource (ie. subscriptions, customers) - -## Metadata Data - -This endpoint will also display the current stats of your metadata to use as a tool for pagination. - -### Metadata for multiple records - -`https://acme.chargify.com/subscriptions/metadata.json?resource_ids[]=1&resource_ids[]=2` - -## Read Metadata for a Site - -This endpoint will list the number of pages of metadata information that are contained within a site. +Lists metadata for a specified array of subscriptions or customers. ```php function listMetadataForResourceType(array $options): PaginatedMetadata @@ -505,7 +491,7 @@ 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 | +| `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` | | `dateField` | [`?string(BasicDateField)`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | @@ -526,7 +512,7 @@ function listMetadataForResourceType(array $options): PaginatedMetadata ```php $collect = [ 'resourceType' => ResourceType::SUBSCRIPTIONS, - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'dateField' => BasicDateField::UPDATED_AT ]; diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index 61bd795..b879f43 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -31,7 +31,7 @@ Full documentation on how to locate, create and edit Customers in the Advanced B Advanced Billing requires that you use the ISO Standard Country codes when formatting country attribute of the customer. -Countries should be formatted as 2 characters. For more information, please see the following wikipedia article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) +Countries should be formatted as 2 characters. For more information, see the following wikipedia article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) ## Required State Format @@ -39,7 +39,7 @@ Advanced Billing requires that you use the ISO Standard State codes when formatt + US States (2 characters): [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) -+ States Outside the US (2-3 characters): To find the correct state codes outside of the US, please go to [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to country you wish to populate. ++ States Outside the US (2-3 characters): To find the correct state codes outside of the US, go to [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to country you wish to populate. ## Locale @@ -144,7 +144,7 @@ Common use cases are: + Search by a reference value from your application + Search by a first or last name -To retrieve a single, exact match by reference, please use the [lookup endpoint](https://developers.chargify.com/docs/api-docs/b710d8fbef104-read-customer-by-reference). +To retrieve a single, exact match by reference, use the [lookup endpoint](https://developers.chargify.com/docs/api-docs/b710d8fbef104-read-customer-by-reference). ```php function listCustomers(array $options): array @@ -172,7 +172,7 @@ function listCustomers(array $options): array ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 30, 'dateField' => BasicDateField::UPDATED_AT ]; diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index 000e99e..de62374 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -126,7 +126,7 @@ function listSegmentsForPricePoint(array $options): ListSegmentsResponse $collect = [ 'componentId' => 'component_id8', 'pricePointId' => 'price_point_id8', - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'filter' => ListSegmentsFilterBuilder::init() ->segmentProperty1Value('EU') diff --git a/doc/controllers/events.md b/doc/controllers/events.md index bfbcf1c..a831302 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -114,7 +114,7 @@ function listEvents(array $options): array ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'direction' => Direction::DESC, 'filter' => [ @@ -229,7 +229,7 @@ function listSubscriptionEvents(array $options): array ```php $collect = [ 'subscriptionId' => 222, - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'direction' => Direction::DESC, 'filter' => [ @@ -312,7 +312,7 @@ function readEventsCount(array $options): CountResponse ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'direction' => Direction::DESC, 'filter' => [ diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index d19dd62..c1902db 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -160,7 +160,7 @@ function listMrrMovements(array $options): ListMRRResponse ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 20 ]; @@ -258,7 +258,7 @@ $collect = [ ) ->build(), 'atTime' => 'at_time=2022-01-10T10:00:00-05:00', - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'direction' => Direction::DESC ]; diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 874c47a..fae428b 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -128,7 +128,7 @@ function listInvoices(array $options): ListInvoicesResponse ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'direction' => Direction::DESC, 'lineItems' => false, @@ -202,7 +202,7 @@ $result = $invoicesController->listInvoices($collect); "organization": "", "email": "meg@example.com" }, - "memo": "Please pay within 15 days.", + "memo": "Payment due within 15 days of receipt.", "billing_address": { "street": "123 I Love Cats Way", "line2": "", @@ -268,7 +268,7 @@ $result = $invoicesController->listInvoices($collect); "organization": "", "email": "food@example.com" }, - "memo": "Please pay within 15 days.", + "memo": "Payment due within 15 days of receipt.", "billing_address": { "street": "", "line2": "", @@ -334,7 +334,7 @@ $result = $invoicesController->listInvoices($collect); "organization": "123", "email": "example@example.com" }, - "memo": "Please pay within 15 days.", + "memo": "Payment due within 15 days of receipt.", "billing_address": { "street": "123 Anywhere Street", "line2": "", @@ -400,7 +400,7 @@ $result = $invoicesController->listInvoices($collect); "organization": "", "email": "example@example.com" }, - "memo": "Please pay within 15 days.", + "memo": "Payment due within 15 days of receipt.", "billing_address": { "street": "123 I Love Cats Way", "line2": "", @@ -513,7 +513,7 @@ $result = $invoicesController->readInvoice($uid); "organization": null, "email": "joe@example.com" }, - "memo": "Please pay within 15 days.", + "memo": "Payment due within 15 days of receipt.", "billing_address": { "street": null, "line2": null, @@ -632,7 +632,7 @@ function listInvoiceEvents(array $options): ListInvoiceEventsResponse ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 100 ]; @@ -1204,7 +1204,7 @@ function listCreditNotes(array $options): ListCreditNotesResponse ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'lineItems' => false, 'discounts' => false, @@ -2046,7 +2046,7 @@ function listConsolidatedInvoiceSegments(array $options): ConsolidatedInvoice ```php $collect = [ 'invoiceUid' => 'invoice_uid0', - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'direction' => Direction::ASC ]; @@ -2098,7 +2098,7 @@ $result = $invoicesController->listConsolidatedInvoiceSegments($collect); "organization": "", "email": "meg@example.com" }, - "memo": "Please pay within 15 days.", + "memo": "Payment due within 15 days of receipt.", "billing_address": { "street": "123 I Love Cats Way", "line2": "", @@ -2164,7 +2164,7 @@ $result = $invoicesController->listConsolidatedInvoiceSegments($collect); "organization": "", "email": "food@example.com" }, - "memo": "Please pay within 15 days.", + "memo": "Payment due within 15 days of receipt.", "billing_address": { "street": "", "line2": "", @@ -2230,7 +2230,7 @@ $result = $invoicesController->listConsolidatedInvoiceSegments($collect); "organization": "123", "email": "example@example.com" }, - "memo": "Please pay within 15 days.", + "memo": "Payment due within 15 days of receipt.", "billing_address": { "street": "123 Anywhere Street", "line2": "", @@ -2296,7 +2296,7 @@ $result = $invoicesController->listConsolidatedInvoiceSegments($collect); "organization": "", "email": "example@example.com" }, - "memo": "Please pay within 15 days.", + "memo": "Payment due within 15 days of receipt.", "billing_address": { "street": "123 I Love Cats Way", "line2": "", @@ -2421,6 +2421,42 @@ If You want to use existing coupon for discount creation, only `code` and option ... ``` +#### Using Coupon Subcodes + +You can also use coupon subcodes to apply existing coupons with specific subcodes: + +```json +... + "coupons": [ + { + "subcode": "SUB1", + "product_family_id": 1 + } + ] +... +``` + +**Important:** You cannot specify both `code` and `subcode` for the same coupon. Use either: + +- `code` to apply a main coupon +- `subcode` to apply a specific coupon subcode + +The API response will include both the main coupon code and the subcode used: + +```json +... + "coupons": [ + { + "code": "MAIN123", + "subcode": "SUB1", + "product_family_id": 1, + "percentage": 10, + "description": "Special discount" + } + ] +... +``` + ### Coupon options #### Code @@ -2429,6 +2465,10 @@ Coupon `code` will be displayed on invoice discount section. Coupon code can only contain uppercase letters, numbers, and allowed special characters. Lowercase letters will be converted to uppercase. It can be used to select an existing coupon from the catalog, or as an ad hoc coupon when passed with `percentage` or `amount`. +#### Subcode + +Coupon `subcode` allows you to apply existing coupons using their subcodes. When a subcode is used, the API response will include both the main coupon code and the specific subcode that was applied. Subcodes are case-insensitive and will be converted to uppercase automatically. + #### Percentage Coupon `percentage` can take values from 0 to 100 and up to 4 decimal places. It cannot be used with `amount`. Only for ad hoc coupons, will be ignored if `code` is used to select an existing coupon from the catalog. @@ -2488,7 +2528,7 @@ By default, invoices will be created with a due date matching the date of invoic #### Addresses -The seller, shipping and billing addresses can be sent to override the site's defaults. Each address requires to send a `first_name` at a minimum in order to work. Please see below for the details on which parameters can be sent for each address object. +The seller, shipping and billing addresses can be sent to override the site's defaults. Each address requires to send a `first_name` at a minimum in order to work. See below for the details on which parameters can be sent for each address object. #### Memo and Payment Instructions @@ -2650,9 +2690,9 @@ $result = $invoicesController->createInvoice( This endpoint allows for invoices to be programmatically delivered via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. -Please note that if no recipient email addresses are specified in the request, then the subscription's default email configuration will be used. For example, if `recipient_emails` is left blank, then the invoice will be delivered to the subscription's customer email address. +If no recipient email addresses are specified in the request, then the subscription's default email configuration will be used. For example, if `recipient_emails` is left blank, then the invoice will be delivered to the subscription's customer email address. -On success, a 204 no-content response will be returned. Please note that this does not indicate that email(s) have been delivered, but instead indicates that emails have been successfully queued for delivery. If _any_ invalid or malformed email address is found in the request body, the entire request will be rejected and a 422 response will be returned. +On success, a 204 no-content response will be returned. The response does not indicate that email(s) have been delivered, but instead indicates that emails have been successfully queued for delivery. If _any_ invalid or malformed email address is found in the request body, the entire request will be rejected and a 422 response will be returned. ```php function sendInvoice(string $uid, ?SendInvoiceRequest $body = null): void diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index e551472..2210301 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -150,7 +150,7 @@ function listOffers(array $options): ListOffersResponse ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'includeArchived' => true ]; diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 88994ca..0ed6438 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -26,236 +26,37 @@ $paymentProfilesController = $client->getPaymentProfilesController(); # Create Payment Profile -Use this endpoint to create a payment profile for a customer. +Creates a payment profile for a customer. -Payment Profiles house the credit card, ACH (Authorize.Net or Stripe only,) or PayPal (Braintree only,) data for a customer. The payment information is attached to the customer within Advanced Billing, as opposed to the Subscription itself. +When you create a new payment profile for a customer via the API, it does not automatically make the profile current for any of the customer’s subscriptions. To use the payment profile as the default, you must set it explicitly for the subscription or subscription group. -You must include a customer_id so that Advanced Billing will attach it to the customer entry. If no customer_id is included the API will return a 404. +Select an option from the **Request Examples** drop-down on the right side of the portal to see examples of common scenarios for creating payment profiles. -## Create a Payment Profile for ACH usage +Do not use real card information for testing. See the Sites articles that cover [testing your site setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0-0) for more details on testing in your sandbox. -If you would like to create a payment method that is a Bank Account applicable for ACH payments use the following: +Note that collecting and sending raw card details in production requires [PCI compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If your business is not PCI compliant, use [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank account information. -```json -{ -"payment_profile": { - "customer_id": [Valid-Customer-ID], - "bank_name": "Best Bank", - "bank_routing_number": "021000089", - "bank_account_number": "111111111111", - "bank_account_type": "checking", - "bank_account_holder_type": "business", - "payment_type": "bank_account" - } -} -``` - -## Taxable Subscriptions - -If your subscriber pays taxes on their purchased product, and you are attempting to create or update the `payment_profile`, complete address information is required. For information on required address formatting to allow your subscriber to be taxed, please see our documentation [here](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) - -## Payment Profile Documentation - -Full documentation on how Payment Profiles operate within Advanced Billing can be located under the following links: +See the following articles to learn more about subscriptions and payments: + [Subscriber Payment Details](https://maxio.zendesk.com/hc/en-us/articles/24251599929613-Subscription-Summary-Payment-Details-Tab) + [Self Service Pages](https://maxio.zendesk.com/hc/en-us/articles/24261425318541-Self-Service-Pages) (Allows credit card updates by Subscriber) + [Public Signup Pages payment settings](https://maxio.zendesk.com/hc/en-us/articles/24261368332557-Individual-Page-Settings) - -## Create a Payment Profile with a Chargify.js token - -```json -{ - "payment_profile": { - "customer_id": 1036, - "chargify_token": "tok_w68qcpnftyv53jk33jv6wk3w" - } -} -``` - -## Active Payment Methods - -Creating a new payment profile for a Customer via the API will not make that Payment Profile current for any of the Customer’s Subscriptions. In order to utilize the payment profile as the default, it must be set as the default payment profile for the subscription or subscription group. - -## Requirements - -Either the full_number, expiration_month, and expiration_year or if you have an existing vault_token from your gateway, that vault_token and the current_vault are required. -Passing in the vault_token and current_vault are only allowed when creating a new payment profile. - -### Taxable Subscriptions - -If your subscriber pays taxes on their purchased product, and you are attempting to create or update the `payment_profile`, complete address information is required. For information on required address formatting to allow your subscriber to be taxed, please see our documentation [here](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) - -## BraintreeBlue - -Some merchants use Braintree JavaScript libraries directly and then pass `payment_method_nonce` and/or `paypal_email` to create a payment profile. This implementation is deprecated and does not handle 3D Secure. Instead, we have provided [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview) which is continuously improved and supports Credit Cards (along with 3D Secure), PayPal and ApplePay payment types. - -## GoCardless - -For more information on GoCardless, please view the following resources: - ++ [Taxes](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) ++ [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview) + + [Chargify.js with GoCardless - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQZKCER8CFK40MR6XJ) + + [Chargify.js with GoCardless - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) + + [Chargify.js with Stripe Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) + + [Chargify.js with Stripe Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QRECQQ4ECS3ZA55GY7) + + [Chargify.js with Stripe BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) + + [Chargify.js with Stripe BECS Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) + [Full documentation on GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909-GoCardless) - -+ [Using Chargify.js with GoCardless - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQZKCER8CFK40MR6XJ) - -+ [Using Chargify.js with GoCardless - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) - -### GoCardless with Local Bank Details - -Following examples create customer, bank account and mandate in GoCardless: - -```json -{ - "payment_profile": { - "customer_id": "Valid-Customer-ID", - "bank_name": "Royal Bank of France", - "bank_account_number": "0000000", - "bank_routing_number": "0003", - "bank_branch_code": "00006", - "payment_type": "bank_account", - "billing_address": "20 Place de la Gare", - "billing_city": "Colombes", - "billing_state": "Île-de-France", - "billing_zip": "92700", - "billing_country": "FR" - } -} -``` - -### GoCardless with IBAN - -```json -{ - "payment_profile": { - "customer_id": "24907598", - "bank_name": "French Bank", - "bank_iban": "FR1420041010050500013M02606", - "payment_type": "bank_account", - "billing_address": "20 Place de la Gare", - "billing_city": "Colombes", - "billing_state": "Île-de-France", - "billing_zip": "92700", - "billing_country": "FR" - } -} -``` - -### Importing GoCardless - -If the customer, bank account, and mandate already exist in GoCardless, a payment profile can be created by using the IDs. In order to create masked versions of `bank_account_number` and `bank_routing_number` that are used to display within Advanced Billing Admin UI, you can pass the last four digits for this fields which then will be saved in this form `XXXX[four-provided-digits]`. - -```json -{ - "payment_profile": { - "customer_id": "24907598", - "customer_vault_token": [Existing GoCardless Customer ID] - "vault_token": [Existing GoCardless Mandate ID], - "current_vault": "gocardless", - "bank_name": "French Bank", - "bank_account_number": [Last Four Of The Existing Account Number or IBAN if applicable], - "bank_routing_number": [Last Four Of The Existing Routing Number], - "payment_type": "bank_account", - "billing_address": "20 Place de la Gare", - "billing_city": "Colombes", - "billing_state": "Île-de-France", - "billing_zip": "92700", - "billing_country": "FR" - } -} -``` - -## SEPA Direct Debit - -For more information on Stripe SEPA Direct Debit, please view the following resources: - + [Full documentation on Stripe SEPA Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) - -+ [Using Chargify.js with Stripe Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) - -+ [Using Chargify.js with Stripe Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QRECQQ4ECS3ZA55GY7) - -### Stripe SEPA Direct Debit Payment Profiles - -The following example creates a customer, bank account and mandate in Stripe: - -```json -{ - "payment_profile": { - "customer_id": "24907598", - "bank_name": "Deutsche bank", - "bank_iban": "DE89370400440532013000", - "payment_type": "bank_account", - "billing_address": "Test", - "billing_city": "Berlin", - "billing_state": "Brandenburg", - "billing_zip": "12345", - "billing_country": "DE" - } -} -``` - -## Stripe BECS Direct Debit - -For more information on Stripe BECS Direct Debit, please view the following resources: - + [Full documentation on Stripe BECS Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) - -+ [Using Chargify.js with Stripe BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) - -+ [Using Chargify.js with Stripe BECS Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) - -### Stripe BECS Direct Debit Payment Profiles - -The following example creates a customer, bank account and mandate in Stripe: - -```json -{ - "payment_profile": { - "customer_id": "24907598", - "bank_name": "Australian bank", - "bank_branch_code": "000000", - "bank_account_number": "000123456" - "payment_type": "bank_account", - "billing_address": "Test", - "billing_city": "Stony Rise", - "billing_state": "Tasmania", - "billing_zip": "12345", - "billing_country": "AU" - } -} -``` - -## Stripe BACS Direct Debit - -Contact the support team to enable this payment method. -For more information on Stripe BACS Direct Debit, please view the following resources: - + [Full documentation on Stripe BACS Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) -### Stripe BACS Direct Debit Payment Profiles +## 3D Secure Authentication during payment profile creation. -The following example creates a customer, bank account and mandate in Stripe: - -```json -{ - "payment_profile": { - "customer_id": "24907598", - "bank_name": "British bank", - "bank_branch_code": "108800", - "bank_account_number": "00012345" - "payment_type": "bank_account", - "billing_address": "Test", - "billing_city": "London", - "billing_state": "LND", - "billing_zip": "12345", - "billing_country": "GB" - } -} -``` - -## 3D Secure - Checkout - -It may happen that a payment needs 3D Secure Authentication when the payment profile is created; this is referred to in our help docs as a [post-authentication flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: +When a payment requires 3D Secure Authentication to adhear to Strong Customer Authentication (SCA) during payment profile creation, the request enters a [post-authentication flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post-authentication). In this case, a 422 Unprocessable Entity status is returned with the following response: ```json { @@ -275,29 +76,34 @@ It may happen that a payment needs 3D Secure Authentication when the payment pro ``` To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. -Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: + +Optionally, you can specify the `callback_url` parameter in the `action_link` URL to receive notification about the result of 3D Secure Authentication. + +The `callback_url` will return the following information: - whether the authentication was successful (`success`) - the payment profile ID (`payment_profile_id`) -Lastly, you can also specify a `redirect_url` parameter within the `action_link` URL if you’d like to redirect a customer back to your site. +You can also specify a `redirect_url` parameter in the `action_link` URL to redirect the customer back to your site. + +You cannot use action_link in an iframe inside a custom application. You must redirect the customer directly to the `action_link` and use the `redirect_url` or `callback_url` to be notified of the result. -It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. +The final URL that you send a customer to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: -The final URL that you send a customer to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&redirect_url=https://yourpage.com` +`https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&redirect_url=https://yourpage.com` ### Example Redirect Flow -You may wish to redirect customers to different pages depending on whether their SCA was performed successfully. Here's an example flow to use as a reference: +Here's an example flow to redirect customers to different pages depending on whether SCA was performed successfully: -1. Create a payment profile via API; it requires 3DS -2. You receive a `action_link` in the response. -3. Use this `action_link` to, for example, connect with your internal resources or generate a session_id -4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to +1. Create a payment profile via the API; it requires 3DS. +2. You receive an `action_link` in the response. +3. Use this `action_link` to, for example, connect with your internal resources or generate a `session_id`. +4. Include one of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to. 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied -6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. -7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known -8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not +6. After the customer completes 3DS authentication, we notify you of the result via the applied `callback_url`. +7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known. +8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine if the redirect was successful. ```php function createPaymentProfile(?CreatePaymentProfileRequest $body = null): PaymentProfileResponse @@ -318,13 +124,8 @@ function createPaymentProfile(?CreatePaymentProfileRequest $body = null): Paymen ```php $body = CreatePaymentProfileRequestBuilder::init( CreatePaymentProfileBuilder::init() - ->paymentType(PaymentType::BANK_ACCOUNT) - ->customerId(123) - ->bankName('Best Bank') - ->bankRoutingNumber('021000089') - ->bankAccountNumber('111111111111') - ->bankAccountType(BankAccountType::CHECKING) - ->bankAccountHolderType(BankAccountHolderType::BUSINESS) + ->chargifyToken('tok_w68qcpnftyv53jk33jv6wk3w') + ->customerId(1036) ->build() )->build(); @@ -392,7 +193,7 @@ function listPaymentProfiles(array $options): array ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50 ]; @@ -467,7 +268,7 @@ $result = $paymentProfilesController->listPaymentProfiles($collect); Using the GET method you can retrieve a Payment Profile identified by its unique ID. -Please note that a different JSON object will be returned if the card method on file is a bank account. +Note that a different JSON object will be returned if the card method on file is a bank account. ### Response for Bank Account @@ -627,11 +428,6 @@ $body = UpdatePaymentProfileRequestBuilder::init( UpdatePaymentProfileBuilder::init() ->firstName('Graham') ->lastName('Test') - ->fullNumber('4111111111111111') - ->cardType(CardType::MASTER) - ->expirationMonth('04') - ->expirationYear('2030') - ->currentVault(AllVaults::BOGUS) ->billingAddress('456 Juniper Court') ->billingCity('Boulder') ->billingState('CO') @@ -655,23 +451,13 @@ $result = $paymentProfilesController->updatePaymentProfile( "id": 10088716, "first_name": "Test", "last_name": "Subscription", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2022, - "customer_id": 14543792, - "current_vault": "bogus", - "vault_token": "1", "billing_address": "123 Montana Way", "billing_city": "Billings", "billing_state": "MT", "billing_zip": "59101", "billing_country": "US", - "customer_vault_token": null, "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null + "payment_type": "bank_account" } } ``` @@ -803,8 +589,8 @@ $result = $paymentProfilesController->verifyBankAccount( { "payment_profile": { "id": 10089892, - "first_name": "Chester", - "last_name": "Tester", + "first_name": "John", + "last_name": "Doe", "customer_id": 14543792, "current_vault": "stripe_connect", "vault_token": "cus_0123abc456def", diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index 3e3b8bf..1fe6f61 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -18,7 +18,7 @@ $productFamiliesController = $client->getProductFamiliesController(); # List Products for Product Family -This method allows to retrieve a list of Products belonging to a Product Family. +Retrieves a list of Products belonging to a Product Family. ```php function listProductsForProductFamily(array $options): array @@ -49,7 +49,7 @@ function listProductsForProductFamily(array $options): array ```php $collect = [ 'productFamilyId' => 'product_family_id4', - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'dateField' => BasicDateField::UPDATED_AT, 'filter' => ListProductsFilterBuilder::init() @@ -175,7 +175,7 @@ $result = $productFamiliesController->listProductsForProductFamily($collect); # Create Product Family -This method will create a Product Family within your Advanced Billing site. Create a Product Family to act as a container for your products, components and coupons. +Creates a Product Family within your Advanced Billing site. Create a Product Family to act as a container for your products, components and coupons. Full documentation on how Product Families operate within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product-Families). @@ -230,7 +230,7 @@ $result = $productFamiliesController->createProductFamily($body); # List Product Families -This method allows to retrieve a list of Product Families for a site. +Retrieve a list of Product Families for a site. ```php function listProductFamilies(array $options): array @@ -292,7 +292,7 @@ $result = $productFamiliesController->listProductFamilies($collect); # Read Product Family -This method allows to retrieve a Product Family via the `product_family_id`. The response will contain a Product Family object. +Retrieves a Product Family via the `product_family_id`. The response will contain a Product Family object. The product family can be specified either with the id number, or with the `handle:my-family` format. diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index 4acfc45..db14d84 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -25,7 +25,7 @@ $productPricePointsController = $client->getProductPricePointsController(); # Create Product Price Point -[Product Price Point Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261111947789-Product-Price-Points) +Creates a Product Price Point. See the [Product Price Point](https://maxio.zendesk.com/hc/en-us/articles/24261111947789-Product-Price-Points) documentation for details. ```php function createProductPricePoint( @@ -61,7 +61,7 @@ $body = CreateProductPricePointRequestBuilder::init( ->trialPriceInCents(4900) ->trialInterval(1) ->trialIntervalUnit(IntervalUnit::MONTH) - ->trialType('payment_expected') + ->trialType(TrialType::PAYMENT_EXPECTED) ->initialChargeInCents(120000) ->initialChargeAfterTrial(false) ->expirationInterval(12) @@ -111,7 +111,7 @@ $result = $productPricePointsController->createProductPricePoint( # List Product Price Points -Use this endpoint to retrieve a list of product price points. +Retrieves a list of product price points. ```php function listProductPricePoints(array $options): ListProductPricePointsResponse @@ -137,7 +137,7 @@ function listProductPricePoints(array $options): ListProductPricePointsResponse ```php $collect = [ 'productId' => 124, - 'page' => 2, + 'page' => 1, 'perPage' => 10, 'filterType' => Liquid error: Value cannot be null. (Parameter 'key') ]; @@ -177,9 +177,9 @@ $result = $productPricePointsController->listProductPricePoints($collect); # Update Product Price Point -Use this endpoint to update a product price point. +Updates a product price point. -Note: Custom product price points are not able to be updated. +Note: Custom product price points cannot be updated. ```php function updateProductPricePoint( @@ -317,7 +317,7 @@ $result = $productPricePointsController->readProductPricePoint( # Archive Product Price Point -Use this endpoint to archive a product price point. +Archives a product price point. ```php function archiveProductPricePoint($productId, $pricePointId): ProductPricePointResponse @@ -443,9 +443,9 @@ $result = $productPricePointsController->unarchiveProductPricePoint( # Promote Product Price Point to Default -Use this endpoint to make a product price point the default for the product. +Sets a product price point as the default for the product. -Note: Custom product price points are not able to be set as the default for a product. +Note: Custom product price points cannot be set as the default for a product. ```php function promoteProductPricePointToDefault(int $productId, int $pricePointId): ProductResponse @@ -531,7 +531,7 @@ $result = $productPricePointsController->promoteProductPricePointToDefault( # Bulk Create Product Price Points -Use this endpoint to create multiple product price points in one request. +Creates multiple product price points in one request. ```php function bulkCreateProductPricePoints( @@ -568,7 +568,7 @@ $body = BulkCreateProductPricePointsRequestBuilder::init( ->trialPriceInCents(4900) ->trialInterval(1) ->trialIntervalUnit(IntervalUnit::MONTH) - ->trialType('payment_expected') + ->trialType(TrialType::PAYMENT_EXPECTED) ->initialChargeInCents(120000) ->initialChargeAfterTrial(false) ->expirationInterval(12) @@ -584,7 +584,7 @@ $body = BulkCreateProductPricePointsRequestBuilder::init( ->trialPriceInCents(4900) ->trialInterval(1) ->trialIntervalUnit(IntervalUnit::MONTH) - ->trialType('payment_expected') + ->trialType(TrialType::PAYMENT_EXPECTED) ->initialChargeInCents(120000) ->initialChargeAfterTrial(false) ->expirationInterval(12) @@ -637,7 +637,7 @@ $result = $productPricePointsController->bulkCreateProductPricePoints( # Create Product Currency Prices -This endpoint allows you to create currency prices for a given currency that has been defined on the site level in your settings. +Creates currency prices for a given currency that has been defined on the site level in your settings. When creating currency prices, they need to mirror the structure of your primary pricing. If the product price point defines a trial and/or setup fee, each currency must also define a trial and/or setup fee. @@ -718,11 +718,11 @@ $result = $productPricePointsController->createProductCurrencyPrices( # Update Product Currency Prices -This endpoint allows you to update the `price`s of currency prices for a given currency that exists on the product price point. +Updates the `price`s of currency prices for a given currency that exists on the product price point. When updating the pricing, it needs to mirror the structure of your primary pricing. If the product price point defines a trial and/or setup fee, each currency must also define a trial and/or setup fee. -Note: Currency Prices are not able to be updated for custom product price points. +Note: Currency Prices cannot be updated for custom product price points. ```php function updateProductCurrencyPrices( @@ -837,7 +837,7 @@ $collect = [ ) ->build(), 'mInclude' => ListProductsPricePointsInclude::CURRENCY_PRICES, - 'page' => 2, + 'page' => 1, 'perPage' => 50 ]; diff --git a/doc/controllers/products.md b/doc/controllers/products.md index 87ff08b..3099ce9 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -20,7 +20,9 @@ $productsController = $client->getProductsController(); # Create Product -Use this method to create a product within your Advanced Billing site. +Creates a product in your Advanced Billing site. + +See the following product docuemation for more information: + [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) + [Changing a Subscription's Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations) @@ -125,7 +127,7 @@ $result = $productsController->createProduct( # Read Product -This endpoint allows you to read the current details of a product that you've created in Advanced Billing. +Reads the current details of a product. ```php function readProduct(int $productId): ProductResponse @@ -195,7 +197,7 @@ $result = $productsController->readProduct($productId); # Update Product -Use this method to change aspects of an existing product. +Updates aspects of an existing product. ### Input Attributes Update Notes @@ -285,7 +287,7 @@ $result = $productsController->updateProduct($productId); # Archive Product -Sending a DELETE request to this endpoint will archive the product. All current subscribers will be unffected; their subscription/purchase will continue to be charged monthly. +Archives the product. All current subscribers will be unffected; their subscription/purchase will continue to be charged monthly. This will restrict the option to chose the product for purchase via the Billing Portal, as well as disable Public Signup Pages for the product. @@ -363,7 +365,7 @@ $result = $productsController->archiveProduct($productId); # Read Product by Handle -This method allows to retrieve a Product object by its `api_handle`. +Retrieves a Product object by its `api_handle`. ```php function readProductByHandle(string $apiHandle): ProductResponse @@ -497,7 +499,7 @@ $collect = [ ] ) ->build(), - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'includeArchived' => true, 'mInclude' => ListProductsInclude::PREPAID_PRODUCT_PRICE_POINT diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 703ac35..bc7cf2a 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -150,7 +150,7 @@ $result = $proformaInvoicesController->readProformaInvoice($proformaInvoiceUid); This endpoint will create a proforma invoice and return it as a response. If the information becomes outdated, simply void the old proforma invoice and generate a new one. -If you would like to preview the next billing amounts without generating a full proforma invoice, please use the renewal preview endpoint. +If you would like to preview the next billing amounts without generating a full proforma invoice, use the renewal preview endpoint. ## Restrictions @@ -220,7 +220,7 @@ function listProformaInvoices(array $options): ListProformaInvoicesResponse ```php $collect = [ 'subscriptionId' => 222, - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'direction' => Direction::DESC, 'lineItems' => false, diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index 22d9272..616e9d0 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -94,7 +94,7 @@ function listReasonCodes(array $options): array ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50 ]; diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 83d4b39..cb7f8ce 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -23,7 +23,7 @@ Endpoint returns subscriptions with associated sales reps The Sales Commission API differs from other Chargify API endpoints. This resource is associated with the seller itself. Up to now all available resources were at the level of the site, therefore creating the API Key per site was a sufficient solution. To share resources at the seller level, a new authentication method was introduced, which is user authentication. Creating an API Key for a user is a required step to correctly use the Sales Commission API, more details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). -Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics please contact Maxio support. +Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. > Note: The request is at seller level, it means `<>` variable will be replaced by `app` @@ -51,7 +51,7 @@ function listSalesCommissionSettings(array $options): array $collect = [ 'sellerId' => 'seller_id8', 'authorization' => 'Bearer <>', - 'page' => 2, + 'page' => 1, 'perPage' => 100 ]; @@ -101,7 +101,7 @@ Endpoint returns sales rep list with details The Sales Commission API differs from other Chargify API endpoints. This resource is associated with the seller itself. Up to now all available resources were at the level of the site, therefore creating the API Key per site was a sufficient solution. To share resources at the seller level, a new authentication method was introduced, which is user authentication. Creating an API Key for a user is a required step to correctly use the Sales Commission API, more details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). -Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics please contact Maxio support. +Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. > Note: The request is at seller level, it means `<>` variable will be replaced by `app` @@ -129,7 +129,7 @@ function listSalesReps(array $options): array $collect = [ 'sellerId' => 'seller_id8', 'authorization' => 'Bearer <>', - 'page' => 2, + 'page' => 1, 'perPage' => 100 ]; @@ -228,7 +228,7 @@ Endpoint returns sales rep and attached subscriptions details. The Sales Commission API differs from other Chargify API endpoints. This resource is associated with the seller itself. Up to now all available resources were at the level of the site, therefore creating the API Key per site was a sufficient solution. To share resources at the seller level, a new authentication method was introduced, which is user authentication. Creating an API Key for a user is a required step to correctly use the Sales Commission API, more details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). -Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics please contact Maxio support. +Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. > Note: The request is at seller level, it means `<>` variable will be replaced by `app` @@ -267,7 +267,7 @@ $salesRepId = 'sales_rep_id4'; $authorization = 'Bearer <>'; -$page = 2; +$page = 1; $perPage = 100; diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index c81c87b..63597e8 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -152,7 +152,7 @@ function listChargifyJsPublicKeys(array $options): ListPublicKeysResponse ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50 ]; diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index 623ade9..f765ad6 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -574,7 +574,7 @@ $subscriptionId = 222; $componentId = 222; -$page = 2; +$page = 1; $result = $subscriptionComponentsController->listAllocations( $subscriptionId, @@ -1043,34 +1043,35 @@ $subscriptionComponentsController->deletePrepaidUsageAllocation( # Create Usage -## Documentation +Records an instance of metered or prepaid usage for a subscription. + +You can report metered or prepaid usage to Advanced Billing as often as you wish. You can report usage as it happens or periodically, such as each night or once per billing period. -Full documentation on how to create Components in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create-Edit-and-Archive-Components). Additionally, for information on how to record component usage against a subscription, please see the following resources: +Full documentation on how to create Components in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create-Edit-and-Archive-Components). Additionally, for information on how to record component usage against a subscription, see the following resources: -+ [Recording Metered Component Usage](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reporting-Component-Allocations#reporting-metered-component-usage) -+ [Reporting Prepaid Component Status](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reporting-Component-Allocations#reporting-prepaid-component-status) +It is not possible to record metered usage for more than one component at a time Usage should be reported as one API call per component on a single subscription. For example, to record that a subscriber has sent both an SMS Message and an Email, send an API call for each. -You may choose to report metered or prepaid usage to Advanced Billing as often as you wish. You may report usage as it happens. You may also report usage periodically, such as each night or once per billing period. If usage events occur in your system very frequently (on the order of thousands of times an hour), it is best to accumulate usage into batches on your side, and then report those batches less frequently, such as daily. This will ensure you remain below any API throttling limits. If your use case requires higher rates of usage reporting, we recommend utilizing Events Based Components. +See the following product documention articles for more information: -## Create Usage for Subscription +- [Create and Manage Components](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create-Edit-and-Archive-Components). A +- [Recording Metered Component Usage](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reporting-Component-Allocations#reporting-metered-component-usage) +- [Reporting Prepaid Component Status](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reporting-Component-Allocations#reporting-prepaid-component-status) -This endpoint allows you to record an instance of metered or prepaid usage for a subscription. The `quantity` from usage for each component is accumulated to the `unit_balance` on the [Component Line Item](./b3A6MTQxMDgzNzQ-read-subscription-component) for the subscription. +The `quantity` from usage for each component is accumulated to the `unit_balance` on the [Component Line Item](../../doc/controllers/subscription-components.md#read-subscription-component) for the subscription. ## Price Point ID usage -If you are using price points, for metered and prepaid usage components, Advanced Billing gives you the option to specify a price point in your request. +If you are using price points, for metered and prepaid usage components Advanced Billing gives you the option to specify a price point in your request. You do not need to specify a price point ID. If a price point is not included, the default price point for the component will be used when the usage is recorded. -If an invalid `price_point_id` is submitted, the endpoint will return an error. - ## Deducting Usage -In the event that you need to reverse a previous usage report or otherwise deduct from the current usage balance, you may provide a negative quantity. +If you need to reverse a previous usage report or otherwise deduct from the current usage balance, you can provide a negative quantity. Example: -Previously recorded: +Previously recorded quantity was 5000: ```json { @@ -1081,7 +1082,7 @@ Previously recorded: } ``` -At this point, `unit_balance` would be `5000`. To reduce the balance to `0`, POST the following payload: +To reduce the quantity to `0`, POST the following payload: ```json { @@ -1094,12 +1095,6 @@ At this point, `unit_balance` would be `5000`. To reduce the balance to `0`, POS The `unit_balance` has a floor of `0`; negative unit balances are never allowed. For example, if the usage balance is 100 and you deduct 200 units, the unit balance would then be `0`, not `-100`. -## FAQ - -Q. Is it possible to record metered usage for more than one component at a time? - -A. No. Usage should be reported as one API call per component on a single subscription. For example, to record that a subscriber has sent both an SMS Message and an Email, send an API call for each. - ```php function createUsage($subscriptionIdOrReference, $componentId, ?CreateUsageRequest $body = null): UsageResponse ``` @@ -1207,7 +1202,7 @@ function listUsages(array $options): array $collect = [ 'subscriptionIdOrReference' => 234, 'componentId' => 144, - 'page' => 2, + 'page' => 1, 'perPage' => 50 ]; @@ -1495,7 +1490,7 @@ function listSubscriptionComponentsForSite(array $options): ListSubscriptionComp ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'sort' => ListSubscriptionComponentsSort::UPDATED_AT, 'filter' => ListSubscriptionComponentsForSiteFilterBuilder::init() diff --git a/doc/controllers/subscription-group-invoice-account.md b/doc/controllers/subscription-group-invoice-account.md index 5002655..dd41617 100644 --- a/doc/controllers/subscription-group-invoice-account.md +++ b/doc/controllers/subscription-group-invoice-account.md @@ -91,7 +91,7 @@ function listPrepaymentsForSubscriptionGroup(array $options): ListSubscriptionGr ```php $collect = [ 'uid' => 'uid0', - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'filter' => ListPrepaymentsFilterBuilder::init() ->dateField(ListPrepaymentDateField::CREATED_AT) diff --git a/doc/controllers/subscription-group-status.md b/doc/controllers/subscription-group-status.md index 72d5d89..6e310c1 100644 --- a/doc/controllers/subscription-group-status.md +++ b/doc/controllers/subscription-group-status.md @@ -18,9 +18,9 @@ $subscriptionGroupStatusController = $client->getSubscriptionGroupStatusControll # Cancel Subscriptions in Group -This endpoint will immediately cancel all subscriptions within the specified group. The group is identified by it's `uid` passed in the URL. To successfully cancel the group, the primary subscription must be on automatic billing. The group members as well must be on automatic billing or they must be prepaid. +Cancels all subscriptions within the specified group immediately. The group is identified by the `uid` that is passed in the URL. To successfully cancel the group, the primary subscription must be on automatic billing. The group members must be on automatic billing or prepaid. -In order to cancel a subscription group while also charging for any unbilled usage on metered or prepaid components, the `charge_unbilled_usage=true` parameter must be included in the request. +To cancel a subscription group while also charging for any unbilled usage on metered or prepaid components, the `charge_unbilled_usage=true` parameter must be included in the request. ```php function cancelSubscriptionsInGroup(string $uid, ?CancelGroupedSubscriptionsRequest $body = null): void @@ -61,7 +61,7 @@ $subscriptionGroupStatusController->cancelSubscriptionsInGroup( # Initiate Delayed Cancellation for Group -This endpoint will schedule all subscriptions within the specified group to be canceled at the end of their billing period. The group is identified by it's uid passed in the URL. +This endpoint will schedule all subscriptions within the specified group to be canceled at the end of their billing period. The group is identified by its uid passed in the URL. All subscriptions in the group must be on automatic billing in order to successfully cancel them, and the group must not be in a "past_due" state. diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index d0b8773..3f7f392 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -32,6 +32,8 @@ You must provide one and only one of the `payment_profile_id`/`credit_card_attri Only one of the `subscriptions` can have `"primary": true` attribute set. When passing product to a subscription you can use either `product_id` or `product_handle` or `offer_id`. You can also use `custom_price` instead. +The subscription request examples below will be split into two sections. +The first section, "Subscription Customization", will focus on passing different information with a subscription, such as components, calendar billing, and custom fields. These examples will presume you are using a secure chargify_token generated by Chargify.js. ```php function signupWithSubscriptionGroup( @@ -177,7 +179,7 @@ function listSubscriptionGroups(array $options): ListSubscriptionGroupsResponse ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'mInclude' => [ SubscriptionGroupsListInclude::ACCOUNT_BALANCES @@ -506,7 +508,7 @@ For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/ Passing `group` parameters with a `target` containing a `type` and optional `id` is all that's needed. When the `target` parameter specifies a `"customer"` or `"subscription"` that is already part of a hierarchy, the subscription will become a member of the customer's subscription group. If the target customer or subscription is not part of a subscription group, a new group will be created and the subscription will become part of the group with the specified target customer set as the responsible payer for the group's subscriptions. -**Please Note:** In order to add an existing subscription to a subscription group, it must belong to either the same customer record as the target, or be within the same customer hierarchy. +**Note:** In order to add an existing subscription to a subscription group, it must belong to either the same customer record as the target, or be within the same customer hierarchy. Rather than specifying a customer, the `target` parameter could instead simply have a value of @@ -514,7 +516,7 @@ Rather than specifying a customer, the `target` parameter could instead simply h * `"parent"` which indicates the subscription will be paid for by the subscribing customer's parent within a customer hierarchy, or * `"eldest"` which indicates the subscription will be paid for by the root-level customer in the subscribing customer's hierarchy. -To create a new subscription into a subscription group, please reference the following: +To create a new subscription into a subscription group, reference the following: [Create Subscription in a Subscription Group](https://developers.chargify.com/docs/api-docs/d571659cf0f24-create-subscription#subscription-in-a-subscription-group) ```php diff --git a/doc/controllers/subscription-invoice-account.md b/doc/controllers/subscription-invoice-account.md index 4598696..9fc5ffd 100644 --- a/doc/controllers/subscription-invoice-account.md +++ b/doc/controllers/subscription-invoice-account.md @@ -54,7 +54,7 @@ In order to specify a prepayment made against a subscription, specify the `amoun When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. -Please note that you **can't** pass `amount_in_cents`. +Note that passing `amount_in_cents` is now allowed. ```php function createPrepayment(int $subscriptionId, ?CreatePrepaymentRequest $body = null): CreatePrepaymentResponse @@ -140,7 +140,7 @@ function listPrepayments(array $options): PrepaymentsResponse ```php $collect = [ 'subscriptionId' => 222, - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'filter' => ListPrepaymentsFilterBuilder::init() ->dateField(ListPrepaymentDateField::CREATED_AT) @@ -311,7 +311,7 @@ function listServiceCredits( ```php $subscriptionId = 222; -$page = 2; +$page = 1; $perPage = 50; diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index c03cb47..bd2ba6d 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -97,7 +97,7 @@ function listSubscriptionNotes(array $options): array ```php $collect = [ 'subscriptionId' => 222, - 'page' => 2, + 'page' => 1, 'perPage' => 50 ]; diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index 112adf7..6368b5a 100644 --- a/doc/controllers/subscription-products.md +++ b/doc/controllers/subscription-products.md @@ -30,11 +30,11 @@ Full documentation on how to record Migrations in the Advanced Billing UI can be ## Failed Migrations -One of the most common ways that a migration can fail is when the attempt is made to migrate a subscription to it's current product. Please be aware of this issue! +Importaint note: One of the most common ways that a migration can fail is when the attempt is made to migrate a subscription to its current product. ## Migration 3D Secure - Stripe -It may happen that a payment needs 3D Secure Authentication when the subscription is migrated to a new product; this is referred to in our help docs as a [post-authentication flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: +When a payment requires 3D Secure Authentication to adhear to Strong Customer Authentication (SCA) when the subscription is migrated to a new product, the request enters a [post-authentication flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: ```json { @@ -62,7 +62,7 @@ The final URL that you send a customer to to complete 3D Secure may resemble the ### Example Redirect Flow -You may wish to redirect customers to different pages depending on whether their SCA was performed successfully. Here's an example flow to use as a reference: +You may wish to redirect customers to different pages depending on whether SCA was performed successfully. Here's an example flow to use as a reference: 1. Create a migration via API; it requires 3DS 2. You receive a `gateway_payment_id` in the `action_link` along other params in the response. diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index e558cb3..627d065 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -522,7 +522,7 @@ This will place the subscription in the on_hold state and it will not renew. ## Limitations -You may not place a subscription on hold if the `next_billing` date is within 24 hours. +You may not place a subscription on hold if the `next_billing_at` date is within 24 hours. ```php function pauseSubscription(int $subscriptionId, ?PauseRequest $body = null): SubscriptionResponse @@ -852,8 +852,7 @@ $result = $subscriptionStatusController->updateAutomaticSubscriptionResumption( Advanced Billing offers the ability to reactivate a previously canceled subscription. For details on how the reactivation works, and how to reactivate subscriptions through the application, see [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming). -**Please note: The term -"resume" is used also during another process in Advanced Billing. This occurs when an on-hold subscription is "resumed". This returns the subscription to an active state.** +**Note: The term "resume" is used also during another process in Advanced Billing. This occurs when an on-hold subscription is "resumed". This returns the subscription to an active state.** + The response returns the subscription object in the `active` or `trialing` state. + The `canceled_at` and `cancellation_message` fields do not have values. @@ -1293,7 +1292,7 @@ $result = $subscriptionStatusController->cancelDunning($subscriptionId); The Chargify API allows you to preview a renewal by posting to the renewals endpoint. Renewal Preview is an object representing a subscription’s next assessment. You can retrieve it to see a snapshot of how much your customer will be charged on their next renewal. -The "Next Billing" amount and "Next Billing" date are already represented in the UI on 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 already represented in the UI on each Subscriber's Summary. For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Optional Component Fields diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index 41f99c3..194a407 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -26,624 +26,21 @@ $subscriptionsController = $client->getSubscriptionsController(); # Create Subscription -Full documentation on how subscriptions operate within Advanced Billing can be located under the following topics: +Creates a Subscription for a customer and product -+ [Subscriptions Reference](https://maxio.zendesk.com/hc/en-us/articles/24251526991757-Subscription-Overview) -+ [Subscriptions Actions](https://maxio.zendesk.com/hc/en-us/articles/24251983024653-Subscription-Actions-Overview) -+ [Subscription Cancellation](https://maxio.zendesk.com/hc/en-us/articles/24251957778829-Cancel-Subscriptions) -+ [Subscription Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming) -+ [Subscription Import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Imports) +Specify the product with `product_id` or `product_handle`. To set a specific product pricepPoint, use `product_price_point_handle` or `product_price_point_id`. -When creating a subscription, you must specify a product and a customer. Credit card details may be required, depending on the options for the Product being subscribed ([see Product Options](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing)). +Identify an existing customer with `customer_id` or `customer_reference`. Optionally, include an existing payment profile using `payment_profile_id`. To create a new customer, pass customer_attributes. -The product may be specified by `product_id` or by `product_handle` (API Handle). In similar fashion, to pass a particular product price point, you may either use `product_price_point_handle` or `product_price_point_id`. +Select an option from the **Request Examples** drop-down on the right side of the portal to see examples of common scenarios for creating subscriptions. -An existing customer may be specified by a `customer_id` (ID within Advanced Billing) or a `customer_reference` (unique value within your app that you have shared with Advanced Billing via the reference attribute on a customer). You may also pass in an existing payment profile for that customer with `payment_profile_id`. A new customer may be created by providing `customer_attributes`. +Payment information may be required to create a subscription, depending on the options for the Product being subscribed. See [product options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Products) for more information. See the [Payments Profile](../../doc/controllers/payment-profiles.md#create-payment-profile) endpoint for details on payment parameters. -Credit card details may be required, depending on the options for the product being subscribed. The product can be specified by `product_id` or by `product_handle` (API Handle). +Do not use real card information for testing. See the Sites articles that cover [testing your site setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0-0) for more details on testing in your sandbox. -If you are creating a subscription with a payment profile, the attribute to send will be `credit_card_attributes` or `bank_account_attributes` for ACH and Direct Debit. That said, when you read the subscription after creation, we return the profile details under `credit_card` or `bank_account`. +Note that collecting and sending raw card details in production requires [PCI compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If your business is not PCI compliant, use [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank account information. -## Bulk creation of subscriptions - -Bulk creation of subscriptions is currently not supported. For scenarios where multiple subscriptions must be added, particularly when assigning to the same subscription group, it is essential to switch to a single-threaded approach. - -To avoid data conflicts or inaccuracies, incorporate a sleep interval between requests. - -While this single-threaded approach may impact performance, it ensures data consistency and accuracy in cases where concurrent creation attempts could otherwise lead to issues with subscription alignment and integrity. - -## Taxable Subscriptions - -If your intent is to charge your subscribers tax via [Avalara Taxes](https://maxio.zendesk.com/hc/en-us/articles/24287043035661-Avalara-VAT-Tax) or [Custom Taxes](https://maxio.zendesk.com/hc/en-us/articles/24287044212749-Custom-Taxes), there are a few considerations to be made regarding collecting subscription data. -For subscribers to be eligible to be taxed, the following information for the `customer` object or `payment_profile` object must by supplied: - -+ A subscription to a [taxable product](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing#tax-settings) -+ [Full valid billing or shipping address](https://maxio.zendesk.com/hc/en-us/articles/24287008131853-Advanced-Billing-Managed-Sales-Tax#full-address-required-for-taxable-subscriptions) to identify the tax locale -+ The portion of the address that houses the [state information](https://maxio.zendesk.com/hc/en-us/articles/24287008131853-Advanced-Billing-Managed-Sales-Tax#required-state-format-for-taxable-subscriptions) of either adddress must adhere to the ISO standard of a 2-3 character limit/format. -+ The portion of the address that houses the [country information](https://maxio.zendesk.com/hc/en-us/articles/24287008131853-Advanced-Billing-Managed-Sales-Tax#required-country-format-for-taxable-subscriptions) must adhere to the ISO standard of a 2 character limit/format. - -## Subscription Request Examples - -The subscription examples below will be split into two sections. - -The first section, "Subscription Customization", will focus on passing different information with a subscription, such as components, calendar billing, and custom fields. These examples will presume you are using a secure `chargify_token` generated by Chargify.js. - -The second section, "Passing Payment Information", will focus on passing payment information into Advanced Billing. Please be aware that collecting and sending Advanced Billing raw card details requires PCI compliance on your end; these examples are provided as guidance. If your business is not PCI compliant, we recommend using Chargify.js to collect credit cards or bank accounts. - -# Subscription Customization - -## With Components - -Different components require slightly different data. For example, quantity-based and on/off components accept `allocated_quantity`, while metered components accept `unit_balance`. - -When creating a subscription with a component, a `price_point_id` can be passed in along with the `component_id` to specify which price point to use. If not passed in, the default price point will be used. - -Note: if an invalid `price_point_id` is used, the subscription will still proceed but will use the component's default price point. - -Components and their price points may be added by ID or by handle. See the example request body labeled "Components By Handle (Quantity-Based)"; the format will be the same for other component types. - -## With Coupon(s) - -Pass an array of `coupon_codes`. See the example request body "With Coupon". - -## With Manual Invoice Collection - -The `invoice` collection method works only on legacy Statement Architecture. - -On Relationship Invoicing Architecture use the `remittance` collection method. - -## Prepaid Subscription - -A prepaid subscription can be created with the usual subscription creation parameters, specifying `prepaid` as the `payment_collection_method` and including a nested `prepaid_configuration`. - -After a prepaid subscription has been created, additional funds can be manually added to the prepayment account through the [Create Prepayment Endpoint](https://developers.chargify.com/docs/api-docs/7ec482de77ba7-create-prepayment). - -Prepaid subscriptions do not work on legacy Statement Architecture. - -## With Metafields - -Metafields can either attach to subscriptions or customers. Metafields are popuplated with the supplied metadata to the resource specified. - -If the metafield doesn't exist yet, it will be created on-the-fly. - -## With Custom Pricing - -Custom pricing is pricing specific to the subscription in question. -Create a subscription with custom pricing by passing pricing information instead of a price point. -For a custom priced product, pass the custom_price object in place of `product_price_point_id`. For a custom priced component, pass the `custom_price` object within the component object. -Custom prices and price points can exist in harmony on a subscription. - -# Passing Payment Information - -## Subscription with Chargify.js token - -The `chargify_token` can be obtained using [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0). The token represents payment profile attributes that were provided by the customer in their browser and stored at the payment gateway. - -The `payment_type` attribute may either be `credit_card` or `bank_account`, depending on the type of payment method being added. If a bank account is being passed, the payment attributes should be changed to `bank_account_attributes`. - -```json -{ - "subscription": { - "product_handle": "pro-plan", - "customer_attributes": { - "first_name": "Joe", - "last_name": "Smith", - "email": "j.smith@example.com" - }, - "credit_card_attributes": { - "chargify_token": "tok_cwhvpfcnbtgkd8nfkzf9dnjn", - "payment_type": "credit_card" - } - } -} -``` - -## Subscription with vault token - -If you already have a customer and card stored in your payment gateway, you may create a subscription with a `vault_token`. Providing the last_four, card type and expiration date will allow the card to be displayed properly in the Advanced Billing UI. - -```json -{ - "subscription": { - "product_handle": "pro-plan", - "customer_attributes": { - "first_name": "Joe", - "last_name": "Smith", - "email": "j.smith@example.com" - }, - "credit_card_attributes": { - first_name: "Joe, - last_name: "Smith", - card_type: "visa", - expiration_month: "05", - expiration_year: "2025", - last_four: "1234", - vault_token: "12345abc", - current_vault: "braintree_blue" - } -} -``` - -## Subscription with ACH as Payment Profile - -```json -{ - "subscription": { - "product_handle": "gold-product", - "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." - }, - "bank_account_attributes": { - "bank_name": "Best Bank", - "bank_routing_number": "021000089", - "bank_account_number": "111111111111", - "bank_account_type": "checking", - "bank_account_holder_type": "business", - "payment_type": "bank_account" - } - } -} -``` - -## Subscription with PayPal payment profile - -### With the nonce from Braintree JS - -```json -{ "subscription": { - "product_handle":"test-product-b", - "customer_attributes": { - "first_name":"Amelia", - "last_name":"Johnson", - "email":"amelia@example.com", - "organization":"My Awesome Company" - }, - "payment_profile_attributes":{ - "paypal_email": "amelia@example.com", - "current_vault": "braintree_blue", - "payment_method_nonce":"abc123", - "payment_type":"paypal_account" - } - } -``` - -### With the Braintree Customer ID as the vault token: - -```json -{ "subscription": { - "product_handle":"test-product-b", - "customer_attributes": { - "first_name":"Amelia", - "last_name":"Johnson", - "email":"amelia@example.com", - "organization":"My Awesome Company" - }, - "payment_profile_attributes":{ - "paypal_email": "amelia@example.com", - "current_vault": "braintree_blue", - "vault_token":"58271347", - "payment_type":"paypal_account" - } - } -``` - -## Subscription using GoCardless Bank Number - -These examples creates a customer, bank account and mandate in GoCardless. - -For more information on GoCardless, please view the following two resources: - -+ [Payment Profiles via API for GoCardless](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-payment-profile#gocardless) - -+ [Full documentation on GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909-GoCardless) - -+ [Using Chargify.js with GoCardless - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQZKCER8CFK40MR6XJ) - -+ [Using Chargify.js with GoCardless - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) - -```json -{ - "subscription": { - "product_handle": "gold-product", - "customer_attributes": { - "first_name": "Jane", - "last_name": "Doe", - "email": "jd@chargify.test" - }, - "bank_account_attributes": { - "bank_name": "Royal Bank of France", - "bank_account_number": "0000000", - "bank_routing_number": "0003", - "bank_branch_code": "00006", - "payment_type": "bank_account", - "billing_address": "20 Place de la Gare", - "billing_city": "Colombes", - "billing_state": "Île-de-France", - "billing_zip": "92700", - "billing_country": "FR" - } - } -} -``` - -## Subscription using GoCardless IBAN Number - -```json -{ - "subscription": { - "product_handle": "gold-product", - "customer_attributes": { - "first_name": "Jane", - "last_name": "Doe", - "email": "jd@chargify.test" - }, - "bank_account_attributes": { - "bank_name": "French Bank", - "bank_iban": "FR1420041010050500013M02606", - "payment_type": "bank_account", - "billing_address": "20 Place de la Gare", - "billing_city": "Colombes", - "billing_state": "Île-de-France", - "billing_zip": "92700", - "billing_country": "FR" - } - } -} -``` - -## Subscription using Stripe SEPA Direct Debit - -For more information on Stripe Direct Debit, please view the following two resources: - -+ [Payment Profiles via API for Stripe SEPA Direct Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-payment-profile#sepa-direct-debit) - -+ [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) - -+ [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) - -+ [Using Chargify.js with Stripe SEPA Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) - -```json -{ - "subscription": { - "product_handle": "gold-product", - "customer_attributes": { - "first_name": "Jane", - "last_name": "Doe", - "email": "jd@chargify.test" - }, - "bank_account_attributes": { - "bank_name": "Test Bank", - "bank_iban": "DE89370400440532013000", - "payment_type": "bank_account" - } - } -} -``` - -## Subscription using Stripe BECS Direct Debit - -For more information on Stripe Direct Debit, please view the following two resources: - -+ [Payment Profiles via API for Stripe BECS Direct Debit](../../doc/controllers/payment-profiles.md#create-payment-profile) - -+ [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) - -+ [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) - -+ [Using Chargify.js with Stripe BECS Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QRX4B1TYZKZD8ZND6D) - -```json -{ - "subscription": { - "product_handle": "gold-product", - "customer_attributes": { - "first_name": "Jane", - "last_name": "Doe", - "email": "jd@chargify.test" - }, - "bank_account_attributes": { - "bank_name": "Test Bank", - "bank_branch_code": "000000", - "bank_account_number": "000123456", - "payment_type": "bank_account" - } - } -} -``` - -## Subscription using Stripe BACS Direct Debit - -For more information on Stripe Direct Debit, please view the following two resources: - -+ [Payment Profiles via API for Stripe BACS Direct Debit](../../doc/controllers/payment-profiles.md#create-payment-profile) - -+ [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) - -+ [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) - -+ [Using Chargify.js with Stripe BACS Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR7PA1DJ3XE9MD05FM) - -```json -{ - "subscription": { - "product_handle": "gold-product", - "customer_attributes": { - "first_name": "Jane", - "last_name": "Doe", - "email": "jd@chargify.test" - }, - "bank_account_attributes": { - "bank_name": "Test Bank", - "bank_branch_code": "108800", - "bank_account_number": "00012345", - "payment_type": "bank_account", - "billing_address": "123 Main St.", - "billing_city": "London", - "billing_state": "LND", - "billing_zip": "W1A 1AA", - "billing_country": "GB" - } - } -} -``` - -## 3D Secure - Stripe - -It may happen that a payment needs 3D Secure Authentication when the subscription is created; this is referred to in our help docs as a [post-authentication flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: - -```json -{ - "errors": [ - "Your card was declined. This transaction requires 3D secure authentication." - ], - "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh", - "description": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after payment is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", - "action_link": "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_time_token_id=242" -} -``` - -To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. -Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: - -- whether the authentication was successful (`success`) -- the gateway ID for the payment (`gateway_payment_id`) -- the subscription ID (`subscription_id`) - -Lastly, you can also specify a `redirect_url` within the `action_link` URL if you’d like to redirect a customer back to your site. - -It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. - -The final URL that you send a customer to to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` - -## 3D Secure - Checkout - -It may happen that a payment needs 3D Secure Authentication when the subscription is created; this is referred to in our help docs as a [post-authentication flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: - -```json -{ - "errors": [ - "Your card was declined. This transaction requires 3D secure authentication." - ], - "gateway_payment_id": "pay_6gjofv7dlyrkpizlolsuspvtiu", - "description": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_time_token_id=123&callback_url=https://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after payment is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", - "action_link": "http://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_time_token_id=123" -} -``` - -To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. -Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: - -- whether the authentication was successful (`success`) -- the gateway ID for the payment (`gateway_payment_id`) -- the subscription ID (`subscription_id`) - -Lastly, you can also specify a `redirect_url` parameter within the `action_link` URL if you’d like to redirect a customer back to your site. - -It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. - -The final URL that you send a customer to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_time_token_id=123&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` - -### Example Redirect Flow - -You may wish to redirect customers to different pages depending on whether their SCA was performed successfully. Here's an example flow to use as a reference: - -1. Create a subscription via API; it requires 3DS -2. You receive a `gateway_payment_id` in the `action_link` along other params in the response. -3. Use this `gateway_payment_id` to, for example, connect with your internal resources or generate a session_id -4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to -5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied -6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. -7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known -8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not - -## Subscriptions Import - -Subscriptions can be “imported” via the API to handle the following scenarios: - -+ You already have existing subscriptions with specific start and renewal dates that you would like to import to Advanced Billing -+ You already have credit cards stored in your provider’s vault and you would like to create subscriptions using those tokens - -Before importing, you should have already set up your products to match your offerings. Then, you can create Subscriptions via the API just like you normally would, but using a few special attributes. - -Full documentation on how import Subscriptions using the **import tool** in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Imports). - -### Important Notices and Disclaimers regarding Imports - -Before performing a bulk import of subscriptions via the API, we suggest reading the [Subscriptions Import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Imports) instructions to understand the repurcussions of a large import. - -### Subscription Input Attributes - -The following _additional_ attributes to the subscription input attributes make imports possible: `next_billing_at`, `previous_billing_at`, and `import_mrr`. - -### Current Vault - -If you are using a Legacy gateway such as "eWAY Rapid (Legacy)" or "Stripe (Legacy)" then please contact Support for further instructions on subscription imports. - -### Braintree Blue (Braintree v2) Imports - -Braintree Blue is Braintree’s newer (version 2) API. For this gateway, please provide the `vault_token` parameter with the value from Braintree’s “Customer ID” rather than the “Payment Profile Token”. At this time we do not use `current_vault_token` with the Braintree Blue gateway, and we only support a single payment profile per Braintree Customer. - -When importing PayPal type payment profiles, please set `payment_type` to `paypal_account`. - -### Stripe ACH Imports - -If the bank account has already been verified, currently you will need to create the customer, create the payment profile in Advanced Billing - setting verified=true, then create a subscription using the customer_id and payment_profile_id. - -### Webhooks During Import - -If no `next_billing_at` is provided, webhooks will be fired as normal. If you do set a future `next_billing_at`, only a subset of the webhooks are fired when the subscription is created. Keep reading for more information as to what webhooks will be fired under which scenarios. - -#### Successful creation with Billing Date - -Scenario: If `next_billing_at` provided - -+ `signup_success` -+ `billing_date_change` - -#### Successful creation without Billing Date - -Scenario: If no `next_billing_at` provided - -+ `signup_success` -+ `payment_success` - -#### Unsuccessful creation - -Scenario: If card can’t be charged, and no `next_billing_at` provided - -+ signup_failure - -#### Webhooks fired when next_billing_at is reached: - -+ `renewal_success or renewal_failure` -+ `payment_success or payment_failure` - -### Date and Time Formats - -We will attempt to parse any string you send as the value of next_billing_at in to a date or time. For best results, use a known format like described in “Date and Time Specification” of RFC 2822 or ISO 8601 . - -The following are all equivalent and will work as input to `next_billing_at`: - -``` -Aug 06 2030 11:34:00 -0400 -Aug 06 2030 11:34 -0400 -2030-08-06T11:34:00-04:00 -8/6/2030 11:34:00 EDT -8/6/2030 8:34:00 PDT -2030-08-06T15:34:00Z -``` - -You may also pass just a date, in which case we will assume the time to be noon - -``` -2010-08-06 -``` - -## Subscription Hierarchies & WhoPays - -When subscription groups were first added to our Relationship Invoicing architecture, to group together invoices for related subscriptions and allow for complex customer hierarchies and WhoPays scenarios, they were designed to consist of a primary and a collection of group members. The primary would control many aspects of the group, such as when the consolidated invoice is generated. As of today, groups still function this way. - -In the future, the concept of a "primary" will be removed in order to offer more flexibility into group management and reduce confusion concerning what actions must be done on a primary level, rather than a member level. - -We have introduced a two scheme system as a bridge between these two group organizations. Scheme 1, which is relevant to all subscription groups today, marks the group as being "ruled" by a primary. - -When reading a subscription via API, they will return a top-level attribute called `group`, which will denote which scheme is being used. At this time, the `scheme` attribute will always be 1. - -### Subscription in a Customer Hierarchy - -For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays) features, it is possible to create subscriptions within a customer hierarchy. This can be achieved through the API by passing group parameters in the **Create Subscription** request. - -+ The `group` parameters are optional and consist of the required `target` and optional `billing` parameters. - -When the `target` parameter specifies a customer that is already part of a hierarchy, the new subscription will become a member of the customer hierarchy as well. If the target customer is not part of a hierarchy, a new customer hierarchy will be created and both the target customer and the new subscription will become part of the hierarchy with the specified target customer set as the responsible payer for the hierarchy's subscriptions. - -Rather than specifying a customer, the `target` parameter could instead simply have a value of `self` which indicates the subscription will be paid for not by some other customer, but by the subscribing customer. This will be true whether the customer is being created new, is already part of a hierarchy, or already exists outside a hierarchy. A valid payment method must also be specified in the subscription parameters. - -Note that when creating subscriptions in a customer hierarchy, if the customer hierarchy does not already have a payment method, passing valid credit card attributes in the subscription parameters will also result in the payment method being established as the default payment method for the customer hierarchy irrespective of the responsible payer. - -The optional `billing` parameters specify how some aspects of the billing for the new subscription should be handled. Rather than capturing payment immediately, the `accrue` parameter can be included so that the new subscription charges accrue until the next assessment date. Regarding the date, the `align_date` parameter can be included so that the billing date of the new subscription matches up with the default subscription group in the customer hierarchy. When choosing to align the dates, the `prorate` parameter can also be specified so that the new subscription charges are prorated based on the billing period of the default subscription group in the customer hierarchy also. - -### Subscription in a Subscription Group - -For sites making use of [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) it may be desireable to create a subscription as part of a [subscription group](https://maxio.zendesk.com/hc/en-us/articles/24252172565005-Subscription-Groups-Overview) in order to rely on [invoice consolidation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). This can be achieved through the API by passing group parameters in the Create Subscription request. The `group` parameters are optional and consist of the required `target` and optional `billing` parameters. - -The `target` parameters specify an existing subscription with which the newly created subscription should be grouped. If the target subscription is already part of a group, the new subscription will become a member of the group as well. If the target subscription is not part of a group, a new group will be created and both the target and the new subscription will become part of the group with the target as the group's primary subscription. - -The optional `billing` parameters specify how some aspects of the billing for the new subscription should be handled. Rather than capturing payment immediately, the `accrue` parameter can be included so that the new subscription charges accrue until the next assessment date. Regarding the date, the `align_date` parameter can be included so that the billing date of the new subscription matches up with the target subscription. When choosing to align the dates, the `prorate` parameter can also be specified so that the new subscription charges are prorated based on the billing period of the target subscription also. - -## Providing Agreement Acceptance Params - -It is possible to provide a proof of customer's acceptance of terms and policies. -We will be storing this proof in case it might be required (i.e. chargeback). -Currently, we already keep it for subscriptions created via Public Signup Pages. -In order to create a subscription with the proof of agreement acceptance, you must provide additional parameters `agreement acceptance` with `ip_address` and at least one url to the policy that was accepted: `terms_url` or `privacy_policy_url`. Additional urls that can be provided: `return_refund_policy_url`, `delivery_policy_url` and -`secure_checkout_policy_url`. - -```json - "subscription": { - "product_handle": "gold-product", - "customer_attributes": { - "first_name": "Jane", - "last_name": "Doe", - "email": "jd@chargify.test" - }, - "agreement_acceptance": { - "ip_address": "1.2.3.4", - "terms_url": "https://terms.url", - "privacy_policy_url": "https://privacy_policy.url", - "return_refund_policy_url": "https://return_refund_policy.url", - "delivery_policy_url": "https://delivery_policy.url", - "secure_checkout_policy_url": "https://secure_checkout_policy.url" - } - } -} -``` - -**For Maxio Payments subscriptions, the agreement acceptance params are required, with at least terms_url provided.** - -## Providing ACH Agreement params - -It is also possible to provide a proof that a customer authorized ACH agreement terms. -The proof will be stored and the email will be sent to the customer with a copy of the terms (if enabled). -In order to create a subscription with the proof of authorized ACH agreement terms, you must provide the additional parameter `ach_agreement` with the following nested parameters: `agreement_terms`, `authorizer_first_name`, `authorizer_last_name` and `ip_address`. -Each of them is required. - -```json - "subscription": { - "product_handle": "gold-product", - "customer_attributes": { - "first_name": "Jane", - "last_name": "Doe", - "email": "jd@chargify.test" - }, - "bank_account_attributes": { - "bank_name": "Test Bank", - "bank_routing_number": "021000089", - "bank_account_number": "111111111111", - "bank_account_type": "checking", - "bank_account_holder_type": "business", - "payment_type": "bank_account" - }, - "ach_agreement": { - "agreement_terms": "ACH agreement terms", - "authorizer_first_name": "Jane", - "authorizer_last_name": "Doe", - "ip_address": "1.2.3.4" - } - } -``` +See the [Subscription Signups](page:introduction/basic-concepts/subscription-signup) article for more information on working with subscriptions in Advanced Billing. ```php function createSubscription(?CreateSubscriptionRequest $body = null): SubscriptionResponse @@ -669,7 +66,7 @@ $body = CreateSubscriptionRequestBuilder::init( ->customerAttributes( CustomerAttributesBuilder::init() ->firstName('Joe') - ->lastName('Blow') + ->lastName('Smith') ->email('joe@example.com') ->organization('Acme') ->reference('XYZ') @@ -879,7 +276,7 @@ function listSubscriptions(array $options): array ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50, 'startDate' => DateTimeHelper::fromSimpleDate('2022-07-01'), 'endDate' => DateTimeHelper::fromSimpleDate('2022-08-01'), @@ -897,47 +294,55 @@ $result = $subscriptionsController->listSubscriptions($collect); # Update Subscription -The subscription endpoint allows you to instantly update one or many attributes about a subscription in a single call. +Updates one or more attributes of a subscription. ## Update Subscription Payment Method -Change the card that your Subscriber uses for their subscription. You can also use this method to simply change the expiration date of the card **if your gateway allows**. +Change the card that your subscriber uses for their subscription. You can also use this method to change the expiration date of the card **if your gateway allows**. -Note that partial card updates for **Authorize.Net** are not allowed via this endpoint. The existing Payment Profile must be directly updated instead. +Do not use real card information for testing. See the Sites articles that cover [testing your site setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0-0) for more details on testing in your sandbox. + +Note that collecting and sending raw card details in production requires [PCI compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If your business is not PCI compliant, use [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank account information. + +> Note: Partial card updates for **Authorize.Net** are not allowed via this endpoint. The existing Payment Profile must be directly updated instead. + +## Update Product You also use this method to change the subscription to a different product by setting a new value for product_handle. A product change can be done in two different ways, **product change** or **delayed product change**. -## Product Change +### Product Change -This endpoint may be used to change a subscription's product. The new payment amount is calculated and charged at the normal start of the next period. If you desire complex product changes or prorated upgrades and downgrades instead, please see the documentation on Migrating Subscription Products. +You can change a subscription's product. The new payment amount is calculated and charged at the normal start of the next period. If you require complex product changes or prorated upgrades and downgrades instead, please see the documentation on [Migrating Subscription Products](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations#product-changes-and-migrations-0-0). -To perform a product change, simply set either the `product_handle` or `product_id` attribute to that of a different product from the same site as the subscription. You can also change the price point by passing in either `product_price_point_id` or `product_price_point_handle` - otherwise the new product's default price point will be used. +To perform a product change, set either the `product_handle` or `product_id` attribute to that of a different product from the same site as the subscription. You can also change the price point by passing in either `product_price_point_id` or `product_price_point_handle` - otherwise the new product's default price point is used. ### Delayed Product Change This method also changes the product and/or price point, and the new payment amount is calculated and charged at the normal start of the next period. -This method schedules the product change to happen automatically at the subscription’s next renewal date. To perform a Delayed Product Change, set the `product_handle` attribute as you would in a regular product change, but also set the `product_change_delayed` attribute to `true`. No proration applies in this case. +This method schedules the product change to happen automatically at the subscription’s next renewal date. To perform a delayed product change, set the `product_handle` attribute as you would in a regular product change, but also set the `product_change_delayed` attribute to `true`. No proration applies in this case. You can also perform a delayed change to the price point by passing in either `product_price_point_id` or `product_price_point_handle` -**Note: To cancel a delayed product change, set `next_product_id` to an empty string.** +> **Note:** To cancel a delayed product change, set `next_product_id` to an empty string. ## Billing Date Changes +You can update dates for a subscrption. + ### Regular Billing Date Changes Send the `next_billing_at` to set the next billing date for the subscription. After that date passes and the subscription is processed, the following billing date will be set according to the subscription's product period. -Note that if you pass an invalid date, we will automatically interpret and set the correct date. For example, when February 30 is entered, the next billing will be set to March 2nd in a non-leap year. +> Note: If you pass an invalid date, the correct date is automatically set to he correct date. For example, if February 30 is passed, the next billing would be set to March 2nd in a non-leap year. -The server response will not return data under the key/value pair of `next_billing`. Please view the key/value pair of `current_period_ends_at` to verify that the `next_billing` date has been changed successfully. +The server response will not return data under the key/value pair of `next_billing_at`. View the key/value pair of `current_period_ends_at` to verify that the `next_billing_at` date has been changed successfully. -### Snap Day Changes +### Calendar Billing and Snap Day Changes For a subscription using Calendar Billing, setting the next billing date is a bit different. Send the `snap_day` attribute to change the calendar billing date for **a subscription using a product eligible for calendar billing**. -Note: If you change the product associated with a subscription that contains a `snap_date` and immediately `READ/GET` the subscription data, it will still contain evidence of the existing `snap_date`. This is due to the fact that a product change is instantanous and only affects the product associated with a subscription. After the `next_billing` date arrives, the `snap_day` associated with the subscription will return to `null.` Another way of looking at this is that you willl have to wait for the next billing cycle to arrive before the `snap_date` will reset to `null`. +> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately `READ/GET` the subscription data, it will still contain original `snap_day`. The `snap_day`will will reset to 'null on the next billing cycle. This is because a product change is instantanous and only affects the product associated with a subscription. ```php function updateSubscription(int $subscriptionId, ?UpdateSubscriptionRequest $body = null): SubscriptionResponse @@ -1369,7 +774,7 @@ For sites in test mode, you may purge individual subscriptions. Provide the subscription ID in the url. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` -If you need to remove subscriptions from a live site, please contact support to discuss your use case. +If you need to remove subscriptions from a live site, contact support to discuss your use case. ### Delete customer and payment profile @@ -1488,7 +893,7 @@ The "Next Billing" amount and "Next Billing" date are represented in each Subscr A subscription will not be created by utilizing 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). +For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Taxable Subscriptions @@ -1498,15 +903,15 @@ This endpoint will preview taxes applicable to a purchase. In order for taxes to + The preview must be for the purchase of a taxable product or component, or combination of the two. + The subscription payload must contain a full billing or shipping address in order to calculate tax -For more information about creating taxable previews, please see our documentation guide on how to create [taxable subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes) +For more information about creating taxable previews, see our documentation guide on how to create [taxable subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes) -You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, please note that when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored in Advanced Billing. The billing address and the credit card information are stored together within the payment profile object. Also, you may not send a billing address to Advanced Billing without payment profile information, as the address is stored on the card. +You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored in Advanced Billing. The billing address and the credit card information are stored together within the payment profile object. Also, you may not send a billing address to Advanced Billing without payment profile information, as the address is stored on the card. You can pass shipping and billing addresses and still decide not to calculate taxes. To do that, pass `skip_billing_manifest_taxes: true` attribute. ## Non-taxable Subscriptions -If you'd like to calculate subscriptions that do not include tax, please feel free to leave off the billing information. +If you'd like to calculate subscriptions that do not include tax you may leave off the billing information. ```php function previewSubscription(?CreateSubscriptionRequest $body = null): SubscriptionPreviewResponse @@ -1867,7 +1272,7 @@ $result = $subscriptionsController->applyCouponsToSubscription( Use this endpoint to remove a coupon from an existing subscription. -For more information on the expected behaviour of removing a coupon from a subscription, please see our documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon) +For more information on the expected behaviour of removing a coupon from a subscription, See our documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon) ```php function removeCouponFromSubscription(int $subscriptionId, ?string $couponCode = null): string diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index b30d245..31a758e 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -46,7 +46,7 @@ function listWebhooks(array $options): array ```php $collect = [ - 'page' => 2, + 'page' => 1, 'perPage' => 50 ]; diff --git a/doc/models/activate-event-based-component.md b/doc/models/activate-event-based-component.md index 91e5e87..420af75 100644 --- a/doc/models/activate-event-based-component.md +++ b/doc/models/activate-event-based-component.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `pricePointId` | `?int` | Optional | The Chargify id of the price point | getPricePointId(): ?int | setPricePointId(?int pricePointId): void | -| `billingSchedule` | [`?BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled | getBillingSchedule(): ?BillingSchedule | setBillingSchedule(?BillingSchedule billingSchedule): void | +| `billingSchedule` | [`?BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. This only works for site with Multifrequency enabled. | getBillingSchedule(): ?BillingSchedule | setBillingSchedule(?BillingSchedule billingSchedule): void | | `customPrice` | [`?ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | getCustomPrice(): ?ComponentCustomPrice | setCustomPrice(?ComponentCustomPrice customPrice): void | ## Example (as JSON) @@ -37,7 +37,8 @@ "ending_quantity": 40, "unit_price": 23.26 } - ] + ], + "renew_prepaid_allocation": false } } ``` diff --git a/doc/models/billing-schedule.md b/doc/models/billing-schedule.md index 6634eff..32fd738 100644 --- a/doc/models/billing-schedule.md +++ b/doc/models/billing-schedule.md @@ -1,7 +1,7 @@ # Billing Schedule -This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled +This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. This only works for site with Multifrequency enabled. ## Structure diff --git a/doc/models/bulk-create-product-price-points-request.md b/doc/models/bulk-create-product-price-points-request.md index e7579c3..fc0092d 100644 --- a/doc/models/bulk-create-product-price-points-request.md +++ b/doc/models/bulk-create-product-price-points-request.md @@ -26,7 +26,7 @@ "trial_price_in_cents": 196, "trial_interval": 250, "trial_interval_unit": "day", - "trial_type": "trial_type6" + "trial_type": "no_obligation" } ] } diff --git a/doc/models/calendar-billing.md b/doc/models/calendar-billing.md index 3d54c61..c699ef6 100644 --- a/doc/models/calendar-billing.md +++ b/doc/models/calendar-billing.md @@ -11,14 +11,14 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `snapDay` | int\|string\|null | Optional | This is a container for one-of cases. | getSnapDay(): | setSnapDay( snapDay): void | +| `snapDay` | int\|string([SnapDay](../../doc/models/snap-day.md))\|null | Optional | This is a container for one-of cases. | getSnapDay(): | setSnapDay( snapDay): void | | `calendarBillingFirstCharge` | [`?string(FirstChargeType)`](../../doc/models/first-charge-type.md) | Optional | - | getCalendarBillingFirstCharge(): ?string | setCalendarBillingFirstCharge(?string calendarBillingFirstCharge): void | ## Example (as JSON) ```json { - "snap_day": 210, + "snap_day": 28, "calendar_billing_first_charge": "prorated" } ``` diff --git a/doc/models/chargify-ebb.md b/doc/models/chargify-ebb.md index 611df3e..db4ed3e 100644 --- a/doc/models/chargify-ebb.md +++ b/doc/models/chargify-ebb.md @@ -10,8 +10,8 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `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 | +| `id` | `?string` | Optional | A unique ID set by Chargify. 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. 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 | | `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-custom-price.md b/doc/models/component-custom-price.md index 742b4e0..4fe11cc 100644 --- a/doc/models/component-custom-price.md +++ b/doc/models/component-custom-price.md @@ -16,6 +16,10 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | `interval` | `?int` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component 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 component price point, either month or day. This property is only available for sites with Multifrequency enabled. | getIntervalUnit(): ?string | setIntervalUnit(?string intervalUnit): void | | `prices` | [`Price[]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1 | getPrices(): array | setPrices(array prices): void | +| `renewPrepaidAllocation` | `?bool` | Optional | Applicable only to prepaid usage components. Controls whether the allocated quantity renews each period. | getRenewPrepaidAllocation(): ?bool | setRenewPrepaidAllocation(?bool renewPrepaidAllocation): void | +| `rolloverPrepaidRemainder` | `?bool` | Optional | Applicable only to prepaid usage components. Controls whether remaining units roll over to the next period. | getRolloverPrepaidRemainder(): ?bool | setRolloverPrepaidRemainder(?bool rolloverPrepaidRemainder): void | +| `expirationInterval` | `?int` | Optional | Applicable only when rollover is enabled. Number of `expiration_interval_unit`s after which rollover amounts expire. | getExpirationInterval(): ?int | setExpirationInterval(?int expirationInterval): void | +| `expirationIntervalUnit` | [`?string(ExpirationIntervalUnit)`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only when rollover is enabled. Interval unit for rollover expiration (month or day). | getExpirationIntervalUnit(): ?string | setExpirationIntervalUnit(?string expirationIntervalUnit): void | ## Example (as JSON) @@ -31,7 +35,8 @@ Create or update custom pricing unique to the subscription. Used in place of `pr "tax_included": false, "pricing_scheme": "stairstep", "interval": 162, - "interval_unit": "day" + "interval_unit": "day", + "renew_prepaid_allocation": false } ``` diff --git a/doc/models/component.md b/doc/models/component.md index 3f93fd3..cb0aee0 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -21,7 +21,6 @@ | `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 | -| `taxable` | `?bool` | Optional | Boolean flag describing whether a component is taxable or not. | getTaxable(): ?bool | setTaxable(?bool taxable): void | | `description` | `?string` | Optional | The description of the component. | getDescription(): ?string | setDescription(?string description): void | | `defaultPricePointId` | `?int` | Optional | - | getDefaultPricePointId(): ?int | setDefaultPricePointId(?int defaultPricePointId): void | | `overagePrices` | [`?(ComponentPrice[])`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | getOveragePrices(): ?array | setOveragePrices(?array overagePrices): void | @@ -29,7 +28,8 @@ | `pricePointCount` | `?int` | Optional | Count for the number of price points associated with the component | getPricePointCount(): ?int | setPricePointCount(?int pricePointCount): void | | `pricePointsUrl` | `?string` | Optional | URL that points to the location to read the existing price points via GET request | getPricePointsUrl(): ?string | setPricePointsUrl(?string pricePointsUrl): void | | `defaultPricePointName` | `?string` | Optional | - | getDefaultPricePointName(): ?string | setDefaultPricePointName(?string defaultPricePointName): void | -| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | +| `taxable` | `?bool` | Optional | Boolean flag describing whether a component is taxable or not. | getTaxable(): ?bool | setTaxable(?bool taxable): void | +| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | | `recurring` | `?bool` | Optional | - | getRecurring(): ?bool | setRecurring(?bool recurring): 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/containers/calendar-billing-snap-day.md b/doc/models/containers/calendar-billing-snap-day.md index b8637b7..cb106fb 100644 --- a/doc/models/containers/calendar-billing-snap-day.md +++ b/doc/models/containers/calendar-billing-snap-day.md @@ -3,12 +3,12 @@ ## Data Type -`int|string` +`int|string(SnapDay)` ## Cases | Type | | --- | | `int` | -| `string` | +| [`string(SnapDay)`](../../../doc/models/snap-day.md) | diff --git a/doc/models/containers/subscription-snap-day.md b/doc/models/containers/subscription-snap-day.md new file mode 100644 index 0000000..e9b5520 --- /dev/null +++ b/doc/models/containers/subscription-snap-day.md @@ -0,0 +1,14 @@ + +# Subscription Snap Day + +## Data Type + +`int|string(SnapDay)` + +## Cases + +| Type | +| --- | +| `int` | +| [`string(SnapDay)`](../../../doc/models/snap-day.md) | + diff --git a/doc/models/containers/update-subscription-snap-day.md b/doc/models/containers/update-subscription-snap-day.md index b721288..82de9fa 100644 --- a/doc/models/containers/update-subscription-snap-day.md +++ b/doc/models/containers/update-subscription-snap-day.md @@ -3,12 +3,12 @@ ## Data Type -`string(SnapDay)|int` +`int|string(SnapDay)` ## Cases | Type | | --- | -| [`string(SnapDay)`](../../../doc/models/snap-day.md) | | `int` | +| [`string(SnapDay)`](../../../doc/models/snap-day.md) | diff --git a/doc/models/create-allocation.md b/doc/models/create-allocation.md index 5076886..3e3d694 100644 --- a/doc/models/create-allocation.md +++ b/doc/models/create-allocation.md @@ -19,7 +19,7 @@ | `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 | | `initiateDunning` | `?bool` | Optional | If set to true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. Defaults to false. | getInitiateDunning(): ?bool | setInitiateDunning(?bool initiateDunning): void | | `pricePointId` | string\|int\|null | Optional | This is a container for one-of cases. | getPricePointId(): | setPricePointId( pricePointId): void | -| `billingSchedule` | [`?BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled | getBillingSchedule(): ?BillingSchedule | setBillingSchedule(?BillingSchedule billingSchedule): void | +| `billingSchedule` | [`?BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. This only works for site with Multifrequency enabled. | getBillingSchedule(): ?BillingSchedule | setBillingSchedule(?BillingSchedule billingSchedule): void | ## Example (as JSON) diff --git a/doc/models/create-invoice-coupon.md b/doc/models/create-invoice-coupon.md index 1f9ae30..1aec6fa 100644 --- a/doc/models/create-invoice-coupon.md +++ b/doc/models/create-invoice-coupon.md @@ -10,6 +10,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `code` | `?string` | Optional | - | getCode(): ?string | setCode(?string code): void | +| `subcode` | `?string` | Optional | - | getSubcode(): ?string | setSubcode(?string subcode): void | | `percentage` | string\|float\|null | Optional | This is a container for one-of cases. | getPercentage(): | setPercentage( percentage): void | | `amount` | string\|float\|null | Optional | This is a container for one-of cases. | getAmount(): | setAmount( amount): void | | `description` | `?string` | Optional | **Constraints**: *Maximum Length*: `255` | getDescription(): ?string | setDescription(?string description): void | @@ -22,9 +23,9 @@ { "percentage": 50.0, "code": "code4", + "subcode": "subcode8", "amount": "String9", - "description": "description4", - "product_family_id": "String3" + "description": "description4" } ``` diff --git a/doc/models/create-invoice-item.md b/doc/models/create-invoice-item.md index ffbb743..3acf41e 100644 --- a/doc/models/create-invoice-item.md +++ b/doc/models/create-invoice-item.md @@ -12,8 +12,8 @@ | `title` | `?string` | Optional | - | getTitle(): ?string | setTitle(?string title): void | | `quantity` | float\|string\|null | Optional | This is a container for one-of cases. | getQuantity(): | setQuantity( quantity): void | | `unitPrice` | float\|string\|null | Optional | This is a container for one-of cases. | getUnitPrice(): | setUnitPrice( unitPrice): void | -| `taxable` | `?bool` | Optional | Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes.

If using Avalara, a tax_code parameter must also be sent. | getTaxable(): ?bool | setTaxable(?bool taxable): void | -| `taxCode` | `?string` | Optional | - | getTaxCode(): ?string | setTaxCode(?string taxCode): void | +| `taxable` | `?bool` | Optional | Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. If using AvaTax, a tax_code parameter must also be sent. | getTaxable(): ?bool | setTaxable(?bool taxable): void | +| `taxCode` | `?string` | Optional | A string representing the tax code related to the product type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | | `periodRangeStart` | `?string` | Optional | YYYY-MM-DD | getPeriodRangeStart(): ?string | setPeriodRangeStart(?string periodRangeStart): void | | `periodRangeEnd` | `?string` | Optional | YYYY-MM-DD | getPeriodRangeEnd(): ?string | setPeriodRangeEnd(?string periodRangeEnd): void | | `productId` | string\|int\|null | Optional | This is a container for one-of cases. | getProductId(): | setProductId( productId): void | diff --git a/doc/models/create-metafield.md b/doc/models/create-metafield.md index 62b98c2..a96fe0e 100644 --- a/doc/models/create-metafield.md +++ b/doc/models/create-metafield.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | --- | --- | | `name` | `?string` | Optional | - | getName(): ?string | setName(?string name): void | | `scope` | [`?MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | getScope(): ?MetafieldScope | setScope(?MetafieldScope scope): void | -| `inputType` | [`?string(MetafieldInput)`](../../doc/models/metafield-input.md) | Optional | Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to 'text' | getInputType(): ?string | setInputType(?string inputType): void | +| `inputType` | [`?string(MetafieldInput)`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | getInputType(): ?string | setInputType(?string inputType): void | | `enum` | `?(string[])` | Optional | Only applicable when input_type is radio or dropdown. Empty strings will not be submitted. | getEnum(): ?array | setEnum(?array enum): void | ## Example (as JSON) diff --git a/doc/models/create-or-update-product.md b/doc/models/create-or-update-product.md index 4bdfd1d..c1270f7 100644 --- a/doc/models/create-or-update-product.md +++ b/doc/models/create-or-update-product.md @@ -13,18 +13,18 @@ | `handle` | `?string` | Optional | The product API handle | getHandle(): ?string | setHandle(?string handle): void | | `description` | `string` | Required | The product description | getDescription(): string | setDescription(string description): void | | `accountingCode` | `?string` | Optional | E.g. Internal ID or SKU Number | getAccountingCode(): ?string | setAccountingCode(?string accountingCode): void | -| `requireCreditCard` | `?bool` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page. | getRequireCreditCard(): ?bool | setRequireCreditCard(?bool requireCreditCard): void | +| `requireCreditCard` | `?bool` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. | getRequireCreditCard(): ?bool | setRequireCreditCard(?bool requireCreditCard): void | | `priceInCents` | `int` | Required | The product price, in integer cents | getPriceInCents(): int | setPriceInCents(int priceInCents): void | | `interval` | `int` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days | getInterval(): int | setInterval(int interval): void | | `intervalUnit` | [`string(IntervalUnit)`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product, either month or day | getIntervalUnit(): string | setIntervalUnit(string intervalUnit): void | | `trialPriceInCents` | `?int` | Optional | The product trial price, in integer cents | getTrialPriceInCents(): ?int | setTrialPriceInCents(?int trialPriceInCents): void | | `trialInterval` | `?int` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. | getTrialInterval(): ?int | setTrialInterval(?int trialInterval): void | | `trialIntervalUnit` | [`?string(IntervalUnit)`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | getTrialIntervalUnit(): ?string | setTrialIntervalUnit(?string trialIntervalUnit): void | -| `trialType` | `?string` | Optional | - | getTrialType(): ?string | setTrialType(?string trialType): void | +| `trialType` | [`?string(TrialType)`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | getTrialType(): ?string | setTrialType(?string trialType): 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 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 AvaTax to tax based on locale. This attribute has a max length of 25 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | ## Example (as JSON) diff --git a/doc/models/create-payment-profile.md b/doc/models/create-payment-profile.md index 3afca40..a4e3bd8 100644 --- a/doc/models/create-payment-profile.md +++ b/doc/models/create-payment-profile.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `chargifyToken` | `?string` | Optional | Token received after sending billing informations using chargify.js. | getChargifyToken(): ?string | setChargifyToken(?string chargifyToken): void | +| `chargifyToken` | `?string` | Optional | Token received after sending billing information using chargify.js. | getChargifyToken(): ?string | setChargifyToken(?string chargifyToken): void | | `id` | `?int` | Optional | - | getId(): ?int | setId(?int id): void | | `paymentType` | [`?string(PaymentType)`](../../doc/models/payment-type.md) | Optional | - | getPaymentType(): ?string | setPaymentType(?string paymentType): void | | `firstName` | `?string` | Optional | First name on card or bank account. If omitted, the first_name from customer attributes will be used. | getFirstName(): ?string | setFirstName(?string firstName): void | @@ -23,7 +23,7 @@ | `billingAddress2` | `?string` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | getBillingAddress2(): ?string | setBillingAddress2(?string billingAddress2): void | | `billingCity` | `?string` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | getBillingCity(): ?string | setBillingCity(?string billingCity): void | | `billingState` | `?string` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | getBillingState(): ?string | setBillingState(?string billingState): void | -| `billingCountry` | `?string` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | getBillingCountry(): ?string | setBillingCountry(?string billingCountry): void | +| `billingCountry` | `?string` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | getBillingCountry(): ?string | setBillingCountry(?string billingCountry): void | | `billingZip` | `?string` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | getBillingZip(): ?string | setBillingZip(?string billingZip): void | | `currentVault` | [`?string(AllVaults)`](../../doc/models/all-vaults.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | getCurrentVault(): ?string | setCurrentVault(?string currentVault): void | | `vaultToken` | `?string` | Optional | The “token” provided by your vault storage for an already stored payment profile | getVaultToken(): ?string | setVaultToken(?string vaultToken): void | diff --git a/doc/models/create-product-price-point-request.md b/doc/models/create-product-price-point-request.md index 9f1954f..030bfdf 100644 --- a/doc/models/create-product-price-point-request.md +++ b/doc/models/create-product-price-point-request.md @@ -25,7 +25,7 @@ "trial_price_in_cents": 108, "trial_interval": 202, "trial_interval_unit": "day", - "trial_type": "trial_type4" + "trial_type": "no_obligation" } } ``` diff --git a/doc/models/create-product-price-point.md b/doc/models/create-product-price-point.md index d9efc0f..13b6da8 100644 --- a/doc/models/create-product-price-point.md +++ b/doc/models/create-product-price-point.md @@ -17,7 +17,7 @@ | `trialPriceInCents` | `?int` | Optional | The product price point trial price, in integer cents | getTrialPriceInCents(): ?int | setTrialPriceInCents(?int trialPriceInCents): void | | `trialInterval` | `?int` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | getTrialInterval(): ?int | setTrialInterval(?int trialInterval): void | | `trialIntervalUnit` | [`?string(IntervalUnit)`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | getTrialIntervalUnit(): ?string | setTrialIntervalUnit(?string trialIntervalUnit): void | -| `trialType` | `?string` | Optional | - | getTrialType(): ?string | setTrialType(?string trialType): void | +| `trialType` | [`?string(TrialType)`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | getTrialType(): ?string | setTrialType(?string trialType): void | | `initialChargeInCents` | `?int` | Optional | The product price point initial charge, in integer cents | getInitialChargeInCents(): ?int | setInitialChargeInCents(?int initialChargeInCents): void | | `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 | @@ -37,7 +37,7 @@ "trial_price_in_cents": 48, "trial_interval": 102, "trial_interval_unit": "day", - "trial_type": "trial_type0" + "trial_type": "no_obligation" } ``` diff --git a/doc/models/create-usage-request.md b/doc/models/create-usage-request.md index 3efacab..2edab1c 100644 --- a/doc/models/create-usage-request.md +++ b/doc/models/create-usage-request.md @@ -21,6 +21,25 @@ "memo": "memo2", "billing_schedule": { "initial_billing_at": "2016-03-13" + }, + "custom_price": { + "tax_included": false, + "pricing_scheme": "stairstep", + "interval": 66, + "interval_unit": "day", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + }, + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ], + "renew_prepaid_allocation": false } } } diff --git a/doc/models/create-usage.md b/doc/models/create-usage.md index cfdbc61..0b9d8cd 100644 --- a/doc/models/create-usage.md +++ b/doc/models/create-usage.md @@ -12,7 +12,8 @@ | `quantity` | `?float` | Optional | integer by default or decimal number if fractional quantities are enabled for the component | getQuantity(): ?float | setQuantity(?float quantity): void | | `pricePointId` | `?string` | Optional | - | getPricePointId(): ?string | setPricePointId(?string pricePointId): void | | `memo` | `?string` | Optional | - | getMemo(): ?string | setMemo(?string memo): void | -| `billingSchedule` | [`?BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled | getBillingSchedule(): ?BillingSchedule | setBillingSchedule(?BillingSchedule billingSchedule): void | +| `billingSchedule` | [`?BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. This only works for site with Multifrequency enabled. | getBillingSchedule(): ?BillingSchedule | setBillingSchedule(?BillingSchedule billingSchedule): void | +| `customPrice` | [`?ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | getCustomPrice(): ?ComponentCustomPrice | setCustomPrice(?ComponentCustomPrice customPrice): void | ## Example (as JSON) @@ -23,6 +24,25 @@ "memo": "memo2", "billing_schedule": { "initial_billing_at": "2016-03-13" + }, + "custom_price": { + "tax_included": false, + "pricing_scheme": "stairstep", + "interval": 66, + "interval_unit": "day", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + }, + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ], + "renew_prepaid_allocation": false } } ``` diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index a7cb509..821b2a8 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -18,7 +18,7 @@ | `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 | | `pricePoints` | [`?(ComponentPricePointItem[])`](../../doc/models/component-price-point-item.md) | Optional | - | getPricePoints(): ?array | setPricePoints(?array pricePoints): void | | `unitPrice` | string\|float\|null | Optional | This is a container for one-of cases. | getUnitPrice(): | setUnitPrice( unitPrice): void | -| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | +| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | | `hideDateRangeOnInvoice` | `?bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | getHideDateRangeOnInvoice(): ?bool | setHideDateRangeOnInvoice(?bool hideDateRangeOnInvoice): void | | `eventBasedBillingMetricId` | `int` | Required | The ID of an event based billing metric that will be attached to this component. | getEventBasedBillingMetricId(): int | setEventBasedBillingMetricId(int eventBasedBillingMetricId): void | | `interval` | `?int` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | getInterval(): ?int | setInterval(?int interval): void | diff --git a/doc/models/list-coupons-filter.md b/doc/models/list-coupons-filter.md index ec0a802..ac5b3a1 100644 --- a/doc/models/list-coupons-filter.md +++ b/doc/models/list-coupons-filter.md @@ -16,7 +16,8 @@ | `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 | | `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 | +| `useSiteExchangeRate` | `?bool` | Optional | If true, restricts the list to coupons whose pricing is recalculated from the site’s current exchange rates, so their currency_prices array contains on-the-fly conversions rather than stored price records. If false, restricts the list to coupons that have manually defined amounts for each currency, ensuring the response includes the saved currency_prices entries instead of exchange-rate-derived values. Use in query `filter[use_site_exchange_rate]=true`. | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | +| `includeArchived` | `?bool` | Optional | Controls returning archived coupons. | getIncludeArchived(): ?bool | setIncludeArchived(?bool includeArchived): void | ## Example (as JSON) diff --git a/doc/models/metafield-input.md b/doc/models/metafield-input.md index ec8203b..75443bd 100644 --- a/doc/models/metafield-input.md +++ b/doc/models/metafield-input.md @@ -1,7 +1,7 @@ # Metafield Input -Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to 'text' +Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. ## Enumeration diff --git a/doc/models/metafield-scope.md b/doc/models/metafield-scope.md index 2ff094f..818e94b 100644 --- a/doc/models/metafield-scope.md +++ b/doc/models/metafield-scope.md @@ -15,8 +15,8 @@ Warning: When updating a metafield's scope attribute, all scope attributes must | `invoices` | [`?string(IncludeOption)`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from invoices. | getInvoices(): ?string | setInvoices(?string invoices): void | | `statements` | [`?string(IncludeOption)`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from statements. | getStatements(): ?string | setStatements(?string statements): void | | `portal` | [`?string(IncludeOption)`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from the portal. | getPortal(): ?string | setPortal(?string portal): void | -| `publicShow` | [`?string(IncludeOption)`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from being viewable by your ecosystem. | getPublicShow(): ?string | setPublicShow(?string publicShow): void | -| `publicEdit` | [`?string(IncludeOption)`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from being edited by your ecosystem. | getPublicEdit(): ?string | setPublicEdit(?string publicEdit): void | +| `publicShow` | [`?string(IncludeOption)`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields used in [Embeddable Components](page:development-tools/embeddable-components/overview) from being viewable by your ecosystem. | getPublicShow(): ?string | setPublicShow(?string publicShow): void | +| `publicEdit` | [`?string(IncludeOption)`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields used in [Embeddable Components](page:development-tools/embeddable-components/overview) from being editable by your ecosystem. | getPublicEdit(): ?string | setPublicEdit(?string publicEdit): void | | `hosted` | `?(string[])` | Optional | - | getHosted(): ?array | setHosted(?array hosted): void | ## Example (as JSON) diff --git a/doc/models/metafield.md b/doc/models/metafield.md index ec1f543..71b49ab 100644 --- a/doc/models/metafield.md +++ b/doc/models/metafield.md @@ -12,8 +12,8 @@ | `id` | `?int` | Optional | - | getId(): ?int | setId(?int id): void | | `name` | `?string` | Optional | - | getName(): ?string | setName(?string name): void | | `scope` | [`?MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | getScope(): ?MetafieldScope | setScope(?MetafieldScope scope): void | -| `dataCount` | `?int` | Optional | the amount of subscriptions this metafield has been applied to in Chargify | getDataCount(): ?int | setDataCount(?int dataCount): void | -| `inputType` | [`?string(MetafieldInput)`](../../doc/models/metafield-input.md) | Optional | Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to 'text' | getInputType(): ?string | setInputType(?string inputType): void | +| `dataCount` | `?int` | Optional | The amount of subscriptions this metafield has been applied to in Advanced Billing. | getDataCount(): ?int | setDataCount(?int dataCount): void | +| `inputType` | [`?string(MetafieldInput)`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | getInputType(): ?string | setInputType(?string inputType): void | | `enum` | string\|string[]\|null | Optional | This is a container for one-of cases. | getEnum(): | setEnum( enum): void | ## Example (as JSON) diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index 04ad5ed..70d587e 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -18,7 +18,7 @@ | `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 | | `pricePoints` | [`?(ComponentPricePointItem[])`](../../doc/models/component-price-point-item.md) | Optional | - | getPricePoints(): ?array | setPricePoints(?array pricePoints): void | | `unitPrice` | string\|float\|null | Optional | This is a container for one-of cases. | getUnitPrice(): | setUnitPrice( unitPrice): void | -| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | +| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | | `hideDateRangeOnInvoice` | `?bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | getHideDateRangeOnInvoice(): ?bool | setHideDateRangeOnInvoice(?bool hideDateRangeOnInvoice): void | | `displayOnHostedPage` | `?bool` | Optional | - | getDisplayOnHostedPage(): ?bool | setDisplayOnHostedPage(?bool displayOnHostedPage): void | | `allowFractionalQuantities` | `?bool` | Optional | - | getAllowFractionalQuantities(): ?bool | setAllowFractionalQuantities(?bool allowFractionalQuantities): void | diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index 661ed8d..02d46b7 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -17,7 +17,7 @@ | `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 | | `pricePoints` | [`?(ComponentPricePointItem[])`](../../doc/models/component-price-point-item.md) | Optional | - | getPricePoints(): ?array | setPricePoints(?array pricePoints): void | | `unitPrice` | string\|float | Required | This is a container for one-of cases. | getUnitPrice(): | setUnitPrice( unitPrice): void | -| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | +| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | | `hideDateRangeOnInvoice` | `?bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | getHideDateRangeOnInvoice(): ?bool | setHideDateRangeOnInvoice(?bool hideDateRangeOnInvoice): void | | `displayOnHostedPage` | `?bool` | Optional | - | getDisplayOnHostedPage(): ?bool | setDisplayOnHostedPage(?bool displayOnHostedPage): void | | `allowFractionalQuantities` | `?bool` | Optional | - | getAllowFractionalQuantities(): ?bool | setAllowFractionalQuantities(?bool allowFractionalQuantities): void | diff --git a/doc/models/payment-profile-attributes.md b/doc/models/payment-profile-attributes.md index 8e7f1de..ad29593 100644 --- a/doc/models/payment-profile-attributes.md +++ b/doc/models/payment-profile-attributes.md @@ -25,7 +25,7 @@ alias to credit_card_attributes | `billingAddress2` | `?string` | Optional | (Optional) Second line of the customer’s billing address i.e. Apt. 100 | getBillingAddress2(): ?string | setBillingAddress2(?string billingAddress2): void | | `billingCity` | `?string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | getBillingCity(): ?string | setBillingCity(?string billingCity): void | | `billingState` | `?string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | getBillingState(): ?string | setBillingState(?string billingState): void | -| `billingCountry` | `?string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | getBillingCountry(): ?string | setBillingCountry(?string billingCountry): void | +| `billingCountry` | `?string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | getBillingCountry(): ?string | setBillingCountry(?string billingCountry): void | | `billingZip` | `?string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | getBillingZip(): ?string | setBillingZip(?string billingZip): void | | `currentVault` | [`?string(AllVaults)`](../../doc/models/all-vaults.md) | Optional | (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. | getCurrentVault(): ?string | setCurrentVault(?string currentVault): void | | `vaultToken` | `?string` | Optional | (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile | getVaultToken(): ?string | setVaultToken(?string vaultToken): void | diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index c0d7cfb..b6ffd5d 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -20,7 +20,7 @@ | `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 | | `pricePoints` | [`?(CreatePrepaidUsageComponentPricePoint[])`](../../doc/models/create-prepaid-usage-component-price-point.md) | Optional | - | getPricePoints(): ?array | setPricePoints(?array pricePoints): void | | `unitPrice` | string\|float\|null | Optional | This is a container for one-of cases. | getUnitPrice(): | setUnitPrice( unitPrice): void | -| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | +| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | | `hideDateRangeOnInvoice` | `?bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | getHideDateRangeOnInvoice(): ?bool | setHideDateRangeOnInvoice(?bool hideDateRangeOnInvoice): void | | `overagePricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | getOveragePricing(): OveragePricing | setOveragePricing(OveragePricing overagePricing): void | | `rolloverPrepaidRemainder` | `?bool` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | getRolloverPrepaidRemainder(): ?bool | setRolloverPrepaidRemainder(?bool rolloverPrepaidRemainder): void | diff --git a/doc/models/product-price-point.md b/doc/models/product-price-point.md index 49c90f9..75fdd19 100644 --- a/doc/models/product-price-point.md +++ b/doc/models/product-price-point.md @@ -18,7 +18,7 @@ | `trialPriceInCents` | `?int` | Optional | The product price point trial price, in integer cents | getTrialPriceInCents(): ?int | setTrialPriceInCents(?int trialPriceInCents): void | | `trialInterval` | `?int` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days | getTrialInterval(): ?int | setTrialInterval(?int trialInterval): void | | `trialIntervalUnit` | [`?string(IntervalUnit)`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | getTrialIntervalUnit(): ?string | setTrialIntervalUnit(?string trialIntervalUnit): void | -| `trialType` | `?string` | Optional | - | getTrialType(): ?string | setTrialType(?string trialType): void | +| `trialType` | [`?string(TrialType)`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | getTrialType(): ?string | setTrialType(?string trialType): void | | `introductoryOffer` | `?bool` | Optional | reserved for future use | getIntroductoryOffer(): ?bool | setIntroductoryOffer(?bool introductoryOffer): void | | `initialChargeInCents` | `?int` | Optional | The product price point initial charge, in integer cents | getInitialChargeInCents(): ?int | setInitialChargeInCents(?int initialChargeInCents): void | | `initialChargeAfterTrial` | `?bool` | Optional | - | getInitialChargeAfterTrial(): ?bool | setInitialChargeAfterTrial(?bool initialChargeAfterTrial): void | diff --git a/doc/models/product.md b/doc/models/product.md index aa6bcd6..3a5b777 100644 --- a/doc/models/product.md +++ b/doc/models/product.md @@ -14,7 +14,7 @@ | `handle` | `?string` | Optional | The product API handle | getHandle(): ?string | setHandle(?string handle): void | | `description` | `?string` | Optional | The product description | getDescription(): ?string | setDescription(?string description): void | | `accountingCode` | `?string` | Optional | E.g. Internal ID or SKU Number | getAccountingCode(): ?string | setAccountingCode(?string accountingCode): void | -| `requestCreditCard` | `?bool` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page. | getRequestCreditCard(): ?bool | setRequestCreditCard(?bool requestCreditCard): void | +| `requestCreditCard` | `?bool` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. | getRequestCreditCard(): ?bool | setRequestCreditCard(?bool requestCreditCard): void | | `expirationInterval` | `?int` | Optional | A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval | 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 | | `createdAt` | `?DateTime` | Optional | Timestamp indicating when this product was created | getCreatedAt(): ?\DateTime | setCreatedAt(?\DateTime createdAt): void | @@ -40,7 +40,7 @@ | `requestBillingAddress` | `?bool` | Optional | A boolean indicating whether to request a billing address on any Self-Service Pages that are used by subscribers of this product. | getRequestBillingAddress(): ?bool | setRequestBillingAddress(?bool requestBillingAddress): void | | `requireBillingAddress` | `?bool` | Optional | A boolean indicating whether a billing address is required to add a payment profile, especially at signup. | getRequireBillingAddress(): ?bool | setRequireBillingAddress(?bool requireBillingAddress): void | | `requireShippingAddress` | `?bool` | Optional | A boolean indicating whether a shipping address is required for the customer, especially at signup. | getRequireShippingAddress(): ?bool | setRequireShippingAddress(?bool requireShippingAddress): 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. | 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 AvaTax to tax based on locale. This attribute has a max length of 25 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | | `defaultProductPricePointId` | `?int` | Optional | - | getDefaultProductPricePointId(): ?int | setDefaultProductPricePointId(?int defaultProductPricePointId): void | | `useSiteExchangeRate` | `?bool` | Optional | - | getUseSiteExchangeRate(): ?bool | setUseSiteExchangeRate(?bool useSiteExchangeRate): void | | `itemCategory` | `?string` | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | getItemCategory(): ?string | setItemCategory(?string itemCategory): void | diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index 5b6ad5d..0a8d339 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -20,7 +20,7 @@ | `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 | | `pricePoints` | [`?(ComponentPricePointItem[])`](../../doc/models/component-price-point-item.md) | Optional | - | getPricePoints(): ?array | setPricePoints(?array pricePoints): void | | `unitPrice` | string\|float\|null | Optional | This is a container for one-of cases. | getUnitPrice(): | setUnitPrice( unitPrice): void | -| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | +| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | | `hideDateRangeOnInvoice` | `?bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | getHideDateRangeOnInvoice(): ?bool | setHideDateRangeOnInvoice(?bool hideDateRangeOnInvoice): void | | `recurring` | `?bool` | Optional | - | getRecurring(): ?bool | setRecurring(?bool recurring): void | | `displayOnHostedPage` | `?bool` | Optional | - | getDisplayOnHostedPage(): ?bool | setDisplayOnHostedPage(?bool displayOnHostedPage): void | diff --git a/doc/models/resume-options.md b/doc/models/resume-options.md index cfede4e..5b28fa2 100644 --- a/doc/models/resume-options.md +++ b/doc/models/resume-options.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `requireResume` | `?bool` | Optional | Chargify will only attempt to resume the subscription's billing period. If not resumable, the subscription will be left in it's current state. | getRequireResume(): ?bool | setRequireResume(?bool requireResume): void | +| `requireResume` | `?bool` | Optional | Chargify will only attempt to resume the subscription's billing period. If not resumable, the subscription will be left in its current state. | getRequireResume(): ?bool | setRequireResume(?bool requireResume): void | | `forgiveBalance` | `?bool` | Optional | Indicates whether or not Chargify should clear the subscription's existing balance before attempting to resume the subscription. If subscription cannot be resumed, the balance will remain as it was before the attempt to resume was made. | getForgiveBalance(): ?bool | setForgiveBalance(?bool forgiveBalance): void | ## Example (as JSON) diff --git a/doc/models/snap-day.md b/doc/models/snap-day.md index 55479f1..3d441f6 100644 --- a/doc/models/snap-day.md +++ b/doc/models/snap-day.md @@ -1,8 +1,6 @@ # Snap Day -Use for subscriptions with product eligible for calendar billing only. Value can be 1-28 or 'end'. - ## Enumeration `SnapDay` diff --git a/doc/models/subscription-custom-price.md b/doc/models/subscription-custom-price.md index 5531f78..e973214 100644 --- a/doc/models/subscription-custom-price.md +++ b/doc/models/subscription-custom-price.md @@ -19,6 +19,7 @@ | `trialPriceInCents` | string\|int\|null | Optional | This is a container for one-of cases. | getTrialPriceInCents(): | setTrialPriceInCents( trialPriceInCents): void | | `trialInterval` | string\|int\|null | Optional | This is a container for one-of cases. | getTrialInterval(): | setTrialInterval( trialInterval): void | | `trialIntervalUnit` | [`?string(IntervalUnit)`](../../doc/models/interval-unit.md) | Optional | (Optional) | getTrialIntervalUnit(): ?string | setTrialIntervalUnit(?string trialIntervalUnit): void | +| `trialType` | [`?string(TrialType)`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | getTrialType(): ?string | setTrialType(?string trialType): void | | `initialChargeInCents` | string\|int\|null | Optional | This is a container for one-of cases. | getInitialChargeInCents(): | setInitialChargeInCents( initialChargeInCents): void | | `initialChargeAfterTrial` | `?bool` | Optional | (Optional) | getInitialChargeAfterTrial(): ?bool | setInitialChargeAfterTrial(?bool initialChargeAfterTrial): void | | `expirationInterval` | string\|int\|null | Optional | This is a container for one-of cases. | getExpirationInterval(): | setExpirationInterval( expirationInterval): void | diff --git a/doc/models/subscription-group-component-custom-price.md b/doc/models/subscription-group-component-custom-price.md index ee21202..7ac9d64 100644 --- a/doc/models/subscription-group-component-custom-price.md +++ b/doc/models/subscription-group-component-custom-price.md @@ -39,7 +39,8 @@ Used in place of `price_point_id` to define a custom price point unique to the s "ending_quantity": 40, "unit_price": 23.26 } - ] + ], + "renew_prepaid_allocation": false } ] } diff --git a/doc/models/subscription-group-signup-component.md b/doc/models/subscription-group-signup-component.md index df8d837..8d10b31 100644 --- a/doc/models/subscription-group-signup-component.md +++ b/doc/models/subscription-group-signup-component.md @@ -49,7 +49,8 @@ "ending_quantity": 40, "unit_price": 23.26 } - ] + ], + "renew_prepaid_allocation": false }, { "tax_included": false, @@ -62,7 +63,8 @@ "ending_quantity": 40, "unit_price": 23.26 } - ] + ], + "renew_prepaid_allocation": false }, { "tax_included": false, @@ -75,7 +77,8 @@ "ending_quantity": 40, "unit_price": 23.26 } - ] + ], + "renew_prepaid_allocation": false } ] } diff --git a/doc/models/subscription.md b/doc/models/subscription.md index d87b9e5..3d4dd7b 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -33,7 +33,7 @@ | `signupRevenue` | `?string` | Optional | The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00) | getSignupRevenue(): ?string | setSignupRevenue(?string signupRevenue): void | | `delayedCancelAt` | `?DateTime` | Optional | Timestamp for when the subscription is currently set to cancel. | getDelayedCancelAt(): ?\DateTime | setDelayedCancelAt(?\DateTime delayedCancelAt): void | | `couponCode` | `?string` | Optional | (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. | getCouponCode(): ?string | setCouponCode(?string couponCode): void | -| `snapDay` | `?string` | Optional | The day of the month that the subscription will charge according to calendar billing rules, if used. | getSnapDay(): ?string | setSnapDay(?string snapDay): void | +| `snapDay` | int\|string([SnapDay](../../doc/models/snap-day.md))\|null | Optional | This is a container for one-of cases. | getSnapDay(): | setSnapDay( snapDay): void | | `paymentCollectionMethod` | [`?string(CollectionMethod)`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | getPaymentCollectionMethod(): ?string | setPaymentCollectionMethod(?string paymentCollectionMethod): void | | `customer` | [`?Customer`](../../doc/models/customer.md) | Optional | - | getCustomer(): ?Customer | setCustomer(?Customer customer): void | | `product` | [`?Product`](../../doc/models/product.md) | Optional | - | getProduct(): ?Product | setProduct(?Product product): void | @@ -51,7 +51,7 @@ | `couponCodes` | `?(string[])` | Optional | An array for all the coupons attached to the subscription. | getCouponCodes(): ?array | setCouponCodes(?array couponCodes): void | | `offerId` | `?int` | Optional | The ID of the offer associated with the subscription. | getOfferId(): ?int | setOfferId(?int offerId): void | | `payerId` | `?int` | Optional | On Relationship Invoicing, the ID of the individual paying for the subscription. Defaults to the Customer ID unless the 'Customer Hierarchies & WhoPays' feature is enabled. | getPayerId(): ?int | setPayerId(?int payerId): void | -| `currentBillingAmountInCents` | `?int` | Optional | The balance in cents plus the estimated renewal amount in cents. Returned ONLY for readSubscription operation as it's compute intensive operation. | getCurrentBillingAmountInCents(): ?int | setCurrentBillingAmountInCents(?int currentBillingAmountInCents): void | +| `currentBillingAmountInCents` | `?int` | Optional | The balance in cents plus the estimated renewal amount in cents. Returned ONLY for the readSubscription operation as it's a compute intensive operation. | getCurrentBillingAmountInCents(): ?int | setCurrentBillingAmountInCents(?int currentBillingAmountInCents): void | | `productPricePointId` | `?int` | Optional | The product price point currently subscribed to. | getProductPricePointId(): ?int | setProductPricePointId(?int productPricePointId): void | | `productPricePointType` | [`?string(PricePointType)`](../../doc/models/price-point-type.md) | Optional | Price point type. We expose the following types:

1. **default**: a price point that is marked as a default price for a certain product.
2. **custom**: a custom price point.
3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. | getProductPricePointType(): ?string | setProductPricePointType(?string productPricePointType): void | | `nextProductPricePointId` | `?int` | Optional | If a delayed product change is scheduled, the ID of the product price point that the subscription will be changed to at the next renewal. | getNextProductPricePointId(): ?int | setNextProductPricePointId(?int nextProductPricePointId): void | diff --git a/doc/models/trial-type.md b/doc/models/trial-type.md new file mode 100644 index 0000000..1298d99 --- /dev/null +++ b/doc/models/trial-type.md @@ -0,0 +1,16 @@ + +# Trial Type + +Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. + +## Enumeration + +`TrialType` + +## Fields + +| Name | +| --- | +| `NO_OBLIGATION` | +| `PAYMENT_EXPECTED` | + diff --git a/doc/models/update-component.md b/doc/models/update-component.md index cf9655a..428d2c5 100644 --- a/doc/models/update-component.md +++ b/doc/models/update-component.md @@ -14,7 +14,7 @@ | `description` | `?string` | Optional | The description of the component. | getDescription(): ?string | setDescription(?string description): void | | `accountingCode` | `?string` | Optional | - | getAccountingCode(): ?string | setAccountingCode(?string accountingCode): void | | `taxable` | `?bool` | Optional | Boolean flag describing whether a component is taxable or not. | getTaxable(): ?bool | setTaxable(?bool taxable): void | -| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | +| `taxCode` | `?string` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | getTaxCode(): ?string | setTaxCode(?string taxCode): void | | `itemCategory` | [`?string(ItemCategory)`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | getItemCategory(): ?string | setItemCategory(?string itemCategory): void | | `displayOnHostedPage` | `?bool` | Optional | - | getDisplayOnHostedPage(): ?bool | setDisplayOnHostedPage(?bool displayOnHostedPage): 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 | diff --git a/doc/models/update-metafield.md b/doc/models/update-metafield.md index 0cfe87a..06a7fd7 100644 --- a/doc/models/update-metafield.md +++ b/doc/models/update-metafield.md @@ -12,8 +12,8 @@ | `currentName` | `?string` | Optional | - | getCurrentName(): ?string | setCurrentName(?string currentName): void | | `name` | `?string` | Optional | - | getName(): ?string | setName(?string name): void | | `scope` | [`?MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | getScope(): ?MetafieldScope | setScope(?MetafieldScope scope): void | -| `inputType` | [`?string(MetafieldInput)`](../../doc/models/metafield-input.md) | Optional | Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to 'text' | getInputType(): ?string | setInputType(?string inputType): void | -| `enum` | `?(string[])` | Optional | Only applicable when input_type is radio or dropdown | getEnum(): ?array | setEnum(?array enum): void | +| `inputType` | [`?string(MetafieldInput)`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | getInputType(): ?string | setInputType(?string inputType): void | +| `enum` | `?(string[])` | Optional | Only applicable when input_type is radio or dropdown. | getEnum(): ?array | setEnum(?array enum): void | ## Example (as JSON) diff --git a/doc/models/update-payment-profile.md b/doc/models/update-payment-profile.md index 97798d7..8c6219e 100644 --- a/doc/models/update-payment-profile.md +++ b/doc/models/update-payment-profile.md @@ -20,7 +20,7 @@ | `billingCity` | `?string` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | getBillingCity(): ?string | setBillingCity(?string billingCity): void | | `billingState` | `?string` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | getBillingState(): ?string | setBillingState(?string billingState): void | | `billingZip` | `?string` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | getBillingZip(): ?string | setBillingZip(?string billingZip): void | -| `billingCountry` | `?string` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | getBillingCountry(): ?string | setBillingCountry(?string billingCountry): void | +| `billingCountry` | `?string` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | getBillingCountry(): ?string | setBillingCountry(?string billingCountry): void | | `billingAddress2` | `?string` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | getBillingAddress2(): ?string | setBillingAddress2(?string billingAddress2): void | ## Example (as JSON) diff --git a/doc/models/update-subscription-component.md b/doc/models/update-subscription-component.md index a7a9127..492635c 100644 --- a/doc/models/update-subscription-component.md +++ b/doc/models/update-subscription-component.md @@ -33,7 +33,8 @@ "ending_quantity": 40, "unit_price": 23.26 } - ] + ], + "renew_prepaid_allocation": false } } ``` diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md index 0bec990..bf65412 100644 --- a/doc/models/update-subscription.md +++ b/doc/models/update-subscription.md @@ -15,7 +15,7 @@ | `productChangeDelayed` | `?bool` | Optional | - | getProductChangeDelayed(): ?bool | setProductChangeDelayed(?bool productChangeDelayed): void | | `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 | +| `snapDay` | int\|string([SnapDay](../../doc/models/snap-day.md))\|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 | diff --git a/src/AdvancedBillingClient.php b/src/AdvancedBillingClient.php index 4aabd30..e158a1a 100644 --- a/src/AdvancedBillingClient.php +++ b/src/AdvancedBillingClient.php @@ -144,7 +144,7 @@ public function __construct(array $config = []) ->converter(new CompatibilityConverter()) ->jsonHelper(ApiHelper::getJsonHelper()) ->apiCallback($this->config['httpCallback'] ?? null) - ->userAgent('AB SDK PHP:7.0.1 on OS {os-info}') + ->userAgent('AB SDK PHP:8.0.0 on OS {os-info}') ->globalConfig($this->getGlobalConfiguration()) ->globalErrors($this->getGlobalErrors()) ->serverUrls(self::ENVIRONMENT_MAP[$this->getEnvironment()], Server::PRODUCTION) diff --git a/src/Controllers/AdvanceInvoiceController.php b/src/Controllers/AdvanceInvoiceController.php index a295cb2..cfc4c8d 100644 --- a/src/Controllers/AdvanceInvoiceController.php +++ b/src/Controllers/AdvanceInvoiceController.php @@ -24,10 +24,10 @@ class AdvanceInvoiceController extends BaseController { /** - * Generate an invoice in advance for a subscription's next renewal date. [Please see our docs](https: - * //maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information - * on advance invoices, including eligibility on generating one; for the most part, they function like - * any other invoice, except they are issued early and have special behavior upon being voided. + * Generate an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio. + * zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on + * advance invoices, including eligibility on generating one; for the most part, they function like any + * other invoice, except they are issued early and have special behavior upon being voided. * A subscription may only have one advance invoice per billing period. Attempting to issue an advance * invoice when one already exists will return an error. * That said, regeneration of the invoice may be forced with the params `force: true`, which will void @@ -99,7 +99,7 @@ public function readAdvanceInvoice(int $subscriptionId): Invoice * Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. * A `reason` is required in order to void, and the invoice must have an open status. Voiding will * cause any prepayments and credits that were applied to the invoice to be returned to the - * subscription. For a full overview of the impact of voiding, please [see our help docs]($m/Invoice). + * subscription. For a full overview of the impact of voiding, [see our help docs]($m/Invoice). * * @param int $subscriptionId The Chargify id of the subscription * @param VoidInvoiceRequest|null $body diff --git a/src/Controllers/BillingPortalController.php b/src/Controllers/BillingPortalController.php index f6f46c3..e0c2463 100644 --- a/src/Controllers/BillingPortalController.php +++ b/src/Controllers/BillingPortalController.php @@ -49,8 +49,8 @@ class BillingPortalController extends BaseController * * In order to prevent abuse & overuse, we ask that you request a new URL only when absolutely * necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as - * much as possible. If you use the URL frequently (such as to display on your website), please **do - * not** make an API request to Advanced Billing every time. + * much as possible. If you use the URL frequently (such as to display on your website), **do not** + * make an API request to Advanced Billing every time. * * @param int $customerId The Chargify id of the customer * @param int|null $autoInvite When set to 1, an Invitation email will be sent to the Customer. diff --git a/src/Controllers/ComponentPricePointsController.php b/src/Controllers/ComponentPricePointsController.php index 9599ef8..6c4cd5a 100644 --- a/src/Controllers/ComponentPricePointsController.php +++ b/src/Controllers/ComponentPricePointsController.php @@ -184,7 +184,7 @@ public function bulkCreateComponentPricePoints( } /** - * When updating a price point, it's prices can be updated as well by creating new prices or editing / + * When updating a price point, prices can be updated as well by creating new prices or editing / * removing existing ones. * * Passing in a price bracket without an `id` will attempt to create a new price. diff --git a/src/Controllers/ComponentsController.php b/src/Controllers/ComponentsController.php index 81d6c33..b67fde3 100644 --- a/src/Controllers/ComponentsController.php +++ b/src/Controllers/ComponentsController.php @@ -42,8 +42,8 @@ class ComponentsController extends BaseController * the start of every billing period. If you want to bill for a quantity of something that does not * change unless you change it, then you want quantity components, instead. * - * For more information on components, please see our documentation [here](https://maxio.zendesk. - * com/hc/en-us/articles/24261141522189-Components-Overview). + * For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en- + * us/articles/24261141522189-Components-Overview). * * @param string $productFamilyId Either the product family's id or its handle prefixed with * `handle:` @@ -101,8 +101,8 @@ public function createMeteredComponent( * The allocated quantity for one-time quantity-based components immediately gets reset back to zero * after the allocation is made. * - * For more information on components, please see our documentation [here](https://maxio.zendesk. - * com/hc/en-us/articles/24261141522189-Components-Overview). + * For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en- + * us/articles/24261141522189-Components-Overview). * * @param string $productFamilyId Either the product family's id or its handle prefixed with * `handle:` @@ -148,8 +148,8 @@ public function createQuantityBasedComponent( * On/off components are used for any flat fee, recurring add on (think $99/month for tech support or a * flat add on shipping fee). * - * For more information on components, please see our documentation [here](https://maxio.zendesk. - * com/hc/en-us/articles/24261141522189-Components-Overview). + * For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en- + * us/articles/24261141522189-Components-Overview). * * @param string $productFamilyId Either the product family's id or its handle prefixed with * `handle:` @@ -197,8 +197,8 @@ public function createOnOffComponent( * charge at the end of the period for the amount of units used, prepaid components are charged for at * the time of purchase, and we subsequently keep track of the usage against the amount purchased. * - * For more information on components, please see our documentation [here](https://maxio.zendesk. - * com/hc/en-us/articles/24261141522189-Components-Overview). + * For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en- + * us/articles/24261141522189-Components-Overview). * * @param string $productFamilyId Either the product family's id or its handle prefixed with * `handle:` @@ -250,8 +250,8 @@ public function createPrepaidUsageComponent( * So, instead of reporting usage directly for each component (as you would with metered components), * the usage is derived from analysis of your events. * - * For more information on components, please see our documentation [here](https://maxio.zendesk. - * com/hc/en-us/articles/24261141522189-Components-Overview). + * For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en- + * us/articles/24261141522189-Components-Overview). * * @param string $productFamilyId Either the product family's id or its handle prefixed with * `handle:` diff --git a/src/Controllers/CouponsController.php b/src/Controllers/CouponsController.php index 1f558fe..d7ce9a5 100644 --- a/src/Controllers/CouponsController.php +++ b/src/Controllers/CouponsController.php @@ -33,13 +33,13 @@ class CouponsController extends BaseController /** * ## Coupons Documentation * - * Coupons can be administered in the Advanced Billing application or created via API. Please view our - * section on [creating coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating- - * Editing-Deleting-Coupons) for more information. + * Coupons can be administered in the Advanced Billing application or created via API. View our section + * on [creating coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing- + * Deleting-Coupons) for more information. * * Additionally, for documentation on how to apply a coupon to a subscription within the Advanced - * Billing UI, please see our documentation [here](https://maxio.zendesk.com/hc/en- - * us/articles/24261259337101-Coupons-and-Subscriptions). + * Billing UI, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- + * Coupons-and-Subscriptions). * * ## Create Coupon * @@ -89,10 +89,6 @@ public function createCoupon(int $productFamilyId, ?CouponRequest $body = null): /** * List coupons for a specific Product Family in a Site. * - * If the coupon 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. - * * @param array $options Array with all options for search * * @return CouponResponse[] Response from the API call @@ -277,10 +273,6 @@ public function archiveCoupon(int $productFamilyId, int $couponId): CouponRespon /** * You can retrieve a list of coupons. * - * If the coupon 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. - * * @param array $options Array with all options for search * * @return CouponResponse[] Response from the API call @@ -307,8 +299,8 @@ public function listCoupons(array $options): array * This request will provide details about the coupon usage as an array of data hashes, one per product. * * @param int $productFamilyId The Advanced Billing id of the product family to which the coupon - * belongs - * @param int $couponId The Advanced Billing id of the coupon + * belongs. + * @param int $couponId The Advanced Billing id of the coupon. * * @return CouponUsage[] Response from the API call * @@ -463,8 +455,8 @@ public function createOrUpdateCouponCurrencyPrices( * [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes). * * Additionally, for documentation on how to apply a coupon to a Subscription within the Advanced - * Billing UI, please see our documentation [here](https://maxio.zendesk.com/hc/en- - * us/articles/24261259337101-Coupons-and-Subscriptions). + * Billing UI, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- + * Coupons-and-Subscriptions). * * ## Create Coupon Subcode * diff --git a/src/Controllers/CustomFieldsController.php b/src/Controllers/CustomFieldsController.php index f086112..a29ca8e 100644 --- a/src/Controllers/CustomFieldsController.php +++ b/src/Controllers/CustomFieldsController.php @@ -34,48 +34,31 @@ class CustomFieldsController extends BaseController { /** - * ## Custom Fields: Metafield Intro + * Creates metafields on a Site for either the Subscriptions or Customers resource. * - * **Advanced Billing refers to Custom Fields in the API documentation as metafields and metadata.** - * Within the Advanced Billing UI, metadata and metafields are grouped together under the umbrella of - * "Custom Fields." All of our UI-based documentation that references custom fields will not cite the - * terminology metafields or metadata. + * Metafields and their metadata are created in the Custom Fields configuration page on your Site. + * Metafields can be populated with metadata when you create them or later with the [Update + * Metafield]($e/Custom%20Fields/updateMetafield), [Create Metadata]($e/Custom%20Fields/createMetadata), + * or [Update Metadata]($e/Custom%20Fields/updateMetadata) endpoints. The Create Metadata and Update + * Metadata endpoints allow you to add metafields and metadata values to a specific subscription or + * customer. * - * + **Metafield is the custom field** - * + **Metadata is the data populating the custom field.** + * Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields + * for Subscriptions and another 100 for Customers. * - * Advanced Billing Metafields are used to add meaningful attributes to subscription and customer - * resources. Full documentation on how to create Custom Fields in the Advanced Billing UI can be - * located [here](https://maxio.zendesk.com/hc/en-us/sections/24266118312589-Custom-Fields). For - * additional documentation on how to record data within custom fields, please see our subscription- - * based documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24251701302925-Subscription- - * Summary-Custom-Fields-Tab). + * > Note: After creating a metafield, the resource type cannot be modified. * - * Metafield are the place where you will set up your resource to accept additional data. It is scoped - * to the site instead of a specific customer or subscription. Think of it as the key, and Metadata as - * the value on every record. + * In the UI and product documentation, metafields and metadata are called Custom Fields. * - * ## Create Metafields + * - Metafield is the custom field + * - Metadata is the data populating the custom field. * - * Use this endpoint to create metafields for your Site. Metafields can be populated with metadata - * after the fact. + * See [Custom Fields Reference](https://docs.maxio.com/hc/en-us/articles/24266140850573-Custom-Fields- + * Reference) and [Custom Fields Tab](https://maxio.zendesk.com/hc/en-us/articles/24251701302925- + * Subscription-Summary-Custom-Fields-Tab) for information on using Custom Fields in the Advanced + * Billing UI. * - * Each site is limited to 100 unique Metafields (i.e. keys, or names) per resource. This means you can - * have 100 Metafields for Subscription and another 100 for Customer. - * - * ### Metafields "On-the-Fly" - * - * 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 - * - * If configuring metafields in the Admin UI or via the API, be careful sending updates to metafields - * with the scope attribute – **if a partial update is sent it will overwrite the current - * configuration**. - * - * @param string $resourceType the resource type to which the metafields belong + * @param string $resourceType The resource type to which the metafields belong. * @param CreateMetafieldsRequest|null $body * * @return Metafield[] Response from the API call @@ -108,8 +91,8 @@ public function createMetafields(string $resourceType, ?CreateMetafieldsRequest } /** - * This endpoint lists metafields associated with a site. The metafield description and usage is - * contained in the response. + * Lists the metafields and their associated details for a Site and resource type. You can filter the + * request to a specific metafield. * * @param array $options Array with all options for search * @@ -141,10 +124,40 @@ public function listMetafields(array $options): ListMetafieldsResponse } /** - * Use the following method to update metafields for your Site. Metafields can be populated with - * metadata after the fact. + * Updates metafields on your Site for a resource type. Depending on the request structure, you can + * update or add metafields and metadata to the Subscriptions or Customers resource. + * + * With this endpoint, you can: + * + * - Add metafields. If the metafield specified in current_name does not exist, a new metafield is + * added. + * >Note: Each site is limited to 100 unique metafields per resource. This means you can have 100 + * metafields for Subscriptions and another 100 for Customers. + * + * - Change the name of a metafield. + * >Note: To keep the metafield name the same and only update the metadata for the metafield, you + * must use the current metafield name in both the `current_name` and `name` parameters. + * + * - Change the input type for the metafield. For example, you can change a metafield input type from + * text to a dropdown. If you change the input type from text to a dropdown or radio, you must update + * the specific subscriptions or customers where the metafield was used to reflect the updated + * metafield and metadata. + * + * - Add metadata values to the existing metadata for a dropdown or radio metafield. + * >Note: Updates to metadata overwrite. To add one or more values, you must specify all metadata + * values including the new value you want to add. * - * @param string $resourceType the resource type to which the metafields belong + * - Add new metadata to a dropdown or radio for a metafield that was created without metadata. + * + * - Remove metadata for a dropdown or radio for a metafield. + * >Note: Updates to metadata overwrite existing values. To remove one or more values, specify all + * metadata values except those you want to remove. + * + * - Add or update scope settings for a metafield. + * >Note: Scope changes overwrite existing settings. You must specify the complete scope, including + * the changes you want to make. + * + * @param string $resourceType The resource type to which the metafields belong. * @param UpdateMetafieldsRequest|null $body * * @return Metafield[] Response from the API call @@ -177,12 +190,10 @@ public function updateMetafield(string $resourceType, ?UpdateMetafieldsRequest $ } /** - * Use the following method to delete a metafield. This will remove the metafield from the Site. + * Deletes a metafield from your Site. Removes the metafield and associated metadata from all + * Subscriptions or Customers resources on the Site. * - * Additionally, this will remove the metafield and associated metadata with all Subscriptions on the - * Site. - * - * @param string $resourceType the resource type to which the metafields belong + * @param string $resourceType The resource type to which the metafields belong. * @param string|null $name The name of the metafield to be deleted * * @return void Response from the API call @@ -207,41 +218,18 @@ public function deleteMetafield(string $resourceType, ?string $name = null): voi } /** - * ## Custom Fields: Metadata Intro - * - * **Advanced Billing refers to Custom Fields in the API documentation as metafields and metadata.** - * Within the Advanced Billing UI, metadata and metafields are grouped together under the umbrella of - * "Custom Fields." All of our UI-based documentation that references custom fields will not cite the - * terminology metafields or metadata. - * - * + **Metafield is the custom field** - * + **Metadata is the data populating the custom field.** - * - * Advanced Billing Metafields are used to add meaningful attributes to subscription and customer - * resources. Full documentation on how to create Custom Fields in the Advanced Billing UI can be - * located [here](https://maxio.zendesk.com/hc/en-us/articles/24266164865677-Custom-Fields-Overview). - * For additional documentation on how to record data within custom fields, please see our subscription- - * based documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24251701302925-Subscription- - * Summary-Custom-Fields-Tab) - * - * Metadata is associated to a customer or subscription, and corresponds to a Metafield. When creating - * a new metadata object for a given record, **if the metafield is not present it will be created**. - * - * ## Metadata limits - * - * Metadata values are limited to 2kB in size. Additonally, there are limits on the number of unique - * metafields available per resource. + * Creates metadata and metafields for a specific subscription or customer, or updates metadata values + * of existing metafields for a subscription or customer. Metadata values are limited to 2 KB in size. * - * ## Create Metadata + * If you create metadata on a subscription or customer with a metafield that does not already exist, + * the metafield is created with the metadata you specify and it is always added as a text field. You + * can update the input_type for the metafield with the [Update + * Metafield]($e/Custom%20Fields/updateMetafield) endpoint. * - * This method will create a metafield for the site on the fly if it does not already exist, and - * populate the metadata value. + * >Note: Each site is limited to 100 unique metafields per resource. This means you can have 100 + * metafields for Subscriptions and another 100 for Customers. * - * ### Subscription or Customer Resource - * - * Please pay special attention to the resource you use when creating metadata. - * - * @param string $resourceType the resource type to which the metafields belong + * @param string $resourceType The resource type to which the metafields belong. * @param int $resourceId The Advanced Billing id of the customer or the subscription for which * the metadata applies * @param CreateMetadataRequest|null $body @@ -277,12 +265,7 @@ public function createMetadata(string $resourceType, int $resourceId, ?CreateMet } /** - * This request will list all of the metadata belonging to a particular resource (ie. subscription, - * customer) that is specified. - * - * ## Metadata Data - * - * This endpoint will also display the current stats of your metadata to use as a tool for pagination. + * Lists metadata and metafields for a specific customer or subscription. * * @param array $options Array with all options for search * @@ -310,9 +293,18 @@ public function listMetadata(array $options): PaginatedMetadata } /** - * This method allows you to update the existing metadata associated with a subscription or customer. + * Updates metadata and metafields on the Site and the customer or subscription specified, and updates + * the metadata value on a subscription or customer. + * + * If you update metadata on a subscription or customer with a metafield that does not already exist, + * the metafield is created with the metadata you specify and it is always added as a text field to the + * Site and to the subscription or customer you specify. You can update the input_type for the + * metafield with the Update Metafield endpoint. * - * @param string $resourceType the resource type to which the metafields belong + * Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields + * for Subscription and another 100 for Customer. + * + * @param string $resourceType The resource type to which the metafields belong. * @param int $resourceId The Advanced Billing id of the customer or the subscription for which * the metadata applies * @param UpdateMetadataRequest|null $body @@ -348,32 +340,9 @@ public function updateMetadata(string $resourceType, int $resourceId, ?UpdateMet } /** - * This method removes the metadata from the subscriber/customer cited. - * - * ## Query String Usage - * - * For instance if you wanted to delete the metadata for customer 99 named weight you would request: - * - * ``` - * https://acme.chargify.com/customers/99/metadata.json?name=weight - * ``` - * - * If you want to delete multiple metadata fields for a customer 99 named: `weight` and `age` you - * wrould request: - * ``` - * https://acme.chargify.com/customers/99/metadata.json?names[]=weight&names[]=age - * ``` + * Deletes one or more metafields (and associated metadata) from the specified subscription or customer. * - * ## Successful Response - * - * For a success, there will be a code `200` and the plain text response `true`. - * - * ## Unsuccessful Response - * - * When a failed response is encountered, you will receive a `404` response and the plain text response - * of `true`. - * - * @param string $resourceType the resource type to which the metafields belong + * @param string $resourceType The resource type to which the metafields belong. * @param int $resourceId The Advanced Billing id of the customer or the subscription for which * the metadata applies * @param string|null $name Name of field to be removed. @@ -408,20 +377,7 @@ public function deleteMetadata( } /** - * This method will provide you information on usage of metadata across your selected resource (ie. - * subscriptions, customers) - * - * ## Metadata Data - * - * This endpoint will also display the current stats of your metadata to use as a tool for pagination. - * - * ### Metadata for multiple records - * - * `https://acme.chargify.com/subscriptions/metadata.json?resource_ids[]=1&resource_ids[]=2` - * - * ## Read Metadata for a Site - * - * This endpoint will list the number of pages of metadata information that are contained within a site. + * Lists metadata for a specified array of subscriptions or customers. * * @param array $options Array with all options for search * diff --git a/src/Controllers/CustomersController.php b/src/Controllers/CustomersController.php index 6ec322e..02c59f2 100644 --- a/src/Controllers/CustomersController.php +++ b/src/Controllers/CustomersController.php @@ -45,8 +45,8 @@ class CustomersController extends BaseController * Advanced Billing requires that you use the ISO Standard Country codes when formatting country * attribute of the customer. * - * Countries should be formatted as 2 characters. For more information, please see the following - * wikipedia article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) + * Countries should be formatted as 2 characters. For more information, see the following wikipedia + * article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) * * ## Required State Format * @@ -55,9 +55,9 @@ class CustomersController extends BaseController * * + US States (2 characters): [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) * - * + States Outside the US (2-3 characters): To find the correct state codes outside of the US, please - * go to [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in - * the “ISO 3166-2 codes” column next to country you wish to populate. + * + States Outside the US (2-3 characters): To find the correct state codes outside of the US, go to + * [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the + * “ISO 3166-2 codes” column next to country you wish to populate. * * ## Locale * @@ -107,7 +107,7 @@ public function createCustomer(?CreateCustomerRequest $body = null): CustomerRes * + Search by a reference value from your application * + Search by a first or last name * - * To retrieve a single, exact match by reference, please use the [lookup endpoint](https://developers. + * To retrieve a single, exact match by reference, use the [lookup endpoint](https://developers. * chargify.com/docs/api-docs/b710d8fbef104-read-customer-by-reference). * * @param array $options Array with all options for search diff --git a/src/Controllers/InvoicesController.php b/src/Controllers/InvoicesController.php index ae15e6b..a960bc9 100644 --- a/src/Controllers/InvoicesController.php +++ b/src/Controllers/InvoicesController.php @@ -633,12 +633,49 @@ public function listConsolidatedInvoiceSegments(array $options): ConsolidatedInv * ... * ``` * + * #### Using Coupon Subcodes + * You can also use coupon subcodes to apply existing coupons with specific subcodes: + * + * ```json + * ... + * "coupons": [ + * { + * "subcode": "SUB1", + * "product_family_id": 1 + * } + * ] + * ... + * ``` + * **Important:** You cannot specify both `code` and `subcode` for the same coupon. Use either: + * - `code` to apply a main coupon + * - `subcode` to apply a specific coupon subcode + * + * The API response will include both the main coupon code and the subcode used: + * + * ```json + * ... + * "coupons": [ + * { + * "code": "MAIN123", + * "subcode": "SUB1", + * "product_family_id": 1, + * "percentage": 10, + * "description": "Special discount" + * } + * ] + * ... + * ``` + * * ### Coupon options * #### Code * Coupon `code` will be displayed on invoice discount section. * Coupon code can only contain uppercase letters, numbers, and allowed special characters. * Lowercase letters will be converted to uppercase. It can be used to select an existing coupon from * the catalog, or as an ad hoc coupon when passed with `percentage` or `amount`. + * #### Subcode + * Coupon `subcode` allows you to apply existing coupons using their subcodes. When a subcode is used, + * the API response will include both the main coupon code and the specific subcode that was applied. + * Subcodes are case-insensitive and will be converted to uppercase automatically. * #### Percentage * Coupon `percentage` can take values from 0 to 100 and up to 4 decimal places. It cannot be used with * `amount`. Only for ad hoc coupons, will be ignored if `code` is used to select an existing coupon @@ -707,8 +744,8 @@ public function listConsolidatedInvoiceSegments(array $options): ConsolidatedInv * #### Addresses * * The seller, shipping and billing addresses can be sent to override the site's defaults. Each address - * requires to send a `first_name` at a minimum in order to work. Please see below for the details on - * which parameters can be sent for each address object. + * requires to send a `first_name` at a minimum in order to work. See below for the details on which + * parameters can be sent for each address object. * * #### Memo and Payment Instructions * @@ -755,14 +792,14 @@ public function createInvoice(int $subscriptionId, ?CreateInvoiceRequest $body = * supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy * (bcc) recipients. * - * Please note that if no recipient email addresses are specified in the request, then the - * subscription's default email configuration will be used. For example, if `recipient_emails` is left - * blank, then the invoice will be delivered to the subscription's customer email address. + * If no recipient email addresses are specified in the request, then the subscription's default email + * configuration will be used. For example, if `recipient_emails` is left blank, then the invoice will + * be delivered to the subscription's customer email address. * - * On success, a 204 no-content response will be returned. Please note that this does not indicate that - * email(s) have been delivered, but instead indicates that emails have been successfully queued for - * delivery. If _any_ invalid or malformed email address is found in the request body, the entire - * request will be rejected and a 422 response will be returned. + * On success, a 204 no-content response will be returned. The response does not indicate that email(s) + * have been delivered, but instead indicates that emails have been successfully queued for delivery. + * If _any_ invalid or malformed email address is found in the request body, the entire request will be + * rejected and a 422 response will be returned. * * @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 c8c0c19..9393374 100644 --- a/src/Controllers/PaymentProfilesController.php +++ b/src/Controllers/PaymentProfilesController.php @@ -29,44 +29,26 @@ class PaymentProfilesController extends BaseController { /** - * Use this endpoint to create a payment profile for a customer. + * Creates a payment profile for a customer. * - * Payment Profiles house the credit card, ACH (Authorize.Net or Stripe only,) or PayPal (Braintree - * only,) data for a customer. The payment information is attached to the customer within Advanced - * Billing, as opposed to the Subscription itself. + * When you create a new payment profile for a customer via the API, it does not automatically make the + * profile current for any of the customer’s subscriptions. To use the payment profile as the default, + * you must set it explicitly for the subscription or subscription group. * - * You must include a customer_id so that Advanced Billing will attach it to the customer entry. If no - * customer_id is included the API will return a 404. + * Select an option from the **Request Examples** drop-down on the right side of the portal to see + * examples of common scenarios for creating payment profiles. * - * ## Create a Payment Profile for ACH usage + * Do not use real card information for testing. See the Sites articles that cover [testing your site + * setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0- + * 0) for more details on testing in your sandbox. * - * If you would like to create a payment method that is a Bank Account applicable for ACH payments use - * the following: - * ```json - * { - * "payment_profile": { - * "customer_id": [Valid-Customer-ID], - * "bank_name": "Best Bank", - * "bank_routing_number": "021000089", - * "bank_account_number": "111111111111", - * "bank_account_type": "checking", - * "bank_account_holder_type": "business", - * "payment_type": "bank_account" - * } - * } - * ``` - * - * ## Taxable Subscriptions + * Note that collecting and sending raw card details in production requires [PCI compliance](https: + * //docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If + * your business is not PCI compliant, use [Chargify.js](https://docs.maxio.com/hc/en- + * us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or + * bank account information. * - * If your subscriber pays taxes on their purchased product, and you are attempting to create or update - * the `payment_profile`, complete address information is required. For information on required address - * formatting to allow your subscriber to be taxed, please see our documentation [here](https: - * //developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) - * - * ## Payment Profile Documentation - * - * Full documentation on how Payment Profiles operate within Advanced Billing can be located under the - * following links: + * See the following articles to learn more about subscriptions and payments: * * + [Subscriber Payment Details](https://maxio.zendesk.com/hc/en-us/articles/24251599929613- * Subscription-Summary-Payment-Details-Tab) @@ -74,232 +56,38 @@ class PaymentProfilesController extends BaseController * Pages) (Allows credit card updates by Subscriber) * + [Public Signup Pages payment settings](https://maxio.zendesk.com/hc/en-us/articles/24261368332557- * Individual-Page-Settings) - * - * ## Create a Payment Profile with a Chargify.js token - * - * ```json - * { - * "payment_profile": { - * "customer_id": 1036, - * "chargify_token": "tok_w68qcpnftyv53jk33jv6wk3w" - * } - * } - * ``` - * - * ## Active Payment Methods - * - * Creating a new payment profile for a Customer via the API will not make that Payment Profile current - * for any of the Customer’s Subscriptions. In order to utilize the payment profile as the default, it - * must be set as the default payment profile for the subscription or subscription group. - * - * ## Requirements - * - * Either the full_number, expiration_month, and expiration_year or if you have an existing vault_token - * from your gateway, that vault_token and the current_vault are required. - * Passing in the vault_token and current_vault are only allowed when creating a new payment profile. - * - * ### Taxable Subscriptions - * - * If your subscriber pays taxes on their purchased product, and you are attempting to create or update - * the `payment_profile`, complete address information is required. For information on required address - * formatting to allow your subscriber to be taxed, please see our documentation [here](https: - * //developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) - * - * ## BraintreeBlue - * Some merchants use Braintree JavaScript libraries directly and then pass `payment_method_nonce` - * and/or `paypal_email` to create a payment profile. This implementation is deprecated and does not - * handle 3D Secure. Instead, we have provided [Chargify.js](https://developers.chargify. - * com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview) which is continuously improved and supports - * Credit Cards (along with 3D Secure), PayPal and ApplePay payment types. - * - * ## GoCardless - * - * For more information on GoCardless, please view the following resources: - * - * + [Full documentation on GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909- - * GoCardless) - * - * + [Using Chargify.js with GoCardless - minimal example](https://docs.maxio.com/hc/en- + * + [Taxes](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) + * + [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview) + * + [Chargify.js with GoCardless - minimal example](https://docs.maxio.com/hc/en- * us/articles/38206331271693-Examples#h_01K0PJ15QQZKCER8CFK40MR6XJ) - * - * + [Using Chargify.js with GoCardless - full example](https://docs.maxio.com/hc/en- + * + [Chargify.js with GoCardless - full example](https://docs.maxio.com/hc/en- * us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) - * - * ### GoCardless with Local Bank Details - * - * Following examples create customer, bank account and mandate in GoCardless: - * - * ```json - * { - * "payment_profile": { - * "customer_id": "Valid-Customer-ID", - * "bank_name": "Royal Bank of France", - * "bank_account_number": "0000000", - * "bank_routing_number": "0003", - * "bank_branch_code": "00006", - * "payment_type": "bank_account", - * "billing_address": "20 Place de la Gare", - * "billing_city": "Colombes", - * "billing_state": "Île-de-France", - * "billing_zip": "92700", - * "billing_country": "FR" - * } - * } - * ``` - * - * ### GoCardless with IBAN - * - * ```json - * { - * "payment_profile": { - * "customer_id": "24907598", - * "bank_name": "French Bank", - * "bank_iban": "FR1420041010050500013M02606", - * "payment_type": "bank_account", - * "billing_address": "20 Place de la Gare", - * "billing_city": "Colombes", - * "billing_state": "Île-de-France", - * "billing_zip": "92700", - * "billing_country": "FR" - * } - * } - * ``` - * - * ### Importing GoCardless - * - * If the customer, bank account, and mandate already exist in GoCardless, a payment profile can be - * created by using the IDs. In order to create masked versions of `bank_account_number` and - * `bank_routing_number` that are used to display within Advanced Billing Admin UI, you can pass the - * last four digits for this fields which then will be saved in this form `XXXX[four-provided-digits]`. - * - * ```json - * { - * "payment_profile": { - * "customer_id": "24907598", - * "customer_vault_token": [Existing GoCardless Customer ID] - * "vault_token": [Existing GoCardless Mandate ID], - * "current_vault": "gocardless", - * "bank_name": "French Bank", - * "bank_account_number": [Last Four Of The Existing Account Number or IBAN if applicable], - * "bank_routing_number": [Last Four Of The Existing Routing Number], - * "payment_type": "bank_account", - * "billing_address": "20 Place de la Gare", - * "billing_city": "Colombes", - * "billing_state": "Île-de-France", - * "billing_zip": "92700", - * "billing_country": "FR" - * } - * } - * ``` - * - * ## SEPA Direct Debit - * - * For more information on Stripe SEPA Direct Debit, please view the following resources: - * - * + [Full documentation on Stripe SEPA Direct Debit](https://maxio.zendesk.com/hc/en- - * us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) - * - * + [Using Chargify.js with Stripe Direct Debit - minimal example](https://docs.maxio.com/hc/en- + * + [Chargify.js with Stripe Direct Debit - minimal example](https://docs.maxio.com/hc/en- * us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) - * - * + [Using Chargify.js with Stripe Direct Debit - full example](https://docs.maxio.com/hc/en- + * + [Chargify.js with Stripe Direct Debit - full example](https://docs.maxio.com/hc/en- * us/articles/38206331271693-Examples#h_01K0PJ15QRECQQ4ECS3ZA55GY7) - * - * ### Stripe SEPA Direct Debit Payment Profiles - * - * The following example creates a customer, bank account and mandate in Stripe: - * - * - * ```json - * { - * "payment_profile": { - * "customer_id": "24907598", - * "bank_name": "Deutsche bank", - * "bank_iban": "DE89370400440532013000", - * "payment_type": "bank_account", - * "billing_address": "Test", - * "billing_city": "Berlin", - * "billing_state": "Brandenburg", - * "billing_zip": "12345", - * "billing_country": "DE" - * } - * } - * ``` - * - * ## Stripe BECS Direct Debit - * - * For more information on Stripe BECS Direct Debit, please view the following resources: - * - * + [Full documentation on Stripe BECS Direct Debit](https://maxio.zendesk.com/hc/en- - * us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) - * - * + [Using Chargify.js with Stripe BECS Direct Debit - minimal example](https://developers.chargify. + * + [Chargify.js with Stripe BECS Direct Debit - minimal example](https://developers.chargify. * com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit- * stripe-gateway) - * - * + [Using Chargify.js with Stripe BECS Direct Debit - full example](https://developers.chargify. + * + [Chargify.js with Stripe BECS Direct Debit - full example](https://developers.chargify. * com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe- * gateway) - * - * ### Stripe BECS Direct Debit Payment Profiles - * - * The following example creates a customer, bank account and mandate in Stripe: - * - * - * ```json - * { - * "payment_profile": { - * "customer_id": "24907598", - * "bank_name": "Australian bank", - * "bank_branch_code": "000000", - * "bank_account_number": "000123456" - * "payment_type": "bank_account", - * "billing_address": "Test", - * "billing_city": "Stony Rise", - * "billing_state": "Tasmania", - * "billing_zip": "12345", - * "billing_country": "AU" - * } - * } - * ``` - * - * ## Stripe BACS Direct Debit - * - * Contact the support team to enable this payment method. - * For more information on Stripe BACS Direct Debit, please view the following resources: - * + * + [Full documentation on GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909- + * GoCardless) + * + [Full documentation on Stripe SEPA Direct Debit](https://maxio.zendesk.com/hc/en- + * us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) + * + [Full documentation on Stripe BECS Direct Debit](https://maxio.zendesk.com/hc/en- + * us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) * + [Full documentation on Stripe BACS Direct Debit](https://maxio.zendesk.com/hc/en- * us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) * - * ### Stripe BACS Direct Debit Payment Profiles - * - * The following example creates a customer, bank account and mandate in Stripe: + * ## 3D Secure Authentication during payment profile creation. * - * - * ```json - * { - * "payment_profile": { - * "customer_id": "24907598", - * "bank_name": "British bank", - * "bank_branch_code": "108800", - * "bank_account_number": "00012345" - * "payment_type": "bank_account", - * "billing_address": "Test", - * "billing_city": "London", - * "billing_state": "LND", - * "billing_zip": "12345", - * "billing_country": "GB" - * } - * } - * ``` - * - * ## 3D Secure - Checkout - * - * It may happen that a payment needs 3D Secure Authentication when the payment profile is created; - * this is referred to in our help docs as a [post-authentication flow](https://maxio.zendesk.com/hc/en- - * us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post- - * authentication). The server returns `422 Unprocessable Entity` in this case with the following - * response: + * When a payment requires 3D Secure Authentication to adhear to Strong Customer Authentication (SCA) + * during payment profile creation, the request enters a [post-authentication flow](https://maxio. + * zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre- + * authentication-and-post-authentication). In this case, a 422 Unprocessable Entity status is returned + * with the following response: * * ```json * { @@ -325,46 +113,48 @@ class PaymentProfilesController extends BaseController * ] * } * ``` - * * To let the customer go through 3D Secure Authentication, they need to be redirected to the URL * specified in `action_link`. - * Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be - * notified about the result of 3D Secure Authentication. The `callback_url` will return the following - * information: + * + * Optionally, you can specify the `callback_url` parameter in the `action_link` URL to receive + * notification about the result of 3D Secure Authentication. + * + * The `callback_url` will return the following information: * * - whether the authentication was successful (`success`) * - the payment profile ID (`payment_profile_id`) * - * Lastly, you can also specify a `redirect_url` parameter within the `action_link` URL if you’d like - * to redirect a customer back to your site. + * You can also specify a `redirect_url` parameter in the `action_link` URL to redirect the customer + * back to your site. * - * It is not possible to use `action_link` in an iframe inside a custom application. You have to - * redirect the customer directly to the `action_link`, then, to be notified about the result, use - * `redirect_url` or `callback_url`. + * You cannot use action_link in an iframe inside a custom application. You must redirect the customer + * directly to the `action_link` and use the `redirect_url` or `callback_url` to be notified of the + * result. * * The final URL that you send a customer to complete 3D Secure may resemble the following, where the * first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: + * * `https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu? * one_time_token_id=93&callback_url=http://localhost:4000&redirect_url=https://yourpage.com` * * ### Example Redirect Flow * - * You may wish to redirect customers to different pages depending on whether their SCA was performed - * successfully. Here's an example flow to use as a reference: + * Here's an example flow to redirect customers to different pages depending on whether SCA was + * performed successfully: * - * 1. Create a payment profile via API; it requires 3DS - * 2. You receive a `action_link` in the response. + * 1. Create a payment profile via the API; it requires 3DS. + * 2. You receive an `action_link` in the response. * 3. Use this `action_link` to, for example, connect with your internal resources or generate a - * session_id - * 4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which - * “session” this applies to + * `session_id`. + * 4. Include one of those attributes inside the `callback_url` and `redirect_url` to be aware which + * “session” this applies to. * 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied - * 6. After the customer finishes 3DS authentication, we let you know the result by making a request to - * applied `callback_url`. + * 6. After the customer completes 3DS authentication, we notify you of the result via the applied + * `callback_url`. * 7. After that, we redirect the customer to the `redirect_url`; at this point the result of - * authentication is known - * 8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was - * successful or not + * authentication is known. + * 8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine if the + * redirect was successful. * * @param CreatePaymentProfileRequest|null $body When following the IBAN or the Local Bank * details examples, a customer, bank account and mandate will be created in your @@ -423,8 +213,7 @@ public function listPaymentProfiles(array $options): array /** * Using the GET method you can retrieve a Payment Profile identified by its unique ID. * - * Please note that a different JSON object will be returned if the card method on file is a bank - * account. + * Note that a different JSON object will be returned if the card method on file is a bank account. * * ### Response for Bank Account * diff --git a/src/Controllers/ProductFamiliesController.php b/src/Controllers/ProductFamiliesController.php index a25104f..0c54c0a 100644 --- a/src/Controllers/ProductFamiliesController.php +++ b/src/Controllers/ProductFamiliesController.php @@ -28,7 +28,7 @@ class ProductFamiliesController extends BaseController { /** - * This method allows to retrieve a list of Products belonging to a Product Family. + * Retrieves a list of Products belonging to a Product Family. * * @param array $options Array with all options for search * @@ -83,8 +83,8 @@ public function listProductsForProductFamily(array $options): array } /** - * This method will create a Product Family within your Advanced Billing site. Create a Product Family - * to act as a container for your products, components and coupons. + * Creates a Product Family within your Advanced Billing site. Create a Product Family to act as a + * container for your products, components and coupons. * * Full documentation on how Product Families operate within the Advanced Billing UI can be located * [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product-Families). @@ -115,7 +115,7 @@ public function createProductFamily(?CreateProductFamilyRequest $body = null): P } /** - * This method allows to retrieve a list of Product Families for a site. + * Retrieve a list of Product Families for a site. * * @param array $options Array with all options for search * @@ -156,8 +156,8 @@ public function listProductFamilies(array $options): array } /** - * This method allows to retrieve a Product Family via the `product_family_id`. The response will - * contain a Product Family object. + * Retrieves a Product Family via the `product_family_id`. The response will contain a Product Family + * object. * * The product family can be specified either with the id number, or with the `handle:my-family` format. * diff --git a/src/Controllers/ProductPricePointsController.php b/src/Controllers/ProductPricePointsController.php index 18c6069..c094e4d 100644 --- a/src/Controllers/ProductPricePointsController.php +++ b/src/Controllers/ProductPricePointsController.php @@ -37,8 +37,8 @@ class ProductPricePointsController extends BaseController { /** - * [Product Price Point Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261111947789- - * Product-Price-Points) + * Creates a Product Price Point. See the [Product Price Point](https://maxio.zendesk.com/hc/en- + * us/articles/24261111947789-Product-Price-Points) documentation for details. * * @param int|string $productId The id or handle of the product. When using the handle, it must * be prefixed with `handle:` @@ -74,7 +74,7 @@ public function createProductPricePoint( } /** - * Use this endpoint to retrieve a list of product price points. + * Retrieves a list of product price points. * * @param array $options Array with all options for search * @@ -107,9 +107,9 @@ public function listProductPricePoints(array $options): ListProductPricePointsRe } /** - * Use this endpoint to update a product price point. + * Updates a product price point. * - * Note: Custom product price points are not able to be updated. + * Note: Custom product price points cannot be updated. * * @param int|string $productId The id or handle of the product. When using the handle, it must * be prefixed with `handle:`. Example: `123` for an integer ID, or `handle:example- @@ -188,7 +188,7 @@ public function readProductPricePoint( } /** - * Use this endpoint to archive a product price point. + * Archives a product price point. * * @param int|string $productId The id or handle of the product. When using the handle, it must * be prefixed with `handle:`. Example: `123` for an integer ID, or `handle:example- @@ -254,9 +254,9 @@ public function unarchiveProductPricePoint(int $productId, int $pricePointId): P } /** - * Use this endpoint to make a product price point the default for the product. + * Sets a product price point as the default for the product. * - * Note: Custom product price points are not able to be set as the default for a product. + * Note: Custom product price points cannot be set as the default for a product. * * @param int $productId The Advanced Billing id of the product to which the price point belongs * @param int $pricePointId The Advanced Billing id of the product price point @@ -283,7 +283,7 @@ public function promoteProductPricePointToDefault(int $productId, int $pricePoin } /** - * Use this endpoint to create multiple product price points in one request. + * Creates multiple product price points in one request. * * @param int $productId The Advanced Billing id of the product to which the price points belong * @param BulkCreateProductPricePointsRequest|null $body @@ -317,8 +317,8 @@ public function bulkCreateProductPricePoints( } /** - * This endpoint allows you to create currency prices for a given currency that has been defined on the - * site level in your settings. + * Creates currency prices for a given currency that has been defined on the site level in your + * settings. * * When creating currency prices, they need to mirror the structure of your primary pricing. If the * product price point defines a trial and/or setup fee, each currency must also define a trial and/or @@ -362,14 +362,13 @@ public function createProductCurrencyPrices( } /** - * This endpoint allows you to update the `price`s of currency prices for a given currency that exists - * on the product price point. + * Updates the `price`s of currency prices for a given currency that exists on the product price point. * * When updating the pricing, it needs to mirror the structure of your primary pricing. If the product * price point defines a trial and/or setup fee, each currency must also define a trial and/or setup * fee. * - * Note: Currency Prices are not able to be updated for custom product price points. + * Note: Currency Prices cannot be updated for custom product price points. * * @param int $productPricePointId The Advanced Billing id of the product price point * @param UpdateCurrencyPricesRequest|null $body diff --git a/src/Controllers/ProductsController.php b/src/Controllers/ProductsController.php index cb6456d..2a5844e 100644 --- a/src/Controllers/ProductsController.php +++ b/src/Controllers/ProductsController.php @@ -27,7 +27,9 @@ class ProductsController extends BaseController { /** - * Use this method to create a product within your Advanced Billing site. + * Creates a product in your Advanced Billing site. + * + * See the following product docuemation for more information: * * + [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products- * Overview) @@ -69,8 +71,7 @@ public function createProduct(string $productFamilyId, ?CreateOrUpdateProductReq } /** - * This endpoint allows you to read the current details of a product that you've created in Advanced - * Billing. + * Reads the current details of a product. * * @param int $productId The Advanced Billing id of the product * @@ -90,7 +91,7 @@ public function readProduct(int $productId): ProductResponse } /** - * Use this method to change aspects of an existing product. + * Updates aspects of an existing product. * * ### Input Attributes Update Notes * @@ -134,8 +135,8 @@ public function updateProduct(int $productId, ?CreateOrUpdateProductRequest $bod } /** - * Sending a DELETE request to this endpoint will archive the product. All current subscribers will be - * unffected; their subscription/purchase will continue to be charged monthly. + * Archives the product. All current subscribers will be unffected; their subscription/purchase will + * continue to be charged monthly. * * This will restrict the option to chose the product for purchase via the Billing Portal, as well as * disable Public Signup Pages for the product. @@ -166,7 +167,7 @@ public function archiveProduct(int $productId): ProductResponse } /** - * This method allows to retrieve a Product object by its `api_handle`. + * Retrieves a Product object by its `api_handle`. * * @param string $apiHandle The handle of the product * diff --git a/src/Controllers/ProformaInvoicesController.php b/src/Controllers/ProformaInvoicesController.php index 6f2c895..cbeadb4 100644 --- a/src/Controllers/ProformaInvoicesController.php +++ b/src/Controllers/ProformaInvoicesController.php @@ -139,7 +139,7 @@ public function readProformaInvoice(string $proformaInvoiceUid): ProformaInvoice * outdated, simply void the old proforma invoice and generate a new one. * * If you would like to preview the next billing amounts without generating a full proforma invoice, - * please use the renewal preview endpoint. + * use the renewal preview endpoint. * * ## Restrictions * diff --git a/src/Controllers/SalesCommissionsController.php b/src/Controllers/SalesCommissionsController.php index dd4c46c..f6a139b 100644 --- a/src/Controllers/SalesCommissionsController.php +++ b/src/Controllers/SalesCommissionsController.php @@ -35,7 +35,7 @@ class SalesCommissionsController extends BaseController * * Access to the Sales Commission API endpoints is available to users with financial access, where the * seller has the Advanced Analytics component enabled. For further information on getting access to - * Advanced Analytics please contact Maxio support. + * Advanced Analytics contact Maxio support. * * > Note: The request is at seller level, it means `<>` variable will be replaced by `app` * @@ -79,7 +79,7 @@ public function listSalesCommissionSettings(array $options): array * * Access to the Sales Commission API endpoints is available to users with financial access, where the * seller has the Advanced Analytics component enabled. For further information on getting access to - * Advanced Analytics please contact Maxio support. + * Advanced Analytics contact Maxio support. * * > Note: The request is at seller level, it means `<>` variable will be replaced by `app` * @@ -120,7 +120,7 @@ public function listSalesReps(array $options): array * * Access to the Sales Commission API endpoints is available to users with financial access, where the * seller has the Advanced Analytics component enabled. For further information on getting access to - * Advanced Analytics please contact Maxio support. + * Advanced Analytics contact Maxio support. * * > Note: The request is at seller level, it means `<>` variable will be replaced by `app` * diff --git a/src/Controllers/SubscriptionComponentsController.php b/src/Controllers/SubscriptionComponentsController.php index be22519..f7af95e 100644 --- a/src/Controllers/SubscriptionComponentsController.php +++ b/src/Controllers/SubscriptionComponentsController.php @@ -584,50 +584,48 @@ public function deletePrepaidUsageAllocation( } /** - * ## Documentation + * Records an instance of metered or prepaid usage for a subscription. + * + * You can report metered or prepaid usage to Advanced Billing as often as you wish. You can report + * usage as it happens or periodically, such as each night or once per billing period. * * Full documentation on how to create Components in the Advanced Billing UI can be located * [here](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create-Edit-and-Archive- * Components). Additionally, for information on how to record component usage against a subscription, - * please see the following resources: + * see the following resources: * - * + [Recording Metered Component Usage](https://maxio.zendesk.com/hc/en-us/articles/24251890500109- - * Reporting-Component-Allocations#reporting-metered-component-usage) - * + [Reporting Prepaid Component Status](https://maxio.zendesk.com/hc/en-us/articles/24251890500109- - * Reporting-Component-Allocations#reporting-prepaid-component-status) + * It is not possible to record metered usage for more than one component at a time Usage should be + * reported as one API call per component on a single subscription. For example, to record that a + * subscriber has sent both an SMS Message and an Email, send an API call for each. * - * You may choose to report metered or prepaid usage to Advanced Billing as often as you wish. You may - * report usage as it happens. You may also report usage periodically, such as each night or once per - * billing period. If usage events occur in your system very frequently (on the order of thousands of - * times an hour), it is best to accumulate usage into batches on your side, and then report those - * batches less frequently, such as daily. This will ensure you remain below any API throttling limits. - * If your use case requires higher rates of usage reporting, we recommend utilizing Events Based - * Components. + * See the following product documention articles for more information: * - * ## Create Usage for Subscription + * - [Create and Manage Components](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create- + * Edit-and-Archive-Components). A + * - [Recording Metered Component Usage](https://maxio.zendesk.com/hc/en-us/articles/24251890500109- + * Reporting-Component-Allocations#reporting-metered-component-usage) + * - [Reporting Prepaid Component Status](https://maxio.zendesk.com/hc/en-us/articles/24251890500109- + * Reporting-Component-Allocations#reporting-prepaid-component-status) * - * This endpoint allows you to record an instance of metered or prepaid usage for a subscription. The - * `quantity` from usage for each component is accumulated to the `unit_balance` on the [Component Line - * Item](./b3A6MTQxMDgzNzQ-read-subscription-component) for the subscription. + * The `quantity` from usage for each component is accumulated to the `unit_balance` on the [Component + * Line Item]($e/Subscription%20Components/readSubscriptionComponent) for the subscription. * * ## Price Point ID usage * - * If you are using price points, for metered and prepaid usage components, Advanced Billing gives you + * If you are using price points, for metered and prepaid usage components Advanced Billing gives you * the option to specify a price point in your request. * * You do not need to specify a price point ID. If a price point is not included, the default price * point for the component will be used when the usage is recorded. * - * If an invalid `price_point_id` is submitted, the endpoint will return an error. - * * ## Deducting Usage * - * In the event that you need to reverse a previous usage report or otherwise deduct from the current - * usage balance, you may provide a negative quantity. + * If you need to reverse a previous usage report or otherwise deduct from the current usage balance, + * you can provide a negative quantity. * * Example: * - * Previously recorded: + * Previously recorded quantity was 5000: * * ```json * { @@ -638,8 +636,7 @@ public function deletePrepaidUsageAllocation( * } * ``` * - * At this point, `unit_balance` would be `5000`. To reduce the balance to `0`, POST the following - * payload: + * To reduce the quantity to `0`, POST the following payload: * * ```json * { @@ -649,17 +646,9 @@ public function deletePrepaidUsageAllocation( * } * } * ``` - * * The `unit_balance` has a floor of `0`; negative unit balances are never allowed. For example, if the * usage balance is 100 and you deduct 200 units, the unit balance would then be `0`, not `-100`. * - * ## FAQ - * - * Q. Is it possible to record metered usage for more than one component at a time? - * - * A. No. Usage should be reported as one API call per component on a single subscription. For example, - * to record that a subscriber has sent both an SMS Message and an Email, send an API call for each. - * * @param int|string $subscriptionIdOrReference Either the Advanced Billing subscription ID * (integer) or the subscription reference (string). Important: In cases where a * numeric string value matches both an existing subscription ID and an existing diff --git a/src/Controllers/SubscriptionGroupStatusController.php b/src/Controllers/SubscriptionGroupStatusController.php index 959e7ed..5292846 100644 --- a/src/Controllers/SubscriptionGroupStatusController.php +++ b/src/Controllers/SubscriptionGroupStatusController.php @@ -24,13 +24,12 @@ class SubscriptionGroupStatusController extends BaseController { /** - * This endpoint will immediately cancel all subscriptions within the specified group. The group is - * identified by it's `uid` passed in the URL. To successfully cancel the group, the primary - * subscription must be on automatic billing. The group members as well must be on automatic billing or - * they must be prepaid. + * Cancels all subscriptions within the specified group immediately. The group is identified by the + * `uid` that is passed in the URL. To successfully cancel the group, the primary subscription must be + * on automatic billing. The group members must be on automatic billing or prepaid. * - * In order to cancel a subscription group while also charging for any unbilled usage on metered or - * prepaid components, the `charge_unbilled_usage=true` parameter must be included in the request. + * To cancel a subscription group while also charging for any unbilled usage on metered or prepaid + * components, the `charge_unbilled_usage=true` parameter must be included in the request. * * @param string $uid The uid of the subscription group * @param CancelGroupedSubscriptionsRequest|null $body @@ -63,7 +62,7 @@ public function cancelSubscriptionsInGroup(string $uid, ?CancelGroupedSubscripti /** * This endpoint will schedule all subscriptions within the specified group to be canceled at the end - * of their billing period. The group is identified by it's uid passed in the URL. + * of their billing period. The group is identified by its uid passed in the URL. * * All subscriptions in the group must be on automatic billing in order to successfully cancel them, * and the group must not be in a "past_due" state. diff --git a/src/Controllers/SubscriptionGroupsController.php b/src/Controllers/SubscriptionGroupsController.php index b695edf..2fd4330 100644 --- a/src/Controllers/SubscriptionGroupsController.php +++ b/src/Controllers/SubscriptionGroupsController.php @@ -50,6 +50,10 @@ class SubscriptionGroupsController extends BaseController * * When passing product to a subscription you can use either `product_id` or `product_handle` or * `offer_id`. You can also use `custom_price` instead. + * The subscription request examples below will be split into two sections. + * The first section, "Subscription Customization", will focus on passing different information with a + * subscription, such as components, calendar billing, and custom fields. These examples will presume + * you are using a secure chargify_token generated by Chargify.js. * * @param SubscriptionGroupSignupRequest|null $body * @@ -269,8 +273,8 @@ public function findSubscriptionGroup(string $subscriptionId): FullSubscriptionG * and the subscription will become part of the group with the specified target customer set as the * responsible payer for the group's subscriptions. * - * **Please Note:** In order to add an existing subscription to a subscription group, it must belong to - * either the same customer record as the target, or be within the same customer hierarchy. + * **Note:** In order to add an existing subscription to a subscription group, it must belong to either + * the same customer record as the target, or be within the same customer hierarchy. * * Rather than specifying a customer, the `target` parameter could instead simply have a value of * * `"self"` which indicates the subscription will be paid for not by some other customer, but by the @@ -280,7 +284,7 @@ public function findSubscriptionGroup(string $subscriptionId): FullSubscriptionG * * `"eldest"` which indicates the subscription will be paid for by the root-level customer in the * subscribing customer's hierarchy. * - * To create a new subscription into a subscription group, please reference the following: + * To create a new subscription into a subscription group, reference the following: * [Create Subscription in a Subscription Group](https://developers.chargify.com/docs/api- * docs/d571659cf0f24-create-subscription#subscription-in-a-subscription-group) * diff --git a/src/Controllers/SubscriptionInvoiceAccountController.php b/src/Controllers/SubscriptionInvoiceAccountController.php index 6b2b668..f6d288f 100644 --- a/src/Controllers/SubscriptionInvoiceAccountController.php +++ b/src/Controllers/SubscriptionInvoiceAccountController.php @@ -65,7 +65,7 @@ public function readAccountBalances(int $subscriptionId): AccountBalances * using the default credit card payment profile and applied to the prepayment account balance. This * is especially useful for manual replenishment of prepaid subscriptions. * - * Please note that you **can't** pass `amount_in_cents`. + * Note that passing `amount_in_cents` is now allowed. * * * @param int $subscriptionId The Chargify id of the subscription diff --git a/src/Controllers/SubscriptionProductsController.php b/src/Controllers/SubscriptionProductsController.php index b1f0777..c4c8d33 100644 --- a/src/Controllers/SubscriptionProductsController.php +++ b/src/Controllers/SubscriptionProductsController.php @@ -48,16 +48,16 @@ class SubscriptionProductsController extends BaseController * * ## Failed Migrations * - * One of the most common ways that a migration can fail is when the attempt is made to migrate a - * subscription to it's current product. Please be aware of this issue! + * Importaint note: One of the most common ways that a migration can fail is when the attempt is made + * to migrate a subscription to its current product. * * ## Migration 3D Secure - Stripe * - * It may happen that a payment needs 3D Secure Authentication when the subscription is migrated to a - * new product; this is referred to in our help docs as a [post-authentication flow](https://maxio. - * zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre- - * authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case - * with the following response: + * When a payment requires 3D Secure Authentication to adhear to Strong Customer Authentication (SCA) + * when the subscription is migrated to a new product, the request enters a [post-authentication + * flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2- + * flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in + * this case with the following response: * * ```json * { @@ -102,7 +102,7 @@ class SubscriptionProductsController extends BaseController * * ### Example Redirect Flow * - * You may wish to redirect customers to different pages depending on whether their SCA was performed + * You may wish to redirect customers to different pages depending on whether SCA was performed * successfully. Here's an example flow to use as a reference: * * 1. Create a migration via API; it requires 3DS diff --git a/src/Controllers/SubscriptionStatusController.php b/src/Controllers/SubscriptionStatusController.php index e0e108d..9f250df 100644 --- a/src/Controllers/SubscriptionStatusController.php +++ b/src/Controllers/SubscriptionStatusController.php @@ -144,7 +144,7 @@ public function resumeSubscription( * * ## Limitations * - * You may not place a subscription on hold if the `next_billing` date is within 24 hours. + * You may not place a subscription on hold if the `next_billing_at` date is within 24 hours. * * @param int $subscriptionId The Chargify id of the subscription * @param PauseRequest|null $body @@ -225,9 +225,8 @@ public function updateAutomaticSubscriptionResumption( * how the reactivation works, and how to reactivate subscriptions through the application, see * [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming). * - * **Please note: The term - * "resume" is used also during another process in Advanced Billing. This occurs when an on-hold - * subscription is "resumed". This returns the subscription to an active state.** + * **Note: The term "resume" is used also during another process in Advanced Billing. This occurs when + * an on-hold subscription is "resumed". This returns the subscription to an active state.** * * + The response returns the subscription object in the `active` or `trialing` state. * + The `canceled_at` and `cancellation_message` fields do not have values. @@ -537,8 +536,8 @@ public function cancelDunning(int $subscriptionId): SubscriptionResponse * snapshot of how much your customer will be charged on their next renewal. * * The "Next Billing" amount and "Next Billing" date are already represented in the UI on each - * Subscriber's Summary. For more information, please see our documentation [here](https://maxio. - * zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). + * Subscriber's Summary. For more information, see our documentation [here](https://maxio.zendesk. + * com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). * * ## Optional Component Fields * diff --git a/src/Controllers/SubscriptionsController.php b/src/Controllers/SubscriptionsController.php index 4618d1b..345c040 100644 --- a/src/Controllers/SubscriptionsController.php +++ b/src/Controllers/SubscriptionsController.php @@ -44,813 +44,35 @@ class SubscriptionsController extends BaseController { /** - * Full documentation on how subscriptions operate within Advanced Billing can be located under the - * following topics: + * Creates a Subscription for a customer and product * - * + [Subscriptions Reference](https://maxio.zendesk.com/hc/en-us/articles/24251526991757-Subscription- - * Overview) - * + [Subscriptions Actions](https://maxio.zendesk.com/hc/en-us/articles/24251983024653-Subscription- - * Actions-Overview) - * + [Subscription Cancellation](https://maxio.zendesk.com/hc/en-us/articles/24251957778829-Cancel- - * Subscriptions) - * + [Subscription Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629- - * Reactivating-and-Resuming) - * + [Subscription Import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Imports) + * Specify the product with `product_id` or `product_handle`. To set a specific product pricepPoint, + * use `product_price_point_handle` or `product_price_point_id`. * - * When creating a subscription, you must specify a product and a customer. Credit card details may be - * required, depending on the options for the Product being subscribed ([see Product Options](https: - * //maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing)). + * Identify an existing customer with `customer_id` or `customer_reference`. Optionally, include an + * existing payment profile using `payment_profile_id`. To create a new customer, pass + * customer_attributes. * - * The product may be specified by `product_id` or by `product_handle` (API Handle). In similar fashion, - * to pass a particular product price point, you may either use `product_price_point_handle` or - * `product_price_point_id`. + * Select an option from the **Request Examples** drop-down on the right side of the portal to see + * examples of common scenarios for creating subscriptions. * - * An existing customer may be specified by a `customer_id` (ID within Advanced Billing) or a - * `customer_reference` (unique value within your app that you have shared with Advanced Billing via - * the reference attribute on a customer). You may also pass in an existing payment profile for that - * customer with `payment_profile_id`. A new customer may be created by providing `customer_attributes`. + * Payment information may be required to create a subscription, depending on the options for the + * Product being subscribed. See [product options](https://docs.maxio.com/hc/en- + * us/articles/24261076617869-Edit-Products) for more information. See the [Payments + * Profile]($e/Payment%20Profiles/createPaymentProfile) endpoint for details on payment parameters. * - * Credit card details may be required, depending on the options for the product being subscribed. The - * product can be specified by `product_id` or by `product_handle` (API Handle). + * Do not use real card information for testing. See the Sites articles that cover [testing your site + * setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0- + * 0) for more details on testing in your sandbox. * - * If you are creating a subscription with a payment profile, the attribute to send will be - * `credit_card_attributes` or `bank_account_attributes` for ACH and Direct Debit. That said, when you - * read the subscription after creation, we return the profile details under `credit_card` or - * `bank_account`. + * Note that collecting and sending raw card details in production requires [PCI compliance](https: + * //docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If + * your business is not PCI compliant, use [Chargify.js](https://docs.maxio.com/hc/en- + * us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or + * bank account information. * - * ## Bulk creation of subscriptions - * - * Bulk creation of subscriptions is currently not supported. For scenarios where multiple - * subscriptions must be added, particularly when assigning to the same subscription group, it is - * essential to switch to a single-threaded approach. - * - * To avoid data conflicts or inaccuracies, incorporate a sleep interval between requests. - * - * While this single-threaded approach may impact performance, it ensures data consistency and accuracy - * in cases where concurrent creation attempts could otherwise lead to issues with subscription - * alignment and integrity. - * - * ## Taxable Subscriptions - * - * If your intent is to charge your subscribers tax via [Avalara Taxes](https://maxio.zendesk.com/hc/en- - * us/articles/24287043035661-Avalara-VAT-Tax) or [Custom Taxes](https://maxio.zendesk.com/hc/en- - * us/articles/24287044212749-Custom-Taxes), there are a few considerations to be made regarding - * collecting subscription data. - * For subscribers to be eligible to be taxed, the following information for the `customer` object or - * `payment_profile` object must by supplied: - * - * + A subscription to a [taxable product](https://maxio.zendesk.com/hc/en-us/articles/24261076617869- - * Product-Editing#tax-settings) - * + [Full valid billing or shipping address](https://maxio.zendesk.com/hc/en- - * us/articles/24287008131853-Advanced-Billing-Managed-Sales-Tax#full-address-required-for-taxable- - * subscriptions) to identify the tax locale - * + The portion of the address that houses the [state information](https://maxio.zendesk.com/hc/en- - * us/articles/24287008131853-Advanced-Billing-Managed-Sales-Tax#required-state-format-for-taxable- - * subscriptions) of either adddress must adhere to the ISO standard of a 2-3 character limit/format. - * + The portion of the address that houses the [country information](https://maxio.zendesk.com/hc/en- - * us/articles/24287008131853-Advanced-Billing-Managed-Sales-Tax#required-country-format-for-taxable- - * subscriptions) must adhere to the ISO standard of a 2 character limit/format. - * - * ## Subscription Request Examples - * - * The subscription examples below will be split into two sections. - * - * The first section, "Subscription Customization", will focus on passing different information with a - * subscription, such as components, calendar billing, and custom fields. These examples will presume - * you are using a secure `chargify_token` generated by Chargify.js. - * - * The second section, "Passing Payment Information", will focus on passing payment information into - * Advanced Billing. Please be aware that collecting and sending Advanced Billing raw card details - * requires PCI compliance on your end; these examples are provided as guidance. If your business - * is not PCI compliant, we recommend using Chargify.js to collect credit cards or bank accounts. - * - * # Subscription Customization - * - * ## With Components - * - * Different components require slightly different data. For example, quantity-based and on/off - * components accept `allocated_quantity`, while metered components accept `unit_balance`. - * - * When creating a subscription with a component, a `price_point_id` can be passed in along with the - * `component_id` to specify which price point to use. If not passed in, the default price point will - * be used. - * - * Note: if an invalid `price_point_id` is used, the subscription will still proceed but will use the - * component's default price point. - * - * Components and their price points may be added by ID or by handle. See the example request body - * labeled "Components By Handle (Quantity-Based)"; the format will be the same for other component - * types. - * - * ## With Coupon(s) - * - * Pass an array of `coupon_codes`. See the example request body "With Coupon". - * - * ## With Manual Invoice Collection - * - * The `invoice` collection method works only on legacy Statement Architecture. - * - * On Relationship Invoicing Architecture use the `remittance` collection method. - * - * ## Prepaid Subscription - * - * A prepaid subscription can be created with the usual subscription creation parameters, specifying - * `prepaid` as the `payment_collection_method` and including a nested `prepaid_configuration`. - * - * After a prepaid subscription has been created, additional funds can be manually added to the - * prepayment account through the [Create Prepayment Endpoint](https://developers.chargify.com/docs/api- - * docs/7ec482de77ba7-create-prepayment). - * - * Prepaid subscriptions do not work on legacy Statement Architecture. - * - * ## With Metafields - * - * Metafields can either attach to subscriptions or customers. Metafields are popuplated with the - * supplied metadata to the resource specified. - * - * If the metafield doesn't exist yet, it will be created on-the-fly. - * - * ## With Custom Pricing - * - * Custom pricing is pricing specific to the subscription in question. - * Create a subscription with custom pricing by passing pricing information instead of a price point. - * For a custom priced product, pass the custom_price object in place of `product_price_point_id`. For - * a custom priced component, pass the `custom_price` object within the component object. - * Custom prices and price points can exist in harmony on a subscription. - * - * # Passing Payment Information - * - * ## Subscription with Chargify.js token - * - * The `chargify_token` can be obtained using [Chargify.js](https://docs.maxio.com/hc/en- - * us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0). The token represents - * payment profile attributes that were provided by the customer in their browser and stored at the - * payment gateway. - * - * The `payment_type` attribute may either be `credit_card` or `bank_account`, depending on the type of - * payment method being added. If a bank account is being passed, the payment attributes should be - * changed to `bank_account_attributes`. - * - * ```json - * { - * "subscription": { - * "product_handle": "pro-plan", - * "customer_attributes": { - * "first_name": "Joe", - * "last_name": "Smith", - * "email": "j.smith@example.com" - * }, - * "credit_card_attributes": { - * "chargify_token": "tok_cwhvpfcnbtgkd8nfkzf9dnjn", - * "payment_type": "credit_card" - * } - * } - * } - * ``` - * - * ## Subscription with vault token - * - * If you already have a customer and card stored in your payment gateway, you may create a - * subscription with a `vault_token`. Providing the last_four, card type and expiration date will - * allow the card to be displayed properly in the Advanced Billing UI. - * - * ```json - * { - * "subscription": { - * "product_handle": "pro-plan", - * "customer_attributes": { - * "first_name": "Joe", - * "last_name": "Smith", - * "email": "j.smith@example.com" - * }, - * "credit_card_attributes": { - * first_name: "Joe, - * last_name: "Smith", - * card_type: "visa", - * expiration_month: "05", - * expiration_year: "2025", - * last_four: "1234", - * vault_token: "12345abc", - * current_vault: "braintree_blue" - * } - * } - * ``` - * - * ## Subscription with ACH as Payment Profile - * - * ```json - * { - * "subscription": { - * "product_handle": "gold-product", - * "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." - * }, - * "bank_account_attributes": { - * "bank_name": "Best Bank", - * "bank_routing_number": "021000089", - * "bank_account_number": "111111111111", - * "bank_account_type": "checking", - * "bank_account_holder_type": "business", - * "payment_type": "bank_account" - * } - * } - * } - * ``` - * - * ## Subscription with PayPal payment profile - * - * ### With the nonce from Braintree JS - * - * ```json - * { "subscription": { - * "product_handle":"test-product-b", - * "customer_attributes": { - * "first_name":"Amelia", - * "last_name":"Johnson", - * "email":"amelia@example.com", - * "organization":"My Awesome Company" - * }, - * "payment_profile_attributes":{ - * "paypal_email": "amelia@example.com", - * "current_vault": "braintree_blue", - * "payment_method_nonce":"abc123", - * "payment_type":"paypal_account" - * } - * } - * ``` - * - * - * ### With the Braintree Customer ID as the vault token: - * - * ```json - * { "subscription": { - * "product_handle":"test-product-b", - * "customer_attributes": { - * "first_name":"Amelia", - * "last_name":"Johnson", - * "email":"amelia@example.com", - * "organization":"My Awesome Company" - * }, - * "payment_profile_attributes":{ - * "paypal_email": "amelia@example.com", - * "current_vault": "braintree_blue", - * "vault_token":"58271347", - * "payment_type":"paypal_account" - * } - * } - * ``` - * - * ## Subscription using GoCardless Bank Number - * - * These examples creates a customer, bank account and mandate in GoCardless. - * - * For more information on GoCardless, please view the following two resources: - * - * + [Payment Profiles via API for GoCardless](https://developers.chargify.com/docs/api- - * docs/1f10a4f170405-create-payment-profile#gocardless) - * + [Full documentation on GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909- - * GoCardless) - * - * + [Using Chargify.js with GoCardless - minimal example](https://docs.maxio.com/hc/en- - * us/articles/38206331271693-Examples#h_01K0PJ15QQZKCER8CFK40MR6XJ) - * - * + [Using Chargify.js with GoCardless - full example](https://docs.maxio.com/hc/en- - * us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) - * - * ```json - * { - * "subscription": { - * "product_handle": "gold-product", - * "customer_attributes": { - * "first_name": "Jane", - * "last_name": "Doe", - * "email": "jd@chargify.test" - * }, - * "bank_account_attributes": { - * "bank_name": "Royal Bank of France", - * "bank_account_number": "0000000", - * "bank_routing_number": "0003", - * "bank_branch_code": "00006", - * "payment_type": "bank_account", - * "billing_address": "20 Place de la Gare", - * "billing_city": "Colombes", - * "billing_state": "Île-de-France", - * "billing_zip": "92700", - * "billing_country": "FR" - * } - * } - * } - * ``` - * - * ## Subscription using GoCardless IBAN Number - * - * ```json - * { - * "subscription": { - * "product_handle": "gold-product", - * "customer_attributes": { - * "first_name": "Jane", - * "last_name": "Doe", - * "email": "jd@chargify.test" - * }, - * "bank_account_attributes": { - * "bank_name": "French Bank", - * "bank_iban": "FR1420041010050500013M02606", - * "payment_type": "bank_account", - * "billing_address": "20 Place de la Gare", - * "billing_city": "Colombes", - * "billing_state": "Île-de-France", - * "billing_zip": "92700", - * "billing_country": "FR" - * } - * } - * } - * ``` - * - * ## Subscription using Stripe SEPA Direct Debit - * - * For more information on Stripe Direct Debit, please view the following two resources: - * - * + [Payment Profiles via API for Stripe SEPA Direct Debit](https://developers.chargify.com/docs/api- - * docs/1f10a4f170405-create-payment-profile#sepa-direct-debit) - * + [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en- - * us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) - * - * + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal example](https://docs.maxio. - * com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) - * - * + [Using Chargify.js with Stripe SEPA Direct Debit - full example](https://docs.maxio.com/hc/en- - * us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) - * - * - * ```json - * { - * "subscription": { - * "product_handle": "gold-product", - * "customer_attributes": { - * "first_name": "Jane", - * "last_name": "Doe", - * "email": "jd@chargify.test" - * }, - * "bank_account_attributes": { - * "bank_name": "Test Bank", - * "bank_iban": "DE89370400440532013000", - * "payment_type": "bank_account" - * } - * } - * } - * ``` - * - * ## Subscription using Stripe BECS Direct Debit - * - * For more information on Stripe Direct Debit, please view the following two resources: - * - * + [Payment Profiles via API for Stripe BECS Direct - * Debit]($e/Payment%20Profiles/createPaymentProfile) - * + [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en- - * us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) - * - * + [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal example](https://docs. - * maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) - * - * + [Using Chargify.js with Stripe BECS Direct Debit - full example](https://docs.maxio.com/hc/en- - * us/articles/38206331271693-Examples#h_01K0PJ15QRX4B1TYZKZD8ZND6D) - * - * - * ```json - * { - * "subscription": { - * "product_handle": "gold-product", - * "customer_attributes": { - * "first_name": "Jane", - * "last_name": "Doe", - * "email": "jd@chargify.test" - * }, - * "bank_account_attributes": { - * "bank_name": "Test Bank", - * "bank_branch_code": "000000", - * "bank_account_number": "000123456", - * "payment_type": "bank_account" - * } - * } - * } - * ``` - * - * ## Subscription using Stripe BACS Direct Debit - * - * For more information on Stripe Direct Debit, please view the following two resources: - * - * + [Payment Profiles via API for Stripe BACS Direct - * Debit]($e/Payment%20Profiles/createPaymentProfile) - * + [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en- - * us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) - * - * + [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal example](https://docs. - * maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) - * - * + [Using Chargify.js with Stripe BACS Direct Debit - full example](https://docs.maxio.com/hc/en- - * us/articles/38206331271693-Examples#h_01K0PJ15QR7PA1DJ3XE9MD05FM) - * - * ```json - * { - * "subscription": { - * "product_handle": "gold-product", - * "customer_attributes": { - * "first_name": "Jane", - * "last_name": "Doe", - * "email": "jd@chargify.test" - * }, - * "bank_account_attributes": { - * "bank_name": "Test Bank", - * "bank_branch_code": "108800", - * "bank_account_number": "00012345", - * "payment_type": "bank_account", - * "billing_address": "123 Main St.", - * "billing_city": "London", - * "billing_state": "LND", - * "billing_zip": "W1A 1AA", - * "billing_country": "GB" - * } - * } - * } - * ``` - * - * ## 3D Secure - Stripe - * - * It may happen that a payment needs 3D Secure Authentication when the subscription is created; this - * is referred to in our help docs as a [post-authentication flow](https://maxio.zendesk.com/hc/en- - * us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post- - * authentication). The server returns `422 Unprocessable Entity` in this case with the following - * response: - * - * ```json - * { - * "errors": [ - * "Your card was declined. This transaction requires 3D secure authentication." - * ], - * "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh", - * "description": "This card requires 3D secure authentication. Redirect the customer to the URL from - * the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be - * notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you - * want to redirect a customer back to your page after 3D Secure authentication. Example: https: - * //mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https: - * //localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 - * after payment is authenticated and will redirect a customer to https://yourpage.com after 3DS - * authentication.", - * "action_link": "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh? - * one_time_token_id=242" - * } - * ``` - * - * To let the customer go through 3D Secure Authentication, they need to be redirected to the URL - * specified in `action_link`. - * Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be - * notified about the result of 3D Secure Authentication. The `callback_url` will return the following - * information: - * - * - whether the authentication was successful (`success`) - * - the gateway ID for the payment (`gateway_payment_id`) - * - the subscription ID (`subscription_id`) - * - * Lastly, you can also specify a `redirect_url` within the `action_link` URL if you’d like to redirect - * a customer back to your site. - * - * It is not possible to use `action_link` in an iframe inside a custom application. You have to - * redirect the customer directly to the `action_link`, then, to be notified about the result, use - * `redirect_url` or `callback_url`. - * - * The final URL that you send a customer to to complete 3D Secure may resemble the following, where - * the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: - * `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm? - * one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` - * - * ## 3D Secure - Checkout - * - * It may happen that a payment needs 3D Secure Authentication when the subscription is created; this - * is referred to in our help docs as a [post-authentication flow](https://maxio.zendesk.com/hc/en- - * us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post- - * authentication). The server returns `422 Unprocessable Entity` in this case with the following - * response: - * - * ```json - * { - * "errors": [ - * "Your card was declined. This transaction requires 3D secure authentication." - * ], - * "gateway_payment_id": "pay_6gjofv7dlyrkpizlolsuspvtiu", - * "description": "This card requires 3D secure authentication. Redirect the customer to the URL from - * the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be - * notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you - * want to redirect a customer back to your page after 3D Secure authentication. Example: https: - * //mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu? - * one_time_token_id=123&callback_url=https://localhost:4000&redirect_url=https://yourpage.com will do - * a POST request to https://localhost:4000 after payment is authenticated and will redirect a customer - * to https://yourpage.com after 3DS authentication.", - * "action_link": "http://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu? - * one_time_token_id=123" - * } - * ``` - * - * To let the customer go through 3D Secure Authentication, they need to be redirected to the URL - * specified in `action_link`. - * Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be - * notified about the result of 3D Secure Authentication. The `callback_url` will return the following - * information: - * - * - whether the authentication was successful (`success`) - * - the gateway ID for the payment (`gateway_payment_id`) - * - the subscription ID (`subscription_id`) - * - * Lastly, you can also specify a `redirect_url` parameter within the `action_link` URL if you’d like - * to redirect a customer back to your site. - * - * It is not possible to use `action_link` in an iframe inside a custom application. You have to - * redirect the customer directly to the `action_link`, then, to be notified about the result, use - * `redirect_url` or `callback_url`. - * - * The final URL that you send a customer to complete 3D Secure may resemble the following, where the - * first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: - * `https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu? - * one_time_token_id=123&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` - * - * ### Example Redirect Flow - * - * You may wish to redirect customers to different pages depending on whether their SCA was performed - * successfully. Here's an example flow to use as a reference: - * - * 1. Create a subscription via API; it requires 3DS - * 2. You receive a `gateway_payment_id` in the `action_link` along other params in the response. - * 3. Use this `gateway_payment_id` to, for example, connect with your internal resources or generate a - * session_id - * 4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which - * “session” this applies to - * 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied - * 6. After the customer finishes 3DS authentication, we let you know the result by making a request to - * applied `callback_url`. - * 7. After that, we redirect the customer to the `redirect_url`; at this point the result of - * authentication is known - * 8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was - * successful or not - * - * ## Subscriptions Import - * - * Subscriptions can be “imported” via the API to handle the following scenarios: - * - * + You already have existing subscriptions with specific start and renewal dates that you would like - * to import to Advanced Billing - * + You already have credit cards stored in your provider’s vault and you would like to create - * subscriptions using those tokens - * - * Before importing, you should have already set up your products to match your offerings. Then, you - * can create Subscriptions via the API just like you normally would, but using a few special - * attributes. - * - * Full documentation on how import Subscriptions using the **import tool** in the Advanced Billing UI - * can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Imports). - * - * ### Important Notices and Disclaimers regarding Imports - * - * Before performing a bulk import of subscriptions via the API, we suggest reading the [Subscriptions - * Import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Imports) instructions to - * understand the repurcussions of a large import. - * - * ### Subscription Input Attributes - * - * The following _additional_ attributes to the subscription input attributes make imports possible: - * `next_billing_at`, `previous_billing_at`, and `import_mrr`. - * - * ### Current Vault - * - * If you are using a Legacy gateway such as "eWAY Rapid (Legacy)" or "Stripe (Legacy)" then please - * contact Support for further instructions on subscription imports. - * - * ### Braintree Blue (Braintree v2) Imports - * - * Braintree Blue is Braintree’s newer (version 2) API. For this gateway, please provide the - * `vault_token` parameter with the value from Braintree’s “Customer ID” rather than the “Payment - * Profile Token”. At this time we do not use `current_vault_token` with the Braintree Blue gateway, - * and we only support a single payment profile per Braintree Customer. - * - * When importing PayPal type payment profiles, please set `payment_type` to `paypal_account`. - * - * ### Stripe ACH Imports - * - * If the bank account has already been verified, currently you will need to create the customer, - * create the payment profile in Advanced Billing - setting verified=true, then create a subscription - * using the customer_id and payment_profile_id. - * - * ### Webhooks During Import - * - * If no `next_billing_at` is provided, webhooks will be fired as normal. If you do set a future - * `next_billing_at`, only a subset of the webhooks are fired when the subscription is created. Keep - * reading for more information as to what webhooks will be fired under which scenarios. - * - * #### Successful creation with Billing Date - * - * Scenario: If `next_billing_at` provided - * - * + `signup_success` - * + `billing_date_change` - * - * #### Successful creation without Billing Date - * - * Scenario: If no `next_billing_at` provided - * - * + `signup_success` - * + `payment_success` - * - * #### Unsuccessful creation - * - * Scenario: If card can’t be charged, and no `next_billing_at` provided - * - * + signup_failure - * - * #### Webhooks fired when next_billing_at is reached: - * - * + `renewal_success or renewal_failure` - * + `payment_success or payment_failure` - * - * ### Date and Time Formats - * - * We will attempt to parse any string you send as the value of next_billing_at in to a date or time. - * For best results, use a known format like described in “Date and Time Specification” of RFC 2822 or - * ISO 8601 . - * - * The following are all equivalent and will work as input to `next_billing_at`: - * - * ``` - * Aug 06 2030 11:34:00 -0400 - * Aug 06 2030 11:34 -0400 - * 2030-08-06T11:34:00-04:00 - * 8/6/2030 11:34:00 EDT - * 8/6/2030 8:34:00 PDT - * 2030-08-06T15:34:00Z - * ``` - * You may also pass just a date, in which case we will assume the time to be noon - * - * ``` - * 2010-08-06 - * ``` - * - * ## Subscription Hierarchies & WhoPays - * - * When subscription groups were first added to our Relationship Invoicing architecture, to group - * together invoices for related subscriptions and allow for complex customer hierarchies and WhoPays - * scenarios, they were designed to consist of a primary and a collection of group members. The primary - * would control many aspects of the group, such as when the consolidated invoice is generated. As of - * today, groups still function this way. - * - * In the future, the concept of a "primary" will be removed in order to offer more flexibility into - * group management and reduce confusion concerning what actions must be done on a primary level, - * rather than a member level. - * - * We have introduced a two scheme system as a bridge between these two group organizations. Scheme 1, - * which is relevant to all subscription groups today, marks the group as being "ruled" by a primary. - * - * When reading a subscription via API, they will return a top-level attribute called `group`, which - * will denote which scheme is being used. At this time, the `scheme` attribute will always be 1. - * - * ### Subscription in a Customer Hierarchy - * - * For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en- - * us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https: - * //maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays) features, it is - * possible to create subscriptions within a customer hierarchy. This can be achieved through the API - * by passing group parameters in the **Create Subscription** request. - * - * + The `group` parameters are optional and consist of the required `target` and optional `billing` - * parameters. - * - * When the `target` parameter specifies a customer that is already part of a hierarchy, the new - * subscription will become a member of the customer hierarchy as well. If the target customer is not - * part of a hierarchy, a new customer hierarchy will be created and both the target customer and the - * new subscription will become part of the hierarchy with the specified target customer set as the - * responsible payer for the hierarchy's subscriptions. - * - * Rather than specifying a customer, the `target` parameter could instead simply have a value of - * `self` which indicates the subscription will be paid for not by some other customer, but by the - * subscribing customer. This will be true whether the customer is being created new, is already part - * of a hierarchy, or already exists outside a hierarchy. A valid payment method must also be - * specified in the subscription parameters. - * - * Note that when creating subscriptions in a customer hierarchy, if the customer hierarchy does not - * already have a payment method, passing valid credit card attributes in the subscription parameters - * will also result in the payment method being established as the default payment method for the - * customer hierarchy irrespective of the responsible payer. - * - * The optional `billing` parameters specify how some aspects of the billing for the new subscription - * should be handled. Rather than capturing payment immediately, the `accrue` parameter can be - * included so that the new subscription charges accrue until the next assessment date. Regarding the - * date, the `align_date` parameter can be included so that the billing date of the new subscription - * matches up with the default subscription group in the customer hierarchy. When choosing to align - * the dates, the `prorate` parameter can also be specified so that the new subscription charges are - * prorated based on the billing period of the default subscription group in the customer hierarchy - * also. - * - * ### Subscription in a Subscription Group - * - * For sites making use of [Relationship Billing](https://maxio.zendesk.com/hc/en- - * us/articles/24252287829645-Advanced-Billing-Invoices-Overview) it may be desireable to create a - * subscription as part of a [subscription group](https://maxio.zendesk.com/hc/en- - * us/articles/24252172565005-Subscription-Groups-Overview) in order to rely on [invoice - * consolidation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). - * This can be achieved through the API by passing group parameters in the Create Subscription request. - * The `group` parameters are optional and consist of the required `target` and optional `billing` - * parameters. - * - * The `target` parameters specify an existing subscription with which the newly created subscription - * should be grouped. If the target subscription is already part of a group, the new subscription will - * become a member of the group as well. If the target subscription is not part of a group, a new - * group will be created and both the target and the new subscription will become part of the group - * with the target as the group's primary subscription. - * - * The optional `billing` parameters specify how some aspects of the billing for the new subscription - * should be handled. Rather than capturing payment immediately, the `accrue` parameter can be - * included so that the new subscription charges accrue until the next assessment date. Regarding the - * date, the `align_date` parameter can be included so that the billing date of the new subscription - * matches up with the target subscription. When choosing to align the dates, the `prorate` parameter - * can also be specified so that the new subscription charges are prorated based on the billing period - * of the target subscription also. - * - * ## Providing Agreement Acceptance Params - * - * It is possible to provide a proof of customer's acceptance of terms and policies. - * We will be storing this proof in case it might be required (i.e. chargeback). - * Currently, we already keep it for subscriptions created via Public Signup Pages. - * In order to create a subscription with the proof of agreement acceptance, you must provide - * additional parameters `agreement acceptance` with `ip_address` and at least one url to the policy - * that was accepted: `terms_url` or `privacy_policy_url`. Additional urls that can be provided: - * `return_refund_policy_url`, `delivery_policy_url` and - * `secure_checkout_policy_url`. - * - * ```json - * "subscription": { - * "product_handle": "gold-product", - * "customer_attributes": { - * "first_name": "Jane", - * "last_name": "Doe", - * "email": "jd@chargify.test" - * }, - * "agreement_acceptance": { - * "ip_address": "1.2.3.4", - * "terms_url": "https://terms.url", - * "privacy_policy_url": "https://privacy_policy.url", - * "return_refund_policy_url": "https://return_refund_policy.url", - * "delivery_policy_url": "https://delivery_policy.url", - * "secure_checkout_policy_url": "https://secure_checkout_policy.url" - * } - * } - * } - * ``` - * - * **For Maxio Payments subscriptions, the agreement acceptance params are required, with at least - * terms_url provided.** - * - * ## Providing ACH Agreement params - * - * It is also possible to provide a proof that a customer authorized ACH agreement terms. - * The proof will be stored and the email will be sent to the customer with a copy of the terms (if - * enabled). - * In order to create a subscription with the proof of authorized ACH agreement terms, you must provide - * the additional parameter `ach_agreement` with the following nested parameters: `agreement_terms`, - * `authorizer_first_name`, `authorizer_last_name` and `ip_address`. - * Each of them is required. - * - * ```json - * "subscription": { - * "product_handle": "gold-product", - * "customer_attributes": { - * "first_name": "Jane", - * "last_name": "Doe", - * "email": "jd@chargify.test" - * }, - * "bank_account_attributes": { - * "bank_name": "Test Bank", - * "bank_routing_number": "021000089", - * "bank_account_number": "111111111111", - * "bank_account_type": "checking", - * "bank_account_holder_type": "business", - * "payment_type": "bank_account" - * }, - * "ach_agreement": { - * "agreement_terms": "ACH agreement terms", - * "authorizer_first_name": "Jane", - * "authorizer_last_name": "Doe", - * "ip_address": "1.2.3.4" - * } - * } - * ``` + * See the [Subscription Signups](page:introduction/basic-concepts/subscription-signup) article for + * more information on working with subscriptions in Advanced Billing. * * @param CreateSubscriptionRequest|null $body * @@ -953,32 +175,44 @@ public function listSubscriptions(array $options): array } /** - * The subscription endpoint allows you to instantly update one or many attributes about a subscription - * in a single call. + * Updates one or more attributes of a subscription. * * ## Update Subscription Payment Method * - * Change the card that your Subscriber uses for their subscription. You can also use this method to - * simply change the expiration date of the card **if your gateway allows**. + * Change the card that your subscriber uses for their subscription. You can also use this method to + * change the expiration date of the card **if your gateway allows**. + * + * Do not use real card information for testing. See the Sites articles that cover [testing your site + * setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0- + * 0) for more details on testing in your sandbox. * - * Note that partial card updates for **Authorize.Net** are not allowed via this endpoint. The existing + * Note that collecting and sending raw card details in production requires [PCI compliance](https: + * //docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If + * your business is not PCI compliant, use [Chargify.js](https://docs.maxio.com/hc/en- + * us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or + * bank account information. + * + * > Note: Partial card updates for **Authorize.Net** are not allowed via this endpoint. The existing * Payment Profile must be directly updated instead. * + * ## Update Product + * * You also use this method to change the subscription to a different product by setting a new value * for product_handle. A product change can be done in two different ways, **product change** or * **delayed product change**. * - * ## Product Change + * ### Product Change * - * This endpoint may be used to change a subscription's product. The new payment amount is calculated - * and charged at the normal start of the next period. If you desire complex product changes or - * prorated upgrades and downgrades instead, please see the documentation on Migrating Subscription - * Products. + * You can change a subscription's product. The new payment amount is calculated and charged at the + * normal start of the next period. If you require complex product changes or prorated upgrades and + * downgrades instead, please see the documentation on [Migrating Subscription Products](https://docs. + * maxio.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations#product-changes-and- + * migrations-0-0). * - * To perform a product change, simply set either the `product_handle` or `product_id` attribute to - * that of a different product from the same site as the subscription. You can also change the price - * point by passing in either `product_price_point_id` or `product_price_point_handle` - otherwise the - * new product's default price point will be used. + * To perform a product change, set either the `product_handle` or `product_id` attribute to that of a + * different product from the same site as the subscription. You can also change the price point by + * passing in either `product_price_point_id` or `product_price_point_handle` - otherwise the new + * product's default price point is used. * * ### Delayed Product Change * @@ -986,42 +220,42 @@ public function listSubscriptions(array $options): array * and charged at the normal start of the next period. * * This method schedules the product change to happen automatically at the subscription’s next renewal - * date. To perform a Delayed Product Change, set the `product_handle` attribute as you would in a + * date. To perform a delayed product change, set the `product_handle` attribute as you would in a * regular product change, but also set the `product_change_delayed` attribute to `true`. No proration * applies in this case. * * You can also perform a delayed change to the price point by passing in either * `product_price_point_id` or `product_price_point_handle` * - * **Note: To cancel a delayed product change, set `next_product_id` to an empty string.** + * > **Note:** To cancel a delayed product change, set `next_product_id` to an empty string. * * ## Billing Date Changes * + * You can update dates for a subscrption. + * * ### Regular Billing Date Changes * * Send the `next_billing_at` to set the next billing date for the subscription. After that date passes * and the subscription is processed, the following billing date will be set according to the * subscription's product period. * - * Note that if you pass an invalid date, we will automatically interpret and set the correct date. For - * example, when February 30 is entered, the next billing will be set to March 2nd in a non-leap year. + * > Note: If you pass an invalid date, the correct date is automatically set to he correct date. For + * example, if February 30 is passed, the next billing would be set to March 2nd in a non-leap year. * - * The server response will not return data under the key/value pair of `next_billing`. Please view the - * key/value pair of `current_period_ends_at` to verify that the `next_billing` date has been changed - * successfully. + * The server response will not return data under the key/value pair of `next_billing_at`. View the + * key/value pair of `current_period_ends_at` to verify that the `next_billing_at` date has been + * changed successfully. * - * ### Snap Day Changes + * ### Calendar Billing and Snap Day Changes * * For a subscription using Calendar Billing, setting the next billing date is a bit different. Send * the `snap_day` attribute to change the calendar billing date for **a subscription using a product * eligible for calendar billing**. * - * Note: If you change the product associated with a subscription that contains a `snap_date` and - * immediately `READ/GET` the subscription data, it will still contain evidence of the existing - * `snap_date`. This is due to the fact that a product change is instantanous and only affects the - * product associated with a subscription. After the `next_billing` date arrives, the `snap_day` - * associated with the subscription will return to `null.` Another way of looking at this is that you - * willl have to wait for the next billing cycle to arrive before the `snap_date` will reset to `null`. + * > Note: If you change the product associated with a subscription that contains a `snap_day` and + * immediately `READ/GET` the subscription data, it will still contain original `snap_day`. The + * `snap_day`will will reset to 'null on the next billing cycle. This is because a product change is + * instantanous and only affects the product associated with a subscription. * * @param int $subscriptionId The Chargify id of the subscription * @param UpdateSubscriptionRequest|null $body @@ -1181,8 +415,7 @@ public function findSubscription(?string $reference = null): SubscriptionRespons * `cascade` parameters. For example, to delete just the customer record, the query params would be: `? * ack={customer_id}&cascade[]=customer` * - * If you need to remove subscriptions from a live site, please contact support to discuss your use - * case. + * If you need to remove subscriptions from a live site, contact support to discuss your use case. * * ### Delete customer and payment profile * @@ -1267,7 +500,7 @@ public function updatePrepaidSubscriptionConfiguration( * * A subscription will not be created by utilizing this endpoint; it is meant to serve as a prediction. * - * For more information, please see our documentation [here](https://maxio.zendesk.com/hc/en- + * For more information, see our documentation [here](https://maxio.zendesk.com/hc/en- * us/articles/24252493695757-Subscriber-Interface-Overview). * * ## Taxable Subscriptions @@ -1280,13 +513,13 @@ public function updatePrepaidSubscriptionConfiguration( * + The subscription payload must contain a full billing or shipping address in order to calculate * tax * - * For more information about creating taxable previews, please see our documentation guide on how to - * create [taxable subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes) + * For more information about creating taxable previews, see our documentation guide on how to create + * [taxable subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes) * * You do **not** need to include a card number to generate tax information when you are previewing a - * subscription. However, please note that when you actually want to create the subscription, you must - * include the credit card information if you want the billing address to be stored in Advanced Billing. - * The billing address and the credit card information are stored together within the payment profile + * subscription. However, when you actually want to create the subscription, you must include the + * credit card information if you want the billing address to be stored in Advanced Billing. The + * billing address and the credit card information are stored together within the payment profile * object. Also, you may not send a billing address to Advanced Billing without payment profile * information, as the address is stored on the card. * @@ -1295,8 +528,8 @@ public function updatePrepaidSubscriptionConfiguration( * * ## Non-taxable Subscriptions * - * If you'd like to calculate subscriptions that do not include tax, please feel free to leave off the - * billing information. + * If you'd like to calculate subscriptions that do not include tax you may leave off the billing + * information. * * @param CreateSubscriptionRequest|null $body * @@ -1371,8 +604,8 @@ public function applyCouponsToSubscription( /** * Use this endpoint to remove a coupon from an existing subscription. * - * For more information on the expected behaviour of removing a coupon from a subscription, please see - * our documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and- + * For more information on the expected behaviour of removing a coupon from a subscription, See our + * documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and- * Subscriptions#removing-a-coupon) * * @param int $subscriptionId The Chargify id of the subscription diff --git a/src/Models/ActivateEventBasedComponent.php b/src/Models/ActivateEventBasedComponent.php index 5d4b1bf..05473f6 100644 --- a/src/Models/ActivateEventBasedComponent.php +++ b/src/Models/ActivateEventBasedComponent.php @@ -53,8 +53,7 @@ public function setPricePointId(?int $pricePointId): void /** * Returns Billing Schedule. * This attribute is particularly useful when you need to align billing events for different components - * on distinct schedules within a subscription. Please note this only works for site with - * Multifrequency enabled + * on distinct schedules within a subscription. This only works for site with Multifrequency enabled. */ public function getBillingSchedule(): ?BillingSchedule { @@ -64,8 +63,7 @@ public function getBillingSchedule(): ?BillingSchedule /** * Sets Billing Schedule. * This attribute is particularly useful when you need to align billing events for different components - * on distinct schedules within a subscription. Please note this only works for site with - * Multifrequency enabled + * on distinct schedules within a subscription. This only works for site with Multifrequency enabled. * * @maps billing_schedule */ diff --git a/src/Models/BillingSchedule.php b/src/Models/BillingSchedule.php index 262a714..3319727 100644 --- a/src/Models/BillingSchedule.php +++ b/src/Models/BillingSchedule.php @@ -16,8 +16,7 @@ /** * This attribute is particularly useful when you need to align billing events for different components - * on distinct schedules within a subscription. Please note this only works for site with - * Multifrequency enabled + * on distinct schedules within a subscription. This only works for site with Multifrequency enabled. */ class BillingSchedule implements \JsonSerializable { diff --git a/src/Models/Builders/CalendarBillingBuilder.php b/src/Models/Builders/CalendarBillingBuilder.php index 39bbee5..13e297a 100644 --- a/src/Models/Builders/CalendarBillingBuilder.php +++ b/src/Models/Builders/CalendarBillingBuilder.php @@ -49,6 +49,15 @@ public function snapDay($value): self return $this; } + /** + * Unsets snap day field. + */ + public function unsetSnapDay(): self + { + $this->instance->unsetSnapDay(); + return $this; + } + /** * Sets calendar billing first charge field. * diff --git a/src/Models/Builders/ComponentBuilder.php b/src/Models/Builders/ComponentBuilder.php index 5808e87..0210486 100644 --- a/src/Models/Builders/ComponentBuilder.php +++ b/src/Models/Builders/ComponentBuilder.php @@ -207,17 +207,6 @@ public function archived(?bool $value): self return $this; } - /** - * Sets taxable field. - * - * @param bool|null $value - */ - public function taxable(?bool $value): self - { - $this->instance->setTaxable($value); - return $this; - } - /** * Sets description field. * @@ -340,6 +329,17 @@ public function defaultPricePointName(?string $value): self return $this; } + /** + * Sets taxable field. + * + * @param bool|null $value + */ + public function taxable(?bool $value): self + { + $this->instance->setTaxable($value); + return $this; + } + /** * Sets tax code field. * diff --git a/src/Models/Builders/ComponentCustomPriceBuilder.php b/src/Models/Builders/ComponentCustomPriceBuilder.php index 2020622..39a68b6 100644 --- a/src/Models/Builders/ComponentCustomPriceBuilder.php +++ b/src/Models/Builders/ComponentCustomPriceBuilder.php @@ -94,6 +94,68 @@ public function unsetIntervalUnit(): self return $this; } + /** + * Sets renew prepaid allocation field. + * + * @param bool|null $value + */ + public function renewPrepaidAllocation(?bool $value): self + { + $this->instance->setRenewPrepaidAllocation($value); + return $this; + } + + /** + * Sets rollover prepaid remainder field. + * + * @param bool|null $value + */ + public function rolloverPrepaidRemainder(?bool $value): self + { + $this->instance->setRolloverPrepaidRemainder($value); + return $this; + } + + /** + * Sets expiration interval field. + * + * @param int|null $value + */ + public function expirationInterval(?int $value): self + { + $this->instance->setExpirationInterval($value); + return $this; + } + + /** + * Unsets expiration interval field. + */ + public function unsetExpirationInterval(): self + { + $this->instance->unsetExpirationInterval(); + return $this; + } + + /** + * Sets expiration interval unit field. + * + * @param string|null $value + */ + public function expirationIntervalUnit(?string $value): self + { + $this->instance->setExpirationIntervalUnit($value); + return $this; + } + + /** + * Unsets expiration interval unit field. + */ + public function unsetExpirationIntervalUnit(): self + { + $this->instance->unsetExpirationIntervalUnit(); + return $this; + } + /** * Add an additional property to this model. * diff --git a/src/Models/Builders/CreateInvoiceCouponBuilder.php b/src/Models/Builders/CreateInvoiceCouponBuilder.php index e2bc25f..c12d22b 100644 --- a/src/Models/Builders/CreateInvoiceCouponBuilder.php +++ b/src/Models/Builders/CreateInvoiceCouponBuilder.php @@ -49,6 +49,17 @@ public function code(?string $value): self return $this; } + /** + * Sets subcode field. + * + * @param string|null $value + */ + public function subcode(?string $value): self + { + $this->instance->setSubcode($value); + return $this; + } + /** * Sets percentage field. * diff --git a/src/Models/Builders/CreateOrUpdateProductBuilder.php b/src/Models/Builders/CreateOrUpdateProductBuilder.php index 31253cb..72691c2 100644 --- a/src/Models/Builders/CreateOrUpdateProductBuilder.php +++ b/src/Models/Builders/CreateOrUpdateProductBuilder.php @@ -135,6 +135,15 @@ public function trialType(?string $value): self return $this; } + /** + * Unsets trial type field. + */ + public function unsetTrialType(): self + { + $this->instance->unsetTrialType(); + return $this; + } + /** * Sets expiration interval field. * diff --git a/src/Models/Builders/CreateProductPricePointBuilder.php b/src/Models/Builders/CreateProductPricePointBuilder.php index caf1e93..e997760 100644 --- a/src/Models/Builders/CreateProductPricePointBuilder.php +++ b/src/Models/Builders/CreateProductPricePointBuilder.php @@ -98,6 +98,15 @@ public function trialType(?string $value): self return $this; } + /** + * Unsets trial type field. + */ + public function unsetTrialType(): self + { + $this->instance->unsetTrialType(); + return $this; + } + /** * Sets initial charge in cents field. * diff --git a/src/Models/Builders/CreateUsageBuilder.php b/src/Models/Builders/CreateUsageBuilder.php index 60ec93b..820098c 100644 --- a/src/Models/Builders/CreateUsageBuilder.php +++ b/src/Models/Builders/CreateUsageBuilder.php @@ -11,6 +11,7 @@ namespace AdvancedBillingLib\Models\Builders; use AdvancedBillingLib\Models\BillingSchedule; +use AdvancedBillingLib\Models\ComponentCustomPrice; use AdvancedBillingLib\Models\CreateUsage; use Core\Utils\CoreHelper; @@ -83,6 +84,17 @@ public function billingSchedule(?BillingSchedule $value): self return $this; } + /** + * Sets custom price field. + * + * @param ComponentCustomPrice|null $value + */ + public function customPrice(?ComponentCustomPrice $value): self + { + $this->instance->setCustomPrice($value); + return $this; + } + /** * Add an additional property to this model. * diff --git a/src/Models/Builders/ListCouponsFilterBuilder.php b/src/Models/Builders/ListCouponsFilterBuilder.php index 7ee420b..5105058 100644 --- a/src/Models/Builders/ListCouponsFilterBuilder.php +++ b/src/Models/Builders/ListCouponsFilterBuilder.php @@ -126,6 +126,17 @@ public function useSiteExchangeRate(?bool $value): self return $this; } + /** + * Sets include archived field. + * + * @param bool|null $value + */ + public function includeArchived(?bool $value): self + { + $this->instance->setIncludeArchived($value); + return $this; + } + /** * Add an additional property to this model. * diff --git a/src/Models/Builders/ProductPricePointBuilder.php b/src/Models/Builders/ProductPricePointBuilder.php index 10cbf84..d933ae3 100644 --- a/src/Models/Builders/ProductPricePointBuilder.php +++ b/src/Models/Builders/ProductPricePointBuilder.php @@ -185,6 +185,15 @@ public function trialType(?string $value): self return $this; } + /** + * Unsets trial type field. + */ + public function unsetTrialType(): self + { + $this->instance->unsetTrialType(); + return $this; + } + /** * Sets introductory offer field. * diff --git a/src/Models/Builders/SubscriptionBuilder.php b/src/Models/Builders/SubscriptionBuilder.php index 615dd00..03e354e 100644 --- a/src/Models/Builders/SubscriptionBuilder.php +++ b/src/Models/Builders/SubscriptionBuilder.php @@ -429,9 +429,9 @@ public function unsetCouponCode(): self /** * Sets snap day field. * - * @param string|null $value + * @param int|string|null $value */ - public function snapDay(?string $value): self + public function snapDay($value): self { $this->instance->setSnapDay($value); return $this; diff --git a/src/Models/Builders/SubscriptionCustomPriceBuilder.php b/src/Models/Builders/SubscriptionCustomPriceBuilder.php index 036ae9e..a90caf5 100644 --- a/src/Models/Builders/SubscriptionCustomPriceBuilder.php +++ b/src/Models/Builders/SubscriptionCustomPriceBuilder.php @@ -107,6 +107,26 @@ public function trialIntervalUnit(?string $value): self return $this; } + /** + * Sets trial type field. + * + * @param string|null $value + */ + public function trialType(?string $value): self + { + $this->instance->setTrialType($value); + return $this; + } + + /** + * Unsets trial type field. + */ + public function unsetTrialType(): self + { + $this->instance->unsetTrialType(); + return $this; + } + /** * Sets initial charge in cents field. * diff --git a/src/Models/Builders/UpdateSubscriptionBuilder.php b/src/Models/Builders/UpdateSubscriptionBuilder.php index ac3816e..660bc82 100644 --- a/src/Models/Builders/UpdateSubscriptionBuilder.php +++ b/src/Models/Builders/UpdateSubscriptionBuilder.php @@ -110,7 +110,7 @@ public function nextProductPricePointId(?string $value): self /** * Sets snap day field. * - * @param string|int|null $value + * @param int|string|null $value */ public function snapDay($value): self { @@ -118,6 +118,15 @@ public function snapDay($value): self return $this; } + /** + * Unsets snap day field. + */ + public function unsetSnapDay(): self + { + $this->instance->unsetSnapDay(); + return $this; + } + /** * Sets initial billing at field. * diff --git a/src/Models/CalendarBilling.php b/src/Models/CalendarBilling.php index b597c56..9019c6b 100644 --- a/src/Models/CalendarBilling.php +++ b/src/Models/CalendarBilling.php @@ -19,9 +19,9 @@ class CalendarBilling implements \JsonSerializable { /** - * @var int|string|null + * @var array */ - private $snapDay; + private $snapDay = []; /** * @var string|null @@ -36,7 +36,10 @@ class CalendarBilling implements \JsonSerializable */ public function getSnapDay() { - return $this->snapDay; + if (count($this->snapDay) == 0) { + return null; + } + return $this->snapDay['value']; } /** @@ -44,13 +47,23 @@ public function getSnapDay() * A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'. * * @maps snap_day - * @mapsBy anyOf(oneOf(int,string),null) + * @mapsBy anyOf(oneOf(int,SnapDay),null) + * @factory \AdvancedBillingLib\Models\SnapDay::checkValue SnapDay * * @param int|string|null $snapDay */ public function setSnapDay($snapDay): void { - $this->snapDay = $snapDay; + $this->snapDay['value'] = $snapDay; + } + + /** + * Unsets Snap Day. + * A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'. + */ + public function unsetSnapDay(): void + { + $this->snapDay = []; } /** @@ -82,7 +95,7 @@ public function __toString(): string return ApiHelper::stringify( 'CalendarBilling', [ - 'snapDay' => $this->snapDay, + 'snapDay' => $this->getSnapDay(), 'calendarBillingFirstCharge' => $this->calendarBillingFirstCharge, 'additionalProperties' => $this->additionalProperties ] @@ -129,11 +142,14 @@ public function findAdditionalProperty(string $name) public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; - if (isset($this->snapDay)) { + if (!empty($this->snapDay)) { $json['snap_day'] = ApiHelper::getJsonHelper()->verifyTypes( - $this->snapDay, - 'anyOf(oneOf(int,string),null)' + $this->snapDay['value'], + 'anyOf(oneOf(int,SnapDay),null)', + [ + '\AdvancedBillingLib\Models\SnapDay::checkValue SnapDay' + ] ); } if (isset($this->calendarBillingFirstCharge)) { diff --git a/src/Models/ChargifyEBB.php b/src/Models/ChargifyEBB.php index bf51d35..12364d2 100644 --- a/src/Models/ChargifyEBB.php +++ b/src/Models/ChargifyEBB.php @@ -73,8 +73,8 @@ public function setTimestamp(?\DateTime $timestamp): void /** * Returns Id. - * 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. + * A unique ID set by Chargify. This field is reserved. If `chargify.id` is present in the request + * payload, it will be overwritten. */ public function getId(): ?string { @@ -83,8 +83,8 @@ public function getId(): ?string /** * Sets Id. - * 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. + * A unique ID set by Chargify. This field is reserved. If `chargify.id` is present in the request + * payload, it will be overwritten. * * @maps id */ @@ -95,9 +95,8 @@ public function setId(?string $id): void /** * Returns Created At. - * 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. + * An ISO-8601 timestamp, set by Chargify at the time each event is recorded. This field is reserved. + * If `chargify.created_at` is present in the request payload, it will be overwritten. */ public function getCreatedAt(): ?\DateTime { @@ -106,9 +105,8 @@ public function getCreatedAt(): ?\DateTime /** * Sets Created At. - * 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. + * An ISO-8601 timestamp, set by Chargify at the time each event is recorded. This field is reserved. + * If `chargify.created_at` is present in the request payload, it will be overwritten. * * @maps created_at * @factory \AdvancedBillingLib\Utils\DateTimeHelper::fromRfc3339DateTime diff --git a/src/Models/Component.php b/src/Models/Component.php index 7bf1dd9..fabd4f7 100644 --- a/src/Models/Component.php +++ b/src/Models/Component.php @@ -76,11 +76,6 @@ class Component implements \JsonSerializable */ private $archived; - /** - * @var bool|null - */ - private $taxable; - /** * @var array */ @@ -116,6 +111,11 @@ class Component implements \JsonSerializable */ private $defaultPricePointName; + /** + * @var bool|null + */ + private $taxable; + /** * @var array */ @@ -483,26 +483,6 @@ public function setArchived(?bool $archived): void $this->archived = $archived; } - /** - * Returns Taxable. - * Boolean flag describing whether a component is taxable or not. - */ - public function getTaxable(): ?bool - { - return $this->taxable; - } - - /** - * Sets Taxable. - * Boolean flag describing whether a component is taxable or not. - * - * @maps taxable - */ - public function setTaxable(?bool $taxable): void - { - $this->taxable = $taxable; - } - /** * Returns Description. * The description of the component. @@ -709,10 +689,30 @@ public function setDefaultPricePointName(?string $defaultPricePointName): void $this->defaultPricePointName = $defaultPricePointName; } + /** + * Returns Taxable. + * Boolean flag describing whether a component is taxable or not. + */ + public function getTaxable(): ?bool + { + return $this->taxable; + } + + /** + * Sets Taxable. + * Boolean flag describing whether a component is taxable or not. + * + * @maps taxable + */ + public function setTaxable(?bool $taxable): void + { + $this->taxable = $taxable; + } + /** * Returns Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function getTaxCode(): ?string { @@ -725,7 +725,7 @@ public function getTaxCode(): ?string /** * Sets Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. * * @maps tax_code */ @@ -737,7 +737,7 @@ public function setTaxCode(?string $taxCode): void /** * Unsets Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function unsetTaxCode(): void { @@ -1153,7 +1153,6 @@ public function __toString(): string 'pricePerUnitInCents' => $this->getPricePerUnitInCents(), 'kind' => $this->kind, 'archived' => $this->archived, - 'taxable' => $this->taxable, 'description' => $this->getDescription(), 'defaultPricePointId' => $this->getDefaultPricePointId(), 'overagePrices' => $this->getOveragePrices(), @@ -1161,6 +1160,7 @@ public function __toString(): string 'pricePointCount' => $this->pricePointCount, 'pricePointsUrl' => $this->getPricePointsUrl(), 'defaultPricePointName' => $this->defaultPricePointName, + 'taxable' => $this->taxable, 'taxCode' => $this->getTaxCode(), 'recurring' => $this->recurring, 'upgradeCharge' => $this->getUpgradeCharge(), @@ -1257,9 +1257,6 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->archived)) { $json['archived'] = $this->archived; } - if (isset($this->taxable)) { - $json['taxable'] = $this->taxable; - } if (!empty($this->description)) { $json['description'] = $this->description['value']; } @@ -1281,6 +1278,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->defaultPricePointName)) { $json['default_price_point_name'] = $this->defaultPricePointName; } + if (isset($this->taxable)) { + $json['taxable'] = $this->taxable; + } if (!empty($this->taxCode)) { $json['tax_code'] = $this->taxCode['value']; } diff --git a/src/Models/ComponentCustomPrice.php b/src/Models/ComponentCustomPrice.php index 08911ce..1544292 100644 --- a/src/Models/ComponentCustomPrice.php +++ b/src/Models/ComponentCustomPrice.php @@ -43,6 +43,26 @@ class ComponentCustomPrice implements \JsonSerializable */ private $prices; + /** + * @var bool|null + */ + private $renewPrepaidAllocation; + + /** + * @var bool|null + */ + private $rolloverPrepaidRemainder; + + /** + * @var array + */ + private $expirationInterval = []; + + /** + * @var array + */ + private $expirationIntervalUnit = []; + /** * @param Price[] $prices */ @@ -177,6 +197,118 @@ public function setPrices(array $prices): void $this->prices = $prices; } + /** + * Returns Renew Prepaid Allocation. + * Applicable only to prepaid usage components. Controls whether the allocated quantity renews each + * period. + */ + public function getRenewPrepaidAllocation(): ?bool + { + return $this->renewPrepaidAllocation; + } + + /** + * Sets Renew Prepaid Allocation. + * Applicable only to prepaid usage components. Controls whether the allocated quantity renews each + * period. + * + * @maps renew_prepaid_allocation + */ + public function setRenewPrepaidAllocation(?bool $renewPrepaidAllocation): void + { + $this->renewPrepaidAllocation = $renewPrepaidAllocation; + } + + /** + * Returns Rollover Prepaid Remainder. + * Applicable only to prepaid usage components. Controls whether remaining units roll over to the next + * period. + */ + public function getRolloverPrepaidRemainder(): ?bool + { + return $this->rolloverPrepaidRemainder; + } + + /** + * Sets Rollover Prepaid Remainder. + * Applicable only to prepaid usage components. Controls whether remaining units roll over to the next + * period. + * + * @maps rollover_prepaid_remainder + */ + public function setRolloverPrepaidRemainder(?bool $rolloverPrepaidRemainder): void + { + $this->rolloverPrepaidRemainder = $rolloverPrepaidRemainder; + } + + /** + * Returns Expiration Interval. + * Applicable only when rollover is enabled. Number of `expiration_interval_unit`s after which rollover + * amounts expire. + */ + public function getExpirationInterval(): ?int + { + if (count($this->expirationInterval) == 0) { + return null; + } + return $this->expirationInterval['value']; + } + + /** + * Sets Expiration Interval. + * Applicable only when rollover is enabled. Number of `expiration_interval_unit`s after which rollover + * amounts expire. + * + * @maps expiration_interval + */ + public function setExpirationInterval(?int $expirationInterval): void + { + $this->expirationInterval['value'] = $expirationInterval; + } + + /** + * Unsets Expiration Interval. + * Applicable only when rollover is enabled. Number of `expiration_interval_unit`s after which rollover + * amounts expire. + */ + public function unsetExpirationInterval(): void + { + $this->expirationInterval = []; + } + + /** + * Returns Expiration Interval Unit. + * Applicable only when rollover is enabled. Interval unit for rollover expiration (month or day). + */ + public function getExpirationIntervalUnit(): ?string + { + if (count($this->expirationIntervalUnit) == 0) { + return null; + } + return $this->expirationIntervalUnit['value']; + } + + /** + * Sets Expiration Interval Unit. + * Applicable only when rollover is enabled. Interval unit for rollover expiration (month or day). + * + * @maps expiration_interval_unit + * @factory \AdvancedBillingLib\Models\ExpirationIntervalUnit::checkValue + */ + public function setExpirationIntervalUnit(?string $expirationIntervalUnit): void + { + $this->expirationIntervalUnit['value'] = $expirationIntervalUnit; + } + + /** + * Unsets Expiration Interval Unit. + * Applicable only when rollover is enabled. Interval unit for rollover expiration (month or day). + */ + public function unsetExpirationIntervalUnit(): void + { + $this->expirationIntervalUnit = []; + } + /** * Converts the ComponentCustomPrice object to a human-readable string representation. * @@ -192,6 +324,10 @@ public function __toString(): string 'interval' => $this->interval, 'intervalUnit' => $this->getIntervalUnit(), 'prices' => $this->prices, + 'renewPrepaidAllocation' => $this->renewPrepaidAllocation, + 'rolloverPrepaidRemainder' => $this->rolloverPrepaidRemainder, + 'expirationInterval' => $this->getExpirationInterval(), + 'expirationIntervalUnit' => $this->getExpirationIntervalUnit(), 'additionalProperties' => $this->additionalProperties ] ); @@ -238,18 +374,33 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->taxIncluded)) { - $json['tax_included'] = $this->taxIncluded; + $json['tax_included'] = $this->taxIncluded; } if (isset($this->pricingScheme)) { - $json['pricing_scheme'] = PricingScheme::checkValue($this->pricingScheme); + $json['pricing_scheme'] = PricingScheme::checkValue($this->pricingScheme); } if (isset($this->interval)) { - $json['interval'] = $this->interval; + $json['interval'] = $this->interval; } if (!empty($this->intervalUnit)) { - $json['interval_unit'] = IntervalUnit::checkValue($this->intervalUnit['value']); + $json['interval_unit'] = IntervalUnit::checkValue($this->intervalUnit['value']); + } + $json['prices'] = $this->prices; + if (isset($this->renewPrepaidAllocation)) { + $json['renew_prepaid_allocation'] = $this->renewPrepaidAllocation; + } + if (isset($this->rolloverPrepaidRemainder)) { + $json['rollover_prepaid_remainder'] = $this->rolloverPrepaidRemainder; + } + if (!empty($this->expirationInterval)) { + $json['expiration_interval'] = $this->expirationInterval['value']; + } + if (!empty($this->expirationIntervalUnit)) { + $json['expiration_interval_unit'] = + ExpirationIntervalUnit::checkValue( + $this->expirationIntervalUnit['value'] + ); } - $json['prices'] = $this->prices; $json = array_merge($json, $this->additionalProperties); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; diff --git a/src/Models/CreateAllocation.php b/src/Models/CreateAllocation.php index e3ed137..2e53ada 100644 --- a/src/Models/CreateAllocation.php +++ b/src/Models/CreateAllocation.php @@ -350,8 +350,7 @@ public function unsetPricePointId(): void /** * Returns Billing Schedule. * This attribute is particularly useful when you need to align billing events for different components - * on distinct schedules within a subscription. Please note this only works for site with - * Multifrequency enabled + * on distinct schedules within a subscription. This only works for site with Multifrequency enabled. */ public function getBillingSchedule(): ?BillingSchedule { @@ -361,8 +360,7 @@ public function getBillingSchedule(): ?BillingSchedule /** * Sets Billing Schedule. * This attribute is particularly useful when you need to align billing events for different components - * on distinct schedules within a subscription. Please note this only works for site with - * Multifrequency enabled + * on distinct schedules within a subscription. This only works for site with Multifrequency enabled. * * @maps billing_schedule */ diff --git a/src/Models/CreateInvoiceCoupon.php b/src/Models/CreateInvoiceCoupon.php index fd6ff53..7ee09b6 100644 --- a/src/Models/CreateInvoiceCoupon.php +++ b/src/Models/CreateInvoiceCoupon.php @@ -20,6 +20,11 @@ class CreateInvoiceCoupon implements \JsonSerializable */ private $code; + /** + * @var string|null + */ + private $subcode; + /** * @var string|float|null */ @@ -63,6 +68,24 @@ public function setCode(?string $code): void $this->code = $code; } + /** + * Returns Subcode. + */ + public function getSubcode(): ?string + { + return $this->subcode; + } + + /** + * Sets Subcode. + * + * @maps subcode + */ + public function setSubcode(?string $subcode): void + { + $this->subcode = $subcode; + } + /** * Returns Percentage. * @@ -188,6 +211,7 @@ public function __toString(): string 'CreateInvoiceCoupon', [ 'code' => $this->code, + 'subcode' => $this->subcode, 'percentage' => $this->percentage, 'amount' => $this->amount, 'description' => $this->description, @@ -241,6 +265,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->code)) { $json['code'] = $this->code; } + if (isset($this->subcode)) { + $json['subcode'] = $this->subcode; + } if (isset($this->percentage)) { $json['percentage'] = ApiHelper::getJsonHelper()->verifyTypes( diff --git a/src/Models/CreateInvoiceItem.php b/src/Models/CreateInvoiceItem.php index 7fcf4aa..43154c2 100644 --- a/src/Models/CreateInvoiceItem.php +++ b/src/Models/CreateInvoiceItem.php @@ -149,9 +149,8 @@ public function setUnitPrice($unitPrice): void /** * Returns Taxable. - * Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. - * - * If using Avalara, a tax_code parameter must also be sent. + * Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. If + * using AvaTax, a tax_code parameter must also be sent. */ public function getTaxable(): ?bool { @@ -160,9 +159,8 @@ public function getTaxable(): ?bool /** * Sets Taxable. - * Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. - * - * If using Avalara, a tax_code parameter must also be sent. + * Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. If + * using AvaTax, a tax_code parameter must also be sent. * * @maps taxable */ @@ -173,6 +171,8 @@ public function setTaxable(?bool $taxable): void /** * Returns Tax Code. + * A string representing the tax code related to the product type. This is especially important when + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function getTaxCode(): ?string { @@ -181,6 +181,8 @@ public function getTaxCode(): ?string /** * Sets Tax Code. + * A string representing the tax code related to the product type. This is especially important when + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. * * @maps tax_code */ diff --git a/src/Models/CreateMetafield.php b/src/Models/CreateMetafield.php index fc913db..b727584 100644 --- a/src/Models/CreateMetafield.php +++ b/src/Models/CreateMetafield.php @@ -77,10 +77,8 @@ public function setScope(?MetafieldScope $scope): void /** * Returns Input Type. - * Indicates how data should be added to the metafield. For example, a text type is just a string, so a - * given metafield of this type can have any value attached. On the other hand, dropdown and radio have - * a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults - * to 'text' + * Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio + * metafields have a set of values that can be selected. Defaults to 'text'. */ public function getInputType(): ?string { @@ -89,10 +87,8 @@ public function getInputType(): ?string /** * Sets Input Type. - * Indicates how data should be added to the metafield. For example, a text type is just a string, so a - * given metafield of this type can have any value attached. On the other hand, dropdown and radio have - * a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults - * to 'text' + * Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio + * metafields have a set of values that can be selected. Defaults to 'text'. * * @maps input_type * @factory \AdvancedBillingLib\Models\MetafieldInput::checkValue diff --git a/src/Models/CreateOrUpdateProduct.php b/src/Models/CreateOrUpdateProduct.php index 449cd17..98d4f19 100644 --- a/src/Models/CreateOrUpdateProduct.php +++ b/src/Models/CreateOrUpdateProduct.php @@ -71,9 +71,9 @@ class CreateOrUpdateProduct implements \JsonSerializable private $trialIntervalUnit = []; /** - * @var string|null + * @var array */ - private $trialType; + private $trialType = []; /** * @var int|null @@ -201,7 +201,7 @@ public function setAccountingCode(?string $accountingCode): void /** * Returns Require Credit Card. * Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page - * users, please read this attribute from under the signup page. + * users, read this attribute from under the signup page. */ public function getRequireCreditCard(): ?bool { @@ -211,7 +211,7 @@ public function getRequireCreditCard(): ?bool /** * Sets Require Credit Card. * Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page - * users, please read this attribute from under the signup page. + * users, read this attribute from under the signup page. * * @maps require_credit_card */ @@ -363,20 +363,44 @@ public function unsetTrialIntervalUnit(): void /** * Returns Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. */ public function getTrialType(): ?string { - return $this->trialType; + if (count($this->trialType) == 0) { + return null; + } + return $this->trialType['value']; } /** * Sets Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. * * @maps trial_type + * @factory \AdvancedBillingLib\Models\TrialType::checkValue */ public function setTrialType(?string $trialType): void { - $this->trialType = $trialType; + $this->trialType['value'] = $trialType; + } + + /** + * Unsets Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. + */ + public function unsetTrialType(): void + { + $this->trialType = []; } /** @@ -455,7 +479,7 @@ public function setAutoCreateSignupPage(?bool $autoCreateSignupPage): void /** * Returns Tax Code. * 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. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function getTaxCode(): ?string { @@ -465,7 +489,7 @@ public function getTaxCode(): ?string /** * Sets Tax Code. * 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. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. * * @maps tax_code */ @@ -495,7 +519,7 @@ public function __toString(): string 'trialPriceInCents' => $this->trialPriceInCents, 'trialInterval' => $this->trialInterval, 'trialIntervalUnit' => $this->getTrialIntervalUnit(), - 'trialType' => $this->trialType, + 'trialType' => $this->getTrialType(), 'expirationInterval' => $this->expirationInterval, 'expirationIntervalUnit' => $this->getExpirationIntervalUnit(), 'autoCreateSignupPage' => $this->autoCreateSignupPage, @@ -568,8 +592,8 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->trialIntervalUnit)) { $json['trial_interval_unit'] = IntervalUnit::checkValue($this->trialIntervalUnit['value']); } - if (isset($this->trialType)) { - $json['trial_type'] = $this->trialType; + if (!empty($this->trialType)) { + $json['trial_type'] = TrialType::checkValue($this->trialType['value']); } if (isset($this->expirationInterval)) { $json['expiration_interval'] = $this->expirationInterval; diff --git a/src/Models/CreatePaymentProfile.php b/src/Models/CreatePaymentProfile.php index a649bf8..a970322 100644 --- a/src/Models/CreatePaymentProfile.php +++ b/src/Models/CreatePaymentProfile.php @@ -177,7 +177,7 @@ class CreatePaymentProfile implements \JsonSerializable /** * Returns Chargify Token. - * Token received after sending billing informations using chargify.js. + * Token received after sending billing information using chargify.js. */ public function getChargifyToken(): ?string { @@ -186,7 +186,7 @@ public function getChargifyToken(): ?string /** * Sets Chargify Token. - * Token received after sending billing informations using chargify.js. + * Token received after sending billing information using chargify.js. * * @maps chargify_token */ @@ -489,8 +489,8 @@ public function setBillingState(?string $billingState): void * Returns Billing Country. * The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en. * wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to - * the payment gateway. Some gateways require country codes in a specific format. Please check your - * gateway’s documentation. If creating an ACH subscription, only US is supported at this time. + * the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s + * documentation. If creating an ACH subscription, only US is supported at this time. */ public function getBillingCountry(): ?string { @@ -501,8 +501,8 @@ public function getBillingCountry(): ?string * Sets Billing Country. * The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en. * wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to - * the payment gateway. Some gateways require country codes in a specific format. Please check your - * gateway’s documentation. If creating an ACH subscription, only US is supported at this time. + * the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s + * documentation. If creating an ACH subscription, only US is supported at this time. * * @maps billing_country */ diff --git a/src/Models/CreateProductPricePoint.php b/src/Models/CreateProductPricePoint.php index 7585106..5c20f2f 100644 --- a/src/Models/CreateProductPricePoint.php +++ b/src/Models/CreateProductPricePoint.php @@ -56,9 +56,9 @@ class CreateProductPricePoint implements \JsonSerializable private $trialIntervalUnit; /** - * @var string|null + * @var array */ - private $trialType; + private $trialType = []; /** * @var int|null @@ -271,20 +271,44 @@ public function setTrialIntervalUnit(?string $trialIntervalUnit): void /** * Returns Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. */ public function getTrialType(): ?string { - return $this->trialType; + if (count($this->trialType) == 0) { + return null; + } + return $this->trialType['value']; } /** * Sets Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. * * @maps trial_type + * @factory \AdvancedBillingLib\Models\TrialType::checkValue */ public function setTrialType(?string $trialType): void { - $this->trialType = $trialType; + $this->trialType['value'] = $trialType; + } + + /** + * Unsets Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. + */ + public function unsetTrialType(): void + { + $this->trialType = []; } /** @@ -423,7 +447,7 @@ public function __toString(): string 'trialPriceInCents' => $this->trialPriceInCents, 'trialInterval' => $this->trialInterval, 'trialIntervalUnit' => $this->trialIntervalUnit, - 'trialType' => $this->trialType, + 'trialType' => $this->getTrialType(), 'initialChargeInCents' => $this->initialChargeInCents, 'initialChargeAfterTrial' => $this->initialChargeAfterTrial, 'expirationInterval' => $this->expirationInterval, @@ -490,8 +514,8 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->trialIntervalUnit)) { $json['trial_interval_unit'] = IntervalUnit::checkValue($this->trialIntervalUnit); } - if (isset($this->trialType)) { - $json['trial_type'] = $this->trialType; + if (!empty($this->trialType)) { + $json['trial_type'] = TrialType::checkValue($this->trialType['value']); } if (isset($this->initialChargeInCents)) { $json['initial_charge_in_cents'] = $this->initialChargeInCents; diff --git a/src/Models/CreateUsage.php b/src/Models/CreateUsage.php index 3e160eb..f7083f7 100644 --- a/src/Models/CreateUsage.php +++ b/src/Models/CreateUsage.php @@ -35,6 +35,11 @@ class CreateUsage implements \JsonSerializable */ private $billingSchedule; + /** + * @var ComponentCustomPrice|null + */ + private $customPrice; + /** * Returns Quantity. * integer by default or decimal number if fractional quantities are enabled for the component @@ -94,8 +99,7 @@ public function setMemo(?string $memo): void /** * Returns Billing Schedule. * This attribute is particularly useful when you need to align billing events for different components - * on distinct schedules within a subscription. Please note this only works for site with - * Multifrequency enabled + * on distinct schedules within a subscription. This only works for site with Multifrequency enabled. */ public function getBillingSchedule(): ?BillingSchedule { @@ -105,8 +109,7 @@ public function getBillingSchedule(): ?BillingSchedule /** * Sets Billing Schedule. * This attribute is particularly useful when you need to align billing events for different components - * on distinct schedules within a subscription. Please note this only works for site with - * Multifrequency enabled + * on distinct schedules within a subscription. This only works for site with Multifrequency enabled. * * @maps billing_schedule */ @@ -115,6 +118,26 @@ public function setBillingSchedule(?BillingSchedule $billingSchedule): void $this->billingSchedule = $billingSchedule; } + /** + * Returns Custom Price. + * Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. + */ + public function getCustomPrice(): ?ComponentCustomPrice + { + return $this->customPrice; + } + + /** + * Sets Custom Price. + * Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. + * + * @maps custom_price + */ + public function setCustomPrice(?ComponentCustomPrice $customPrice): void + { + $this->customPrice = $customPrice; + } + /** * Converts the CreateUsage object to a human-readable string representation. * @@ -129,6 +152,7 @@ public function __toString(): string 'pricePointId' => $this->pricePointId, 'memo' => $this->memo, 'billingSchedule' => $this->billingSchedule, + 'customPrice' => $this->customPrice, 'additionalProperties' => $this->additionalProperties ] ); @@ -186,6 +210,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->billingSchedule)) { $json['billing_schedule'] = $this->billingSchedule; } + if (isset($this->customPrice)) { + $json['custom_price'] = $this->customPrice; + } $json = array_merge($json, $this->additionalProperties); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; diff --git a/src/Models/EBBComponent.php b/src/Models/EBBComponent.php index 7b9a0dc..14222fb 100644 --- a/src/Models/EBBComponent.php +++ b/src/Models/EBBComponent.php @@ -315,7 +315,7 @@ public function setUnitPrice($unitPrice): void /** * Returns Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function getTaxCode(): ?string { @@ -325,7 +325,7 @@ public function getTaxCode(): ?string /** * Sets Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. * * @maps tax_code */ diff --git a/src/Models/ListCouponsFilter.php b/src/Models/ListCouponsFilter.php index e97c75e..bf347e2 100644 --- a/src/Models/ListCouponsFilter.php +++ b/src/Models/ListCouponsFilter.php @@ -56,6 +56,11 @@ class ListCouponsFilter implements \JsonSerializable */ private $useSiteExchangeRate; + /** + * @var bool|null + */ + private $includeArchived; + /** * Returns Date Field. * The type of filter you would like to apply to your search. Use in query @@ -235,8 +240,11 @@ public function setCodes(?array $codes): void /** * Returns Use Site Exchange Rate. - * Allows fetching coupons with matching use_site_exchange_rate based on provided value. Use in query - * `filter[use_site_exchange_rate]=true`. + * If true, restricts the list to coupons whose pricing is recalculated from the site’s current + * exchange rates, so their currency_prices array contains on-the-fly conversions rather than stored + * price records. If false, restricts the list to coupons that have manually defined amounts for each + * currency, ensuring the response includes the saved currency_prices entries instead of exchange-rate- + * derived values. Use in query `filter[use_site_exchange_rate]=true`. */ public function getUseSiteExchangeRate(): ?bool { @@ -245,8 +253,11 @@ public function getUseSiteExchangeRate(): ?bool /** * Sets Use Site Exchange Rate. - * Allows fetching coupons with matching use_site_exchange_rate based on provided value. Use in query - * `filter[use_site_exchange_rate]=true`. + * If true, restricts the list to coupons whose pricing is recalculated from the site’s current + * exchange rates, so their currency_prices array contains on-the-fly conversions rather than stored + * price records. If false, restricts the list to coupons that have manually defined amounts for each + * currency, ensuring the response includes the saved currency_prices entries instead of exchange-rate- + * derived values. Use in query `filter[use_site_exchange_rate]=true`. * * @maps use_site_exchange_rate */ @@ -255,6 +266,26 @@ public function setUseSiteExchangeRate(?bool $useSiteExchangeRate): void $this->useSiteExchangeRate = $useSiteExchangeRate; } + /** + * Returns Include Archived. + * Controls returning archived coupons. + */ + public function getIncludeArchived(): ?bool + { + return $this->includeArchived; + } + + /** + * Sets Include Archived. + * Controls returning archived coupons. + * + * @maps include_archived + */ + public function setIncludeArchived(?bool $includeArchived): void + { + $this->includeArchived = $includeArchived; + } + /** * Converts the ListCouponsFilter object to a human-readable string representation. * @@ -273,6 +304,7 @@ public function __toString(): string 'ids' => $this->ids, 'codes' => $this->codes, 'useSiteExchangeRate' => $this->useSiteExchangeRate, + 'includeArchived' => $this->includeArchived, 'additionalProperties' => $this->additionalProperties ] ); @@ -342,6 +374,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->useSiteExchangeRate)) { $json['use_site_exchange_rate'] = $this->useSiteExchangeRate; } + if (isset($this->includeArchived)) { + $json['include_archived'] = $this->includeArchived; + } $json = array_merge($json, $this->additionalProperties); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; diff --git a/src/Models/Metafield.php b/src/Models/Metafield.php index 04116e5..1ba5039 100644 --- a/src/Models/Metafield.php +++ b/src/Models/Metafield.php @@ -105,7 +105,7 @@ public function setScope(?MetafieldScope $scope): void /** * Returns Data Count. - * the amount of subscriptions this metafield has been applied to in Chargify + * The amount of subscriptions this metafield has been applied to in Advanced Billing. */ public function getDataCount(): ?int { @@ -114,7 +114,7 @@ public function getDataCount(): ?int /** * Sets Data Count. - * the amount of subscriptions this metafield has been applied to in Chargify + * The amount of subscriptions this metafield has been applied to in Advanced Billing. * * @maps data_count */ @@ -125,10 +125,8 @@ public function setDataCount(?int $dataCount): void /** * Returns Input Type. - * Indicates how data should be added to the metafield. For example, a text type is just a string, so a - * given metafield of this type can have any value attached. On the other hand, dropdown and radio have - * a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults - * to 'text' + * Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio + * metafields have a set of values that can be selected. Defaults to 'text'. */ public function getInputType(): ?string { @@ -137,10 +135,8 @@ public function getInputType(): ?string /** * Sets Input Type. - * Indicates how data should be added to the metafield. For example, a text type is just a string, so a - * given metafield of this type can have any value attached. On the other hand, dropdown and radio have - * a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults - * to 'text' + * Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio + * metafields have a set of values that can be selected. Defaults to 'text'. * * @maps input_type * @factory \AdvancedBillingLib\Models\MetafieldInput::checkValue diff --git a/src/Models/MetafieldInput.php b/src/Models/MetafieldInput.php index b3241de..7943d13 100644 --- a/src/Models/MetafieldInput.php +++ b/src/Models/MetafieldInput.php @@ -15,10 +15,8 @@ use stdClass; /** - * Indicates how data should be added to the metafield. For example, a text type is just a string, so a - * given metafield of this type can have any value attached. On the other hand, dropdown and radio have - * a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults - * to 'text' + * Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio + * metafields have a set of values that can be selected. Defaults to 'text'. */ class MetafieldInput { diff --git a/src/Models/MetafieldScope.php b/src/Models/MetafieldScope.php index 4509a0b..c4ffbbc 100644 --- a/src/Models/MetafieldScope.php +++ b/src/Models/MetafieldScope.php @@ -140,7 +140,8 @@ public function setPortal(?string $portal): void /** * Returns Public Show. - * Include (1) or exclude (0) metafields from being viewable by your ecosystem. + * Include (1) or exclude (0) metafields used in [Embeddable Components](page:development- + * tools/embeddable-components/overview) from being viewable by your ecosystem. */ public function getPublicShow(): ?string { @@ -149,7 +150,8 @@ public function getPublicShow(): ?string /** * Sets Public Show. - * Include (1) or exclude (0) metafields from being viewable by your ecosystem. + * Include (1) or exclude (0) metafields used in [Embeddable Components](page:development- + * tools/embeddable-components/overview) from being viewable by your ecosystem. * * @maps public_show * @factory \AdvancedBillingLib\Models\IncludeOption::checkValue @@ -161,7 +163,8 @@ public function setPublicShow(?string $publicShow): void /** * Returns Public Edit. - * Include (1) or exclude (0) metafields from being edited by your ecosystem. + * Include (1) or exclude (0) metafields used in [Embeddable Components](page:development- + * tools/embeddable-components/overview) from being editable by your ecosystem. */ public function getPublicEdit(): ?string { @@ -170,7 +173,8 @@ public function getPublicEdit(): ?string /** * Sets Public Edit. - * Include (1) or exclude (0) metafields from being edited by your ecosystem. + * Include (1) or exclude (0) metafields used in [Embeddable Components](page:development- + * tools/embeddable-components/overview) from being editable by your ecosystem. * * @maps public_edit * @factory \AdvancedBillingLib\Models\IncludeOption::checkValue diff --git a/src/Models/MeteredComponent.php b/src/Models/MeteredComponent.php index 029362a..ae86188 100644 --- a/src/Models/MeteredComponent.php +++ b/src/Models/MeteredComponent.php @@ -325,7 +325,7 @@ public function setUnitPrice($unitPrice): void /** * Returns Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function getTaxCode(): ?string { @@ -335,7 +335,7 @@ public function getTaxCode(): ?string /** * Sets Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. * * @maps tax_code */ diff --git a/src/Models/OnOffComponent.php b/src/Models/OnOffComponent.php index 3c2c771..020e04e 100644 --- a/src/Models/OnOffComponent.php +++ b/src/Models/OnOffComponent.php @@ -318,7 +318,7 @@ public function setUnitPrice($unitPrice): void /** * Returns Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function getTaxCode(): ?string { @@ -328,7 +328,7 @@ public function getTaxCode(): ?string /** * Sets Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. * * @maps tax_code */ diff --git a/src/Models/PaymentProfileAttributes.php b/src/Models/PaymentProfileAttributes.php index 0b21d20..74c3141 100644 --- a/src/Models/PaymentProfileAttributes.php +++ b/src/Models/PaymentProfileAttributes.php @@ -472,7 +472,7 @@ public function setBillingState(?string $billingState): void * (Optional, may be required by your product configuration or gateway settings) The credit card or * bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia. * org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment - * gateway. Some gateways require country codes in a specific format. Please check your gateway’s + * gateway. Some gateways require country codes in a specific format. Check your gateway’s * documentation. If creating an ACH subscription, only US is supported at this time. */ public function getBillingCountry(): ?string @@ -485,7 +485,7 @@ public function getBillingCountry(): ?string * (Optional, may be required by your product configuration or gateway settings) The credit card or * bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia. * org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment - * gateway. Some gateways require country codes in a specific format. Please check your gateway’s + * gateway. Some gateways require country codes in a specific format. Check your gateway’s * documentation. If creating an ACH subscription, only US is supported at this time. * * @maps billing_country diff --git a/src/Models/PrepaidUsageComponent.php b/src/Models/PrepaidUsageComponent.php index 64da37c..dc576ab 100644 --- a/src/Models/PrepaidUsageComponent.php +++ b/src/Models/PrepaidUsageComponent.php @@ -430,7 +430,7 @@ public function setUnitPrice($unitPrice): void /** * Returns Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function getTaxCode(): ?string { @@ -440,7 +440,7 @@ public function getTaxCode(): ?string /** * Sets Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. * * @maps tax_code */ diff --git a/src/Models/Product.php b/src/Models/Product.php index 5b9ab78..29bc43d 100644 --- a/src/Models/Product.php +++ b/src/Models/Product.php @@ -338,7 +338,7 @@ public function unsetAccountingCode(): void /** * Returns Request Credit Card. * Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page - * users, please read this attribute from under the signup page. + * users, read this attribute from under the signup page. */ public function getRequestCreditCard(): ?bool { @@ -348,7 +348,7 @@ public function getRequestCreditCard(): ?bool /** * Sets Request Credit Card. * Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page - * users, please read this attribute from under the signup page. + * users, read this attribute from under the signup page. * * @maps request_credit_card */ @@ -1014,7 +1014,7 @@ public function setRequireShippingAddress(?bool $requireShippingAddress): void /** * Returns Tax Code. * 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. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function getTaxCode(): ?string { @@ -1027,7 +1027,7 @@ public function getTaxCode(): ?string /** * Sets Tax Code. * 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. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. * * @maps tax_code */ @@ -1039,7 +1039,7 @@ public function setTaxCode(?string $taxCode): void /** * Unsets Tax Code. * 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. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function unsetTaxCode(): void { diff --git a/src/Models/ProductPricePoint.php b/src/Models/ProductPricePoint.php index a0e3b15..84a097d 100644 --- a/src/Models/ProductPricePoint.php +++ b/src/Models/ProductPricePoint.php @@ -62,9 +62,9 @@ class ProductPricePoint implements \JsonSerializable private $trialIntervalUnit = []; /** - * @var string|null + * @var array */ - private $trialType; + private $trialType = []; /** * @var array @@ -371,20 +371,44 @@ public function unsetTrialIntervalUnit(): void /** * Returns Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. */ public function getTrialType(): ?string { - return $this->trialType; + if (count($this->trialType) == 0) { + return null; + } + return $this->trialType['value']; } /** * Sets Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. * * @maps trial_type + * @factory \AdvancedBillingLib\Models\TrialType::checkValue */ public function setTrialType(?string $trialType): void { - $this->trialType = $trialType; + $this->trialType['value'] = $trialType; + } + + /** + * Unsets Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. + */ + public function unsetTrialType(): void + { + $this->trialType = []; } /** @@ -788,7 +812,7 @@ public function __toString(): string 'trialPriceInCents' => $this->getTrialPriceInCents(), 'trialInterval' => $this->getTrialInterval(), 'trialIntervalUnit' => $this->getTrialIntervalUnit(), - 'trialType' => $this->trialType, + 'trialType' => $this->getTrialType(), 'introductoryOffer' => $this->getIntroductoryOffer(), 'initialChargeInCents' => $this->getInitialChargeInCents(), 'initialChargeAfterTrial' => $this->getInitialChargeAfterTrial(), @@ -875,8 +899,8 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->trialIntervalUnit)) { $json['trial_interval_unit'] = IntervalUnit::checkValue($this->trialIntervalUnit['value']); } - if (isset($this->trialType)) { - $json['trial_type'] = $this->trialType; + if (!empty($this->trialType)) { + $json['trial_type'] = TrialType::checkValue($this->trialType['value']); } if (!empty($this->introductoryOffer)) { $json['introductory_offer'] = $this->introductoryOffer['value']; diff --git a/src/Models/QuantityBasedComponent.php b/src/Models/QuantityBasedComponent.php index bead60a..00e2ec0 100644 --- a/src/Models/QuantityBasedComponent.php +++ b/src/Models/QuantityBasedComponent.php @@ -418,7 +418,7 @@ public function setUnitPrice($unitPrice): void /** * Returns Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ public function getTaxCode(): ?string { @@ -428,7 +428,7 @@ public function getTaxCode(): ?string /** * Sets Tax Code. * A string representing the tax code related to the component type. This is especially important when - * using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + * using AvaTax to tax based on locale. This attribute has a max length of 25 characters. * * @maps tax_code */ diff --git a/src/Models/ResumeOptions.php b/src/Models/ResumeOptions.php index 585a46a..95faaf9 100644 --- a/src/Models/ResumeOptions.php +++ b/src/Models/ResumeOptions.php @@ -28,7 +28,7 @@ class ResumeOptions implements \JsonSerializable /** * Returns Require Resume. * Chargify will only attempt to resume the subscription's billing period. If not resumable, the - * subscription will be left in it's current state. + * subscription will be left in its current state. */ public function getRequireResume(): ?bool { @@ -38,7 +38,7 @@ public function getRequireResume(): ?bool /** * Sets Require Resume. * Chargify will only attempt to resume the subscription's billing period. If not resumable, the - * subscription will be left in it's current state. + * subscription will be left in its current state. * * @maps require_resume */ diff --git a/src/Models/SnapDay.php b/src/Models/SnapDay.php index 4e50e64..4887c77 100644 --- a/src/Models/SnapDay.php +++ b/src/Models/SnapDay.php @@ -14,9 +14,6 @@ use Exception; use stdClass; -/** - * Use for subscriptions with product eligible for calendar billing only. Value can be 1-28 or 'end'. - */ class SnapDay { public const END = 'end'; @@ -26,18 +23,35 @@ class SnapDay /** * Ensures that all the given values are present in this Enum. * - * @param array|stdClass|null|string $value Value or a list/map of values to be checked + * @param array|stdClass|null|string|int $value Value or a list/map of values to be checked * - * @return array|null|string Input value(s), if all are a part of this Enum + * @return array|null|string|int Input value(s), if all are a part of this Enum * * @throws Exception Throws exception if any given value is not in this Enum */ public static function checkValue($value) { $value = json_decode(json_encode($value), true); // converts stdClass into array + + // If value is a numeric string (1-28), convert it to an integer + // This handles cases where the API returns numeric snap_day as a string + if (is_string($value) && is_numeric($value)) { + $numericValue = (int)$value; + if ($numericValue >= 1 && $numericValue <= 28) { + return $numericValue; + } + } + + // Check if it's a valid enum value (e.g., "end") if (CoreHelper::checkValueOrValuesInList($value, self::_ALL_VALUES)) { return $value; } + + // For integer values (1-28), pass them through + if (is_int($value) && $value >= 1 && $value <= 28) { + return $value; + } + throw new Exception("$value is invalid for SnapDay."); } } diff --git a/src/Models/Subscription.php b/src/Models/Subscription.php index e5df6fb..058f5b9 100644 --- a/src/Models/Subscription.php +++ b/src/Models/Subscription.php @@ -1117,8 +1117,10 @@ public function unsetCouponCode(): void /** * Returns Snap Day. * The day of the month that the subscription will charge according to calendar billing rules, if used. + * + * @return int|string|null */ - public function getSnapDay(): ?string + public function getSnapDay() { if (count($this->snapDay) == 0) { return null; @@ -1131,8 +1133,12 @@ public function getSnapDay(): ?string * The day of the month that the subscription will charge according to calendar billing rules, if used. * * @maps snap_day + * @mapsBy anyOf(oneOf(int,SnapDay),null) + * @factory \AdvancedBillingLib\Models\SnapDay::checkValue SnapDay + * + * @param int|string|null $snapDay */ - public function setSnapDay(?string $snapDay): void + public function setSnapDay($snapDay): void { $this->snapDay['value'] = $snapDay; } @@ -1634,8 +1640,8 @@ public function unsetPayerId(): void /** * Returns Current Billing Amount in Cents. - * The balance in cents plus the estimated renewal amount in cents. Returned ONLY for readSubscription - * operation as it's compute intensive operation. + * The balance in cents plus the estimated renewal amount in cents. Returned ONLY for the + * readSubscription operation as it's a compute intensive operation. */ public function getCurrentBillingAmountInCents(): ?int { @@ -1644,8 +1650,8 @@ public function getCurrentBillingAmountInCents(): ?int /** * Sets Current Billing Amount in Cents. - * The balance in cents plus the estimated renewal amount in cents. Returned ONLY for readSubscription - * operation as it's compute intensive operation. + * The balance in cents plus the estimated renewal amount in cents. Returned ONLY for the + * readSubscription operation as it's a compute intensive operation. * * @maps current_billing_amount_in_cents */ @@ -2389,7 +2395,14 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) $json['coupon_code'] = $this->couponCode['value']; } if (!empty($this->snapDay)) { - $json['snap_day'] = $this->snapDay['value']; + $json['snap_day'] = + ApiHelper::getJsonHelper()->verifyTypes( + $this->snapDay['value'], + 'anyOf(oneOf(int,SnapDay),null)', + [ + '\AdvancedBillingLib\Models\SnapDay::checkValue SnapDay' + ] + ); } if (isset($this->paymentCollectionMethod)) { $json['payment_collection_method'] = diff --git a/src/Models/SubscriptionCustomPrice.php b/src/Models/SubscriptionCustomPrice.php index 6b80d3b..a6ab6a3 100644 --- a/src/Models/SubscriptionCustomPrice.php +++ b/src/Models/SubscriptionCustomPrice.php @@ -59,6 +59,11 @@ class SubscriptionCustomPrice implements \JsonSerializable */ private $trialIntervalUnit; + /** + * @var array + */ + private $trialType = []; + /** * @var string|int|null */ @@ -278,6 +283,48 @@ public function setTrialIntervalUnit(?string $trialIntervalUnit): void $this->trialIntervalUnit = $trialIntervalUnit; } + /** + * Returns Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. + */ + public function getTrialType(): ?string + { + if (count($this->trialType) == 0) { + return null; + } + return $this->trialType['value']; + } + + /** + * Sets Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. + * + * @maps trial_type + * @factory \AdvancedBillingLib\Models\TrialType::checkValue + */ + public function setTrialType(?string $trialType): void + { + $this->trialType['value'] = $trialType; + } + + /** + * Unsets Trial Type. + * Indicates how a trial is handled when the trail period ends and there is no credit card on file. For + * `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails + * or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will + * send normal dunning emails and statements according to your other settings. + */ + public function unsetTrialType(): void + { + $this->trialType = []; + } + /** * Returns Initial Charge in Cents. * (Optional) @@ -419,6 +466,7 @@ public function __toString(): string 'trialPriceInCents' => $this->trialPriceInCents, 'trialInterval' => $this->trialInterval, 'trialIntervalUnit' => $this->trialIntervalUnit, + 'trialType' => $this->getTrialType(), 'initialChargeInCents' => $this->initialChargeInCents, 'initialChargeAfterTrial' => $this->initialChargeAfterTrial, 'expirationInterval' => $this->expirationInterval, @@ -503,6 +551,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->trialIntervalUnit)) { $json['trial_interval_unit'] = IntervalUnit::checkValue($this->trialIntervalUnit); } + if (!empty($this->trialType)) { + $json['trial_type'] = TrialType::checkValue($this->trialType['value']); + } if (isset($this->initialChargeInCents)) { $json['initial_charge_in_cents'] = ApiHelper::getJsonHelper()->verifyTypes( diff --git a/src/Models/TrialType.php b/src/Models/TrialType.php new file mode 100644 index 0000000..174245f --- /dev/null +++ b/src/Models/TrialType.php @@ -0,0 +1,48 @@ +snapDay; + if (count($this->snapDay) == 0) { + return null; + } + return $this->snapDay['value']; } /** @@ -256,14 +259,23 @@ public function getSnapDay() * Use for subscriptions with product eligible for calendar billing only. Value can be 1-28 or 'end'. * * @maps snap_day - * @mapsBy anyOf(oneOf(SnapDay,int),null) + * @mapsBy anyOf(oneOf(int,SnapDay),null) * @factory \AdvancedBillingLib\Models\SnapDay::checkValue SnapDay * - * @param string|int|null $snapDay + * @param int|string|null $snapDay */ public function setSnapDay($snapDay): void { - $this->snapDay = $snapDay; + $this->snapDay['value'] = $snapDay; + } + + /** + * Unsets Snap Day. + * Use for subscriptions with product eligible for calendar billing only. Value can be 1-28 or 'end'. + */ + public function unsetSnapDay(): void + { + $this->snapDay = []; } /** @@ -632,7 +644,7 @@ public function __toString(): string 'productChangeDelayed' => $this->productChangeDelayed, 'nextProductId' => $this->nextProductId, 'nextProductPricePointId' => $this->nextProductPricePointId, - 'snapDay' => $this->snapDay, + 'snapDay' => $this->getSnapDay(), 'initialBillingAt' => $this->initialBillingAt, 'deferSignup' => $this->deferSignup, 'nextBillingAt' => $this->nextBillingAt, @@ -711,11 +723,11 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->nextProductPricePointId)) { $json['next_product_price_point_id'] = $this->nextProductPricePointId; } - if (isset($this->snapDay)) { + if (!empty($this->snapDay)) { $json['snap_day'] = ApiHelper::getJsonHelper()->verifyTypes( - $this->snapDay, - 'anyOf(oneOf(SnapDay,int),null)', + $this->snapDay['value'], + 'anyOf(oneOf(int,SnapDay),null)', [ '\AdvancedBillingLib\Models\SnapDay::checkValue SnapDay' ] diff --git a/tests/Controllers/PaymentProfilesControllerTest.php b/tests/Controllers/PaymentProfilesControllerTest.php index f6e7c94..035c7e4 100644 --- a/tests/Controllers/PaymentProfilesControllerTest.php +++ b/tests/Controllers/PaymentProfilesControllerTest.php @@ -48,6 +48,9 @@ public function test_CreatePaymentProfile_ShouldCreatePaymentProfile_WhenCustome public function test_ListPaymentProfiles_ShouldReturnEmptyList_WhenCustomerDoesNotHaveAnyPaymentProfile(): void { $customer = $this->testData->loadCustomer(); + + // Clean up any existing payment profiles for this customer + $this->cleaner->removeAllPaymentProfilesForCustomer($customer->getId()); $paymentProfiles = $this->client ->getPaymentProfilesController() @@ -64,6 +67,10 @@ public function test_ListPaymentProfiles_ShouldReturnEmptyList_WhenCustomerDoesN public function test_ListPaymentProfiles_ShouldReturnListWithPaymentProfiles_WhenCustomerHasOneProfile(): void { $customer = $this->testData->loadCustomer(); + + // Clean up any existing payment profiles for this customer + $this->cleaner->removeAllPaymentProfilesForCustomer($customer->getId()); + $creditCardPaymentProfile = $this->testData->loadCreditCardPaymentProfile($customer->getId()); $paymentProfiles = $this->client @@ -120,6 +127,10 @@ public function test_UpdatePaymentProfile_ShouldUpdatePaymentProfile_WhenNewValu public function test_DeleteUnusedPaymentProfile_ShouldRemoveProfile_WhenProfileWasCreated(): void { $customer = $this->testData->loadCustomer(); + + // Clean up any existing payment profiles for this customer + $this->cleaner->removeAllPaymentProfilesForCustomer($customer->getId()); + $creditCardPaymentProfile = $this->testData->loadCreditCardPaymentProfile($customer->getId()); $this->client->getPaymentProfilesController()->deleteUnusedPaymentProfile($creditCardPaymentProfile->getId()); @@ -139,6 +150,10 @@ public function test_DeleteUnusedPaymentProfile_ShouldRemoveProfile_WhenProfileW public function test_DeleteSubscriptionPaymentProfile_ShouldDeleteProfile_WhenProfileBelongsToSubscription(): void { $customer = $this->testData->loadCustomer(); + + // Clean up any existing payment profiles for this customer + $this->cleaner->removeAllPaymentProfilesForCustomer($customer->getId()); + $creditCardPaymentProfile = $this->testData->loadCreditCardPaymentProfile($customer->getId()); $subscription = $this->testData->loadSubscription($customer->getId(), $creditCardPaymentProfile->getId()); diff --git a/tests/Controllers/PaymentProfilesControllerTestAssertions.php b/tests/Controllers/PaymentProfilesControllerTestAssertions.php index ac20b5e..8241dc1 100644 --- a/tests/Controllers/PaymentProfilesControllerTestAssertions.php +++ b/tests/Controllers/PaymentProfilesControllerTestAssertions.php @@ -31,6 +31,9 @@ public function assertPaymentProfileCreated( unset($paymentProfileJson['created_at']); unset($expectedPaymentProfileJson['updated_at']); unset($paymentProfileJson['updated_at']); + + // Remove card_funding_source as it's a new API field not in the test expectations + unset($paymentProfileJson['card_funding_source']); $this->testCase::assertEquals($expectedPaymentProfileJson, $paymentProfileJson); } diff --git a/tests/Controllers/SitesControllerTestAssertions.php b/tests/Controllers/SitesControllerTestAssertions.php index d223441..6e43b75 100644 --- a/tests/Controllers/SitesControllerTestAssertions.php +++ b/tests/Controllers/SitesControllerTestAssertions.php @@ -16,7 +16,10 @@ public function __construct(private SitesControllerTest $testCase) public function assertExpectedSiteDataWereReturned(Site $expectedSite, Site $site): void { - $this->testCase::assertEquals($expectedSite->jsonSerialize(), $site->jsonSerialize()); + $expectedSiteJson = json_decode(json_encode($expectedSite->jsonSerialize()), true); + $siteJson = json_decode(json_encode($site->jsonSerialize()), true); + + $this->testCase::assertEquals($expectedSiteJson, $siteJson); } public function assertUnauthorizedApiExceptionThrown(): void diff --git a/tests/TestCleaner.php b/tests/TestCleaner.php index b75d72e..74996b9 100644 --- a/tests/TestCleaner.php +++ b/tests/TestCleaner.php @@ -35,15 +35,48 @@ public function removeSubscriptionById(int $subscriptionId, int $customerId): vo public function removeUnusedPaymentProfileById(int $paymentProfileId): void { - $this->client->getPaymentProfilesController()->deleteUnusedPaymentProfile($paymentProfileId); + try { + $this->client->getPaymentProfilesController()->deleteUnusedPaymentProfile($paymentProfileId); + } catch (ApiException) { + // Payment profile might already be deleted or in use, ignore + } } public function removeSubscriptionPaymentProfileById(int $subscriptionId, int $paymentProfileId): void { - $this->client->getPaymentProfilesController()->deleteSubscriptionsPaymentProfile( - $subscriptionId, - $paymentProfileId - ); + try { + $this->client->getPaymentProfilesController()->deleteSubscriptionsPaymentProfile( + $subscriptionId, + $paymentProfileId + ); + } catch (ApiException) { + // Payment profile might already be deleted, try as unused profile + try { + $this->client->getPaymentProfilesController()->deleteUnusedPaymentProfile($paymentProfileId); + } catch (ApiException) { + // Ignore if still fails + } + } + } + + public function removeAllPaymentProfilesForCustomer(int $customerId): void + { + try { + $paymentProfiles = $this->client->getPaymentProfilesController()->listPaymentProfiles([ + 'customer_id' => $customerId + ]); + + foreach ($paymentProfiles as $profileResponse) { + $profile = $profileResponse->getPaymentProfile(); + try { + $this->client->getPaymentProfilesController()->deleteUnusedPaymentProfile($profile->getId()); + } catch (ApiException) { + // Ignore if deletion fails + } + } + } catch (ApiException) { + // Ignore if listing fails + } } public function removeMetafield(string $resourceType, string $name): void diff --git a/tests/TestFactory/TestSiteFactory.php b/tests/TestFactory/TestSiteFactory.php index a0a1d11..d931c29 100644 --- a/tests/TestFactory/TestSiteFactory.php +++ b/tests/TestFactory/TestSiteFactory.php @@ -83,6 +83,7 @@ private function createDefaultNetTerms(): NetTerms ->remittanceNetTerms(TestSiteData::REMITTANCE_NET_TERMS) ->netTermsOnRemittanceSignupsEnabled(TestSiteData::ON_REMITTANCE_SIGNUPS_ENABLED) ->customNetTermsEnabled(TestSiteData::CUSTOM_NET_TERMS_ENABLED) + ->additionalProperty('net_terms_on_automatic_signups_enabled', false) ->build(); } }