diff --git a/plugins/stripe-php/.gitignore b/plugins/stripe-php/.gitignore index 880465ac..2049c207 100644 --- a/plugins/stripe-php/.gitignore +++ b/plugins/stripe-php/.gitignore @@ -13,9 +13,6 @@ build/* # If the vendor directory isn't being commited the composer.lock file should also be ignored composer.lock -# Ignore PHPUnit coverage file -clover.xml - # Ignore IDE's configuration files .idea diff --git a/plugins/stripe-php/CHANGELOG.md b/plugins/stripe-php/CHANGELOG.md index ace08d25..babf0e9e 100644 --- a/plugins/stripe-php/CHANGELOG.md +++ b/plugins/stripe-php/CHANGELOG.md @@ -1,8 +1,137 @@ # Changelog +## 17.2.1 - 2025-05-19 +* [#1869](https://github.com/stripe/stripe-php/pull/1869) Fixed type of map parameters(eg. metadata, currency_options) from `StripeObject` to `array` in all methods. +* [#1866](https://github.com/stripe/stripe-php/pull/1866) Adds CONTRIBUTING.md + +## 17.2.0 - 2025-04-30 + + This release changes the pinned API version to `2025-04-30.basil`. + +* [#1839](https://github.com/stripe/stripe-php/pull/1839) Update generated code + * Add support for new value `tax_id_prohibited` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code` + * Add support for `wallet_options` on `Checkout.Session` + * Add support for `context` on `Event` + * Add support for new values `aw_tin`, `az_tin`, `bd_bin`, `bf_ifu`, `bj_ifu`, `cm_niu`, `cv_nif`, `et_tin`, `kg_tin`, and `la_tin` on enums `Invoice.customer_tax_ids[].type` and `TaxId.type` + * Add support for new value `affirm` on enums `Invoice.payment_settings.payment_method_types` and `Subscription.payment_settings.payment_method_types` + * Add support for `pix` on `PaymentMethodConfiguration` + * Add support for `klarna` on `PaymentMethodDomain` + * Add support for `us_cfpb_data` on `Person` + * Add support for `pending_reason` on `Refund` + * Change type of `Tax.CalculationLineItem.reference` from `nullable(string)` to `string` +* [#1857](https://github.com/stripe/stripe-php/pull/1857) Include new PHP 8.3 and 8.4 in CI +* [#1856](https://github.com/stripe/stripe-php/pull/1856) Faster parallel runner for PHP formatter + +## 17.1.1 - 2025-04-04 +* [#1847](https://github.com/stripe/stripe-php/pull/1847) Remove stdClass from object shapes + * Remove intersection with `stdClass` in resource properties and fixed `instanceof` checks. + +## 17.1.0 - 2025-04-02 +* [#1843](https://github.com/stripe/stripe-php/pull/1843) Add null type in resource fields to non required objects + * Fixes nullable resource properties that were incorrectly set as required in PHPDocs + +## 17.0.0 - 2025-04-01 +* [#1837](https://github.com/stripe/stripe-php/pull/1837) Better type hints in your editor!! + * Added type hints for method parameters + * PHPStorm IDE with array type hints + * Improved type hints for resource properties that are not primitive types. Take for example, the invoice settings in Customer resource. Previously, you could not reference inner fields like `custom_fields` on `customer->invoice_settings` without PHPStan complaining. This is now fixed. + +* [#1818](https://github.com/stripe/stripe-php/pull/1818) Support for APIs in the new API version 2025-03-31.basil + + This release changes the pinned API version to `2025-03-31.basil`. + + ### ⚠️ Breaking changes due to changes in the Stripe API + + Please review details for the breaking changes and alternatives in the [Stripe API changelog](https://docs.stripe.com/changelog/acacia) before upgrading. + + * Remove support for resources `UsageRecordSummary` and `UsageRecord` + * Remove support for `create` method on resource `UsageRecord` + * Remove support for `all` method on resource `UsageRecordSummary` + * Remove support for `upcomingLines` and `upcoming` methods on resource `Invoice` + * Remove support for `invoice` on `Charge` and `PaymentIntent` + * Remove support for `shipping_details` on `Checkout.Session` + * Remove support for `refund` on `CreditNote` + * Remove support for `tax_amounts` on `CreditNoteLineItem`, `CreditNote`, and `InvoiceLineItem` + * Remove support for `amount_excluding_tax` and `unit_amount_excluding_tax` on `CreditNoteLineItem` and `InvoiceLineItem` + * Remove support for `application_fee_amount`, `charge`, `paid_out_of_band`, `paid`, `payment_intent`, `quote`, `subscription`, `subscription_details`, `subscription_proration_date`, `tax`, `total_tax_amounts`, and `transfer_data` on `Invoice` + * Remove support for `discount` on `Invoice` and `Subscription` + * Remove support for `invoice_item`, `proration_details`, `proration`, `tax_rates`, and `type` on `InvoiceLineItem` + * Remove support for `plan`, `price`, and `subscription_item` on `InvoiceItem` and `InvoiceLineItem` + * Remove support for `subscription`, `unit_amount_decimal`, and `unit_amount` on `InvoiceItem` + * Remove support for `aggregate_usage` on `Plan` + * Remove support for `billing_thresholds` on `SubscriptionItem` and `Subscription` + * Remove support for `current_period_end` and `current_period_start` on `Subscription` + + ### ⚠️ Other Breaking changes in the SDK + * [#1826](https://github.com/stripe/stripe-php/pull/1826) configure max_nextwork_retries at the client level + * Allow setting `maxNetworkRetries` at the `StripeClient` level via a new argument to the `RequestOptions` constructor + * ⚠️ (potentially breaking) a client's configuration for `maxNetworkRetries` is set during client initialization. Subsequent calls to `Stripe::setMaxNetworkRetries()` after client creation **won't** affect that client. + * Allow setting `maxNetworkRetries` per-request via the `max_network_retries` config argument. This works for both the service and resource based patterns. In both cases, an explicitly passed value takes precedence over the global (or client) value. + * [#1835](https://github.com/stripe/stripe-php/pull/1835) Removed the protected method _searchResource as it is no longer used + * ⚠️ Removed `_searchResource` method and `Search` trait. Use the public `search` method on `Charge`, `Customer`, `Invoice`, `PaymentIntent`, `Price`, `Product`, and `Subscription` resource. + * [#1832](https://github.com/stripe/stripe-php/pull/1832) Added requestCollection and requestSearchResult to StripeClientInterface + * ⚠️ Added `requestSearchResult`, `requestCollection` to `StripeClientInterface`. Developers building custom StripeClient will now have to implement these new methods. + * Refer to our implementation in [BaseStripeClient](https://github.com/stripe/stripe-php/blob/f65c497d0bc175aaa04538602fd49645f44f9384/lib/BaseStripeClient.php#L259-L315) for guidance. + + + ### Additions + + * Add support for new resource `InvoicePayment` + * Add support for `all` and `retrieve` methods on resource `InvoicePayment` + * Add support for new values `forwarding_api_retryable_upstream_error` and `setup_intent_mobile_wallet_unsupported` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code` + * Add support for new values `stripe_balance_payment_debit_reversal` and `stripe_balance_payment_debit` on enum `BalanceTransaction.type` + * Add support for new value `last` on enum `Billing.Meter.default_aggregation.formula` + * Add support for `presentment_details` on `Charge`, `Checkout.Session`, `PaymentIntent`, and `Refund` + * Add support for `optional_items` on `Checkout.Session` and `PaymentLink` + * Add support for `permissions` on `Checkout.Session` + * Add support for new value `custom` on enum `Checkout.Session.ui_mode` + * Add support for new values `billie`, `nz_bank_account`, and `satispay` on enums `ConfirmationToken.payment_method_preview.type` and `PaymentMethod.type` + * Add support for `refunds` on `CreditNote` + * Add support for `total_taxes` on `CreditNote` and `Invoice` + * Add support for `taxes` on `CreditNoteLineItem` and `InvoiceLineItem` + * Add support for `checkout_session` on `CustomerBalanceTransaction` + * Add support for new values `checkout_session_subscription_payment_canceled` and `checkout_session_subscription_payment` on enum `CustomerBalanceTransaction.type` + * Add support for new value `invoice.overpaid` on enum `Event.type` + * Add support for `amount_overpaid`, `confirmation_secret`, and `payments` on `Invoice` + * Add support for `parent` on `InvoiceItem`, `InvoiceLineItem`, and `Invoice` + * Add support for new values `klarna` and `nz_bank_account` on enums `Invoice.payment_settings.payment_method_types` and `Subscription.payment_settings.payment_method_types` + * Add support for `pricing` on `InvoiceItem` and `InvoiceLineItem` + * Add support for new value `network_fallback` on enum `Issuing.Authorization.request_history[].reason` + * Add support for new value `expired` on enum `Issuing.Authorization.status` + * Add support for new value `expired` on enum `PaymentIntent.cancellation_reason` + * Add support for new values `billie` and `satispay` on enum `PaymentLink.payment_method_types` + * Add support for `billie`, `nz_bank_account`, and `satispay` on `PaymentMethodConfiguration` and `PaymentMethod` + * Add support for new value `canceled` on enum `Review.closed_reason` + * Add support for `current_period_end` and `current_period_start` on `SubscriptionItem` + * Add support for `wifi` on `Terminal.Configuration` + +## 16.6.0 - 2025-02-24 +* [#1809](https://github.com/stripe/stripe-php/pull/1809) Update generated code + * Add support for `priority` on `Billing.CreditGrant` + * Add support for `collected_information` on `Checkout.Session` +* [#1816](https://github.com/stripe/stripe-php/pull/1816) add codeowners file + +## 16.5.1 - 2025-02-07 +* [#1811](https://github.com/stripe/stripe-php/pull/1811) Include a useful error message when a null byte is found in the URL path +* [#1810](https://github.com/stripe/stripe-php/pull/1810) Make `httpClient()` a public, static method + +## 16.5.0 - 2025-01-27 +* [#1804](https://github.com/stripe/stripe-php/pull/1804) Update generated code + * Add support for `close` method on resource `Treasury.FinancialAccount` + * Add support for `discounts` on `Checkout.Session` + * Add support for new value `pay_by_bank` on enum `PaymentLink.payment_method_types[]` + * Add support for `pay_by_bank` on `PaymentMethodConfiguration` and `PaymentMethod` + * Add support for new value `pay_by_bank` on enum `PaymentMethod.type` + * Add support for `is_default` and `nickname` on `Treasury.FinancialAccount` +* [#1805](https://github.com/stripe/stripe-php/pull/1805) Restore testCoreEventsGet generated test +* [#1807](https://github.com/stripe/stripe-php/pull/1807) minor justfile fixes +* [#1806](https://github.com/stripe/stripe-php/pull/1806) Added CONTRIBUTING.md file +* [#1802](https://github.com/stripe/stripe-php/pull/1802) ensure dependencies are installed for format and test recipes +* [#1801](https://github.com/stripe/stripe-php/pull/1801) Add justfile, remove coveralls, and fix AUTOLOAD in CI +* [#1797](https://github.com/stripe/stripe-php/pull/1797) Added pull request template + ## 16.4.0 - 2024-12-18 * [#1793](https://github.com/stripe/stripe-php/pull/1793) This release changes the pinned API version to `2024-12-18.acacia`. - * Add support for `network_advice_code` and `network_decline_code` on `StripeError` * Add support for new values `payout_minimum_balance_hold` and `payout_minimum_balance_release` on enum `BalanceTransaction.type` * Add support for `allow_redisplay` on `Card` and `Source` * Add support for `regulated_status` on `Card` diff --git a/plugins/stripe-php/CONTRIBUTING.md b/plugins/stripe-php/CONTRIBUTING.md new file mode 100644 index 00000000..d18d5bf2 --- /dev/null +++ b/plugins/stripe-php/CONTRIBUTING.md @@ -0,0 +1,25 @@ + +# Contributing + +We welcome bug reports, feature requests, and code contributions in a pull request. + +For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-php/issues/new/choose). + +## Contributor License Agreement + +All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant. + +## Generated code + +This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution. + +To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`. + +## Compatibility with supported language and runtime versions + +This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward. + +## Set up your dev environment + +Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment. + diff --git a/plugins/stripe-php/OPENAPI_VERSION b/plugins/stripe-php/OPENAPI_VERSION index bf0daa66..3fdaa4ab 100644 --- a/plugins/stripe-php/OPENAPI_VERSION +++ b/plugins/stripe-php/OPENAPI_VERSION @@ -1 +1 @@ -v1412 \ No newline at end of file +v1719 \ No newline at end of file diff --git a/plugins/stripe-php/README.md b/plugins/stripe-php/README.md index b51c486d..25097fbe 100644 --- a/plugins/stripe-php/README.md +++ b/plugins/stripe-php/README.md @@ -4,7 +4,6 @@ [![Latest Stable Version](https://poser.pugx.org/stripe/stripe-php/v/stable.svg)](https://packagist.org/packages/stripe/stripe-php) [![Total Downloads](https://poser.pugx.org/stripe/stripe-php/downloads.svg)](https://packagist.org/packages/stripe/stripe-php) [![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php) -[![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master) The Stripe PHP library provides convenient access to the Stripe API from applications written in the PHP language. It includes a pre-defined set of @@ -70,8 +69,6 @@ You can continue to use the legacy integration patterns used prior to version [7 See the [PHP API docs](https://stripe.com/docs/api/?lang=php#intro). -See [video demonstrations][youtube-playlist] covering how to use the library. - ## Legacy Version Support ### PHP 5.4 & 5.5 @@ -202,22 +199,21 @@ You can disable this behavior if you prefer: \Stripe\Stripe::setEnableTelemetry(false); ``` -### Beta SDKs +### Public Preview SDKs -Stripe has features in the beta phase that can be accessed via the beta version of this package. -We would love for you to try these and share feedback with us before these features reach the stable phase. -Use the `composer require` command with an exact version specified to install the beta version of the stripe-php pacakge. +Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `12.2.0-beta.2`. +We would love for you to try these as we incrementally release new features and improve them based on your feedback. + +The public preview SDKs are a different version of the same package as the stable SDKs. These versions are appended with `-beta.X` such as `15.0.0-beta.1`. To install, choose the version that includes support for the preview feature you are interested in by reviewing the [releases page](https://github.com/stripe/stripe-dotnet/releases/) and then use it in the `composer require` command: ```bash -composer require stripe/stripe-php:v9.2.0-beta.1 +composer require stripe/stripe-php:v ``` > **Note** -> There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your composer.json file. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version. +> There can be breaking changes between two versions of the public preview SDKs without a bump in the major version. Therefore we recommend pinning the package version to a specific version in your composer.json file. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest version of the public preview SDK. -We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version. - -If your beta feature requires a `Stripe-Version` header to be sent, set the `apiVersion` property of `config` object by using the function `addBetaVersion`: +Some preview features require a name and version to be set in the `Stripe-Version` header like `feature_beta=v3`. If the preview feature you are interested in has this requirement, use the function `addBetaVersion` (available only in the public preview SDKs): ```php Stripe::addBetaVersion("feature_beta", "v3"); @@ -249,7 +245,11 @@ New features and bug fixes are released on the latest major version of the Strip ## Development -Get [Composer][composer]. For example, on Mac OS: +[Contribution guidelines for this project](CONTRIBUTING.md) + +We use [just](https://github.com/casey/just) for conveniently running development tasks. You can use them directly, or copy the commands out of the `justfile`. To our help docs, run `just`. + +To get started, install [Composer][composer]. For example, on Mac OS: ```bash brew install composer @@ -258,7 +258,8 @@ brew install composer Install dependencies: ```bash -composer install +just install +# or: composer install ``` The test suite depends on [stripe-mock], so make sure to fetch and run it from a @@ -273,13 +274,15 @@ stripe-mock Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite: ```bash -./vendor/bin/phpunit +just test +# or: ./vendor/bin/phpunit ``` Or to run an individual test file: ```bash -./vendor/bin/phpunit tests/Stripe/UtilTest.php +just test tests/Stripe/UtilTest.php +# or: ./vendor/bin/phpunit tests/Stripe/UtilTest.php ``` Update bundled CA certificates from the [Mozilla cURL release][curl]: @@ -291,7 +294,8 @@ Update bundled CA certificates from the [Mozilla cURL release][curl]: The library uses [PHP CS Fixer][php-cs-fixer] for code formatting. Code must be formatted before PRs are submitted, otherwise CI will fail. Run the formatter with: ```bash -./vendor/bin/php-cs-fixer fix -v . +just format +# or: ./vendor/bin/php-cs-fixer fix -v . ``` ## Attention plugin developers @@ -315,4 +319,3 @@ See the "SSL / TLS compatibility issues" paragraph above for full context. If yo [php-cs-fixer]: https://github.com/FriendsOfPHP/PHP-CS-Fixer [psr3]: http://www.php-fig.org/psr/psr-3/ [stripe-mock]: https://github.com/stripe/stripe-mock -[youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M6cUbiHrfMkXxZ9j9SGBxFE diff --git a/plugins/stripe-php/VERSION b/plugins/stripe-php/VERSION index 29b7b9ad..7c95a075 100644 --- a/plugins/stripe-php/VERSION +++ b/plugins/stripe-php/VERSION @@ -1 +1 @@ -16.4.0 +17.2.1 diff --git a/plugins/stripe-php/composer.json b/plugins/stripe-php/composer.json index 1e4dd7cb..f7763d66 100644 --- a/plugins/stripe-php/composer.json +++ b/plugins/stripe-php/composer.json @@ -22,7 +22,7 @@ }, "require-dev": { "phpunit/phpunit": "^5.7 || ^9.0", - "friendsofphp/php-cs-fixer": "3.5.0", + "friendsofphp/php-cs-fixer": "3.72.0", "phpstan/phpstan": "^1.2" }, "autoload": { diff --git a/plugins/stripe-php/init.php b/plugins/stripe-php/init.php index 01238f6d..f37db761 100644 --- a/plugins/stripe-php/init.php +++ b/plugins/stripe-php/init.php @@ -55,7 +55,6 @@ require __DIR__ . '/lib/ApiOperations/Delete.php'; require __DIR__ . '/lib/ApiOperations/NestedResource.php'; require __DIR__ . '/lib/ApiOperations/Request.php'; require __DIR__ . '/lib/ApiOperations/Retrieve.php'; -require __DIR__ . '/lib/ApiOperations/Search.php'; require __DIR__ . '/lib/ApiOperations/SingletonRetrieve.php'; require __DIR__ . '/lib/ApiOperations/Update.php'; @@ -138,6 +137,7 @@ require __DIR__ . '/lib/EventData/V1BillingMeterErrorReportTriggeredEventData.ph require __DIR__ . '/lib/EventData/V1BillingMeterNoMeterFoundEventData.php'; require __DIR__ . '/lib/Events/V1BillingMeterErrorReportTriggeredEvent.php'; require __DIR__ . '/lib/Events/V1BillingMeterNoMeterFoundEvent.php'; +require __DIR__ . '/lib/Events/V2CoreEventDestinationPingEvent.php'; require __DIR__ . '/lib/Exception/TemporarySessionExpiredException.php'; require __DIR__ . '/lib/ExchangeRate.php'; require __DIR__ . '/lib/File.php'; @@ -154,6 +154,7 @@ require __DIR__ . '/lib/Identity/VerificationSession.php'; require __DIR__ . '/lib/Invoice.php'; require __DIR__ . '/lib/InvoiceItem.php'; require __DIR__ . '/lib/InvoiceLineItem.php'; +require __DIR__ . '/lib/InvoicePayment.php'; require __DIR__ . '/lib/InvoiceRenderingTemplate.php'; require __DIR__ . '/lib/Issuing/Authorization.php'; require __DIR__ . '/lib/Issuing/Card.php'; @@ -240,6 +241,7 @@ require __DIR__ . '/lib/Service/Identity/IdentityServiceFactory.php'; require __DIR__ . '/lib/Service/Identity/VerificationReportService.php'; require __DIR__ . '/lib/Service/Identity/VerificationSessionService.php'; require __DIR__ . '/lib/Service/InvoiceItemService.php'; +require __DIR__ . '/lib/Service/InvoicePaymentService.php'; require __DIR__ . '/lib/Service/InvoiceRenderingTemplateService.php'; require __DIR__ . '/lib/Service/InvoiceService.php'; require __DIR__ . '/lib/Service/Issuing/AuthorizationService.php'; @@ -376,8 +378,6 @@ require __DIR__ . '/lib/Treasury/ReceivedCredit.php'; require __DIR__ . '/lib/Treasury/ReceivedDebit.php'; require __DIR__ . '/lib/Treasury/Transaction.php'; require __DIR__ . '/lib/Treasury/TransactionEntry.php'; -require __DIR__ . '/lib/UsageRecord.php'; -require __DIR__ . '/lib/UsageRecordSummary.php'; require __DIR__ . '/lib/V2/Billing/MeterEvent.php'; require __DIR__ . '/lib/V2/Billing/MeterEventAdjustment.php'; require __DIR__ . '/lib/V2/Billing/MeterEventSession.php'; diff --git a/plugins/stripe-php/justfile b/plugins/stripe-php/justfile new file mode 100644 index 00000000..5a6247d0 --- /dev/null +++ b/plugins/stripe-php/justfile @@ -0,0 +1,59 @@ +set quiet + +import? '../sdk-codegen/utils.just' + +# make vendored executables callable directly +export PATH := "vendor/bin:" + env_var('PATH') + +_default: + just --list --unsorted + +# install vendored dependencies +install *args: + composer install {{ if is_dependency() == "true" {"--quiet"} else {""} }} {{ args }} + +# ⭐ run full unit test suite; needs stripe-mock +[no-exit-message] +test *args: install + phpunit {{ args }} + +# run tests in CI; can use autoload mode (or not) +[confirm("This will modify local files and is intended for use in CI; do you want to proceed?")] +ci-test autoload: + ./build.php {{ autoload }} + +# ⭐ format all files +format *args: install + PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix -v --using-cache=no {{ args }} + +# check formatting for, but don't modify, files +format-check: (format "--dry-run") + +# ⭐ statically analyze code +lint *args: + php -d memory_limit=512M vendor/bin/phpstan analyse lib tests {{args}} + +# for backwards compatibility; ideally removed later +[private] +alias phpstan := lint + +# called by tooling +[private] +update-version version: + echo "{{ version }}" > VERSION + perl -pi -e 's|VERSION = '\''[.\-\w\d]+'\''|VERSION = '\''{{ version }}'\''|' lib/Stripe.php + + +PHPDOCUMENTOR_VERSION := "v3.0.0" +# generates docs; currently broken? can unhide if working +[private] +phpdoc: + #!/usr/bin/env bash + set -euo pipefail + + if [ ! -f vendor/bin/phpdoc ]; then + curl -sfL https://github.com/phpDocumentor/phpDocumentor/releases/download/{{ PHPDOCUMENTOR_VERSION }}/phpDocumentor.phar -o vendor/bin/phpdoc + chmod +x vendor/bin/phpdoc + fi + + phpdoc diff --git a/plugins/stripe-php/lib/Account.php b/plugins/stripe-php/lib/Account.php index d4a7a4c0..d208e19f 100644 --- a/plugins/stripe-php/lib/Account.php +++ b/plugins/stripe-php/lib/Account.php @@ -20,26 +20,26 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $business_profile Business information about the account. - * @property null|string $business_type The business type. After you create an Account Link or Account Session, this property is only returned for accounts where controller.requirement_collection is application, which includes Custom accounts. - * @property null|\Stripe\StripeObject $capabilities + * @property null|(object{annual_revenue?: null|(object{amount: null|int, currency: null|string, fiscal_year_end: null|string}&StripeObject), estimated_worker_count?: null|int, mcc: null|string, minority_owned_business_designation: null|string[], monthly_estimated_revenue?: (object{amount: int, currency: string}&StripeObject), name: null|string, product_description?: null|string, support_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), support_email: null|string, support_phone: null|string, support_url: null|string, url: null|string}&StripeObject) $business_profile Business information about the account. + * @property null|string $business_type The business type. + * @property null|(object{acss_debit_payments?: string, affirm_payments?: string, afterpay_clearpay_payments?: string, alma_payments?: string, amazon_pay_payments?: string, au_becs_debit_payments?: string, bacs_debit_payments?: string, bancontact_payments?: string, bank_transfer_payments?: string, billie_payments?: string, blik_payments?: string, boleto_payments?: string, card_issuing?: string, card_payments?: string, cartes_bancaires_payments?: string, cashapp_payments?: string, eps_payments?: string, fpx_payments?: string, gb_bank_transfer_payments?: string, giropay_payments?: string, grabpay_payments?: string, ideal_payments?: string, india_international_payments?: string, jcb_payments?: string, jp_bank_transfer_payments?: string, kakao_pay_payments?: string, klarna_payments?: string, konbini_payments?: string, kr_card_payments?: string, legacy_payments?: string, link_payments?: string, mobilepay_payments?: string, multibanco_payments?: string, mx_bank_transfer_payments?: string, naver_pay_payments?: string, nz_bank_account_becs_debit_payments?: string, oxxo_payments?: string, p24_payments?: string, pay_by_bank_payments?: string, payco_payments?: string, paynow_payments?: string, promptpay_payments?: string, revolut_pay_payments?: string, samsung_pay_payments?: string, satispay_payments?: string, sepa_bank_transfer_payments?: string, sepa_debit_payments?: string, sofort_payments?: string, swish_payments?: string, tax_reporting_us_1099_k?: string, tax_reporting_us_1099_misc?: string, transfers?: string, treasury?: string, twint_payments?: string, us_bank_account_ach_payments?: string, us_bank_transfer_payments?: string, zip_payments?: string}&StripeObject) $capabilities * @property null|bool $charges_enabled Whether the account can process charges. - * @property null|\Stripe\StripeObject $company - * @property null|\Stripe\StripeObject $controller + * @property null|(object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), address_kana?: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string, town: null|string}&StripeObject), address_kanji?: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string, town: null|string}&StripeObject), directors_provided?: bool, directorship_declaration?: null|(object{date: null|int, ip: null|string, user_agent: null|string}&StripeObject), executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: null|string, name_kana?: null|string, name_kanji?: null|string, owners_provided?: bool, ownership_declaration?: null|(object{date: null|int, ip: null|string, user_agent: null|string}&StripeObject), ownership_exemption_reason?: string, phone?: null|string, registration_date?: (object{day: null|int, month: null|int, year: null|int}&StripeObject), structure?: string, tax_id_provided?: bool, tax_id_registrar?: string, vat_id_provided?: bool, verification?: null|(object{document: (object{back: null|File|string, details: null|string, details_code: null|string, front: null|File|string}&StripeObject)}&StripeObject)}&StripeObject) $company + * @property null|(object{fees?: (object{payer: string}&StripeObject), is_controller?: bool, losses?: (object{payments: string}&StripeObject), requirement_collection?: string, stripe_dashboard?: (object{type: string}&StripeObject), type: string}&StripeObject) $controller * @property null|string $country The account's country. * @property null|int $created Time at which the account was connected. Measured in seconds since the Unix epoch. * @property null|string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that Stripe supports in the account's country. * @property null|bool $details_submitted Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to an onboarding flow to finish submitting account details. * @property null|string $email An email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform. - * @property null|\Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> $external_accounts External accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where controller[is_controller] is true. - * @property null|\Stripe\StripeObject $future_requirements - * @property null|\Stripe\StripeObject $groups The groups associated with the account. - * @property null|\Stripe\Person $individual

This is an object representing a person associated with a Stripe account.

A platform cannot access a person for an account where account.controller.requirement_collection is stripe, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding.

See the Standard onboarding or Express onboarding documentation for information about prefilling information and account onboarding steps. Learn more about handling identity verification with the API.

- * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|Collection $external_accounts External accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where controller[is_controller] is true. + * @property null|(object{alternatives: null|(object{alternative_fields_due: string[], original_fields_due: string[]}&StripeObject)[], current_deadline: null|int, currently_due: null|string[], disabled_reason: null|string, errors: null|(object{code: string, reason: string, requirement: string}&StripeObject)[], eventually_due: null|string[], past_due: null|string[], pending_verification: null|string[]}&StripeObject) $future_requirements + * @property null|(object{payments_pricing: null|string}&StripeObject) $groups The groups associated with the account. + * @property null|Person $individual

This is an object representing a person associated with a Stripe account.

A platform can only access a subset of data in a person for an account where account.controller.requirement_collection is stripe, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding.

See the Standard onboarding or Express onboarding documentation for information about prefilling information and account onboarding steps. Learn more about handling identity verification with the API.

+ * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|bool $payouts_enabled Whether the funds in this account can be paid out. - * @property null|\Stripe\StripeObject $requirements - * @property null|\Stripe\StripeObject $settings Options for customizing how the account functions within Stripe. - * @property null|\Stripe\StripeObject $tos_acceptance + * @property null|(object{alternatives: null|(object{alternative_fields_due: string[], original_fields_due: string[]}&StripeObject)[], current_deadline: null|int, currently_due: null|string[], disabled_reason: null|string, errors: null|(object{code: string, reason: string, requirement: string}&StripeObject)[], eventually_due: null|string[], past_due: null|string[], pending_verification: null|string[]}&StripeObject) $requirements + * @property null|(object{bacs_debit_payments?: (object{display_name: null|string, service_user_number: null|string}&StripeObject), branding: (object{icon: null|File|string, logo: null|File|string, primary_color: null|string, secondary_color: null|string}&StripeObject), card_issuing?: (object{tos_acceptance?: (object{date: null|int, ip: null|string, user_agent?: string}&StripeObject)}&StripeObject), card_payments: (object{decline_on?: (object{avs_failure: bool, cvc_failure: bool}&StripeObject), statement_descriptor_prefix: null|string, statement_descriptor_prefix_kana: null|string, statement_descriptor_prefix_kanji: null|string}&StripeObject), dashboard: (object{display_name: null|string, timezone: null|string}&StripeObject), invoices?: (object{default_account_tax_ids: null|(string|TaxId)[], hosted_payment_method_save?: null|string}&StripeObject), payments: (object{statement_descriptor: null|string, statement_descriptor_kana: null|string, statement_descriptor_kanji: null|string, statement_descriptor_prefix_kana: null|string, statement_descriptor_prefix_kanji: null|string}&StripeObject), payouts?: (object{debit_negative_balances: bool, schedule: (object{delay_days: int, interval: string, monthly_anchor?: int, weekly_anchor?: string}&StripeObject), statement_descriptor: null|string}&StripeObject), sepa_debit_payments?: (object{creditor_id?: string}&StripeObject), treasury?: (object{tos_acceptance?: (object{date: null|int, ip: null|string, user_agent?: string}&StripeObject)}&StripeObject)}&StripeObject) $settings Options for customizing how the account functions within Stripe. + * @property null|(object{date?: null|int, ip?: null|string, service_agreement?: string, user_agent?: null|string}&StripeObject) $tos_acceptance * @property null|string $type The Stripe account type. Can be standard, express, custom, or none. */ class Account extends ApiResource @@ -71,12 +71,12 @@ class Account extends ApiResource * information during account onboarding. You can prefill any information on the * account. * - * @param null|array $params + * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, controller?: array{fees?: array{payer?: string}, losses?: array{payments?: string}, requirement_collection?: string, stripe_dashboard?: array{type?: string}}, country?: string, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_registration?: array{files?: string[]}, proof_of_ultimate_beneficial_ownership?: array{files?: string[]}}, email?: string, expand?: string[], external_account?: array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, weekly_anchor?: string}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}, type?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Account the created resource * - * @return \Stripe\Account the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -84,7 +84,7 @@ class Account extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -108,9 +108,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Account the deleted resource * - * @return \Stripe\Account the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -127,18 +127,18 @@ class Account extends ApiResource * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is empty. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Account> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -163,12 +163,12 @@ class Account extends ApiResource * more about updating accounts. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_registration?: array{files?: string[]}, proof_of_ultimate_beneficial_ownership?: array{files?: string[]}}, email?: string, expand?: string[], external_account?: null|array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{default_account_tax_ids?: null|string[], hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, weekly_anchor?: string}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Account the updated resource * - * @return \Stripe\Account the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -176,7 +176,7 @@ class Account extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -213,9 +213,9 @@ class Account extends ApiResource * options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Account * - * @return \Stripe\Account + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id = null, $opts = null) { @@ -256,7 +256,7 @@ class Account extends ApiResource } else { $originalValue = []; } - if (($originalValue) && (\count($originalValue) > \count($additionalOwners))) { + if ($originalValue && (\count($originalValue) > \count($additionalOwners))) { throw new Exception\InvalidArgumentException( 'You cannot delete an item from an array, you must instead set a new array' ); @@ -282,9 +282,9 @@ class Account extends ApiResource * @param null|array $clientId * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return StripeObject object containing the response from the API * - * @return \Stripe\StripeObject object containing the response from the API + * @throws Exception\ApiErrorException if the request fails */ public function deauthorize($clientId = null, $opts = null) { @@ -300,9 +300,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Account the rejected account * - * @return \Stripe\Account the rejected account + * @throws Exception\ApiErrorException if the request fails */ public function reject($params = null, $opts = null) { @@ -320,9 +320,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection the list of capabilities * - * @return \Stripe\Collection<\Stripe\Capability> the list of capabilities + * @throws Exception\ApiErrorException if the request fails */ public static function allCapabilities($id, $params = null, $opts = null) { @@ -335,9 +335,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Capability * - * @return \Stripe\Capability + * @throws Exception\ApiErrorException if the request fails */ public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null) { @@ -350,9 +350,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Capability * - * @return \Stripe\Capability + * @throws Exception\ApiErrorException if the request fails */ public static function updateCapability($id, $capabilityId, $params = null, $opts = null) { @@ -365,9 +365,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection the list of external accounts (BankAccount or Card) * - * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> the list of external accounts (BankAccount or Card) + * @throws Exception\ApiErrorException if the request fails */ public static function allExternalAccounts($id, $params = null, $opts = null) { @@ -379,9 +379,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return BankAccount|Card * - * @return \Stripe\BankAccount|\Stripe\Card + * @throws Exception\ApiErrorException if the request fails */ public static function createExternalAccount($id, $params = null, $opts = null) { @@ -394,9 +394,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return BankAccount|Card * - * @return \Stripe\BankAccount|\Stripe\Card + * @throws Exception\ApiErrorException if the request fails */ public static function deleteExternalAccount($id, $externalAccountId, $params = null, $opts = null) { @@ -409,9 +409,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return BankAccount|Card * - * @return \Stripe\BankAccount|\Stripe\Card + * @throws Exception\ApiErrorException if the request fails */ public static function retrieveExternalAccount($id, $externalAccountId, $params = null, $opts = null) { @@ -424,9 +424,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return BankAccount|Card * - * @return \Stripe\BankAccount|\Stripe\Card + * @throws Exception\ApiErrorException if the request fails */ public static function updateExternalAccount($id, $externalAccountId, $params = null, $opts = null) { @@ -439,9 +439,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return LoginLink * - * @return \Stripe\LoginLink + * @throws Exception\ApiErrorException if the request fails */ public static function createLoginLink($id, $params = null, $opts = null) { @@ -454,9 +454,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection the list of persons * - * @return \Stripe\Collection<\Stripe\Person> the list of persons + * @throws Exception\ApiErrorException if the request fails */ public static function allPersons($id, $params = null, $opts = null) { @@ -468,9 +468,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Person * - * @return \Stripe\Person + * @throws Exception\ApiErrorException if the request fails */ public static function createPerson($id, $params = null, $opts = null) { @@ -483,9 +483,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Person * - * @return \Stripe\Person + * @throws Exception\ApiErrorException if the request fails */ public static function deletePerson($id, $personId, $params = null, $opts = null) { @@ -498,9 +498,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Person * - * @return \Stripe\Person + * @throws Exception\ApiErrorException if the request fails */ public static function retrievePerson($id, $personId, $params = null, $opts = null) { @@ -513,9 +513,9 @@ class Account extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Person * - * @return \Stripe\Person + * @throws Exception\ApiErrorException if the request fails */ public static function updatePerson($id, $personId, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/AccountLink.php b/plugins/stripe-php/lib/AccountLink.php index 339d0a1d..593bf945 100644 --- a/plugins/stripe-php/lib/AccountLink.php +++ b/plugins/stripe-php/lib/AccountLink.php @@ -24,12 +24,12 @@ class AccountLink extends ApiResource * platform can redirect their user to in order to take them through the Connect * Onboarding flow. * - * @param null|array $params + * @param null|array{account: string, collect?: string, collection_options?: array{fields?: string, future_requirements?: string}, expand?: string[], refresh_url?: string, return_url?: string, type: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return AccountLink the created resource * - * @return \Stripe\AccountLink the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -37,7 +37,7 @@ class AccountLink extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/AccountSession.php b/plugins/stripe-php/lib/AccountSession.php index 85b04c9b..28b4f3a8 100644 --- a/plugins/stripe-php/lib/AccountSession.php +++ b/plugins/stripe-php/lib/AccountSession.php @@ -16,7 +16,7 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string $account The ID of the account the AccountSession was created for * @property string $client_secret

The client secret of this AccountSession. Used on the client to set up secure access to the given account.

The client secret can be used to provide access to account from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.

Refer to our docs to setup Connect embedded components and learn about how client_secret should be handled.

- * @property \Stripe\StripeObject $components + * @property (object{account_management: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool}&StripeObject)}&StripeObject), account_onboarding: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool}&StripeObject)}&StripeObject), balances: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, edit_payout_schedule: bool, external_account_collection: bool, instant_payouts: bool, standard_payouts: bool}&StripeObject)}&StripeObject), documents: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject), financial_account: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool, send_money: bool, transfer_balance: bool}&StripeObject)}&StripeObject), financial_account_transactions: (object{enabled: bool, features: (object{card_spend_dispute_management: bool}&StripeObject)}&StripeObject), issuing_card: (object{enabled: bool, features: (object{card_management: bool, card_spend_dispute_management: bool, cardholder_management: bool, spend_control_management: bool}&StripeObject)}&StripeObject), issuing_cards_list: (object{enabled: bool, features: (object{card_management: bool, card_spend_dispute_management: bool, cardholder_management: bool, disable_stripe_user_authentication: bool, spend_control_management: bool}&StripeObject)}&StripeObject), notification_banner: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool}&StripeObject)}&StripeObject), payment_details: (object{enabled: bool, features: (object{capture_payments: bool, destination_on_behalf_of_charge_management: bool, dispute_management: bool, refund_management: bool}&StripeObject)}&StripeObject), payments: (object{enabled: bool, features: (object{capture_payments: bool, destination_on_behalf_of_charge_management: bool, dispute_management: bool, refund_management: bool}&StripeObject)}&StripeObject), payouts: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, edit_payout_schedule: bool, external_account_collection: bool, instant_payouts: bool, standard_payouts: bool}&StripeObject)}&StripeObject), payouts_list: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject), tax_registrations: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject), tax_settings: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject)}&StripeObject) $components * @property int $expires_at The timestamp at which this AccountSession will expire. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. */ @@ -28,12 +28,12 @@ class AccountSession extends ApiResource * Creates a AccountSession object that includes a single-use token that the * platform can use on their front-end to grant client-side API access. * - * @param null|array $params + * @param null|array{account: string, components: array{account_management?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, account_onboarding?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, balances?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, edit_payout_schedule?: bool, external_account_collection?: bool, instant_payouts?: bool, standard_payouts?: bool}}, documents?: array{enabled: bool, features?: array{}}, financial_account?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool, send_money?: bool, transfer_balance?: bool}}, financial_account_transactions?: array{enabled: bool, features?: array{card_spend_dispute_management?: bool}}, issuing_card?: array{enabled: bool, features?: array{card_management?: bool, card_spend_dispute_management?: bool, cardholder_management?: bool, spend_control_management?: bool}}, issuing_cards_list?: array{enabled: bool, features?: array{card_management?: bool, card_spend_dispute_management?: bool, cardholder_management?: bool, disable_stripe_user_authentication?: bool, spend_control_management?: bool}}, notification_banner?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, payment_details?: array{enabled: bool, features?: array{capture_payments?: bool, destination_on_behalf_of_charge_management?: bool, dispute_management?: bool, refund_management?: bool}}, payments?: array{enabled: bool, features?: array{capture_payments?: bool, destination_on_behalf_of_charge_management?: bool, dispute_management?: bool, refund_management?: bool}}, payouts?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, edit_payout_schedule?: bool, external_account_collection?: bool, instant_payouts?: bool, standard_payouts?: bool}}, payouts_list?: array{enabled: bool, features?: array{}}, tax_registrations?: array{enabled: bool, features?: array{}}, tax_settings?: array{enabled: bool, features?: array{}}}, expand?: string[]} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return AccountSession the created resource * - * @return \Stripe\AccountSession the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -41,7 +41,7 @@ class AccountSession extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/ApiOperations/All.php b/plugins/stripe-php/lib/ApiOperations/All.php index f421f885..ec72b1aa 100644 --- a/plugins/stripe-php/lib/ApiOperations/All.php +++ b/plugins/stripe-php/lib/ApiOperations/All.php @@ -13,9 +13,9 @@ trait All * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection of ApiResources + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/ApiOperations/Create.php b/plugins/stripe-php/lib/ApiOperations/Create.php index c4351321..244cc36b 100644 --- a/plugins/stripe-php/lib/ApiOperations/Create.php +++ b/plugins/stripe-php/lib/ApiOperations/Create.php @@ -13,9 +13,9 @@ trait Create * @param null|array $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return static the created resource + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { diff --git a/plugins/stripe-php/lib/ApiOperations/Delete.php b/plugins/stripe-php/lib/ApiOperations/Delete.php index c6082ff9..e6c6f757 100644 --- a/plugins/stripe-php/lib/ApiOperations/Delete.php +++ b/plugins/stripe-php/lib/ApiOperations/Delete.php @@ -13,9 +13,9 @@ trait Delete * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return static the deleted resource + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/ApiOperations/NestedResource.php b/plugins/stripe-php/lib/ApiOperations/NestedResource.php index 26af8dc3..e89fb999 100644 --- a/plugins/stripe-php/lib/ApiOperations/NestedResource.php +++ b/plugins/stripe-php/lib/ApiOperations/NestedResource.php @@ -51,9 +51,9 @@ trait NestedResource * @param null|array $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\StripeObject + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ protected static function _createNestedResource($id, $nestedPath, $params = null, $options = null) { @@ -69,9 +69,9 @@ trait NestedResource * @param null|array $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\StripeObject + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ protected static function _retrieveNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) { @@ -87,9 +87,9 @@ trait NestedResource * @param null|array $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\StripeObject + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ protected static function _updateNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) { @@ -105,9 +105,9 @@ trait NestedResource * @param null|array $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\StripeObject + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ protected static function _deleteNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) { @@ -122,9 +122,9 @@ trait NestedResource * @param null|array $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\StripeObject + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ protected static function _allNestedResources($id, $nestedPath, $params = null, $options = null) { diff --git a/plugins/stripe-php/lib/ApiOperations/Request.php b/plugins/stripe-php/lib/ApiOperations/Request.php index 3f33e7df..b721b72b 100644 --- a/plugins/stripe-php/lib/ApiOperations/Request.php +++ b/plugins/stripe-php/lib/ApiOperations/Request.php @@ -34,9 +34,9 @@ trait Request * @param string[] $usage names of tracked behaviors associated with this request * @param 'v1'|'v2' $apiMode * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return array tuple containing (the JSON response, $options) + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ protected function _request($method, $url, $params = [], $options = null, $usage = [], $apiMode = 'v1') { @@ -49,14 +49,14 @@ trait Request /** * @param string $url URL for the request - * @param class-string< \Stripe\SearchResult|\Stripe\Collection > $resultClass indicating what type of paginated result is returned + * @param class-string< \Stripe\Collection|\Stripe\SearchResult > $resultClass indicating what type of paginated result is returned * @param null|array $params list of parameters for the request * @param null|array|string $options * @param string[] $usage names of tracked behaviors associated with this request * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection|\Stripe\SearchResult + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ protected static function _requestPage($url, $resultClass, $params = null, $options = null, $usage = []) { @@ -64,7 +64,7 @@ trait Request list($response, $opts) = static::_staticRequest('get', $url, $params, $options, $usage); $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - if (!($obj instanceof $resultClass)) { + if (!$obj instanceof $resultClass) { throw new \Stripe\Exception\UnexpectedValueException( 'Expected type ' . $resultClass . ', got "' . \get_class($obj) . '" instead.' ); @@ -99,9 +99,9 @@ trait Request * @param string[] $usage names of tracked behaviors associated with this request * @param 'v1'|'v2' $apiMode * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return array tuple containing (the JSON response, $options) + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ protected static function _staticRequest($method, $url, $params, $options, $usage = [], $apiMode = 'v1') { diff --git a/plugins/stripe-php/lib/ApiOperations/Retrieve.php b/plugins/stripe-php/lib/ApiOperations/Retrieve.php index 5170afb3..1fc7f612 100644 --- a/plugins/stripe-php/lib/ApiOperations/Retrieve.php +++ b/plugins/stripe-php/lib/ApiOperations/Retrieve.php @@ -15,9 +15,9 @@ trait Retrieve * or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return static + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/ApiOperations/Search.php b/plugins/stripe-php/lib/ApiOperations/Search.php deleted file mode 100644 index 4ecd0aa1..00000000 --- a/plugins/stripe-php/lib/ApiOperations/Search.php +++ /dev/null @@ -1,25 +0,0 @@ -_requestRaw($method, $url, $params, $headers, $apiMode, $usage); + list($rbody, $rcode, $rheaders, $myApiKey) + = $this->_requestRaw($method, $url, $params, $headers, $apiMode, $usage, $maxNetworkRetries); $json = $this->_interpretResponse($rbody, $rcode, $rheaders, $apiMode); $resp = new ApiResponse($rbody, $rcode, $rheaders, $json); @@ -147,15 +148,16 @@ class ApiRequestor * @param null|array $headers * @param 'v1'|'v2' $apiMode * @param string[] $usage + * @param null|int $maxNetworkRetries * * @throws Exception\ApiErrorException */ - public function requestStream($method, $url, $readBodyChunkCallable, $params = null, $headers = null, $apiMode = 'v1', $usage = []) + public function requestStream($method, $url, $readBodyChunkCallable, $params = null, $headers = null, $apiMode = 'v1', $usage = [], $maxNetworkRetries = null) { $params = $params ?: []; $headers = $headers ?: []; - list($rbody, $rcode, $rheaders, $myApiKey) = - $this->_requestRawStreaming($method, $url, $params, $headers, $apiMode, $usage, $readBodyChunkCallable); + list($rbody, $rcode, $rheaders, $myApiKey) + = $this->_requestRawStreaming($method, $url, $params, $headers, $apiMode, $usage, $readBodyChunkCallable, $maxNetworkRetries); if ($rcode >= 300) { $this->_interpretResponse($rbody, $rcode, $rheaders, $apiMode); } @@ -224,8 +226,8 @@ class ApiRequestor return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); } - // fall through in generic 400 or 404, returns InvalidRequestException by default - // no break + // fall through in generic 400 or 404, returns InvalidRequestException by default + // no break case 404: return Exception\InvalidRequestException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); @@ -266,7 +268,8 @@ class ApiRequestor switch ($type) { case 'idempotency_error': return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); - // The beginning of the section generated from our OpenAPI spec + + // The beginning of the section generated from our OpenAPI spec case 'temporary_session_expired': return Exception\TemporarySessionExpiredException::factory( $msg, @@ -277,7 +280,7 @@ class ApiRequestor $code ); - // The end of the section generated from our OpenAPI spec + // The end of the section generated from our OpenAPI spec default: return self::_specificV1APIError($rbody, $rcode, $rheaders, $resp, $errorData); } @@ -436,14 +439,14 @@ class ApiRequestor // X-Stripe-Client-User-Agent header via the optional getUserAgentInfo() // method $clientUAInfo = null; - if (\method_exists($this->httpClient(), 'getUserAgentInfo')) { - $clientUAInfo = $this->httpClient()->getUserAgentInfo(); + if (\method_exists(self::httpClient(), 'getUserAgentInfo')) { + $clientUAInfo = self::httpClient()->getUserAgentInfo(); } if ($params && \is_array($params)) { $optionKeysInParams = \array_filter( self::$OPTIONS_KEYS, - function ($key) use ($params) { + static function ($key) use ($params) { return \array_key_exists($key, $params); } ); @@ -506,25 +509,33 @@ class ApiRequestor * @param array $headers * @param 'v1'|'v2' $apiMode * @param string[] $usage + * @param null|int $maxNetworkRetries + * + * @return array * * @throws Exception\AuthenticationException * @throws Exception\ApiConnectionException - * - * @return array */ - private function _requestRaw($method, $url, $params, $headers, $apiMode, $usage) + private function _requestRaw($method, $url, $params, $headers, $apiMode, $usage, $maxNetworkRetries) { list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers, $apiMode); + // for some reason, PHP users will sometimes include null bytes in their paths, which leads to cryptic server 400s. + // we'll be louder about this to help catch issues earlier. + if (false !== \strpos($absUrl, "\0") || false !== \strpos($absUrl, '%00')) { + throw new Exception\InvalidRequestException("URLs may not contain null bytes ('\\0'); double check any IDs you're including with the request."); + } + $requestStartMs = Util\Util::currentTimeMillis(); - list($rbody, $rcode, $rheaders) = $this->httpClient()->request( + list($rbody, $rcode, $rheaders) = self::httpClient()->request( $method, $absUrl, $rawHeaders, $params, $hasFile, - $apiMode + $apiMode, + $maxNetworkRetries ); if ( @@ -550,25 +561,27 @@ class ApiRequestor * @param string[] $usage * @param callable $readBodyChunkCallable * @param 'v1'|'v2' $apiMode + * @param int $maxNetworkRetries + * + * @return array * * @throws Exception\AuthenticationException * @throws Exception\ApiConnectionException - * - * @return array */ - private function _requestRawStreaming($method, $url, $params, $headers, $apiMode, $usage, $readBodyChunkCallable) + private function _requestRawStreaming($method, $url, $params, $headers, $apiMode, $usage, $readBodyChunkCallable, $maxNetworkRetries) { list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers, $apiMode); $requestStartMs = Util\Util::currentTimeMillis(); - list($rbody, $rcode, $rheaders) = $this->streamingHttpClient()->requestStream( + list($rbody, $rcode, $rheaders) = self::streamingHttpClient()->requestStream( $method, $absUrl, $rawHeaders, $params, $hasFile, - $readBodyChunkCallable + $readBodyChunkCallable, + $maxNetworkRetries ); if ( @@ -588,9 +601,9 @@ class ApiRequestor /** * @param resource $resource * - * @throws Exception\InvalidArgumentException - * * @return \CURLFile|string + * + * @throws Exception\InvalidArgumentException */ private function _processResourceParam($resource) { @@ -617,10 +630,10 @@ class ApiRequestor * @param array $rheaders * @param 'v1'|'v2' $apiMode * + * @return array + * * @throws Exception\UnexpectedValueException * @throws Exception\ApiErrorException - * - * @return array */ private function _interpretResponse($rbody, $rcode, $rheaders, $apiMode) { @@ -673,7 +686,7 @@ class ApiRequestor /** * @return HttpClient\ClientInterface */ - private function httpClient() + public static function httpClient() { if (!self::$_httpClient) { self::$_httpClient = HttpClient\CurlClient::instance(); @@ -685,7 +698,7 @@ class ApiRequestor /** * @return HttpClient\StreamingClientInterface */ - private function streamingHttpClient() + public static function streamingHttpClient() { if (!self::$_streamingHttpClient) { self::$_streamingHttpClient = HttpClient\CurlClient::instance(); diff --git a/plugins/stripe-php/lib/ApiResource.php b/plugins/stripe-php/lib/ApiResource.php index c0765c80..33f70c61 100644 --- a/plugins/stripe-php/lib/ApiResource.php +++ b/plugins/stripe-php/lib/ApiResource.php @@ -11,7 +11,7 @@ abstract class ApiResource extends StripeObject use ApiOperations\Request; /** - * @return \Stripe\Util\Set A list of fields that can be their own type of + * @return Util\Set A list of fields that can be their own type of * API resource (say a nested card under an account for example), and if * that resource is set, it should be transmitted to the API on a create or * update. Doing so is not the default behavior because API resources @@ -40,16 +40,16 @@ abstract class ApiResource extends StripeObject { parent::__set($k, $v); $v = $this->{$k}; - if ((static::getSavedNestedResources()->includes($k)) + if (static::getSavedNestedResources()->includes($k) && ($v instanceof ApiResource)) { $v->saveWithParent = true; } } /** - * @throws Exception\ApiErrorException - * * @return ApiResource the refreshed resource + * + * @throws Exception\ApiErrorException */ public function refresh() { @@ -93,9 +93,9 @@ abstract class ApiResource extends StripeObject /** * @param null|string $id the ID of the resource * - * @throws Exception\UnexpectedValueException if $id is null - * * @return string the instance endpoint URL for the given class + * + * @throws Exception\UnexpectedValueException if $id is null */ public static function resourceUrl($id) { diff --git a/plugins/stripe-php/lib/ApplePayDomain.php b/plugins/stripe-php/lib/ApplePayDomain.php index db37b6a0..0aa38422 100644 --- a/plugins/stripe-php/lib/ApplePayDomain.php +++ b/plugins/stripe-php/lib/ApplePayDomain.php @@ -18,12 +18,12 @@ class ApplePayDomain extends ApiResource /** * Create an apple pay domain. * - * @param null|array $params + * @param null|array{domain_name: string, expand?: string[]} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ApplePayDomain the created resource * - * @return \Stripe\ApplePayDomain the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -31,7 +31,7 @@ class ApplePayDomain extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -43,9 +43,9 @@ class ApplePayDomain extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ApplePayDomain the deleted resource * - * @return \Stripe\ApplePayDomain the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -61,18 +61,18 @@ class ApplePayDomain extends ApiResource /** * List apple pay domains. * - * @param null|array $params + * @param null|array{domain_name?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\ApplePayDomain> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -81,13 +81,13 @@ class ApplePayDomain extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ApplePayDomain * - * @return \Stripe\ApplePayDomain + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/ApplicationFee.php b/plugins/stripe-php/lib/ApplicationFee.php index 1843c27c..32db7913 100644 --- a/plugins/stripe-php/lib/ApplicationFee.php +++ b/plugins/stripe-php/lib/ApplicationFee.php @@ -7,19 +7,19 @@ namespace Stripe; /** * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string|\Stripe\Account $account ID of the Stripe account this fee was taken from. + * @property Account|string $account ID of the Stripe account this fee was taken from. * @property int $amount Amount earned, in cents (or local equivalent). * @property int $amount_refunded Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued) - * @property string|\Stripe\Application $application ID of the Connect application that earned the fee. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds). - * @property string|\Stripe\Charge $charge ID of the charge that the application fee was taken from. + * @property Application|string $application ID of the Connect application that earned the fee. + * @property null|BalanceTransaction|string $balance_transaction Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds). + * @property Charge|string $charge ID of the charge that the application fee was taken from. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|\Stripe\StripeObject $fee_source Polymorphic source of the application fee. Includes the ID of the object the application fee was created from. + * @property null|(object{charge?: string, payout?: string, type: string}&StripeObject) $fee_source Polymorphic source of the application fee. Includes the ID of the object the application fee was created from. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Charge $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the destination parameter. + * @property null|Charge|string $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the destination parameter. * @property bool $refunded Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false. - * @property \Stripe\Collection<\Stripe\ApplicationFeeRefund> $refunds A list of refunds that have been applied to the fee. + * @property Collection $refunds A list of refunds that have been applied to the fee. */ class ApplicationFee extends ApiResource { @@ -31,18 +31,18 @@ class ApplicationFee extends ApiResource * Returns a list of application fees you’ve previously collected. The application * fees are returned in sorted order, with the most recent fees appearing first. * - * @param null|array $params + * @param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\ApplicationFee> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -52,13 +52,13 @@ class ApplicationFee extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ApplicationFee * - * @return \Stripe\ApplicationFee + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -72,9 +72,9 @@ class ApplicationFee extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection the list of application fee refunds * - * @return \Stripe\Collection<\Stripe\ApplicationFeeRefund> the list of application fee refunds + * @throws Exception\ApiErrorException if the request fails */ public static function allRefunds($id, $params = null, $opts = null) { @@ -86,9 +86,9 @@ class ApplicationFee extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ApplicationFeeRefund * - * @return \Stripe\ApplicationFeeRefund + * @throws Exception\ApiErrorException if the request fails */ public static function createRefund($id, $params = null, $opts = null) { @@ -101,9 +101,9 @@ class ApplicationFee extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ApplicationFeeRefund * - * @return \Stripe\ApplicationFeeRefund + * @throws Exception\ApiErrorException if the request fails */ public static function retrieveRefund($id, $refundId, $params = null, $opts = null) { @@ -116,9 +116,9 @@ class ApplicationFee extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ApplicationFeeRefund * - * @return \Stripe\ApplicationFeeRefund + * @throws Exception\ApiErrorException if the request fails */ public static function updateRefund($id, $refundId, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/ApplicationFeeRefund.php b/plugins/stripe-php/lib/ApplicationFeeRefund.php index 1d383c01..3d1e18de 100644 --- a/plugins/stripe-php/lib/ApplicationFeeRefund.php +++ b/plugins/stripe-php/lib/ApplicationFeeRefund.php @@ -14,11 +14,11 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Amount, in cents (or local equivalent). - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property null|BalanceTransaction|string $balance_transaction Balance transaction that describes the impact on your account balance. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property ApplicationFee|string $fee ID of the application fee that was refunded. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. */ class ApplicationFeeRefund extends ApiResource { @@ -37,8 +37,8 @@ class ApplicationFeeRefund extends ApiResource $fee = $this['fee']; if (!$id) { throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", + 'Could not determine which URL to request: ' + . "class instance has invalid ID: {$id}", null ); } diff --git a/plugins/stripe-php/lib/Apps/Secret.php b/plugins/stripe-php/lib/Apps/Secret.php index 948f3dc1..c1dd0075 100644 --- a/plugins/stripe-php/lib/Apps/Secret.php +++ b/plugins/stripe-php/lib/Apps/Secret.php @@ -23,7 +23,7 @@ namespace Stripe\Apps; * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $name A name for the secret that's unique within the scope. * @property null|string $payload The plaintext secret value to be stored. - * @property \Stripe\StripeObject $scope + * @property (object{type: string, user?: string}&\Stripe\StripeObject) $scope */ class Secret extends \Stripe\ApiResource { @@ -32,12 +32,12 @@ class Secret extends \Stripe\ApiResource /** * Create or replace a secret in the secret store. * - * @param null|array $params + * @param null|array{expand?: string[], expires_at?: int, name: string, payload: string, scope: array{type: string, user?: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Secret the created resource * - * @return \Stripe\Apps\Secret the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -54,12 +54,12 @@ class Secret extends \Stripe\ApiResource /** * List all secrets stored on the given scope. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, scope: array{type: string, user?: string}, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Apps\Secret> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -72,9 +72,9 @@ class Secret extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Secret the deleted secret * - * @return \Stripe\Apps\Secret the deleted secret + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function deleteWhere($params = null, $opts = null) { @@ -90,9 +90,9 @@ class Secret extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Secret the finded secret * - * @return \Stripe\Apps\Secret the finded secret + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function find($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Balance.php b/plugins/stripe-php/lib/Balance.php index 61c8f40e..5c97b46e 100644 --- a/plugins/stripe-php/lib/Balance.php +++ b/plugins/stripe-php/lib/Balance.php @@ -18,12 +18,12 @@ namespace Stripe; * Related guide: Understanding Connect account balances * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject[] $available Available funds that you can transfer or pay out automatically by Stripe or explicitly through the Transfers API or Payouts API. You can find the available balance for each currency and payment type in the source_types property. - * @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected accounts where account.controller.requirement_collection is application, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the source_types property. - * @property null|\Stripe\StripeObject[] $instant_available Funds that you can pay out using Instant Payouts. - * @property null|\Stripe\StripeObject $issuing + * @property (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $available Available funds that you can transfer or pay out automatically by Stripe or explicitly through the Transfers API or Payouts API. You can find the available balance for each currency and payment type in the source_types property. + * @property null|(object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $connect_reserved Funds held due to negative balances on connected accounts where account.controller.requirement_collection is application, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the source_types property. + * @property null|(object{amount: int, currency: string, net_available?: (object{amount: int, destination: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[], source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $instant_available Funds that you can pay out using Instant Payouts. + * @property null|(object{available: (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[]}&StripeObject) $issuing * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject[] $pending Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the source_types property. + * @property (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $pending Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the source_types property. */ class Balance extends SingletonApiResource { @@ -37,13 +37,13 @@ class Balance extends SingletonApiResource * * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Balance * - * @return \Stripe\Balance + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static(null, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/BalanceTransaction.php b/plugins/stripe-php/lib/BalanceTransaction.php index b83ef767..a68bcfc7 100644 --- a/plugins/stripe-php/lib/BalanceTransaction.php +++ b/plugins/stripe-php/lib/BalanceTransaction.php @@ -19,12 +19,12 @@ namespace Stripe; * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|float $exchange_rate If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the amount in currency A, multipled by the exchange_rate, equals the amount in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's amount is 1000 and currency is eur. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's amount is 1234, its currency is usd, and the exchange_rate is 1.234. * @property int $fee Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed. - * @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. + * @property ((object{amount: int, application: null|string, currency: string, description: null|string, type: string}&StripeObject))[] $fee_details Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. * @property int $net Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by amount - fee * @property string $reporting_category Learn more about how reporting categories can help you understand balance transactions from an accounting perspective. - * @property null|string|\Stripe\ApplicationFee|\Stripe\ApplicationFeeRefund|\Stripe\Charge|\Stripe\ConnectCollectionTransfer|\Stripe\CustomerCashBalanceTransaction|\Stripe\Dispute|\Stripe\Issuing\Authorization|\Stripe\Issuing\Dispute|\Stripe\Issuing\Transaction|\Stripe\Payout|\Stripe\Refund|\Stripe\ReserveTransaction|\Stripe\TaxDeductedAtSource|\Stripe\Topup|\Stripe\Transfer|\Stripe\TransferReversal $source This transaction relates to the Stripe object. + * @property null|ApplicationFee|ApplicationFeeRefund|Charge|ConnectCollectionTransfer|CustomerCashBalanceTransaction|Dispute|Issuing\Authorization|Issuing\Dispute|Issuing\Transaction|Payout|Refund|ReserveTransaction|string|TaxDeductedAtSource|Topup|Transfer|TransferReversal $source This transaction relates to the Stripe object. * @property string $status The transaction's net funds status in the Stripe balance, which are either available or pending. - * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, climate_order_purchase, climate_order_refund, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_outbound, obligation_reversal_inbound, payment, payment_failure_refund, payment_network_reserve_hold, payment_network_reserve_release, payment_refund, payment_reversal, payment_unreconciled, payout, payout_cancel, payout_failure, payout_minimum_balance_hold, payout_minimum_balance_release, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead. + * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, climate_order_purchase, climate_order_refund, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_outbound, obligation_reversal_inbound, payment, payment_failure_refund, payment_network_reserve_hold, payment_network_reserve_release, payment_refund, payment_reversal, payment_unreconciled, payout, payout_cancel, payout_failure, payout_minimum_balance_hold, payout_minimum_balance_release, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, stripe_balance_payment_debit, stripe_balance_payment_debit_reversal, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead. */ class BalanceTransaction extends ApiResource { @@ -63,6 +63,8 @@ class BalanceTransaction extends ApiResource const TYPE_REFUND_FAILURE = 'refund_failure'; const TYPE_RESERVED_FUNDS = 'reserved_funds'; const TYPE_RESERVE_TRANSACTION = 'reserve_transaction'; + const TYPE_STRIPE_BALANCE_PAYMENT_DEBIT = 'stripe_balance_payment_debit'; + const TYPE_STRIPE_BALANCE_PAYMENT_DEBIT_REVERSAL = 'stripe_balance_payment_debit_reversal'; const TYPE_STRIPE_FEE = 'stripe_fee'; const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee'; const TYPE_TAX_FEE = 'tax_fee'; @@ -81,18 +83,18 @@ class BalanceTransaction extends ApiResource * Note that this endpoint was previously called “Balance history” and used the * path /v1/balance/history. * - * @param null|array $params + * @param null|array{created?: array|int, currency?: string, ending_before?: string, expand?: string[], limit?: int, payout?: string, source?: string, starting_after?: string, type?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\BalanceTransaction> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -104,13 +106,13 @@ class BalanceTransaction extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return BalanceTransaction * - * @return \Stripe\BalanceTransaction + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/BankAccount.php b/plugins/stripe-php/lib/BankAccount.php index ce536a40..eb5c2ab2 100644 --- a/plugins/stripe-php/lib/BankAccount.php +++ b/plugins/stripe-php/lib/BankAccount.php @@ -15,7 +15,7 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\Account $account The ID of the account that the bank account is associated with. + * @property null|Account|string $account The account this bank account belongs to. Only applicable on Accounts (not customers or recipients) This property is only available when returned as an External Account where controller.is_controller is true. * @property null|string $account_holder_name The name of the person or business that owns the bank account. * @property null|string $account_holder_type The type of entity that holds the account. This can be either individual or company. * @property null|string $account_type The bank account type. This can only be checking or savings in most countries. In Japan, this can only be futsu or toza. @@ -23,13 +23,13 @@ namespace Stripe; * @property null|string $bank_name Name of the bank associated with the routing number (e.g., WELLS FARGO). * @property string $country Two-letter ISO code representing the country the bank account is located in. * @property string $currency Three-letter ISO code for the currency paid out to the bank account. - * @property null|string|\Stripe\Customer $customer The ID of the customer that the bank account is associated with. + * @property null|Customer|string $customer The ID of the customer that the bank account is associated with. * @property null|bool $default_for_currency Whether this bank account is the default external account for its currency. * @property null|string $fingerprint Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. - * @property null|\Stripe\StripeObject $future_requirements Information about the upcoming new requirements for the bank account, including what information needs to be collected, and by when. + * @property null|(object{currently_due: null|string[], errors: null|(object{code: string, reason: string, requirement: string}&StripeObject)[], past_due: null|string[], pending_verification: null|string[]}&StripeObject) $future_requirements Information about the upcoming new requirements for the bank account, including what information needs to be collected, and by when. * @property string $last4 The last four digits of the bank account number. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $requirements Information about the requirements for the bank account, including what information needs to be collected. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|(object{currently_due: null|string[], errors: null|(object{code: string, reason: string, requirement: string}&StripeObject)[], past_due: null|string[], pending_verification: null|string[]}&StripeObject) $requirements Information about the requirements for the bank account, including what information needs to be collected. * @property null|string $routing_number The routing transit number for the bank account. * @property string $status

For bank accounts, possible values are new, validated, verified, verification_failed, or errored. A bank account that hasn't had any activity or validation performed is new. If Stripe can determine that the bank account exists, its status will be validated. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be verified. If the verification failed for any reason, such as microdeposit failure, the status will be verification_failed. If a payout sent to this bank account fails, we'll set the status to errored and will not continue to send scheduled payouts until the bank details are updated.

For external accounts, possible values are new, errored and verification_failed. If a payout fails, the status is set to errored and scheduled payouts are stopped until account details are updated. In the US and India, if we can't verify the owner of the bank account, we'll set the status to verification_failed. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.

*/ @@ -43,9 +43,9 @@ class BankAccount extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return BankAccount the deleted resource * - * @return \Stripe\BankAccount the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -98,15 +98,15 @@ class BankAccount extends ApiResource * @param array|string $_id * @param null|array|string $_opts * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function retrieve($_id, $_opts = null) { - $msg = 'Bank accounts cannot be retrieved without a customer ID or ' . - 'an account ID. Retrieve a bank account using ' . - "`Customer::retrieveSource('customer_id', " . - "'bank_account_id')` or `Account::retrieveExternalAccount(" . - "'account_id', 'bank_account_id')`."; + $msg = 'Bank accounts cannot be retrieved without a customer ID or ' + . 'an account ID. Retrieve a bank account using ' + . "`Customer::retrieveSource('customer_id', " + . "'bank_account_id')` or `Account::retrieveExternalAccount(" + . "'account_id', 'bank_account_id')`."; throw new Exception\BadMethodCallException($msg); } @@ -116,15 +116,15 @@ class BankAccount extends ApiResource * @param null|array $_params * @param null|array|string $_options * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function update($_id, $_params = null, $_options = null) { - $msg = 'Bank accounts cannot be updated without a customer ID or an ' . - 'account ID. Update a bank account using ' . - "`Customer::updateSource('customer_id', 'bank_account_id', " . - '$updateParams)` or `Account::updateExternalAccount(' . - "'account_id', 'bank_account_id', \$updateParams)`."; + $msg = 'Bank accounts cannot be updated without a customer ID or an ' + . 'account ID. Update a bank account using ' + . "`Customer::updateSource('customer_id', 'bank_account_id', " + . '$updateParams)` or `Account::updateExternalAccount(' + . "'account_id', 'bank_account_id', \$updateParams)`."; throw new Exception\BadMethodCallException($msg); } @@ -132,10 +132,10 @@ class BankAccount extends ApiResource /** * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return static the saved resource * + * @throws Exception\ApiErrorException if the request fails + * * @deprecated The `save` method is deprecated and will be removed in a * future major version of the library. Use the static method `update` * on the resource instead. @@ -156,9 +156,9 @@ class BankAccount extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return BankAccount the verified bank account + * + * @throws Exception\ApiErrorException if the request fails */ public function verify($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/BaseStripeClient.php b/plugins/stripe-php/lib/BaseStripeClient.php index a2eb04a7..6e87bfa7 100644 --- a/plugins/stripe-php/lib/BaseStripeClient.php +++ b/plugins/stripe-php/lib/BaseStripeClient.php @@ -18,7 +18,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn /** @var string default base URL for Stripe's Meter Events API */ const DEFAULT_METER_EVENTS_BASE = 'https://meter-events.stripe.com'; - /** @var array */ + /** @var array */ const DEFAULT_CONFIG = [ 'api_key' => null, 'app_info' => null, @@ -30,6 +30,8 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn 'connect_base' => self::DEFAULT_CONNECT_BASE, 'files_base' => self::DEFAULT_FILES_BASE, 'meter_events_base' => self::DEFAULT_METER_EVENTS_BASE, + // inherit from global + 'max_network_retries' => null, ]; /** @var array */ @@ -56,6 +58,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn * will automatically use the {@code Stripe-Context} header with that ID. * - stripe_version (null|string): a Stripe API version. If set, all requests sent by the client * will include the {@code Stripe-Version} header with that API version. + * - max_network_retries (null|int): the number of times this client should retry API failures; defaults to 0. * * The following configuration settings are also available, though setting these should rarely be necessary * (only useful if you want to send requests to a mock server like stripe-mock): @@ -77,7 +80,12 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn if (\is_string($config)) { $config = ['api_key' => $config]; } elseif (!\is_array($config)) { - throw new \Stripe\Exception\InvalidArgumentException('$config must be a string or an array'); + throw new Exception\InvalidArgumentException('$config must be a string or an array'); + } + + if (!\array_key_exists('max_network_retries', $config)) { + // if no value is passed, inherit the global value at the time of client creation + $config['max_network_retries'] = Stripe::getMaxNetworkRetries(); } $config = \array_merge(self::DEFAULT_CONFIG, $config); @@ -89,6 +97,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn 'stripe_account' => $config['stripe_account'], 'stripe_context' => $config['stripe_context'], 'stripe_version' => $config['stripe_version'], + 'max_network_retries' => $config['max_network_retries'], ]); } @@ -152,6 +161,16 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn return $this->config['meter_events_base']; } + /** + * Gets the configured number of retries. + * + * @return int the number of times this client will retry failed requests + */ + public function getMaxNetworkRetries() + { + return $this->config['max_network_retries']; + } + /** * Gets the app info for this client. * @@ -170,24 +189,24 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn * @param array $params the parameters of the request * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request * - * @return \Stripe\StripeObject the object returned by Stripe's API + * @return StripeObject the object returned by Stripe's API */ public function request($method, $path, $params, $opts) { $defaultRequestOpts = $this->defaultOpts; - $apiMode = \Stripe\Util\Util::getApiMode($path); + $apiMode = Util::getApiMode($path); $opts = $defaultRequestOpts->merge($opts, true); $baseUrl = $opts->apiBase ?: $this->getApiBase(); - $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl, $this->getAppInfo()); - list($response, $opts->apiKey) = $requestor->request($method, $path, $params, $opts->headers, $apiMode, ['stripe_client']); + $requestor = new ApiRequestor($this->apiKeyForRequest($opts), $baseUrl, $this->getAppInfo()); + list($response, $opts->apiKey) = $requestor->request($method, $path, $params, $opts->headers, $apiMode, ['stripe_client'], $opts->maxNetworkRetries); $opts->discardNonPersistentHeaders(); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts, $apiMode); + $obj = Util::convertToStripeObject($response->json, $opts, $apiMode); if (\is_array($obj)) { // Edge case for v2 endpoints that return empty/void response // Example: client->v2->billing->meterEventStream->create - $obj = new \Stripe\StripeObject(); + $obj = new StripeObject(); } $obj->setLastResponse($response); @@ -203,15 +222,16 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn * @param string $path the path of the request * @param null|array $params the parameters of the request * @param array $opts the special modifiers of the request + * @param null|int $maxNetworkRetries * - * @return \Stripe\ApiResponse + * @return ApiResponse */ - public function rawRequest($method, $path, $params = null, $opts = []) + public function rawRequest($method, $path, $params = null, $opts = [], $maxNetworkRetries = null) { if ('post' !== $method && null !== $params) { throw new Exception\InvalidArgumentException('Error: rawRequest only supports $params on post requests. Please pass null and add your parameters to $path'); } - $apiMode = \Stripe\Util\Util::getApiMode($path); + $apiMode = Util::getApiMode($path); $headers = []; if (\is_array($opts) && \array_key_exists('headers', $opts)) { $headers = $opts['headers'] ?: []; @@ -229,8 +249,8 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn // Concatenate $headers to $opts->headers, removing duplicates. $opts->headers = \array_merge($opts->headers, $headers); $baseUrl = $opts->apiBase ?: $this->getApiBase(); - $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); - list($response) = $requestor->request($method, $path, $params, $opts->headers, $apiMode, ['raw_request']); + $requestor = new ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); + list($response) = $requestor->request($method, $path, $params, $opts->headers, $apiMode, ['raw_request'], $maxNetworkRetries); return $response; } @@ -251,8 +271,8 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn { $opts = $this->defaultOpts->merge($opts, true); $baseUrl = $opts->apiBase ?: $this->getApiBase(); - $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl, $this->getAppInfo()); - $apiMode = \Stripe\Util\Util::getApiMode($path); + $requestor = new ApiRequestor($this->apiKeyForRequest($opts), $baseUrl, $this->getAppInfo()); + $apiMode = Util::getApiMode($path); list($response, $opts->apiKey) = $requestor->requestStream($method, $path, $readBodyChunkCallable, $params, $opts->headers, $apiMode, ['stripe_client']); } @@ -264,26 +284,26 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn * @param array $params the parameters of the request * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request * - * @return \Stripe\Collection|\Stripe\V2\Collection of ApiResources + * @return Collection|V2\Collection of ApiResources */ public function requestCollection($method, $path, $params, $opts) { $obj = $this->request($method, $path, $params, $opts); - $apiMode = \Stripe\Util\Util::getApiMode($path); + $apiMode = Util::getApiMode($path); if ('v1' === $apiMode) { - if (!($obj instanceof \Stripe\Collection)) { + if (!$obj instanceof Collection) { $received_class = \get_class($obj); $msg = "Expected to receive `Stripe\\Collection` object from Stripe API. Instead received `{$received_class}`."; - throw new \Stripe\Exception\UnexpectedValueException($msg); + throw new Exception\UnexpectedValueException($msg); } $obj->setFilters($params); } else { - if (!($obj instanceof \Stripe\V2\Collection)) { + if (!$obj instanceof V2\Collection) { $received_class = \get_class($obj); $msg = "Expected to receive `Stripe\\V2\\Collection` object from Stripe API. Instead received `{$received_class}`."; - throw new \Stripe\Exception\UnexpectedValueException($msg); + throw new Exception\UnexpectedValueException($msg); } } @@ -298,16 +318,16 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn * @param array $params the parameters of the request * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request * - * @return \Stripe\SearchResult of ApiResources + * @return SearchResult of ApiResources */ public function requestSearchResult($method, $path, $params, $opts) { $obj = $this->request($method, $path, $params, $opts); - if (!($obj instanceof \Stripe\SearchResult)) { + if (!$obj instanceof SearchResult) { $received_class = \get_class($obj); $msg = "Expected to receive `Stripe\\SearchResult` object from Stripe API. Instead received `{$received_class}`."; - throw new \Stripe\Exception\UnexpectedValueException($msg); + throw new Exception\UnexpectedValueException($msg); } $obj->setFilters($params); @@ -317,9 +337,9 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn /** * @param \Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\AuthenticationException - * * @return string + * + * @throws Exception\AuthenticationException */ private function apiKeyForRequest($opts) { @@ -330,7 +350,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn . 'StripeClient instance, or provide it on a per-request basis ' . 'using the `api_key` key in the $opts argument.'; - throw new \Stripe\Exception\AuthenticationException($msg); + throw new Exception\AuthenticationException($msg); } return $apiKey; @@ -339,72 +359,77 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn /** * @param array $config * - * @throws \Stripe\Exception\InvalidArgumentException + * @throws Exception\InvalidArgumentException */ private function validateConfig($config) { // api_key if (null !== $config['api_key'] && !\is_string($config['api_key'])) { - throw new \Stripe\Exception\InvalidArgumentException('api_key must be null or a string'); + throw new Exception\InvalidArgumentException('api_key must be null or a string'); } if (null !== $config['api_key'] && ('' === $config['api_key'])) { $msg = 'api_key cannot be the empty string'; - throw new \Stripe\Exception\InvalidArgumentException($msg); + throw new Exception\InvalidArgumentException($msg); } - if (null !== $config['api_key'] && (\preg_match('/\s/', $config['api_key']))) { + if (null !== $config['api_key'] && \preg_match('/\s/', $config['api_key'])) { $msg = 'api_key cannot contain whitespace'; - throw new \Stripe\Exception\InvalidArgumentException($msg); + throw new Exception\InvalidArgumentException($msg); } // client_id if (null !== $config['client_id'] && !\is_string($config['client_id'])) { - throw new \Stripe\Exception\InvalidArgumentException('client_id must be null or a string'); + throw new Exception\InvalidArgumentException('client_id must be null or a string'); } // stripe_account if (null !== $config['stripe_account'] && !\is_string($config['stripe_account'])) { - throw new \Stripe\Exception\InvalidArgumentException('stripe_account must be null or a string'); + throw new Exception\InvalidArgumentException('stripe_account must be null or a string'); } // stripe_context if (null !== $config['stripe_context'] && !\is_string($config['stripe_context'])) { - throw new \Stripe\Exception\InvalidArgumentException('stripe_context must be null or a string'); + throw new Exception\InvalidArgumentException('stripe_context must be null or a string'); } // stripe_version if (null !== $config['stripe_version'] && !\is_string($config['stripe_version'])) { - throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be null or a string'); + throw new Exception\InvalidArgumentException('stripe_version must be null or a string'); } // api_base if (!\is_string($config['api_base'])) { - throw new \Stripe\Exception\InvalidArgumentException('api_base must be a string'); + throw new Exception\InvalidArgumentException('api_base must be a string'); } // connect_base if (!\is_string($config['connect_base'])) { - throw new \Stripe\Exception\InvalidArgumentException('connect_base must be a string'); + throw new Exception\InvalidArgumentException('connect_base must be a string'); } // files_base if (!\is_string($config['files_base'])) { - throw new \Stripe\Exception\InvalidArgumentException('files_base must be a string'); + throw new Exception\InvalidArgumentException('files_base must be a string'); } // app info if (null !== $config['app_info'] && !\is_array($config['app_info'])) { - throw new \Stripe\Exception\InvalidArgumentException('app_info must be an array'); + throw new Exception\InvalidArgumentException('app_info must be an array'); + } + + // max_network_retries + if (!\is_int($config['max_network_retries'])) { + throw new Exception\InvalidArgumentException('max_network_retries must an int'); } $appInfoKeys = ['name', 'version', 'url', 'partner_id']; if (null !== $config['app_info'] && array_diff_key($config['app_info'], array_flip($appInfoKeys))) { $msg = 'app_info must be of type array{name: string, version?: string, url?: string, partner_id?: string}'; - throw new \Stripe\Exception\InvalidArgumentException($msg); + throw new Exception\InvalidArgumentException($msg); } // check absence of extra keys @@ -413,7 +438,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn // Wrap in single quote to more easily catch trailing spaces errors $invalidKeys = "'" . \implode("', '", $extraConfigKeys) . "'"; - throw new \Stripe\Exception\InvalidArgumentException('Found unknown key(s) in configuration array: ' . $invalidKeys); + throw new Exception\InvalidArgumentException('Found unknown key(s) in configuration array: ' . $invalidKeys); } } @@ -423,11 +448,11 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn * @param string $json * @param 'v1'|'v2' $apiMode * - * @return \Stripe\StripeObject + * @return StripeObject * */ public function deserialize($json, $apiMode = 'v1') { - return \Stripe\Util\Util::convertToStripeObject(\json_decode($json, true), [], $apiMode); + return Util::convertToStripeObject(\json_decode($json, true), [], $apiMode); } /** @@ -443,10 +468,10 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn * @param int $tolerance maximum difference allowed between the header's * timestamp and the current time. Defaults to 300 seconds (5 min) * + * @return ThinEvent + * * @throws Exception\SignatureVerificationException if the verification fails * @throws Exception\UnexpectedValueException if the payload is not valid JSON, - * - * @return \Stripe\ThinEvent */ public function parseThinEvent($payload, $sigHeader, $secret, $tolerance = Webhook::DEFAULT_TOLERANCE) { @@ -460,7 +485,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn ); } catch (\ReflectionException $e) { // Fail gracefully - return new \Stripe\ThinEvent(); + return new ThinEvent(); } } } diff --git a/plugins/stripe-php/lib/Billing/Alert.php b/plugins/stripe-php/lib/Billing/Alert.php index 5545d5f1..57cc7f95 100644 --- a/plugins/stripe-php/lib/Billing/Alert.php +++ b/plugins/stripe-php/lib/Billing/Alert.php @@ -13,7 +13,7 @@ namespace Stripe\Billing; * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $status Status of the alert. This can be active, inactive or archived. * @property string $title Title of the alert. - * @property null|\Stripe\StripeObject $usage_threshold Encapsulates configuration of the alert to monitor usage on a specific Billing Meter. + * @property null|(object{filters: null|((object{customer: null|string|\Stripe\Customer, type: string}&\Stripe\StripeObject))[], gte: int, meter: Meter|string, recurrence: string}&\Stripe\StripeObject) $usage_threshold Encapsulates configuration of the alert to monitor usage on a specific Billing Meter. */ class Alert extends \Stripe\ApiResource { @@ -26,12 +26,12 @@ class Alert extends \Stripe\ApiResource /** * Creates a billing alert. * - * @param null|array $params + * @param null|array{alert_type: string, expand?: string[], title: string, usage_threshold?: array{filters?: array{customer?: string, type: string}[], gte: int, meter?: string, recurrence: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Alert the created resource * - * @return \Stripe\Billing\Alert the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -48,12 +48,12 @@ class Alert extends \Stripe\ApiResource /** * Lists billing active and inactive alerts. * - * @param null|array $params + * @param null|array{alert_type?: string, ending_before?: string, expand?: string[], limit?: int, meter?: string, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Billing\Alert> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -68,9 +68,9 @@ class Alert extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Alert * - * @return \Stripe\Billing\Alert + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -85,9 +85,9 @@ class Alert extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Alert the activated alert * - * @return \Stripe\Billing\Alert the activated alert + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function activate($params = null, $opts = null) { @@ -102,9 +102,9 @@ class Alert extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Alert the archived alert * - * @return \Stripe\Billing\Alert the archived alert + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function archive($params = null, $opts = null) { @@ -119,9 +119,9 @@ class Alert extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Alert the deactivated alert * - * @return \Stripe\Billing\Alert the deactivated alert + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deactivate($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Billing/AlertTriggered.php b/plugins/stripe-php/lib/Billing/AlertTriggered.php index 04bae44d..8641dd38 100644 --- a/plugins/stripe-php/lib/Billing/AlertTriggered.php +++ b/plugins/stripe-php/lib/Billing/AlertTriggered.php @@ -6,7 +6,7 @@ namespace Stripe\Billing; /** * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\Billing\Alert $alert A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests. + * @property Alert $alert A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $customer ID of customer for which the alert triggered * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. diff --git a/plugins/stripe-php/lib/Billing/CreditBalanceSummary.php b/plugins/stripe-php/lib/Billing/CreditBalanceSummary.php index c6c76310..e8132b57 100644 --- a/plugins/stripe-php/lib/Billing/CreditBalanceSummary.php +++ b/plugins/stripe-php/lib/Billing/CreditBalanceSummary.php @@ -8,7 +8,7 @@ namespace Stripe\Billing; * Indicates the billing credit balance for billing credits granted to a customer. * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject[] $balances The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry. + * @property ((object{available_balance: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ledger_balance: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject))[] $balances The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry. * @property string|\Stripe\Customer $customer The customer the balance is for. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. */ @@ -21,9 +21,9 @@ class CreditBalanceSummary extends \Stripe\SingletonApiResource * * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditBalanceSummary * - * @return \Stripe\Billing\CreditBalanceSummary + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($opts = null) { diff --git a/plugins/stripe-php/lib/Billing/CreditBalanceTransaction.php b/plugins/stripe-php/lib/Billing/CreditBalanceTransaction.php index 74ef7ae6..495a9b34 100644 --- a/plugins/stripe-php/lib/Billing/CreditBalanceTransaction.php +++ b/plugins/stripe-php/lib/Billing/CreditBalanceTransaction.php @@ -10,9 +10,9 @@ namespace Stripe\Billing; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $credit Credit details for this credit balance transaction. Only present if type is credit. - * @property string|\Stripe\Billing\CreditGrant $credit_grant The credit grant associated with this credit balance transaction. - * @property null|\Stripe\StripeObject $debit Debit details for this credit balance transaction. Only present if type is debit. + * @property null|(object{amount: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), credits_application_invoice_voided: null|(object{invoice: string|\Stripe\Invoice, invoice_line_item: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $credit Credit details for this credit balance transaction. Only present if type is credit. + * @property CreditGrant|string $credit_grant The credit grant associated with this credit balance transaction. + * @property null|(object{amount: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), credits_applied: null|(object{invoice: string|\Stripe\Invoice, invoice_line_item: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $debit Debit details for this credit balance transaction. Only present if type is debit. * @property int $effective_at The effective time of this credit balance transaction. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this credit balance transaction belongs to. @@ -28,12 +28,12 @@ class CreditBalanceTransaction extends \Stripe\ApiResource /** * Retrieve a list of credit balance transactions. * - * @param null|array $params + * @param null|array{credit_grant?: string, customer: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Billing\CreditBalanceTransaction> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -48,9 +48,9 @@ class CreditBalanceTransaction extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditBalanceTransaction * - * @return \Stripe\Billing\CreditBalanceTransaction + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Billing/CreditGrant.php b/plugins/stripe-php/lib/Billing/CreditGrant.php index bcc27446..56e0e800 100644 --- a/plugins/stripe-php/lib/Billing/CreditGrant.php +++ b/plugins/stripe-php/lib/Billing/CreditGrant.php @@ -11,8 +11,8 @@ namespace Stripe\Billing; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $amount - * @property \Stripe\StripeObject $applicability_config + * @property (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $amount + * @property (object{scope: (object{price_type?: string, prices?: ((object{id: null|string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $applicability_config * @property string $category The category of this credit grant. This is for tracking purposes and isn't displayed to the customer. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string|\Stripe\Customer $customer ID of the customer receiving the billing credits. @@ -21,6 +21,7 @@ namespace Stripe\Billing; * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name A descriptive name shown in dashboard. + * @property null|int $priority The priority for applying this credit grant. The highest priority is 0 and the lowest is 100. * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this credit grant belongs to. * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. * @property null|int $voided_at The time when this credit grant was voided. If not present, the credit grant hasn't been voided. @@ -37,12 +38,12 @@ class CreditGrant extends \Stripe\ApiResource /** * Creates a credit grant. * - * @param null|array $params + * @param null|array{amount: array{monetary?: array{currency: string, value: int}, type: string}, applicability_config: array{scope: array{price_type?: string, prices?: array{id: string}[]}}, category: string, customer: string, effective_at?: int, expand?: string[], expires_at?: int, metadata?: array, name?: string, priority?: int} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditGrant the created resource * - * @return \Stripe\Billing\CreditGrant the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -59,12 +60,12 @@ class CreditGrant extends \Stripe\ApiResource /** * Retrieve a list of credit grants. * - * @param null|array $params + * @param null|array{customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Billing\CreditGrant> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -79,9 +80,9 @@ class CreditGrant extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditGrant * - * @return \Stripe\Billing\CreditGrant + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -96,12 +97,12 @@ class CreditGrant extends \Stripe\ApiResource * Updates a credit grant. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], expires_at?: null|int, metadata?: array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditGrant the updated resource * - * @return \Stripe\Billing\CreditGrant the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -119,9 +120,9 @@ class CreditGrant extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditGrant the expired credit grant * - * @return \Stripe\Billing\CreditGrant the expired credit grant + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function expire($params = null, $opts = null) { @@ -136,9 +137,9 @@ class CreditGrant extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditGrant the voided credit grant * - * @return \Stripe\Billing\CreditGrant the voided credit grant + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function voidGrant($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Billing/Meter.php b/plugins/stripe-php/lib/Billing/Meter.php index 1e0080a9..cea4b93c 100644 --- a/plugins/stripe-php/lib/Billing/Meter.php +++ b/plugins/stripe-php/lib/Billing/Meter.php @@ -12,16 +12,16 @@ namespace Stripe\Billing; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $customer_mapping - * @property \Stripe\StripeObject $default_aggregation + * @property (object{event_payload_key: string, type: string}&\Stripe\StripeObject) $customer_mapping + * @property (object{formula: string}&\Stripe\StripeObject) $default_aggregation * @property string $display_name The meter's name. * @property string $event_name The name of the meter event to record usage for. Corresponds with the event_name field on meter events. * @property null|string $event_time_window The time window to pre-aggregate meter events for, if any. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $status The meter's status. - * @property \Stripe\StripeObject $status_transitions + * @property (object{deactivated_at: null|int}&\Stripe\StripeObject) $status_transitions * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $value_settings + * @property (object{event_payload_key: string}&\Stripe\StripeObject) $value_settings */ class Meter extends \Stripe\ApiResource { @@ -39,12 +39,12 @@ class Meter extends \Stripe\ApiResource /** * Creates a billing meter. * - * @param null|array $params + * @param null|array{customer_mapping?: array{event_payload_key: string, type: string}, default_aggregation: array{formula: string}, display_name: string, event_name: string, event_time_window?: string, expand?: string[], value_settings?: array{event_payload_key: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Meter the created resource * - * @return \Stripe\Billing\Meter the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -61,12 +61,12 @@ class Meter extends \Stripe\ApiResource /** * Retrieve a list of billing meters. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Billing\Meter> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -81,9 +81,9 @@ class Meter extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Meter * - * @return \Stripe\Billing\Meter + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -98,12 +98,12 @@ class Meter extends \Stripe\ApiResource * Updates a billing meter. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{display_name?: string, expand?: string[]} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Meter the updated resource * - * @return \Stripe\Billing\Meter the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -121,9 +121,9 @@ class Meter extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Meter the deactivated meter * - * @return \Stripe\Billing\Meter the deactivated meter + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deactivate($params = null, $opts = null) { @@ -138,9 +138,9 @@ class Meter extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Meter the reactivated meter * - * @return \Stripe\Billing\Meter the reactivated meter + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function reactivate($params = null, $opts = null) { @@ -158,9 +158,9 @@ class Meter extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection the list of meter event summaries * - * @return \Stripe\Collection<\Stripe\Billing\MeterEventSummary> the list of meter event summaries + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function allEventSummaries($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Billing/MeterEvent.php b/plugins/stripe-php/lib/Billing/MeterEvent.php index d0ff22c1..e2c1fd1b 100644 --- a/plugins/stripe-php/lib/Billing/MeterEvent.php +++ b/plugins/stripe-php/lib/Billing/MeterEvent.php @@ -22,12 +22,12 @@ class MeterEvent extends \Stripe\ApiResource /** * Creates a billing meter event. * - * @param null|array $params + * @param null|array{event_name: string, expand?: string[], identifier?: string, payload: array, timestamp?: int} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return MeterEvent the created resource * - * @return \Stripe\Billing\MeterEvent the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { diff --git a/plugins/stripe-php/lib/Billing/MeterEventAdjustment.php b/plugins/stripe-php/lib/Billing/MeterEventAdjustment.php index 90863fb6..a6742b46 100644 --- a/plugins/stripe-php/lib/Billing/MeterEventAdjustment.php +++ b/plugins/stripe-php/lib/Billing/MeterEventAdjustment.php @@ -8,7 +8,7 @@ namespace Stripe\Billing; * A billing meter event adjustment is a resource that allows you to cancel a meter event. For example, you might create a billing meter event adjustment to cancel a meter event that was created in error or attached to the wrong customer. * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $cancel Specifies which event to cancel. + * @property null|(object{identifier: null|string}&\Stripe\StripeObject) $cancel Specifies which event to cancel. * @property string $event_name The name of the meter event. Corresponds with the event_name field on a meter. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $status The meter event adjustment's status. @@ -24,12 +24,12 @@ class MeterEventAdjustment extends \Stripe\ApiResource /** * Creates a billing meter event adjustment. * - * @param null|array $params + * @param null|array{cancel?: array{identifier?: string}, event_name: string, expand?: string[], type: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return MeterEventAdjustment the created resource * - * @return \Stripe\Billing\MeterEventAdjustment the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { diff --git a/plugins/stripe-php/lib/Billing/MeterEventSummary.php b/plugins/stripe-php/lib/Billing/MeterEventSummary.php index e56ada7f..008525a6 100644 --- a/plugins/stripe-php/lib/Billing/MeterEventSummary.php +++ b/plugins/stripe-php/lib/Billing/MeterEventSummary.php @@ -8,6 +8,8 @@ namespace Stripe\Billing; * A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much * usage was accrued by a customer for that period. * + * Note: Meters events are aggregated asynchronously so the meter event summaries provide an eventually consistent view of the reported usage. + * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property float $aggregated_value Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via default_aggregation. diff --git a/plugins/stripe-php/lib/BillingPortal/Configuration.php b/plugins/stripe-php/lib/BillingPortal/Configuration.php index 04b2c620..3d114829 100644 --- a/plugins/stripe-php/lib/BillingPortal/Configuration.php +++ b/plugins/stripe-php/lib/BillingPortal/Configuration.php @@ -11,13 +11,13 @@ namespace Stripe\BillingPortal; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Whether the configuration is active and can be used to create portal sessions. * @property null|string|\Stripe\Application $application ID of the Connect Application that created the configuration. - * @property \Stripe\StripeObject $business_profile + * @property (object{headline: null|string, privacy_policy_url: null|string, terms_of_service_url: null|string}&\Stripe\StripeObject) $business_profile * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $default_return_url The default URL to redirect customers to when they click on the portal's link to return to your website. This can be overriden when creating the session. - * @property \Stripe\StripeObject $features + * @property (object{customer_update: (object{allowed_updates: string[], enabled: bool}&\Stripe\StripeObject), invoice_history: (object{enabled: bool}&\Stripe\StripeObject), payment_method_update: (object{enabled: bool}&\Stripe\StripeObject), subscription_cancel: (object{cancellation_reason: (object{enabled: bool, options: string[]}&\Stripe\StripeObject), enabled: bool, mode: string, proration_behavior: string}&\Stripe\StripeObject), subscription_update: (object{default_allowed_updates: string[], enabled: bool, products?: null|(object{prices: string[], product: string}&\Stripe\StripeObject)[], proration_behavior: string, schedule_at_period_end: (object{conditions: (object{type: string}&\Stripe\StripeObject)[]}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject) $features * @property bool $is_default Whether the configuration is the default. If true, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $login_page + * @property (object{enabled: bool, url: null|string}&\Stripe\StripeObject) $login_page * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. */ @@ -31,12 +31,12 @@ class Configuration extends \Stripe\ApiResource * Creates a configuration that describes the functionality and behavior of a * PortalSession. * - * @param null|array $params + * @param null|array{business_profile?: array{headline?: null|string, privacy_policy_url?: string, terms_of_service_url?: string}, default_return_url?: null|string, expand?: string[], features: array{customer_update?: array{allowed_updates?: null|string[], enabled: bool}, invoice_history?: array{enabled: bool}, payment_method_update?: array{enabled: bool}, subscription_cancel?: array{cancellation_reason?: array{enabled: bool, options: null|string[]}, enabled: bool, mode?: string, proration_behavior?: string}, subscription_update?: array{default_allowed_updates?: null|string[], enabled: bool, products?: null|array{prices: string[], product: string}[], proration_behavior?: string, schedule_at_period_end?: array{conditions?: array{type: string}[]}}}, login_page?: array{enabled: bool}, metadata?: array} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Configuration the created resource * - * @return \Stripe\BillingPortal\Configuration the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -54,12 +54,12 @@ class Configuration extends \Stripe\ApiResource * Returns a list of configurations that describe the functionality of the customer * portal. * - * @param null|array $params + * @param null|array{active?: bool, ending_before?: string, expand?: string[], is_default?: bool, limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\BillingPortal\Configuration> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -75,9 +75,9 @@ class Configuration extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Configuration * - * @return \Stripe\BillingPortal\Configuration + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -92,12 +92,12 @@ class Configuration extends \Stripe\ApiResource * Updates a configuration that describes the functionality of the customer portal. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{active?: bool, business_profile?: array{headline?: null|string, privacy_policy_url?: null|string, terms_of_service_url?: null|string}, default_return_url?: null|string, expand?: string[], features?: array{customer_update?: array{allowed_updates?: null|string[], enabled?: bool}, invoice_history?: array{enabled: bool}, payment_method_update?: array{enabled: bool}, subscription_cancel?: array{cancellation_reason?: array{enabled: bool, options?: null|string[]}, enabled?: bool, mode?: string, proration_behavior?: string}, subscription_update?: array{default_allowed_updates?: null|string[], enabled?: bool, products?: null|array{prices: string[], product: string}[], proration_behavior?: string, schedule_at_period_end?: array{conditions?: null|array{type: string}[]}}}, login_page?: array{enabled: bool}, metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Configuration the updated resource * - * @return \Stripe\BillingPortal\Configuration the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/BillingPortal/Session.php b/plugins/stripe-php/lib/BillingPortal/Session.php index a94d5f9a..80d2c303 100644 --- a/plugins/stripe-php/lib/BillingPortal/Session.php +++ b/plugins/stripe-php/lib/BillingPortal/Session.php @@ -22,10 +22,10 @@ namespace Stripe\BillingPortal; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string|\Stripe\BillingPortal\Configuration $configuration The configuration used by this session, describing the features available. + * @property Configuration|string $configuration The configuration used by this session, describing the features available. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $customer The ID of the customer for this session. - * @property null|\Stripe\StripeObject $flow Information about a specific flow for the customer to go through. See the docs to learn more about using customer portal deep links and flows. + * @property null|(object{after_completion: (object{hosted_confirmation: null|(object{custom_message: null|string}&\Stripe\StripeObject), redirect: null|(object{return_url: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), subscription_cancel: null|(object{retention: null|(object{coupon_offer: null|(object{coupon: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), subscription: string}&\Stripe\StripeObject), subscription_update: null|(object{subscription: string}&\Stripe\StripeObject), subscription_update_confirm: null|(object{discounts: null|((object{coupon: null|string, promotion_code: null|string}&\Stripe\StripeObject))[], items: ((object{id: null|string, price: null|string, quantity?: int}&\Stripe\StripeObject))[], subscription: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $flow Information about a specific flow for the customer to go through. See the docs to learn more about using customer portal deep links and flows. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $locale The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s preferred_locales or browser’s locale is used. * @property null|string $on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays. @@ -39,12 +39,12 @@ class Session extends \Stripe\ApiResource /** * Creates a session of the customer portal. * - * @param null|array $params + * @param null|array{configuration?: string, customer: string, expand?: string[], flow_data?: array{after_completion?: array{hosted_confirmation?: array{custom_message?: string}, redirect?: array{return_url: string}, type: string}, subscription_cancel?: array{retention?: array{coupon_offer: array{coupon: string}, type: string}, subscription: string}, subscription_update?: array{subscription: string}, subscription_update_confirm?: array{discounts?: array{coupon?: string, promotion_code?: string}[], items: array{id: string, price?: string, quantity?: int}[], subscription: string}, type: string}, locale?: string, on_behalf_of?: string, return_url?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Session the created resource * - * @return \Stripe\BillingPortal\Session the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { diff --git a/plugins/stripe-php/lib/Capability.php b/plugins/stripe-php/lib/Capability.php index 056c5e81..bc4b9bfc 100644 --- a/plugins/stripe-php/lib/Capability.php +++ b/plugins/stripe-php/lib/Capability.php @@ -11,11 +11,11 @@ namespace Stripe; * * @property string $id The identifier for the capability. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string|\Stripe\Account $account The account for which the capability enables functionality. - * @property null|\Stripe\StripeObject $future_requirements + * @property Account|string $account The account for which the capability enables functionality. + * @property null|(object{alternatives: null|(object{alternative_fields_due: string[], original_fields_due: string[]}&StripeObject)[], current_deadline: null|int, currently_due: string[], disabled_reason: null|string, errors: (object{code: string, reason: string, requirement: string}&StripeObject)[], eventually_due: string[], past_due: string[], pending_verification: string[]}&StripeObject) $future_requirements * @property bool $requested Whether the capability has been requested. * @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $requirements + * @property null|(object{alternatives: null|(object{alternative_fields_due: string[], original_fields_due: string[]}&StripeObject)[], current_deadline: null|int, currently_due: string[], disabled_reason: null|string, errors: (object{code: string, reason: string, requirement: string}&StripeObject)[], eventually_due: string[], past_due: string[], pending_verification: string[]}&StripeObject) $requirements * @property string $status The status of the capability. */ class Capability extends ApiResource @@ -36,8 +36,8 @@ class Capability extends ApiResource $account = $this['account']; if (!$id) { throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", + 'Could not determine which URL to request: ' + . "class instance has invalid ID: {$id}", null ); } @@ -55,13 +55,13 @@ class Capability extends ApiResource * @param array|string $_id * @param null|array|string $_opts * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function retrieve($_id, $_opts = null) { - $msg = 'Capabilities cannot be retrieved without an account ID. ' . - 'Retrieve a capability using `Account::retrieveCapability(' . - "'account_id', 'capability_id')`."; + $msg = 'Capabilities cannot be retrieved without an account ID. ' + . 'Retrieve a capability using `Account::retrieveCapability(' + . "'account_id', 'capability_id')`."; throw new Exception\BadMethodCallException($msg); } @@ -71,13 +71,13 @@ class Capability extends ApiResource * @param null|array $_params * @param null|array|string $_options * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function update($_id, $_params = null, $_options = null) { - $msg = 'Capabilities cannot be updated without an account ID. ' . - 'Update a capability using `Account::updateCapability(' . - "'account_id', 'capability_id', \$updateParams)`."; + $msg = 'Capabilities cannot be updated without an account ID. ' + . 'Update a capability using `Account::updateCapability(' + . "'account_id', 'capability_id', \$updateParams)`."; throw new Exception\BadMethodCallException($msg); } @@ -85,10 +85,10 @@ class Capability extends ApiResource /** * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return static the saved resource * + * @throws Exception\ApiErrorException if the request fails + * * @deprecated The `save` method is deprecated and will be removed in a * future major version of the library. Use the static method `update` * on the resource instead. diff --git a/plugins/stripe-php/lib/Card.php b/plugins/stripe-php/lib/Card.php index 014e6b45..52fa506e 100644 --- a/plugins/stripe-php/lib/Card.php +++ b/plugins/stripe-php/lib/Card.php @@ -13,7 +13,7 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\Account $account The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. This property is only available for accounts where controller.requirement_collection is application, which includes Custom accounts. + * @property null|Account|string $account * @property null|string $address_city City/District/Suburb/Town/Village. * @property null|string $address_country Billing address country, if provided when creating card. * @property null|string $address_line1 Address line 1 (Street address/PO Box/Company name). @@ -26,8 +26,8 @@ namespace Stripe; * @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the method when creating a payout. * @property string $brand Card brand. Can be American Express, Diners Club, Discover, Eftpos Australia, Girocard, JCB, MasterCard, UnionPay, Visa, or Unknown. * @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. - * @property null|string $currency Three-letter ISO code for currency in lowercase. Must be a supported currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where controller.requirement_collection is application, which includes Custom accounts. - * @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead. + * @property null|string $currency Three-letter ISO code for currency in lowercase. Must be a supported currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available when returned as an External Account where controller.is_controller is true. + * @property null|Customer|string $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead. * @property null|string $cvc_check If a CVC was provided, results of the check: pass, fail, unavailable, or unchecked. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see Check if a card is valid without a charge. * @property null|bool $default_for_currency Whether this card is the default external account for its currency. This property is only available for accounts where controller.requirement_collection is application, which includes Custom accounts. * @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number. @@ -36,9 +36,9 @@ namespace Stripe; * @property null|string $fingerprint

Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.

As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.

* @property string $funding Card funding type. Can be credit, debit, prepaid, or unknown. * @property string $last4 The last four digits of the card. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name Cardholder name. - * @property null|\Stripe\StripeObject $networks + * @property null|(object{preferred: null|string}&StripeObject) $networks * @property null|string $regulated_status Status of a card based on the card issuer. * @property null|string $status For external accounts that are cards, possible values are new and errored. If a payout fails, the status is set to errored and scheduled payouts are stopped until account details are updated. * @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be android_pay (includes Google Pay), apple_pay, masterpass, visa_checkout, or null. @@ -60,9 +60,9 @@ class Card extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Card the deleted resource * - * @return \Stripe\Card the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -133,14 +133,14 @@ class Card extends ApiResource * @param array|string $_id * @param null|array|string $_opts * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function retrieve($_id, $_opts = null) { - $msg = 'Cards cannot be retrieved without a customer ID or an ' . - 'account ID. Retrieve a card using ' . - "`Customer::retrieveSource('customer_id', 'card_id')` or " . - "`Account::retrieveExternalAccount('account_id', 'card_id')`."; + $msg = 'Cards cannot be retrieved without a customer ID or an ' + . 'account ID. Retrieve a card using ' + . "`Customer::retrieveSource('customer_id', 'card_id')` or " + . "`Account::retrieveExternalAccount('account_id', 'card_id')`."; throw new Exception\BadMethodCallException($msg); } @@ -150,15 +150,15 @@ class Card extends ApiResource * @param null|array $_params * @param null|array|string $_options * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function update($_id, $_params = null, $_options = null) { - $msg = 'Cards cannot be updated without a customer ID or an ' . - 'account ID. Update a card using ' . - "`Customer::updateSource('customer_id', 'card_id', " . - '$updateParams)` or `Account::updateExternalAccount(' . - "'account_id', 'card_id', \$updateParams)`."; + $msg = 'Cards cannot be updated without a customer ID or an ' + . 'account ID. Update a card using ' + . "`Customer::updateSource('customer_id', 'card_id', " + . '$updateParams)` or `Account::updateExternalAccount(' + . "'account_id', 'card_id', \$updateParams)`."; throw new Exception\BadMethodCallException($msg); } @@ -166,10 +166,10 @@ class Card extends ApiResource /** * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return static the saved resource * + * @throws Exception\ApiErrorException if the request fails + * * @deprecated The `save` method is deprecated and will be removed in a * future major version of the library. Use the static method `update` * on the resource instead. diff --git a/plugins/stripe-php/lib/CashBalance.php b/plugins/stripe-php/lib/CashBalance.php index 84ee9a81..84514985 100644 --- a/plugins/stripe-php/lib/CashBalance.php +++ b/plugins/stripe-php/lib/CashBalance.php @@ -8,10 +8,10 @@ namespace Stripe; * A customer's Cash balance represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account. * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the smallest currency unit. + * @property null|StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the smallest currency unit. * @property string $customer The ID of the customer whose cash balance this object represents. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $settings + * @property (object{reconciliation_mode: string, using_merchant_default: bool}&StripeObject) $settings */ class CashBalance extends ApiResource { @@ -35,13 +35,13 @@ class CashBalance extends ApiResource * @param array|string $_id * @param null|array|string $_opts * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function retrieve($_id, $_opts = null) { - $msg = 'Customer Cash Balance cannot be retrieved without a ' . - 'customer ID. Retrieve a Customer Cash Balance using ' . - "`Customer::retrieveCashBalance('customer_id')`."; + $msg = 'Customer Cash Balance cannot be retrieved without a ' + . 'customer ID. Retrieve a Customer Cash Balance using ' + . "`Customer::retrieveCashBalance('customer_id')`."; throw new Exception\BadMethodCallException($msg); } @@ -51,13 +51,13 @@ class CashBalance extends ApiResource * @param null|array $_params * @param null|array|string $_options * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function update($_id, $_params = null, $_options = null) { - $msg = 'Customer Cash Balance cannot be updated without a ' . - 'customer ID. Retrieve a Customer Cash Balance using ' . - "`Customer::updateCashBalance('customer_id')`."; + $msg = 'Customer Cash Balance cannot be updated without a ' + . 'customer ID. Retrieve a Customer Cash Balance using ' + . "`Customer::updateCashBalance('customer_id')`."; throw new Exception\BadMethodCallException($msg); } diff --git a/plugins/stripe-php/lib/Charge.php b/plugins/stripe-php/lib/Charge.php index 2a3e37a0..eaf66dc3 100644 --- a/plugins/stripe-php/lib/Charge.php +++ b/plugins/stripe-php/lib/Charge.php @@ -15,48 +15,48 @@ namespace Stripe; * @property int $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). * @property int $amount_captured Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made). * @property int $amount_refunded Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued). - * @property null|string|\Stripe\Application $application ID of the Connect application that created the charge. - * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. See the Connect documentation for details. + * @property null|Application|string $application ID of the Connect application that created the charge. + * @property null|ApplicationFee|string $application_fee The application fee (if any) for the charge. See the Connect documentation for details. * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the charge. See the Connect documentation for details. * @property null|string $authorization_code Authorization code on the charge. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). - * @property \Stripe\StripeObject $billing_details + * @property null|BalanceTransaction|string $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). + * @property (object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string, tax_id: null|string}&StripeObject) $billing_details * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This value only exists for card payments. * @property bool $captured If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer ID of the customer this charge is for if one exists. + * @property null|Customer|string $customer ID of the customer this charge is for if one exists. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property bool $disputed Whether the charge has been disputed. - * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. + * @property null|BalanceTransaction|string $failure_balance_transaction ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. * @property null|string $failure_code Error code explaining reason for charge failure if available (see the errors section for a list of codes). * @property null|string $failure_message Message to user further explaining reason for charge failure if available. - * @property null|\Stripe\StripeObject $fraud_details Information on fraud assessments for the charge. - * @property null|string|\Stripe\Invoice $invoice ID of the invoice this charge is for if one exists. - * @property null|\Stripe\StripeObject $level3 + * @property null|(object{stripe_report?: string, user_report?: string}&StripeObject) $fraud_details Information on fraud assessments for the charge. + * @property null|(object{customer_reference?: string, line_items: ((object{discount_amount: null|int, product_code: string, product_description: string, quantity: null|int, tax_amount: null|int, unit_cost: null|int}&StripeObject))[], merchant_reference: string, shipping_address_zip?: string, shipping_amount?: int, shipping_from_zip?: string}&StripeObject) $level3 * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details. - * @property null|\Stripe\StripeObject $outcome Details about whether the payment was accepted, and why. See understanding declines for details. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|Account|string $on_behalf_of The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details. + * @property null|(object{advice_code: null|string, network_advice_code: null|string, network_decline_code: null|string, network_status: null|string, reason: null|string, risk_level?: string, risk_score?: int, rule?: (object{action: string, id: string, predicate: string}&StripeObject)|string, seller_message: null|string, type: string}&StripeObject) $outcome Details about whether the payment was accepted, and why. See understanding declines for details. * @property bool $paid true if the charge succeeded, or was successfully authorized for later capture. - * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent associated with this charge, if one exists. + * @property null|PaymentIntent|string $payment_intent ID of the PaymentIntent associated with this charge, if one exists. * @property null|string $payment_method ID of the payment method used in this charge. - * @property null|\Stripe\StripeObject $payment_method_details Details about the payment method at the time of the transaction. - * @property null|\Stripe\StripeObject $radar_options Options to configure Radar. See Radar Session for more information. + * @property null|(object{ach_credit_transfer?: (object{account_number: null|string, bank_name: null|string, routing_number: null|string, swift_code: null|string}&StripeObject), ach_debit?: (object{account_holder_type: null|string, bank_name: null|string, country: null|string, fingerprint: null|string, last4: null|string, routing_number: null|string}&StripeObject), acss_debit?: (object{bank_name: null|string, fingerprint: null|string, institution_number: null|string, last4: null|string, mandate?: string, transit_number: null|string}&StripeObject), affirm?: (object{transaction_id: null|string}&StripeObject), afterpay_clearpay?: (object{order_id: null|string, reference: null|string}&StripeObject), alipay?: (object{buyer_id?: string, fingerprint: null|string, transaction_id: null|string}&StripeObject), alma?: (object{}&StripeObject), amazon_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject)}&StripeObject), au_becs_debit?: (object{bsb_number: null|string, fingerprint: null|string, last4: null|string, mandate?: string}&StripeObject), bacs_debit?: (object{fingerprint: null|string, last4: null|string, mandate: null|string, sort_code: null|string}&StripeObject), bancontact?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), billie?: (object{}&StripeObject), blik?: (object{buyer_id: null|string}&StripeObject), boleto?: (object{tax_id: string}&StripeObject), card?: (object{amount_authorized: null|int, authorization_code: null|string, brand: null|string, capture_before?: int, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description?: null|string, exp_month: int, exp_year: int, extended_authorization?: (object{status: string}&StripeObject), fingerprint?: null|string, funding: null|string, iin?: null|string, incremental_authorization?: (object{status: string}&StripeObject), installments: null|(object{plan: null|(object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject), issuer?: null|string, last4: null|string, mandate: null|string, moto?: null|bool, multicapture?: (object{status: string}&StripeObject), network: null|string, network_token?: null|(object{used: bool}&StripeObject), network_transaction_id: null|string, overcapture?: (object{maximum_amount_capturable: int, status: string}&StripeObject), regulated_status: null|string, three_d_secure: null|(object{authentication_flow: null|string, electronic_commerce_indicator: null|string, exemption_indicator: null|string, exemption_indicator_applied?: bool, result: null|string, result_reason: null|string, transaction_id: null|string, version: null|string}&StripeObject), wallet: null|(object{amex_express_checkout?: (object{}&StripeObject), apple_pay?: (object{}&StripeObject), dynamic_last4: null|string, google_pay?: (object{}&StripeObject), link?: (object{}&StripeObject), masterpass?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject), samsung_pay?: (object{}&StripeObject), type: string, visa_checkout?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject)}&StripeObject)}&StripeObject), card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), cashapp?: (object{buyer_id: null|string, cashtag: null|string}&StripeObject), customer_balance?: (object{}&StripeObject), eps?: (object{bank: null|string, verified_name: null|string}&StripeObject), fpx?: (object{account_holder_type: null|string, bank: string, transaction_id: null|string}&StripeObject), giropay?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, verified_name: null|string}&StripeObject), grabpay?: (object{transaction_id: null|string}&StripeObject), ideal?: (object{bank: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, verified_name: null|string}&StripeObject), interac_present?: (object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, issuer?: null|string, last4: null|string, network: null|string, network_transaction_id: null|string, preferred_locales: null|string[], read_method: null|string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject)}&StripeObject), kakao_pay?: (object{buyer_id: null|string}&StripeObject), klarna?: (object{payer_details: null|(object{address: null|(object{country: null|string}&StripeObject)}&StripeObject), payment_method_category: null|string, preferred_locale: null|string}&StripeObject), konbini?: (object{store: null|(object{chain: null|string}&StripeObject)}&StripeObject), kr_card?: (object{brand: null|string, buyer_id: null|string, last4: null|string}&StripeObject), link?: (object{country: null|string}&StripeObject), mobilepay?: (object{card: null|(object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, last4: null|string}&StripeObject)}&StripeObject), multibanco?: (object{entity: null|string, reference: null|string}&StripeObject), naver_pay?: (object{buyer_id: null|string}&StripeObject), nz_bank_account?: (object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, last4: string, suffix: null|string}&StripeObject), oxxo?: (object{number: null|string}&StripeObject), p24?: (object{bank: null|string, reference: null|string, verified_name: null|string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{buyer_id: null|string}&StripeObject), paynow?: (object{reference: null|string}&StripeObject), paypal?: (object{country: null|string, payer_email: null|string, payer_id: null|string, payer_name: null|string, seller_protection: null|(object{dispute_categories: null|string[], status: string}&StripeObject), transaction_id: null|string}&StripeObject), pix?: (object{bank_transaction_id?: null|string}&StripeObject), promptpay?: (object{reference: null|string}&StripeObject), revolut_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject)}&StripeObject), samsung_pay?: (object{buyer_id: null|string}&StripeObject), satispay?: (object{}&StripeObject), sepa_credit_transfer?: (object{bank_name: null|string, bic: null|string, iban: null|string}&StripeObject), sepa_debit?: (object{bank_code: null|string, branch_code: null|string, country: null|string, fingerprint: null|string, last4: null|string, mandate: null|string}&StripeObject), sofort?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, country: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), stripe_account?: (object{}&StripeObject), swish?: (object{fingerprint: null|string, payment_reference: null|string, verified_phone_last4: null|string}&StripeObject), twint?: (object{}&StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, fingerprint: null|string, last4: null|string, mandate?: Mandate|string, payment_reference: null|string, routing_number: null|string}&StripeObject), wechat?: (object{}&StripeObject), wechat_pay?: (object{fingerprint: null|string, transaction_id: null|string}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $payment_method_details Details about the payment method at the time of the transaction. + * @property null|(object{presentment_amount: int, presentment_currency: string}&StripeObject) $presentment_details + * @property null|(object{session?: string}&StripeObject) $radar_options Options to configure Radar. See Radar Session for more information. * @property null|string $receipt_email This is the email address that the receipt for this charge was sent to. * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent. * @property null|string $receipt_url This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. * @property bool $refunded Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. - * @property null|\Stripe\Collection<\Stripe\Refund> $refunds A list of refunds that have been applied to the charge. - * @property null|string|\Stripe\Review $review ID of the review associated with this charge if one exists. - * @property null|\Stripe\StripeObject $shipping Shipping information for the charge. - * @property null|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead. - * @property null|string|\Stripe\Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details. + * @property null|Collection $refunds A list of refunds that have been applied to the charge. + * @property null|Review|string $review ID of the review associated with this charge if one exists. + * @property null|(object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), carrier?: null|string, name?: string, phone?: null|string, tracking_number?: null|string}&StripeObject) $shipping Shipping information for the charge. + * @property null|Account|BankAccount|Card|Source $source This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead. + * @property null|string|Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details. * @property null|string $statement_descriptor

For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see the Statement Descriptor docs.

For a card charge, this value is ignored unless you don't specify a statement_descriptor_suffix, in which case this value is used as the suffix.

* @property null|string $statement_descriptor_suffix Provides information about a card charge. Concatenated to the account's statement descriptor prefix to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. * @property string $status The status of the payment is either succeeded, pending, or failed. - * @property null|string|\Stripe\Transfer $transfer ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter). - * @property null|\Stripe\StripeObject $transfer_data An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details. + * @property null|string|Transfer $transfer ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter). + * @property null|(object{amount: null|int, destination: Account|string}&StripeObject) $transfer_data An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details. * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. */ class Charge extends ApiResource @@ -76,12 +76,12 @@ class Charge extends ApiResource * payment instead. Confirmation of the PaymentIntent creates the * Charge object used to request payment. * - * @param null|array $params + * @param null|array{amount?: int, application_fee?: int, application_fee_amount?: int, capture?: bool, currency?: string, customer?: string, description?: string, destination?: array{account: string, amount?: int}, expand?: string[], metadata?: null|array, on_behalf_of?: string, radar_options?: array{session?: string}, receipt_email?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, source?: string, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Charge the created resource * - * @return \Stripe\Charge the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -89,7 +89,7 @@ class Charge extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -99,18 +99,18 @@ class Charge extends ApiResource * Returns a list of charges you’ve previously created. The charges are returned in * sorted order, with the most recent charges appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string, transfer_group?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Charge> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -122,13 +122,13 @@ class Charge extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Charge * - * @return \Stripe\Charge + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -140,12 +140,12 @@ class Charge extends ApiResource * parameters not provided will be left unchanged. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{customer?: string, description?: string, expand?: string[], fraud_details?: array{user_report: null|string}, metadata?: null|array, receipt_email?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, transfer_group?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Charge the updated resource * - * @return \Stripe\Charge the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -153,7 +153,7 @@ class Charge extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -216,9 +216,9 @@ class Charge extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Charge the captured charge * - * @return \Stripe\Charge the captured charge + * @throws Exception\ApiErrorException if the request fails */ public function capture($params = null, $opts = null) { @@ -233,15 +233,15 @@ class Charge extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SearchResult the charge search results * - * @return \Stripe\SearchResult<\Stripe\Charge> the charge search results + * @throws Exception\ApiErrorException if the request fails */ public static function search($params = null, $opts = null) { $url = '/v1/charges/search'; - return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts); + return static::_requestPage($url, SearchResult::class, $params, $opts); } const PATH_REFUNDS = '/refunds'; @@ -251,9 +251,9 @@ class Charge extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection the list of refunds * - * @return \Stripe\Collection<\Stripe\Refund> the list of refunds + * @throws Exception\ApiErrorException if the request fails */ public static function allRefunds($id, $params = null, $opts = null) { @@ -266,9 +266,9 @@ class Charge extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Refund * - * @return \Stripe\Refund + * @throws Exception\ApiErrorException if the request fails */ public static function retrieveRefund($id, $refundId, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Checkout/Session.php b/plugins/stripe-php/lib/Checkout/Session.php index 9bf15baf..c8e42f5c 100644 --- a/plugins/stripe-php/lib/Checkout/Session.php +++ b/plugins/stripe-php/lib/Checkout/Session.php @@ -22,60 +22,65 @@ namespace Stripe\Checkout; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $adaptive_pricing Settings for price localization with Adaptive Pricing. - * @property null|\Stripe\StripeObject $after_expiration When set, provides configuration for actions to take if this Checkout Session expires. + * @property null|(object{enabled: bool}&\Stripe\StripeObject) $adaptive_pricing Settings for price localization with Adaptive Pricing. + * @property null|(object{recovery: null|(object{allow_promotion_codes: bool, enabled: bool, expires_at: null|int, url: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $after_expiration When set, provides configuration for actions to take if this Checkout Session expires. * @property null|bool $allow_promotion_codes Enables user redeemable promotion codes. * @property null|int $amount_subtotal Total of all items before discounts or taxes are applied. * @property null|int $amount_total Total of all items after discounts and taxes are applied. - * @property \Stripe\StripeObject $automatic_tax + * @property (object{enabled: bool, liability: null|(object{account?: string|\Stripe\Account, type: string}&\Stripe\StripeObject), provider: null|string, status: null|string}&\Stripe\StripeObject) $automatic_tax * @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address. Defaults to auto. * @property null|string $cancel_url If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. * @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. - * @property null|string $client_secret Client secret to be used when initializing Stripe.js embedded checkout. - * @property null|\Stripe\StripeObject $consent Results of consent_collection for this session. - * @property null|\Stripe\StripeObject $consent_collection When set, provides configuration for the Checkout Session to gather active consent from customers. + * @property null|string $client_secret The client secret of your Checkout Session. Applies to Checkout Sessions with ui_mode: embedded or ui_mode: custom. For ui_mode: embedded, the client secret is to be used when initializing Stripe.js embedded checkout. For ui_mode: custom, use the client secret with initCheckout on your front end. + * @property null|(object{shipping_details: null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), name: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $collected_information Information about the customer collected within the Checkout Session. + * @property null|(object{promotions: null|string, terms_of_service: null|string}&\Stripe\StripeObject) $consent Results of consent_collection for this session. + * @property null|(object{payment_method_reuse_agreement: null|(object{position: string}&\Stripe\StripeObject), promotions: null|string, terms_of_service: null|string}&\Stripe\StripeObject) $consent_collection When set, provides configuration for the Checkout Session to gather active consent from customers. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|\Stripe\StripeObject $currency_conversion Currency conversion details for Adaptive Pricing sessions - * @property \Stripe\StripeObject[] $custom_fields Collect additional information from your customer using custom fields. Up to 3 fields are supported. - * @property \Stripe\StripeObject $custom_text + * @property null|(object{amount_subtotal: int, amount_total: int, fx_rate: string, source_currency: string}&\Stripe\StripeObject) $currency_conversion Currency conversion details for Adaptive Pricing sessions created before 2025-03-31. + * @property ((object{dropdown?: (object{default_value: null|string, options: (object{label: string, value: string}&\Stripe\StripeObject)[], value: null|string}&\Stripe\StripeObject), key: string, label: (object{custom: null|string, type: string}&\Stripe\StripeObject), numeric?: (object{default_value: null|string, maximum_length: null|int, minimum_length: null|int, value: null|string}&\Stripe\StripeObject), optional: bool, text?: (object{default_value: null|string, maximum_length: null|int, minimum_length: null|int, value: null|string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject))[] $custom_fields Collect additional information from your customer using custom fields. Up to 3 fields are supported. + * @property (object{after_submit: null|(object{message: string}&\Stripe\StripeObject), shipping_address: null|(object{message: string}&\Stripe\StripeObject), submit: null|(object{message: string}&\Stripe\StripeObject), terms_of_service_acceptance: null|(object{message: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $custom_text * @property null|string|\Stripe\Customer $customer The ID of the customer for this Session. For Checkout Sessions in subscription mode or Checkout Sessions with customer_creation set as always in payment mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created. * @property null|string $customer_creation Configure whether a Checkout Session creates a Customer when the Checkout Session completes. - * @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in setup mode. + * @property null|(object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string, phone: null|string, tax_exempt: null|string, tax_ids: null|((object{type: string, value: null|string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject) $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in setup mode. * @property null|string $customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the customer attribute. + * @property null|((object{coupon: null|string|\Stripe\Coupon, promotion_code: null|string|\Stripe\PromotionCode}&\Stripe\StripeObject))[] $discounts List of coupons and promotion codes attached to the Checkout Session. * @property int $expires_at The timestamp at which the Checkout Session will expire. * @property null|string|\Stripe\Invoice $invoice ID of the invoice created by the Checkout Session, if it exists. - * @property null|\Stripe\StripeObject $invoice_creation Details on the state of invoice creation for the Checkout Session. + * @property null|(object{enabled: bool, invoice_data: (object{account_tax_ids: null|(string|\Stripe\TaxId)[], custom_fields: null|(object{name: string, value: string}&\Stripe\StripeObject)[], description: null|string, footer: null|string, issuer: null|(object{account?: string|\Stripe\Account, type: string}&\Stripe\StripeObject), metadata: null|\Stripe\StripeObject, rendering_options: null|(object{amount_tax_display: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject) $invoice_creation Details on the state of invoice creation for the Checkout Session. * @property null|\Stripe\Collection<\Stripe\LineItem> $line_items The line items purchased by the customer. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $mode The mode of the Checkout Session. + * @property null|((object{adjustable_quantity: null|(object{enabled: bool, maximum: null|int, minimum: null|int}&\Stripe\StripeObject), price: string, quantity: int}&\Stripe\StripeObject))[] $optional_items The optional items presented to the customer at checkout. * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in payment mode. You can't confirm or cancel the PaymentIntent for a Checkout Session. To cancel, expire the Checkout Session instead. * @property null|string|\Stripe\PaymentLink $payment_link The ID of the Payment Link that created this Session. * @property null|string $payment_method_collection Configure whether a Checkout Session should collect a payment method. Defaults to always. - * @property null|\Stripe\StripeObject $payment_method_configuration_details Information about the payment method configuration used for this Checkout session if using dynamic payment methods. - * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. + * @property null|(object{id: string, parent: null|string}&\Stripe\StripeObject) $payment_method_configuration_details Information about the payment method configuration used for this Checkout session if using dynamic payment methods. + * @property null|(object{acss_debit?: (object{currency?: string, mandate_options?: (object{custom_mandate_url?: string, default_for?: string[], interval_description: null|string, payment_schedule: null|string, transaction_type: null|string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string, verification_method?: string}&\Stripe\StripeObject), affirm?: (object{setup_future_usage?: string}&\Stripe\StripeObject), afterpay_clearpay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), alipay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), amazon_pay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), au_becs_debit?: (object{setup_future_usage?: string, target_date?: string}&\Stripe\StripeObject), bacs_debit?: (object{mandate_options?: (object{reference_prefix?: string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string}&\Stripe\StripeObject), bancontact?: (object{setup_future_usage?: string}&\Stripe\StripeObject), boleto?: (object{expires_after_days: int, setup_future_usage?: string}&\Stripe\StripeObject), card?: (object{installments?: (object{enabled?: bool}&\Stripe\StripeObject), request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure: string, restrictions?: (object{brands_blocked?: string[]}&\Stripe\StripeObject), setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}&\Stripe\StripeObject), cashapp?: (object{setup_future_usage?: string}&\Stripe\StripeObject), customer_balance?: (object{bank_transfer?: (object{eu_bank_transfer?: (object{country: string}&\Stripe\StripeObject), requested_address_types?: string[], type: null|string}&\Stripe\StripeObject), funding_type: null|string, setup_future_usage?: string}&\Stripe\StripeObject), eps?: (object{setup_future_usage?: string}&\Stripe\StripeObject), fpx?: (object{setup_future_usage?: string}&\Stripe\StripeObject), giropay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), grabpay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), ideal?: (object{setup_future_usage?: string}&\Stripe\StripeObject), kakao_pay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), klarna?: (object{setup_future_usage?: string}&\Stripe\StripeObject), konbini?: (object{expires_after_days: null|int, setup_future_usage?: string}&\Stripe\StripeObject), kr_card?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), link?: (object{setup_future_usage?: string}&\Stripe\StripeObject), mobilepay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), multibanco?: (object{setup_future_usage?: string}&\Stripe\StripeObject), naver_pay?: (object{capture_method?: string}&\Stripe\StripeObject), oxxo?: (object{expires_after_days: int, setup_future_usage?: string}&\Stripe\StripeObject), p24?: (object{setup_future_usage?: string}&\Stripe\StripeObject), payco?: (object{capture_method?: string}&\Stripe\StripeObject), paynow?: (object{setup_future_usage?: string}&\Stripe\StripeObject), paypal?: (object{capture_method?: string, preferred_locale: null|string, reference: null|string, setup_future_usage?: string}&\Stripe\StripeObject), pix?: (object{expires_after_seconds: null|int}&\Stripe\StripeObject), revolut_pay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), samsung_pay?: (object{capture_method?: string}&\Stripe\StripeObject), sepa_debit?: (object{mandate_options?: (object{reference_prefix?: string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string}&\Stripe\StripeObject), sofort?: (object{setup_future_usage?: string}&\Stripe\StripeObject), swish?: (object{reference: null|string}&\Stripe\StripeObject), us_bank_account?: (object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&\Stripe\StripeObject), permissions?: string[], prefetch: null|string[], return_url?: string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string, verification_method?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. * @property string $payment_status The payment status of the Checkout Session, one of paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order. - * @property null|\Stripe\StripeObject $phone_number_collection + * @property null|(object{update_shipping_details: null|string}&\Stripe\StripeObject) $permissions

This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.

For specific permissions, please refer to their dedicated subsections, such as permissions.update_shipping_details.

+ * @property null|(object{enabled: bool}&\Stripe\StripeObject) $phone_number_collection + * @property null|(object{presentment_amount: int, presentment_currency: string}&\Stripe\StripeObject) $presentment_details * @property null|string $recovered_from The ID of the original expired Checkout Session that triggered the recovery flow. * @property null|string $redirect_on_completion This parameter applies to ui_mode: embedded. Learn more about the redirect behavior of embedded sessions. Defaults to always. - * @property null|string $return_url Applies to Checkout Sessions with ui_mode: embedded. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. - * @property null|\Stripe\StripeObject $saved_payment_method_options Controls saved payment method settings for the session. Only available in payment and subscription mode. + * @property null|string $return_url Applies to Checkout Sessions with ui_mode: embedded or ui_mode: custom. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + * @property null|(object{allow_redisplay_filters: null|string[], payment_method_remove: null|string, payment_method_save: null|string}&\Stripe\StripeObject) $saved_payment_method_options Controls saved payment method settings for the session. Only available in payment and subscription mode. * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in setup mode. You can't confirm or cancel the SetupIntent for a Checkout Session. To cancel, expire the Checkout Session instead. - * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer. - * @property null|\Stripe\StripeObject $shipping_cost The details of the customer cost of shipping, including the customer chosen ShippingRate. - * @property null|\Stripe\StripeObject $shipping_details Shipping information for this Checkout Session. - * @property \Stripe\StripeObject[] $shipping_options The shipping rate options applied to this Session. + * @property null|(object{allowed_countries: string[]}&\Stripe\StripeObject) $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer. + * @property null|(object{amount_subtotal: int, amount_tax: int, amount_total: int, shipping_rate: null|string|\Stripe\ShippingRate, taxes?: ((object{amount: int, rate: \Stripe\TaxRate, taxability_reason: null|string, taxable_amount: null|int}&\Stripe\StripeObject))[]}&\Stripe\StripeObject) $shipping_cost The details of the customer cost of shipping, including the customer chosen ShippingRate. + * @property ((object{shipping_amount: int, shipping_rate: string|\Stripe\ShippingRate}&\Stripe\StripeObject))[] $shipping_options The shipping rate options applied to this Session. * @property null|string $status The status of the Checkout Session, one of open, complete, or expired. * @property null|string $submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode. If blank or auto, pay is used. * @property null|string|\Stripe\Subscription $subscription The ID of the subscription for Checkout Sessions in subscription mode. * @property null|string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. - * @property null|\Stripe\StripeObject $tax_id_collection - * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. + * @property null|(object{enabled: bool, required: string}&\Stripe\StripeObject) $tax_id_collection + * @property null|(object{amount_discount: int, amount_shipping: null|int, amount_tax: int, breakdown?: (object{discounts: (object{amount: int, discount: \Stripe\Discount}&\Stripe\StripeObject)[], taxes: ((object{amount: int, rate: \Stripe\TaxRate, taxability_reason: null|string, taxable_amount: null|int}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $total_details Tax and discount details for the computed total amount. * @property null|string $ui_mode The UI mode of the Session. Defaults to hosted. - * @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. This value is only present when the session is active. + * @property null|string $url The URL to the Checkout Session. Applies to Checkout Sessions with ui_mode: hosted. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. This value is only present when the session is active. + * @property null|(object{link?: (object{display?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $wallet_options Wallet-specific configuration for this Checkout Session. */ class Session extends \Stripe\ApiResource { @@ -114,18 +119,19 @@ class Session extends \Stripe\ApiResource const SUBMIT_TYPE_PAY = 'pay'; const SUBMIT_TYPE_SUBSCRIBE = 'subscribe'; + const UI_MODE_CUSTOM = 'custom'; const UI_MODE_EMBEDDED = 'embedded'; const UI_MODE_HOSTED = 'hosted'; /** - * Creates a Session object. + * Creates a Checkout Session object. * - * @param null|array $params + * @param null|array{adaptive_pricing?: array{enabled?: bool}, after_expiration?: array{recovery?: array{allow_promotion_codes?: bool, enabled: bool}}, allow_promotion_codes?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_address_collection?: string, cancel_url?: string, client_reference_id?: string, consent_collection?: array{payment_method_reuse_agreement?: array{position: string}, promotions?: string, terms_of_service?: string}, currency?: string, custom_fields?: array{dropdown?: array{default_value?: string, options: array{label: string, value: string}[]}, key: string, label: array{custom: string, type: string}, numeric?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, optional?: bool, text?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, type: string}[], custom_text?: array{after_submit?: null|array{message: string}, shipping_address?: null|array{message: string}, submit?: null|array{message: string}, terms_of_service_acceptance?: null|array{message: string}}, customer?: string, customer_creation?: string, customer_email?: string, customer_update?: array{address?: string, name?: string, shipping?: string}, discounts?: array{coupon?: string, promotion_code?: string}[], expand?: string[], expires_at?: int, invoice_creation?: array{enabled: bool, invoice_data?: array{account_tax_ids?: null|string[], custom_fields?: null|array{name: string, value: string}[], description?: string, footer?: string, issuer?: array{account?: string, type: string}, metadata?: array, rendering_options?: null|array{amount_tax_display?: null|string}}}, line_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, dynamic_tax_rates?: string[], price?: string, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string}, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: string[]}[], locale?: string, metadata?: array, mode?: string, optional_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, price: string, quantity: int}[], payment_intent_data?: array{application_fee_amount?: int, capture_method?: string, description?: string, metadata?: array, on_behalf_of?: string, receipt_email?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string}, payment_method_collection?: string, payment_method_configuration?: string, payment_method_data?: array{allow_redisplay?: string}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: string, target_date?: string, verification_method?: string}, affirm?: array{setup_future_usage?: string}, afterpay_clearpay?: array{setup_future_usage?: string}, alipay?: array{setup_future_usage?: string}, amazon_pay?: array{setup_future_usage?: string}, au_becs_debit?: array{setup_future_usage?: string, target_date?: string}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, bancontact?: array{setup_future_usage?: string}, boleto?: array{expires_after_days?: int, setup_future_usage?: string}, card?: array{installments?: array{enabled?: bool}, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, restrictions?: array{brands_blocked?: string[]}, setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}, cashapp?: array{setup_future_usage?: string}, customer_balance?: array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: array{setup_future_usage?: string}, fpx?: array{setup_future_usage?: string}, giropay?: array{setup_future_usage?: string}, grabpay?: array{setup_future_usage?: string}, ideal?: array{setup_future_usage?: string}, kakao_pay?: array{capture_method?: string, setup_future_usage?: string}, klarna?: array{setup_future_usage?: string}, konbini?: array{expires_after_days?: int, setup_future_usage?: string}, kr_card?: array{capture_method?: string, setup_future_usage?: string}, link?: array{setup_future_usage?: string}, mobilepay?: array{setup_future_usage?: string}, multibanco?: array{setup_future_usage?: string}, naver_pay?: array{capture_method?: string, setup_future_usage?: string}, oxxo?: array{expires_after_days?: int, setup_future_usage?: string}, p24?: array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: array{}, payco?: array{capture_method?: string}, paynow?: array{setup_future_usage?: string}, paypal?: array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, pix?: array{expires_after_seconds?: int}, revolut_pay?: array{setup_future_usage?: string}, samsung_pay?: array{capture_method?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, sofort?: array{setup_future_usage?: string}, swish?: array{reference?: string}, us_bank_account?: array{financial_connections?: array{permissions?: string[], prefetch?: string[]}, setup_future_usage?: string, target_date?: string, verification_method?: string}, wechat_pay?: array{app_id?: string, client: string, setup_future_usage?: string}}, payment_method_types?: string[], permissions?: array{update_shipping_details?: string}, phone_number_collection?: array{enabled: bool}, redirect_on_completion?: string, return_url?: string, saved_payment_method_options?: array{allow_redisplay_filters?: string[], payment_method_save?: string}, setup_intent_data?: array{description?: string, metadata?: array, on_behalf_of?: string}, shipping_address_collection?: array{allowed_countries: string[]}, shipping_options?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}[], submit_type?: string, subscription_data?: array{application_fee_percent?: float, billing_cycle_anchor?: int, default_tax_rates?: string[], description?: string, invoice_settings?: array{issuer?: array{account?: string, type: string}}, metadata?: array, on_behalf_of?: string, proration_behavior?: string, transfer_data?: array{amount_percent?: float, destination: string}, trial_end?: int, trial_period_days?: int, trial_settings?: array{end_behavior: array{missing_payment_method: string}}}, success_url?: string, tax_id_collection?: array{enabled: bool, required?: string}, ui_mode?: string, wallet_options?: array{link?: array{display?: string}}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Session the created resource * - * @return \Stripe\Checkout\Session the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -142,12 +148,12 @@ class Session extends \Stripe\ApiResource /** * Returns a list of Checkout Sessions. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, customer_details?: array{email: string}, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, payment_link?: string, starting_after?: string, status?: string, subscription?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Checkout\Session> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -157,14 +163,14 @@ class Session extends \Stripe\ApiResource } /** - * Retrieves a Session object. + * Retrieves a Checkout Session object. * * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Session * - * @return \Stripe\Checkout\Session + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -176,15 +182,15 @@ class Session extends \Stripe\ApiResource } /** - * Updates a Session object. + * Updates a Checkout Session object. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{collected_information?: array{shipping_details?: array{address: array{city?: string, country: string, line1: string, line2?: string, postal_code?: string, state?: string}, name: string}}, expand?: string[], metadata?: null|array, shipping_options?: null|array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}[]} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Session the updated resource * - * @return \Stripe\Checkout\Session the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -202,9 +208,9 @@ class Session extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Session the expired session * - * @return \Stripe\Checkout\Session the expired session + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function expire($params = null, $opts = null) { @@ -220,9 +226,9 @@ class Session extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\LineItem> list of line items + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function allLineItems($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Climate/Order.php b/plugins/stripe-php/lib/Climate/Order.php index 5d96204c..4201faf1 100644 --- a/plugins/stripe-php/lib/Climate/Order.php +++ b/plugins/stripe-php/lib/Climate/Order.php @@ -13,7 +13,7 @@ namespace Stripe\Climate; * @property int $amount_fees Total amount of Frontier's service fees in the currency's smallest unit. * @property int $amount_subtotal Total amount of the carbon removal in the currency's smallest unit. * @property int $amount_total Total amount of the order including fees in the currency's smallest unit. - * @property null|\Stripe\StripeObject $beneficiary + * @property null|(object{public_name: string}&\Stripe\StripeObject) $beneficiary * @property null|int $canceled_at Time at which the order was canceled. Measured in seconds since the Unix epoch. * @property null|string $cancellation_reason Reason for the cancellation of this order. * @property null|string $certificate For delivered orders, a URL to a delivery certificate for the order. @@ -22,12 +22,12 @@ namespace Stripe\Climate; * @property string $currency Three-letter ISO currency code, in lowercase, representing the currency for this order. * @property null|int $delayed_at Time at which the order's expected_delivery_year was delayed. Measured in seconds since the Unix epoch. * @property null|int $delivered_at Time at which the order was delivered. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject[] $delivery_details Details about the delivery of carbon removal for this order. + * @property ((object{delivered_at: int, location: null|(object{city: null|string, country: string, latitude: null|float, longitude: null|float, region: null|string}&\Stripe\StripeObject), metric_tons: string, registry_url: null|string, supplier: Supplier}&\Stripe\StripeObject))[] $delivery_details Details about the delivery of carbon removal for this order. * @property int $expected_delivery_year The year this order is expected to be delivered. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $metric_tons Quantity of carbon removal that is included in this order. - * @property string|\Stripe\Climate\Product $product Unique ID for the Climate Product this order is purchasing. + * @property Product|string $product Unique ID for the Climate Product this order is purchasing. * @property null|int $product_substituted_at Time at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch. * @property string $status The current status of this order. */ @@ -52,12 +52,12 @@ class Order extends \Stripe\ApiResource * processed immediately after creation and payment will be deducted your Stripe * balance. * - * @param null|array $params + * @param null|array{amount?: int, beneficiary?: array{public_name: string}, currency?: string, expand?: string[], metadata?: array, metric_tons?: string, product: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Order the created resource * - * @return \Stripe\Climate\Order the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -75,12 +75,12 @@ class Order extends \Stripe\ApiResource * Lists all Climate order objects. The orders are returned sorted by creation * date, with the most recently created orders appearing first. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Climate\Order> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -95,9 +95,9 @@ class Order extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Order * - * @return \Stripe\Climate\Order + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -112,12 +112,12 @@ class Order extends \Stripe\ApiResource * Updates the specified order by setting the values of the parameters passed. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{beneficiary?: null|array{public_name: null|string}, expand?: string[], metadata?: array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Order the updated resource * - * @return \Stripe\Climate\Order the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -135,9 +135,9 @@ class Order extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Order the canceled order * - * @return \Stripe\Climate\Order the canceled order + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Climate/Product.php b/plugins/stripe-php/lib/Climate/Product.php index 3b7bc61c..612d3851 100644 --- a/plugins/stripe-php/lib/Climate/Product.php +++ b/plugins/stripe-php/lib/Climate/Product.php @@ -16,7 +16,7 @@ namespace Stripe\Climate; * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $metric_tons_available The quantity of metric tons available for reservation. * @property string $name The Climate product's name. - * @property \Stripe\Climate\Supplier[] $suppliers The carbon removal suppliers that fulfill orders for this Climate product. + * @property Supplier[] $suppliers The carbon removal suppliers that fulfill orders for this Climate product. */ class Product extends \Stripe\ApiResource { @@ -25,12 +25,12 @@ class Product extends \Stripe\ApiResource /** * Lists all available Climate product objects. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Climate\Product> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -45,9 +45,9 @@ class Product extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Product * - * @return \Stripe\Climate\Product + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Climate/Supplier.php b/plugins/stripe-php/lib/Climate/Supplier.php index 4b298c9d..02044540 100644 --- a/plugins/stripe-php/lib/Climate/Supplier.php +++ b/plugins/stripe-php/lib/Climate/Supplier.php @@ -11,7 +11,7 @@ namespace Stripe\Climate; * @property string $object String representing the object’s type. Objects of the same type share the same value. * @property string $info_url Link to a webpage to learn more about the supplier. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject[] $locations The locations in which this supplier operates. + * @property ((object{city: null|string, country: string, latitude: null|float, longitude: null|float, region: null|string}&\Stripe\StripeObject))[] $locations The locations in which this supplier operates. * @property string $name Name of this carbon removal supplier. * @property string $removal_pathway The scientific pathway used for carbon removal. */ @@ -26,12 +26,12 @@ class Supplier extends \Stripe\ApiResource /** * Lists all available Climate supplier objects. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Climate\Supplier> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -46,9 +46,9 @@ class Supplier extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Supplier * - * @return \Stripe\Climate\Supplier + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Collection.php b/plugins/stripe-php/lib/Collection.php index bd8d7db8..b8c1d4bd 100644 --- a/plugins/stripe-php/lib/Collection.php +++ b/plugins/stripe-php/lib/Collection.php @@ -6,6 +6,7 @@ namespace Stripe; * Class Collection. * * @template TStripeObject of StripeObject + * * @template-implements \IteratorAggregate * * @property string $object @@ -59,10 +60,10 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate if (\is_string($k)) { return parent::offsetGet($k); } - $msg = "You tried to access the {$k} index, but Collection " . - 'types only support string keys. (HINT: List calls ' . - 'return an object with a `data` (which is the data ' . - "array). You likely want to call ->data[{$k}])"; + $msg = "You tried to access the {$k} index, but Collection " + . 'types only support string keys. (HINT: List calls ' + . 'return an object with a `data` (which is the data ' + . "array). You likely want to call ->data[{$k}])"; throw new Exception\InvalidArgumentException($msg); } @@ -71,9 +72,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @param null|array $params * @param null|array|string $opts * - * @throws Exception\ApiErrorException - * * @return Collection + * + * @throws Exception\ApiErrorException */ public function all($params = null, $opts = null) { @@ -82,9 +83,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate list($response, $opts) = $this->_request('get', $url, $params, $opts); $obj = Util\Util::convertToStripeObject($response, $opts); - if (!($obj instanceof \Stripe\Collection)) { - throw new \Stripe\Exception\UnexpectedValueException( - 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' + if (!$obj instanceof Collection) { + throw new Exception\UnexpectedValueException( + 'Expected type ' . Collection::class . ', got "' . \get_class($obj) . '" instead.' ); } $obj->setFilters($params); @@ -96,9 +97,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @param null|array $params * @param null|array|string $opts * - * @throws Exception\ApiErrorException - * * @return TStripeObject + * + * @throws Exception\ApiErrorException */ public function create($params = null, $opts = null) { @@ -115,9 +116,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @param null|array $params * @param null|array|string $opts * - * @throws Exception\ApiErrorException - * * @return TStripeObject + * + * @throws Exception\ApiErrorException */ public function retrieve($id, $params = null, $opts = null) { @@ -165,12 +166,12 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate } /** - * @throws Exception\ApiErrorException - * * @return \Generator|TStripeObject[] A generator that can be used to * iterate across all objects across all pages. As page boundaries are * encountered, the next page will be fetched automatically for * continued iteration. + * + * @throws Exception\ApiErrorException */ public function autoPagingIterator() { @@ -230,9 +231,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @param null|array $params * @param null|array|string $opts * - * @throws Exception\ApiErrorException - * * @return Collection + * + * @throws Exception\ApiErrorException */ public function nextPage($params = null, $opts = null) { @@ -260,9 +261,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @param null|array $params * @param null|array|string $opts * - * @throws Exception\ApiErrorException - * * @return Collection + * + * @throws Exception\ApiErrorException */ public function previousPage($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/ConfirmationToken.php b/plugins/stripe-php/lib/ConfirmationToken.php index 0ef4b8a9..9b06e8b2 100644 --- a/plugins/stripe-php/lib/ConfirmationToken.php +++ b/plugins/stripe-php/lib/ConfirmationToken.php @@ -18,14 +18,14 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|int $expires_at Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $mandate_data Data used for generating a Mandate. + * @property null|(object{customer_acceptance: (object{online: null|(object{ip_address: null|string, user_agent: null|string}&StripeObject), type: string}&StripeObject)}&StripeObject) $mandate_data Data used for generating a Mandate. * @property null|string $payment_intent ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. - * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this ConfirmationToken. - * @property null|\Stripe\StripeObject $payment_method_preview Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. + * @property null|(object{card: null|(object{cvc_token: null|string, installments?: (object{plan?: (object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject)}&StripeObject)}&StripeObject) $payment_method_options Payment-method-specific configuration for this ConfirmationToken. + * @property null|(object{acss_debit?: (object{bank_name: null|string, fingerprint: null|string, institution_number: null|string, last4: null|string, transit_number: null|string}&StripeObject), affirm?: (object{}&StripeObject), afterpay_clearpay?: (object{}&StripeObject), alipay?: (object{}&StripeObject), allow_redisplay?: string, alma?: (object{}&StripeObject), amazon_pay?: (object{}&StripeObject), au_becs_debit?: (object{bsb_number: null|string, fingerprint: null|string, last4: null|string}&StripeObject), bacs_debit?: (object{fingerprint: null|string, last4: null|string, sort_code: null|string}&StripeObject), bancontact?: (object{}&StripeObject), billie?: (object{}&StripeObject), billing_details: (object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string, tax_id: null|string}&StripeObject), blik?: (object{}&StripeObject), boleto?: (object{tax_id: string}&StripeObject), card?: (object{brand: string, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description?: null|string, display_brand: null|string, exp_month: int, exp_year: int, fingerprint?: null|string, funding: string, generated_from: null|(object{charge: null|string, payment_method_details: null|(object{card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), type: string}&StripeObject), setup_attempt: null|SetupAttempt|string}&StripeObject), iin?: null|string, issuer?: null|string, last4: string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), regulated_status: null|string, three_d_secure_usage: null|(object{supported: bool}&StripeObject), wallet: null|(object{amex_express_checkout?: (object{}&StripeObject), apple_pay?: (object{}&StripeObject), dynamic_last4: null|string, google_pay?: (object{}&StripeObject), link?: (object{}&StripeObject), masterpass?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject), samsung_pay?: (object{}&StripeObject), type: string, visa_checkout?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject)}&StripeObject)}&StripeObject), card_present?: (object{brand: null|string, brand_product: null|string, cardholder_name: null|string, country: null|string, description?: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), preferred_locales: null|string[], read_method: null|string, wallet?: (object{type: string}&StripeObject)}&StripeObject), cashapp?: (object{buyer_id: null|string, cashtag: null|string}&StripeObject), customer: null|Customer|string, customer_balance?: (object{}&StripeObject), eps?: (object{bank: null|string}&StripeObject), fpx?: (object{account_holder_type: null|string, bank: string}&StripeObject), giropay?: (object{}&StripeObject), grabpay?: (object{}&StripeObject), ideal?: (object{bank: null|string, bic: null|string}&StripeObject), interac_present?: (object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), preferred_locales: null|string[], read_method: null|string}&StripeObject), kakao_pay?: (object{}&StripeObject), klarna?: (object{dob?: null|(object{day: null|int, month: null|int, year: null|int}&StripeObject)}&StripeObject), konbini?: (object{}&StripeObject), kr_card?: (object{brand: null|string, last4: null|string}&StripeObject), link?: (object{email: null|string, persistent_token?: string}&StripeObject), mobilepay?: (object{}&StripeObject), multibanco?: (object{}&StripeObject), naver_pay?: (object{buyer_id?: null|string, funding: string}&StripeObject), nz_bank_account?: (object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, last4: string, suffix: null|string}&StripeObject), oxxo?: (object{}&StripeObject), p24?: (object{bank: null|string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{}&StripeObject), paynow?: (object{}&StripeObject), paypal?: (object{country: null|string, payer_email: null|string, payer_id: null|string}&StripeObject), pix?: (object{}&StripeObject), promptpay?: (object{}&StripeObject), revolut_pay?: (object{}&StripeObject), samsung_pay?: (object{}&StripeObject), satispay?: (object{}&StripeObject), sepa_debit?: (object{bank_code: null|string, branch_code: null|string, country: null|string, fingerprint: null|string, generated_from: null|(object{charge: null|Charge|string, setup_attempt: null|SetupAttempt|string}&StripeObject), last4: null|string}&StripeObject), sofort?: (object{country: null|string}&StripeObject), swish?: (object{}&StripeObject), twint?: (object{}&StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, financial_connections_account: null|string, fingerprint: null|string, last4: null|string, networks: null|(object{preferred: null|string, supported: string[]}&StripeObject), routing_number: null|string, status_details: null|(object{blocked?: (object{network_code: null|string, reason: null|string}&StripeObject)}&StripeObject)}&StripeObject), wechat_pay?: (object{}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $payment_method_preview Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. * @property null|string $return_url Return URL used to confirm the Intent. * @property null|string $setup_future_usage

Indicates that you intend to make future payments with this ConfirmationToken's payment method.

The presence of this property will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.

* @property null|string $setup_intent ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. - * @property null|\Stripe\StripeObject $shipping Shipping information collected on this ConfirmationToken. + * @property null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), name: string, phone: null|string}&StripeObject) $shipping Shipping information collected on this ConfirmationToken. * @property bool $use_stripe_sdk Indicates whether the Stripe SDK is used to handle confirmation flow. Defaults to true on ConfirmationToken. */ class ConfirmationToken extends ApiResource @@ -41,13 +41,13 @@ class ConfirmationToken extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ConfirmationToken * - * @return \Stripe\ConfirmationToken + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/ConnectCollectionTransfer.php b/plugins/stripe-php/lib/ConnectCollectionTransfer.php index 69f961d0..837547a2 100644 --- a/plugins/stripe-php/lib/ConnectCollectionTransfer.php +++ b/plugins/stripe-php/lib/ConnectCollectionTransfer.php @@ -9,7 +9,7 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Amount transferred, in cents (or local equivalent). * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Account $destination ID of the account that funds are being collected for. + * @property Account|string $destination ID of the account that funds are being collected for. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. */ class ConnectCollectionTransfer extends ApiResource diff --git a/plugins/stripe-php/lib/CountrySpec.php b/plugins/stripe-php/lib/CountrySpec.php index aa601a7a..1fdce380 100644 --- a/plugins/stripe-php/lib/CountrySpec.php +++ b/plugins/stripe-php/lib/CountrySpec.php @@ -15,11 +15,11 @@ namespace Stripe; * @property string $id Unique identifier for the object. Represented as the ISO country code for this country. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string $default_currency The default currency for this country. This applies to both payment methods and bank accounts. - * @property \Stripe\StripeObject $supported_bank_account_currencies Currencies that can be accepted in the specific country (for transfers). + * @property StripeObject $supported_bank_account_currencies Currencies that can be accepted in the specific country (for transfers). * @property string[] $supported_payment_currencies Currencies that can be accepted in the specified country (for payments). * @property string[] $supported_payment_methods Payment methods available in the specified country. You may need to enable some payment methods (e.g., ACH) on your account before they appear in this list. The stripe payment method refers to charging through your platform. * @property string[] $supported_transfer_countries Countries that can accept transfers from the specified country. - * @property \Stripe\StripeObject $verification_fields + * @property (object{company: (object{additional: string[], minimum: string[]}&StripeObject), individual: (object{additional: string[], minimum: string[]}&StripeObject)}&StripeObject) $verification_fields */ class CountrySpec extends ApiResource { @@ -28,18 +28,18 @@ class CountrySpec extends ApiResource /** * Lists all Country Spec objects available in the API. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\CountrySpec> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -48,13 +48,13 @@ class CountrySpec extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CountrySpec * - * @return \Stripe\CountrySpec + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/Coupon.php b/plugins/stripe-php/lib/Coupon.php index cf110919..1cd8ca97 100644 --- a/plugins/stripe-php/lib/Coupon.php +++ b/plugins/stripe-php/lib/Coupon.php @@ -12,15 +12,15 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|int $amount_off Amount (in the currency specified) that will be taken off the subtotal of any invoices for this customer. - * @property null|\Stripe\StripeObject $applies_to + * @property null|(object{products: string[]}&StripeObject) $applies_to * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency If amount_off has been set, the three-letter ISO code for the currency of the amount to take off. - * @property null|\Stripe\StripeObject $currency_options Coupons defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency. - * @property string $duration One of forever, once, and repeating. Describes how long a customer who applies this coupon will get the discount. + * @property null|StripeObject $currency_options Coupons defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency. + * @property string $duration One of forever, once, or repeating. Describes how long a customer who applies this coupon will get the discount. * @property null|int $duration_in_months If duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|int $max_redemptions Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name Name of the coupon displayed to customers on for instance invoices or receipts. * @property null|float $percent_off Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead. * @property null|int $redeem_by Date after which the coupon can no longer be redeemed. @@ -53,12 +53,12 @@ class Coupon extends ApiResource * a coupon with an amount_off of 200 is applied to * it. * - * @param null|array $params + * @param null|array{amount_off?: int, applies_to?: array{products?: string[]}, currency?: string, currency_options?: array, duration?: string, duration_in_months?: int, expand?: string[], id?: string, max_redemptions?: int, metadata?: null|array, name?: string, percent_off?: float, redeem_by?: int} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Coupon the created resource * - * @return \Stripe\Coupon the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -66,7 +66,7 @@ class Coupon extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -82,9 +82,9 @@ class Coupon extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Coupon the deleted resource * - * @return \Stripe\Coupon the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -100,18 +100,18 @@ class Coupon extends ApiResource /** * Returns a list of your coupons. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Coupon> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -120,13 +120,13 @@ class Coupon extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Coupon * - * @return \Stripe\Coupon + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -138,12 +138,12 @@ class Coupon extends ApiResource * amount_off) are, by design, not editable. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{currency_options?: array, expand?: string[], metadata?: null|array, name?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Coupon the updated resource * - * @return \Stripe\Coupon the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -151,7 +151,7 @@ class Coupon extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/CreditNote.php b/plugins/stripe-php/lib/CreditNote.php index d19b102c..2ec4f861 100644 --- a/plugins/stripe-php/lib/CreditNote.php +++ b/plugins/stripe-php/lib/CreditNote.php @@ -15,29 +15,29 @@ namespace Stripe; * @property int $amount_shipping This is the sum of all the shipping amounts. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Customer $customer ID of the customer. - * @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note. + * @property Customer|string $customer ID of the customer. + * @property null|CustomerBalanceTransaction|string $customer_balance_transaction Customer balance transaction related to this credit note. * @property int $discount_amount The integer amount in cents (or local equivalent) representing the total amount of discount that was credited. - * @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items. + * @property ((object{amount: int, discount: Discount|string}&StripeObject))[] $discount_amounts The aggregate amounts calculated per discount for all line items. * @property null|int $effective_at The date when this credit note is in effect. Same as created unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. - * @property string|\Stripe\Invoice $invoice ID of the invoice. - * @property \Stripe\Collection<\Stripe\CreditNoteLineItem> $lines Line items that make up the credit note + * @property Invoice|string $invoice ID of the invoice. + * @property Collection $lines Line items that make up the credit note * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $memo Customer-facing text that appears on the credit note PDF. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. * @property null|int $out_of_band_amount Amount that was credited outside of Stripe. * @property string $pdf The link to download the PDF of the credit note. - * @property null|\Stripe\StripeObject[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for all line items. + * @property ((object{amount: int, credit_balance_transaction?: Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for all line items. * @property null|string $reason Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory - * @property null|string|\Stripe\Refund $refund Refund related to this credit note. - * @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied to the invoice. + * @property ((object{amount_refunded: int, refund: Refund|string}&StripeObject))[] $refunds Refunds related to this credit note. + * @property null|(object{amount_subtotal: int, amount_tax: int, amount_total: int, shipping_rate: null|ShippingRate|string, taxes?: ((object{amount: int, rate: TaxRate, taxability_reason: null|string, taxable_amount: null|int}&StripeObject))[]}&StripeObject) $shipping_cost The details of the cost of shipping, including the ShippingRate applied to the invoice. * @property string $status Status of this credit note, one of issued or void. Learn more about voiding credit notes. * @property int $subtotal The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts. * @property null|int $subtotal_excluding_tax The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts. - * @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items. * @property int $total The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount. * @property null|int $total_excluding_tax The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. + * @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $total_taxes The aggregate tax information for all line items. * @property string $type Type of this credit note, one of pre_payment or post_payment. A pre_payment credit note means it was issued when the invoice was open. A post_payment credit note means it was issued when the invoice was paid. * @property null|int $voided_at The time that the credit note was voided. */ @@ -64,7 +64,7 @@ class CreditNote extends ApiResource * status=open invoice, a credit note reduces its * amount_due. For a status=paid invoice, a credit note * does not affect its amount_due. Instead, it can result in any - * combination of the following:. + * combination of the following: * *
  • Refund: create a new refund (using refund_amount) or link * an existing refund (using refund).
  • Customer balance @@ -81,12 +81,12 @@ class CreditNote extends ApiResource * post_payment_credit_notes_amount depending on its * status at the time of credit note creation. * - * @param null|array $params + * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, refund?: string}[], shipping_cost?: array{shipping_rate?: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditNote the created resource * - * @return \Stripe\CreditNote the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -94,7 +94,7 @@ class CreditNote extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -103,18 +103,18 @@ class CreditNote extends ApiResource /** * Returns a list of credit notes. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], invoice?: string, limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\CreditNote> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -123,13 +123,13 @@ class CreditNote extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditNote * - * @return \Stripe\CreditNote + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -140,12 +140,12 @@ class CreditNote extends ApiResource * Updates an existing credit note. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], memo?: string, metadata?: array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditNote the updated resource * - * @return \Stripe\CreditNote the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -153,7 +153,7 @@ class CreditNote extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -163,15 +163,15 @@ class CreditNote extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditNote the previewed credit note * - * @return \Stripe\CreditNote the previewed credit note + * @throws Exception\ApiErrorException if the request fails */ public static function preview($params = null, $opts = null) { $url = static::classUrl() . '/preview'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -181,15 +181,15 @@ class CreditNote extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection list of credit note line items * - * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> list of credit note line items + * @throws Exception\ApiErrorException if the request fails */ public static function previewLines($params = null, $opts = null) { $url = static::classUrl() . '/preview/lines'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -199,9 +199,9 @@ class CreditNote extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditNote the voided credit note * - * @return \Stripe\CreditNote the voided credit note + * @throws Exception\ApiErrorException if the request fails */ public function voidCreditNote($params = null, $opts = null) { @@ -219,9 +219,9 @@ class CreditNote extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection the list of credit note line items * - * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> the list of credit note line items + * @throws Exception\ApiErrorException if the request fails */ public static function allLines($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/CreditNoteLineItem.php b/plugins/stripe-php/lib/CreditNoteLineItem.php index 357dc0fb..10b2d3d6 100644 --- a/plugins/stripe-php/lib/CreditNoteLineItem.php +++ b/plugins/stripe-php/lib/CreditNoteLineItem.php @@ -10,20 +10,18 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. - * @property null|int $amount_excluding_tax The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts. * @property null|string $description Description of the item being credited. * @property int $discount_amount The integer amount in cents (or local equivalent) representing the discount being credited for this line item. - * @property \Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item + * @property ((object{amount: int, discount: Discount|string}&StripeObject))[] $discount_amounts The amount of discount calculated per discount for this line item * @property null|string $invoice_line_item ID of the invoice line item being credited * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for this line item. + * @property ((object{amount: int, credit_balance_transaction?: Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for this line item. * @property null|int $quantity The number of units of product being credited. - * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item - * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. + * @property TaxRate[] $tax_rates The tax rates which apply to the line item. + * @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $taxes The tax information of the line item. * @property string $type The type of the credit note line item, one of invoice_line_item or custom_line_item. When the type is invoice_line_item there is an additional invoice_line_item property on the resource the value of which is the id of the credited line item on the invoice. * @property null|int $unit_amount The cost of each unit of product being credited. * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. - * @property null|string $unit_amount_excluding_tax The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. */ class CreditNoteLineItem extends ApiResource { diff --git a/plugins/stripe-php/lib/Customer.php b/plugins/stripe-php/lib/Customer.php index 1c7d246f..14019214 100644 --- a/plugins/stripe-php/lib/Customer.php +++ b/plugins/stripe-php/lib/Customer.php @@ -10,32 +10,32 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $address The customer's address. + * @property null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject) $address The customer's address. * @property null|int $balance The current balance, if any, that's stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize. - * @property null|\Stripe\CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The settings[reconciliation_mode] field describes if these funds apply to these payment intents manually or automatically. + * @property null|CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The settings[reconciliation_mode] field describes if these funds apply to these payment intents manually or automatically. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes. - * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source

    ID of the default payment source for the customer.

    If you use payment methods created through the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

    + * @property null|Account|BankAccount|Card|Source|string $default_source

    ID of the default payment source for the customer.

    If you use payment methods created through the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

    * @property null|bool $delinquent

    Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the invoice.due_date will set this field to true.

    If an invoice becomes uncollectible by dunning, delinquent doesn't reset to false.

    If you care whether the customer has paid their most recent subscription invoice, use subscription.status instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to false.

    * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one. + * @property null|Discount $discount Describes the current discount active on the customer, if there is one. * @property null|string $email The customer's email address. - * @property null|\Stripe\StripeObject $invoice_credit_balance The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. + * @property null|StripeObject $invoice_credit_balance The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. * @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers. - * @property null|\Stripe\StripeObject $invoice_settings + * @property null|(object{custom_fields: null|(object{name: string, value: string}&StripeObject)[], default_payment_method: null|PaymentMethod|string, footer: null|string, rendering_options: null|(object{amount_tax_display: null|string, template: null|string}&StripeObject)}&StripeObject) $invoice_settings * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name The customer's full name or business name. * @property null|int $next_invoice_sequence The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses. * @property null|string $phone The customer's phone number. * @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference. - * @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. - * @property null|\Stripe\Collection<\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source> $sources The customer's payment sources, if any. - * @property null|\Stripe\Collection<\Stripe\Subscription> $subscriptions The customer's current subscriptions, if any. - * @property null|\Stripe\StripeObject $tax + * @property null|(object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), carrier?: null|string, name?: string, phone?: null|string, tracking_number?: null|string}&StripeObject) $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. + * @property null|Collection $sources The customer's payment sources, if any. + * @property null|Collection $subscriptions The customer's current subscriptions, if any. + * @property null|(object{automatic_tax: string, ip_address: null|string, location: null|(object{country: string, source: string, state: null|string}&StripeObject)}&StripeObject) $tax * @property null|string $tax_exempt Describes the customer's tax exemption status, which is none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the following text: "Reverse charge". - * @property null|\Stripe\Collection<\Stripe\TaxId> $tax_ids The customer's tax IDs. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock that this customer belongs to. + * @property null|Collection $tax_ids The customer's tax IDs. + * @property null|string|TestHelpers\TestClock $test_clock ID of the test clock that this customer belongs to. */ class Customer extends ApiResource { @@ -51,12 +51,12 @@ class Customer extends ApiResource /** * Creates a new customer object. * - * @param null|array $params + * @param null|array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, balance?: int, cash_balance?: array{settings?: array{reconciliation_mode?: string}}, description?: string, email?: string, expand?: string[], invoice_prefix?: string, invoice_settings?: array{custom_fields?: null|array{name: string, value: string}[], default_payment_method?: string, footer?: string, rendering_options?: null|array{amount_tax_display?: null|string, template?: string}}, metadata?: null|array, name?: string, next_invoice_sequence?: int, payment_method?: string, phone?: string, preferred_locales?: string[], shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: string}, source?: string, tax?: array{ip_address?: null|string, validate_location?: string}, tax_exempt?: null|string, tax_id_data?: array{type: string, value: string}[], test_clock?: string, validate?: bool} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Customer the created resource * - * @return \Stripe\Customer the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -64,7 +64,7 @@ class Customer extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -77,9 +77,9 @@ class Customer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Customer the deleted resource * - * @return \Stripe\Customer the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -96,18 +96,18 @@ class Customer extends ApiResource * Returns a list of your customers. The customers are returned sorted by creation * date, with the most recent customers appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, email?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, test_clock?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Customer> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -116,13 +116,13 @@ class Customer extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Customer * - * @return \Stripe\Customer + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -145,12 +145,12 @@ class Customer extends ApiResource * This request accepts mostly the same arguments as the customer creation call. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, balance?: int, cash_balance?: array{settings?: array{reconciliation_mode?: string}}, default_source?: string, description?: string, email?: string, expand?: string[], invoice_prefix?: string, invoice_settings?: array{custom_fields?: null|array{name: string, value: string}[], default_payment_method?: string, footer?: string, rendering_options?: null|array{amount_tax_display?: null|string, template?: string}}, metadata?: null|array, name?: string, next_invoice_sequence?: int, phone?: string, preferred_locales?: string[], shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: string}, source?: string, tax?: array{ip_address?: null|string, validate_location?: string}, tax_exempt?: null|string, validate?: bool} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Customer the updated resource * - * @return \Stripe\Customer the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -158,7 +158,7 @@ class Customer extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -180,7 +180,7 @@ class Customer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @return \Stripe\Customer the updated customer + * @return Customer the updated customer */ public function deleteDiscount($params = null, $opts = null) { @@ -196,15 +196,15 @@ class Customer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection list of payment methods * - * @return \Stripe\Collection<\Stripe\PaymentMethod> list of payment methods + * @throws Exception\ApiErrorException if the request fails */ public static function allPaymentMethods($id, $params = null, $opts = null) { $url = static::resourceUrl($id) . '/payment_methods'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -215,15 +215,15 @@ class Customer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethod the retrieved payment method * - * @return \Stripe\PaymentMethod the retrieved payment method + * @throws Exception\ApiErrorException if the request fails */ public function retrievePaymentMethod($payment_method, $params = null, $opts = null) { $url = $this->instanceUrl() . '/payment_methods/' . $payment_method; list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj = Util\Util::convertToStripeObject($response, $opts); $obj->setLastResponse($response); return $obj; @@ -233,180 +233,17 @@ class Customer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SearchResult the customer search results * - * @return \Stripe\SearchResult<\Stripe\Customer> the customer search results + * @throws Exception\ApiErrorException if the request fails */ public static function search($params = null, $opts = null) { $url = '/v1/customers/search'; - return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts); + return static::_requestPage($url, SearchResult::class, $params, $opts); } - const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; - - /** - * @param string $id the ID of the customer on which to retrieve the customer balance transactions - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\CustomerBalanceTransaction> the list of customer balance transactions - */ - public static function allBalanceTransactions($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); - } - - /** - * @param string $id the ID of the customer on which to create the customer balance transaction - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public static function createBalanceTransaction($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the customer balance transaction belongs - * @param string $balanceTransactionId the ID of the customer balance transaction to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the customer balance transaction belongs - * @param string $balanceTransactionId the ID of the customer balance transaction to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); - } - const PATH_CASH_BALANCE_TRANSACTIONS = '/cash_balance_transactions'; - - /** - * @param string $id the ID of the customer on which to retrieve the customer cash balance transactions - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\CustomerCashBalanceTransaction> the list of customer cash balance transactions - */ - public static function allCashBalanceTransactions($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the customer cash balance transaction belongs - * @param string $cashBalanceTransactionId the ID of the customer cash balance transaction to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerCashBalanceTransaction - */ - public static function retrieveCashBalanceTransaction($id, $cashBalanceTransactionId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $cashBalanceTransactionId, $params, $opts); - } - const PATH_SOURCES = '/sources'; - - /** - * @param string $id the ID of the customer on which to retrieve the payment sources - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card|\Stripe\Source> the list of payment sources (BankAccount, Card or Source) - */ - public static function allSources($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts); - } - - /** - * @param string $id the ID of the customer on which to create the payment source - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source - */ - public static function createSource($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the payment source belongs - * @param string $sourceId the ID of the payment source to delete - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source - */ - public static function deleteSource($id, $sourceId, $params = null, $opts = null) - { - return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the payment source belongs - * @param string $sourceId the ID of the payment source to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source - */ - public static function retrieveSource($id, $sourceId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the payment source belongs - * @param string $sourceId the ID of the payment source to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source - */ - public static function updateSource($id, $sourceId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); - } const PATH_CASH_BALANCE = '/cash_balance'; /** @@ -415,9 +252,9 @@ class Customer extends ApiResource * @param null|array|string $opts * @param mixed $cashBalanceId * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CashBalance * - * @return \Stripe\CashBalance + * @throws Exception\ApiErrorException if the request fails */ public static function retrieveCashBalance($id, $cashBalanceId, $params = null, $opts = null) { @@ -430,14 +267,177 @@ class Customer extends ApiResource * @param null|array|string $opts * @param mixed $cashBalanceId * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CashBalance * - * @return \Stripe\CashBalance + * @throws Exception\ApiErrorException if the request fails */ public static function updateCashBalance($id, $cashBalanceId, $params = null, $opts = null) { return self::_updateNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts); } + const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; + + /** + * @param string $id the ID of the customer on which to retrieve the customer balance transactions + * @param null|array $params + * @param null|array|string $opts + * + * @return Collection the list of customer balance transactions + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function allBalanceTransactions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the customer balance transaction + * @param null|array $params + * @param null|array|string $opts + * + * @return CustomerBalanceTransaction + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function createBalanceTransaction($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the customer balance transaction belongs + * @param string $balanceTransactionId the ID of the customer balance transaction to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @return CustomerBalanceTransaction + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the customer balance transaction belongs + * @param string $balanceTransactionId the ID of the customer balance transaction to update + * @param null|array $params + * @param null|array|string $opts + * + * @return CustomerBalanceTransaction + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); + } + const PATH_CASH_BALANCE_TRANSACTIONS = '/cash_balance_transactions'; + + /** + * @param string $id the ID of the customer on which to retrieve the customer cash balance transactions + * @param null|array $params + * @param null|array|string $opts + * + * @return Collection the list of customer cash balance transactions + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function allCashBalanceTransactions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the customer cash balance transaction belongs + * @param string $cashBalanceTransactionId the ID of the customer cash balance transaction to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @return CustomerCashBalanceTransaction + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function retrieveCashBalanceTransaction($id, $cashBalanceTransactionId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $cashBalanceTransactionId, $params, $opts); + } + const PATH_SOURCES = '/sources'; + + /** + * @param string $id the ID of the customer on which to retrieve the payment sources + * @param null|array $params + * @param null|array|string $opts + * + * @return Collection the list of payment sources (BankAccount, Card or Source) + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function allSources($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the payment source + * @param null|array $params + * @param null|array|string $opts + * + * @return BankAccount|Card|Source + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function createSource($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to delete + * @param null|array $params + * @param null|array|string $opts + * + * @return BankAccount|Card|Source + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function deleteSource($id, $sourceId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @return BankAccount|Card|Source + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function retrieveSource($id, $sourceId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to update + * @param null|array $params + * @param null|array|string $opts + * + * @return BankAccount|Card|Source + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function updateSource($id, $sourceId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } const PATH_TAX_IDS = '/tax_ids'; /** @@ -445,9 +445,9 @@ class Customer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection the list of tax ids * - * @return \Stripe\Collection<\Stripe\TaxId> the list of tax ids + * @throws Exception\ApiErrorException if the request fails */ public static function allTaxIds($id, $params = null, $opts = null) { @@ -459,9 +459,9 @@ class Customer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TaxId * - * @return \Stripe\TaxId + * @throws Exception\ApiErrorException if the request fails */ public static function createTaxId($id, $params = null, $opts = null) { @@ -474,9 +474,9 @@ class Customer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TaxId * - * @return \Stripe\TaxId + * @throws Exception\ApiErrorException if the request fails */ public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null) { @@ -489,9 +489,9 @@ class Customer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TaxId * - * @return \Stripe\TaxId + * @throws Exception\ApiErrorException if the request fails */ public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/CustomerBalanceTransaction.php b/plugins/stripe-php/lib/CustomerBalanceTransaction.php index 37473d9f..ae1f2357 100644 --- a/plugins/stripe-php/lib/CustomerBalanceTransaction.php +++ b/plugins/stripe-php/lib/CustomerBalanceTransaction.php @@ -15,16 +15,17 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's balance. + * @property null|Checkout\Session|string $checkout_session The ID of the checkout session (if any) that created the transaction. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\CreditNote $credit_note The ID of the credit note (if any) related to the transaction. + * @property null|CreditNote|string $credit_note The ID of the credit note (if any) related to the transaction. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Customer $customer The ID of the customer the transaction belongs to. + * @property Customer|string $customer The ID of the customer the transaction belongs to. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property int $ending_balance The customer's balance after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. - * @property null|string|\Stripe\Invoice $invoice The ID of the invoice (if any) related to the transaction. + * @property null|Invoice|string $invoice The ID of the invoice (if any) related to the transaction. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $type Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_overpaid, invoice_too_large, invoice_too_small, unspent_receiver_credit, or unapplied_from_invoice. See the Customer Balance page to learn more about transaction types. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $type Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_overpaid, invoice_too_large, invoice_too_small, unspent_receiver_credit, unapplied_from_invoice, checkout_session_subscription_payment, or checkout_session_subscription_payment_canceled. See the Customer Balance page to learn more about transaction types. */ class CustomerBalanceTransaction extends ApiResource { @@ -32,6 +33,8 @@ class CustomerBalanceTransaction extends ApiResource const TYPE_ADJUSTMENT = 'adjustment'; const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice'; + const TYPE_CHECKOUT_SESSION_SUBSCRIPTION_PAYMENT = 'checkout_session_subscription_payment'; + const TYPE_CHECKOUT_SESSION_SUBSCRIPTION_PAYMENT_CANCELED = 'checkout_session_subscription_payment_canceled'; const TYPE_CREDIT_NOTE = 'credit_note'; const TYPE_INITIAL = 'initial'; const TYPE_INVOICE_OVERPAID = 'invoice_overpaid'; @@ -68,14 +71,14 @@ class CustomerBalanceTransaction extends ApiResource * @param array|string $_id * @param null|array|string $_opts * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function retrieve($_id, $_opts = null) { - $msg = 'Customer Balance Transactions cannot be retrieved without a ' . - 'customer ID. Retrieve a Customer Balance Transaction using ' . - "`Customer::retrieveBalanceTransaction('customer_id', " . - "'balance_transaction_id')`."; + $msg = 'Customer Balance Transactions cannot be retrieved without a ' + . 'customer ID. Retrieve a Customer Balance Transaction using ' + . "`Customer::retrieveBalanceTransaction('customer_id', " + . "'balance_transaction_id')`."; throw new Exception\BadMethodCallException($msg); } @@ -85,14 +88,14 @@ class CustomerBalanceTransaction extends ApiResource * @param null|array $_params * @param null|array|string $_options * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function update($_id, $_params = null, $_options = null) { - $msg = 'Customer Balance Transactions cannot be updated without a ' . - 'customer ID. Update a Customer Balance Transaction using ' . - "`Customer::updateBalanceTransaction('customer_id', " . - "'balance_transaction_id', \$updateParams)`."; + $msg = 'Customer Balance Transactions cannot be updated without a ' + . 'customer ID. Update a Customer Balance Transaction using ' + . "`Customer::updateBalanceTransaction('customer_id', " + . "'balance_transaction_id', \$updateParams)`."; throw new Exception\BadMethodCallException($msg); } diff --git a/plugins/stripe-php/lib/CustomerCashBalanceTransaction.php b/plugins/stripe-php/lib/CustomerCashBalanceTransaction.php index aa8819e1..c9733d60 100644 --- a/plugins/stripe-php/lib/CustomerCashBalanceTransaction.php +++ b/plugins/stripe-php/lib/CustomerCashBalanceTransaction.php @@ -12,19 +12,19 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $adjusted_for_overdraft - * @property null|\Stripe\StripeObject $applied_to_payment + * @property null|(object{balance_transaction: BalanceTransaction|string, linked_transaction: CustomerCashBalanceTransaction|string}&StripeObject) $adjusted_for_overdraft + * @property null|(object{payment_intent: PaymentIntent|string}&StripeObject) $applied_to_payment * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Customer $customer The customer whose available cash balance changed as a result of this transaction. + * @property Customer|string $customer The customer whose available cash balance changed as a result of this transaction. * @property int $ending_balance The total available cash balance for the specified currency after this transaction was applied. Represented in the smallest currency unit. - * @property null|\Stripe\StripeObject $funded + * @property null|(object{bank_transfer: (object{eu_bank_transfer?: (object{bic: null|string, iban_last4: null|string, sender_name: null|string}&StripeObject), gb_bank_transfer?: (object{account_number_last4: null|string, sender_name: null|string, sort_code: null|string}&StripeObject), jp_bank_transfer?: (object{sender_bank: null|string, sender_branch: null|string, sender_name: null|string}&StripeObject), reference: null|string, type: string, us_bank_transfer?: (object{network?: string, sender_name: null|string}&StripeObject)}&StripeObject)}&StripeObject) $funded * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property int $net_amount The amount by which the cash balance changed, represented in the smallest currency unit. A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance. - * @property null|\Stripe\StripeObject $refunded_from_payment - * @property null|\Stripe\StripeObject $transferred_to_balance + * @property null|(object{refund: Refund|string}&StripeObject) $refunded_from_payment + * @property null|(object{balance_transaction: BalanceTransaction|string}&StripeObject) $transferred_to_balance * @property string $type The type of the cash balance transaction. New types may be added in future. See Customer Balance to learn more about these types. - * @property null|\Stripe\StripeObject $unapplied_from_payment + * @property null|(object{payment_intent: PaymentIntent|string}&StripeObject) $unapplied_from_payment */ class CustomerCashBalanceTransaction extends ApiResource { diff --git a/plugins/stripe-php/lib/CustomerSession.php b/plugins/stripe-php/lib/CustomerSession.php index e84bb8c9..5efa34ec 100644 --- a/plugins/stripe-php/lib/CustomerSession.php +++ b/plugins/stripe-php/lib/CustomerSession.php @@ -14,9 +14,9 @@ namespace Stripe; * * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string $client_secret

    The client secret of this Customer Session. Used on the client to set up secure access to the given customer.

    The client secret can be used to provide access to customer from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.

    - * @property null|\Stripe\StripeObject $components Configuration for the components supported by this Customer Session. + * @property null|(object{buy_button: (object{enabled: bool}&StripeObject), payment_element: (object{enabled: bool, features: null|(object{payment_method_allow_redisplay_filters: string[], payment_method_redisplay: string, payment_method_redisplay_limit: null|int, payment_method_remove: string, payment_method_save: string, payment_method_save_usage: null|string}&StripeObject)}&StripeObject), pricing_table: (object{enabled: bool}&StripeObject)}&StripeObject) $components Configuration for the components supported by this Customer Session. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string|\Stripe\Customer $customer The Customer the Customer Session was created for. + * @property Customer|string $customer The Customer the Customer Session was created for. * @property int $expires_at The timestamp at which this Customer Session will expire. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. */ @@ -29,12 +29,12 @@ class CustomerSession extends ApiResource * you can use on your front-end to grant client-side API access for certain * customer resources. * - * @param null|array $params + * @param null|array{components: array{buy_button?: array{enabled: bool}, payment_element?: array{enabled: bool, features?: array{payment_method_allow_redisplay_filters?: string[], payment_method_redisplay?: string, payment_method_redisplay_limit?: int, payment_method_remove?: string, payment_method_save?: string, payment_method_save_usage?: string}}, pricing_table?: array{enabled: bool}}, customer: string, expand?: string[]} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CustomerSession the created resource * - * @return \Stripe\CustomerSession the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -42,7 +42,7 @@ class CustomerSession extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/Discount.php b/plugins/stripe-php/lib/Discount.php index e1f3f84a..794741ac 100644 --- a/plugins/stripe-php/lib/Discount.php +++ b/plugins/stripe-php/lib/Discount.php @@ -13,12 +13,12 @@ namespace Stripe; * @property string $id The ID of the discount object. Discounts cannot be fetched by ID. Use expand[]=discounts in API calls to expand discount IDs in an array. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string $checkout_session The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode. - * @property \Stripe\Coupon $coupon A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not work with conventional one-off charges or payment intents. - * @property null|string|\Stripe\Customer $customer The ID of the customer associated with this discount. + * @property Coupon $coupon A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not work with conventional one-off charges or payment intents. + * @property null|Customer|string $customer The ID of the customer associated with this discount. * @property null|int $end If the coupon has a duration of repeating, the date that this discount will end. If the coupon has a duration of once or forever, this attribute will be null. * @property null|string $invoice The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. * @property null|string $invoice_item The invoice item id (or invoice line item id for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. - * @property null|string|\Stripe\PromotionCode $promotion_code The promotion code applied to create this discount. + * @property null|PromotionCode|string $promotion_code The promotion code applied to create this discount. * @property int $start Date that the coupon was applied. * @property null|string $subscription The subscription that this coupon is applied to, if it is applied to a particular subscription. * @property null|string $subscription_item The subscription item that this coupon is applied to, if it is applied to a particular subscription item. diff --git a/plugins/stripe-php/lib/Dispute.php b/plugins/stripe-php/lib/Dispute.php index 4cac7523..cc73e1b7 100644 --- a/plugins/stripe-php/lib/Dispute.php +++ b/plugins/stripe-php/lib/Dispute.php @@ -14,19 +14,19 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Disputed amount. Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). - * @property \Stripe\BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. - * @property string|\Stripe\Charge $charge ID of the charge that's disputed. + * @property BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. + * @property Charge|string $charge ID of the charge that's disputed. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property string[] $enhanced_eligibility_types List of eligibility types that are included in enhanced_evidence. - * @property \Stripe\StripeObject $evidence - * @property \Stripe\StripeObject $evidence_details + * @property (object{access_activity_log: null|string, billing_address: null|string, cancellation_policy: null|File|string, cancellation_policy_disclosure: null|string, cancellation_rebuttal: null|string, customer_communication: null|File|string, customer_email_address: null|string, customer_name: null|string, customer_purchase_ip: null|string, customer_signature: null|File|string, duplicate_charge_documentation: null|File|string, duplicate_charge_explanation: null|string, duplicate_charge_id: null|string, enhanced_evidence: (object{visa_compelling_evidence_3?: (object{disputed_transaction: null|(object{customer_account_id: null|string, customer_device_fingerprint: null|string, customer_device_id: null|string, customer_email_address: null|string, customer_purchase_ip: null|string, merchandise_or_services: null|string, product_description: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject), prior_undisputed_transactions: ((object{charge: string, customer_account_id: null|string, customer_device_fingerprint: null|string, customer_device_id: null|string, customer_email_address: null|string, customer_purchase_ip: null|string, product_description: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject))[]}&StripeObject), visa_compliance?: (object{fee_acknowledged: bool}&StripeObject)}&StripeObject), product_description: null|string, receipt: null|File|string, refund_policy: null|File|string, refund_policy_disclosure: null|string, refund_refusal_explanation: null|string, service_date: null|string, service_documentation: null|File|string, shipping_address: null|string, shipping_carrier: null|string, shipping_date: null|string, shipping_documentation: null|File|string, shipping_tracking_number: null|string, uncategorized_file: null|File|string, uncategorized_text: null|string}&StripeObject) $evidence + * @property (object{due_by: null|int, enhanced_eligibility: (object{visa_compelling_evidence_3?: (object{required_actions: string[], status: string}&StripeObject), visa_compliance?: (object{status: string}&StripeObject)}&StripeObject), has_evidence: bool, past_due: bool, submission_count: int}&StripeObject) $evidence_details * @property bool $is_charge_refundable If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $network_reason_code Network-dependent reason code for the dispute. - * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that's disputed. - * @property null|\Stripe\StripeObject $payment_method_details + * @property null|PaymentIntent|string $payment_intent ID of the PaymentIntent that's disputed. + * @property null|(object{amazon_pay?: (object{dispute_type: null|string}&StripeObject), card?: (object{brand: string, case_type: string, network_reason_code: null|string}&StripeObject), klarna?: (object{reason_code: null|string}&StripeObject), paypal?: (object{case_id: null|string, reason_code: null|string}&StripeObject), type: string}&StripeObject) $payment_method_details * @property string $reason Reason given by cardholder for dispute. Possible values are bank_cannot_process, check_returned, credit_not_processed, customer_initiated, debit_not_authorized, duplicate, fraudulent, general, incorrect_account_details, insufficient_funds, product_not_received, product_unacceptable, subscription_canceled, or unrecognized. Learn more about dispute reasons. * @property string $status Current status of dispute. Possible values are warning_needs_response, warning_under_review, warning_closed, needs_response, under_review, won, or lost. */ @@ -62,18 +62,18 @@ class Dispute extends ApiResource /** * Returns a list of your disputes. * - * @param null|array $params + * @param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Dispute> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -82,13 +82,13 @@ class Dispute extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Dispute * - * @return \Stripe\Dispute + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -107,12 +107,12 @@ class Dispute extends ApiResource * see our guide to dispute types. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{evidence?: array{access_activity_log?: string, billing_address?: string, cancellation_policy?: string, cancellation_policy_disclosure?: string, cancellation_rebuttal?: string, customer_communication?: string, customer_email_address?: string, customer_name?: string, customer_purchase_ip?: string, customer_signature?: string, duplicate_charge_documentation?: string, duplicate_charge_explanation?: string, duplicate_charge_id?: string, enhanced_evidence?: null|array{visa_compelling_evidence_3?: array{disputed_transaction?: array{customer_account_id?: null|string, customer_device_fingerprint?: null|string, customer_device_id?: null|string, customer_email_address?: null|string, customer_purchase_ip?: null|string, merchandise_or_services?: string, product_description?: null|string, shipping_address?: array{city?: null|string, country?: null|string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}}, prior_undisputed_transactions?: (array{charge: string, customer_account_id?: null|string, customer_device_fingerprint?: null|string, customer_device_id?: null|string, customer_email_address?: null|string, customer_purchase_ip?: null|string, product_description?: null|string, shipping_address?: array{city?: null|string, country?: null|string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}})[]}, visa_compliance?: array{fee_acknowledged?: bool}}, product_description?: string, receipt?: string, refund_policy?: string, refund_policy_disclosure?: string, refund_refusal_explanation?: string, service_date?: string, service_documentation?: string, shipping_address?: string, shipping_carrier?: string, shipping_date?: string, shipping_documentation?: string, shipping_tracking_number?: string, uncategorized_file?: string, uncategorized_text?: string}, expand?: string[], metadata?: null|array, submit?: bool} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Dispute the updated resource * - * @return \Stripe\Dispute the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -120,7 +120,7 @@ class Dispute extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -130,9 +130,9 @@ class Dispute extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Dispute the closed dispute * - * @return \Stripe\Dispute the closed dispute + * @throws Exception\ApiErrorException if the request fails */ public function close($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Entitlements/ActiveEntitlement.php b/plugins/stripe-php/lib/Entitlements/ActiveEntitlement.php index d3ea3265..4f423b23 100644 --- a/plugins/stripe-php/lib/Entitlements/ActiveEntitlement.php +++ b/plugins/stripe-php/lib/Entitlements/ActiveEntitlement.php @@ -9,7 +9,7 @@ namespace Stripe\Entitlements; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string|\Stripe\Entitlements\Feature $feature The Feature that the customer is entitled to. + * @property Feature|string $feature The Feature that the customer is entitled to. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $lookup_key A unique key you provide as your own system identifier. This may be up to 80 characters. */ @@ -20,12 +20,12 @@ class ActiveEntitlement extends \Stripe\ApiResource /** * Retrieve a list of active entitlements for a customer. * - * @param null|array $params + * @param null|array{customer: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Entitlements\ActiveEntitlement> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -40,9 +40,9 @@ class ActiveEntitlement extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ActiveEntitlement * - * @return \Stripe\Entitlements\ActiveEntitlement + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Entitlements/ActiveEntitlementSummary.php b/plugins/stripe-php/lib/Entitlements/ActiveEntitlementSummary.php index 46a9105f..cfa368e4 100644 --- a/plugins/stripe-php/lib/Entitlements/ActiveEntitlementSummary.php +++ b/plugins/stripe-php/lib/Entitlements/ActiveEntitlementSummary.php @@ -9,7 +9,7 @@ namespace Stripe\Entitlements; * * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string $customer The customer that is entitled to this feature. - * @property \Stripe\Collection<\Stripe\Entitlements\ActiveEntitlement> $entitlements The list of entitlements this customer has. + * @property \Stripe\Collection $entitlements The list of entitlements this customer has. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. */ class ActiveEntitlementSummary extends \Stripe\ApiResource diff --git a/plugins/stripe-php/lib/Entitlements/Feature.php b/plugins/stripe-php/lib/Entitlements/Feature.php index f7cd75c3..61b49a26 100644 --- a/plugins/stripe-php/lib/Entitlements/Feature.php +++ b/plugins/stripe-php/lib/Entitlements/Feature.php @@ -25,12 +25,12 @@ class Feature extends \Stripe\ApiResource /** * Creates a feature. * - * @param null|array $params + * @param null|array{expand?: string[], lookup_key: string, metadata?: array, name: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Feature the created resource * - * @return \Stripe\Entitlements\Feature the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -47,12 +47,12 @@ class Feature extends \Stripe\ApiResource /** * Retrieve a list of features. * - * @param null|array $params + * @param null|array{archived?: bool, ending_before?: string, expand?: string[], limit?: int, lookup_key?: string, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Entitlements\Feature> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -67,9 +67,9 @@ class Feature extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Feature * - * @return \Stripe\Entitlements\Feature + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -84,12 +84,12 @@ class Feature extends \Stripe\ApiResource * Update a feature’s metadata or permanently deactivate it. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{active?: bool, expand?: string[], metadata?: null|array, name?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Feature the updated resource * - * @return \Stripe\Entitlements\Feature the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/EphemeralKey.php b/plugins/stripe-php/lib/EphemeralKey.php index b69b0222..cd78fe6f 100644 --- a/plugins/stripe-php/lib/EphemeralKey.php +++ b/plugins/stripe-php/lib/EphemeralKey.php @@ -19,12 +19,12 @@ class EphemeralKey extends ApiResource /** * Invalidates a short-lived API key for a given resource. * - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return EphemeralKey the deleted resource * - * @return \Stripe\EphemeralKey the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -45,10 +45,10 @@ class EphemeralKey extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return EphemeralKey the created key * - * @return \Stripe\EphemeralKey the created key + * @throws Exception\InvalidArgumentException if stripe_version is missing + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/ErrorObject.php b/plugins/stripe-php/lib/ErrorObject.php index 02b5de3e..a16322fe 100644 --- a/plugins/stripe-php/lib/ErrorObject.php +++ b/plugins/stripe-php/lib/ErrorObject.php @@ -94,6 +94,7 @@ class ErrorObject extends StripeObject const CODE_FINANCIAL_CONNECTIONS_NO_SUCCESSFUL_TRANSACTION_REFRESH = 'financial_connections_no_successful_transaction_refresh'; const CODE_FORWARDING_API_INACTIVE = 'forwarding_api_inactive'; const CODE_FORWARDING_API_INVALID_PARAMETER = 'forwarding_api_invalid_parameter'; + const CODE_FORWARDING_API_RETRYABLE_UPSTREAM_ERROR = 'forwarding_api_retryable_upstream_error'; const CODE_FORWARDING_API_UPSTREAM_CONNECTION_ERROR = 'forwarding_api_upstream_connection_error'; const CODE_FORWARDING_API_UPSTREAM_CONNECTION_TIMEOUT = 'forwarding_api_upstream_connection_timeout'; const CODE_IDEMPOTENCY_KEY_IN_USE = 'idempotency_key_in_use'; @@ -190,6 +191,7 @@ class ErrorObject extends StripeObject const CODE_SETUP_INTENT_AUTHENTICATION_FAILURE = 'setup_intent_authentication_failure'; const CODE_SETUP_INTENT_INVALID_PARAMETER = 'setup_intent_invalid_parameter'; const CODE_SETUP_INTENT_MANDATE_INVALID = 'setup_intent_mandate_invalid'; + const CODE_SETUP_INTENT_MOBILE_WALLET_UNSUPPORTED = 'setup_intent_mobile_wallet_unsupported'; const CODE_SETUP_INTENT_SETUP_ATTEMPT_EXPIRED = 'setup_intent_setup_attempt_expired'; const CODE_SETUP_INTENT_UNEXPECTED_STATE = 'setup_intent_unexpected_state'; const CODE_SHIPPING_ADDRESS_INVALID = 'shipping_address_invalid'; @@ -199,6 +201,7 @@ class ErrorObject extends StripeObject const CODE_STATUS_TRANSITION_INVALID = 'status_transition_invalid'; const CODE_STRIPE_TAX_INACTIVE = 'stripe_tax_inactive'; const CODE_TAX_ID_INVALID = 'tax_id_invalid'; + const CODE_TAX_ID_PROHIBITED = 'tax_id_prohibited'; const CODE_TAXES_CALCULATION_FAILED = 'taxes_calculation_failed'; const CODE_TERMINAL_LOCATION_COUNTRY_UNSUPPORTED = 'terminal_location_country_unsupported'; const CODE_TERMINAL_READER_BUSY = 'terminal_reader_busy'; diff --git a/plugins/stripe-php/lib/Event.php b/plugins/stripe-php/lib/Event.php index a935cc84..c5ffa002 100644 --- a/plugins/stripe-php/lib/Event.php +++ b/plugins/stripe-php/lib/Event.php @@ -43,11 +43,12 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string $account The connected account that originates the event. * @property null|string $api_version The Stripe API version used to render data. This property is populated only for events on or after October 31, 2014. + * @property null|string $context * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $data + * @property (object{object: StripeObject, previous_attributes?: StripeObject}&StripeObject) $data * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property int $pending_webhooks Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. - * @property null|\Stripe\StripeObject $request Information on the API request that triggers the event. + * @property null|(object{id: null|string, idempotency_key: null|string}&StripeObject) $request Information on the API request that triggers the event. * @property string $type Description of the event (for example, invoice.created or charge.refunded). */ class Event extends ApiResource @@ -65,6 +66,13 @@ class Event extends ApiResource const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; const BALANCE_AVAILABLE = 'balance.available'; const BILLING_ALERT_TRIGGERED = 'billing.alert.triggered'; + const BILLING_CREDIT_BALANCE_TRANSACTION_CREATED = 'billing.credit_balance_transaction.created'; + const BILLING_CREDIT_GRANT_CREATED = 'billing.credit_grant.created'; + const BILLING_CREDIT_GRANT_UPDATED = 'billing.credit_grant.updated'; + const BILLING_METER_CREATED = 'billing.meter.created'; + const BILLING_METER_DEACTIVATED = 'billing.meter.deactivated'; + const BILLING_METER_REACTIVATED = 'billing.meter.reactivated'; + const BILLING_METER_UPDATED = 'billing.meter.updated'; const BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created'; const BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated'; const BILLING_PORTAL_SESSION_CREATED = 'billing_portal.session.created'; @@ -145,6 +153,7 @@ class Event extends ApiResource const INVOICE_FINALIZED = 'invoice.finalized'; const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible'; const INVOICE_OVERDUE = 'invoice.overdue'; + const INVOICE_OVERPAID = 'invoice.overpaid'; const INVOICE_PAID = 'invoice.paid'; const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required'; const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; @@ -305,6 +314,10 @@ class Event extends ApiResource const TYPE_APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; const TYPE_BALANCE_AVAILABLE = 'balance.available'; const TYPE_BILLING_ALERT_TRIGGERED = 'billing.alert.triggered'; + const TYPE_BILLING_METER_CREATED = 'billing.meter.created'; + const TYPE_BILLING_METER_DEACTIVATED = 'billing.meter.deactivated'; + const TYPE_BILLING_METER_REACTIVATED = 'billing.meter.reactivated'; + const TYPE_BILLING_METER_UPDATED = 'billing.meter.updated'; const TYPE_BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created'; const TYPE_BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated'; const TYPE_BILLING_PORTAL_SESSION_CREATED = 'billing_portal.session.created'; @@ -385,6 +398,7 @@ class Event extends ApiResource const TYPE_INVOICE_FINALIZED = 'invoice.finalized'; const TYPE_INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible'; const TYPE_INVOICE_OVERDUE = 'invoice.overdue'; + const TYPE_INVOICE_OVERPAID = 'invoice.overpaid'; const TYPE_INVOICE_PAID = 'invoice.paid'; const TYPE_INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required'; const TYPE_INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; @@ -541,18 +555,18 @@ class Event extends ApiResource * api_version attribute (not according to your current Stripe API * version or Stripe-Version header). * - * @param null|array $params + * @param null|array{created?: array|int, delivery_success?: bool, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string, types?: string[]} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Event> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -562,13 +576,13 @@ class Event extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Event * - * @return \Stripe\Event + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/EventData/V1BillingMeterErrorReportTriggeredEventData.php b/plugins/stripe-php/lib/EventData/V1BillingMeterErrorReportTriggeredEventData.php index 3c8535c1..13c5f99e 100644 --- a/plugins/stripe-php/lib/EventData/V1BillingMeterErrorReportTriggeredEventData.php +++ b/plugins/stripe-php/lib/EventData/V1BillingMeterErrorReportTriggeredEventData.php @@ -6,10 +6,8 @@ namespace Stripe\EventData; /** * @property string $developer_message_summary Extra field included in the event's data when fetched from /v2/events. - * @property \Stripe\StripeObject $reason This contains information about why meter error happens. + * @property (object{error_count: int, error_types: (object{code: string, error_count: int, sample_errors: (object{error_message: string, request: (object{identifier: string}&\Stripe\StripeObject)}&\Stripe\StripeObject)[]}&\Stripe\StripeObject)[]}&\Stripe\StripeObject) $reason This contains information about why meter error happens. * @property int $validation_end The end of the window that is encapsulated by this summary. * @property int $validation_start The start of the window that is encapsulated by this summary. */ -class V1BillingMeterErrorReportTriggeredEventData extends \Stripe\StripeObject -{ -} +class V1BillingMeterErrorReportTriggeredEventData extends \Stripe\StripeObject {} diff --git a/plugins/stripe-php/lib/EventData/V1BillingMeterNoMeterFoundEventData.php b/plugins/stripe-php/lib/EventData/V1BillingMeterNoMeterFoundEventData.php index 3c1d70a5..f7e85f66 100644 --- a/plugins/stripe-php/lib/EventData/V1BillingMeterNoMeterFoundEventData.php +++ b/plugins/stripe-php/lib/EventData/V1BillingMeterNoMeterFoundEventData.php @@ -6,10 +6,8 @@ namespace Stripe\EventData; /** * @property string $developer_message_summary Extra field included in the event's data when fetched from /v2/events. - * @property \Stripe\StripeObject $reason This contains information about why meter error happens. + * @property (object{error_count: int, error_types: (object{code: string, error_count: int, sample_errors: (object{error_message: string, request: (object{identifier: string}&\Stripe\StripeObject)}&\Stripe\StripeObject)[]}&\Stripe\StripeObject)[]}&\Stripe\StripeObject) $reason This contains information about why meter error happens. * @property int $validation_end The end of the window that is encapsulated by this summary. * @property int $validation_start The start of the window that is encapsulated by this summary. */ -class V1BillingMeterNoMeterFoundEventData extends \Stripe\StripeObject -{ -} +class V1BillingMeterNoMeterFoundEventData extends \Stripe\StripeObject {} diff --git a/plugins/stripe-php/lib/Events/V1BillingMeterErrorReportTriggeredEvent.php b/plugins/stripe-php/lib/Events/V1BillingMeterErrorReportTriggeredEvent.php index 894ed6a2..cc939cb3 100644 --- a/plugins/stripe-php/lib/Events/V1BillingMeterErrorReportTriggeredEvent.php +++ b/plugins/stripe-php/lib/Events/V1BillingMeterErrorReportTriggeredEvent.php @@ -15,9 +15,9 @@ class V1BillingMeterErrorReportTriggeredEvent extends \Stripe\V2\Event /** * Retrieves the related object from the API. Make an API request on every call. * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Meter + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function fetchRelatedObject() { diff --git a/plugins/stripe-php/lib/Events/V2CoreEventDestinationPingEvent.php b/plugins/stripe-php/lib/Events/V2CoreEventDestinationPingEvent.php new file mode 100644 index 00000000..732cbe2b --- /dev/null +++ b/plugins/stripe-php/lib/Events/V2CoreEventDestinationPingEvent.php @@ -0,0 +1,35 @@ +related_object->url); + list($object, $options) = $this->_request( + 'get', + $this->related_object->url, + [], + ['stripe_account' => $this->context], + [], + $apiMode + ); + + return \Stripe\Util\Util::convertToStripeObject($object, $options, $apiMode); + } +} diff --git a/plugins/stripe-php/lib/Exception/ApiConnectionException.php b/plugins/stripe-php/lib/Exception/ApiConnectionException.php index 33f2ede9..8c9fc48b 100644 --- a/plugins/stripe-php/lib/Exception/ApiConnectionException.php +++ b/plugins/stripe-php/lib/Exception/ApiConnectionException.php @@ -7,6 +7,4 @@ namespace Stripe\Exception; * servers. That can be for a variety of different reasons from a downed * network to a bad TLS certificate. */ -class ApiConnectionException extends ApiErrorException -{ -} +class ApiConnectionException extends ApiErrorException {} diff --git a/plugins/stripe-php/lib/Exception/AuthenticationException.php b/plugins/stripe-php/lib/Exception/AuthenticationException.php index 9e5c718b..74a6df69 100644 --- a/plugins/stripe-php/lib/Exception/AuthenticationException.php +++ b/plugins/stripe-php/lib/Exception/AuthenticationException.php @@ -6,6 +6,4 @@ namespace Stripe\Exception; * AuthenticationException is thrown when invalid credentials are used to * connect to Stripe's servers. */ -class AuthenticationException extends ApiErrorException -{ -} +class AuthenticationException extends ApiErrorException {} diff --git a/plugins/stripe-php/lib/Exception/BadMethodCallException.php b/plugins/stripe-php/lib/Exception/BadMethodCallException.php index 96bdf669..e72f9c2a 100644 --- a/plugins/stripe-php/lib/Exception/BadMethodCallException.php +++ b/plugins/stripe-php/lib/Exception/BadMethodCallException.php @@ -2,6 +2,4 @@ namespace Stripe\Exception; -class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface -{ -} +class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface {} diff --git a/plugins/stripe-php/lib/Exception/ExceptionInterface.php b/plugins/stripe-php/lib/Exception/ExceptionInterface.php index c84f37de..e15fb50f 100644 --- a/plugins/stripe-php/lib/Exception/ExceptionInterface.php +++ b/plugins/stripe-php/lib/Exception/ExceptionInterface.php @@ -7,16 +7,12 @@ if (\interface_exists(\Throwable::class, false)) { /** * The base interface for all Stripe exceptions. */ - interface ExceptionInterface extends \Throwable - { - } + interface ExceptionInterface extends \Throwable {} } else { /** * The base interface for all Stripe exceptions. */ // phpcs:disable PSR1.Classes.ClassDeclaration.MultipleClasses - interface ExceptionInterface - { - } + interface ExceptionInterface {} // phpcs:enable } diff --git a/plugins/stripe-php/lib/Exception/IdempotencyException.php b/plugins/stripe-php/lib/Exception/IdempotencyException.php index 09dbf07f..482747fe 100644 --- a/plugins/stripe-php/lib/Exception/IdempotencyException.php +++ b/plugins/stripe-php/lib/Exception/IdempotencyException.php @@ -6,6 +6,4 @@ namespace Stripe\Exception; * IdempotencyException is thrown in cases where an idempotency key was used * improperly. */ -class IdempotencyException extends ApiErrorException -{ -} +class IdempotencyException extends ApiErrorException {} diff --git a/plugins/stripe-php/lib/Exception/InvalidArgumentException.php b/plugins/stripe-php/lib/Exception/InvalidArgumentException.php index 7aa3ca3d..99872c17 100644 --- a/plugins/stripe-php/lib/Exception/InvalidArgumentException.php +++ b/plugins/stripe-php/lib/Exception/InvalidArgumentException.php @@ -2,6 +2,4 @@ namespace Stripe\Exception; -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface {} diff --git a/plugins/stripe-php/lib/Exception/OAuth/ExceptionInterface.php b/plugins/stripe-php/lib/Exception/OAuth/ExceptionInterface.php index dd426620..bdb91733 100644 --- a/plugins/stripe-php/lib/Exception/OAuth/ExceptionInterface.php +++ b/plugins/stripe-php/lib/Exception/OAuth/ExceptionInterface.php @@ -5,6 +5,4 @@ namespace Stripe\Exception\OAuth; /** * The base interface for all Stripe OAuth exceptions. */ -interface ExceptionInterface extends \Stripe\Exception\ExceptionInterface -{ -} +interface ExceptionInterface extends \Stripe\Exception\ExceptionInterface {} diff --git a/plugins/stripe-php/lib/Exception/OAuth/InvalidClientException.php b/plugins/stripe-php/lib/Exception/OAuth/InvalidClientException.php index 13934519..d88b4530 100644 --- a/plugins/stripe-php/lib/Exception/OAuth/InvalidClientException.php +++ b/plugins/stripe-php/lib/Exception/OAuth/InvalidClientException.php @@ -7,6 +7,4 @@ namespace Stripe\Exception\OAuth; * the stripe_user_id does not exist or is not connected to your application, * or the API key mode (live or test mode) does not match the client_id mode. */ -class InvalidClientException extends OAuthErrorException -{ -} +class InvalidClientException extends OAuthErrorException {} diff --git a/plugins/stripe-php/lib/Exception/OAuth/InvalidGrantException.php b/plugins/stripe-php/lib/Exception/OAuth/InvalidGrantException.php index 898b3a77..03559d36 100644 --- a/plugins/stripe-php/lib/Exception/OAuth/InvalidGrantException.php +++ b/plugins/stripe-php/lib/Exception/OAuth/InvalidGrantException.php @@ -8,6 +8,4 @@ namespace Stripe\Exception\OAuth; * exist, or doesn't belong to you; or if an API key's mode (live or test) * doesn't match the mode of a code or refresh token. */ -class InvalidGrantException extends OAuthErrorException -{ -} +class InvalidGrantException extends OAuthErrorException {} diff --git a/plugins/stripe-php/lib/Exception/OAuth/InvalidRequestException.php b/plugins/stripe-php/lib/Exception/OAuth/InvalidRequestException.php index 59dac7c0..0a40a795 100644 --- a/plugins/stripe-php/lib/Exception/OAuth/InvalidRequestException.php +++ b/plugins/stripe-php/lib/Exception/OAuth/InvalidRequestException.php @@ -6,6 +6,4 @@ namespace Stripe\Exception\OAuth; * InvalidRequestException is thrown when a code, refresh token, or grant * type parameter is not provided, but was required. */ -class InvalidRequestException extends OAuthErrorException -{ -} +class InvalidRequestException extends OAuthErrorException {} diff --git a/plugins/stripe-php/lib/Exception/OAuth/InvalidScopeException.php b/plugins/stripe-php/lib/Exception/OAuth/InvalidScopeException.php index 091729d9..ee0431b6 100644 --- a/plugins/stripe-php/lib/Exception/OAuth/InvalidScopeException.php +++ b/plugins/stripe-php/lib/Exception/OAuth/InvalidScopeException.php @@ -5,6 +5,4 @@ namespace Stripe\Exception\OAuth; /** * InvalidScopeException is thrown when an invalid scope parameter is provided. */ -class InvalidScopeException extends OAuthErrorException -{ -} +class InvalidScopeException extends OAuthErrorException {} diff --git a/plugins/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php b/plugins/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php index c8dba29b..2413aeb9 100644 --- a/plugins/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php +++ b/plugins/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php @@ -7,6 +7,4 @@ namespace Stripe\Exception\OAuth; * error from the OAuth API it doesn't know about. Receiving this error usually * means that your client library is outdated and should be upgraded. */ -class UnknownOAuthErrorException extends OAuthErrorException -{ -} +class UnknownOAuthErrorException extends OAuthErrorException {} diff --git a/plugins/stripe-php/lib/Exception/OAuth/UnsupportedGrantTypeException.php b/plugins/stripe-php/lib/Exception/OAuth/UnsupportedGrantTypeException.php index 418635d4..661528e6 100644 --- a/plugins/stripe-php/lib/Exception/OAuth/UnsupportedGrantTypeException.php +++ b/plugins/stripe-php/lib/Exception/OAuth/UnsupportedGrantTypeException.php @@ -6,6 +6,4 @@ namespace Stripe\Exception\OAuth; * UnsupportedGrantTypeException is thrown when an unuspported grant type * parameter is specified. */ -class UnsupportedGrantTypeException extends OAuthErrorException -{ -} +class UnsupportedGrantTypeException extends OAuthErrorException {} diff --git a/plugins/stripe-php/lib/Exception/OAuth/UnsupportedResponseTypeException.php b/plugins/stripe-php/lib/Exception/OAuth/UnsupportedResponseTypeException.php index 26742a80..fd7fd4b1 100644 --- a/plugins/stripe-php/lib/Exception/OAuth/UnsupportedResponseTypeException.php +++ b/plugins/stripe-php/lib/Exception/OAuth/UnsupportedResponseTypeException.php @@ -6,6 +6,4 @@ namespace Stripe\Exception\OAuth; * UnsupportedResponseTypeException is thrown when an unsupported response type * parameter is specified. */ -class UnsupportedResponseTypeException extends OAuthErrorException -{ -} +class UnsupportedResponseTypeException extends OAuthErrorException {} diff --git a/plugins/stripe-php/lib/Exception/PermissionException.php b/plugins/stripe-php/lib/Exception/PermissionException.php index 5cf5154b..41a7c342 100644 --- a/plugins/stripe-php/lib/Exception/PermissionException.php +++ b/plugins/stripe-php/lib/Exception/PermissionException.php @@ -6,6 +6,4 @@ namespace Stripe\Exception; * PermissionException is thrown in cases where access was attempted on a * resource that wasn't allowed. */ -class PermissionException extends ApiErrorException -{ -} +class PermissionException extends ApiErrorException {} diff --git a/plugins/stripe-php/lib/Exception/RateLimitException.php b/plugins/stripe-php/lib/Exception/RateLimitException.php index f28f450f..13805ca3 100644 --- a/plugins/stripe-php/lib/Exception/RateLimitException.php +++ b/plugins/stripe-php/lib/Exception/RateLimitException.php @@ -7,6 +7,4 @@ namespace Stripe\Exception; * load on Stripe's API servers (usually by performing too many requests). * Please back off on request rate. */ -class RateLimitException extends InvalidRequestException -{ -} +class RateLimitException extends InvalidRequestException {} diff --git a/plugins/stripe-php/lib/Exception/TemporarySessionExpiredException.php b/plugins/stripe-php/lib/Exception/TemporarySessionExpiredException.php index cdab2233..9e00cee2 100644 --- a/plugins/stripe-php/lib/Exception/TemporarySessionExpiredException.php +++ b/plugins/stripe-php/lib/Exception/TemporarySessionExpiredException.php @@ -4,6 +4,4 @@ namespace Stripe\Exception; -class TemporarySessionExpiredException extends ApiErrorException -{ -} +class TemporarySessionExpiredException extends ApiErrorException {} diff --git a/plugins/stripe-php/lib/Exception/UnexpectedValueException.php b/plugins/stripe-php/lib/Exception/UnexpectedValueException.php index 0a629edf..82950895 100644 --- a/plugins/stripe-php/lib/Exception/UnexpectedValueException.php +++ b/plugins/stripe-php/lib/Exception/UnexpectedValueException.php @@ -2,6 +2,4 @@ namespace Stripe\Exception; -class UnexpectedValueException extends \UnexpectedValueException implements ExceptionInterface -{ -} +class UnexpectedValueException extends \UnexpectedValueException implements ExceptionInterface {} diff --git a/plugins/stripe-php/lib/Exception/UnknownApiErrorException.php b/plugins/stripe-php/lib/Exception/UnknownApiErrorException.php index 7873bf8b..43c85140 100644 --- a/plugins/stripe-php/lib/Exception/UnknownApiErrorException.php +++ b/plugins/stripe-php/lib/Exception/UnknownApiErrorException.php @@ -7,6 +7,4 @@ namespace Stripe\Exception; * error from the API it doesn't know about. Receiving this error usually * means that your client library is outdated and should be upgraded. */ -class UnknownApiErrorException extends ApiErrorException -{ -} +class UnknownApiErrorException extends ApiErrorException {} diff --git a/plugins/stripe-php/lib/ExchangeRate.php b/plugins/stripe-php/lib/ExchangeRate.php index dbfda216..f67daf74 100644 --- a/plugins/stripe-php/lib/ExchangeRate.php +++ b/plugins/stripe-php/lib/ExchangeRate.php @@ -34,7 +34,7 @@ namespace Stripe; * * @property string $id Unique identifier for the object. Represented as the three-letter ISO currency code in lowercase. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $rates Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. + * @property StripeObject $rates Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. */ class ExchangeRate extends ApiResource { @@ -44,18 +44,18 @@ class ExchangeRate extends ApiResource * Returns a list of objects that contain the rates at which foreign currencies are * converted to one another. Only shows the currencies for which Stripe supports. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\ExchangeRate> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -65,13 +65,13 @@ class ExchangeRate extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ExchangeRate * - * @return \Stripe\ExchangeRate + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/File.php b/plugins/stripe-php/lib/File.php index 0a46fbc8..3aa79692 100644 --- a/plugins/stripe-php/lib/File.php +++ b/plugins/stripe-php/lib/File.php @@ -18,7 +18,7 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|int $expires_at The file expires and isn't available at this time in epoch seconds. * @property null|string $filename The suitable name for saving the file to a filesystem. - * @property null|\Stripe\Collection<\Stripe\FileLink> $links A list of file links that point at this file. + * @property null|Collection $links A list of file links that point at this file. * @property string $purpose The purpose of the uploaded file. * @property int $size The size of the file object in bytes. * @property null|string $title A suitable title for the document. @@ -52,18 +52,18 @@ class File extends ApiResource * returns the files by their creation dates, placing the most recently created * files at the top. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, purpose?: string, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\File> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -74,13 +74,13 @@ class File extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return File * - * @return \Stripe\File + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -101,19 +101,19 @@ class File extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return File the created file * - * @return \Stripe\File the created file + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); if (null === $opts->apiBase) { $opts->apiBase = Stripe::$apiUploadBase; } // Manually flatten params, otherwise curl's multipart encoder will // choke on nested arrays. - $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); + $flatParams = \array_column(Util\Util::flattenParams($params), 1, 0); return static::_create($flatParams, $opts); } diff --git a/plugins/stripe-php/lib/FileLink.php b/plugins/stripe-php/lib/FileLink.php index 8c449223..e339db73 100644 --- a/plugins/stripe-php/lib/FileLink.php +++ b/plugins/stripe-php/lib/FileLink.php @@ -14,9 +14,9 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property bool $expired Returns if the link is already expired. * @property null|int $expires_at Time that the link expires. - * @property string|\Stripe\File $file The file object this link points to. + * @property File|string $file The file object this link points to. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $url The publicly accessible URL to download the file. */ class FileLink extends ApiResource @@ -28,12 +28,12 @@ class FileLink extends ApiResource /** * Creates a new file link object. * - * @param null|array $params + * @param null|array{expand?: string[], expires_at?: int, file: string, metadata?: null|array} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return FileLink the created resource * - * @return \Stripe\FileLink the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -41,7 +41,7 @@ class FileLink extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -50,18 +50,18 @@ class FileLink extends ApiResource /** * Returns a list of file links. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], expired?: bool, file?: string, limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\FileLink> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -70,13 +70,13 @@ class FileLink extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return FileLink * - * @return \Stripe\FileLink + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -87,12 +87,12 @@ class FileLink extends ApiResource * Updates an existing file link object. Expired links can no longer be updated. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], expires_at?: null|array|int|string, metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return FileLink the updated resource * - * @return \Stripe\FileLink the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -100,7 +100,7 @@ class FileLink extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/FinancialConnections/Account.php b/plugins/stripe-php/lib/FinancialConnections/Account.php index e0f33d93..26b3eab6 100644 --- a/plugins/stripe-php/lib/FinancialConnections/Account.php +++ b/plugins/stripe-php/lib/FinancialConnections/Account.php @@ -9,23 +9,23 @@ namespace Stripe\FinancialConnections; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $account_holder The account holder that this account belongs to. - * @property null|\Stripe\StripeObject $balance The most recent information about the account's balance. - * @property null|\Stripe\StripeObject $balance_refresh The state of the most recent attempt to refresh the account balance. + * @property null|(object{account?: string|\Stripe\Account, customer?: string|\Stripe\Customer, type: string}&\Stripe\StripeObject) $account_holder The account holder that this account belongs to. + * @property null|(object{as_of: int, cash?: (object{available: null|\Stripe\StripeObject}&\Stripe\StripeObject), credit?: (object{used: null|\Stripe\StripeObject}&\Stripe\StripeObject), current: \Stripe\StripeObject, type: string}&\Stripe\StripeObject) $balance The most recent information about the account's balance. + * @property null|(object{last_attempted_at: int, next_refresh_available_at: null|int, status: string}&\Stripe\StripeObject) $balance_refresh The state of the most recent attempt to refresh the account balance. * @property string $category The type of the account. Account category is further divided in subcategory. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $display_name A human-readable name that has been assigned to this account, either by the account holder or by the institution. * @property string $institution_name The name of the institution that holds this account. * @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\FinancialConnections\AccountOwnership $ownership The most recent information about the account's owners. - * @property null|\Stripe\StripeObject $ownership_refresh The state of the most recent attempt to refresh the account owners. + * @property null|AccountOwnership|string $ownership The most recent information about the account's owners. + * @property null|(object{last_attempted_at: int, next_refresh_available_at: null|int, status: string}&\Stripe\StripeObject) $ownership_refresh The state of the most recent attempt to refresh the account owners. * @property null|string[] $permissions The list of permissions granted by this account. * @property string $status The status of the link to the account. * @property string $subcategory

    If category is cash, one of:

    - checking - savings - other

    If category is credit, one of:

    - mortgage - line_of_credit - credit_card - other

    If category is investment or other, this will be other.

    * @property null|string[] $subscriptions The list of data refresh subscriptions requested on this account. * @property string[] $supported_payment_method_types The PaymentMethod type(s) that can be created from this account. - * @property null|\Stripe\StripeObject $transaction_refresh The state of the most recent attempt to refresh the account transactions. + * @property null|(object{id: string, last_attempted_at: int, next_refresh_available_at: null|int, status: string}&\Stripe\StripeObject) $transaction_refresh The state of the most recent attempt to refresh the account transactions. */ class Account extends \Stripe\ApiResource { @@ -50,12 +50,12 @@ class Account extends \Stripe\ApiResource /** * Returns a list of Financial Connections Account objects. * - * @param null|array $params + * @param null|array{account_holder?: array{account?: string, customer?: string}, ending_before?: string, expand?: string[], limit?: int, session?: string, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\FinancialConnections\Account> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -70,9 +70,9 @@ class Account extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Account * - * @return \Stripe\FinancialConnections\Account + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -87,9 +87,9 @@ class Account extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Account the disconnected account * - * @return \Stripe\FinancialConnections\Account the disconnected account + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function disconnect($params = null, $opts = null) { @@ -105,9 +105,9 @@ class Account extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection list of account owners * - * @return \Stripe\Collection<\Stripe\FinancialConnections\AccountOwner> list of account owners + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function allOwners($id, $params = null, $opts = null) { @@ -123,9 +123,9 @@ class Account extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Account the refreshed account * - * @return \Stripe\FinancialConnections\Account the refreshed account + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function refreshAccount($params = null, $opts = null) { @@ -140,9 +140,9 @@ class Account extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Account the subscribed account * - * @return \Stripe\FinancialConnections\Account the subscribed account + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function subscribe($params = null, $opts = null) { @@ -157,9 +157,9 @@ class Account extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Account the unsubscribed account * - * @return \Stripe\FinancialConnections\Account the unsubscribed account + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function unsubscribe($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/FinancialConnections/AccountOwnership.php b/plugins/stripe-php/lib/FinancialConnections/AccountOwnership.php index 63ef45a8..2dd921b0 100644 --- a/plugins/stripe-php/lib/FinancialConnections/AccountOwnership.php +++ b/plugins/stripe-php/lib/FinancialConnections/AccountOwnership.php @@ -10,7 +10,7 @@ namespace Stripe\FinancialConnections; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property \Stripe\Collection<\Stripe\FinancialConnections\AccountOwner> $owners A paginated list of owners for this account. + * @property \Stripe\Collection $owners A paginated list of owners for this account. */ class AccountOwnership extends \Stripe\ApiResource { diff --git a/plugins/stripe-php/lib/FinancialConnections/Session.php b/plugins/stripe-php/lib/FinancialConnections/Session.php index 1bfd2af9..d2aae77b 100644 --- a/plugins/stripe-php/lib/FinancialConnections/Session.php +++ b/plugins/stripe-php/lib/FinancialConnections/Session.php @@ -9,10 +9,10 @@ namespace Stripe\FinancialConnections; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $account_holder The account holder for whom accounts are collected in this session. - * @property \Stripe\Collection<\Stripe\FinancialConnections\Account> $accounts The accounts that were collected as part of this Session. + * @property null|(object{account?: string|\Stripe\Account, customer?: string|\Stripe\Customer, type: string}&\Stripe\StripeObject) $account_holder The account holder for whom accounts are collected in this session. + * @property \Stripe\Collection $accounts The accounts that were collected as part of this Session. * @property string $client_secret A value that will be passed to the client to launch the authentication flow. - * @property null|\Stripe\StripeObject $filters + * @property null|(object{account_subcategories: null|string[], countries: null|string[]}&\Stripe\StripeObject) $filters * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string[] $permissions Permissions requested for accounts collected during this session. * @property null|string[] $prefetch Data features requested to be retrieved upon account creation. @@ -27,12 +27,12 @@ class Session extends \Stripe\ApiResource * Session. The session’s client_secret can be used to * launch the flow using Stripe.js. * - * @param null|array $params + * @param null|array{account_holder: array{account?: string, customer?: string, type: string}, expand?: string[], filters?: array{account_subcategories?: string[], countries?: string[]}, permissions: string[], prefetch?: string[], return_url?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Session the created resource * - * @return \Stripe\FinancialConnections\Session the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -52,9 +52,9 @@ class Session extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Session * - * @return \Stripe\FinancialConnections\Session + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/FinancialConnections/Transaction.php b/plugins/stripe-php/lib/FinancialConnections/Transaction.php index 8f90ab6b..68a95262 100644 --- a/plugins/stripe-php/lib/FinancialConnections/Transaction.php +++ b/plugins/stripe-php/lib/FinancialConnections/Transaction.php @@ -15,7 +15,7 @@ namespace Stripe\FinancialConnections; * @property string $description The description of this transaction. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $status The status of the transaction. - * @property \Stripe\StripeObject $status_transitions + * @property (object{posted_at: null|int, void_at: null|int}&\Stripe\StripeObject) $status_transitions * @property int $transacted_at Time at which the transaction was transacted. Measured in seconds since the Unix epoch. * @property string $transaction_refresh The token of the transaction refresh that last updated or created this transaction. * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. @@ -31,12 +31,12 @@ class Transaction extends \Stripe\ApiResource /** * Returns a list of Financial Connections Transaction objects. * - * @param null|array $params + * @param null|array{account: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, transacted_at?: array|int, transaction_refresh?: array{after: string}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\FinancialConnections\Transaction> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -51,9 +51,9 @@ class Transaction extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Transaction * - * @return \Stripe\FinancialConnections\Transaction + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Forwarding/Request.php b/plugins/stripe-php/lib/Forwarding/Request.php index 24efc5aa..9a3f53fb 100644 --- a/plugins/stripe-php/lib/Forwarding/Request.php +++ b/plugins/stripe-php/lib/Forwarding/Request.php @@ -29,9 +29,9 @@ namespace Stripe\Forwarding; * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $payment_method The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. * @property string[] $replacements The field kinds to be replaced in the forwarded request. - * @property null|\Stripe\StripeObject $request_context Context about the request from Stripe's servers to the destination endpoint. - * @property null|\Stripe\StripeObject $request_details The request that was sent to the destination endpoint. We redact any sensitive fields. - * @property null|\Stripe\StripeObject $response_details The response that the destination endpoint returned to us. We redact any sensitive fields. + * @property null|(object{destination_duration: int, destination_ip_address: string}&\Stripe\StripeObject) $request_context Context about the request from Stripe's servers to the destination endpoint. + * @property null|(object{body: string, headers: (object{name: string, value: string}&\Stripe\StripeObject)[], http_method: string}&\Stripe\StripeObject) $request_details The request that was sent to the destination endpoint. We redact any sensitive fields. + * @property null|(object{body: string, headers: (object{name: string, value: string}&\Stripe\StripeObject)[], status: int}&\Stripe\StripeObject) $response_details The response that the destination endpoint returned to us. We redact any sensitive fields. * @property null|string $url The destination URL for the forwarded request. Must be supported by the config. */ class Request extends \Stripe\ApiResource @@ -41,12 +41,12 @@ class Request extends \Stripe\ApiResource /** * Creates a ForwardingRequest object. * - * @param null|array $params + * @param null|array{expand?: string[], metadata?: array, payment_method: string, replacements: string[], request: array{body?: string, headers?: array{name: string, value: string}[]}, url: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Request the created resource * - * @return \Stripe\Forwarding\Request the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -63,12 +63,12 @@ class Request extends \Stripe\ApiResource /** * Lists all ForwardingRequest objects. * - * @param null|array $params + * @param null|array{created?: array{gt?: int, gte?: int, lt?: int, lte?: int}, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Forwarding\Request> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -83,9 +83,9 @@ class Request extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Request * - * @return \Stripe\Forwarding\Request + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/FundingInstructions.php b/plugins/stripe-php/lib/FundingInstructions.php index 0632a31b..14d14d83 100644 --- a/plugins/stripe-php/lib/FundingInstructions.php +++ b/plugins/stripe-php/lib/FundingInstructions.php @@ -12,7 +12,7 @@ namespace Stripe; * Related guide: Customer balance funding instructions. * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $bank_transfer + * @property (object{country: string, financial_addresses: ((object{aba?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, routing_number: string}&StripeObject), iban?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bic: string, country: string, iban: string}&StripeObject), sort_code?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), sort_code: string}&StripeObject), spei?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: string, bank_name: string, clabe: string}&StripeObject), supported_networks?: string[], swift?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, swift_code: string}&StripeObject), type: string, zengin?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: null|string, account_number: null|string, account_type: null|string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: null|string, bank_name: null|string, branch_code: null|string, branch_name: null|string}&StripeObject)}&StripeObject))[], type: string}&StripeObject) $bank_transfer * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property string $funding_type The funding_type of the returned instructions * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. diff --git a/plugins/stripe-php/lib/HttpClient/ClientInterface.php b/plugins/stripe-php/lib/HttpClient/ClientInterface.php index 47f61d5b..a86b7613 100644 --- a/plugins/stripe-php/lib/HttpClient/ClientInterface.php +++ b/plugins/stripe-php/lib/HttpClient/ClientInterface.php @@ -12,12 +12,13 @@ interface ClientInterface * @param bool $hasFile Whether or not $params references a file (via an @ prefix or * CURLFile) * @param 'v1'|'v2' $apiMode Specifies if this is a v1 or v2 request - * - * @throws \Stripe\Exception\ApiConnectionException - * @throws \Stripe\Exception\UnexpectedValueException + * @param null|int $maxNetworkRetries * * @return array an array whose first element is raw request body, second * element is HTTP status code and third array of HTTP headers + * + * @throws \Stripe\Exception\ApiConnectionException + * @throws \Stripe\Exception\UnexpectedValueException */ - public function request($method, $absUrl, $headers, $params, $hasFile, $apiMode = 'v1'); + public function request($method, $absUrl, $headers, $params, $hasFile, $apiMode = 'v1', $maxNetworkRetries = null); } diff --git a/plugins/stripe-php/lib/HttpClient/CurlClient.php b/plugins/stripe-php/lib/HttpClient/CurlClient.php index 3932da30..0038d3b3 100644 --- a/plugins/stripe-php/lib/HttpClient/CurlClient.php +++ b/plugins/stripe-php/lib/HttpClient/CurlClient.php @@ -39,7 +39,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface protected $defaultOptions; - /** @var \Stripe\Util\RandomGenerator */ + /** @var Util\RandomGenerator */ protected $randomGenerator; protected $userAgentInfo; @@ -64,7 +64,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface * throw an exception if $defaultOptions returns a non-array value. * * @param null|array|callable $defaultOptions - * @param null|\Stripe\Util\RandomGenerator $randomGenerator + * @param null|Util\RandomGenerator $randomGenerator */ public function __construct($defaultOptions = null, $randomGenerator = null) { @@ -340,11 +340,12 @@ class CurlClient implements ClientInterface, StreamingClientInterface * @param array $params * @param bool $hasFile * @param 'v1'|'v2' $apiMode + * @param null|int $maxNetworkRetries */ - public function request($method, $absUrl, $headers, $params, $hasFile, $apiMode = 'v1') + public function request($method, $absUrl, $headers, $params, $hasFile, $apiMode = 'v1', $maxNetworkRetries = null) { list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile, $apiMode); - list($rbody, $rcode, $rheaders) = $this->executeRequestWithRetries($opts, $absUrl); + list($rbody, $rcode, $rheaders) = $this->executeRequestWithRetries($opts, $absUrl, $maxNetworkRetries); return [$rbody, $rcode, $rheaders]; } @@ -357,12 +358,13 @@ class CurlClient implements ClientInterface, StreamingClientInterface * @param bool $hasFile * @param callable $readBodyChunk * @param 'v1'|'v2' $apiMode + * @param null|int $maxNetworkRetries */ - public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunk, $apiMode = 'v1') + public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunk, $apiMode = 'v1', $maxNetworkRetries = null) { list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile, $apiMode); $opts[\CURLOPT_RETURNTRANSFER] = false; - list($rbody, $rcode, $rheaders) = $this->executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk); + list($rbody, $rcode, $rheaders) = $this->executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk, $maxNetworkRetries); return [$rbody, $rcode, $rheaders]; } @@ -388,12 +390,12 @@ class CurlClient implements ClientInterface, StreamingClientInterface private function useHeadersToDetermineWriteCallback($opts, $determineWriteCallback) { $rheaders = new Util\CaseInsensitiveArray(); - $headerCallback = function ($curl, $header_line) use (&$rheaders) { + $headerCallback = static function ($curl, $header_line) use (&$rheaders) { return self::parseLineIntoHeaderArray($header_line, $rheaders); }; $writeCallback = null; - $writeCallbackWrapper = function ($curl, $data) use (&$writeCallback, &$rheaders, &$determineWriteCallback) { + $writeCallbackWrapper = static function ($curl, $data) use (&$writeCallback, &$rheaders, &$determineWriteCallback) { if (null === $writeCallback) { $writeCallback = \call_user_func_array($determineWriteCallback, [$rheaders]); } @@ -426,10 +428,11 @@ class CurlClient implements ClientInterface, StreamingClientInterface * @param array $opts cURL options * @param string $absUrl * @param callable $readBodyChunk + * @param null|int $maxNetworkRetries * * @return array */ - public function executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk) + public function executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk, $maxNetworkRetries = null) { /** @var bool */ $shouldRetry = false; @@ -452,7 +455,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface $errno = null; $message = null; - $determineWriteCallback = function ($rheaders) use (&$readBodyChunk, &$shouldRetry, &$rbody, &$numRetries, &$rcode, &$lastRHeaders, &$errno) { + $determineWriteCallback = function ($rheaders) use (&$readBodyChunk, &$shouldRetry, &$rbody, &$numRetries, &$rcode, &$lastRHeaders, &$errno, &$maxNetworkRetries) { $lastRHeaders = $rheaders; $errno = \curl_errno($this->curlHandle); @@ -462,7 +465,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface if ($rcode < 300) { $rbody = null; - return function ($curl, $data) use (&$readBodyChunk) { + return static function ($curl, $data) use (&$readBodyChunk) { // Don't expose the $curl handle to the user, and don't require them to // return the length of $data. \call_user_func_array($readBodyChunk, [$data]); @@ -471,11 +474,11 @@ class CurlClient implements ClientInterface, StreamingClientInterface }; } - $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); + $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries, $maxNetworkRetries); // Discard the body from an unsuccessful request that should be retried. if ($shouldRetry) { - return function ($curl, $data) { + return static function ($curl, $data) { return \strlen($data); }; } else { @@ -483,7 +486,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface // which exception to throw to the user. $rbody = ''; - return function ($curl, $data) use (&$rbody) { + return static function ($curl, $data) use (&$rbody) { $rbody .= $data; return \strlen($data); @@ -535,8 +538,9 @@ class CurlClient implements ClientInterface, StreamingClientInterface /** * @param array $opts cURL options * @param string $absUrl + * @param null|int $maxNetworkRetries */ - public function executeRequestWithRetries($opts, $absUrl) + public function executeRequestWithRetries($opts, $absUrl, $maxNetworkRetries = null) { $numRetries = 0; @@ -547,7 +551,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface // Create a callback to capture HTTP headers for the response $rheaders = new Util\CaseInsensitiveArray(); - $headerCallback = function ($curl, $header_line) use (&$rheaders) { + $headerCallback = static function ($curl, $header_line) use (&$rheaders) { return CurlClient::parseLineIntoHeaderArray($header_line, $rheaders); }; $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; @@ -566,7 +570,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface $this->closeCurlHandle(); } - $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); + $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries, $maxNetworkRetries); if (\is_callable($this->getRequestStatusCallback())) { \call_user_func_array( @@ -643,14 +647,20 @@ class CurlClient implements ClientInterface, StreamingClientInterface * * @param int $errno * @param int $rcode - * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders + * @param array|Util\CaseInsensitiveArray $rheaders * @param int $numRetries + * @param null|int $maxNetworkRetries * * @return bool */ - private function shouldRetry($errno, $rcode, $rheaders, $numRetries) + private function shouldRetry($errno, $rcode, $rheaders, $numRetries, $maxNetworkRetries) { - if ($numRetries >= Stripe::getMaxNetworkRetries()) { + if (null === $maxNetworkRetries) { + // all calls from a StripeClient have a number here, so we only see `null` (and use the global configuration) if coming from a non-client call. + $maxNetworkRetries = Stripe::getMaxNetworkRetries(); + } + + if ($numRetries >= $maxNetworkRetries) { return false; } @@ -698,7 +708,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface * Provides the number of seconds to wait before retrying a request. * * @param int $numRetries - * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders + * @param array|Util\CaseInsensitiveArray $rheaders * * @return int */ diff --git a/plugins/stripe-php/lib/HttpClient/StreamingClientInterface.php b/plugins/stripe-php/lib/HttpClient/StreamingClientInterface.php index 7612c94a..d01d6e6d 100644 --- a/plugins/stripe-php/lib/HttpClient/StreamingClientInterface.php +++ b/plugins/stripe-php/lib/HttpClient/StreamingClientInterface.php @@ -12,12 +12,13 @@ interface StreamingClientInterface * @param bool $hasFile Whether or not $params references a file (via an @ prefix or * CURLFile) * @param callable $readBodyChunkCallable a function that will be called with chunks of bytes from the body if the request is successful - * - * @throws \Stripe\Exception\ApiConnectionException - * @throws \Stripe\Exception\UnexpectedValueException + * @param null|int $maxNetworkRetries * * @return array an array whose first element is raw request body, second * element is HTTP status code and third array of HTTP headers + * + * @throws \Stripe\Exception\ApiConnectionException + * @throws \Stripe\Exception\UnexpectedValueException */ - public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunkCallable); + public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunkCallable, $maxNetworkRetries = null); } diff --git a/plugins/stripe-php/lib/Identity/VerificationReport.php b/plugins/stripe-php/lib/Identity/VerificationReport.php index 058ac7f9..460db653 100644 --- a/plugins/stripe-php/lib/Identity/VerificationReport.php +++ b/plugins/stripe-php/lib/Identity/VerificationReport.php @@ -21,13 +21,13 @@ namespace Stripe\Identity; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string $client_reference_id A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $document Result from a document check - * @property null|\Stripe\StripeObject $email Result from a email check - * @property null|\Stripe\StripeObject $id_number Result from an id_number check + * @property null|(object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), dob?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), expiration_date?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), files: null|string[], first_name: null|string, issued_date: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), issuing_country: null|string, last_name: null|string, number?: null|string, status: string, type: null|string}&\Stripe\StripeObject) $document Result from a document check + * @property null|(object{email: null|string, error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), status: string}&\Stripe\StripeObject) $email Result from a email check + * @property null|(object{dob?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), first_name: null|string, id_number?: null|string, id_number_type: null|string, last_name: null|string, status: string}&\Stripe\StripeObject) $id_number Result from an id_number check * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $options - * @property null|\Stripe\StripeObject $phone Result from a phone check - * @property null|\Stripe\StripeObject $selfie Result from a selfie check + * @property null|(object{document?: (object{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}&\Stripe\StripeObject), id_number?: (object{}&\Stripe\StripeObject)}&\Stripe\StripeObject) $options + * @property null|(object{error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), phone: null|string, status: string}&\Stripe\StripeObject) $phone Result from a phone check + * @property null|(object{document: null|string, error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), selfie: null|string, status: string}&\Stripe\StripeObject) $selfie Result from a selfie check * @property string $type Type of report. * @property null|string $verification_flow The configuration token of a verification flow from the dashboard. * @property null|string $verification_session ID of the VerificationSession that created this report. @@ -43,12 +43,12 @@ class VerificationReport extends \Stripe\ApiResource /** * List all verification reports. * - * @param null|array $params + * @param null|array{client_reference_id?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string, verification_session?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Identity\VerificationReport> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -63,9 +63,9 @@ class VerificationReport extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return VerificationReport * - * @return \Stripe\Identity\VerificationReport + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Identity/VerificationSession.php b/plugins/stripe-php/lib/Identity/VerificationSession.php index 7adf5d0a..3a418261 100644 --- a/plugins/stripe-php/lib/Identity/VerificationSession.php +++ b/plugins/stripe-php/lib/Identity/VerificationSession.php @@ -22,19 +22,19 @@ namespace Stripe\Identity; * @property null|string $client_reference_id A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. * @property null|string $client_secret The short-lived client secret used by Stripe.js to show a verification modal inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on passing the client secret to the frontend to learn more. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $last_error If present, this property tells you the last error encountered when processing the verification. - * @property null|string|\Stripe\Identity\VerificationReport $last_verification_report ID of the most recent VerificationReport. Learn more about accessing detailed verification results. + * @property null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject) $last_error If present, this property tells you the last error encountered when processing the verification. + * @property null|string|VerificationReport $last_verification_report ID of the most recent VerificationReport. Learn more about accessing detailed verification results. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $options A set of options for the session’s verification checks. - * @property null|\Stripe\StripeObject $provided_details Details provided about the user being verified. These details may be shown to the user. - * @property null|\Stripe\StripeObject $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. - * @property null|string $related_customer Token referencing a Customer resource. + * @property null|(object{document?: (object{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}&\Stripe\StripeObject), email?: (object{require_verification?: bool}&\Stripe\StripeObject), id_number?: (object{}&\Stripe\StripeObject), phone?: (object{require_verification?: bool}&\Stripe\StripeObject)}&\Stripe\StripeObject) $options A set of options for the session’s verification checks. + * @property null|(object{email?: string, phone?: string}&\Stripe\StripeObject) $provided_details Details provided about the user being verified. These details may be shown to the user. + * @property null|(object{status: string}&\Stripe\StripeObject) $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. + * @property null|string $related_customer Customer ID * @property string $status Status of this VerificationSession. Learn more about the lifecycle of sessions. * @property string $type The type of verification check to be performed. * @property null|string $url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on verifying identity documents to learn how to redirect users to Stripe. * @property null|string $verification_flow The configuration token of a verification flow from the dashboard. - * @property null|\Stripe\StripeObject $verified_outputs The user’s verified data. + * @property null|(object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), dob?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), email: null|string, first_name: null|string, id_number?: null|string, id_number_type: null|string, last_name: null|string, phone: null|string}&\Stripe\StripeObject) $verified_outputs The user’s verified data. */ class VerificationSession extends \Stripe\ApiResource { @@ -64,12 +64,12 @@ class VerificationSession extends \Stripe\ApiResource * Related guide: Verify your * users’ identity documents * - * @param null|array $params + * @param null|array{client_reference_id?: string, expand?: string[], metadata?: array, options?: array{document?: null|array{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}}, provided_details?: array{email?: string, phone?: string}, related_customer?: string, return_url?: string, type?: string, verification_flow?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return VerificationSession the created resource * - * @return \Stripe\Identity\VerificationSession the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -86,12 +86,12 @@ class VerificationSession extends \Stripe\ApiResource /** * Returns a list of VerificationSessions. * - * @param null|array $params + * @param null|array{client_reference_id?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, related_customer?: string, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Identity\VerificationSession> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -110,9 +110,9 @@ class VerificationSession extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return VerificationSession * - * @return \Stripe\Identity\VerificationSession + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -130,12 +130,12 @@ class VerificationSession extends \Stripe\ApiResource * to update the verification check and options. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], metadata?: array, options?: array{document?: null|array{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}}, provided_details?: array{email?: string, phone?: string}, type?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return VerificationSession the updated resource * - * @return \Stripe\Identity\VerificationSession the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -153,9 +153,9 @@ class VerificationSession extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return VerificationSession the canceled verification session * - * @return \Stripe\Identity\VerificationSession the canceled verification session + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { @@ -170,9 +170,9 @@ class VerificationSession extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return VerificationSession the redacted verification session * - * @return \Stripe\Identity\VerificationSession the redacted verification session + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function redact($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Invoice.php b/plugins/stripe-php/lib/Invoice.php index aba69de4..ee327f85 100644 --- a/plugins/stripe-php/lib/Invoice.php +++ b/plugins/stripe-php/lib/Invoice.php @@ -42,85 +42,77 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string $account_country The country of the business associated with this invoice, most often the business creating the invoice. * @property null|string $account_name The public name of the business associated with this invoice, most often the business creating the invoice. - * @property null|(string|\Stripe\TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + * @property null|(string|TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft. * @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due. + * @property int $amount_overpaid Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance. * @property int $amount_paid The amount, in cents (or local equivalent), that was paid. * @property int $amount_remaining The difference between amount_due and amount_paid, in cents (or local equivalent). * @property int $amount_shipping This is the sum of all the shipping amounts. - * @property null|string|\Stripe\Application $application ID of the Connect Application that created the invoice. - * @property null|int $application_fee_amount The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + * @property null|Application|string $application ID of the Connect Application that created the invoice. * @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. * @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users. * @property null|bool $auto_advance Controls whether Stripe performs automatic collection of the invoice. If false, the invoice's state doesn't automatically advance without an explicit action. - * @property \Stripe\StripeObject $automatic_tax + * @property (object{disabled_reason: null|string, enabled: bool, liability: null|(object{account?: Account|string, type: string}&StripeObject), provider: null|string, status: null|string}&StripeObject) $automatic_tax * @property null|int $automatically_finalizes_at The time when this invoice is currently scheduled to be automatically finalized. The field will be null if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be null - see finalized_at for the time when an already-finalized invoice was finalized. * @property null|string $billing_reason

    Indicates the reason why the invoice was created.

    * manual: Unrelated to a subscription, for example, created via the invoice editor. * subscription: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * subscription_create: A new subscription was created. * subscription_cycle: A subscription advanced into a new period. * subscription_threshold: A subscription reached a billing threshold. * subscription_update: A subscription was updated. * upcoming: Reserved for simulated invoices, per the upcoming invoice endpoint.

    - * @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any. * @property string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + * @property null|(object{client_secret: string, type: string}&StripeObject) $confirmation_secret The confirmation secret associated with this invoice. Currently, this contains the client_secret of the PaymentIntent that Stripe creates during invoice finalization. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|\Stripe\StripeObject[] $custom_fields Custom fields displayed on the invoice. - * @property null|string|\Stripe\Customer $customer The ID of the customer who will be billed. - * @property null|\Stripe\StripeObject $customer_address The customer's address. Until the invoice is finalized, this field will equal customer.address. Once the invoice is finalized, this field will no longer be updated. + * @property null|(object{name: string, value: string}&StripeObject)[] $custom_fields Custom fields displayed on the invoice. + * @property null|Customer|string $customer The ID of the customer who will be billed. + * @property null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject) $customer_address The customer's address. Until the invoice is finalized, this field will equal customer.address. Once the invoice is finalized, this field will no longer be updated. * @property null|string $customer_email The customer's email. Until the invoice is finalized, this field will equal customer.email. Once the invoice is finalized, this field will no longer be updated. * @property null|string $customer_name The customer's name. Until the invoice is finalized, this field will equal customer.name. Once the invoice is finalized, this field will no longer be updated. * @property null|string $customer_phone The customer's phone number. Until the invoice is finalized, this field will equal customer.phone. Once the invoice is finalized, this field will no longer be updated. - * @property null|\Stripe\StripeObject $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal customer.shipping. Once the invoice is finalized, this field will no longer be updated. + * @property null|(object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), carrier?: null|string, name?: string, phone?: null|string, tracking_number?: null|string}&StripeObject) $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal customer.shipping. Once the invoice is finalized, this field will no longer be updated. * @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt. Once the invoice is finalized, this field will no longer be updated. - * @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated. - * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. - * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. - * @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any. + * @property null|((object{type: string, value: null|string}&StripeObject))[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated. + * @property null|PaymentMethod|string $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + * @property null|Account|BankAccount|Card|Source|string $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + * @property TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. - * @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. - * @property (string|\Stripe\Discount)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property (Discount|string)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. * @property null|int $due_date The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically. * @property null|int $effective_at The date when this invoice is in effect. Same as finalized_at unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. * @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. * @property null|string $footer Footer displayed on the invoice. - * @property null|\Stripe\StripeObject $from_invoice Details of the invoice that was cloned. See the revision documentation for more details. + * @property null|(object{action: string, invoice: Invoice|string}&StripeObject) $from_invoice Details of the invoice that was cloned. See the revision documentation for more details. * @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null. * @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. - * @property \Stripe\StripeObject $issuer - * @property null|\Stripe\StripeObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. - * @property null|string|\Stripe\Invoice $latest_revision The ID of the most recent non-draft revision of this invoice - * @property \Stripe\Collection<\Stripe\InvoiceLineItem> $lines The individual line items that make up the invoice. lines is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. + * @property (object{account?: Account|string, type: string}&StripeObject) $issuer + * @property null|(object{advice_code?: string, charge?: string, code?: string, decline_code?: string, doc_url?: string, message?: string, network_advice_code?: string, network_decline_code?: string, param?: string, payment_intent?: PaymentIntent, payment_method?: PaymentMethod, payment_method_type?: string, request_log_url?: string, setup_intent?: SetupIntent, source?: Account|BankAccount|Card|Source, type: string}&StripeObject) $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. + * @property null|Invoice|string $latest_revision The ID of the most recent non-draft revision of this invoice + * @property Collection $lines The individual line items that make up the invoice. lines is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|int $next_payment_attempt The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice. * @property null|string $number A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. - * @property bool $paid Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. - * @property bool $paid_out_of_band Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. - * @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. - * @property \Stripe\StripeObject $payment_settings + * @property null|Account|string $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. + * @property null|(object{quote_details: null|(object{quote: string}&StripeObject), subscription_details: null|(object{metadata: null|StripeObject, subscription: string|Subscription, subscription_proration_date?: int}&StripeObject), type: string}&StripeObject) $parent The parent that generated this invoice + * @property (object{default_mandate: null|string, payment_method_options: null|(object{acss_debit: null|(object{mandate_options?: (object{transaction_type: null|string}&StripeObject), verification_method?: string}&StripeObject), bancontact: null|(object{preferred_language: string}&StripeObject), card: null|(object{installments?: (object{enabled: null|bool}&StripeObject), request_three_d_secure: null|string}&StripeObject), customer_balance: null|(object{bank_transfer?: (object{eu_bank_transfer?: (object{country: string}&StripeObject), type: null|string}&StripeObject), funding_type: null|string}&StripeObject), konbini: null|(object{}&StripeObject), sepa_debit: null|(object{}&StripeObject), us_bank_account: null|(object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&StripeObject), permissions?: string[], prefetch: null|string[]}&StripeObject), verification_method?: string}&StripeObject)}&StripeObject), payment_method_types: null|string[]}&StripeObject) $payment_settings + * @property null|Collection $payments Payments for this invoice * @property int $period_end End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the line item period to get the service period for each price. * @property int $period_start Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the line item period to get the service period for each price. * @property int $post_payment_credit_notes_amount Total amount of all post-payment credit notes issued for this invoice. * @property int $pre_payment_credit_notes_amount Total amount of all pre-payment credit notes issued for this invoice. - * @property null|string|\Stripe\Quote $quote The quote this invoice was generated from. * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice. - * @property null|\Stripe\StripeObject $rendering The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. - * @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied on the invoice. - * @property null|\Stripe\StripeObject $shipping_details Shipping details for the invoice. The Invoice PDF will use the shipping_details value if it is set, otherwise the PDF will render the shipping address from the customer. + * @property null|(object{amount_tax_display: null|string, pdf: null|(object{page_size: null|string}&StripeObject), template: null|string, template_version: null|int}&StripeObject) $rendering The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + * @property null|(object{amount_subtotal: int, amount_tax: int, amount_total: int, shipping_rate: null|ShippingRate|string, taxes?: ((object{amount: int, rate: TaxRate, taxability_reason: null|string, taxable_amount: null|int}&StripeObject))[]}&StripeObject) $shipping_cost The details of the cost of shipping, including the ShippingRate applied on the invoice. + * @property null|(object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), carrier?: null|string, name?: string, phone?: null|string, tracking_number?: null|string}&StripeObject) $shipping_details Shipping details for the invoice. The Invoice PDF will use the shipping_details value if it is set, otherwise the PDF will render the shipping address from the customer. * @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice. * @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement. * @property null|string $status The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more - * @property \Stripe\StripeObject $status_transitions - * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any. - * @property null|\Stripe\StripeObject $subscription_details Details about the subscription that created this invoice. - * @property null|int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + * @property (object{finalized_at: null|int, marked_uncollectible_at: null|int, paid_at: null|int, voided_at: null|int}&StripeObject) $status_transitions * @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated * @property null|int $subtotal_excluding_tax The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated - * @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice belongs to. - * @property null|\Stripe\StripeObject $threshold_reason + * @property null|string|TestHelpers\TestClock $test_clock ID of the test clock this invoice belongs to. + * @property null|(object{amount_gte: null|int, item_reasons: (object{line_item_ids: string[], usage_gte: int}&StripeObject)[]}&StripeObject) $threshold_reason * @property int $total Total after discounts and taxes. - * @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items. + * @property null|((object{amount: int, discount: Discount|string}&StripeObject))[] $total_discount_amounts The aggregate amounts calculated per discount across all line items. * @property null|int $total_excluding_tax The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. - * @property null|\Stripe\StripeObject[] $total_pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. - * @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items. - * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice. + * @property null|((object{amount: int, credit_balance_transaction?: null|Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $total_pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. + * @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $total_taxes The aggregate tax information of all line items. * @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. */ class Invoice extends ApiResource @@ -159,12 +151,12 @@ class Invoice extends ApiResource * allows you to pay or send * the invoice to your customers. * - * @param null|array $params + * @param null|array{account_tax_ids?: null|string[], application_fee_amount?: int, auto_advance?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, automatically_finalizes_at?: int, collection_method?: string, currency?: string, custom_fields?: null|array{name: string, value: string}[], customer?: string, days_until_due?: int, default_payment_method?: string, default_source?: string, default_tax_rates?: string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], due_date?: int, effective_at?: int, expand?: string[], footer?: string, from_invoice?: array{action: string, invoice: string}, issuer?: array{account?: string, type: string}, metadata?: null|array, number?: string, on_behalf_of?: string, payment_settings?: array{default_mandate?: null|string, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[]}, pending_invoice_items_behavior?: string, rendering?: array{amount_tax_display?: null|string, pdf?: array{page_size?: string}, template?: string, template_version?: null|int}, shipping_cost?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}, shipping_details?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}, statement_descriptor?: string, subscription?: string, transfer_data?: array{amount?: int, destination: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the created resource * - * @return \Stripe\Invoice the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -172,7 +164,7 @@ class Invoice extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -187,9 +179,9 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the deleted resource * - * @return \Stripe\Invoice the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -207,18 +199,18 @@ class Invoice extends ApiResource * invoices are returned sorted by creation date, with the most recently created * invoices appearing first. * - * @param null|array $params + * @param null|array{collection_method?: string, created?: array|int, customer?: string, due_date?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, subscription?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Invoice> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -227,13 +219,13 @@ class Invoice extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice * - * @return \Stripe\Invoice + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -251,12 +243,12 @@ class Invoice extends ApiResource * invoices, pass auto_advance=false. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{account_tax_ids?: null|string[], application_fee_amount?: int, auto_advance?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, automatically_finalizes_at?: int, collection_method?: string, custom_fields?: null|array{name: string, value: string}[], days_until_due?: int, default_payment_method?: string, default_source?: null|string, default_tax_rates?: null|string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], due_date?: int, effective_at?: null|int, expand?: string[], footer?: string, issuer?: array{account?: string, type: string}, metadata?: null|array, number?: null|string, on_behalf_of?: null|string, payment_settings?: array{default_mandate?: null|string, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[]}, rendering?: array{amount_tax_display?: null|string, pdf?: array{page_size?: string}, template?: string, template_version?: null|int}, shipping_cost?: null|array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}, shipping_details?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}, statement_descriptor?: string, transfer_data?: null|array{amount?: int, destination: string}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the updated resource * - * @return \Stripe\Invoice the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -264,7 +256,7 @@ class Invoice extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -277,9 +269,9 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the added invoice * - * @return \Stripe\Invoice the added invoice + * @throws Exception\ApiErrorException if the request fails */ public function addLines($params = null, $opts = null) { @@ -294,15 +286,15 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the created invoice * - * @return \Stripe\Invoice the created invoice + * @throws Exception\ApiErrorException if the request fails */ public static function createPreview($params = null, $opts = null) { $url = static::classUrl() . '/create_preview'; list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -312,9 +304,9 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the finalized invoice * - * @return \Stripe\Invoice the finalized invoice + * @throws Exception\ApiErrorException if the request fails */ public function finalizeInvoice($params = null, $opts = null) { @@ -329,9 +321,9 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the uncollectible invoice * - * @return \Stripe\Invoice the uncollectible invoice + * @throws Exception\ApiErrorException if the request fails */ public function markUncollectible($params = null, $opts = null) { @@ -346,9 +338,9 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the paid invoice * - * @return \Stripe\Invoice the paid invoice + * @throws Exception\ApiErrorException if the request fails */ public function pay($params = null, $opts = null) { @@ -363,9 +355,9 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the removed invoice * - * @return \Stripe\Invoice the removed invoice + * @throws Exception\ApiErrorException if the request fails */ public function removeLines($params = null, $opts = null) { @@ -380,9 +372,9 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the sent invoice * - * @return \Stripe\Invoice the sent invoice + * @throws Exception\ApiErrorException if the request fails */ public function sendInvoice($params = null, $opts = null) { @@ -397,45 +389,9 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the updated invoice * - * @return \Stripe\Invoice the upcoming invoice - */ - public static function upcoming($params = null, $opts = null) - { - $url = static::classUrl() . '/upcoming'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\InvoiceLineItem> list of invoice line items - */ - public static function upcomingLines($params = null, $opts = null) - { - $url = static::classUrl() . '/upcoming/lines'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the updated invoice + * @throws Exception\ApiErrorException if the request fails */ public function updateLines($params = null, $opts = null) { @@ -450,9 +406,9 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Invoice the voided invoice * - * @return \Stripe\Invoice the voided invoice + * @throws Exception\ApiErrorException if the request fails */ public function voidInvoice($params = null, $opts = null) { @@ -467,15 +423,15 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SearchResult the invoice search results * - * @return \Stripe\SearchResult<\Stripe\Invoice> the invoice search results + * @throws Exception\ApiErrorException if the request fails */ public static function search($params = null, $opts = null) { $url = '/v1/invoices/search'; - return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts); + return static::_requestPage($url, SearchResult::class, $params, $opts); } const PATH_LINES = '/lines'; @@ -485,9 +441,9 @@ class Invoice extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection the list of invoice line items * - * @return \Stripe\Collection<\Stripe\InvoiceLineItem> the list of invoice line items + * @throws Exception\ApiErrorException if the request fails */ public static function allLines($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/InvoiceItem.php b/plugins/stripe-php/lib/InvoiceItem.php index 49c323ce..858ce93c 100644 --- a/plugins/stripe-php/lib/InvoiceItem.php +++ b/plugins/stripe-php/lib/InvoiceItem.php @@ -21,25 +21,21 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Amount (in the currency specified) of the invoice item. This should always be equal to unit_amount * quantity. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Customer $customer The ID of the customer who will be billed when this invoice item is billed. + * @property Customer|string $customer The ID of the customer who will be billed when this invoice item is billed. * @property int $date Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property bool $discountable If true, discounts will apply to this invoice item. Always false for prorations. - * @property null|(string|\Stripe\Discount)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. - * @property null|string|\Stripe\Invoice $invoice The ID of the invoice this invoice item belongs to. + * @property null|(Discount|string)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property null|Invoice|string $invoice The ID of the invoice this invoice item belongs to. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $period - * @property null|\Stripe\Plan $plan If the invoice item is a proration, the plan of the subscription that the proration was computed for. - * @property null|\Stripe\Price $price The price of the invoice item. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|(object{subscription_details: null|(object{subscription: string, subscription_item?: string}&StripeObject), type: string}&StripeObject) $parent The parent that generated this invoice + * @property (object{end: int, start: int}&StripeObject) $period + * @property null|(object{price_details?: (object{price: string, product: string}&StripeObject), type: string, unit_amount_decimal: null|string}&StripeObject) $pricing The pricing information of the invoice item. * @property bool $proration Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. * @property int $quantity Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. - * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice item has been created for, if any. - * @property null|string $subscription_item The subscription item that this invoice item has been created for, if any. - * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice item belongs to. - * @property null|int $unit_amount Unit amount (in the currency specified) of the invoice item. - * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. + * @property null|TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item. + * @property null|string|TestHelpers\TestClock $test_clock ID of the test clock this invoice item belongs to. */ class InvoiceItem extends ApiResource { @@ -52,12 +48,12 @@ class InvoiceItem extends ApiResource * no invoice is specified, the item will be on the next invoice created for the * customer specified. * - * @param null|array $params + * @param null|array{amount?: int, currency?: string, customer: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice?: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, subscription?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: string[], unit_amount_decimal?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InvoiceItem the created resource * - * @return \Stripe\InvoiceItem the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -65,7 +61,7 @@ class InvoiceItem extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -79,9 +75,9 @@ class InvoiceItem extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InvoiceItem the deleted resource * - * @return \Stripe\InvoiceItem the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -98,18 +94,18 @@ class InvoiceItem extends ApiResource * Returns a list of your invoice items. Invoice items are returned sorted by * creation date, with the most recently created invoice items appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], invoice?: string, limit?: int, pending?: bool, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\InvoiceItem> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -118,13 +114,13 @@ class InvoiceItem extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InvoiceItem * - * @return \Stripe\InvoiceItem + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -137,12 +133,12 @@ class InvoiceItem extends ApiResource * closed. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount_decimal?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InvoiceItem the updated resource * - * @return \Stripe\InvoiceItem the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -150,7 +146,7 @@ class InvoiceItem extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/InvoiceLineItem.php b/plugins/stripe-php/lib/InvoiceLineItem.php index a6120c9b..7ce6c7ec 100644 --- a/plugins/stripe-php/lib/InvoiceLineItem.php +++ b/plugins/stripe-php/lib/InvoiceLineItem.php @@ -12,29 +12,21 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The amount, in cents (or local equivalent). - * @property null|int $amount_excluding_tax The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item. + * @property null|((object{amount: int, discount: Discount|string}&StripeObject))[] $discount_amounts The amount of discount calculated per discount for this line item. * @property bool $discountable If true, discounts will apply to this line item. Always false for prorations. - * @property (string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property (Discount|string)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. * @property null|string $invoice The ID of the invoice that contains this line item. - * @property null|string|\Stripe\InvoiceItem $invoice_item The ID of the invoice item associated with this line item if any. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with type=subscription, metadata reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation. - * @property \Stripe\StripeObject $period - * @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration. - * @property null|\Stripe\StripeObject[] $pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item. - * @property null|\Stripe\Price $price The price of the line item. - * @property bool $proration Whether this is a proration. - * @property null|\Stripe\StripeObject $proration_details Additional details for proration line items + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with type=subscription, metadata reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation. + * @property null|(object{invoice_item_details: null|(object{invoice_item: string, proration: bool, proration_details: null|(object{credited_items: null|(object{invoice: string, invoice_line_items: string[]}&StripeObject)}&StripeObject), subscription: null|string}&StripeObject), subscription_item_details: null|(object{invoice_item: null|string, proration: bool, proration_details: null|(object{credited_items: null|(object{invoice: string, invoice_line_items: string[]}&StripeObject)}&StripeObject), subscription: null|string, subscription_item: string}&StripeObject), type: string}&StripeObject) $parent The parent that generated this invoice + * @property (object{end: int, start: int}&StripeObject) $period + * @property null|((object{amount: int, credit_balance_transaction?: null|Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item. + * @property null|(object{price_details?: (object{price: string, product: string}&StripeObject), type: string, unit_amount_decimal: null|string}&StripeObject) $pricing The pricing information of the line item. * @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration. - * @property null|string|\Stripe\Subscription $subscription The subscription that the invoice item pertains to, if any. - * @property null|string|\Stripe\SubscriptionItem $subscription_item The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription. - * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item - * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. - * @property string $type A string identifying the type of the source of this line item, either an invoiceitem or a subscription. - * @property null|string $unit_amount_excluding_tax The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. + * @property null|string|Subscription $subscription + * @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $taxes The tax information of the line item. */ class InvoiceLineItem extends ApiResource { @@ -51,12 +43,12 @@ class InvoiceLineItem extends ApiResource * before the invoice is finalized. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InvoiceLineItem the updated resource * - * @return \Stripe\InvoiceLineItem the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -64,7 +56,7 @@ class InvoiceLineItem extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/InvoicePayment.php b/plugins/stripe-php/lib/InvoicePayment.php new file mode 100644 index 00000000..9a33d7ee --- /dev/null +++ b/plugins/stripe-php/lib/InvoicePayment.php @@ -0,0 +1,64 @@ +paid. This amount can be less than the amount_requested if the PaymentIntent’s amount_received is not sufficient to pay all of the invoices that it is attached to. + * @property int $amount_requested Amount intended to be paid toward this invoice, in cents (or local equivalent) + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property Invoice|string $invoice The invoice that was paid. + * @property bool $is_default Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice’s amount_remaining. The PaymentIntent associated with the default payment can’t be edited or canceled directly. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property (object{charge?: Charge|string, payment_intent?: PaymentIntent|string, type: string}&StripeObject) $payment + * @property string $status The status of the payment, one of open, paid, or canceled. + * @property (object{canceled_at: null|int, paid_at: null|int}&StripeObject) $status_transitions + */ +class InvoicePayment extends ApiResource +{ + const OBJECT_NAME = 'invoice_payment'; + + /** + * When retrieving an invoice, there is an includable payments property containing + * the first handful of those items. There is also a URL where you can retrieve the + * full (paginated) list of payments. + * + * @param null|array{ending_before?: string, expand?: string[], invoice?: string, limit?: int, payment?: array{payment_intent?: string, type: string}, starting_after?: string, status?: string} $params + * @param null|array|string $opts + * + * @return Collection of ApiResources + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function all($params = null, $opts = null) + { + $url = static::classUrl(); + + return static::_requestPage($url, Collection::class, $params, $opts); + } + + /** + * Retrieves the invoice payment with the given ID. + * + * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key + * @param null|array|string $opts + * + * @return InvoicePayment + * + * @throws Exception\ApiErrorException if the request fails + */ + public static function retrieve($id, $opts = null) + { + $opts = Util\RequestOptions::parse($opts); + $instance = new static($id, $opts); + $instance->refresh(); + + return $instance; + } +} diff --git a/plugins/stripe-php/lib/InvoiceRenderingTemplate.php b/plugins/stripe-php/lib/InvoiceRenderingTemplate.php index f6ca508f..e3bac1c8 100644 --- a/plugins/stripe-php/lib/InvoiceRenderingTemplate.php +++ b/plugins/stripe-php/lib/InvoiceRenderingTemplate.php @@ -12,7 +12,7 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $nickname A brief description of the template, hidden from customers * @property string $status The status of the template, one of active or archived. * @property int $version Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering @@ -28,18 +28,18 @@ class InvoiceRenderingTemplate extends ApiResource * List all templates, ordered by creation date, with the most recently created * template appearing first. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\InvoiceRenderingTemplate> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -50,13 +50,13 @@ class InvoiceRenderingTemplate extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InvoiceRenderingTemplate * - * @return \Stripe\InvoiceRenderingTemplate + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -67,9 +67,9 @@ class InvoiceRenderingTemplate extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InvoiceRenderingTemplate the archived invoice rendering template * - * @return \Stripe\InvoiceRenderingTemplate the archived invoice rendering template + * @throws Exception\ApiErrorException if the request fails */ public function archive($params = null, $opts = null) { @@ -84,9 +84,9 @@ class InvoiceRenderingTemplate extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InvoiceRenderingTemplate the unarchived invoice rendering template * - * @return \Stripe\InvoiceRenderingTemplate the unarchived invoice rendering template + * @throws Exception\ApiErrorException if the request fails */ public function unarchive($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Issuing/Authorization.php b/plugins/stripe-php/lib/Issuing/Authorization.php index ec4088b0..f2323feb 100644 --- a/plugins/stripe-php/lib/Issuing/Authorization.php +++ b/plugins/stripe-php/lib/Issuing/Authorization.php @@ -14,30 +14,30 @@ namespace Stripe\Issuing; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The total amount that was authorized or rejected. This amount is in currency and in the smallest currency unit. amount should be the same as merchant_amount, unless currency and merchant_currency are different. - * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. + * @property null|(object{atm_fee: null|int, cashback_amount: null|int}&\Stripe\StripeObject) $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. * @property bool $approved Whether the authorization has been approved. * @property string $authorization_method How the card details were provided. * @property \Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with this authorization. - * @property \Stripe\Issuing\Card $card You can create physical or virtual cards that are issued to cardholders. - * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this authorization belongs. + * @property Card $card You can create physical or virtual cards that are issued to cardholders. + * @property null|Cardholder|string $cardholder The cardholder to whom this authorization belongs. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency The currency of the cardholder. This currency can be different from the currency presented at authorization and the merchant_currency field on this authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|\Stripe\StripeObject $fleet Fleet-specific information for authorizations using Fleet cards. - * @property null|\Stripe\StripeObject[] $fraud_challenges Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk reasons. - * @property null|\Stripe\StripeObject $fuel Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. + * @property null|(object{cardholder_prompt_data: null|(object{alphanumeric_id: null|string, driver_id: null|string, odometer: null|int, unspecified_id: null|string, user_id: null|string, vehicle_number: null|string}&\Stripe\StripeObject), purchase_type: null|string, reported_breakdown: null|(object{fuel: null|(object{gross_amount_decimal: null|string}&\Stripe\StripeObject), non_fuel: null|(object{gross_amount_decimal: null|string}&\Stripe\StripeObject), tax: null|(object{local_amount_decimal: null|string, national_amount_decimal: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject), service_type: null|string}&\Stripe\StripeObject) $fleet Fleet-specific information for authorizations using Fleet cards. + * @property null|((object{channel: string, status: string, undeliverable_reason: null|string}&\Stripe\StripeObject))[] $fraud_challenges Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk reasons. + * @property null|(object{industry_product_code: null|string, quantity_decimal: null|string, type: null|string, unit: null|string, unit_cost_decimal: null|string}&\Stripe\StripeObject) $fuel Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property int $merchant_amount The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit. merchant_amount should be the same as amount, unless merchant_currency and currency are different. * @property string $merchant_currency The local currency that was presented to the cardholder for the authorization. This currency can be different from the cardholder currency and the currency field on this authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property \Stripe\StripeObject $merchant_data + * @property (object{category: string, category_code: string, city: null|string, country: null|string, name: null|string, network_id: string, postal_code: null|string, state: null|string, tax_id: null|string, terminal_id: null|string, url: null|string}&\Stripe\StripeObject) $merchant_data * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $network_data Details about the authorization, such as identifiers, set by the card network. - * @property null|\Stripe\StripeObject $pending_request The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook. - * @property \Stripe\StripeObject[] $request_history History of every time a pending_request authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. + * @property null|(object{acquiring_institution_id: null|string, system_trace_audit_number: null|string, transaction_id: null|string}&\Stripe\StripeObject) $network_data Details about the authorization, such as identifiers, set by the card network. + * @property null|(object{amount: int, amount_details: null|(object{atm_fee: null|int, cashback_amount: null|int}&\Stripe\StripeObject), currency: string, is_amount_controllable: bool, merchant_amount: int, merchant_currency: string, network_risk_score: null|int}&\Stripe\StripeObject) $pending_request The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook. + * @property ((object{amount: int, amount_details: null|(object{atm_fee: null|int, cashback_amount: null|int}&\Stripe\StripeObject), approved: bool, authorization_code: null|string, created: int, currency: string, merchant_amount: int, merchant_currency: string, network_risk_score: null|int, reason: string, reason_message: null|string, requested_at: null|int}&\Stripe\StripeObject))[] $request_history History of every time a pending_request authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. * @property string $status The current status of the authorization in its lifecycle. - * @property null|string|\Stripe\Issuing\Token $token Token object used for this authorization. If a network token was not used for this authorization, this field will be null. - * @property \Stripe\Issuing\Transaction[] $transactions List of transactions associated with this authorization. - * @property null|\Stripe\StripeObject $treasury Treasury details related to this authorization if it was created on a FinancialAccount. - * @property \Stripe\StripeObject $verification_data + * @property null|string|Token $token Token object used for this authorization. If a network token was not used for this authorization, this field will be null. + * @property Transaction[] $transactions List of transactions associated with this authorization. + * @property null|(object{received_credits: string[], received_debits: string[], transaction: null|string}&\Stripe\StripeObject) $treasury Treasury details related to this authorization if it was created on a FinancialAccount. + * @property (object{address_line1_check: string, address_postal_code_check: string, authentication_exemption: null|(object{claimed_by: string, type: string}&\Stripe\StripeObject), cvc_check: string, expiry_check: string, postal_code: null|string, three_d_secure: null|(object{result: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $verification_data * @property null|bool $verified_by_fraud_challenge Whether the authorization bypassed fraud risk checks because the cardholder has previously completed a fraud challenge on a similar high-risk authorization from the same merchant. * @property null|string $wallet The digital wallet used for this transaction. One of apple_pay, google_pay, or samsung_pay. Will populate as null when no digital wallet was utilized. */ @@ -54,6 +54,7 @@ class Authorization extends \Stripe\ApiResource const AUTHORIZATION_METHOD_SWIPE = 'swipe'; const STATUS_CLOSED = 'closed'; + const STATUS_EXPIRED = 'expired'; const STATUS_PENDING = 'pending'; const STATUS_REVERSED = 'reversed'; @@ -62,12 +63,12 @@ class Authorization extends \Stripe\ApiResource * sorted in descending order by creation date, with the most recently created * object appearing first. * - * @param null|array $params + * @param null|array{card?: string, cardholder?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Issuing\Authorization> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -82,9 +83,9 @@ class Authorization extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Authorization * - * @return \Stripe\Issuing\Authorization + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -101,12 +102,12 @@ class Authorization extends \Stripe\ApiResource * unchanged. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Authorization the updated resource * - * @return \Stripe\Issuing\Authorization the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -124,9 +125,9 @@ class Authorization extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Authorization the approved authorization * - * @return \Stripe\Issuing\Authorization the approved authorization + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function approve($params = null, $opts = null) { @@ -141,9 +142,9 @@ class Authorization extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Authorization the declined authorization * - * @return \Stripe\Issuing\Authorization the declined authorization + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function decline($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Issuing/Card.php b/plugins/stripe-php/lib/Issuing/Card.php index a436ba31..a00fa4c2 100644 --- a/plugins/stripe-php/lib/Issuing/Card.php +++ b/plugins/stripe-php/lib/Issuing/Card.php @@ -11,7 +11,7 @@ namespace Stripe\Issuing; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string $brand The brand of the card. * @property null|string $cancellation_reason The reason why the card was canceled. - * @property \Stripe\Issuing\Cardholder $cardholder

    An Issuing Cardholder object represents an individual or business entity who is issued cards.

    Related guide: How to create a cardholder

    + * @property Cardholder $cardholder

    An Issuing Cardholder object represents an individual or business entity who is issued cards.

    Related guide: How to create a cardholder

    * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Supported currencies are usd in the US, eur in the EU, and gbp in the UK. * @property null|string $cvc The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. @@ -22,15 +22,15 @@ namespace Stripe\Issuing; * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. - * @property null|string|\Stripe\Issuing\PersonalizationDesign $personalization_design The personalization design object belonging to this card. - * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any. - * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any. + * @property null|PersonalizationDesign|string $personalization_design The personalization design object belonging to this card. + * @property null|Card|string $replaced_by The latest card that replaces this card, if any. + * @property null|Card|string $replacement_for The card this card replaces, if any. * @property null|string $replacement_reason The reason why the previous card needed to be replaced. - * @property null|\Stripe\StripeObject $shipping Where and how the card will be shipped. - * @property \Stripe\StripeObject $spending_controls + * @property null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), address_validation: null|(object{mode: string, normalized_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), result: null|string}&\Stripe\StripeObject), carrier: null|string, customs: null|(object{eori_number: null|string}&\Stripe\StripeObject), eta: null|int, name: string, phone_number: null|string, require_signature: null|bool, service: string, status: null|string, tracking_number: null|string, tracking_url: null|string, type: string}&\Stripe\StripeObject) $shipping Where and how the card will be shipped. + * @property (object{allowed_categories: null|string[], allowed_merchant_countries: null|string[], blocked_categories: null|string[], blocked_merchant_countries: null|string[], spending_limits: null|((object{amount: int, categories: null|string[], interval: string}&\Stripe\StripeObject))[], spending_limits_currency: null|string}&\Stripe\StripeObject) $spending_controls * @property string $status Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to inactive. * @property string $type The type of the card. - * @property null|\Stripe\StripeObject $wallets Information relating to digital wallets (like Apple Pay and Google Pay). + * @property null|(object{apple_pay: (object{eligible: bool, ineligible_reason: null|string}&\Stripe\StripeObject), google_pay: (object{eligible: bool, ineligible_reason: null|string}&\Stripe\StripeObject), primary_account_identifier: null|string}&\Stripe\StripeObject) $wallets Information relating to digital wallets (like Apple Pay and Google Pay). */ class Card extends \Stripe\ApiResource { @@ -57,12 +57,12 @@ class Card extends \Stripe\ApiResource /** * Creates an Issuing Card object. * - * @param null|array $params + * @param null|array{cardholder?: string, currency: string, expand?: string[], financial_account?: string, metadata?: array, personalization_design?: string, pin?: array{encrypted_number?: string}, replacement_for?: string, replacement_reason?: string, second_line?: null|string, shipping?: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}, address_validation?: array{mode: string}, customs?: array{eori_number?: string}, name: string, phone_number?: string, require_signature?: bool, service?: string, type?: string}, spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[]}, status?: string, type: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Card the created resource * - * @return \Stripe\Issuing\Card the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -81,12 +81,12 @@ class Card extends \Stripe\ApiResource * descending order by creation date, with the most recently created object * appearing first. * - * @param null|array $params + * @param null|array{cardholder?: string, created?: array|int, ending_before?: string, exp_month?: int, exp_year?: int, expand?: string[], last4?: string, limit?: int, personalization_design?: string, starting_after?: string, status?: string, type?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Issuing\Card> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -101,9 +101,9 @@ class Card extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Card * - * @return \Stripe\Issuing\Card + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -119,12 +119,12 @@ class Card extends \Stripe\ApiResource * the parameters passed. Any parameters not provided will be left unchanged. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{cancellation_reason?: string, expand?: string[], metadata?: null|array, personalization_design?: string, pin?: array{encrypted_number?: string}, shipping?: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}, address_validation?: array{mode: string}, customs?: array{eori_number?: string}, name: string, phone_number?: string, require_signature?: bool, service?: string, type?: string}, spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[]}, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Card the updated resource * - * @return \Stripe\Issuing\Card the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Issuing/Cardholder.php b/plugins/stripe-php/lib/Issuing/Cardholder.php index 5731c638..dc54024c 100644 --- a/plugins/stripe-php/lib/Issuing/Cardholder.php +++ b/plugins/stripe-php/lib/Issuing/Cardholder.php @@ -11,18 +11,18 @@ namespace Stripe\Issuing; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $billing - * @property null|\Stripe\StripeObject $company Additional information about a company cardholder. + * @property (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $billing + * @property null|(object{tax_id_provided: bool}&\Stripe\StripeObject) $company Additional information about a company cardholder. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $email The cardholder's email address. - * @property null|\Stripe\StripeObject $individual Additional information about an individual cardholder. + * @property null|(object{card_issuing?: null|(object{user_terms_acceptance: null|(object{date: null|int, ip: null|string, user_agent: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject), dob: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), first_name: null|string, last_name: null|string, verification: null|(object{document: null|(object{back: null|string|\Stripe\File, front: null|string|\Stripe\File}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject) $individual Additional information about an individual cardholder. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $name The cardholder's name. This will be printed on cards issued to them. * @property null|string $phone_number The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the 3D Secure documentation for more details. * @property null|string[] $preferred_locales The cardholder’s preferred locales (languages), ordered by preference. Locales can be de, en, es, fr, or it. This changes the language of the 3D Secure flow and one-time password messages sent to the cardholder. - * @property \Stripe\StripeObject $requirements - * @property null|\Stripe\StripeObject $spending_controls Rules that control spending across this cardholder's cards. Refer to our documentation for more details. + * @property (object{disabled_reason: null|string, past_due: null|string[]}&\Stripe\StripeObject) $requirements + * @property null|(object{allowed_categories: null|string[], allowed_merchant_countries: null|string[], blocked_categories: null|string[], blocked_merchant_countries: null|string[], spending_limits: null|((object{amount: int, categories: null|string[], interval: string}&\Stripe\StripeObject))[], spending_limits_currency: null|string}&\Stripe\StripeObject) $spending_controls Rules that control spending across this cardholder's cards. Refer to our documentation for more details. * @property string $status Specifies whether to permit authorizations on this cardholder's cards. * @property string $type One of individual or company. See Choose a cardholder type for more details. */ @@ -42,12 +42,12 @@ class Cardholder extends \Stripe\ApiResource /** * Creates a new Issuing Cardholder object that can be issued cards. * - * @param null|array $params + * @param null|array{billing: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}}, company?: array{tax_id?: string}, email?: string, expand?: string[], individual?: array{card_issuing?: array{user_terms_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, dob?: array{day: int, month: int, year: int}, first_name?: string, last_name?: string, verification?: array{document?: array{back?: string, front?: string}}}, metadata?: array, name: string, phone_number?: string, preferred_locales?: string[], spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[], spending_limits_currency?: string}, status?: string, type?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Cardholder the created resource * - * @return \Stripe\Issuing\Cardholder the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -66,12 +66,12 @@ class Cardholder extends \Stripe\ApiResource * sorted in descending order by creation date, with the most recently created * object appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, email?: string, ending_before?: string, expand?: string[], limit?: int, phone_number?: string, starting_after?: string, status?: string, type?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Issuing\Cardholder> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -86,9 +86,9 @@ class Cardholder extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Cardholder * - * @return \Stripe\Issuing\Cardholder + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -105,12 +105,12 @@ class Cardholder extends \Stripe\ApiResource * unchanged. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{billing?: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}}, company?: array{tax_id?: string}, email?: string, expand?: string[], individual?: array{card_issuing?: array{user_terms_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, dob?: array{day: int, month: int, year: int}, first_name?: string, last_name?: string, verification?: array{document?: array{back?: string, front?: string}}}, metadata?: array, phone_number?: string, preferred_locales?: string[], spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[], spending_limits_currency?: string}, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Cardholder the updated resource * - * @return \Stripe\Issuing\Cardholder the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Issuing/Dispute.php b/plugins/stripe-php/lib/Issuing/Dispute.php index b05c7e87..db96dc2f 100644 --- a/plugins/stripe-php/lib/Issuing/Dispute.php +++ b/plugins/stripe-php/lib/Issuing/Dispute.php @@ -15,13 +15,13 @@ namespace Stripe\Issuing; * @property null|\Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with the dispute. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency The currency the transaction was made in. - * @property \Stripe\StripeObject $evidence + * @property (object{canceled?: (object{additional_documentation: null|string|\Stripe\File, canceled_at: null|int, cancellation_policy_provided: null|bool, cancellation_reason: null|string, expected_at: null|int, explanation: null|string, product_description: null|string, product_type: null|string, return_status: null|string, returned_at: null|int}&\Stripe\StripeObject), duplicate?: (object{additional_documentation: null|string|\Stripe\File, card_statement: null|string|\Stripe\File, cash_receipt: null|string|\Stripe\File, check_image: null|string|\Stripe\File, explanation: null|string, original_transaction: null|string}&\Stripe\StripeObject), fraudulent?: (object{additional_documentation: null|string|\Stripe\File, explanation: null|string}&\Stripe\StripeObject), merchandise_not_as_described?: (object{additional_documentation: null|string|\Stripe\File, explanation: null|string, received_at: null|int, return_description: null|string, return_status: null|string, returned_at: null|int}&\Stripe\StripeObject), no_valid_authorization?: (object{additional_documentation: null|string|\Stripe\File, explanation: null|string}&\Stripe\StripeObject), not_received?: (object{additional_documentation: null|string|\Stripe\File, expected_at: null|int, explanation: null|string, product_description: null|string, product_type: null|string}&\Stripe\StripeObject), other?: (object{additional_documentation: null|string|\Stripe\File, explanation: null|string, product_description: null|string, product_type: null|string}&\Stripe\StripeObject), reason: string, service_not_as_described?: (object{additional_documentation: null|string|\Stripe\File, canceled_at: null|int, cancellation_reason: null|string, explanation: null|string, received_at: null|int}&\Stripe\StripeObject)}&\Stripe\StripeObject) $evidence * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $loss_reason The enum that describes the dispute loss outcome. If the dispute is not lost, this field will be absent. New enum values may be added in the future, so be sure to handle unknown values. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $status Current status of the dispute. - * @property string|\Stripe\Issuing\Transaction $transaction The transaction being disputed. - * @property null|\Stripe\StripeObject $treasury Treasury details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts + * @property string|Transaction $transaction The transaction being disputed. + * @property null|(object{debit_reversal: null|string, received_debit: string}&\Stripe\StripeObject) $treasury Treasury details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts */ class Dispute extends \Stripe\ApiResource { @@ -63,12 +63,12 @@ class Dispute extends \Stripe\ApiResource * href="/docs/issuing/purchases/disputes#dispute-reasons-and-evidence">Dispute * reasons and evidence for more details about evidence requirements. * - * @param null|array $params + * @param null|array{amount?: int, evidence?: array{canceled?: null|array{additional_documentation?: null|string, canceled_at?: null|int, cancellation_policy_provided?: null|bool, cancellation_reason?: null|string, expected_at?: null|int, explanation?: null|string, product_description?: null|string, product_type?: null|string, return_status?: null|string, returned_at?: null|int}, duplicate?: null|array{additional_documentation?: null|string, card_statement?: null|string, cash_receipt?: null|string, check_image?: null|string, explanation?: null|string, original_transaction?: string}, fraudulent?: null|array{additional_documentation?: null|string, explanation?: null|string}, merchandise_not_as_described?: null|array{additional_documentation?: null|string, explanation?: null|string, received_at?: null|int, return_description?: null|string, return_status?: null|string, returned_at?: null|int}, no_valid_authorization?: null|array{additional_documentation?: null|string, explanation?: null|string}, not_received?: null|array{additional_documentation?: null|string, expected_at?: null|int, explanation?: null|string, product_description?: null|string, product_type?: null|string}, other?: null|array{additional_documentation?: null|string, explanation?: null|string, product_description?: null|string, product_type?: null|string}, reason?: string, service_not_as_described?: null|array{additional_documentation?: null|string, canceled_at?: null|int, cancellation_reason?: null|string, explanation?: null|string, received_at?: null|int}}, expand?: string[], metadata?: array, transaction?: string, treasury?: array{received_debit: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Dispute the created resource * - * @return \Stripe\Issuing\Dispute the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -87,12 +87,12 @@ class Dispute extends \Stripe\ApiResource * in descending order by creation date, with the most recently created object * appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, transaction?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Issuing\Dispute> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -107,9 +107,9 @@ class Dispute extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Dispute * - * @return \Stripe\Issuing\Dispute + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -127,12 +127,12 @@ class Dispute extends \Stripe\ApiResource * empty string. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{amount?: int, evidence?: array{canceled?: null|array{additional_documentation?: null|string, canceled_at?: null|int, cancellation_policy_provided?: null|bool, cancellation_reason?: null|string, expected_at?: null|int, explanation?: null|string, product_description?: null|string, product_type?: null|string, return_status?: null|string, returned_at?: null|int}, duplicate?: null|array{additional_documentation?: null|string, card_statement?: null|string, cash_receipt?: null|string, check_image?: null|string, explanation?: null|string, original_transaction?: string}, fraudulent?: null|array{additional_documentation?: null|string, explanation?: null|string}, merchandise_not_as_described?: null|array{additional_documentation?: null|string, explanation?: null|string, received_at?: null|int, return_description?: null|string, return_status?: null|string, returned_at?: null|int}, no_valid_authorization?: null|array{additional_documentation?: null|string, explanation?: null|string}, not_received?: null|array{additional_documentation?: null|string, expected_at?: null|int, explanation?: null|string, product_description?: null|string, product_type?: null|string}, other?: null|array{additional_documentation?: null|string, explanation?: null|string, product_description?: null|string, product_type?: null|string}, reason?: string, service_not_as_described?: null|array{additional_documentation?: null|string, canceled_at?: null|int, cancellation_reason?: null|string, explanation?: null|string, received_at?: null|int}}, expand?: string[], metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Dispute the updated resource * - * @return \Stripe\Issuing\Dispute the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -150,9 +150,9 @@ class Dispute extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Dispute the submited dispute * - * @return \Stripe\Issuing\Dispute the submited dispute + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function submit($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Issuing/PersonalizationDesign.php b/plugins/stripe-php/lib/Issuing/PersonalizationDesign.php index d2e472a5..8543c286 100644 --- a/plugins/stripe-php/lib/Issuing/PersonalizationDesign.php +++ b/plugins/stripe-php/lib/Issuing/PersonalizationDesign.php @@ -10,15 +10,15 @@ namespace Stripe\Issuing; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string|\Stripe\File $card_logo The file for the card logo to use with physical bundles that support card logos. Must have a purpose value of issuing_logo. - * @property null|\Stripe\StripeObject $carrier_text Hash containing carrier text, for use with physical bundles that support carrier text. + * @property null|(object{footer_body: null|string, footer_title: null|string, header_body: null|string, header_title: null|string}&\Stripe\StripeObject) $carrier_text Hash containing carrier text, for use with physical bundles that support carrier text. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $lookup_key A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name Friendly display name. - * @property string|\Stripe\Issuing\PhysicalBundle $physical_bundle The physical bundle object belonging to this personalization design. - * @property \Stripe\StripeObject $preferences - * @property \Stripe\StripeObject $rejection_reasons + * @property PhysicalBundle|string $physical_bundle The physical bundle object belonging to this personalization design. + * @property (object{is_default: bool, is_platform_default: null|bool}&\Stripe\StripeObject) $preferences + * @property (object{card_logo: null|string[], carrier_text: null|string[]}&\Stripe\StripeObject) $rejection_reasons * @property string $status Whether this personalization design can be used to create cards. */ class PersonalizationDesign extends \Stripe\ApiResource @@ -35,12 +35,12 @@ class PersonalizationDesign extends \Stripe\ApiResource /** * Creates a personalization design object. * - * @param null|array $params + * @param null|array{card_logo?: string, carrier_text?: array{footer_body?: null|string, footer_title?: null|string, header_body?: null|string, header_title?: null|string}, expand?: string[], lookup_key?: string, metadata?: array, name?: string, physical_bundle: string, preferences?: array{is_default: bool}, transfer_lookup_key?: bool} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PersonalizationDesign the created resource * - * @return \Stripe\Issuing\PersonalizationDesign the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -59,12 +59,12 @@ class PersonalizationDesign extends \Stripe\ApiResource * descending order by creation date, with the most recently created object * appearing first. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, lookup_keys?: string[], preferences?: array{is_default?: bool, is_platform_default?: bool}, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Issuing\PersonalizationDesign> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -79,9 +79,9 @@ class PersonalizationDesign extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PersonalizationDesign * - * @return \Stripe\Issuing\PersonalizationDesign + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -96,12 +96,12 @@ class PersonalizationDesign extends \Stripe\ApiResource * Updates a card personalization object. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{card_logo?: null|string, carrier_text?: null|array{footer_body?: null|string, footer_title?: null|string, header_body?: null|string, header_title?: null|string}, expand?: string[], lookup_key?: null|string, metadata?: array, name?: null|string, physical_bundle?: string, preferences?: array{is_default: bool}, transfer_lookup_key?: bool} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PersonalizationDesign the updated resource * - * @return \Stripe\Issuing\PersonalizationDesign the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Issuing/PhysicalBundle.php b/plugins/stripe-php/lib/Issuing/PhysicalBundle.php index 419a0205..6e130c70 100644 --- a/plugins/stripe-php/lib/Issuing/PhysicalBundle.php +++ b/plugins/stripe-php/lib/Issuing/PhysicalBundle.php @@ -9,7 +9,7 @@ namespace Stripe\Issuing; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $features + * @property (object{card_logo: string, carrier_text: string, second_line: string}&\Stripe\StripeObject) $features * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $name Friendly display name. * @property string $status Whether this physical bundle can be used to create cards. @@ -30,12 +30,12 @@ class PhysicalBundle extends \Stripe\ApiResource * Returns a list of physical bundle objects. The objects are sorted in descending * order by creation date, with the most recently created object appearing first. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, type?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Issuing\PhysicalBundle> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -50,9 +50,9 @@ class PhysicalBundle extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PhysicalBundle * - * @return \Stripe\Issuing\PhysicalBundle + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Issuing/Token.php b/plugins/stripe-php/lib/Issuing/Token.php index 196c7aba..d2d1f18a 100644 --- a/plugins/stripe-php/lib/Issuing/Token.php +++ b/plugins/stripe-php/lib/Issuing/Token.php @@ -9,13 +9,13 @@ namespace Stripe\Issuing; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string|\Stripe\Issuing\Card $card Card associated with this token. + * @property Card|string $card Card associated with this token. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $device_fingerprint The hashed ID derived from the device ID from the card network associated with the token. * @property null|string $last4 The last four digits of the token. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $network The token service provider / card network associated with the token. - * @property null|\Stripe\StripeObject $network_data + * @property null|(object{device?: (object{device_fingerprint?: string, ip_address?: string, location?: string, name?: string, phone_number?: string, type?: string}&\Stripe\StripeObject), mastercard?: (object{card_reference_id?: string, token_reference_id: string, token_requestor_id: string, token_requestor_name?: string}&\Stripe\StripeObject), type: string, visa?: (object{card_reference_id: string, token_reference_id: string, token_requestor_id: string, token_risk_score?: string}&\Stripe\StripeObject), wallet_provider?: (object{account_id?: string, account_trust_score?: int, card_number_source?: string, cardholder_address?: (object{line1: string, postal_code: string}&\Stripe\StripeObject), cardholder_name?: string, device_trust_score?: int, hashed_account_email_address?: string, reason_codes?: string[], suggested_decision?: string, suggested_decision_version?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $network_data * @property int $network_updated_at Time at which the token was last updated by the card network. Measured in seconds since the Unix epoch. * @property string $status The usage state of the token. * @property null|string $wallet_provider The digital wallet for this token, if one was used. @@ -41,12 +41,12 @@ class Token extends \Stripe\ApiResource /** * Lists all Issuing Token objects for a given card. * - * @param null|array $params + * @param null|array{card: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Issuing\Token> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -61,9 +61,9 @@ class Token extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Token * - * @return \Stripe\Issuing\Token + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -79,12 +79,12 @@ class Token extends \Stripe\ApiResource * specified. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], status: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Token the updated resource * - * @return \Stripe\Issuing\Token the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Issuing/Transaction.php b/plugins/stripe-php/lib/Issuing/Transaction.php index 45585a01..4ccb9f7b 100644 --- a/plugins/stripe-php/lib/Issuing/Transaction.php +++ b/plugins/stripe-php/lib/Issuing/Transaction.php @@ -14,23 +14,23 @@ namespace Stripe\Issuing; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The transaction amount, which will be reflected in your balance. This amount is in your currency and in the smallest currency unit. - * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. - * @property null|string|\Stripe\Issuing\Authorization $authorization The Authorization object that led to this transaction. + * @property null|(object{atm_fee: null|int, cashback_amount: null|int}&\Stripe\StripeObject) $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. + * @property null|Authorization|string $authorization The Authorization object that led to this transaction. * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction associated with this transaction. - * @property string|\Stripe\Issuing\Card $card The card used to make this transaction. - * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this transaction belongs. + * @property Card|string $card The card used to make this transaction. + * @property null|Cardholder|string $cardholder The cardholder to whom this transaction belongs. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Issuing\Dispute $dispute If you've disputed the transaction, the ID of the dispute. + * @property null|Dispute|string $dispute If you've disputed the transaction, the ID of the dispute. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property int $merchant_amount The amount that the merchant will receive, denominated in merchant_currency and in the smallest currency unit. It will be different from amount if the merchant is taking payment in a different currency. * @property string $merchant_currency The currency with which the merchant is taking payment. - * @property \Stripe\StripeObject $merchant_data + * @property (object{category: string, category_code: string, city: null|string, country: null|string, name: null|string, network_id: string, postal_code: null|string, state: null|string, tax_id: null|string, terminal_id: null|string, url: null|string}&\Stripe\StripeObject) $merchant_data * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $network_data Details about the transaction, such as processing dates, set by the card network. - * @property null|\Stripe\StripeObject $purchase_details Additional purchase information that is optionally provided by the merchant. - * @property null|string|\Stripe\Issuing\Token $token Token object used for this transaction. If a network token was not used for this transaction, this field will be null. - * @property null|\Stripe\StripeObject $treasury Treasury details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts + * @property null|(object{authorization_code: null|string, processing_date: null|string, transaction_id: null|string}&\Stripe\StripeObject) $network_data Details about the transaction, such as processing dates, set by the card network. + * @property null|(object{fleet: null|(object{cardholder_prompt_data: null|(object{driver_id: null|string, odometer: null|int, unspecified_id: null|string, user_id: null|string, vehicle_number: null|string}&\Stripe\StripeObject), purchase_type: null|string, reported_breakdown: null|(object{fuel: null|(object{gross_amount_decimal: null|string}&\Stripe\StripeObject), non_fuel: null|(object{gross_amount_decimal: null|string}&\Stripe\StripeObject), tax: null|(object{local_amount_decimal: null|string, national_amount_decimal: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject), service_type: null|string}&\Stripe\StripeObject), flight: null|(object{departure_at: null|int, passenger_name: null|string, refundable: null|bool, segments: null|((object{arrival_airport_code: null|string, carrier: null|string, departure_airport_code: null|string, flight_number: null|string, service_class: null|string, stopover_allowed: null|bool}&\Stripe\StripeObject))[], travel_agency: null|string}&\Stripe\StripeObject), fuel: null|(object{industry_product_code: null|string, quantity_decimal: null|string, type: string, unit: string, unit_cost_decimal: string}&\Stripe\StripeObject), lodging: null|(object{check_in_at: null|int, nights: null|int}&\Stripe\StripeObject), receipt: null|((object{description: null|string, quantity: null|float, total: null|int, unit_cost: null|int}&\Stripe\StripeObject))[], reference: null|string}&\Stripe\StripeObject) $purchase_details Additional purchase information that is optionally provided by the merchant. + * @property null|string|Token $token Token object used for this transaction. If a network token was not used for this transaction, this field will be null. + * @property null|(object{received_credit: null|string, received_debit: null|string}&\Stripe\StripeObject) $treasury Treasury details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts * @property string $type The nature of the transaction. * @property null|string $wallet The digital wallet used for this transaction. One of apple_pay, google_pay, or samsung_pay. */ @@ -52,12 +52,12 @@ class Transaction extends \Stripe\ApiResource * sorted in descending order by creation date, with the most recently created * object appearing first. * - * @param null|array $params + * @param null|array{card?: string, cardholder?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Issuing\Transaction> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -72,9 +72,9 @@ class Transaction extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Transaction * - * @return \Stripe\Issuing\Transaction + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -91,12 +91,12 @@ class Transaction extends \Stripe\ApiResource * unchanged. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Transaction the updated resource * - * @return \Stripe\Issuing\Transaction the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/LineItem.php b/plugins/stripe-php/lib/LineItem.php index 837cbb1d..5b9191b4 100644 --- a/plugins/stripe-php/lib/LineItem.php +++ b/plugins/stripe-php/lib/LineItem.php @@ -15,10 +15,10 @@ namespace Stripe; * @property int $amount_total Total after discounts and taxes. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. - * @property null|\Stripe\StripeObject[] $discounts The discounts applied to the line item. - * @property null|\Stripe\Price $price The price used to generate the line item. + * @property null|(object{amount: int, discount: Discount}&StripeObject)[] $discounts The discounts applied to the line item. + * @property null|Price $price The price used to generate the line item. * @property null|int $quantity The quantity of products being purchased. - * @property null|\Stripe\StripeObject[] $taxes The taxes applied to the line item. + * @property null|((object{amount: int, rate: TaxRate, taxability_reason: null|string, taxable_amount: null|int}&StripeObject))[] $taxes The taxes applied to the line item. */ class LineItem extends ApiResource { diff --git a/plugins/stripe-php/lib/LoginLink.php b/plugins/stripe-php/lib/LoginLink.php index 6d901293..3f9ab52e 100644 --- a/plugins/stripe-php/lib/LoginLink.php +++ b/plugins/stripe-php/lib/LoginLink.php @@ -5,7 +5,8 @@ namespace Stripe; /** - * Login Links are single-use URLs for a connected account to access the Express Dashboard. The connected account's account.controller.stripe_dashboard.type must be express to have access to the Express Dashboard. + * Login Links are single-use URLs that takes an Express account to the login page for their Stripe dashboard. + * A Login Link differs from an Account Link in that it takes the user directly to their Express dashboard for the specified account. * * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. diff --git a/plugins/stripe-php/lib/Mandate.php b/plugins/stripe-php/lib/Mandate.php index 0974b96a..e5336ac7 100644 --- a/plugins/stripe-php/lib/Mandate.php +++ b/plugins/stripe-php/lib/Mandate.php @@ -9,13 +9,13 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $customer_acceptance + * @property (object{accepted_at: null|int, offline?: (object{}&StripeObject), online?: (object{ip_address: null|string, user_agent: null|string}&StripeObject), type: string}&StripeObject) $customer_acceptance * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $multi_use + * @property null|(object{}&StripeObject) $multi_use * @property null|string $on_behalf_of The account (if any) that the mandate is intended for. - * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method associated with this mandate. - * @property \Stripe\StripeObject $payment_method_details - * @property null|\Stripe\StripeObject $single_use + * @property PaymentMethod|string $payment_method ID of the payment method associated with this mandate. + * @property (object{acss_debit?: (object{default_for?: string[], interval_description: null|string, payment_schedule: string, transaction_type: string}&StripeObject), amazon_pay?: (object{}&StripeObject), au_becs_debit?: (object{url: string}&StripeObject), bacs_debit?: (object{network_status: string, reference: string, revocation_reason: null|string, url: string}&StripeObject), card?: (object{}&StripeObject), cashapp?: (object{}&StripeObject), kakao_pay?: (object{}&StripeObject), kr_card?: (object{}&StripeObject), link?: (object{}&StripeObject), naver_pay?: (object{}&StripeObject), nz_bank_account?: (object{}&StripeObject), paypal?: (object{billing_agreement_id: null|string, payer_id: null|string}&StripeObject), revolut_pay?: (object{}&StripeObject), sepa_debit?: (object{reference: string, url: string}&StripeObject), type: string, us_bank_account?: (object{collection_method?: string}&StripeObject)}&StripeObject) $payment_method_details + * @property null|(object{amount: int, currency: string}&StripeObject) $single_use * @property string $status The mandate status indicates whether or not you can use it to initiate a payment. * @property string $type The type of the mandate. */ @@ -36,13 +36,13 @@ class Mandate extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Mandate * - * @return \Stripe\Mandate + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/OAuth.php b/plugins/stripe-php/lib/OAuth.php index 7b0886e3..06f66c49 100644 --- a/plugins/stripe-php/lib/OAuth.php +++ b/plugins/stripe-php/lib/OAuth.php @@ -34,9 +34,9 @@ abstract class OAuth * @param null|array $params * @param null|array $opts * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * * @return StripeObject object containing the response from the API + * + * @throws Exception\OAuth\OAuthErrorException if the request fails */ public static function token($params = null, $opts = null) { @@ -58,9 +58,9 @@ abstract class OAuth * @param null|array $params * @param null|array $opts * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * * @return StripeObject object containing the response from the API + * + * @throws Exception\OAuth\OAuthErrorException if the request fails */ public static function deauthorize($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/PaymentIntent.php b/plugins/stripe-php/lib/PaymentIntent.php index c466fed7..824b42ee 100644 --- a/plugins/stripe-php/lib/PaymentIntent.php +++ b/plugins/stripe-php/lib/PaymentIntent.php @@ -21,41 +21,41 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). * @property int $amount_capturable Amount that can be captured from this PaymentIntent. - * @property null|\Stripe\StripeObject $amount_details + * @property null|(object{tip?: (object{amount?: int}&StripeObject)}&StripeObject) $amount_details * @property int $amount_received Amount that this PaymentIntent collects. - * @property null|string|\Stripe\Application $application ID of the Connect application that created the PaymentIntent. - * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts. - * @property null|\Stripe\StripeObject $automatic_payment_methods Settings to configure compatible payment methods from the Stripe Dashboard + * @property null|Application|string $application ID of the Connect application that created the PaymentIntent. + * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents use case for connected accounts. + * @property null|(object{allow_redirects?: string, enabled: bool}&StripeObject) $automatic_payment_methods Settings to configure compatible payment methods from the Stripe Dashboard * @property null|int $canceled_at Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. - * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic). + * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, automatic, or expired). * @property string $capture_method Controls when the funds will be captured from the customer's account. * @property null|string $client_secret

    The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.

    The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

    Refer to our docs to accept a payment and learn about how client_secret should be handled.

    * @property string $confirmation_method Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer

    ID of the Customer this PaymentIntent belongs to, if one exists.

    Payment methods attached to other Customers cannot be used with this PaymentIntent.

    If setup_future_usage is set and this PaymentIntent's payment method is not card_present, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is card_present and isn't a digital wallet, then a generated_card payment method representing the card is created and attached to the Customer instead.

    + * @property null|Customer|string $customer

    ID of the Customer this PaymentIntent belongs to, if one exists.

    Payment methods attached to other Customers cannot be used with this PaymentIntent.

    If setup_future_usage is set and this PaymentIntent's payment method is not card_present, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is card_present and isn't a digital wallet, then a generated_card payment method representing the card is created and attached to the Customer instead.

    * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\Invoice $invoice ID of the invoice that created this PaymentIntent, if it exists. - * @property null|\Stripe\StripeObject $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. - * @property null|string|\Stripe\Charge $latest_charge ID of the latest Charge object created by this PaymentIntent. This property is null until PaymentIntent confirmation is attempted. + * @property null|(object{advice_code?: string, charge?: string, code?: string, decline_code?: string, doc_url?: string, message?: string, network_advice_code?: string, network_decline_code?: string, param?: string, payment_intent?: PaymentIntent, payment_method?: PaymentMethod, payment_method_type?: string, request_log_url?: string, setup_intent?: SetupIntent, source?: Account|BankAccount|Card|Source, type: string}&StripeObject) $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. + * @property null|Charge|string $latest_charge ID of the latest Charge object created by this PaymentIntent. This property is null until PaymentIntent confirmation is attempted. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Learn more about storing information in metadata. - * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details. - * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used in this PaymentIntent. - * @property null|\Stripe\StripeObject $payment_method_configuration_details Information about the payment method configuration used for this PaymentIntent. - * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this PaymentIntent. - * @property string[] $payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. - * @property null|\Stripe\StripeObject $processing If present, this property tells you about the processing state of the payment. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Learn more about storing information in metadata. + * @property null|(object{alipay_handle_redirect?: (object{native_data: null|string, native_url: null|string, return_url: null|string, url: null|string}&StripeObject), boleto_display_details?: (object{expires_at: null|int, hosted_voucher_url: null|string, number: null|string, pdf: null|string}&StripeObject), card_await_notification?: (object{charge_attempt_at: null|int, customer_approval_required: null|bool}&StripeObject), cashapp_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, mobile_auth_url: string, qr_code: (object{expires_at: int, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), display_bank_transfer_instructions?: (object{amount_remaining: null|int, currency: null|string, financial_addresses?: ((object{aba?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, routing_number: string}&StripeObject), iban?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bic: string, country: string, iban: string}&StripeObject), sort_code?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), sort_code: string}&StripeObject), spei?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: string, bank_name: string, clabe: string}&StripeObject), supported_networks?: string[], swift?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, swift_code: string}&StripeObject), type: string, zengin?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: null|string, account_number: null|string, account_type: null|string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: null|string, bank_name: null|string, branch_code: null|string, branch_name: null|string}&StripeObject)}&StripeObject))[], hosted_instructions_url: null|string, reference: null|string, type: string}&StripeObject), konbini_display_details?: (object{expires_at: int, hosted_voucher_url: null|string, stores: (object{familymart: null|(object{confirmation_number?: string, payment_code: string}&StripeObject), lawson: null|(object{confirmation_number?: string, payment_code: string}&StripeObject), ministop: null|(object{confirmation_number?: string, payment_code: string}&StripeObject), seicomart: null|(object{confirmation_number?: string, payment_code: string}&StripeObject)}&StripeObject)}&StripeObject), multibanco_display_details?: (object{entity: null|string, expires_at: null|int, hosted_voucher_url: null|string, reference: null|string}&StripeObject), oxxo_display_details?: (object{expires_after: null|int, hosted_voucher_url: null|string, number: null|string}&StripeObject), paynow_display_qr_code?: (object{data: string, hosted_instructions_url: null|string, image_url_png: string, image_url_svg: string}&StripeObject), pix_display_qr_code?: (object{data?: string, expires_at?: int, hosted_instructions_url?: string, image_url_png?: string, image_url_svg?: string}&StripeObject), promptpay_display_qr_code?: (object{data: string, hosted_instructions_url: string, image_url_png: string, image_url_svg: string}&StripeObject), redirect_to_url?: (object{return_url: null|string, url: null|string}&StripeObject), swish_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, mobile_auth_url: string, qr_code: (object{data: string, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), type: string, use_stripe_sdk?: StripeObject, verify_with_microdeposits?: (object{arrival_date: int, hosted_verification_url: string, microdeposit_type: null|string}&StripeObject), wechat_pay_display_qr_code?: (object{data: string, hosted_instructions_url: string, image_data_url: string, image_url_png: string, image_url_svg: string}&StripeObject), wechat_pay_redirect_to_android_app?: (object{app_id: string, nonce_str: string, package: string, partner_id: string, prepay_id: string, sign: string, timestamp: string}&StripeObject), wechat_pay_redirect_to_ios_app?: (object{native_url: string}&StripeObject)}&StripeObject) $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + * @property null|Account|string $on_behalf_of The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details. + * @property null|PaymentMethod|string $payment_method ID of the payment method used in this PaymentIntent. + * @property null|(object{id: string, parent: null|string}&StripeObject) $payment_method_configuration_details Information about the payment method configuration used for this PaymentIntent. + * @property null|(object{acss_debit?: (object{mandate_options?: (object{custom_mandate_url?: string, interval_description: null|string, payment_schedule: null|string, transaction_type: null|string}&StripeObject), setup_future_usage?: string, target_date?: string, verification_method?: string}&StripeObject), affirm?: (object{capture_method?: string, preferred_locale?: string, setup_future_usage?: string}&StripeObject), afterpay_clearpay?: (object{capture_method?: string, reference: null|string, setup_future_usage?: string}&StripeObject), alipay?: (object{setup_future_usage?: string}&StripeObject), alma?: (object{capture_method?: string}&StripeObject), amazon_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), au_becs_debit?: (object{setup_future_usage?: string, target_date?: string}&StripeObject), bacs_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject), setup_future_usage?: string, target_date?: string}&StripeObject), bancontact?: (object{preferred_language: string, setup_future_usage?: string}&StripeObject), billie?: (object{}&StripeObject), blik?: (object{setup_future_usage?: string}&StripeObject), boleto?: (object{expires_after_days: int, setup_future_usage?: string}&StripeObject), card?: (object{capture_method?: string, installments: null|(object{available_plans: null|((object{count: null|int, interval: null|string, type: string}&StripeObject))[], enabled: bool, plan: null|(object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject), mandate_options: null|(object{amount: int, amount_type: string, description: null|string, end_date: null|int, interval: string, interval_count: null|int, reference: string, start_date: int, supported_types: null|string[]}&StripeObject), network: null|string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure: null|string, require_cvc_recollection?: bool, setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}&StripeObject), card_present?: (object{request_extended_authorization: null|bool, request_incremental_authorization_support: null|bool, routing?: (object{requested_priority: null|string}&StripeObject)}&StripeObject), cashapp?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), customer_balance?: (object{bank_transfer?: (object{eu_bank_transfer?: (object{country: string}&StripeObject), requested_address_types?: string[], type: null|string}&StripeObject), funding_type: null|string, setup_future_usage?: string}&StripeObject), eps?: (object{setup_future_usage?: string}&StripeObject), fpx?: (object{setup_future_usage?: string}&StripeObject), giropay?: (object{setup_future_usage?: string}&StripeObject), grabpay?: (object{setup_future_usage?: string}&StripeObject), ideal?: (object{setup_future_usage?: string}&StripeObject), interac_present?: (object{}&StripeObject), kakao_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), klarna?: (object{capture_method?: string, preferred_locale: null|string, setup_future_usage?: string}&StripeObject), konbini?: (object{confirmation_number: null|string, expires_after_days: null|int, expires_at: null|int, product_description: null|string, setup_future_usage?: string}&StripeObject), kr_card?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), link?: (object{capture_method?: string, persistent_token: null|string, setup_future_usage?: string}&StripeObject), mobilepay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), multibanco?: (object{setup_future_usage?: string}&StripeObject), naver_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), nz_bank_account?: (object{setup_future_usage?: string, target_date?: string}&StripeObject), oxxo?: (object{expires_after_days: int, setup_future_usage?: string}&StripeObject), p24?: (object{setup_future_usage?: string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{capture_method?: string}&StripeObject), paynow?: (object{setup_future_usage?: string}&StripeObject), paypal?: (object{capture_method?: string, preferred_locale: null|string, reference: null|string, setup_future_usage?: string}&StripeObject), pix?: (object{expires_after_seconds: null|int, expires_at: null|int, setup_future_usage?: string}&StripeObject), promptpay?: (object{setup_future_usage?: string}&StripeObject), revolut_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), samsung_pay?: (object{capture_method?: string}&StripeObject), sepa_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject), setup_future_usage?: string, target_date?: string}&StripeObject), sofort?: (object{preferred_language: null|string, setup_future_usage?: string}&StripeObject), swish?: (object{reference: null|string, setup_future_usage?: string}&StripeObject), twint?: (object{setup_future_usage?: string}&StripeObject), us_bank_account?: (object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&StripeObject), permissions?: string[], prefetch: null|string[], return_url?: string}&StripeObject), mandate_options?: (object{collection_method?: string}&StripeObject), preferred_settlement_speed?: string, setup_future_usage?: string, target_date?: string, verification_method?: string}&StripeObject), wechat_pay?: (object{app_id: null|string, client: null|string, setup_future_usage?: string}&StripeObject), zip?: (object{setup_future_usage?: string}&StripeObject)}&StripeObject) $payment_method_options Payment-method-specific configuration for this PaymentIntent. + * @property string[] $payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. A comprehensive list of valid payment method types can be found here. + * @property null|(object{presentment_amount: int, presentment_currency: string}&StripeObject) $presentment_details + * @property null|(object{card?: (object{customer_notification?: (object{approval_requested: null|bool, completes_at: null|int}&StripeObject)}&StripeObject), type: string}&StripeObject) $processing If present, this property tells you about the processing state of the payment. * @property null|string $receipt_email Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings. - * @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any. + * @property null|Review|string $review ID of the review associated with this PaymentIntent, if any. * @property null|string $setup_future_usage

    Indicates that you intend to make future payments with this PaymentIntent's payment method.

    If you provide a Customer with the PaymentIntent, you can use this parameter to attach the payment method to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still attach the payment method to a Customer after the transaction completes.

    If the payment method is card_present and isn't a digital wallet, Stripe creates and attaches a generated_card payment method representing the card to the Customer instead.

    When processing card payments, Stripe uses setup_future_usage to help you comply with regional legislation and network rules, such as SCA.

    - * @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent. - * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. + * @property null|(object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), carrier?: null|string, name?: string, phone?: null|string, tracking_number?: null|string}&StripeObject) $shipping Shipping information for this PaymentIntent. + * @property null|Account|BankAccount|Card|Source|string $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. * @property null|string $statement_descriptor

    Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see the Statement Descriptor docs.

    Setting this value for a card charge returns an error. For card charges, set the statement_descriptor_suffix instead.

    * @property null|string $statement_descriptor_suffix Provides information about a card charge. Concatenated to the account's statement descriptor prefix to form the complete statement descriptor that appears on the customer's statement. * @property string $status Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. Read more about each PaymentIntent status. - * @property null|\Stripe\StripeObject $transfer_data The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for connected accounts. + * @property null|(object{amount?: int, destination: Account|string}&StripeObject) $transfer_data The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for connected accounts. * @property null|string $transfer_group A string that identifies the resulting payment as part of a group. Learn more about the use case for connected accounts. */ class PaymentIntent extends ApiResource @@ -67,6 +67,7 @@ class PaymentIntent extends ApiResource const CANCELLATION_REASON_ABANDONED = 'abandoned'; const CANCELLATION_REASON_AUTOMATIC = 'automatic'; const CANCELLATION_REASON_DUPLICATE = 'duplicate'; + const CANCELLATION_REASON_EXPIRED = 'expired'; const CANCELLATION_REASON_FAILED_INVOICE = 'failed_invoice'; const CANCELLATION_REASON_FRAUDULENT = 'fraudulent'; const CANCELLATION_REASON_REQUESTED_BY_CUSTOMER = 'requested_by_customer'; @@ -103,12 +104,12 @@ class PaymentIntent extends ApiResource * parameters available in the confirm * API when you supply confirm=true. * - * @param null|array $params + * @param null|array{amount: int, application_fee_amount?: int, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, capture_method?: string, confirm?: bool, confirmation_method?: string, confirmation_token?: string, currency: string, customer?: string, description?: string, error_on_requires_action?: bool, expand?: string[], mandate?: string, mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, off_session?: array|bool|string, on_behalf_of?: string, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, pix?: null|array{expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, preferred_settlement_speed?: null|string, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], radar_options?: array{session?: string}, receipt_email?: string, return_url?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string, use_stripe_sdk?: bool} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentIntent the created resource * - * @return \Stripe\PaymentIntent the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -116,7 +117,7 @@ class PaymentIntent extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -125,18 +126,18 @@ class PaymentIntent extends ApiResource /** * Returns a list of PaymentIntents. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\PaymentIntent> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -152,13 +153,13 @@ class PaymentIntent extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentIntent * - * @return \Stripe\PaymentIntent + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -175,12 +176,12 @@ class PaymentIntent extends ApiResource * href="/docs/api/payment_intents/confirm">confirm API instead. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{amount?: int, application_fee_amount?: null|int, capture_method?: string, currency?: string, customer?: string, description?: string, expand?: string[], metadata?: null|array, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, pix?: null|array{expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, preferred_settlement_speed?: null|string, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], receipt_email?: null|string, setup_future_usage?: null|string, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int}, transfer_group?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentIntent the updated resource * - * @return \Stripe\PaymentIntent the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -188,7 +189,7 @@ class PaymentIntent extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -198,9 +199,9 @@ class PaymentIntent extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentIntent the applied payment intent * - * @return \Stripe\PaymentIntent the applied payment intent + * @throws Exception\ApiErrorException if the request fails */ public function applyCustomerBalance($params = null, $opts = null) { @@ -215,9 +216,9 @@ class PaymentIntent extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentIntent the canceled payment intent * - * @return \Stripe\PaymentIntent the canceled payment intent + * @throws Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { @@ -232,9 +233,9 @@ class PaymentIntent extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentIntent the captured payment intent * - * @return \Stripe\PaymentIntent the captured payment intent + * @throws Exception\ApiErrorException if the request fails */ public function capture($params = null, $opts = null) { @@ -249,9 +250,9 @@ class PaymentIntent extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentIntent the confirmed payment intent * - * @return \Stripe\PaymentIntent the confirmed payment intent + * @throws Exception\ApiErrorException if the request fails */ public function confirm($params = null, $opts = null) { @@ -266,9 +267,9 @@ class PaymentIntent extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentIntent the incremented payment intent * - * @return \Stripe\PaymentIntent the incremented payment intent + * @throws Exception\ApiErrorException if the request fails */ public function incrementAuthorization($params = null, $opts = null) { @@ -283,9 +284,9 @@ class PaymentIntent extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentIntent the verified payment intent * - * @return \Stripe\PaymentIntent the verified payment intent + * @throws Exception\ApiErrorException if the request fails */ public function verifyMicrodeposits($params = null, $opts = null) { @@ -300,14 +301,14 @@ class PaymentIntent extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SearchResult the payment intent search results * - * @return \Stripe\SearchResult<\Stripe\PaymentIntent> the payment intent search results + * @throws Exception\ApiErrorException if the request fails */ public static function search($params = null, $opts = null) { $url = '/v1/payment_intents/search'; - return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts); + return static::_requestPage($url, SearchResult::class, $params, $opts); } } diff --git a/plugins/stripe-php/lib/PaymentLink.php b/plugins/stripe-php/lib/PaymentLink.php index c0c59c97..c42b8275 100644 --- a/plugins/stripe-php/lib/PaymentLink.php +++ b/plugins/stripe-php/lib/PaymentLink.php @@ -14,35 +14,36 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Whether the payment link's url is active. If false, customers visiting the URL will be shown a page saying that the link has been deactivated. - * @property \Stripe\StripeObject $after_completion + * @property (object{hosted_confirmation?: (object{custom_message: null|string}&StripeObject), redirect?: (object{url: string}&StripeObject), type: string}&StripeObject) $after_completion * @property bool $allow_promotion_codes Whether user redeemable promotion codes are enabled. - * @property null|string|\Stripe\Application $application The ID of the Connect application that created the Payment Link. + * @property null|Application|string $application The ID of the Connect application that created the Payment Link. * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. * @property null|float $application_fee_percent This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - * @property \Stripe\StripeObject $automatic_tax + * @property (object{enabled: bool, liability: null|(object{account?: Account|string, type: string}&StripeObject)}&StripeObject) $automatic_tax * @property string $billing_address_collection Configuration for collecting the customer's billing address. Defaults to auto. - * @property null|\Stripe\StripeObject $consent_collection When set, provides configuration to gather active consent from customers. + * @property null|(object{payment_method_reuse_agreement: null|(object{position: string}&StripeObject), promotions: null|string, terms_of_service: null|string}&StripeObject) $consent_collection When set, provides configuration to gather active consent from customers. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property \Stripe\StripeObject[] $custom_fields Collect additional information from your customer using custom fields. Up to 3 fields are supported. - * @property \Stripe\StripeObject $custom_text + * @property ((object{dropdown?: (object{default_value: null|string, options: (object{label: string, value: string}&StripeObject)[]}&StripeObject), key: string, label: (object{custom: null|string, type: string}&StripeObject), numeric?: (object{default_value: null|string, maximum_length: null|int, minimum_length: null|int}&StripeObject), optional: bool, text?: (object{default_value: null|string, maximum_length: null|int, minimum_length: null|int}&StripeObject), type: string}&StripeObject))[] $custom_fields Collect additional information from your customer using custom fields. Up to 3 fields are supported. + * @property (object{after_submit: null|(object{message: string}&StripeObject), shipping_address: null|(object{message: string}&StripeObject), submit: null|(object{message: string}&StripeObject), terms_of_service_acceptance: null|(object{message: string}&StripeObject)}&StripeObject) $custom_text * @property string $customer_creation Configuration for Customer creation during checkout. * @property null|string $inactive_message The custom message to be displayed to a customer when a payment link is no longer active. - * @property null|\Stripe\StripeObject $invoice_creation Configuration for creating invoice for payment mode payment links. - * @property null|\Stripe\Collection<\Stripe\LineItem> $line_items The line items representing what is being sold. + * @property null|(object{enabled: bool, invoice_data: null|(object{account_tax_ids: null|(string|TaxId)[], custom_fields: null|(object{name: string, value: string}&StripeObject)[], description: null|string, footer: null|string, issuer: null|(object{account?: Account|string, type: string}&StripeObject), metadata: null|StripeObject, rendering_options: null|(object{amount_tax_display: null|string}&StripeObject)}&StripeObject)}&StripeObject) $invoice_creation Configuration for creating invoice for payment mode payment links. + * @property null|Collection $line_items The line items representing what is being sold. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. - * @property null|\Stripe\StripeObject $payment_intent_data Indicates the parameters to be passed to PaymentIntent creation during checkout. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|Account|string $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. + * @property null|((object{adjustable_quantity: null|(object{enabled: bool, maximum: null|int, minimum: null|int}&StripeObject), price: string, quantity: int}&StripeObject))[] $optional_items The optional items presented to the customer at checkout. + * @property null|(object{capture_method: null|string, description: null|string, metadata: StripeObject, setup_future_usage: null|string, statement_descriptor: null|string, statement_descriptor_suffix: null|string, transfer_group: null|string}&StripeObject) $payment_intent_data Indicates the parameters to be passed to PaymentIntent creation during checkout. * @property string $payment_method_collection Configuration for collecting a payment method during checkout. Defaults to always. * @property null|string[] $payment_method_types The list of payment method types that customers can use. When null, Stripe will dynamically show relevant payment methods you've enabled in your payment method settings. - * @property \Stripe\StripeObject $phone_number_collection - * @property null|\Stripe\StripeObject $restrictions Settings that restrict the usage of a payment link. - * @property null|\Stripe\StripeObject $shipping_address_collection Configuration for collecting the customer's shipping address. - * @property \Stripe\StripeObject[] $shipping_options The shipping rate options applied to the session. + * @property (object{enabled: bool}&StripeObject) $phone_number_collection + * @property null|(object{completed_sessions: (object{count: int, limit: int}&StripeObject)}&StripeObject) $restrictions Settings that restrict the usage of a payment link. + * @property null|(object{allowed_countries: string[]}&StripeObject) $shipping_address_collection Configuration for collecting the customer's shipping address. + * @property ((object{shipping_amount: int, shipping_rate: ShippingRate|string}&StripeObject))[] $shipping_options The shipping rate options applied to the session. * @property string $submit_type Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. - * @property null|\Stripe\StripeObject $subscription_data When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use subscription_data. - * @property \Stripe\StripeObject $tax_id_collection - * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + * @property null|(object{description: null|string, invoice_settings: (object{issuer: (object{account?: Account|string, type: string}&StripeObject)}&StripeObject), metadata: StripeObject, trial_period_days: null|int, trial_settings: null|(object{end_behavior: (object{missing_payment_method: string}&StripeObject)}&StripeObject)}&StripeObject) $subscription_data When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use subscription_data. + * @property (object{enabled: bool, required: string}&StripeObject) $tax_id_collection + * @property null|(object{amount: null|int, destination: Account|string}&StripeObject) $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. * @property string $url The public URL that can be shared with customers. */ class PaymentLink extends ApiResource @@ -69,12 +70,12 @@ class PaymentLink extends ApiResource /** * Creates a payment link. * - * @param null|array $params + * @param null|array{after_completion?: array{hosted_confirmation?: array{custom_message?: string}, redirect?: array{url: string}, type: string}, allow_promotion_codes?: bool, application_fee_amount?: int, application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_address_collection?: string, consent_collection?: array{payment_method_reuse_agreement?: array{position: string}, promotions?: string, terms_of_service?: string}, currency?: string, custom_fields?: array{dropdown?: array{default_value?: string, options: array{label: string, value: string}[]}, key: string, label: array{custom: string, type: string}, numeric?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, optional?: bool, text?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, type: string}[], custom_text?: array{after_submit?: null|array{message: string}, shipping_address?: null|array{message: string}, submit?: null|array{message: string}, terms_of_service_acceptance?: null|array{message: string}}, customer_creation?: string, expand?: string[], inactive_message?: string, invoice_creation?: array{enabled: bool, invoice_data?: array{account_tax_ids?: null|string[], custom_fields?: null|array{name: string, value: string}[], description?: string, footer?: string, issuer?: array{account?: string, type: string}, metadata?: null|array, rendering_options?: null|array{amount_tax_display?: null|string}}}, line_items: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, price: string, quantity: int}[], metadata?: array, on_behalf_of?: string, optional_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, price: string, quantity: int}[], payment_intent_data?: array{capture_method?: string, description?: string, metadata?: array, setup_future_usage?: string, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_group?: string}, payment_method_collection?: string, payment_method_types?: string[], phone_number_collection?: array{enabled: bool}, restrictions?: array{completed_sessions: array{limit: int}}, shipping_address_collection?: array{allowed_countries: string[]}, shipping_options?: array{shipping_rate?: string}[], submit_type?: string, subscription_data?: array{description?: string, invoice_settings?: array{issuer?: array{account?: string, type: string}}, metadata?: array, trial_period_days?: int, trial_settings?: array{end_behavior: array{missing_payment_method: string}}}, tax_id_collection?: array{enabled: bool, required?: string}, transfer_data?: array{amount?: int, destination: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentLink the created resource * - * @return \Stripe\PaymentLink the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -82,7 +83,7 @@ class PaymentLink extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -91,18 +92,18 @@ class PaymentLink extends ApiResource /** * Returns a list of your payment links. * - * @param null|array $params + * @param null|array{active?: bool, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\PaymentLink> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -111,13 +112,13 @@ class PaymentLink extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentLink * - * @return \Stripe\PaymentLink + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -128,12 +129,12 @@ class PaymentLink extends ApiResource * Updates a payment link. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{active?: bool, after_completion?: array{hosted_confirmation?: array{custom_message?: string}, redirect?: array{url: string}, type: string}, allow_promotion_codes?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_address_collection?: string, custom_fields?: null|array{dropdown?: array{default_value?: string, options: array{label: string, value: string}[]}, key: string, label: array{custom: string, type: string}, numeric?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, optional?: bool, text?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, type: string}[], custom_text?: array{after_submit?: null|array{message: string}, shipping_address?: null|array{message: string}, submit?: null|array{message: string}, terms_of_service_acceptance?: null|array{message: string}}, customer_creation?: string, expand?: string[], inactive_message?: null|string, invoice_creation?: array{enabled: bool, invoice_data?: array{account_tax_ids?: null|string[], custom_fields?: null|array{name: string, value: string}[], description?: string, footer?: string, issuer?: array{account?: string, type: string}, metadata?: null|array, rendering_options?: null|array{amount_tax_display?: null|string}}}, line_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, id: string, quantity?: int}[], metadata?: array, payment_intent_data?: array{description?: null|string, metadata?: null|array, statement_descriptor?: null|string, statement_descriptor_suffix?: null|string, transfer_group?: null|string}, payment_method_collection?: string, payment_method_types?: null|string[], phone_number_collection?: array{enabled: bool}, restrictions?: null|array{completed_sessions: array{limit: int}}, shipping_address_collection?: null|array{allowed_countries: string[]}, submit_type?: string, subscription_data?: array{invoice_settings?: array{issuer?: array{account?: string, type: string}}, metadata?: null|array, trial_period_days?: null|int, trial_settings?: null|array{end_behavior: array{missing_payment_method: string}}}, tax_id_collection?: array{enabled: bool, required?: string}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentLink the updated resource * - * @return \Stripe\PaymentLink the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -141,7 +142,7 @@ class PaymentLink extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -152,15 +153,15 @@ class PaymentLink extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection list of line items * - * @return \Stripe\Collection<\Stripe\LineItem> list of line items + * @throws Exception\ApiErrorException if the request fails */ public static function allLineItems($id, $params = null, $opts = null) { $url = static::resourceUrl($id) . '/line_items'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/PaymentMethod.php b/plugins/stripe-php/lib/PaymentMethod.php index d2d32b06..54c44740 100644 --- a/plugins/stripe-php/lib/PaymentMethod.php +++ b/plugins/stripe-php/lib/PaymentMethod.php @@ -13,59 +13,63 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $acss_debit - * @property null|\Stripe\StripeObject $affirm - * @property null|\Stripe\StripeObject $afterpay_clearpay - * @property null|\Stripe\StripeObject $alipay + * @property null|(object{bank_name: null|string, fingerprint: null|string, institution_number: null|string, last4: null|string, transit_number: null|string}&StripeObject) $acss_debit + * @property null|(object{}&StripeObject) $affirm + * @property null|(object{}&StripeObject) $afterpay_clearpay + * @property null|(object{}&StripeObject) $alipay * @property null|string $allow_redisplay This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. - * @property null|\Stripe\StripeObject $alma - * @property null|\Stripe\StripeObject $amazon_pay - * @property null|\Stripe\StripeObject $au_becs_debit - * @property null|\Stripe\StripeObject $bacs_debit - * @property null|\Stripe\StripeObject $bancontact - * @property \Stripe\StripeObject $billing_details - * @property null|\Stripe\StripeObject $blik - * @property null|\Stripe\StripeObject $boleto - * @property null|\Stripe\StripeObject $card - * @property null|\Stripe\StripeObject $card_present - * @property null|\Stripe\StripeObject $cashapp + * @property null|(object{}&StripeObject) $alma + * @property null|(object{}&StripeObject) $amazon_pay + * @property null|(object{bsb_number: null|string, fingerprint: null|string, last4: null|string}&StripeObject) $au_becs_debit + * @property null|(object{fingerprint: null|string, last4: null|string, sort_code: null|string}&StripeObject) $bacs_debit + * @property null|(object{}&StripeObject) $bancontact + * @property null|(object{}&StripeObject) $billie + * @property (object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string, tax_id: null|string}&StripeObject) $billing_details + * @property null|(object{}&StripeObject) $blik + * @property null|(object{tax_id: string}&StripeObject) $boleto + * @property null|(object{brand: string, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description?: null|string, display_brand: null|string, exp_month: int, exp_year: int, fingerprint?: null|string, funding: string, generated_from: null|(object{charge: null|string, payment_method_details: null|(object{card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), type: string}&StripeObject), setup_attempt: null|SetupAttempt|string}&StripeObject), iin?: null|string, issuer?: null|string, last4: string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), regulated_status: null|string, three_d_secure_usage: null|(object{supported: bool}&StripeObject), wallet: null|(object{amex_express_checkout?: (object{}&StripeObject), apple_pay?: (object{}&StripeObject), dynamic_last4: null|string, google_pay?: (object{}&StripeObject), link?: (object{}&StripeObject), masterpass?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject), samsung_pay?: (object{}&StripeObject), type: string, visa_checkout?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject)}&StripeObject)}&StripeObject) $card + * @property null|(object{brand: null|string, brand_product: null|string, cardholder_name: null|string, country: null|string, description?: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), preferred_locales: null|string[], read_method: null|string, wallet?: (object{type: string}&StripeObject)}&StripeObject) $card_present + * @property null|(object{buyer_id: null|string, cashtag: null|string}&StripeObject) $cashapp * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. - * @property null|\Stripe\StripeObject $customer_balance - * @property null|\Stripe\StripeObject $eps - * @property null|\Stripe\StripeObject $fpx - * @property null|\Stripe\StripeObject $giropay - * @property null|\Stripe\StripeObject $grabpay - * @property null|\Stripe\StripeObject $ideal - * @property null|\Stripe\StripeObject $interac_present - * @property null|\Stripe\StripeObject $kakao_pay - * @property null|\Stripe\StripeObject $klarna - * @property null|\Stripe\StripeObject $konbini - * @property null|\Stripe\StripeObject $kr_card - * @property null|\Stripe\StripeObject $link + * @property null|Customer|string $customer The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + * @property null|(object{}&StripeObject) $customer_balance + * @property null|(object{bank: null|string}&StripeObject) $eps + * @property null|(object{account_holder_type: null|string, bank: string}&StripeObject) $fpx + * @property null|(object{}&StripeObject) $giropay + * @property null|(object{}&StripeObject) $grabpay + * @property null|(object{bank: null|string, bic: null|string}&StripeObject) $ideal + * @property null|(object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), preferred_locales: null|string[], read_method: null|string}&StripeObject) $interac_present + * @property null|(object{}&StripeObject) $kakao_pay + * @property null|(object{dob?: null|(object{day: null|int, month: null|int, year: null|int}&StripeObject)}&StripeObject) $klarna + * @property null|(object{}&StripeObject) $konbini + * @property null|(object{brand: null|string, last4: null|string}&StripeObject) $kr_card + * @property null|(object{email: null|string, persistent_token?: string}&StripeObject) $link * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $mobilepay - * @property null|\Stripe\StripeObject $multibanco - * @property null|\Stripe\StripeObject $naver_pay - * @property null|\Stripe\StripeObject $oxxo - * @property null|\Stripe\StripeObject $p24 - * @property null|\Stripe\StripeObject $payco - * @property null|\Stripe\StripeObject $paynow - * @property null|\Stripe\StripeObject $paypal - * @property null|\Stripe\StripeObject $pix - * @property null|\Stripe\StripeObject $promptpay - * @property null|\Stripe\StripeObject $radar_options Options to configure Radar. See Radar Session for more information. - * @property null|\Stripe\StripeObject $revolut_pay - * @property null|\Stripe\StripeObject $samsung_pay - * @property null|\Stripe\StripeObject $sepa_debit - * @property null|\Stripe\StripeObject $sofort - * @property null|\Stripe\StripeObject $swish - * @property null|\Stripe\StripeObject $twint + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|(object{}&StripeObject) $mobilepay + * @property null|(object{}&StripeObject) $multibanco + * @property null|(object{buyer_id?: null|string, funding: string}&StripeObject) $naver_pay + * @property null|(object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, last4: string, suffix: null|string}&StripeObject) $nz_bank_account + * @property null|(object{}&StripeObject) $oxxo + * @property null|(object{bank: null|string}&StripeObject) $p24 + * @property null|(object{}&StripeObject) $pay_by_bank + * @property null|(object{}&StripeObject) $payco + * @property null|(object{}&StripeObject) $paynow + * @property null|(object{country: null|string, payer_email: null|string, payer_id: null|string}&StripeObject) $paypal + * @property null|(object{}&StripeObject) $pix + * @property null|(object{}&StripeObject) $promptpay + * @property null|(object{session?: string}&StripeObject) $radar_options Options to configure Radar. See Radar Session for more information. + * @property null|(object{}&StripeObject) $revolut_pay + * @property null|(object{}&StripeObject) $samsung_pay + * @property null|(object{}&StripeObject) $satispay + * @property null|(object{bank_code: null|string, branch_code: null|string, country: null|string, fingerprint: null|string, generated_from: null|(object{charge: null|Charge|string, setup_attempt: null|SetupAttempt|string}&StripeObject), last4: null|string}&StripeObject) $sepa_debit + * @property null|(object{country: null|string}&StripeObject) $sofort + * @property null|(object{}&StripeObject) $swish + * @property null|(object{}&StripeObject) $twint * @property string $type The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - * @property null|\Stripe\StripeObject $us_bank_account - * @property null|\Stripe\StripeObject $wechat_pay - * @property null|\Stripe\StripeObject $zip + * @property null|(object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, financial_connections_account: null|string, fingerprint: null|string, last4: null|string, networks: null|(object{preferred: null|string, supported: string[]}&StripeObject), routing_number: null|string, status_details: null|(object{blocked?: (object{network_code: null|string, reason: null|string}&StripeObject)}&StripeObject)}&StripeObject) $us_bank_account + * @property null|(object{}&StripeObject) $wechat_pay + * @property null|(object{}&StripeObject) $zip */ class PaymentMethod extends ApiResource { @@ -86,6 +90,7 @@ class PaymentMethod extends ApiResource const TYPE_AU_BECS_DEBIT = 'au_becs_debit'; const TYPE_BACS_DEBIT = 'bacs_debit'; const TYPE_BANCONTACT = 'bancontact'; + const TYPE_BILLIE = 'billie'; const TYPE_BLIK = 'blik'; const TYPE_BOLETO = 'boleto'; const TYPE_CARD = 'card'; @@ -106,15 +111,18 @@ class PaymentMethod extends ApiResource const TYPE_MOBILEPAY = 'mobilepay'; const TYPE_MULTIBANCO = 'multibanco'; const TYPE_NAVER_PAY = 'naver_pay'; + const TYPE_NZ_BANK_ACCOUNT = 'nz_bank_account'; const TYPE_OXXO = 'oxxo'; const TYPE_P24 = 'p24'; const TYPE_PAYCO = 'payco'; const TYPE_PAYNOW = 'paynow'; const TYPE_PAYPAL = 'paypal'; + const TYPE_PAY_BY_BANK = 'pay_by_bank'; const TYPE_PIX = 'pix'; const TYPE_PROMPTPAY = 'promptpay'; const TYPE_REVOLUT_PAY = 'revolut_pay'; const TYPE_SAMSUNG_PAY = 'samsung_pay'; + const TYPE_SATISPAY = 'satispay'; const TYPE_SEPA_DEBIT = 'sepa_debit'; const TYPE_SOFORT = 'sofort'; const TYPE_SWISH = 'swish'; @@ -134,12 +142,12 @@ class PaymentMethod extends ApiResource * href="/docs/payments/save-and-reuse">SetupIntent API to collect payment * method details ahead of a future payment. * - * @param null|array $params + * @param null|array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, card?: array{cvc?: string, exp_month?: int, exp_year?: int, networks?: array{preferred?: string}, number?: string, token?: string}, cashapp?: array{}, customer?: string, customer_balance?: array{}, eps?: array{bank?: string}, expand?: string[], fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, payment_method?: string, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type?: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethod the created resource * - * @return \Stripe\PaymentMethod the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -147,7 +155,7 @@ class PaymentMethod extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -159,18 +167,18 @@ class PaymentMethod extends ApiResource * href="/docs/api/payment_methods/customer_list">List a Customer’s * PaymentMethods API instead. * - * @param null|array $params + * @param null|array{customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\PaymentMethod> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -182,13 +190,13 @@ class PaymentMethod extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethod * - * @return \Stripe\PaymentMethod + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -200,12 +208,12 @@ class PaymentMethod extends ApiResource * be updated. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{allow_redisplay?: string, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, card?: array{exp_month?: int, exp_year?: int, networks?: array{preferred?: null|string}}, expand?: string[], link?: array{}, metadata?: null|array, pay_by_bank?: array{}, us_bank_account?: array{account_holder_type?: string, account_type?: string}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethod the updated resource * - * @return \Stripe\PaymentMethod the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -213,7 +221,7 @@ class PaymentMethod extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -223,9 +231,9 @@ class PaymentMethod extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethod the attached payment method * - * @return \Stripe\PaymentMethod the attached payment method + * @throws Exception\ApiErrorException if the request fails */ public function attach($params = null, $opts = null) { @@ -240,9 +248,9 @@ class PaymentMethod extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethod the detached payment method * - * @return \Stripe\PaymentMethod the detached payment method + * @throws Exception\ApiErrorException if the request fails */ public function detach($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/PaymentMethodConfiguration.php b/plugins/stripe-php/lib/PaymentMethodConfiguration.php index 46e1ed0f..1c87d219 100644 --- a/plugins/stripe-php/lib/PaymentMethodConfiguration.php +++ b/plugins/stripe-php/lib/PaymentMethodConfiguration.php @@ -22,53 +22,58 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $acss_debit + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $acss_debit * @property bool $active Whether the configuration can be used for new payments. - * @property null|\Stripe\StripeObject $affirm - * @property null|\Stripe\StripeObject $afterpay_clearpay - * @property null|\Stripe\StripeObject $alipay - * @property null|\Stripe\StripeObject $alma - * @property null|\Stripe\StripeObject $amazon_pay - * @property null|\Stripe\StripeObject $apple_pay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $affirm + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $afterpay_clearpay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $alipay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $alma + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $amazon_pay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $apple_pay * @property null|string $application For child configs, the Connect application associated with the configuration. - * @property null|\Stripe\StripeObject $au_becs_debit - * @property null|\Stripe\StripeObject $bacs_debit - * @property null|\Stripe\StripeObject $bancontact - * @property null|\Stripe\StripeObject $blik - * @property null|\Stripe\StripeObject $boleto - * @property null|\Stripe\StripeObject $card - * @property null|\Stripe\StripeObject $cartes_bancaires - * @property null|\Stripe\StripeObject $cashapp - * @property null|\Stripe\StripeObject $customer_balance - * @property null|\Stripe\StripeObject $eps - * @property null|\Stripe\StripeObject $fpx - * @property null|\Stripe\StripeObject $giropay - * @property null|\Stripe\StripeObject $google_pay - * @property null|\Stripe\StripeObject $grabpay - * @property null|\Stripe\StripeObject $ideal + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $au_becs_debit + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $bacs_debit + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $bancontact + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $billie + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $blik + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $boleto + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $card + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $cartes_bancaires + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $cashapp + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $customer_balance + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $eps + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $fpx + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $giropay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $google_pay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $grabpay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $ideal * @property bool $is_default The default configuration is used whenever a payment method configuration is not specified. - * @property null|\Stripe\StripeObject $jcb - * @property null|\Stripe\StripeObject $klarna - * @property null|\Stripe\StripeObject $konbini - * @property null|\Stripe\StripeObject $link + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $jcb + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $klarna + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $konbini + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $link * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $mobilepay - * @property null|\Stripe\StripeObject $multibanco + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $mobilepay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $multibanco * @property string $name The configuration's name. - * @property null|\Stripe\StripeObject $oxxo - * @property null|\Stripe\StripeObject $p24 + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $nz_bank_account + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $oxxo + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $p24 * @property null|string $parent For child configs, the configuration's parent configuration. - * @property null|\Stripe\StripeObject $paynow - * @property null|\Stripe\StripeObject $paypal - * @property null|\Stripe\StripeObject $promptpay - * @property null|\Stripe\StripeObject $revolut_pay - * @property null|\Stripe\StripeObject $sepa_debit - * @property null|\Stripe\StripeObject $sofort - * @property null|\Stripe\StripeObject $swish - * @property null|\Stripe\StripeObject $twint - * @property null|\Stripe\StripeObject $us_bank_account - * @property null|\Stripe\StripeObject $wechat_pay - * @property null|\Stripe\StripeObject $zip + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $pay_by_bank + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $paynow + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $paypal + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $pix + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $promptpay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $revolut_pay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $satispay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $sepa_debit + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $sofort + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $swish + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $twint + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $us_bank_account + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $wechat_pay + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $zip */ class PaymentMethodConfiguration extends ApiResource { @@ -79,12 +84,12 @@ class PaymentMethodConfiguration extends ApiResource /** * Creates a payment method configuration. * - * @param null|array $params + * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, parent?: string, pay_by_bank?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethodConfiguration the created resource * - * @return \Stripe\PaymentMethodConfiguration the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -92,7 +97,7 @@ class PaymentMethodConfiguration extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -101,18 +106,18 @@ class PaymentMethodConfiguration extends ApiResource /** * List payment method configurations. * - * @param null|array $params + * @param null|array{application?: null|string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\PaymentMethodConfiguration> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -121,13 +126,13 @@ class PaymentMethodConfiguration extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethodConfiguration * - * @return \Stripe\PaymentMethodConfiguration + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -138,12 +143,12 @@ class PaymentMethodConfiguration extends ApiResource * Update payment method configuration. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, active?: bool, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, pay_by_bank?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethodConfiguration the updated resource * - * @return \Stripe\PaymentMethodConfiguration the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -151,7 +156,7 @@ class PaymentMethodConfiguration extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/PaymentMethodDomain.php b/plugins/stripe-php/lib/PaymentMethodDomain.php index e50eaa93..fc0e6bbc 100644 --- a/plugins/stripe-php/lib/PaymentMethodDomain.php +++ b/plugins/stripe-php/lib/PaymentMethodDomain.php @@ -12,15 +12,16 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $amazon_pay Indicates the status of a specific payment method on a payment method domain. - * @property \Stripe\StripeObject $apple_pay Indicates the status of a specific payment method on a payment method domain. + * @property (object{status: string, status_details?: (object{error_message: string}&StripeObject)}&StripeObject) $amazon_pay Indicates the status of a specific payment method on a payment method domain. + * @property (object{status: string, status_details?: (object{error_message: string}&StripeObject)}&StripeObject) $apple_pay Indicates the status of a specific payment method on a payment method domain. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $domain_name The domain name that this payment method domain object represents. * @property bool $enabled Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. - * @property \Stripe\StripeObject $google_pay Indicates the status of a specific payment method on a payment method domain. - * @property \Stripe\StripeObject $link Indicates the status of a specific payment method on a payment method domain. + * @property (object{status: string, status_details?: (object{error_message: string}&StripeObject)}&StripeObject) $google_pay Indicates the status of a specific payment method on a payment method domain. + * @property (object{status: string, status_details?: (object{error_message: string}&StripeObject)}&StripeObject) $klarna Indicates the status of a specific payment method on a payment method domain. + * @property (object{status: string, status_details?: (object{error_message: string}&StripeObject)}&StripeObject) $link Indicates the status of a specific payment method on a payment method domain. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $paypal Indicates the status of a specific payment method on a payment method domain. + * @property (object{status: string, status_details?: (object{error_message: string}&StripeObject)}&StripeObject) $paypal Indicates the status of a specific payment method on a payment method domain. */ class PaymentMethodDomain extends ApiResource { @@ -31,12 +32,12 @@ class PaymentMethodDomain extends ApiResource /** * Creates a payment method domain. * - * @param null|array $params + * @param null|array{domain_name: string, enabled?: bool, expand?: string[]} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethodDomain the created resource * - * @return \Stripe\PaymentMethodDomain the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -44,7 +45,7 @@ class PaymentMethodDomain extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -53,18 +54,18 @@ class PaymentMethodDomain extends ApiResource /** * Lists the details of existing payment method domains. * - * @param null|array $params + * @param null|array{domain_name?: string, enabled?: bool, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\PaymentMethodDomain> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -73,13 +74,13 @@ class PaymentMethodDomain extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethodDomain * - * @return \Stripe\PaymentMethodDomain + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -90,12 +91,12 @@ class PaymentMethodDomain extends ApiResource * Updates an existing payment method domain. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{enabled?: bool, expand?: string[]} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethodDomain the updated resource * - * @return \Stripe\PaymentMethodDomain the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -103,7 +104,7 @@ class PaymentMethodDomain extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -113,9 +114,9 @@ class PaymentMethodDomain extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PaymentMethodDomain the validated payment method domain * - * @return \Stripe\PaymentMethodDomain the validated payment method domain + * @throws Exception\ApiErrorException if the request fails */ public function validate($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Payout.php b/plugins/stripe-php/lib/Payout.php index b97bcfa4..c6821d97 100644 --- a/plugins/stripe-php/lib/Payout.php +++ b/plugins/stripe-php/lib/Payout.php @@ -17,28 +17,28 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The amount (in cents (or local equivalent)) that transfers to your bank account or debit card. - * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the payout. See the Connect documentation for details. + * @property null|ApplicationFee|string $application_fee The application fee (if any) for the payout. See the Connect documentation for details. * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the payout. See the Connect documentation for details. * @property int $arrival_date Date that you can expect the payout to arrive in the bank. This factors in delays to account for weekends or bank holidays. * @property bool $automatic Returns true if the payout is created by an automated payout schedule and false if it's requested manually. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this payout on your account balance. + * @property null|BalanceTransaction|string $balance_transaction ID of the balance transaction that describes the impact of this payout on your account balance. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\BankAccount|\Stripe\Card $destination ID of the bank account or card the payout is sent to. - * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance. + * @property null|BankAccount|Card|string $destination ID of the bank account or card the payout is sent to. + * @property null|BalanceTransaction|string $failure_balance_transaction If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance. * @property null|string $failure_code Error code that provides a reason for a payout failure, if available. View our list of failure codes. * @property null|string $failure_message Message that provides the reason for a payout failure, if available. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $method The method used to send this payout, which can be standard or instant. instant is supported for payouts to debit cards and bank accounts in certain countries. Learn more about bank support for Instant Payouts. - * @property null|string|\Stripe\Payout $original_payout If the payout reverses another, this is the ID of the original payout. + * @property null|Payout|string $original_payout If the payout reverses another, this is the ID of the original payout. * @property string $reconciliation_status If completed, you can use the Balance Transactions API to list all balance transactions that are paid out in this payout. - * @property null|string|\Stripe\Payout $reversed_by If the payout reverses, this is the ID of the payout that reverses this payout. + * @property null|Payout|string $reversed_by If the payout reverses, this is the ID of the payout that reverses this payout. * @property string $source_type The source balance this payout came from, which can be one of the following: card, fpx, or bank_account. * @property null|string $statement_descriptor Extra information about a payout that displays on the user's bank statement. * @property string $status Current status of the payout: paid, pending, in_transit, canceled or failed. A payout is pending until it's submitted to the bank, when it becomes in_transit. The status changes to paid if the transaction succeeds, or to failed or canceled (within 5 business days). Some payouts that fail might initially show as paid, then change to failed. - * @property null|\Stripe\StripeObject $trace_id A value that generates from the beneficiary's bank that allows users to track payouts with their bank. Banks might call this a "reference number" or something similar. + * @property null|(object{status: string, value: null|string}&StripeObject) $trace_id A value that generates from the beneficiary's bank that allows users to track payouts with their bank. Banks might call this a "reference number" or something similar. * @property string $type Can be bank_account or card. */ class Payout extends ApiResource @@ -76,12 +76,12 @@ class Payout extends ApiResource * from. The balance object details available and * pending amounts by source type. * - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, destination?: string, expand?: string[], metadata?: array, method?: string, source_type?: string, statement_descriptor?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Payout the created resource * - * @return \Stripe\Payout the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -89,7 +89,7 @@ class Payout extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -100,18 +100,18 @@ class Payout extends ApiResource * that Stripe sent to you. The payouts return in sorted order, with the most * recently created payouts appearing first. * - * @param null|array $params + * @param null|array{arrival_date?: array|int, created?: array|int, destination?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Payout> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -122,13 +122,13 @@ class Payout extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Payout * - * @return \Stripe\Payout + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -141,12 +141,12 @@ class Payout extends ApiResource * metadata as arguments. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Payout the updated resource * - * @return \Stripe\Payout the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -154,7 +154,7 @@ class Payout extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -180,9 +180,9 @@ class Payout extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Payout the canceled payout * - * @return \Stripe\Payout the canceled payout + * @throws Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { @@ -197,9 +197,9 @@ class Payout extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Payout the reversed payout * - * @return \Stripe\Payout the reversed payout + * @throws Exception\ApiErrorException if the request fails */ public function reverse($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Person.php b/plugins/stripe-php/lib/Person.php index 467295ed..7125c93d 100644 --- a/plugins/stripe-php/lib/Person.php +++ b/plugins/stripe-php/lib/Person.php @@ -7,41 +7,42 @@ namespace Stripe; /** * This is an object representing a person associated with a Stripe account. * - * A platform cannot access a person for an account where account.controller.requirement_collection is stripe, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. + * A platform can only access a subset of data in a person for an account where account.controller.requirement_collection is stripe, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. * * See the Standard onboarding or Express onboarding documentation for information about prefilling information and account onboarding steps. Learn more about handling identity verification with the API. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string $account The account the person is associated with. - * @property null|\Stripe\StripeObject $additional_tos_acceptances - * @property null|\Stripe\StripeObject $address - * @property null|\Stripe\StripeObject $address_kana The Kana variation of the person's address (Japan only). - * @property null|\Stripe\StripeObject $address_kanji The Kanji variation of the person's address (Japan only). + * @property null|(object{account: null|(object{date: null|int, ip: null|string, user_agent: null|string}&StripeObject)}&StripeObject) $additional_tos_acceptances + * @property null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject) $address + * @property null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string, town: null|string}&StripeObject) $address_kana The Kana variation of the person's address (Japan only). + * @property null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string, town: null|string}&StripeObject) $address_kanji The Kanji variation of the person's address (Japan only). * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $dob - * @property null|string $email The person's email address. - * @property null|string $first_name The person's first name. - * @property null|string $first_name_kana The Kana variation of the person's first name (Japan only). - * @property null|string $first_name_kanji The Kanji variation of the person's first name (Japan only). - * @property null|string[] $full_name_aliases A list of alternate names or aliases that the person is known by. - * @property null|\Stripe\StripeObject $future_requirements Information about the upcoming new requirements for this person, including what information needs to be collected, and by when. + * @property null|(object{day: null|int, month: null|int, year: null|int}&StripeObject) $dob + * @property null|string $email The person's email address. Also available for accounts where controller.requirement_collection is stripe. + * @property null|string $first_name The person's first name. Also available for accounts where controller.requirement_collection is stripe. + * @property null|string $first_name_kana The Kana variation of the person's first name (Japan only). Also available for accounts where controller.requirement_collection is stripe. + * @property null|string $first_name_kanji The Kanji variation of the person's first name (Japan only). Also available for accounts where controller.requirement_collection is stripe. + * @property null|string[] $full_name_aliases A list of alternate names or aliases that the person is known by. Also available for accounts where controller.requirement_collection is stripe. + * @property null|(object{alternatives: null|(object{alternative_fields_due: string[], original_fields_due: string[]}&StripeObject)[], currently_due: string[], errors: (object{code: string, reason: string, requirement: string}&StripeObject)[], eventually_due: string[], past_due: string[], pending_verification: string[]}&StripeObject) $future_requirements Information about the upcoming new requirements for this person, including what information needs to be collected, and by when. * @property null|string $gender The person's gender. * @property null|bool $id_number_provided Whether the person's id_number was provided. True if either the full ID number was provided or if only the required part of the ID number was provided (ex. last four of an individual's SSN for the US indicated by ssn_last_4_provided). * @property null|bool $id_number_secondary_provided Whether the person's id_number_secondary was provided. - * @property null|string $last_name The person's last name. - * @property null|string $last_name_kana The Kana variation of the person's last name (Japan only). - * @property null|string $last_name_kanji The Kanji variation of the person's last name (Japan only). + * @property null|string $last_name The person's last name. Also available for accounts where controller.requirement_collection is stripe. + * @property null|string $last_name_kana The Kana variation of the person's last name (Japan only). Also available for accounts where controller.requirement_collection is stripe. + * @property null|string $last_name_kanji The Kanji variation of the person's last name (Japan only). Also available for accounts where controller.requirement_collection is stripe. * @property null|string $maiden_name The person's maiden name. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $nationality The country where the person is a national. * @property null|string $phone The person's phone number. * @property null|string $political_exposure Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - * @property null|\Stripe\StripeObject $registered_address - * @property null|\Stripe\StripeObject $relationship - * @property null|\Stripe\StripeObject $requirements Information about the requirements for this person, including what information needs to be collected, and by when. + * @property null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject) $registered_address + * @property null|(object{authorizer: null|bool, director: null|bool, executive: null|bool, legal_guardian: null|bool, owner: null|bool, percent_ownership: null|float, representative: null|bool, title: null|string}&StripeObject) $relationship + * @property null|(object{alternatives: null|(object{alternative_fields_due: string[], original_fields_due: string[]}&StripeObject)[], currently_due: string[], errors: (object{code: string, reason: string, requirement: string}&StripeObject)[], eventually_due: string[], past_due: string[], pending_verification: string[]}&StripeObject) $requirements Information about the requirements for this person, including what information needs to be collected, and by when. * @property null|bool $ssn_last_4_provided Whether the last four digits of the person's Social Security number have been provided (U.S. only). - * @property null|\Stripe\StripeObject $verification + * @property null|(object{ethnicity_details: null|(object{ethnicity: null|string[], ethnicity_other: null|string}&StripeObject), race_details: null|(object{race: null|string[], race_other: null|string}&StripeObject), self_identified_gender: null|string}&StripeObject) $us_cfpb_data Demographic data related to the person. + * @property null|(object{additional_document?: null|(object{back: null|File|string, details: null|string, details_code: null|string, front: null|File|string}&StripeObject), details?: null|string, details_code?: null|string, document?: (object{back: null|File|string, details: null|string, details_code: null|string, front: null|File|string}&StripeObject), status: string}&StripeObject) $verification */ class Person extends ApiResource { @@ -68,8 +69,8 @@ class Person extends ApiResource $account = $this['account']; if (!$id) { throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", + 'Could not determine which URL to request: ' + . "class instance has invalid ID: {$id}", null ); } @@ -87,13 +88,13 @@ class Person extends ApiResource * @param array|string $_id * @param null|array|string $_opts * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function retrieve($_id, $_opts = null) { - $msg = 'Persons cannot be retrieved without an account ID. Retrieve ' . - "a person using `Account::retrievePerson('account_id', " . - "'person_id')`."; + $msg = 'Persons cannot be retrieved without an account ID. Retrieve ' + . "a person using `Account::retrievePerson('account_id', " + . "'person_id')`."; throw new Exception\BadMethodCallException($msg); } @@ -103,13 +104,13 @@ class Person extends ApiResource * @param null|array $_params * @param null|array|string $_options * - * @throws \Stripe\Exception\BadMethodCallException + * @throws Exception\BadMethodCallException */ public static function update($_id, $_params = null, $_options = null) { - $msg = 'Persons cannot be updated without an account ID. Update ' . - "a person using `Account::updatePerson('account_id', " . - "'person_id', \$updateParams)`."; + $msg = 'Persons cannot be updated without an account ID. Update ' + . "a person using `Account::updatePerson('account_id', " + . "'person_id', \$updateParams)`."; throw new Exception\BadMethodCallException($msg); } @@ -117,10 +118,10 @@ class Person extends ApiResource /** * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return static the saved resource * + * @throws Exception\ApiErrorException if the request fails + * * @deprecated The `save` method is deprecated and will be removed in a * future major version of the library. Use the static method `update` * on the resource instead. diff --git a/plugins/stripe-php/lib/Plan.php b/plugins/stripe-php/lib/Plan.php index 53d869b7..13655a64 100644 --- a/plugins/stripe-php/lib/Plan.php +++ b/plugins/stripe-php/lib/Plan.php @@ -17,7 +17,6 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Whether the plan can be used for new purchases. - * @property null|string $aggregate_usage Specifies a usage aggregation strategy for plans of usage_type=metered. Allowed values are sum for summing up all usage during a period, last_during_period for using the last usage record reported within a period, last_ever for using the last usage record ever (across period bounds) or max which uses the usage record with the maximum reported usage during a period. Defaults to sum. * @property null|int $amount The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. * @property null|string $amount_decimal The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in amount) will be charged per unit in quantity (for plans with usage_type=licensed), or per unit of total usage (for plans with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. @@ -26,13 +25,13 @@ namespace Stripe; * @property string $interval The frequency at which a subscription is billed. One of day, week, month or year. * @property int $interval_count The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $meter The meter tracking the usage of a metered price * @property null|string $nickname A brief description of the plan, hidden from customers. - * @property null|string|\Stripe\Product $product The product whose pricing this plan determines. - * @property null|\Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. + * @property null|Product|string $product The product whose pricing this plan determines. + * @property null|((object{flat_amount: null|int, flat_amount_decimal: null|string, unit_amount: null|int, unit_amount_decimal: null|string, up_to: null|int}&StripeObject))[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. - * @property null|\Stripe\StripeObject $transform_usage Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. + * @property null|(object{divide_by: int, round: string}&StripeObject) $transform_usage Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. * @property null|int $trial_period_days Default number of trial days when subscribing a customer to this plan using trial_from_plan=true. * @property string $usage_type Configures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed. */ @@ -42,11 +41,6 @@ class Plan extends ApiResource use ApiOperations\Update; - const AGGREGATE_USAGE_LAST_DURING_PERIOD = 'last_during_period'; - const AGGREGATE_USAGE_LAST_EVER = 'last_ever'; - const AGGREGATE_USAGE_MAX = 'max'; - const AGGREGATE_USAGE_SUM = 'sum'; - const BILLING_SCHEME_PER_UNIT = 'per_unit'; const BILLING_SCHEME_TIERED = 'tiered'; @@ -66,12 +60,12 @@ class Plan extends ApiResource * API. It replaces the Plans API and is backwards compatible to simplify your * migration. * - * @param null|array $params + * @param null|array{active?: bool, amount?: int, amount_decimal?: string, billing_scheme?: string, currency: string, expand?: string[], id?: string, interval: string, interval_count?: int, metadata?: null|array, meter?: string, nickname?: string, product?: array|string, tiers?: (array{flat_amount?: int, flat_amount_decimal?: string, unit_amount?: int, unit_amount_decimal?: string, up_to: array|int|string})[], tiers_mode?: string, transform_usage?: array{divide_by: int, round: string}, trial_period_days?: int, usage_type?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Plan the created resource * - * @return \Stripe\Plan the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -79,7 +73,7 @@ class Plan extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -92,9 +86,9 @@ class Plan extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Plan the deleted resource * - * @return \Stripe\Plan the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -110,18 +104,18 @@ class Plan extends ApiResource /** * Returns a list of your plans. * - * @param null|array $params + * @param null|array{active?: bool, created?: array|int, ending_before?: string, expand?: string[], limit?: int, product?: string, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Plan> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -130,13 +124,13 @@ class Plan extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Plan * - * @return \Stripe\Plan + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -149,12 +143,12 @@ class Plan extends ApiResource * plan’s ID, amount, currency, or billing cycle. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{active?: bool, expand?: string[], metadata?: null|array, nickname?: string, product?: string, trial_period_days?: int} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Plan the updated resource * - * @return \Stripe\Plan the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -162,7 +156,7 @@ class Plan extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/Price.php b/plugins/stripe-php/lib/Price.php index 48a76228..5ce4e341 100644 --- a/plugins/stripe-php/lib/Price.php +++ b/plugins/stripe-php/lib/Price.php @@ -18,18 +18,18 @@ namespace Stripe; * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity (for prices with usage_type=licensed), or per unit of total usage (for prices with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|\Stripe\StripeObject $currency_options Prices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency. - * @property null|\Stripe\StripeObject $custom_unit_amount When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + * @property null|StripeObject $currency_options Prices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency. + * @property null|(object{maximum: null|int, minimum: null|int, preset: null|int}&StripeObject) $custom_unit_amount When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $lookup_key A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $nickname A brief description of the price, hidden from customers. - * @property string|\Stripe\Product $product The ID of the product this price is associated with. - * @property null|\Stripe\StripeObject $recurring The recurring components of a price such as interval and usage_type. + * @property Product|string $product The ID of the product this price is associated with. + * @property null|(object{interval: string, interval_count: int, meter: null|string, trial_period_days: null|int, usage_type: string}&StripeObject) $recurring The recurring components of a price such as interval and usage_type. * @property null|string $tax_behavior Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. Once specified as either inclusive or exclusive, it cannot be changed. - * @property null|\Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. + * @property null|((object{flat_amount: null|int, flat_amount_decimal: null|string, unit_amount: null|int, unit_amount_decimal: null|string, up_to: null|int}&StripeObject))[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. - * @property null|\Stripe\StripeObject $transform_quantity Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. + * @property null|(object{divide_by: int, round: string}&StripeObject) $transform_quantity Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. * @property string $type One of one_time or recurring depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. * @property null|int $unit_amount The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. * @property null|string $unit_amount_decimal The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. @@ -54,15 +54,16 @@ class Price extends ApiResource const TYPE_RECURRING = 'recurring'; /** - * Creates a new price for an existing product. The price can be recurring or - * one-time. + * Creates a new Price for an + * existing Product. The Price + * can be recurring or one-time. * - * @param null|array $params + * @param null|array{active?: bool, billing_scheme?: string, currency: string, currency_options?: array, custom_unit_amount?: array{enabled: bool, maximum?: int, minimum?: int, preset?: int}, expand?: string[], lookup_key?: string, metadata?: array, nickname?: string, product?: string, product_data?: array{active?: bool, id?: string, metadata?: array, name: string, statement_descriptor?: string, tax_code?: string, unit_label?: string}, recurring?: array{interval: string, interval_count?: int, meter?: string, trial_period_days?: int, usage_type?: string}, tax_behavior?: string, tiers?: (array{flat_amount?: int, flat_amount_decimal?: string, unit_amount?: int, unit_amount_decimal?: string, up_to: array|int|string})[], tiers_mode?: string, transfer_lookup_key?: bool, transform_quantity?: array{divide_by: int, round: string}, unit_amount?: int, unit_amount_decimal?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Price the created resource * - * @return \Stripe\Price the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -70,7 +71,7 @@ class Price extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -81,18 +82,18 @@ class Price extends ApiResource * href="/docs/products-prices/pricing-models#inline-pricing">inline prices. * For the list of inactive prices, set active to false. * - * @param null|array $params + * @param null|array{active?: bool, created?: array|int, currency?: string, ending_before?: string, expand?: string[], limit?: int, lookup_keys?: string[], product?: string, recurring?: array{interval?: string, meter?: string, usage_type?: string}, starting_after?: string, type?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Price> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -101,13 +102,13 @@ class Price extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Price * - * @return \Stripe\Price + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -119,12 +120,12 @@ class Price extends ApiResource * parameters not provided are left unchanged. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{active?: bool, currency_options?: null|array, expand?: string[], lookup_key?: string, metadata?: null|array, nickname?: string, tax_behavior?: string, transfer_lookup_key?: bool} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Price the updated resource * - * @return \Stripe\Price the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -132,7 +133,7 @@ class Price extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -142,14 +143,14 @@ class Price extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SearchResult the price search results * - * @return \Stripe\SearchResult<\Stripe\Price> the price search results + * @throws Exception\ApiErrorException if the request fails */ public static function search($params = null, $opts = null) { $url = '/v1/prices/search'; - return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts); + return static::_requestPage($url, SearchResult::class, $params, $opts); } } diff --git a/plugins/stripe-php/lib/Product.php b/plugins/stripe-php/lib/Product.php index 168d7a0c..66175c05 100644 --- a/plugins/stripe-php/lib/Product.php +++ b/plugins/stripe-php/lib/Product.php @@ -18,17 +18,17 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Whether the product is currently available for purchase. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Price $default_price The ID of the Price object that is the default price for this product. + * @property null|Price|string $default_price The ID of the Price object that is the default price for this product. * @property null|string $description The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. * @property string[] $images A list of up to 8 URLs of images for this product, meant to be displayable to the customer. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject[] $marketing_features A list of up to 15 marketing features for this product. These are displayed in pricing tables. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property (object{name?: string}&StripeObject)[] $marketing_features A list of up to 15 marketing features for this product. These are displayed in pricing tables. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $name The product's name, meant to be displayable to the customer. - * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this product for shipping purposes. + * @property null|(object{height: float, length: float, weight: float, width: float}&StripeObject) $package_dimensions The dimensions of this product for shipping purposes. * @property null|bool $shippable Whether this product is shipped (i.e., physical goods). * @property null|string $statement_descriptor Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. Only used for subscription payments. - * @property null|string|\Stripe\TaxCode $tax_code A tax code ID. + * @property null|string|TaxCode $tax_code A tax code ID. * @property string $type The type of the product. The product is either of type good, which is eligible for use with Orders and SKUs, or service, which is eligible for use with Subscriptions and Plans. * @property null|string $unit_label A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. @@ -47,12 +47,12 @@ class Product extends ApiResource /** * Creates a new product object. * - * @param null|array $params + * @param null|array{active?: bool, default_price_data?: array{currency: string, currency_options?: array, custom_unit_amount?: array{enabled: bool, maximum?: int, minimum?: int, preset?: int}, metadata?: array, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, description?: string, expand?: string[], id?: string, images?: string[], marketing_features?: array{name: string}[], metadata?: array, name: string, package_dimensions?: array{height: float, length: float, weight: float, width: float}, shippable?: bool, statement_descriptor?: string, tax_code?: string, type?: string, unit_label?: string, url?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Product the created resource * - * @return \Stripe\Product the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -60,7 +60,7 @@ class Product extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -74,9 +74,9 @@ class Product extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Product the deleted resource * - * @return \Stripe\Product the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -93,18 +93,18 @@ class Product extends ApiResource * Returns a list of your products. The products are returned sorted by creation * date, with the most recently created products appearing first. * - * @param null|array $params + * @param null|array{active?: bool, created?: array|int, ending_before?: string, expand?: string[], ids?: string[], limit?: int, shippable?: bool, starting_after?: string, type?: string, url?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Product> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -115,13 +115,13 @@ class Product extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Product * - * @return \Stripe\Product + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -133,12 +133,12 @@ class Product extends ApiResource * parameters not provided will be left unchanged. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{active?: bool, default_price?: string, description?: null|string, expand?: string[], images?: null|string[], marketing_features?: null|array{name: string}[], metadata?: null|array, name?: string, package_dimensions?: null|array{height: float, length: float, weight: float, width: float}, shippable?: bool, statement_descriptor?: string, tax_code?: null|string, unit_label?: null|string, url?: null|string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Product the updated resource * - * @return \Stripe\Product the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -146,7 +146,7 @@ class Product extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -156,15 +156,15 @@ class Product extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SearchResult the product search results * - * @return \Stripe\SearchResult<\Stripe\Product> the product search results + * @throws Exception\ApiErrorException if the request fails */ public static function search($params = null, $opts = null) { $url = '/v1/products/search'; - return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts); + return static::_requestPage($url, SearchResult::class, $params, $opts); } const PATH_FEATURES = '/features'; @@ -174,9 +174,9 @@ class Product extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection the list of product features * - * @return \Stripe\Collection<\Stripe\ProductFeature> the list of product features + * @throws Exception\ApiErrorException if the request fails */ public static function allFeatures($id, $params = null, $opts = null) { @@ -188,9 +188,9 @@ class Product extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ProductFeature * - * @return \Stripe\ProductFeature + * @throws Exception\ApiErrorException if the request fails */ public static function createFeature($id, $params = null, $opts = null) { @@ -203,9 +203,9 @@ class Product extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ProductFeature * - * @return \Stripe\ProductFeature + * @throws Exception\ApiErrorException if the request fails */ public static function deleteFeature($id, $featureId, $params = null, $opts = null) { @@ -218,9 +218,9 @@ class Product extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ProductFeature * - * @return \Stripe\ProductFeature + * @throws Exception\ApiErrorException if the request fails */ public static function retrieveFeature($id, $featureId, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/ProductFeature.php b/plugins/stripe-php/lib/ProductFeature.php index a978fb18..a5aac756 100644 --- a/plugins/stripe-php/lib/ProductFeature.php +++ b/plugins/stripe-php/lib/ProductFeature.php @@ -10,7 +10,7 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\Entitlements\Feature $entitlement_feature A feature represents a monetizable ability or functionality in your system. Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. + * @property Entitlements\Feature $entitlement_feature A feature represents a monetizable ability or functionality in your system. Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. */ class ProductFeature extends ApiResource diff --git a/plugins/stripe-php/lib/PromotionCode.php b/plugins/stripe-php/lib/PromotionCode.php index 317555e1..bcfbfc7f 100644 --- a/plugins/stripe-php/lib/PromotionCode.php +++ b/plugins/stripe-php/lib/PromotionCode.php @@ -12,14 +12,14 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid. * @property string $code The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9). - * @property \Stripe\Coupon $coupon A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not work with conventional one-off charges or payment intents. + * @property Coupon $coupon A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not work with conventional one-off charges or payment intents. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer The customer that this promotion code can be used by. + * @property null|Customer|string $customer The customer that this promotion code can be used by. * @property null|int $expires_at Date at which the promotion code can no longer be redeemed. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|int $max_redemptions Maximum number of times this promotion code can be redeemed. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $restrictions + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property (object{currency_options?: StripeObject, first_time_transaction: bool, minimum_amount: null|int, minimum_amount_currency: null|string}&StripeObject) $restrictions * @property int $times_redeemed Number of times this promotion code has been used. */ class PromotionCode extends ApiResource @@ -32,12 +32,12 @@ class PromotionCode extends ApiResource * A promotion code points to a coupon. You can optionally restrict the code to a * specific customer, redemption limit, and expiration date. * - * @param null|array $params + * @param null|array{active?: bool, code?: string, coupon: string, customer?: string, expand?: string[], expires_at?: int, max_redemptions?: int, metadata?: array, restrictions?: array{currency_options?: array, first_time_transaction?: bool, minimum_amount?: int, minimum_amount_currency?: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PromotionCode the created resource * - * @return \Stripe\PromotionCode the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -45,7 +45,7 @@ class PromotionCode extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -54,18 +54,18 @@ class PromotionCode extends ApiResource /** * Returns a list of your promotion codes. * - * @param null|array $params + * @param null|array{active?: bool, code?: string, coupon?: string, created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\PromotionCode> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -77,13 +77,13 @@ class PromotionCode extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PromotionCode * - * @return \Stripe\PromotionCode + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -95,12 +95,12 @@ class PromotionCode extends ApiResource * passed. Most fields are, by design, not editable. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{active?: bool, expand?: string[], metadata?: null|array, restrictions?: array{currency_options?: array}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return PromotionCode the updated resource * - * @return \Stripe\PromotionCode the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -108,7 +108,7 @@ class PromotionCode extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/Quote.php b/plugins/stripe-php/lib/Quote.php index 3a4eb41f..3e849256 100644 --- a/plugins/stripe-php/lib/Quote.php +++ b/plugins/stripe-php/lib/Quote.php @@ -12,37 +12,37 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount_subtotal Total before any discounts or taxes are applied. * @property int $amount_total Total after discounts and taxes are applied. - * @property null|string|\Stripe\Application $application ID of the Connect Application that created the quote. + * @property null|Application|string $application ID of the Connect Application that created the quote. * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote. * @property null|float $application_fee_percent A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote. - * @property \Stripe\StripeObject $automatic_tax + * @property (object{enabled: bool, liability: null|(object{account?: Account|string, type: string}&StripeObject), provider: null|string, status: null|string}&StripeObject) $automatic_tax * @property string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as active. Defaults to charge_automatically. - * @property \Stripe\StripeObject $computed + * @property (object{recurring: null|(object{amount_subtotal: int, amount_total: int, interval: string, interval_count: int, total_details: (object{amount_discount: int, amount_shipping: null|int, amount_tax: int, breakdown?: (object{discounts: (object{amount: int, discount: Discount}&StripeObject)[], taxes: ((object{amount: int, rate: TaxRate, taxability_reason: null|string, taxable_amount: null|int}&StripeObject))[]}&StripeObject)}&StripeObject)}&StripeObject), upfront: (object{amount_subtotal: int, amount_total: int, line_items?: Collection, total_details: (object{amount_discount: int, amount_shipping: null|int, amount_tax: int, breakdown?: (object{discounts: (object{amount: int, discount: Discount}&StripeObject)[], taxes: ((object{amount: int, rate: TaxRate, taxability_reason: null|string, taxable_amount: null|int}&StripeObject))[]}&StripeObject)}&StripeObject)}&StripeObject)}&StripeObject) $computed * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. - * @property null|(string|\Stripe\TaxRate)[] $default_tax_rates The tax rates applied to this quote. + * @property null|Customer|string $customer The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + * @property null|(string|TaxRate)[] $default_tax_rates The tax rates applied to this quote. * @property null|string $description A description that will be displayed on the quote PDF. - * @property (string|\Stripe\Discount)[] $discounts The discounts applied to this quote. + * @property (Discount|string)[] $discounts The discounts applied to this quote. * @property int $expires_at The date on which the quote will be canceled if in open or draft status. Measured in seconds since the Unix epoch. * @property null|string $footer A footer that will be displayed on the quote PDF. - * @property null|\Stripe\StripeObject $from_quote Details of the quote that was cloned. See the cloning documentation for more details. + * @property null|(object{is_revision: bool, quote: Quote|string}&StripeObject) $from_quote Details of the quote that was cloned. See the cloning documentation for more details. * @property null|string $header A header that will be displayed on the quote PDF. - * @property null|string|\Stripe\Invoice $invoice The invoice that was created from this quote. - * @property \Stripe\StripeObject $invoice_settings - * @property null|\Stripe\Collection<\Stripe\LineItem> $line_items A list of items the customer is being quoted for. + * @property null|Invoice|string $invoice The invoice that was created from this quote. + * @property (object{days_until_due: null|int, issuer: (object{account?: Account|string, type: string}&StripeObject)}&StripeObject) $invoice_settings + * @property null|Collection $line_items A list of items the customer is being quoted for. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $number A unique number that identifies this particular quote. This number is assigned once the quote is finalized. - * @property null|string|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. + * @property null|Account|string $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. * @property string $status The status of the quote. - * @property \Stripe\StripeObject $status_transitions - * @property null|string|\Stripe\Subscription $subscription The subscription that was created or updated from this quote. - * @property \Stripe\StripeObject $subscription_data - * @property null|string|\Stripe\SubscriptionSchedule $subscription_schedule The subscription schedule that was created or updated from this quote. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this quote belongs to. - * @property \Stripe\StripeObject $total_details - * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. + * @property (object{accepted_at: null|int, canceled_at: null|int, finalized_at: null|int}&StripeObject) $status_transitions + * @property null|string|Subscription $subscription The subscription that was created or updated from this quote. + * @property (object{description: null|string, effective_date: null|int, metadata: null|StripeObject, trial_period_days: null|int}&StripeObject) $subscription_data + * @property null|string|SubscriptionSchedule $subscription_schedule The subscription schedule that was created or updated from this quote. + * @property null|string|TestHelpers\TestClock $test_clock ID of the test clock this quote belongs to. + * @property (object{amount_discount: int, amount_shipping: null|int, amount_tax: int, breakdown?: (object{discounts: (object{amount: int, discount: Discount}&StripeObject)[], taxes: ((object{amount: int, rate: TaxRate, taxability_reason: null|string, taxable_amount: null|int}&StripeObject))[]}&StripeObject)}&StripeObject) $total_details + * @property null|(object{amount: null|int, amount_percent: null|float, destination: Account|string}&StripeObject) $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. */ class Quote extends ApiResource { @@ -64,12 +64,12 @@ class Quote extends ApiResource * expires_at can be set in the dashboard via the quote template. * - * @param null|array $params + * @param null|array{application_fee_amount?: null|int, application_fee_percent?: null|float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, collection_method?: string, customer?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], expires_at?: int, footer?: null|string, from_quote?: array{is_revision?: bool, quote: string}, header?: null|string, invoice_settings?: array{days_until_due?: int, issuer?: array{account?: string, type: string}}, line_items?: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: array, on_behalf_of?: null|string, subscription_data?: array{description?: string, effective_date?: null|array|int|string, metadata?: array, trial_period_days?: null|int}, test_clock?: string, transfer_data?: null|array{amount?: int, amount_percent?: float, destination: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Quote the created resource * - * @return \Stripe\Quote the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -77,7 +77,7 @@ class Quote extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -86,18 +86,18 @@ class Quote extends ApiResource /** * Returns a list of your quotes. * - * @param null|array $params + * @param null|array{customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, test_clock?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Quote> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -106,13 +106,13 @@ class Quote extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Quote * - * @return \Stripe\Quote + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -123,12 +123,12 @@ class Quote extends ApiResource * A quote models prices and services for a customer. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{application_fee_amount?: null|int, application_fee_percent?: null|float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, collection_method?: string, customer?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], expires_at?: int, footer?: null|string, header?: null|string, invoice_settings?: array{days_until_due?: int, issuer?: array{account?: string, type: string}}, line_items?: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id?: string, price?: string, price_data?: array{currency: string, product: string, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: array, on_behalf_of?: null|string, subscription_data?: array{description?: null|string, effective_date?: null|array|int|string, metadata?: array, trial_period_days?: null|int}, transfer_data?: null|array{amount?: int, amount_percent?: float, destination: string}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Quote the updated resource * - * @return \Stripe\Quote the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -136,7 +136,7 @@ class Quote extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -146,9 +146,9 @@ class Quote extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Quote the accepted quote * - * @return \Stripe\Quote the accepted quote + * @throws Exception\ApiErrorException if the request fails */ public function accept($params = null, $opts = null) { @@ -163,9 +163,9 @@ class Quote extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Quote the canceled quote * - * @return \Stripe\Quote the canceled quote + * @throws Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { @@ -180,9 +180,9 @@ class Quote extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Quote the finalized quote * - * @return \Stripe\Quote the finalized quote + * @throws Exception\ApiErrorException if the request fails */ public function finalizeQuote($params = null, $opts = null) { @@ -198,15 +198,15 @@ class Quote extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection list of line items * - * @return \Stripe\Collection<\Stripe\LineItem> list of line items + * @throws Exception\ApiErrorException if the request fails */ public static function allComputedUpfrontLineItems($id, $params = null, $opts = null) { $url = static::resourceUrl($id) . '/computed_upfront_line_items'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -217,15 +217,15 @@ class Quote extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection list of line items * - * @return \Stripe\Collection<\Stripe\LineItem> list of line items + * @throws Exception\ApiErrorException if the request fails */ public static function allLineItems($id, $params = null, $opts = null) { $url = static::resourceUrl($id) . '/line_items'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -236,15 +236,15 @@ class Quote extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return void + * + * @throws Exception\ApiErrorException if the request fails */ public function pdf($readBodyChunkCallable, $params = null, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); if (!isset($opts->apiBase)) { - $opts->apiBase = \Stripe\Stripe::$apiUploadBase; + $opts->apiBase = Stripe::$apiUploadBase; } $url = $this->instanceUrl() . '/pdf'; $this->_requestStream('get', $url, $readBodyChunkCallable, $params, $opts); diff --git a/plugins/stripe-php/lib/Radar/EarlyFraudWarning.php b/plugins/stripe-php/lib/Radar/EarlyFraudWarning.php index a48ae1a5..631d3036 100644 --- a/plugins/stripe-php/lib/Radar/EarlyFraudWarning.php +++ b/plugins/stripe-php/lib/Radar/EarlyFraudWarning.php @@ -34,12 +34,12 @@ class EarlyFraudWarning extends \Stripe\ApiResource /** * Returns a list of early fraud warnings. * - * @param null|array $params + * @param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Radar\EarlyFraudWarning> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -58,9 +58,9 @@ class EarlyFraudWarning extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return EarlyFraudWarning * - * @return \Stripe\Radar\EarlyFraudWarning + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Radar/ValueList.php b/plugins/stripe-php/lib/Radar/ValueList.php index 14afacd3..dfac30b1 100644 --- a/plugins/stripe-php/lib/Radar/ValueList.php +++ b/plugins/stripe-php/lib/Radar/ValueList.php @@ -15,7 +15,7 @@ namespace Stripe\Radar; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $created_by The name or email address of the user who created this value list. * @property string $item_type The type of items in the value list. One of card_fingerprint, us_bank_account_fingerprint, sepa_debit_fingerprint, card_bin, email, ip_address, country, string, case_sensitive_string, or customer_id. - * @property \Stripe\Collection<\Stripe\Radar\ValueListItem> $list_items List of items contained within this value list. + * @property \Stripe\Collection $list_items List of items contained within this value list. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $name The name of the value list. @@ -41,12 +41,12 @@ class ValueList extends \Stripe\ApiResource * Creates a new ValueList object, which can then be referenced in * rules. * - * @param null|array $params + * @param null|array{alias: string, expand?: string[], item_type?: string, metadata?: array, name: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ValueList the created resource * - * @return \Stripe\Radar\ValueList the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -68,9 +68,9 @@ class ValueList extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ValueList the deleted resource * - * @return \Stripe\Radar\ValueList the deleted resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -88,12 +88,12 @@ class ValueList extends \Stripe\ApiResource * descending order by creation date, with the most recently created object * appearing first. * - * @param null|array $params + * @param null|array{alias?: string, contains?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Radar\ValueList> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -108,9 +108,9 @@ class ValueList extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ValueList * - * @return \Stripe\Radar\ValueList + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -127,12 +127,12 @@ class ValueList extends \Stripe\ApiResource * item_type is immutable. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{alias?: string, expand?: string[], metadata?: array, name?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ValueList the updated resource * - * @return \Stripe\Radar\ValueList the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Radar/ValueListItem.php b/plugins/stripe-php/lib/Radar/ValueListItem.php index a40b9da8..58de0b5a 100644 --- a/plugins/stripe-php/lib/Radar/ValueListItem.php +++ b/plugins/stripe-php/lib/Radar/ValueListItem.php @@ -25,12 +25,12 @@ class ValueListItem extends \Stripe\ApiResource * Creates a new ValueListItem object, which is added to the specified * parent value list. * - * @param null|array $params + * @param null|array{expand?: string[], value: string, value_list: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ValueListItem the created resource * - * @return \Stripe\Radar\ValueListItem the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -51,9 +51,9 @@ class ValueListItem extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ValueListItem the deleted resource * - * @return \Stripe\Radar\ValueListItem the deleted resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -71,12 +71,12 @@ class ValueListItem extends \Stripe\ApiResource * descending order by creation date, with the most recently created object * appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, value?: string, value_list: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Radar\ValueListItem> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -91,9 +91,9 @@ class ValueListItem extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ValueListItem * - * @return \Stripe\Radar\ValueListItem + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/RecipientTransfer.php b/plugins/stripe-php/lib/RecipientTransfer.php index 5e2d4365..938a0d3c 100644 --- a/plugins/stripe-php/lib/RecipientTransfer.php +++ b/plugins/stripe-php/lib/RecipientTransfer.php @@ -20,10 +20,10 @@ namespace Stripe; * @property string $failure_code * @property string $failure_message * @property bool $livemode - * @property \Stripe\StripeObject $metadata + * @property StripeObject $metadata * @property string $method * @property string $recipient - * @property \Stripe\Collection $reversals + * @property Collection $reversals * @property bool $reversed * @property string $source_type * @property string $statement_descriptor diff --git a/plugins/stripe-php/lib/Refund.php b/plugins/stripe-php/lib/Refund.php index 9e59f8c6..ddad96d1 100644 --- a/plugins/stripe-php/lib/Refund.php +++ b/plugins/stripe-php/lib/Refund.php @@ -14,23 +14,25 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Amount, in cents (or local equivalent). - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. - * @property null|string|\Stripe\Charge $charge ID of the charge that's refunded. + * @property null|BalanceTransaction|string $balance_transaction Balance transaction that describes the impact on your account balance. + * @property null|Charge|string $charge ID of the charge that's refunded. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only). - * @property null|\Stripe\StripeObject $destination_details - * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. + * @property null|(object{affirm?: (object{}&StripeObject), afterpay_clearpay?: (object{}&StripeObject), alipay?: (object{}&StripeObject), alma?: (object{}&StripeObject), amazon_pay?: (object{}&StripeObject), au_bank_transfer?: (object{}&StripeObject), blik?: (object{network_decline_code: null|string, reference: null|string, reference_status: null|string}&StripeObject), br_bank_transfer?: (object{reference: null|string, reference_status: null|string}&StripeObject), card?: (object{reference?: string, reference_status?: string, reference_type?: string, type: string}&StripeObject), cashapp?: (object{}&StripeObject), customer_cash_balance?: (object{}&StripeObject), eps?: (object{}&StripeObject), eu_bank_transfer?: (object{reference: null|string, reference_status: null|string}&StripeObject), gb_bank_transfer?: (object{reference: null|string, reference_status: null|string}&StripeObject), giropay?: (object{}&StripeObject), grabpay?: (object{}&StripeObject), jp_bank_transfer?: (object{reference: null|string, reference_status: null|string}&StripeObject), klarna?: (object{}&StripeObject), multibanco?: (object{reference: null|string, reference_status: null|string}&StripeObject), mx_bank_transfer?: (object{reference: null|string, reference_status: null|string}&StripeObject), nz_bank_transfer?: (object{}&StripeObject), p24?: (object{reference: null|string, reference_status: null|string}&StripeObject), paynow?: (object{}&StripeObject), paypal?: (object{}&StripeObject), pix?: (object{}&StripeObject), revolut?: (object{}&StripeObject), sofort?: (object{}&StripeObject), swish?: (object{network_decline_code: null|string, reference: null|string, reference_status: null|string}&StripeObject), th_bank_transfer?: (object{reference: null|string, reference_status: null|string}&StripeObject), type: string, us_bank_transfer?: (object{reference: null|string, reference_status: null|string}&StripeObject), wechat_pay?: (object{}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $destination_details + * @property null|BalanceTransaction|string $failure_balance_transaction After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. * @property null|string $failure_reason Provides the reason for the refund failure. Possible values are: lost_or_stolen_card, expired_or_canceled_card, charge_for_pending_refund_disputed, insufficient_funds, declined, merchant_request, or unknown. * @property null|string $instructions_email For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $next_action - * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that's refunded. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|(object{display_details?: (object{email_sent: (object{email_sent_at: int, email_sent_to: string}&StripeObject), expires_at: int}&StripeObject), type: string}&StripeObject) $next_action + * @property null|PaymentIntent|string $payment_intent ID of the PaymentIntent that's refunded. + * @property null|string $pending_reason Provides the reason for why the refund is pending. Possible values are: processing, insufficient_funds, or charge_pending. + * @property null|(object{presentment_amount: int, presentment_currency: string}&StripeObject) $presentment_details * @property null|string $reason Reason for the refund, which is either user-provided (duplicate, fraudulent, or requested_by_customer) or generated by Stripe internally (expired_uncaptured_charge). * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this refund. - * @property null|string|\Stripe\TransferReversal $source_transfer_reversal The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account. + * @property null|string|TransferReversal $source_transfer_reversal The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account. * @property null|string $status Status of the refund. This can be pending, requires_action, succeeded, failed, or canceled. Learn more about failed refunds. - * @property null|string|\Stripe\TransferReversal $transfer_reversal This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter. + * @property null|string|TransferReversal $transfer_reversal This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter. */ class Refund extends ApiResource { @@ -42,6 +44,10 @@ class Refund extends ApiResource const FAILURE_REASON_LOST_OR_STOLEN_CARD = 'lost_or_stolen_card'; const FAILURE_REASON_UNKNOWN = 'unknown'; + const PENDING_REASON_CHARGE_PENDING = 'charge_pending'; + const PENDING_REASON_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const PENDING_REASON_PROCESSING = 'processing'; + const REASON_DUPLICATE = 'duplicate'; const REASON_EXPIRED_UNCAPTURED_CHARGE = 'expired_uncaptured_charge'; const REASON_FRAUDULENT = 'fraudulent'; @@ -68,12 +74,12 @@ class Refund extends ApiResource * an error when called on an already-refunded charge, or when trying to refund * more money than is left on a charge. * - * @param null|array $params + * @param null|array{amount?: int, charge?: string, currency?: string, customer?: string, expand?: string[], instructions_email?: string, metadata?: null|array, origin?: string, payment_intent?: string, reason?: string, refund_application_fee?: bool, reverse_transfer?: bool} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Refund the created resource * - * @return \Stripe\Refund the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -81,7 +87,7 @@ class Refund extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -92,18 +98,18 @@ class Refund extends ApiResource * order, with the most recent refunds appearing first. The 10 most recent refunds * are always available by default on the Charge object. * - * @param null|array $params + * @param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Refund> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -112,13 +118,13 @@ class Refund extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Refund * - * @return \Stripe\Refund + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -132,12 +138,12 @@ class Refund extends ApiResource * This request only accepts metadata as an argument. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Refund the updated resource * - * @return \Stripe\Refund the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -145,7 +151,7 @@ class Refund extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -155,9 +161,9 @@ class Refund extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Refund the canceled refund * - * @return \Stripe\Refund the canceled refund + * @throws Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Reporting/ReportRun.php b/plugins/stripe-php/lib/Reporting/ReportRun.php index f543f657..27e3cd07 100644 --- a/plugins/stripe-php/lib/Reporting/ReportRun.php +++ b/plugins/stripe-php/lib/Reporting/ReportRun.php @@ -19,7 +19,7 @@ namespace Stripe\Reporting; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $error If something should go wrong during the run, a message about the failure (populated when status=failed). * @property bool $livemode true if the report is run on live mode data and false if it is run on test mode data. - * @property \Stripe\StripeObject $parameters + * @property (object{columns?: string[], connected_account?: string, currency?: string, interval_end?: int, interval_start?: int, payout?: string, reporting_category?: string, timezone?: string}&\Stripe\StripeObject) $parameters * @property string $report_type The ID of the report type to run, such as "balance.summary.1". * @property null|\Stripe\File $result The file object representing the result of the report run (populated when status=succeeded). * @property string $status Status of this report run. This will be pending when the run is initially created. When the run finishes, this will be set to succeeded and the result field will be populated. Rarely, we may encounter an error, at which point this will be set to failed and the error field will be populated. @@ -33,12 +33,12 @@ class ReportRun extends \Stripe\ApiResource * Creates a new object and begin running the report. (Certain report types require * a live-mode API key.). * - * @param null|array $params + * @param null|array{expand?: string[], parameters?: array{columns?: string[], connected_account?: string, currency?: string, interval_end?: int, interval_start?: int, payout?: string, reporting_category?: string, timezone?: string}, report_type: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ReportRun the created resource * - * @return \Stripe\Reporting\ReportRun the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -55,12 +55,12 @@ class ReportRun extends \Stripe\ApiResource /** * Returns a list of Report Runs, with the most recent appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Reporting\ReportRun> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -75,9 +75,9 @@ class ReportRun extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ReportRun * - * @return \Stripe\Reporting\ReportRun + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Reporting/ReportType.php b/plugins/stripe-php/lib/Reporting/ReportType.php index 0fdeb536..4b8c87ac 100644 --- a/plugins/stripe-php/lib/Reporting/ReportType.php +++ b/plugins/stripe-php/lib/Reporting/ReportType.php @@ -31,12 +31,12 @@ class ReportType extends \Stripe\ApiResource /** * Returns a full list of Report Types. * - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Reporting\ReportType> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -52,9 +52,9 @@ class ReportType extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ReportType * - * @return \Stripe\Reporting\ReportType + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Review.php b/plugins/stripe-php/lib/Review.php index cfb2395b..75714f3c 100644 --- a/plugins/stripe-php/lib/Review.php +++ b/plugins/stripe-php/lib/Review.php @@ -13,23 +13,24 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string $billing_zip The ZIP or postal code of the card used, if applicable. - * @property null|string|\Stripe\Charge $charge The charge associated with this review. - * @property null|string $closed_reason The reason the review was closed, or null if it has not yet been closed. One of approved, refunded, refunded_as_fraud, disputed, or redacted. + * @property null|Charge|string $charge The charge associated with this review. + * @property null|string $closed_reason The reason the review was closed, or null if it has not yet been closed. One of approved, refunded, refunded_as_fraud, disputed, redacted, or canceled. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $ip_address The IP address where the payment originated. - * @property null|\Stripe\StripeObject $ip_address_location Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. + * @property null|(object{city: null|string, country: null|string, latitude: null|float, longitude: null|float, region: null|string}&StripeObject) $ip_address_location Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property bool $open If true, the review needs action. * @property string $opened_reason The reason the review was opened. One of rule or manual. - * @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent ID associated with this review, if one exists. - * @property string $reason The reason the review is currently open or closed. One of rule, manual, approved, refunded, refunded_as_fraud, disputed, or redacted. - * @property null|\Stripe\StripeObject $session Information related to the browsing session of the user who initiated the payment. + * @property null|PaymentIntent|string $payment_intent The PaymentIntent ID associated with this review, if one exists. + * @property string $reason The reason the review is currently open or closed. One of rule, manual, approved, refunded, refunded_as_fraud, disputed, redacted, or canceled. + * @property null|(object{browser: null|string, device: null|string, platform: null|string, version: null|string}&StripeObject) $session Information related to the browsing session of the user who initiated the payment. */ class Review extends ApiResource { const OBJECT_NAME = 'review'; const CLOSED_REASON_APPROVED = 'approved'; + const CLOSED_REASON_CANCELED = 'canceled'; const CLOSED_REASON_DISPUTED = 'disputed'; const CLOSED_REASON_REDACTED = 'redacted'; const CLOSED_REASON_REFUNDED = 'refunded'; @@ -43,18 +44,18 @@ class Review extends ApiResource * true. The objects are sorted in descending order by creation date, * with the most recently created object appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Review> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -63,13 +64,13 @@ class Review extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Review * - * @return \Stripe\Review + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -94,9 +95,9 @@ class Review extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Review the approved review * - * @return \Stripe\Review the approved review + * @throws Exception\ApiErrorException if the request fails */ public function approve($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/SearchResult.php b/plugins/stripe-php/lib/SearchResult.php index fc3e4616..f60b09c0 100644 --- a/plugins/stripe-php/lib/SearchResult.php +++ b/plugins/stripe-php/lib/SearchResult.php @@ -16,6 +16,7 @@ namespace Stripe; * the `expand` parameter contains `total_count`. * * @template TStripeObject of StripeObject + * * @template-implements \IteratorAggregate * * @property string $object @@ -71,10 +72,10 @@ class SearchResult extends StripeObject implements \Countable, \IteratorAggregat if (\is_string($k)) { return parent::offsetGet($k); } - $msg = "You tried to access the {$k} index, but SearchResult " . - 'types only support string keys. (HINT: Search calls ' . - 'return an object with a `data` (which is the data ' . - "array). You likely want to call ->data[{$k}])"; + $msg = "You tried to access the {$k} index, but SearchResult " + . 'types only support string keys. (HINT: Search calls ' + . 'return an object with a `data` (which is the data ' + . "array). You likely want to call ->data[{$k}])"; throw new Exception\InvalidArgumentException($msg); } @@ -83,9 +84,9 @@ class SearchResult extends StripeObject implements \Countable, \IteratorAggregat * @param null|array $params * @param null|array|string $opts * - * @throws Exception\ApiErrorException - * * @return SearchResult + * + * @throws Exception\ApiErrorException */ public function all($params = null, $opts = null) { @@ -94,9 +95,9 @@ class SearchResult extends StripeObject implements \Countable, \IteratorAggregat list($response, $opts) = $this->_request('get', $url, $params, $opts); $obj = Util\Util::convertToStripeObject($response, $opts); - if (!($obj instanceof \Stripe\SearchResult)) { - throw new \Stripe\Exception\UnexpectedValueException( - 'Expected type ' . \Stripe\SearchResult::class . ', got "' . \get_class($obj) . '" instead.' + if (!$obj instanceof SearchResult) { + throw new Exception\UnexpectedValueException( + 'Expected type ' . SearchResult::class . ', got "' . \get_class($obj) . '" instead.' ); } $obj->setFilters($params); @@ -124,12 +125,12 @@ class SearchResult extends StripeObject implements \Countable, \IteratorAggregat } /** - * @throws Exception\ApiErrorException - * * @return \Generator|TStripeObject[] A generator that can be used to * iterate across all objects across all pages. As page boundaries are * encountered, the next page will be fetched automatically for * continued iteration. + * + * @throws Exception\ApiErrorException */ public function autoPagingIterator() { @@ -181,9 +182,9 @@ class SearchResult extends StripeObject implements \Countable, \IteratorAggregat * @param null|array $params * @param null|array|string $opts * - * @throws Exception\ApiErrorException - * * @return SearchResult + * + * @throws Exception\ApiErrorException */ public function nextPage($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/AbstractService.php b/plugins/stripe-php/lib/Service/AbstractService.php index 44392c45..23132a37 100644 --- a/plugins/stripe-php/lib/Service/AbstractService.php +++ b/plugins/stripe-php/lib/Service/AbstractService.php @@ -61,7 +61,7 @@ abstract class AbstractService if (null === $params) { return null; } - \array_walk_recursive($params, function (&$value, $key) { + \array_walk_recursive($params, static function (&$value, $key) { if (null === $value) { $value = ''; } @@ -77,22 +77,16 @@ abstract class AbstractService protected function requestStream($method, $path, $readBodyChunkCallable, $params, $opts) { - // TODO (MAJOR): Add this method to StripeClientInterface - // @phpstan-ignore-next-line return $this->getStreamingClient()->requestStream($method, $path, $readBodyChunkCallable, self::formatParams($params), $opts); } protected function requestCollection($method, $path, $params, $opts) { - // TODO (MAJOR): Add this method to StripeClientInterface - // @phpstan-ignore-next-line return $this->getClient()->requestCollection($method, $path, self::formatParams($params), $opts); } protected function requestSearchResult($method, $path, $params, $opts) { - // TODO (MAJOR): Add this method to StripeClientInterface - // @phpstan-ignore-next-line return $this->getClient()->requestSearchResult($method, $path, self::formatParams($params), $opts); } diff --git a/plugins/stripe-php/lib/Service/AccountLinkService.php b/plugins/stripe-php/lib/Service/AccountLinkService.php index 603d6915..de987ac2 100644 --- a/plugins/stripe-php/lib/Service/AccountLinkService.php +++ b/plugins/stripe-php/lib/Service/AccountLinkService.php @@ -6,21 +6,22 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class AccountLinkService extends \Stripe\Service\AbstractService +class AccountLinkService extends AbstractService { /** * Creates an AccountLink object that includes a single-use Stripe URL that the * platform can redirect their user to in order to take them through the Connect * Onboarding flow. * - * @param null|array $params + * @param null|array{account: string, collect?: string, collection_options?: array{fields?: string, future_requirements?: string}, expand?: string[], refresh_url?: string, return_url?: string, type: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\AccountLink + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/AccountService.php b/plugins/stripe-php/lib/Service/AccountService.php index f48890c4..f1e29f8a 100644 --- a/plugins/stripe-php/lib/Service/AccountService.php +++ b/plugins/stripe-php/lib/Service/AccountService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class AccountService extends \Stripe\Service\AbstractService +class AccountService extends AbstractService { /** * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is empty. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Account> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -32,12 +33,12 @@ class AccountService extends \Stripe\Service\AbstractService * first. * * @param string $parentId - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Capability> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allCapabilities($parentId, $params = null, $opts = null) { @@ -48,12 +49,12 @@ class AccountService extends \Stripe\Service\AbstractService * List external accounts for an account. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, object?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allExternalAccounts($parentId, $params = null, $opts = null) { @@ -66,12 +67,12 @@ class AccountService extends \Stripe\Service\AbstractService * first. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, relationship?: array{authorizer?: bool, director?: bool, executive?: bool, legal_guardian?: bool, owner?: bool, representative?: bool}, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Person> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allPersons($parentId, $params = null, $opts = null) { @@ -90,12 +91,12 @@ class AccountService extends \Stripe\Service\AbstractService * information during account onboarding. You can prefill any information on the * account. * - * @param null|array $params + * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, controller?: array{fees?: array{payer?: string}, losses?: array{payments?: string}, requirement_collection?: string, stripe_dashboard?: array{type?: string}}, country?: string, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_registration?: array{files?: string[]}, proof_of_ultimate_beneficial_ownership?: array{files?: string[]}}, email?: string, expand?: string[], external_account?: array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, weekly_anchor?: string}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -106,12 +107,12 @@ class AccountService extends \Stripe\Service\AbstractService * Create an external account for a given account. * * @param string $parentId - * @param null|array $params + * @param null|array{default_for_currency?: bool, expand?: string[], external_account: array|string, metadata?: array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\BankAccount|\Stripe\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createExternalAccount($parentId, $params = null, $opts = null) { @@ -126,12 +127,12 @@ class AccountService extends \Stripe\Service\AbstractService * your platform. * * @param string $parentId - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\LoginLink + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createLoginLink($parentId, $params = null, $opts = null) { @@ -142,12 +143,12 @@ class AccountService extends \Stripe\Service\AbstractService * Creates a new person. * * @param string $parentId - * @param null|array $params + * @param null|array{additional_tos_acceptances?: array{account?: array{date?: int, ip?: string, user_agent?: null|string}}, address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files?: string[]}, passport?: array{files?: string[]}, visa?: array{files?: string[]}}, email?: string, expand?: string[], first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, nationality?: string, person_token?: string, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{authorizer?: bool, director?: bool, executive?: bool, legal_guardian?: bool, owner?: bool, percent_ownership?: null|float, representative?: bool, title?: string}, ssn_last_4?: string, us_cfpb_data?: array{ethnicity_details?: array{ethnicity?: string[], ethnicity_other?: string}, race_details?: array{race?: string[], race_other?: string}, self_identified_gender?: string}, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Person + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createPerson($parentId, $params = null, $opts = null) { @@ -173,9 +174,9 @@ class AccountService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -190,9 +191,9 @@ class AccountService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\BankAccount|\Stripe\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deleteExternalAccount($parentId, $id, $params = null, $opts = null) { @@ -211,9 +212,9 @@ class AccountService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Person + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deletePerson($parentId, $id, $params = null, $opts = null) { @@ -230,12 +231,12 @@ class AccountService extends \Stripe\Service\AbstractService * are zero. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], reason: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function reject($id, $params = null, $opts = null) { @@ -247,12 +248,12 @@ class AccountService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Capability + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveCapability($parentId, $id, $params = null, $opts = null) { @@ -264,12 +265,12 @@ class AccountService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\BankAccount|\Stripe\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveExternalAccount($parentId, $id, $params = null, $opts = null) { @@ -281,12 +282,12 @@ class AccountService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Person + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrievePerson($parentId, $id, $params = null, $opts = null) { @@ -315,12 +316,12 @@ class AccountService extends \Stripe\Service\AbstractService * more about updating accounts. * * @param string $id - * @param null|array $params + * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_registration?: array{files?: string[]}, proof_of_ultimate_beneficial_ownership?: array{files?: string[]}}, email?: string, expand?: string[], external_account?: null|array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{default_account_tax_ids?: null|string[], hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, weekly_anchor?: string}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -333,12 +334,12 @@ class AccountService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], requested?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Capability + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateCapability($parentId, $id, $params = null, $opts = null) { @@ -360,12 +361,12 @@ class AccountService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{account_holder_name?: string, account_holder_type?: null|string, account_type?: string, address_city?: string, address_country?: string, address_line1?: string, address_line2?: string, address_state?: string, address_zip?: string, default_for_currency?: bool, documents?: array{bank_account_ownership_verification?: array{files?: string[]}}, exp_month?: string, exp_year?: string, expand?: string[], metadata?: null|array, name?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\BankAccount|\Stripe\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateExternalAccount($parentId, $id, $params = null, $opts = null) { @@ -377,12 +378,12 @@ class AccountService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{additional_tos_acceptances?: array{account?: array{date?: int, ip?: string, user_agent?: null|string}}, address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files?: string[]}, passport?: array{files?: string[]}, visa?: array{files?: string[]}}, email?: string, expand?: string[], first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, nationality?: string, person_token?: string, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{authorizer?: bool, director?: bool, executive?: bool, legal_guardian?: bool, owner?: bool, percent_ownership?: null|float, representative?: bool, title?: string}, ssn_last_4?: string, us_cfpb_data?: array{ethnicity_details?: array{ethnicity?: string[], ethnicity_other?: string}, race_details?: array{race?: string[], race_other?: string}, self_identified_gender?: string}, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Person + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updatePerson($parentId, $id, $params = null, $opts = null) { @@ -396,9 +397,9 @@ class AccountService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id = null, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/AccountSessionService.php b/plugins/stripe-php/lib/Service/AccountSessionService.php index 2b681b89..c8e50542 100644 --- a/plugins/stripe-php/lib/Service/AccountSessionService.php +++ b/plugins/stripe-php/lib/Service/AccountSessionService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class AccountSessionService extends \Stripe\Service\AbstractService +class AccountSessionService extends AbstractService { /** * Creates a AccountSession object that includes a single-use token that the * platform can use on their front-end to grant client-side API access. * - * @param null|array $params + * @param null|array{account: string, components: array{account_management?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, account_onboarding?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, balances?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, edit_payout_schedule?: bool, external_account_collection?: bool, instant_payouts?: bool, standard_payouts?: bool}}, documents?: array{enabled: bool, features?: array{}}, financial_account?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool, send_money?: bool, transfer_balance?: bool}}, financial_account_transactions?: array{enabled: bool, features?: array{card_spend_dispute_management?: bool}}, issuing_card?: array{enabled: bool, features?: array{card_management?: bool, card_spend_dispute_management?: bool, cardholder_management?: bool, spend_control_management?: bool}}, issuing_cards_list?: array{enabled: bool, features?: array{card_management?: bool, card_spend_dispute_management?: bool, cardholder_management?: bool, disable_stripe_user_authentication?: bool, spend_control_management?: bool}}, notification_banner?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, payment_details?: array{enabled: bool, features?: array{capture_payments?: bool, destination_on_behalf_of_charge_management?: bool, dispute_management?: bool, refund_management?: bool}}, payments?: array{enabled: bool, features?: array{capture_payments?: bool, destination_on_behalf_of_charge_management?: bool, dispute_management?: bool, refund_management?: bool}}, payouts?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, edit_payout_schedule?: bool, external_account_collection?: bool, instant_payouts?: bool, standard_payouts?: bool}}, payouts_list?: array{enabled: bool, features?: array{}}, tax_registrations?: array{enabled: bool, features?: array{}}, tax_settings?: array{enabled: bool, features?: array{}}}, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\AccountSession + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/ApplePayDomainService.php b/plugins/stripe-php/lib/Service/ApplePayDomainService.php index 04f5b630..b8ae804d 100644 --- a/plugins/stripe-php/lib/Service/ApplePayDomainService.php +++ b/plugins/stripe-php/lib/Service/ApplePayDomainService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class ApplePayDomainService extends \Stripe\Service\AbstractService +class ApplePayDomainService extends AbstractService { /** * List apple pay domains. * - * @param null|array $params + * @param null|array{domain_name?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\ApplePayDomain> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class ApplePayDomainService extends \Stripe\Service\AbstractService /** * Create an apple pay domain. * - * @param null|array $params + * @param null|array{domain_name: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ApplePayDomain + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -47,9 +48,9 @@ class ApplePayDomainService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ApplePayDomain + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -60,12 +61,12 @@ class ApplePayDomainService extends \Stripe\Service\AbstractService * Retrieve an apple pay domain. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ApplePayDomain + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/ApplicationFeeService.php b/plugins/stripe-php/lib/Service/ApplicationFeeService.php index 8cc42afa..4b4136de 100644 --- a/plugins/stripe-php/lib/Service/ApplicationFeeService.php +++ b/plugins/stripe-php/lib/Service/ApplicationFeeService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class ApplicationFeeService extends \Stripe\Service\AbstractService +class ApplicationFeeService extends AbstractService { /** * Returns a list of application fees you’ve previously collected. The application * fees are returned in sorted order, with the most recent fees appearing first. * - * @param null|array $params + * @param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\ApplicationFee> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -34,12 +35,12 @@ class ApplicationFeeService extends \Stripe\Service\AbstractService * page through additional refunds. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\ApplicationFeeRefund> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allRefunds($parentId, $params = null, $opts = null) { @@ -59,12 +60,12 @@ class ApplicationFeeService extends \Stripe\Service\AbstractService * trying to refund more money than is left on an application fee. * * @param string $parentId - * @param null|array $params + * @param null|array{amount?: int, expand?: string[], metadata?: array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ApplicationFeeRefund + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createRefund($parentId, $params = null, $opts = null) { @@ -76,12 +77,12 @@ class ApplicationFeeService extends \Stripe\Service\AbstractService * same information is returned when refunding the application fee. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ApplicationFee + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -95,12 +96,12 @@ class ApplicationFeeService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ApplicationFeeRefund + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveRefund($parentId, $id, $params = null, $opts = null) { @@ -115,12 +116,12 @@ class ApplicationFeeService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ApplicationFeeRefund + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateRefund($parentId, $id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Apps/SecretService.php b/plugins/stripe-php/lib/Service/Apps/SecretService.php index 760d3cb1..51fbd996 100644 --- a/plugins/stripe-php/lib/Service/Apps/SecretService.php +++ b/plugins/stripe-php/lib/Service/Apps/SecretService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Apps; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class SecretService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class SecretService extends \Stripe\Service\AbstractService /** * List all secrets stored on the given scope. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, scope: array{type: string, user?: string}, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Apps\Secret> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class SecretService extends \Stripe\Service\AbstractService /** * Create or replace a secret in the secret store. * - * @param null|array $params + * @param null|array{expand?: string[], expires_at?: int, name: string, payload: string, scope: array{type: string, user?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Apps\Secret + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -43,12 +44,12 @@ class SecretService extends \Stripe\Service\AbstractService /** * Deletes a secret from the secret store by name and scope. * - * @param null|array $params + * @param null|array{expand?: string[], name: string, scope: array{type: string, user?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Apps\Secret + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deleteWhere($params = null, $opts = null) { @@ -58,12 +59,12 @@ class SecretService extends \Stripe\Service\AbstractService /** * Finds a secret in the secret store by name and scope. * - * @param null|array $params + * @param null|array{expand?: string[], name: string, scope: array{type: string, user?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Apps\Secret + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function find($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/BalanceService.php b/plugins/stripe-php/lib/Service/BalanceService.php index dac98eae..7ba94c37 100644 --- a/plugins/stripe-php/lib/Service/BalanceService.php +++ b/plugins/stripe-php/lib/Service/BalanceService.php @@ -6,9 +6,10 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class BalanceService extends \Stripe\Service\AbstractService +class BalanceService extends AbstractService { /** * Retrieves the current account balance, based on the authentication that was used @@ -16,12 +17,12 @@ class BalanceService extends \Stripe\Service\AbstractService * href="/docs/connect/account-balances#accounting-for-negative-balances">Accounting * for negative balances. * - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Balance + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/BalanceTransactionService.php b/plugins/stripe-php/lib/Service/BalanceTransactionService.php index 7ea050cc..d00ea6c6 100644 --- a/plugins/stripe-php/lib/Service/BalanceTransactionService.php +++ b/plugins/stripe-php/lib/Service/BalanceTransactionService.php @@ -6,9 +6,10 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class BalanceTransactionService extends \Stripe\Service\AbstractService +class BalanceTransactionService extends AbstractService { /** * Returns a list of transactions that have contributed to the Stripe account @@ -18,12 +19,12 @@ class BalanceTransactionService extends \Stripe\Service\AbstractService * Note that this endpoint was previously called “Balance history” and used the * path /v1/balance/history. * - * @param null|array $params + * @param null|array{created?: array|int, currency?: string, ending_before?: string, expand?: string[], limit?: int, payout?: string, source?: string, starting_after?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\BalanceTransaction> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -37,12 +38,12 @@ class BalanceTransactionService extends \Stripe\Service\AbstractService * /v1/balance/history/:id. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\BalanceTransaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Billing/AlertService.php b/plugins/stripe-php/lib/Service/Billing/AlertService.php index 8baafb1b..00e6ed95 100644 --- a/plugins/stripe-php/lib/Service/Billing/AlertService.php +++ b/plugins/stripe-php/lib/Service/Billing/AlertService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class AlertService extends \Stripe\Service\AbstractService @@ -14,12 +15,12 @@ class AlertService extends \Stripe\Service\AbstractService * Reactivates this alert, allowing it to trigger again. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Alert + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function activate($id, $params = null, $opts = null) { @@ -29,12 +30,12 @@ class AlertService extends \Stripe\Service\AbstractService /** * Lists billing active and inactive alerts. * - * @param null|array $params + * @param null|array{alert_type?: string, ending_before?: string, expand?: string[], limit?: int, meter?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Billing\Alert> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -46,12 +47,12 @@ class AlertService extends \Stripe\Service\AbstractService * non-reversible. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Alert + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function archive($id, $params = null, $opts = null) { @@ -61,12 +62,12 @@ class AlertService extends \Stripe\Service\AbstractService /** * Creates a billing alert. * - * @param null|array $params + * @param null|array{alert_type: string, expand?: string[], title: string, usage_threshold?: array{filters?: array{customer?: string, type: string}[], gte: int, meter?: string, recurrence: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Alert + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -77,12 +78,12 @@ class AlertService extends \Stripe\Service\AbstractService * Deactivates this alert, preventing it from triggering. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Alert + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deactivate($id, $params = null, $opts = null) { @@ -93,12 +94,12 @@ class AlertService extends \Stripe\Service\AbstractService * Retrieves a billing alert given an ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Alert + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Billing/CreditBalanceSummaryService.php b/plugins/stripe-php/lib/Service/Billing/CreditBalanceSummaryService.php index 6169f05f..3b060f98 100644 --- a/plugins/stripe-php/lib/Service/Billing/CreditBalanceSummaryService.php +++ b/plugins/stripe-php/lib/Service/Billing/CreditBalanceSummaryService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class CreditBalanceSummaryService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class CreditBalanceSummaryService extends \Stripe\Service\AbstractService /** * Retrieves the credit balance summary for a customer. * - * @param null|array $params + * @param null|array{customer: string, expand?: string[], filter: array{applicability_scope?: array{price_type?: string, prices?: array{id: string}[]}, credit_grant?: string, type: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\CreditBalanceSummary + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Billing/CreditBalanceTransactionService.php b/plugins/stripe-php/lib/Service/Billing/CreditBalanceTransactionService.php index b4b84087..ff71e40e 100644 --- a/plugins/stripe-php/lib/Service/Billing/CreditBalanceTransactionService.php +++ b/plugins/stripe-php/lib/Service/Billing/CreditBalanceTransactionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class CreditBalanceTransactionService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class CreditBalanceTransactionService extends \Stripe\Service\AbstractService /** * Retrieve a list of credit balance transactions. * - * @param null|array $params + * @param null|array{credit_grant?: string, customer: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Billing\CreditBalanceTransaction> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class CreditBalanceTransactionService extends \Stripe\Service\AbstractService * Retrieves a credit balance transaction. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\CreditBalanceTransaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Billing/CreditGrantService.php b/plugins/stripe-php/lib/Service/Billing/CreditGrantService.php index 29cbb155..8d8c8efb 100644 --- a/plugins/stripe-php/lib/Service/Billing/CreditGrantService.php +++ b/plugins/stripe-php/lib/Service/Billing/CreditGrantService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class CreditGrantService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class CreditGrantService extends \Stripe\Service\AbstractService /** * Retrieve a list of credit grants. * - * @param null|array $params + * @param null|array{customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Billing\CreditGrant> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class CreditGrantService extends \Stripe\Service\AbstractService /** * Creates a credit grant. * - * @param null|array $params + * @param null|array{amount: array{monetary?: array{currency: string, value: int}, type: string}, applicability_config: array{scope: array{price_type?: string, prices?: array{id: string}[]}}, category: string, customer: string, effective_at?: int, expand?: string[], expires_at?: int, metadata?: array, name?: string, priority?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\CreditGrant + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -44,12 +45,12 @@ class CreditGrantService extends \Stripe\Service\AbstractService * Expires a credit grant. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\CreditGrant + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function expire($id, $params = null, $opts = null) { @@ -60,12 +61,12 @@ class CreditGrantService extends \Stripe\Service\AbstractService * Retrieves a credit grant. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\CreditGrant + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -76,12 +77,12 @@ class CreditGrantService extends \Stripe\Service\AbstractService * Updates a credit grant. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], expires_at?: null|int, metadata?: array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\CreditGrant + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -92,12 +93,12 @@ class CreditGrantService extends \Stripe\Service\AbstractService * Voids a credit grant. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\CreditGrant + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function voidGrant($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Billing/MeterEventAdjustmentService.php b/plugins/stripe-php/lib/Service/Billing/MeterEventAdjustmentService.php index 90eb9710..c05e9e0f 100644 --- a/plugins/stripe-php/lib/Service/Billing/MeterEventAdjustmentService.php +++ b/plugins/stripe-php/lib/Service/Billing/MeterEventAdjustmentService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class MeterEventAdjustmentService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class MeterEventAdjustmentService extends \Stripe\Service\AbstractService /** * Creates a billing meter event adjustment. * - * @param null|array $params + * @param null|array{cancel?: array{identifier?: string}, event_name: string, expand?: string[], type: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\MeterEventAdjustment + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Billing/MeterEventService.php b/plugins/stripe-php/lib/Service/Billing/MeterEventService.php index 9c442b73..5b155a75 100644 --- a/plugins/stripe-php/lib/Service/Billing/MeterEventService.php +++ b/plugins/stripe-php/lib/Service/Billing/MeterEventService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class MeterEventService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class MeterEventService extends \Stripe\Service\AbstractService /** * Creates a billing meter event. * - * @param null|array $params + * @param null|array{event_name: string, expand?: string[], identifier?: string, payload: array, timestamp?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\MeterEvent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Billing/MeterService.php b/plugins/stripe-php/lib/Service/Billing/MeterService.php index 7defce8c..11ea4c22 100644 --- a/plugins/stripe-php/lib/Service/Billing/MeterService.php +++ b/plugins/stripe-php/lib/Service/Billing/MeterService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class MeterService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class MeterService extends \Stripe\Service\AbstractService /** * Retrieve a list of billing meters. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Billing\Meter> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class MeterService extends \Stripe\Service\AbstractService * Retrieve a list of billing meter event summaries. * * @param string $parentId - * @param null|array $params + * @param null|array{customer: string, end_time: int, ending_before?: string, expand?: string[], limit?: int, start_time: int, starting_after?: string, value_grouping_window?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Billing\MeterEventSummary> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allEventSummaries($parentId, $params = null, $opts = null) { @@ -44,12 +45,12 @@ class MeterService extends \Stripe\Service\AbstractService /** * Creates a billing meter. * - * @param null|array $params + * @param null|array{customer_mapping?: array{event_payload_key: string, type: string}, default_aggregation: array{formula: string}, display_name: string, event_name: string, event_time_window?: string, expand?: string[], value_settings?: array{event_payload_key: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Meter + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -61,12 +62,12 @@ class MeterService extends \Stripe\Service\AbstractService * meter. You can’t attach a deactivated meter to a price. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Meter + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deactivate($id, $params = null, $opts = null) { @@ -78,12 +79,12 @@ class MeterService extends \Stripe\Service\AbstractService * attach the meter to a price. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Meter + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function reactivate($id, $params = null, $opts = null) { @@ -94,12 +95,12 @@ class MeterService extends \Stripe\Service\AbstractService * Retrieves a billing meter given an ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Meter + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -110,12 +111,12 @@ class MeterService extends \Stripe\Service\AbstractService * Updates a billing meter. * * @param string $id - * @param null|array $params + * @param null|array{display_name?: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Billing\Meter + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/BillingPortal/ConfigurationService.php b/plugins/stripe-php/lib/Service/BillingPortal/ConfigurationService.php index dad1380c..aea225f9 100644 --- a/plugins/stripe-php/lib/Service/BillingPortal/ConfigurationService.php +++ b/plugins/stripe-php/lib/Service/BillingPortal/ConfigurationService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\BillingPortal; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ConfigurationService extends \Stripe\Service\AbstractService @@ -14,12 +15,12 @@ class ConfigurationService extends \Stripe\Service\AbstractService * Returns a list of configurations that describe the functionality of the customer * portal. * - * @param null|array $params + * @param null|array{active?: bool, ending_before?: string, expand?: string[], is_default?: bool, limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\BillingPortal\Configuration> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class ConfigurationService extends \Stripe\Service\AbstractService * Creates a configuration that describes the functionality and behavior of a * PortalSession. * - * @param null|array $params + * @param null|array{business_profile?: array{headline?: null|string, privacy_policy_url?: string, terms_of_service_url?: string}, default_return_url?: null|string, expand?: string[], features: array{customer_update?: array{allowed_updates?: null|string[], enabled: bool}, invoice_history?: array{enabled: bool}, payment_method_update?: array{enabled: bool}, subscription_cancel?: array{cancellation_reason?: array{enabled: bool, options: null|string[]}, enabled: bool, mode?: string, proration_behavior?: string}, subscription_update?: array{default_allowed_updates?: null|string[], enabled: bool, products?: null|array{prices: string[], product: string}[], proration_behavior?: string, schedule_at_period_end?: array{conditions?: array{type: string}[]}}}, login_page?: array{enabled: bool}, metadata?: array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\BillingPortal\Configuration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -47,12 +48,12 @@ class ConfigurationService extends \Stripe\Service\AbstractService * portal. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\BillingPortal\Configuration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -63,12 +64,12 @@ class ConfigurationService extends \Stripe\Service\AbstractService * Updates a configuration that describes the functionality of the customer portal. * * @param string $id - * @param null|array $params + * @param null|array{active?: bool, business_profile?: array{headline?: null|string, privacy_policy_url?: null|string, terms_of_service_url?: null|string}, default_return_url?: null|string, expand?: string[], features?: array{customer_update?: array{allowed_updates?: null|string[], enabled?: bool}, invoice_history?: array{enabled: bool}, payment_method_update?: array{enabled: bool}, subscription_cancel?: array{cancellation_reason?: array{enabled: bool, options?: null|string[]}, enabled?: bool, mode?: string, proration_behavior?: string}, subscription_update?: array{default_allowed_updates?: null|string[], enabled?: bool, products?: null|array{prices: string[], product: string}[], proration_behavior?: string, schedule_at_period_end?: array{conditions?: null|array{type: string}[]}}}, login_page?: array{enabled: bool}, metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\BillingPortal\Configuration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/BillingPortal/SessionService.php b/plugins/stripe-php/lib/Service/BillingPortal/SessionService.php index 6f7e5174..259745c2 100644 --- a/plugins/stripe-php/lib/Service/BillingPortal/SessionService.php +++ b/plugins/stripe-php/lib/Service/BillingPortal/SessionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\BillingPortal; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class SessionService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class SessionService extends \Stripe\Service\AbstractService /** * Creates a session of the customer portal. * - * @param null|array $params + * @param null|array{configuration?: string, customer: string, expand?: string[], flow_data?: array{after_completion?: array{hosted_confirmation?: array{custom_message?: string}, redirect?: array{return_url: string}, type: string}, subscription_cancel?: array{retention?: array{coupon_offer: array{coupon: string}, type: string}, subscription: string}, subscription_update?: array{subscription: string}, subscription_update_confirm?: array{discounts?: array{coupon?: string, promotion_code?: string}[], items: array{id: string, price?: string, quantity?: int}[], subscription: string}, type: string}, locale?: string, on_behalf_of?: string, return_url?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\BillingPortal\Session + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/ChargeService.php b/plugins/stripe-php/lib/Service/ChargeService.php index 500456f9..301fd2bf 100644 --- a/plugins/stripe-php/lib/Service/ChargeService.php +++ b/plugins/stripe-php/lib/Service/ChargeService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class ChargeService extends \Stripe\Service\AbstractService +class ChargeService extends AbstractService { /** * Returns a list of charges you’ve previously created. The charges are returned in * sorted order, with the most recent charges appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string, transfer_group?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Charge> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -38,12 +39,12 @@ class ChargeService extends \Stripe\Service\AbstractService * href="/docs/api/payment_intents/capture">Capture a PaymentIntent. * * @param string $id - * @param null|array $params + * @param null|array{amount?: int, application_fee?: int, application_fee_amount?: int, expand?: string[], receipt_email?: string, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int}, transfer_group?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Charge + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function capture($id, $params = null, $opts = null) { @@ -56,12 +57,12 @@ class ChargeService extends \Stripe\Service\AbstractService * payment instead. Confirmation of the PaymentIntent creates the * Charge object used to request payment. * - * @param null|array $params + * @param null|array{amount?: int, application_fee?: int, application_fee_amount?: int, capture?: bool, currency?: string, customer?: string, description?: string, destination?: array{account: string, amount?: int}, expand?: string[], metadata?: null|array, on_behalf_of?: string, radar_options?: array{session?: string}, receipt_email?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, source?: string, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Charge + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -75,12 +76,12 @@ class ChargeService extends \Stripe\Service\AbstractService * when creating or refunding the charge. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Charge + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -95,12 +96,12 @@ class ChargeService extends \Stripe\Service\AbstractService * Occasionally, propagation of new or updated data can be up to an hour behind * during outages. Search functionality is not available to merchants in India. * - * @param null|array $params + * @param null|array{expand?: string[], limit?: int, page?: string, query: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SearchResult<\Stripe\Charge> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function search($params = null, $opts = null) { @@ -112,12 +113,12 @@ class ChargeService extends \Stripe\Service\AbstractService * parameters not provided will be left unchanged. * * @param string $id - * @param null|array $params + * @param null|array{customer?: string, description?: string, expand?: string[], fraud_details?: array{user_report: null|string}, metadata?: null|array, receipt_email?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, transfer_group?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Charge + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Checkout/SessionService.php b/plugins/stripe-php/lib/Service/Checkout/SessionService.php index c419a505..cbc854cb 100644 --- a/plugins/stripe-php/lib/Service/Checkout/SessionService.php +++ b/plugins/stripe-php/lib/Service/Checkout/SessionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Checkout; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class SessionService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class SessionService extends \Stripe\Service\AbstractService /** * Returns a list of Checkout Sessions. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, customer_details?: array{email: string}, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, payment_link?: string, starting_after?: string, status?: string, subscription?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Checkout\Session> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -32,12 +33,12 @@ class SessionService extends \Stripe\Service\AbstractService * line items. * * @param string $id - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\LineItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allLineItems($id, $params = null, $opts = null) { @@ -45,14 +46,14 @@ class SessionService extends \Stripe\Service\AbstractService } /** - * Creates a Session object. + * Creates a Checkout Session object. * - * @param null|array $params + * @param null|array{adaptive_pricing?: array{enabled?: bool}, after_expiration?: array{recovery?: array{allow_promotion_codes?: bool, enabled: bool}}, allow_promotion_codes?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_address_collection?: string, cancel_url?: string, client_reference_id?: string, consent_collection?: array{payment_method_reuse_agreement?: array{position: string}, promotions?: string, terms_of_service?: string}, currency?: string, custom_fields?: array{dropdown?: array{default_value?: string, options: array{label: string, value: string}[]}, key: string, label: array{custom: string, type: string}, numeric?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, optional?: bool, text?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, type: string}[], custom_text?: array{after_submit?: null|array{message: string}, shipping_address?: null|array{message: string}, submit?: null|array{message: string}, terms_of_service_acceptance?: null|array{message: string}}, customer?: string, customer_creation?: string, customer_email?: string, customer_update?: array{address?: string, name?: string, shipping?: string}, discounts?: array{coupon?: string, promotion_code?: string}[], expand?: string[], expires_at?: int, invoice_creation?: array{enabled: bool, invoice_data?: array{account_tax_ids?: null|string[], custom_fields?: null|array{name: string, value: string}[], description?: string, footer?: string, issuer?: array{account?: string, type: string}, metadata?: array, rendering_options?: null|array{amount_tax_display?: null|string}}}, line_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, dynamic_tax_rates?: string[], price?: string, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string}, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: string[]}[], locale?: string, metadata?: array, mode?: string, optional_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, price: string, quantity: int}[], payment_intent_data?: array{application_fee_amount?: int, capture_method?: string, description?: string, metadata?: array, on_behalf_of?: string, receipt_email?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string}, payment_method_collection?: string, payment_method_configuration?: string, payment_method_data?: array{allow_redisplay?: string}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: string, target_date?: string, verification_method?: string}, affirm?: array{setup_future_usage?: string}, afterpay_clearpay?: array{setup_future_usage?: string}, alipay?: array{setup_future_usage?: string}, amazon_pay?: array{setup_future_usage?: string}, au_becs_debit?: array{setup_future_usage?: string, target_date?: string}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, bancontact?: array{setup_future_usage?: string}, boleto?: array{expires_after_days?: int, setup_future_usage?: string}, card?: array{installments?: array{enabled?: bool}, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, restrictions?: array{brands_blocked?: string[]}, setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}, cashapp?: array{setup_future_usage?: string}, customer_balance?: array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: array{setup_future_usage?: string}, fpx?: array{setup_future_usage?: string}, giropay?: array{setup_future_usage?: string}, grabpay?: array{setup_future_usage?: string}, ideal?: array{setup_future_usage?: string}, kakao_pay?: array{capture_method?: string, setup_future_usage?: string}, klarna?: array{setup_future_usage?: string}, konbini?: array{expires_after_days?: int, setup_future_usage?: string}, kr_card?: array{capture_method?: string, setup_future_usage?: string}, link?: array{setup_future_usage?: string}, mobilepay?: array{setup_future_usage?: string}, multibanco?: array{setup_future_usage?: string}, naver_pay?: array{capture_method?: string, setup_future_usage?: string}, oxxo?: array{expires_after_days?: int, setup_future_usage?: string}, p24?: array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: array{}, payco?: array{capture_method?: string}, paynow?: array{setup_future_usage?: string}, paypal?: array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, pix?: array{expires_after_seconds?: int}, revolut_pay?: array{setup_future_usage?: string}, samsung_pay?: array{capture_method?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, sofort?: array{setup_future_usage?: string}, swish?: array{reference?: string}, us_bank_account?: array{financial_connections?: array{permissions?: string[], prefetch?: string[]}, setup_future_usage?: string, target_date?: string, verification_method?: string}, wechat_pay?: array{app_id?: string, client: string, setup_future_usage?: string}}, payment_method_types?: string[], permissions?: array{update_shipping_details?: string}, phone_number_collection?: array{enabled: bool}, redirect_on_completion?: string, return_url?: string, saved_payment_method_options?: array{allow_redisplay_filters?: string[], payment_method_save?: string}, setup_intent_data?: array{description?: string, metadata?: array, on_behalf_of?: string}, shipping_address_collection?: array{allowed_countries: string[]}, shipping_options?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}[], submit_type?: string, subscription_data?: array{application_fee_percent?: float, billing_cycle_anchor?: int, default_tax_rates?: string[], description?: string, invoice_settings?: array{issuer?: array{account?: string, type: string}}, metadata?: array, on_behalf_of?: string, proration_behavior?: string, transfer_data?: array{amount_percent?: float, destination: string}, trial_end?: int, trial_period_days?: int, trial_settings?: array{end_behavior: array{missing_payment_method: string}}}, success_url?: string, tax_id_collection?: array{enabled: bool, required?: string}, ui_mode?: string, wallet_options?: array{link?: array{display?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Checkout\Session + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -60,18 +61,20 @@ class SessionService extends \Stripe\Service\AbstractService } /** - * A Session can be expired when it is in one of these statuses: open. + * A Checkout Session can be expired when it is in one of these statuses: + * open * - * After it expires, a customer can’t complete a Session and customers loading the - * Session see a message saying the Session is expired. + * After it expires, a customer can’t complete a Checkout Session and customers + * loading the Checkout Session see a message saying the Checkout Session is + * expired. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Checkout\Session + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function expire($id, $params = null, $opts = null) { @@ -79,15 +82,15 @@ class SessionService extends \Stripe\Service\AbstractService } /** - * Retrieves a Session object. + * Retrieves a Checkout Session object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Checkout\Session + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -95,15 +98,15 @@ class SessionService extends \Stripe\Service\AbstractService } /** - * Updates a Session object. + * Updates a Checkout Session object. * * @param string $id - * @param null|array $params + * @param null|array{collected_information?: array{shipping_details?: array{address: array{city?: string, country: string, line1: string, line2?: string, postal_code?: string, state?: string}, name: string}}, expand?: string[], metadata?: null|array, shipping_options?: null|array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Checkout\Session + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Climate/OrderService.php b/plugins/stripe-php/lib/Service/Climate/OrderService.php index 29917ffa..63348da2 100644 --- a/plugins/stripe-php/lib/Service/Climate/OrderService.php +++ b/plugins/stripe-php/lib/Service/Climate/OrderService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Climate; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class OrderService extends \Stripe\Service\AbstractService @@ -14,12 +15,12 @@ class OrderService extends \Stripe\Service\AbstractService * Lists all Climate order objects. The orders are returned sorted by creation * date, with the most recently created orders appearing first. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Climate\Order> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -35,12 +36,12 @@ class OrderService extends \Stripe\Service\AbstractService * amount_total. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Climate\Order + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -52,12 +53,12 @@ class OrderService extends \Stripe\Service\AbstractService * processed immediately after creation and payment will be deducted your Stripe * balance. * - * @param null|array $params + * @param null|array{amount?: int, beneficiary?: array{public_name: string}, currency?: string, expand?: string[], metadata?: array, metric_tons?: string, product: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Climate\Order + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -68,12 +69,12 @@ class OrderService extends \Stripe\Service\AbstractService * Retrieves the details of a Climate order object with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Climate\Order + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -84,12 +85,12 @@ class OrderService extends \Stripe\Service\AbstractService * Updates the specified order by setting the values of the parameters passed. * * @param string $id - * @param null|array $params + * @param null|array{beneficiary?: null|array{public_name: null|string}, expand?: string[], metadata?: array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Climate\Order + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Climate/ProductService.php b/plugins/stripe-php/lib/Service/Climate/ProductService.php index c449b856..0db98127 100644 --- a/plugins/stripe-php/lib/Service/Climate/ProductService.php +++ b/plugins/stripe-php/lib/Service/Climate/ProductService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Climate; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ProductService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class ProductService extends \Stripe\Service\AbstractService /** * Lists all available Climate product objects. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Climate\Product> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class ProductService extends \Stripe\Service\AbstractService * Retrieves the details of a Climate product with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Climate\Product + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Climate/SupplierService.php b/plugins/stripe-php/lib/Service/Climate/SupplierService.php index 5ab203d6..f03fd1cf 100644 --- a/plugins/stripe-php/lib/Service/Climate/SupplierService.php +++ b/plugins/stripe-php/lib/Service/Climate/SupplierService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Climate; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class SupplierService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class SupplierService extends \Stripe\Service\AbstractService /** * Lists all available Climate supplier objects. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Climate\Supplier> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class SupplierService extends \Stripe\Service\AbstractService * Retrieves a Climate supplier object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Climate\Supplier + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/ConfirmationTokenService.php b/plugins/stripe-php/lib/Service/ConfirmationTokenService.php index cdf47105..86c1d61e 100644 --- a/plugins/stripe-php/lib/Service/ConfirmationTokenService.php +++ b/plugins/stripe-php/lib/Service/ConfirmationTokenService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class ConfirmationTokenService extends \Stripe\Service\AbstractService +class ConfirmationTokenService extends AbstractService { /** * Retrieves an existing ConfirmationToken object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ConfirmationToken + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/CoreServiceFactory.php b/plugins/stripe-php/lib/Service/CoreServiceFactory.php index 15042041..363bc452 100644 --- a/plugins/stripe-php/lib/Service/CoreServiceFactory.php +++ b/plugins/stripe-php/lib/Service/CoreServiceFactory.php @@ -37,6 +37,7 @@ namespace Stripe\Service; * @property Forwarding\ForwardingServiceFactory $forwarding * @property Identity\IdentityServiceFactory $identity * @property InvoiceItemService $invoiceItems + * @property InvoicePaymentService $invoicePayments * @property InvoiceRenderingTemplateService $invoiceRenderingTemplates * @property InvoiceService $invoices * @property Issuing\IssuingServiceFactory $issuing @@ -78,7 +79,7 @@ namespace Stripe\Service; * @property WebhookEndpointService $webhookEndpoints * // Doc: The end of the section generated from our OpenAPI spec */ -class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory +class CoreServiceFactory extends AbstractServiceFactory { /** * @var array @@ -116,6 +117,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory 'forwarding' => Forwarding\ForwardingServiceFactory::class, 'identity' => Identity\IdentityServiceFactory::class, 'invoiceItems' => InvoiceItemService::class, + 'invoicePayments' => InvoicePaymentService::class, 'invoiceRenderingTemplates' => InvoiceRenderingTemplateService::class, 'invoices' => InvoiceService::class, 'issuing' => Issuing\IssuingServiceFactory::class, diff --git a/plugins/stripe-php/lib/Service/CountrySpecService.php b/plugins/stripe-php/lib/Service/CountrySpecService.php index e4410e12..a03107ea 100644 --- a/plugins/stripe-php/lib/Service/CountrySpecService.php +++ b/plugins/stripe-php/lib/Service/CountrySpecService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class CountrySpecService extends \Stripe\Service\AbstractService +class CountrySpecService extends AbstractService { /** * Lists all Country Spec objects available in the API. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\CountrySpec> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class CountrySpecService extends \Stripe\Service\AbstractService * Returns a Country Spec for a given Country code. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CountrySpec + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/CouponService.php b/plugins/stripe-php/lib/Service/CouponService.php index d0d4f82a..de1e36be 100644 --- a/plugins/stripe-php/lib/Service/CouponService.php +++ b/plugins/stripe-php/lib/Service/CouponService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class CouponService extends \Stripe\Service\AbstractService +class CouponService extends AbstractService { /** * Returns a list of your coupons. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Coupon> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -41,12 +42,12 @@ class CouponService extends \Stripe\Service\AbstractService * a coupon with an amount_off of 200 is applied to * it. * - * @param null|array $params + * @param null|array{amount_off?: int, applies_to?: array{products?: string[]}, currency?: string, currency_options?: array, duration?: string, duration_in_months?: int, expand?: string[], id?: string, max_redemptions?: int, metadata?: null|array, name?: string, percent_off?: float, redeem_by?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Coupon + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -64,9 +65,9 @@ class CouponService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Coupon + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -77,12 +78,12 @@ class CouponService extends \Stripe\Service\AbstractService * Retrieves the coupon with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Coupon + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -94,12 +95,12 @@ class CouponService extends \Stripe\Service\AbstractService * amount_off) are, by design, not editable. * * @param string $id - * @param null|array $params + * @param null|array{currency_options?: array, expand?: string[], metadata?: null|array, name?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Coupon + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/CreditNoteService.php b/plugins/stripe-php/lib/Service/CreditNoteService.php index 6731730b..f1a4978e 100644 --- a/plugins/stripe-php/lib/Service/CreditNoteService.php +++ b/plugins/stripe-php/lib/Service/CreditNoteService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class CreditNoteService extends \Stripe\Service\AbstractService +class CreditNoteService extends AbstractService { /** * Returns a list of credit notes. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], invoice?: string, limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\CreditNote> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -31,12 +32,12 @@ class CreditNoteService extends \Stripe\Service\AbstractService * retrieve the full (paginated) list of line items. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allLines($parentId, $params = null, $opts = null) { @@ -48,7 +49,7 @@ class CreditNoteService extends \Stripe\Service\AbstractService * status=open invoice, a credit note reduces its * amount_due. For a status=paid invoice, a credit note * does not affect its amount_due. Instead, it can result in any - * combination of the following:. + * combination of the following: * *
    • Refund: create a new refund (using refund_amount) or link * an existing refund (using refund).
    • Customer balance @@ -65,12 +66,12 @@ class CreditNoteService extends \Stripe\Service\AbstractService * post_payment_credit_notes_amount depending on its * status at the time of credit note creation. * - * @param null|array $params + * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, refund?: string}[], shipping_cost?: array{shipping_rate?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CreditNote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -80,12 +81,12 @@ class CreditNoteService extends \Stripe\Service\AbstractService /** * Get a preview of a credit note without creating it. * - * @param null|array $params + * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, refund?: string}[], shipping_cost?: array{shipping_rate?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CreditNote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function preview($params = null, $opts = null) { @@ -97,12 +98,12 @@ class CreditNoteService extends \Stripe\Service\AbstractService * property containing the first handful of those items. This URL you can retrieve * the full (paginated) list of line items. * - * @param null|array $params + * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, ending_before?: string, expand?: string[], invoice: string, limit?: int, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, refund?: string}[], shipping_cost?: array{shipping_rate?: string}, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function previewLines($params = null, $opts = null) { @@ -113,12 +114,12 @@ class CreditNoteService extends \Stripe\Service\AbstractService * Retrieves the credit note object with the given identifier. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CreditNote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -129,12 +130,12 @@ class CreditNoteService extends \Stripe\Service\AbstractService * Updates an existing credit note. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], memo?: string, metadata?: array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CreditNote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -146,12 +147,12 @@ class CreditNoteService extends \Stripe\Service\AbstractService * href="/docs/billing/invoices/credit-notes#voiding">voiding credit notes. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CreditNote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function voidCreditNote($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/CustomerService.php b/plugins/stripe-php/lib/Service/CustomerService.php index f8d5b1ed..146c2e2a 100644 --- a/plugins/stripe-php/lib/Service/CustomerService.php +++ b/plugins/stripe-php/lib/Service/CustomerService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class CustomerService extends \Stripe\Service\AbstractService +class CustomerService extends AbstractService { /** * Returns a list of your customers. The customers are returned sorted by creation * date, with the most recent customers appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, email?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, test_clock?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Customer> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -31,12 +32,12 @@ class CustomerService extends \Stripe\Service\AbstractService * href="/docs/billing/customer/balance">balances. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\CustomerBalanceTransaction> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allBalanceTransactions($parentId, $params = null, $opts = null) { @@ -48,12 +49,12 @@ class CustomerService extends \Stripe\Service\AbstractService * href="/docs/payments/customer-balance">cash balance. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\CustomerCashBalanceTransaction> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allCashBalanceTransactions($parentId, $params = null, $opts = null) { @@ -64,12 +65,12 @@ class CustomerService extends \Stripe\Service\AbstractService * Returns a list of PaymentMethods for a given Customer. * * @param string $id - * @param null|array $params + * @param null|array{allow_redisplay?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\PaymentMethod> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allPaymentMethods($id, $params = null, $opts = null) { @@ -80,12 +81,12 @@ class CustomerService extends \Stripe\Service\AbstractService * List sources for a specified customer. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, object?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allSources($parentId, $params = null, $opts = null) { @@ -96,12 +97,12 @@ class CustomerService extends \Stripe\Service\AbstractService * Returns a list of tax IDs for a customer. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\TaxId> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allTaxIds($parentId, $params = null, $opts = null) { @@ -111,12 +112,12 @@ class CustomerService extends \Stripe\Service\AbstractService /** * Creates a new customer object. * - * @param null|array $params + * @param null|array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, balance?: int, cash_balance?: array{settings?: array{reconciliation_mode?: string}}, description?: string, email?: string, expand?: string[], invoice_prefix?: string, invoice_settings?: array{custom_fields?: null|array{name: string, value: string}[], default_payment_method?: string, footer?: string, rendering_options?: null|array{amount_tax_display?: null|string, template?: string}}, metadata?: null|array, name?: string, next_invoice_sequence?: int, payment_method?: string, phone?: string, preferred_locales?: string[], shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: string}, source?: string, tax?: array{ip_address?: null|string, validate_location?: string}, tax_exempt?: null|string, tax_id_data?: array{type: string, value: string}[], test_clock?: string, validate?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Customer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -128,12 +129,12 @@ class CustomerService extends \Stripe\Service\AbstractService * href="/docs/billing/customer/balance">balance. * * @param string $parentId - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CustomerBalanceTransaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createBalanceTransaction($parentId, $params = null, $opts = null) { @@ -148,12 +149,12 @@ class CustomerService extends \Stripe\Service\AbstractService * the same funding instructions each time. * * @param string $id - * @param null|array $params + * @param null|array{bank_transfer: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, currency: string, expand?: string[], funding_type: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FundingInstructions + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createFundingInstructions($id, $params = null, $opts = null) { @@ -170,12 +171,12 @@ class CustomerService extends \Stripe\Service\AbstractService * customer to have a new default_source. * * @param string $parentId - * @param null|array $params + * @param null|array{expand?: string[], metadata?: array, source: string, validate?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createSource($parentId, $params = null, $opts = null) { @@ -186,12 +187,12 @@ class CustomerService extends \Stripe\Service\AbstractService * Creates a new tax_id object for a customer. * * @param string $parentId - * @param null|array $params + * @param null|array{expand?: string[], type: string, value: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TaxId + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createTaxId($parentId, $params = null, $opts = null) { @@ -206,9 +207,9 @@ class CustomerService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Customer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -222,9 +223,9 @@ class CustomerService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Discount + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deleteDiscount($id, $params = null, $opts = null) { @@ -236,12 +237,12 @@ class CustomerService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deleteSource($parentId, $id, $params = null, $opts = null) { @@ -256,9 +257,9 @@ class CustomerService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TaxId + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deleteTaxId($parentId, $id, $params = null, $opts = null) { @@ -269,12 +270,12 @@ class CustomerService extends \Stripe\Service\AbstractService * Retrieves a Customer object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Customer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -287,12 +288,12 @@ class CustomerService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CustomerBalanceTransaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveBalanceTransaction($parentId, $id, $params = null, $opts = null) { @@ -303,12 +304,12 @@ class CustomerService extends \Stripe\Service\AbstractService * Retrieves a customer’s cash balance. * * @param string $parentId - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CashBalance + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveCashBalance($parentId, $params = null, $opts = null) { @@ -321,12 +322,12 @@ class CustomerService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CustomerCashBalanceTransaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveCashBalanceTransaction($parentId, $id, $params = null, $opts = null) { @@ -338,12 +339,12 @@ class CustomerService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethod + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrievePaymentMethod($parentId, $id, $params = null, $opts = null) { @@ -355,12 +356,12 @@ class CustomerService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveSource($parentId, $id, $params = null, $opts = null) { @@ -372,12 +373,12 @@ class CustomerService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TaxId + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveTaxId($parentId, $id, $params = null, $opts = null) { @@ -392,12 +393,12 @@ class CustomerService extends \Stripe\Service\AbstractService * Occasionally, propagation of new or updated data can be up to an hour behind * during outages. Search functionality is not available to merchants in India. * - * @param null|array $params + * @param null|array{expand?: string[], limit?: int, page?: string, query: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SearchResult<\Stripe\Customer> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function search($params = null, $opts = null) { @@ -420,12 +421,12 @@ class CustomerService extends \Stripe\Service\AbstractService * This request accepts mostly the same arguments as the customer creation call. * * @param string $id - * @param null|array $params + * @param null|array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, balance?: int, cash_balance?: array{settings?: array{reconciliation_mode?: string}}, default_source?: string, description?: string, email?: string, expand?: string[], invoice_prefix?: string, invoice_settings?: array{custom_fields?: null|array{name: string, value: string}[], default_payment_method?: string, footer?: string, rendering_options?: null|array{amount_tax_display?: null|string, template?: string}}, metadata?: null|array, name?: string, next_invoice_sequence?: int, phone?: string, preferred_locales?: string[], shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: string}, source?: string, tax?: array{ip_address?: null|string, validate_location?: string}, tax_exempt?: null|string, validate?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Customer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -438,12 +439,12 @@ class CustomerService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{description?: string, expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CustomerBalanceTransaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateBalanceTransaction($parentId, $id, $params = null, $opts = null) { @@ -454,12 +455,12 @@ class CustomerService extends \Stripe\Service\AbstractService * Changes the settings on a customer’s cash balance. * * @param string $parentId - * @param null|array $params + * @param null|array{expand?: string[], settings?: array{reconciliation_mode?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CashBalance + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateCashBalance($parentId, $params = null, $opts = null) { @@ -471,12 +472,12 @@ class CustomerService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{account_holder_name?: string, account_holder_type?: string, address_city?: string, address_country?: string, address_line1?: string, address_line2?: string, address_state?: string, address_zip?: string, exp_month?: string, exp_year?: string, expand?: string[], metadata?: null|array, name?: string, owner?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: string, name?: string, phone?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateSource($parentId, $id, $params = null, $opts = null) { @@ -488,12 +489,12 @@ class CustomerService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{amounts?: int[], expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function verifySource($parentId, $id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/CustomerSessionService.php b/plugins/stripe-php/lib/Service/CustomerSessionService.php index d3b0d685..8b27fb2b 100644 --- a/plugins/stripe-php/lib/Service/CustomerSessionService.php +++ b/plugins/stripe-php/lib/Service/CustomerSessionService.php @@ -6,21 +6,22 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class CustomerSessionService extends \Stripe\Service\AbstractService +class CustomerSessionService extends AbstractService { /** * Creates a Customer Session object that includes a single-use client secret that * you can use on your front-end to grant client-side API access for certain * customer resources. * - * @param null|array $params + * @param null|array{components: array{buy_button?: array{enabled: bool}, payment_element?: array{enabled: bool, features?: array{payment_method_allow_redisplay_filters?: string[], payment_method_redisplay?: string, payment_method_redisplay_limit?: int, payment_method_remove?: string, payment_method_save?: string, payment_method_save_usage?: string}}, pricing_table?: array{enabled: bool}}, customer: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CustomerSession + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/DisputeService.php b/plugins/stripe-php/lib/Service/DisputeService.php index ea48ceb4..fadfe45b 100644 --- a/plugins/stripe-php/lib/Service/DisputeService.php +++ b/plugins/stripe-php/lib/Service/DisputeService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class DisputeService extends \Stripe\Service\AbstractService +class DisputeService extends AbstractService { /** * Returns a list of your disputes. * - * @param null|array $params + * @param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Dispute> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -33,12 +34,12 @@ class DisputeService extends \Stripe\Service\AbstractService * lost. Closing a dispute is irreversible. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Dispute + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function close($id, $params = null, $opts = null) { @@ -49,12 +50,12 @@ class DisputeService extends \Stripe\Service\AbstractService * Retrieves the dispute with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Dispute + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -73,12 +74,12 @@ class DisputeService extends \Stripe\Service\AbstractService * see our guide to dispute types. * * @param string $id - * @param null|array $params + * @param null|array{evidence?: array{access_activity_log?: string, billing_address?: string, cancellation_policy?: string, cancellation_policy_disclosure?: string, cancellation_rebuttal?: string, customer_communication?: string, customer_email_address?: string, customer_name?: string, customer_purchase_ip?: string, customer_signature?: string, duplicate_charge_documentation?: string, duplicate_charge_explanation?: string, duplicate_charge_id?: string, enhanced_evidence?: null|array{visa_compelling_evidence_3?: array{disputed_transaction?: array{customer_account_id?: null|string, customer_device_fingerprint?: null|string, customer_device_id?: null|string, customer_email_address?: null|string, customer_purchase_ip?: null|string, merchandise_or_services?: string, product_description?: null|string, shipping_address?: array{city?: null|string, country?: null|string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}}, prior_undisputed_transactions?: (array{charge: string, customer_account_id?: null|string, customer_device_fingerprint?: null|string, customer_device_id?: null|string, customer_email_address?: null|string, customer_purchase_ip?: null|string, product_description?: null|string, shipping_address?: array{city?: null|string, country?: null|string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}})[]}, visa_compliance?: array{fee_acknowledged?: bool}}, product_description?: string, receipt?: string, refund_policy?: string, refund_policy_disclosure?: string, refund_refusal_explanation?: string, service_date?: string, service_documentation?: string, shipping_address?: string, shipping_carrier?: string, shipping_date?: string, shipping_documentation?: string, shipping_tracking_number?: string, uncategorized_file?: string, uncategorized_text?: string}, expand?: string[], metadata?: null|array, submit?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Dispute + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Entitlements/ActiveEntitlementService.php b/plugins/stripe-php/lib/Service/Entitlements/ActiveEntitlementService.php index f9760016..f2c950af 100644 --- a/plugins/stripe-php/lib/Service/Entitlements/ActiveEntitlementService.php +++ b/plugins/stripe-php/lib/Service/Entitlements/ActiveEntitlementService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Entitlements; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ActiveEntitlementService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class ActiveEntitlementService extends \Stripe\Service\AbstractService /** * Retrieve a list of active entitlements for a customer. * - * @param null|array $params + * @param null|array{customer: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Entitlements\ActiveEntitlement> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class ActiveEntitlementService extends \Stripe\Service\AbstractService * Retrieve an active entitlement. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Entitlements\ActiveEntitlement + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Entitlements/FeatureService.php b/plugins/stripe-php/lib/Service/Entitlements/FeatureService.php index a47fc499..81e38b08 100644 --- a/plugins/stripe-php/lib/Service/Entitlements/FeatureService.php +++ b/plugins/stripe-php/lib/Service/Entitlements/FeatureService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Entitlements; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class FeatureService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class FeatureService extends \Stripe\Service\AbstractService /** * Retrieve a list of features. * - * @param null|array $params + * @param null|array{archived?: bool, ending_before?: string, expand?: string[], limit?: int, lookup_key?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Entitlements\Feature> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class FeatureService extends \Stripe\Service\AbstractService /** * Creates a feature. * - * @param null|array $params + * @param null|array{expand?: string[], lookup_key: string, metadata?: array, name: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Entitlements\Feature + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -44,12 +45,12 @@ class FeatureService extends \Stripe\Service\AbstractService * Retrieves a feature. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Entitlements\Feature + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -60,12 +61,12 @@ class FeatureService extends \Stripe\Service\AbstractService * Update a feature’s metadata or permanently deactivate it. * * @param string $id - * @param null|array $params + * @param null|array{active?: bool, expand?: string[], metadata?: null|array, name?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Entitlements\Feature + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/EphemeralKeyService.php b/plugins/stripe-php/lib/Service/EphemeralKeyService.php index cb2d4a42..64f2332e 100644 --- a/plugins/stripe-php/lib/Service/EphemeralKeyService.php +++ b/plugins/stripe-php/lib/Service/EphemeralKeyService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class EphemeralKeyService extends \Stripe\Service\AbstractService +class EphemeralKeyService extends AbstractService { /** * Invalidates a short-lived API key for a given resource. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\EphemeralKey + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -32,9 +33,9 @@ class EphemeralKeyService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\EphemeralKey + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/EventService.php b/plugins/stripe-php/lib/Service/EventService.php index 7b02e408..0b299915 100644 --- a/plugins/stripe-php/lib/Service/EventService.php +++ b/plugins/stripe-php/lib/Service/EventService.php @@ -6,9 +6,10 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class EventService extends \Stripe\Service\AbstractService +class EventService extends AbstractService { /** * List events, going back up to 30 days. Each event data is rendered according to @@ -17,12 +18,12 @@ class EventService extends \Stripe\Service\AbstractService * api_version attribute (not according to your current Stripe API * version or Stripe-Version header). * - * @param null|array $params + * @param null|array{created?: array|int, delivery_success?: bool, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string, types?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Event> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -34,12 +35,12 @@ class EventService extends \Stripe\Service\AbstractService * the unique identifier of the event, which you might have received in a webhook. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Event + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/ExchangeRateService.php b/plugins/stripe-php/lib/Service/ExchangeRateService.php index ff2223f1..79d1a6cc 100644 --- a/plugins/stripe-php/lib/Service/ExchangeRateService.php +++ b/plugins/stripe-php/lib/Service/ExchangeRateService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class ExchangeRateService extends \Stripe\Service\AbstractService +class ExchangeRateService extends AbstractService { /** * Returns a list of objects that contain the rates at which foreign currencies are * converted to one another. Only shows the currencies for which Stripe supports. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\ExchangeRate> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -31,12 +32,12 @@ class ExchangeRateService extends \Stripe\Service\AbstractService * currency. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ExchangeRate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/FileLinkService.php b/plugins/stripe-php/lib/Service/FileLinkService.php index 68773f0b..024d7ee3 100644 --- a/plugins/stripe-php/lib/Service/FileLinkService.php +++ b/plugins/stripe-php/lib/Service/FileLinkService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class FileLinkService extends \Stripe\Service\AbstractService +class FileLinkService extends AbstractService { /** * Returns a list of file links. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], expired?: bool, file?: string, limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\FileLink> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class FileLinkService extends \Stripe\Service\AbstractService /** * Creates a new file link object. * - * @param null|array $params + * @param null|array{expand?: string[], expires_at?: int, file: string, metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FileLink + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -44,12 +45,12 @@ class FileLinkService extends \Stripe\Service\AbstractService * Retrieves the file link with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FileLink + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -60,12 +61,12 @@ class FileLinkService extends \Stripe\Service\AbstractService * Updates an existing file link object. Expired links can no longer be updated. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], expires_at?: null|array|int|string, metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FileLink + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/FileService.php b/plugins/stripe-php/lib/Service/FileService.php index 87748ddd..54e898ad 100644 --- a/plugins/stripe-php/lib/Service/FileService.php +++ b/plugins/stripe-php/lib/Service/FileService.php @@ -6,21 +6,22 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class FileService extends \Stripe\Service\AbstractService +class FileService extends AbstractService { /** * Returns a list of the files that your account has access to. Stripe sorts and * returns the files by their creation dates, placing the most recently created * files at the top. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, purpose?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\File> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -33,12 +34,12 @@ class FileService extends \Stripe\Service\AbstractService * href="/docs/file-upload#download-file-contents">access file contents. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\File + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/FinancialConnections/AccountService.php b/plugins/stripe-php/lib/Service/FinancialConnections/AccountService.php index dd52243f..f0de48d2 100644 --- a/plugins/stripe-php/lib/Service/FinancialConnections/AccountService.php +++ b/plugins/stripe-php/lib/Service/FinancialConnections/AccountService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\FinancialConnections; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class AccountService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class AccountService extends \Stripe\Service\AbstractService /** * Returns a list of Financial Connections Account objects. * - * @param null|array $params + * @param null|array{account_holder?: array{account?: string, customer?: string}, ending_before?: string, expand?: string[], limit?: int, session?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\FinancialConnections\Account> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class AccountService extends \Stripe\Service\AbstractService * Lists all owners for a given Account. * * @param string $id - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, ownership: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\FinancialConnections\AccountOwner> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allOwners($id, $params = null, $opts = null) { @@ -47,12 +48,12 @@ class AccountService extends \Stripe\Service\AbstractService * transactions). * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FinancialConnections\Account + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function disconnect($id, $params = null, $opts = null) { @@ -63,12 +64,12 @@ class AccountService extends \Stripe\Service\AbstractService * Refreshes the data associated with a Financial Connections Account. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], features: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FinancialConnections\Account + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function refresh($id, $params = null, $opts = null) { @@ -79,12 +80,12 @@ class AccountService extends \Stripe\Service\AbstractService * Retrieves the details of an Financial Connections Account. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FinancialConnections\Account + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -96,12 +97,12 @@ class AccountService extends \Stripe\Service\AbstractService * Account. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], features: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FinancialConnections\Account + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function subscribe($id, $params = null, $opts = null) { @@ -113,12 +114,12 @@ class AccountService extends \Stripe\Service\AbstractService * Connections Account. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], features: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FinancialConnections\Account + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function unsubscribe($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/FinancialConnections/SessionService.php b/plugins/stripe-php/lib/Service/FinancialConnections/SessionService.php index 2ba8c3ae..8385ee3e 100644 --- a/plugins/stripe-php/lib/Service/FinancialConnections/SessionService.php +++ b/plugins/stripe-php/lib/Service/FinancialConnections/SessionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\FinancialConnections; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class SessionService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class SessionService extends \Stripe\Service\AbstractService * Session. The session’s client_secret can be used to * launch the flow using Stripe.js. * - * @param null|array $params + * @param null|array{account_holder: array{account?: string, customer?: string, type: string}, expand?: string[], filters?: array{account_subcategories?: string[], countries?: string[]}, permissions: string[], prefetch?: string[], return_url?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FinancialConnections\Session + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -31,12 +32,12 @@ class SessionService extends \Stripe\Service\AbstractService * Retrieves the details of a Financial Connections Session. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FinancialConnections\Session + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/FinancialConnections/TransactionService.php b/plugins/stripe-php/lib/Service/FinancialConnections/TransactionService.php index 9204b6a3..e26d7536 100644 --- a/plugins/stripe-php/lib/Service/FinancialConnections/TransactionService.php +++ b/plugins/stripe-php/lib/Service/FinancialConnections/TransactionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\FinancialConnections; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class TransactionService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class TransactionService extends \Stripe\Service\AbstractService /** * Returns a list of Financial Connections Transaction objects. * - * @param null|array $params + * @param null|array{account: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, transacted_at?: array|int, transaction_refresh?: array{after: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\FinancialConnections\Transaction> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class TransactionService extends \Stripe\Service\AbstractService * Retrieves the details of a Financial Connections Transaction. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\FinancialConnections\Transaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Forwarding/RequestService.php b/plugins/stripe-php/lib/Service/Forwarding/RequestService.php index c81a8c52..9710a2a3 100644 --- a/plugins/stripe-php/lib/Service/Forwarding/RequestService.php +++ b/plugins/stripe-php/lib/Service/Forwarding/RequestService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Forwarding; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class RequestService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class RequestService extends \Stripe\Service\AbstractService /** * Lists all ForwardingRequest objects. * - * @param null|array $params + * @param null|array{created?: array{gt?: int, gte?: int, lt?: int, lte?: int}, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Forwarding\Request> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class RequestService extends \Stripe\Service\AbstractService /** * Creates a ForwardingRequest object. * - * @param null|array $params + * @param null|array{expand?: string[], metadata?: array, payment_method: string, replacements: string[], request: array{body?: string, headers?: array{name: string, value: string}[]}, url: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Forwarding\Request + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -44,12 +45,12 @@ class RequestService extends \Stripe\Service\AbstractService * Retrieves a ForwardingRequest object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Forwarding\Request + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Identity/VerificationReportService.php b/plugins/stripe-php/lib/Service/Identity/VerificationReportService.php index 669a4c98..ec83206a 100644 --- a/plugins/stripe-php/lib/Service/Identity/VerificationReportService.php +++ b/plugins/stripe-php/lib/Service/Identity/VerificationReportService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Identity; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class VerificationReportService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class VerificationReportService extends \Stripe\Service\AbstractService /** * List all verification reports. * - * @param null|array $params + * @param null|array{client_reference_id?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string, verification_session?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Identity\VerificationReport> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class VerificationReportService extends \Stripe\Service\AbstractService * Retrieves an existing VerificationReport. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Identity\VerificationReport + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Identity/VerificationSessionService.php b/plugins/stripe-php/lib/Service/Identity/VerificationSessionService.php index b1c0c3c2..b6fae8c2 100644 --- a/plugins/stripe-php/lib/Service/Identity/VerificationSessionService.php +++ b/plugins/stripe-php/lib/Service/Identity/VerificationSessionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Identity; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class VerificationSessionService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class VerificationSessionService extends \Stripe\Service\AbstractService /** * Returns a list of VerificationSessions. * - * @param null|array $params + * @param null|array{client_reference_id?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, related_customer?: string, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Identity\VerificationSession> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -34,12 +35,12 @@ class VerificationSessionService extends \Stripe\Service\AbstractService * Learn more. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Identity\VerificationSession + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -59,12 +60,12 @@ class VerificationSessionService extends \Stripe\Service\AbstractService * Related guide: Verify your * users’ identity documents * - * @param null|array $params + * @param null|array{client_reference_id?: string, expand?: string[], metadata?: array, options?: array{document?: null|array{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}}, provided_details?: array{email?: string, phone?: string}, related_customer?: string, return_url?: string, type?: string, verification_flow?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Identity\VerificationSession + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -97,12 +98,12 @@ class VerificationSessionService extends \Stripe\Service\AbstractService * Learn more. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Identity\VerificationSession + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function redact($id, $params = null, $opts = null) { @@ -117,12 +118,12 @@ class VerificationSessionService extends \Stripe\Service\AbstractService * re-submission. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Identity\VerificationSession + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -136,12 +137,12 @@ class VerificationSessionService extends \Stripe\Service\AbstractService * to update the verification check and options. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], metadata?: array, options?: array{document?: null|array{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}}, provided_details?: array{email?: string, phone?: string}, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Identity\VerificationSession + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/InvoiceItemService.php b/plugins/stripe-php/lib/Service/InvoiceItemService.php index 642e374b..533f2c7b 100644 --- a/plugins/stripe-php/lib/Service/InvoiceItemService.php +++ b/plugins/stripe-php/lib/Service/InvoiceItemService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class InvoiceItemService extends \Stripe\Service\AbstractService +class InvoiceItemService extends AbstractService { /** * Returns a list of your invoice items. Invoice items are returned sorted by * creation date, with the most recently created invoice items appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], invoice?: string, limit?: int, pending?: bool, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\InvoiceItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -31,12 +32,12 @@ class InvoiceItemService extends \Stripe\Service\AbstractService * no invoice is specified, the item will be on the next invoice created for the * customer specified. * - * @param null|array $params + * @param null|array{amount?: int, currency?: string, customer: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice?: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, subscription?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: string[], unit_amount_decimal?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\InvoiceItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -52,9 +53,9 @@ class InvoiceItemService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\InvoiceItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -65,12 +66,12 @@ class InvoiceItemService extends \Stripe\Service\AbstractService * Retrieves the invoice item with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\InvoiceItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -83,12 +84,12 @@ class InvoiceItemService extends \Stripe\Service\AbstractService * closed. * * @param string $id - * @param null|array $params + * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount_decimal?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\InvoiceItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/InvoicePaymentService.php b/plugins/stripe-php/lib/Service/InvoicePaymentService.php new file mode 100644 index 00000000..9d93bf2b --- /dev/null +++ b/plugins/stripe-php/lib/Service/InvoicePaymentService.php @@ -0,0 +1,46 @@ + + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/invoice_payments', $params, $opts); + } + + /** + * Retrieves the invoice payment with the given ID. + * + * @param string $id + * @param null|array{expand?: string[]} $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @return \Stripe\InvoicePayment + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/invoice_payments/%s', $id), $params, $opts); + } +} diff --git a/plugins/stripe-php/lib/Service/InvoiceRenderingTemplateService.php b/plugins/stripe-php/lib/Service/InvoiceRenderingTemplateService.php index 90d8f23a..feb07d3b 100644 --- a/plugins/stripe-php/lib/Service/InvoiceRenderingTemplateService.php +++ b/plugins/stripe-php/lib/Service/InvoiceRenderingTemplateService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class InvoiceRenderingTemplateService extends \Stripe\Service\AbstractService +class InvoiceRenderingTemplateService extends AbstractService { /** * List all templates, ordered by creation date, with the most recently created * template appearing first. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\InvoiceRenderingTemplate> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -33,12 +34,12 @@ class InvoiceRenderingTemplateService extends \Stripe\Service\AbstractService * object, it will continue to be applied on invoices generated by it. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\InvoiceRenderingTemplate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function archive($id, $params = null, $opts = null) { @@ -51,12 +52,12 @@ class InvoiceRenderingTemplateService extends \Stripe\Service\AbstractService * previous versions. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], version?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\InvoiceRenderingTemplate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -68,12 +69,12 @@ class InvoiceRenderingTemplateService extends \Stripe\Service\AbstractService * again. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\InvoiceRenderingTemplate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function unarchive($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/InvoiceService.php b/plugins/stripe-php/lib/Service/InvoiceService.php index a5cbd222..4693e98f 100644 --- a/plugins/stripe-php/lib/Service/InvoiceService.php +++ b/plugins/stripe-php/lib/Service/InvoiceService.php @@ -6,21 +6,22 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class InvoiceService extends \Stripe\Service\AbstractService +class InvoiceService extends AbstractService { /** * Adds multiple line items to an invoice. This is only possible when an invoice is * still a draft. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], invoice_metadata?: null|array, lines: (array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], invoice_item?: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]})[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function addLines($id, $params = null, $opts = null) { @@ -32,12 +33,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * invoices are returned sorted by creation date, with the most recently created * invoices appearing first. * - * @param null|array $params + * @param null|array{collection_method?: string, created?: array|int, customer?: string, due_date?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, subscription?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Invoice> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -51,12 +52,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * items. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\InvoiceLineItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allLines($parentId, $params = null, $opts = null) { @@ -69,12 +70,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * allows you to pay or send * the invoice to your customers. * - * @param null|array $params + * @param null|array{account_tax_ids?: null|string[], application_fee_amount?: int, auto_advance?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, automatically_finalizes_at?: int, collection_method?: string, currency?: string, custom_fields?: null|array{name: string, value: string}[], customer?: string, days_until_due?: int, default_payment_method?: string, default_source?: string, default_tax_rates?: string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], due_date?: int, effective_at?: int, expand?: string[], footer?: string, from_invoice?: array{action: string, invoice: string}, issuer?: array{account?: string, type: string}, metadata?: null|array, number?: string, on_behalf_of?: string, payment_settings?: array{default_mandate?: null|string, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[]}, pending_invoice_items_behavior?: string, rendering?: array{amount_tax_display?: null|string, pdf?: array{page_size?: string}, template?: string, template_version?: null|int}, shipping_cost?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}, shipping_details?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}, statement_descriptor?: string, subscription?: string, transfer_data?: array{amount?: int, destination: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -82,10 +83,10 @@ class InvoiceService extends \Stripe\Service\AbstractService } /** - * At any time, you can preview the upcoming invoice for a customer. This will show - * you all the charges that are pending, including subscription renewal charges, - * invoice item charges, etc. It will also show you any discounts that are - * applicable to the invoice. + * At any time, you can preview the upcoming invoice for a subscription or + * subscription schedule. This will show you all the charges that are pending, + * including subscription renewal charges, invoice item charges, etc. It will also + * show you any discounts that are applicable to the invoice. * * Note that when you are viewing an upcoming invoice, you are simply viewing a * preview – the invoice has not yet been created. As such, the upcoming invoice @@ -108,12 +109,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * invoice creation. Learn * more * - * @param null|array $params + * @param null|array{automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, currency?: string, customer?: string, customer_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: string}, tax?: array{ip_address?: null|string}, tax_exempt?: null|string, tax_ids?: array{type: string, value: string}[]}, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice_items?: (array{amount?: int, currency?: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], invoiceitem?: string, metadata?: null|array, period?: array{end: int, start: int}, price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount?: int, unit_amount_decimal?: string})[], issuer?: array{account?: string, type: string}, on_behalf_of?: null|string, preview_mode?: string, schedule?: string, schedule_details?: array{end_behavior?: string, phases?: (array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, collection_method?: string, currency?: string, default_payment_method?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], end_date?: array|int|string, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, items: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], iterations?: int, metadata?: array, on_behalf_of?: string, proration_behavior?: string, start_date?: array|int|string, transfer_data?: array{amount_percent?: float, destination: string}, trial?: bool, trial_end?: array|int|string})[], proration_behavior?: string}, subscription?: string, subscription_details?: array{billing_cycle_anchor?: array|int|string, cancel_at?: null|int, cancel_at_period_end?: bool, cancel_now?: bool, default_tax_rates?: null|string[], items?: (array{clear_usage?: bool, deleted?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id?: string, metadata?: null|array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], proration_behavior?: string, proration_date?: int, resume_at?: string, start_date?: int, trial_end?: array|int|string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createPreview($params = null, $opts = null) { @@ -130,9 +131,9 @@ class InvoiceService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -145,12 +146,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * do so using this method. * * @param string $id - * @param null|array $params + * @param null|array{auto_advance?: bool, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function finalizeInvoice($id, $params = null, $opts = null) { @@ -162,12 +163,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * that can be written off for accounting purposes. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function markUncollectible($id, $params = null, $opts = null) { @@ -182,12 +183,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * normal collection schedule or for some other reason, you can do so. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], forgive?: bool, mandate?: null|string, off_session?: bool, paid_out_of_band?: bool, payment_method?: string, source?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function pay($id, $params = null, $opts = null) { @@ -199,12 +200,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * invoice is still a draft. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], invoice_metadata?: null|array, lines: array{behavior: string, id: string}[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function removeLines($id, $params = null, $opts = null) { @@ -215,12 +216,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * Retrieves the invoice with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -235,12 +236,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * Occasionally, propagation of new or updated data can be up to an hour behind * during outages. Search functionality is not available to merchants in India. * - * @param null|array $params + * @param null|array{expand?: string[], limit?: int, page?: string, query: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SearchResult<\Stripe\Invoice> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function search($params = null, $opts = null) { @@ -258,75 +259,18 @@ class InvoiceService extends \Stripe\Service\AbstractService * invoice.sent event. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function sendInvoice($id, $params = null, $opts = null) { return $this->request('post', $this->buildPath('/v1/invoices/%s/send', $id), $params, $opts); } - /** - * At any time, you can preview the upcoming invoice for a customer. This will show - * you all the charges that are pending, including subscription renewal charges, - * invoice item charges, etc. It will also show you any discounts that are - * applicable to the invoice. - * - * Note that when you are viewing an upcoming invoice, you are simply viewing a - * preview – the invoice has not yet been created. As such, the upcoming invoice - * will not show up in invoice listing calls, and you cannot use the API to pay or - * edit the invoice. If you want to change the amount that your customer will be - * billed, you can add, remove, or update pending invoice items, or update the - * customer’s discount. - * - * You can preview the effects of updating a subscription, including a preview of - * what proration will take place. To ensure that the actual proration is - * calculated exactly the same as the previewed proration, you should pass the - * subscription_details.proration_date parameter when doing the actual - * subscription update. The recommended way to get only the prorations being - * previewed is to consider only proration line items where - * period[start] is equal to the - * subscription_details.proration_date value passed in the request. - * - * Note: Currency conversion calculations use the latest exchange rates. Exchange - * rates may vary between the time of the preview and the time of the actual - * invoice creation. Learn - * more - * - * @param null|array $params - * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function upcoming($params = null, $opts = null) - { - return $this->request('get', '/v1/invoices/upcoming', $params, $opts); - } - - /** - * When retrieving an upcoming invoice, you’ll get a lines - * property containing the total count of line items and the first handful of those - * items. There is also a URL where you can retrieve the full (paginated) list of - * line items. - * - * @param null|array $params - * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\InvoiceLineItem> - */ - public function upcomingLines($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/invoices/upcoming/lines', $params, $opts); - } - /** * Draft invoices are fully editable. Once an invoice is finalized, monetary values, @@ -338,12 +282,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * invoices, pass auto_advance=false. * * @param string $id - * @param null|array $params + * @param null|array{account_tax_ids?: null|string[], application_fee_amount?: int, auto_advance?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, automatically_finalizes_at?: int, collection_method?: string, custom_fields?: null|array{name: string, value: string}[], days_until_due?: int, default_payment_method?: string, default_source?: null|string, default_tax_rates?: null|string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], due_date?: int, effective_at?: null|int, expand?: string[], footer?: string, issuer?: array{account?: string, type: string}, metadata?: null|array, number?: null|string, on_behalf_of?: null|string, payment_settings?: array{default_mandate?: null|string, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[]}, rendering?: array{amount_tax_display?: null|string, pdf?: array{page_size?: string}, template?: string, template_version?: null|int}, shipping_cost?: null|array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}, shipping_details?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}, statement_descriptor?: string, transfer_data?: null|array{amount?: int, destination: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -360,12 +304,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\InvoiceLineItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateLine($parentId, $id, $params = null, $opts = null) { @@ -377,12 +321,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * is still a draft. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], invoice_metadata?: null|array, lines: (array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]})[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateLines($id, $params = null, $opts = null) { @@ -402,12 +346,12 @@ class InvoiceService extends \Stripe\Service\AbstractService * consult with your legal counsel for advice specific to your business. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Invoice + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function voidInvoice($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Issuing/AuthorizationService.php b/plugins/stripe-php/lib/Service/Issuing/AuthorizationService.php index a743ead7..b7221383 100644 --- a/plugins/stripe-php/lib/Service/Issuing/AuthorizationService.php +++ b/plugins/stripe-php/lib/Service/Issuing/AuthorizationService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class AuthorizationService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * sorted in descending order by creation date, with the most recently created * object appearing first. * - * @param null|array $params + * @param null|array{card?: string, cardholder?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Issuing\Authorization> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -38,12 +39,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * @deprecated this method is deprecated, please refer to the description for details * * @param string $id - * @param null|array $params + * @param null|array{amount?: int, expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function approve($id, $params = null, $opts = null) { @@ -61,12 +62,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * @deprecated this method is deprecated, please refer to the description for details * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function decline($id, $params = null, $opts = null) { @@ -77,12 +78,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * Retrieves an Issuing Authorization object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -95,12 +96,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * unchanged. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Issuing/CardService.php b/plugins/stripe-php/lib/Service/Issuing/CardService.php index 27844d09..2197510b 100644 --- a/plugins/stripe-php/lib/Service/Issuing/CardService.php +++ b/plugins/stripe-php/lib/Service/Issuing/CardService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class CardService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class CardService extends \Stripe\Service\AbstractService * descending order by creation date, with the most recently created object * appearing first. * - * @param null|array $params + * @param null|array{cardholder?: string, created?: array|int, ending_before?: string, exp_month?: int, exp_year?: int, expand?: string[], last4?: string, limit?: int, personalization_design?: string, starting_after?: string, status?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Issuing\Card> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class CardService extends \Stripe\Service\AbstractService /** * Creates an Issuing Card object. * - * @param null|array $params + * @param null|array{cardholder?: string, currency: string, expand?: string[], financial_account?: string, metadata?: array, personalization_design?: string, pin?: array{encrypted_number?: string}, replacement_for?: string, replacement_reason?: string, second_line?: null|string, shipping?: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}, address_validation?: array{mode: string}, customs?: array{eori_number?: string}, name: string, phone_number?: string, require_signature?: bool, service?: string, type?: string}, spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[]}, status?: string, type: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -46,12 +47,12 @@ class CardService extends \Stripe\Service\AbstractService * Retrieves an Issuing Card object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -63,12 +64,12 @@ class CardService extends \Stripe\Service\AbstractService * the parameters passed. Any parameters not provided will be left unchanged. * * @param string $id - * @param null|array $params + * @param null|array{cancellation_reason?: string, expand?: string[], metadata?: null|array, personalization_design?: string, pin?: array{encrypted_number?: string}, shipping?: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}, address_validation?: array{mode: string}, customs?: array{eori_number?: string}, name: string, phone_number?: string, require_signature?: bool, service?: string, type?: string}, spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[]}, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Issuing/CardholderService.php b/plugins/stripe-php/lib/Service/Issuing/CardholderService.php index abc3a887..2b9a0a0e 100644 --- a/plugins/stripe-php/lib/Service/Issuing/CardholderService.php +++ b/plugins/stripe-php/lib/Service/Issuing/CardholderService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class CardholderService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class CardholderService extends \Stripe\Service\AbstractService * sorted in descending order by creation date, with the most recently created * object appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, email?: string, ending_before?: string, expand?: string[], limit?: int, phone_number?: string, starting_after?: string, status?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Issuing\Cardholder> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class CardholderService extends \Stripe\Service\AbstractService /** * Creates a new Issuing Cardholder object that can be issued cards. * - * @param null|array $params + * @param null|array{billing: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}}, company?: array{tax_id?: string}, email?: string, expand?: string[], individual?: array{card_issuing?: array{user_terms_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, dob?: array{day: int, month: int, year: int}, first_name?: string, last_name?: string, verification?: array{document?: array{back?: string, front?: string}}}, metadata?: array, name: string, phone_number?: string, preferred_locales?: string[], spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[], spending_limits_currency?: string}, status?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Cardholder + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -46,12 +47,12 @@ class CardholderService extends \Stripe\Service\AbstractService * Retrieves an Issuing Cardholder object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Cardholder + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -64,12 +65,12 @@ class CardholderService extends \Stripe\Service\AbstractService * unchanged. * * @param string $id - * @param null|array $params + * @param null|array{billing?: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}}, company?: array{tax_id?: string}, email?: string, expand?: string[], individual?: array{card_issuing?: array{user_terms_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, dob?: array{day: int, month: int, year: int}, first_name?: string, last_name?: string, verification?: array{document?: array{back?: string, front?: string}}}, metadata?: array, phone_number?: string, preferred_locales?: string[], spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[], spending_limits_currency?: string}, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Cardholder + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Issuing/DisputeService.php b/plugins/stripe-php/lib/Service/Issuing/DisputeService.php index 19f4da43..df6b28f2 100644 --- a/plugins/stripe-php/lib/Service/Issuing/DisputeService.php +++ b/plugins/stripe-php/lib/Service/Issuing/DisputeService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class DisputeService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class DisputeService extends \Stripe\Service\AbstractService * in descending order by creation date, with the most recently created object * appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, transaction?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Issuing\Dispute> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -34,12 +35,12 @@ class DisputeService extends \Stripe\Service\AbstractService * href="/docs/issuing/purchases/disputes#dispute-reasons-and-evidence">Dispute * reasons and evidence for more details about evidence requirements. * - * @param null|array $params + * @param null|array{amount?: int, evidence?: array{canceled?: null|array{additional_documentation?: null|string, canceled_at?: null|int, cancellation_policy_provided?: null|bool, cancellation_reason?: null|string, expected_at?: null|int, explanation?: null|string, product_description?: null|string, product_type?: null|string, return_status?: null|string, returned_at?: null|int}, duplicate?: null|array{additional_documentation?: null|string, card_statement?: null|string, cash_receipt?: null|string, check_image?: null|string, explanation?: null|string, original_transaction?: string}, fraudulent?: null|array{additional_documentation?: null|string, explanation?: null|string}, merchandise_not_as_described?: null|array{additional_documentation?: null|string, explanation?: null|string, received_at?: null|int, return_description?: null|string, return_status?: null|string, returned_at?: null|int}, no_valid_authorization?: null|array{additional_documentation?: null|string, explanation?: null|string}, not_received?: null|array{additional_documentation?: null|string, expected_at?: null|int, explanation?: null|string, product_description?: null|string, product_type?: null|string}, other?: null|array{additional_documentation?: null|string, explanation?: null|string, product_description?: null|string, product_type?: null|string}, reason?: string, service_not_as_described?: null|array{additional_documentation?: null|string, canceled_at?: null|int, cancellation_reason?: null|string, explanation?: null|string, received_at?: null|int}}, expand?: string[], metadata?: array, transaction?: string, treasury?: array{received_debit: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Dispute + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -50,12 +51,12 @@ class DisputeService extends \Stripe\Service\AbstractService * Retrieves an Issuing Dispute object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Dispute + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -70,12 +71,12 @@ class DisputeService extends \Stripe\Service\AbstractService * reasons and evidence. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Dispute + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function submit($id, $params = null, $opts = null) { @@ -89,12 +90,12 @@ class DisputeService extends \Stripe\Service\AbstractService * empty string. * * @param string $id - * @param null|array $params + * @param null|array{amount?: int, evidence?: array{canceled?: null|array{additional_documentation?: null|string, canceled_at?: null|int, cancellation_policy_provided?: null|bool, cancellation_reason?: null|string, expected_at?: null|int, explanation?: null|string, product_description?: null|string, product_type?: null|string, return_status?: null|string, returned_at?: null|int}, duplicate?: null|array{additional_documentation?: null|string, card_statement?: null|string, cash_receipt?: null|string, check_image?: null|string, explanation?: null|string, original_transaction?: string}, fraudulent?: null|array{additional_documentation?: null|string, explanation?: null|string}, merchandise_not_as_described?: null|array{additional_documentation?: null|string, explanation?: null|string, received_at?: null|int, return_description?: null|string, return_status?: null|string, returned_at?: null|int}, no_valid_authorization?: null|array{additional_documentation?: null|string, explanation?: null|string}, not_received?: null|array{additional_documentation?: null|string, expected_at?: null|int, explanation?: null|string, product_description?: null|string, product_type?: null|string}, other?: null|array{additional_documentation?: null|string, explanation?: null|string, product_description?: null|string, product_type?: null|string}, reason?: string, service_not_as_described?: null|array{additional_documentation?: null|string, canceled_at?: null|int, cancellation_reason?: null|string, explanation?: null|string, received_at?: null|int}}, expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Dispute + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Issuing/PersonalizationDesignService.php b/plugins/stripe-php/lib/Service/Issuing/PersonalizationDesignService.php index 0a54d9e4..8d4fef1a 100644 --- a/plugins/stripe-php/lib/Service/Issuing/PersonalizationDesignService.php +++ b/plugins/stripe-php/lib/Service/Issuing/PersonalizationDesignService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class PersonalizationDesignService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class PersonalizationDesignService extends \Stripe\Service\AbstractService * descending order by creation date, with the most recently created object * appearing first. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, lookup_keys?: string[], preferences?: array{is_default?: bool, is_platform_default?: bool}, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Issuing\PersonalizationDesign> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class PersonalizationDesignService extends \Stripe\Service\AbstractService /** * Creates a personalization design object. * - * @param null|array $params + * @param null|array{card_logo?: string, carrier_text?: array{footer_body?: null|string, footer_title?: null|string, header_body?: null|string, header_title?: null|string}, expand?: string[], lookup_key?: string, metadata?: array, name?: string, physical_bundle: string, preferences?: array{is_default: bool}, transfer_lookup_key?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\PersonalizationDesign + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -46,12 +47,12 @@ class PersonalizationDesignService extends \Stripe\Service\AbstractService * Retrieves a personalization design object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\PersonalizationDesign + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -62,12 +63,12 @@ class PersonalizationDesignService extends \Stripe\Service\AbstractService * Updates a card personalization object. * * @param string $id - * @param null|array $params + * @param null|array{card_logo?: null|string, carrier_text?: null|array{footer_body?: null|string, footer_title?: null|string, header_body?: null|string, header_title?: null|string}, expand?: string[], lookup_key?: null|string, metadata?: array, name?: null|string, physical_bundle?: string, preferences?: array{is_default: bool}, transfer_lookup_key?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\PersonalizationDesign + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Issuing/PhysicalBundleService.php b/plugins/stripe-php/lib/Service/Issuing/PhysicalBundleService.php index 620266fe..4fc906c0 100644 --- a/plugins/stripe-php/lib/Service/Issuing/PhysicalBundleService.php +++ b/plugins/stripe-php/lib/Service/Issuing/PhysicalBundleService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class PhysicalBundleService extends \Stripe\Service\AbstractService @@ -14,12 +15,12 @@ class PhysicalBundleService extends \Stripe\Service\AbstractService * Returns a list of physical bundle objects. The objects are sorted in descending * order by creation date, with the most recently created object appearing first. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Issuing\PhysicalBundle> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class PhysicalBundleService extends \Stripe\Service\AbstractService * Retrieves a physical bundle object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\PhysicalBundle + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Issuing/TokenService.php b/plugins/stripe-php/lib/Service/Issuing/TokenService.php index f1314c8b..42c5aa78 100644 --- a/plugins/stripe-php/lib/Service/Issuing/TokenService.php +++ b/plugins/stripe-php/lib/Service/Issuing/TokenService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class TokenService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class TokenService extends \Stripe\Service\AbstractService /** * Lists all Issuing Token objects for a given card. * - * @param null|array $params + * @param null|array{card: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Issuing\Token> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class TokenService extends \Stripe\Service\AbstractService * Retrieves an Issuing Token object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Token + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -46,12 +47,12 @@ class TokenService extends \Stripe\Service\AbstractService * specified. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], status: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Token + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Issuing/TransactionService.php b/plugins/stripe-php/lib/Service/Issuing/TransactionService.php index 063295e9..f037c669 100644 --- a/plugins/stripe-php/lib/Service/Issuing/TransactionService.php +++ b/plugins/stripe-php/lib/Service/Issuing/TransactionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class TransactionService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class TransactionService extends \Stripe\Service\AbstractService * sorted in descending order by creation date, with the most recently created * object appearing first. * - * @param null|array $params + * @param null|array{card?: string, cardholder?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Issuing\Transaction> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -31,12 +32,12 @@ class TransactionService extends \Stripe\Service\AbstractService * Retrieves an Issuing Transaction object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Transaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -49,12 +50,12 @@ class TransactionService extends \Stripe\Service\AbstractService * unchanged. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Transaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/MandateService.php b/plugins/stripe-php/lib/Service/MandateService.php index 7d10f322..29f9bb1a 100644 --- a/plugins/stripe-php/lib/Service/MandateService.php +++ b/plugins/stripe-php/lib/Service/MandateService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class MandateService extends \Stripe\Service\AbstractService +class MandateService extends AbstractService { /** * Retrieves a Mandate object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Mandate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/OAuthService.php b/plugins/stripe-php/lib/Service/OAuthService.php index 3870cccd..7c43b962 100644 --- a/plugins/stripe-php/lib/Service/OAuthService.php +++ b/plugins/stripe-php/lib/Service/OAuthService.php @@ -2,7 +2,7 @@ namespace Stripe\Service; -class OAuthService extends \Stripe\Service\AbstractService +class OAuthService extends AbstractService { /** * Sends a request to Stripe's Connect API. @@ -53,9 +53,9 @@ class OAuthService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|array $opts * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * * @return \Stripe\StripeObject object containing the response from the API + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails */ public function token($params = null, $opts = null) { @@ -71,9 +71,9 @@ class OAuthService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|array $opts * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * * @return \Stripe\StripeObject object containing the response from the API + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails */ public function deauthorize($params = null, $opts = null) { @@ -118,9 +118,9 @@ class OAuthService extends \Stripe\Service\AbstractService /** * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request * - * @throws \Stripe\Exception\InvalidArgumentException - * * @return \Stripe\Util\RequestOptions + * + * @throws \Stripe\Exception\InvalidArgumentException */ private function _parseOpts($opts) { @@ -143,8 +143,8 @@ class OAuthService extends \Stripe\Service\AbstractService */ private function _getBase($opts) { - return isset($opts->apiBase) ? - $opts->apiBase : - $this->client->getConnectBase(); + return isset($opts->apiBase) + ? $opts->apiBase + : $this->client->getConnectBase(); } } diff --git a/plugins/stripe-php/lib/Service/PaymentIntentService.php b/plugins/stripe-php/lib/Service/PaymentIntentService.php index 58b54bd3..9f6da916 100644 --- a/plugins/stripe-php/lib/Service/PaymentIntentService.php +++ b/plugins/stripe-php/lib/Service/PaymentIntentService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class PaymentIntentService extends \Stripe\Service\AbstractService +class PaymentIntentService extends AbstractService { /** * Returns a list of PaymentIntents. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\PaymentIntent> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * PaymentIntent. * * @param string $id - * @param null|array $params + * @param null|array{amount?: int, currency?: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function applyCustomerBalance($id, $params = null, $opts = null) { @@ -58,12 +59,12 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * instead. * * @param string $id - * @param null|array $params + * @param null|array{cancellation_reason?: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -81,12 +82,12 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * and capture. * * @param string $id - * @param null|array $params + * @param null|array{amount_to_capture?: int, application_fee_amount?: int, expand?: string[], final_capture?: bool, metadata?: null|array, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function capture($id, $params = null, $opts = null) { @@ -121,12 +122,12 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * state. * * @param string $id - * @param null|array $params + * @param null|array{capture_method?: string, confirmation_token?: string, error_on_requires_action?: bool, expand?: string[], mandate?: string, mandate_data?: null|array{customer_acceptance?: array{accepted_at?: int, offline?: array{}, online?: array{ip_address?: string, user_agent?: string}, type: string}}, off_session?: array|bool|string, payment_method?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, pix?: null|array{expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, preferred_settlement_speed?: null|string, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], radar_options?: array{session?: string}, receipt_email?: null|string, return_url?: string, setup_future_usage?: null|string, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, use_stripe_sdk?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function confirm($id, $params = null, $opts = null) { @@ -146,12 +147,12 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * parameters available in the confirm * API when you supply confirm=true. * - * @param null|array $params + * @param null|array{amount: int, application_fee_amount?: int, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, capture_method?: string, confirm?: bool, confirmation_method?: string, confirmation_token?: string, currency: string, customer?: string, description?: string, error_on_requires_action?: bool, expand?: string[], mandate?: string, mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, off_session?: array|bool|string, on_behalf_of?: string, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, pix?: null|array{expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, preferred_settlement_speed?: null|string, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], radar_options?: array{session?: string}, receipt_email?: string, return_url?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string, use_stripe_sdk?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -188,12 +189,12 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * authorizations. * * @param string $id - * @param null|array $params + * @param null|array{amount: int, application_fee_amount?: int, description?: string, expand?: string[], metadata?: array, statement_descriptor?: string, transfer_data?: array{amount?: int}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function incrementAuthorization($id, $params = null, $opts = null) { @@ -211,12 +212,12 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * object reference for more details. * * @param string $id - * @param null|array $params + * @param null|array{client_secret?: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -231,12 +232,12 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * Occasionally, propagation of new or updated data can be up to an hour behind * during outages. Search functionality is not available to merchants in India. * - * @param null|array $params + * @param null|array{expand?: string[], limit?: int, page?: string, query: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SearchResult<\Stripe\PaymentIntent> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function search($params = null, $opts = null) { @@ -253,12 +254,12 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * href="/docs/api/payment_intents/confirm">confirm API instead. * * @param string $id - * @param null|array $params + * @param null|array{amount?: int, application_fee_amount?: null|int, capture_method?: string, currency?: string, customer?: string, description?: string, expand?: string[], metadata?: null|array, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, pix?: null|array{expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, preferred_settlement_speed?: null|string, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], receipt_email?: null|string, setup_future_usage?: null|string, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int}, transfer_group?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -269,12 +270,12 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * Verifies microdeposits on a PaymentIntent object. * * @param string $id - * @param null|array $params + * @param null|array{amounts?: int[], descriptor_code?: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function verifyMicrodeposits($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/PaymentLinkService.php b/plugins/stripe-php/lib/Service/PaymentLinkService.php index d6daa177..5f59d00f 100644 --- a/plugins/stripe-php/lib/Service/PaymentLinkService.php +++ b/plugins/stripe-php/lib/Service/PaymentLinkService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class PaymentLinkService extends \Stripe\Service\AbstractService +class PaymentLinkService extends AbstractService { /** * Returns a list of your payment links. * - * @param null|array $params + * @param null|array{active?: bool, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\PaymentLink> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -32,12 +33,12 @@ class PaymentLinkService extends \Stripe\Service\AbstractService * line items. * * @param string $id - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\LineItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allLineItems($id, $params = null, $opts = null) { @@ -47,12 +48,12 @@ class PaymentLinkService extends \Stripe\Service\AbstractService /** * Creates a payment link. * - * @param null|array $params + * @param null|array{after_completion?: array{hosted_confirmation?: array{custom_message?: string}, redirect?: array{url: string}, type: string}, allow_promotion_codes?: bool, application_fee_amount?: int, application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_address_collection?: string, consent_collection?: array{payment_method_reuse_agreement?: array{position: string}, promotions?: string, terms_of_service?: string}, currency?: string, custom_fields?: array{dropdown?: array{default_value?: string, options: array{label: string, value: string}[]}, key: string, label: array{custom: string, type: string}, numeric?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, optional?: bool, text?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, type: string}[], custom_text?: array{after_submit?: null|array{message: string}, shipping_address?: null|array{message: string}, submit?: null|array{message: string}, terms_of_service_acceptance?: null|array{message: string}}, customer_creation?: string, expand?: string[], inactive_message?: string, invoice_creation?: array{enabled: bool, invoice_data?: array{account_tax_ids?: null|string[], custom_fields?: null|array{name: string, value: string}[], description?: string, footer?: string, issuer?: array{account?: string, type: string}, metadata?: null|array, rendering_options?: null|array{amount_tax_display?: null|string}}}, line_items: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, price: string, quantity: int}[], metadata?: array, on_behalf_of?: string, optional_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, price: string, quantity: int}[], payment_intent_data?: array{capture_method?: string, description?: string, metadata?: array, setup_future_usage?: string, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_group?: string}, payment_method_collection?: string, payment_method_types?: string[], phone_number_collection?: array{enabled: bool}, restrictions?: array{completed_sessions: array{limit: int}}, shipping_address_collection?: array{allowed_countries: string[]}, shipping_options?: array{shipping_rate?: string}[], submit_type?: string, subscription_data?: array{description?: string, invoice_settings?: array{issuer?: array{account?: string, type: string}}, metadata?: array, trial_period_days?: int, trial_settings?: array{end_behavior: array{missing_payment_method: string}}}, tax_id_collection?: array{enabled: bool, required?: string}, transfer_data?: array{amount?: int, destination: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentLink + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -63,12 +64,12 @@ class PaymentLinkService extends \Stripe\Service\AbstractService * Retrieve a payment link. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentLink + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -79,12 +80,12 @@ class PaymentLinkService extends \Stripe\Service\AbstractService * Updates a payment link. * * @param string $id - * @param null|array $params + * @param null|array{active?: bool, after_completion?: array{hosted_confirmation?: array{custom_message?: string}, redirect?: array{url: string}, type: string}, allow_promotion_codes?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_address_collection?: string, custom_fields?: null|array{dropdown?: array{default_value?: string, options: array{label: string, value: string}[]}, key: string, label: array{custom: string, type: string}, numeric?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, optional?: bool, text?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, type: string}[], custom_text?: array{after_submit?: null|array{message: string}, shipping_address?: null|array{message: string}, submit?: null|array{message: string}, terms_of_service_acceptance?: null|array{message: string}}, customer_creation?: string, expand?: string[], inactive_message?: null|string, invoice_creation?: array{enabled: bool, invoice_data?: array{account_tax_ids?: null|string[], custom_fields?: null|array{name: string, value: string}[], description?: string, footer?: string, issuer?: array{account?: string, type: string}, metadata?: null|array, rendering_options?: null|array{amount_tax_display?: null|string}}}, line_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, id: string, quantity?: int}[], metadata?: array, payment_intent_data?: array{description?: null|string, metadata?: null|array, statement_descriptor?: null|string, statement_descriptor_suffix?: null|string, transfer_group?: null|string}, payment_method_collection?: string, payment_method_types?: null|string[], phone_number_collection?: array{enabled: bool}, restrictions?: null|array{completed_sessions: array{limit: int}}, shipping_address_collection?: null|array{allowed_countries: string[]}, submit_type?: string, subscription_data?: array{invoice_settings?: array{issuer?: array{account?: string, type: string}}, metadata?: null|array, trial_period_days?: null|int, trial_settings?: null|array{end_behavior: array{missing_payment_method: string}}}, tax_id_collection?: array{enabled: bool, required?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentLink + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/PaymentMethodConfigurationService.php b/plugins/stripe-php/lib/Service/PaymentMethodConfigurationService.php index 4bd7b965..91b9aa4b 100644 --- a/plugins/stripe-php/lib/Service/PaymentMethodConfigurationService.php +++ b/plugins/stripe-php/lib/Service/PaymentMethodConfigurationService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class PaymentMethodConfigurationService extends \Stripe\Service\AbstractService +class PaymentMethodConfigurationService extends AbstractService { /** * List payment method configurations. * - * @param null|array $params + * @param null|array{application?: null|string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\PaymentMethodConfiguration> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class PaymentMethodConfigurationService extends \Stripe\Service\AbstractService /** * Creates a payment method configuration. * - * @param null|array $params + * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, parent?: string, pay_by_bank?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethodConfiguration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -44,12 +45,12 @@ class PaymentMethodConfigurationService extends \Stripe\Service\AbstractService * Retrieve payment method configuration. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethodConfiguration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -60,12 +61,12 @@ class PaymentMethodConfigurationService extends \Stripe\Service\AbstractService * Update payment method configuration. * * @param string $id - * @param null|array $params + * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, active?: bool, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, pay_by_bank?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethodConfiguration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/PaymentMethodDomainService.php b/plugins/stripe-php/lib/Service/PaymentMethodDomainService.php index c6e7d084..55f907ee 100644 --- a/plugins/stripe-php/lib/Service/PaymentMethodDomainService.php +++ b/plugins/stripe-php/lib/Service/PaymentMethodDomainService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class PaymentMethodDomainService extends \Stripe\Service\AbstractService +class PaymentMethodDomainService extends AbstractService { /** * Lists the details of existing payment method domains. * - * @param null|array $params + * @param null|array{domain_name?: string, enabled?: bool, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\PaymentMethodDomain> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class PaymentMethodDomainService extends \Stripe\Service\AbstractService /** * Creates a payment method domain. * - * @param null|array $params + * @param null|array{domain_name: string, enabled?: bool, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethodDomain + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -44,12 +45,12 @@ class PaymentMethodDomainService extends \Stripe\Service\AbstractService * Retrieves the details of an existing payment method domain. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethodDomain + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -60,12 +61,12 @@ class PaymentMethodDomainService extends \Stripe\Service\AbstractService * Updates an existing payment method domain. * * @param string $id - * @param null|array $params + * @param null|array{enabled?: bool, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethodDomain + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -73,26 +74,26 @@ class PaymentMethodDomainService extends \Stripe\Service\AbstractService } /** - * Some payment methods such as Apple Pay require additional steps to verify a - * domain. If the requirements weren’t satisfied when the domain was created, the - * payment method will be inactive on the domain. The payment method doesn’t appear - * in Elements for this domain until it is active. + * Some payment methods might require additional steps to register a domain. If the + * requirements weren’t satisfied when the domain was created, the payment method + * will be inactive on the domain. The payment method doesn’t appear in Elements or + * Embedded Checkout for this domain until it is active. * * To activate a payment method on an existing payment method domain, complete the - * required validation steps specific to the payment method, and then validate the - * payment method domain with this endpoint. + * required registration steps specific to the payment method, and then validate + * the payment method domain with this endpoint. * * Related guides: Payment method * domains. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethodDomain + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function validate($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/PaymentMethodService.php b/plugins/stripe-php/lib/Service/PaymentMethodService.php index 054d03b6..387d9f43 100644 --- a/plugins/stripe-php/lib/Service/PaymentMethodService.php +++ b/plugins/stripe-php/lib/Service/PaymentMethodService.php @@ -6,9 +6,10 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class PaymentMethodService extends \Stripe\Service\AbstractService +class PaymentMethodService extends AbstractService { /** * Returns a list of PaymentMethods for Treasury flows. If you want to list the @@ -16,12 +17,12 @@ class PaymentMethodService extends \Stripe\Service\AbstractService * href="/docs/api/payment_methods/customer_list">List a Customer’s * PaymentMethods API instead. * - * @param null|array $params + * @param null|array{customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\PaymentMethod> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -49,12 +50,12 @@ class PaymentMethodService extends \Stripe\Service\AbstractService * on the Customer to the PaymentMethod’s ID. * * @param string $id - * @param null|array $params + * @param null|array{customer: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethod + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function attach($id, $params = null, $opts = null) { @@ -72,12 +73,12 @@ class PaymentMethodService extends \Stripe\Service\AbstractService * href="/docs/payments/save-and-reuse">SetupIntent API to collect payment * method details ahead of a future payment. * - * @param null|array $params + * @param null|array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, card?: array{cvc?: string, exp_month?: int, exp_year?: int, networks?: array{preferred?: string}, number?: string, token?: string}, cashapp?: array{}, customer?: string, customer_balance?: array{}, eps?: array{bank?: string}, expand?: string[], fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, payment_method?: string, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type?: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethod + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -89,12 +90,12 @@ class PaymentMethodService extends \Stripe\Service\AbstractService * detached, it can no longer be used for a payment or re-attached to a Customer. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethod + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function detach($id, $params = null, $opts = null) { @@ -108,12 +109,12 @@ class PaymentMethodService extends \Stripe\Service\AbstractService * PaymentMethods. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethod + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -125,12 +126,12 @@ class PaymentMethodService extends \Stripe\Service\AbstractService * be updated. * * @param string $id - * @param null|array $params + * @param null|array{allow_redisplay?: string, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, card?: array{exp_month?: int, exp_year?: int, networks?: array{preferred?: null|string}}, expand?: string[], link?: array{}, metadata?: null|array, pay_by_bank?: array{}, us_bank_account?: array{account_holder_type?: string, account_type?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PaymentMethod + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/PayoutService.php b/plugins/stripe-php/lib/Service/PayoutService.php index 3bd0eb29..15863a18 100644 --- a/plugins/stripe-php/lib/Service/PayoutService.php +++ b/plugins/stripe-php/lib/Service/PayoutService.php @@ -6,21 +6,22 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class PayoutService extends \Stripe\Service\AbstractService +class PayoutService extends AbstractService { /** * Returns a list of existing payouts sent to third-party bank accounts or payouts * that Stripe sent to you. The payouts return in sorted order, with the most * recently created payouts appearing first. * - * @param null|array $params + * @param null|array{arrival_date?: array|int, created?: array|int, destination?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Payout> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -33,12 +34,12 @@ class PayoutService extends \Stripe\Service\AbstractService * can’t cancel automatic Stripe payouts. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Payout + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -58,12 +59,12 @@ class PayoutService extends \Stripe\Service\AbstractService * from. The balance object details available and * pending amounts by source type. * - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, destination?: string, expand?: string[], metadata?: array, method?: string, source_type?: string, statement_descriptor?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Payout + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -76,12 +77,12 @@ class PayoutService extends \Stripe\Service\AbstractService * corresponding payout information. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Payout + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -99,12 +100,12 @@ class PayoutService extends \Stripe\Service\AbstractService * the debit on the bank account and that no other authorization is required. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], metadata?: array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Payout + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function reverse($id, $params = null, $opts = null) { @@ -117,12 +118,12 @@ class PayoutService extends \Stripe\Service\AbstractService * metadata as arguments. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Payout + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/PlanService.php b/plugins/stripe-php/lib/Service/PlanService.php index 1cea58ea..eb385cd9 100644 --- a/plugins/stripe-php/lib/Service/PlanService.php +++ b/plugins/stripe-php/lib/Service/PlanService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class PlanService extends \Stripe\Service\AbstractService +class PlanService extends AbstractService { /** * Returns a list of your plans. * - * @param null|array $params + * @param null|array{active?: bool, created?: array|int, ending_before?: string, expand?: string[], limit?: int, product?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Plan> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class PlanService extends \Stripe\Service\AbstractService * API. It replaces the Plans API and is backwards compatible to simplify your * migration. * - * @param null|array $params + * @param null|array{active?: bool, amount?: int, amount_decimal?: string, billing_scheme?: string, currency: string, expand?: string[], id?: string, interval: string, interval_count?: int, metadata?: null|array, meter?: string, nickname?: string, product?: array|string, tiers?: (array{flat_amount?: int, flat_amount_decimal?: string, unit_amount?: int, unit_amount_decimal?: string, up_to: array|int|string})[], tiers_mode?: string, transform_usage?: array{divide_by: int, round: string}, trial_period_days?: int, usage_type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Plan + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -50,9 +51,9 @@ class PlanService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Plan + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -63,12 +64,12 @@ class PlanService extends \Stripe\Service\AbstractService * Retrieves the plan with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Plan + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -81,12 +82,12 @@ class PlanService extends \Stripe\Service\AbstractService * plan’s ID, amount, currency, or billing cycle. * * @param string $id - * @param null|array $params + * @param null|array{active?: bool, expand?: string[], metadata?: null|array, nickname?: string, product?: string, trial_period_days?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Plan + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/PriceService.php b/plugins/stripe-php/lib/Service/PriceService.php index 7d164ba4..0071d601 100644 --- a/plugins/stripe-php/lib/Service/PriceService.php +++ b/plugins/stripe-php/lib/Service/PriceService.php @@ -6,21 +6,22 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class PriceService extends \Stripe\Service\AbstractService +class PriceService extends AbstractService { /** * Returns a list of your active prices, excluding inline prices. * For the list of inactive prices, set active to false. * - * @param null|array $params + * @param null|array{active?: bool, created?: array|int, currency?: string, ending_before?: string, expand?: string[], limit?: int, lookup_keys?: string[], product?: string, recurring?: array{interval?: string, meter?: string, usage_type?: string}, starting_after?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Price> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,15 +29,16 @@ class PriceService extends \Stripe\Service\AbstractService } /** - * Creates a new price for an existing product. The price can be recurring or - * one-time. + * Creates a new Price for an + * existing Product. The Price + * can be recurring or one-time. * - * @param null|array $params + * @param null|array{active?: bool, billing_scheme?: string, currency: string, currency_options?: array, custom_unit_amount?: array{enabled: bool, maximum?: int, minimum?: int, preset?: int}, expand?: string[], lookup_key?: string, metadata?: array, nickname?: string, product?: string, product_data?: array{active?: bool, id?: string, metadata?: array, name: string, statement_descriptor?: string, tax_code?: string, unit_label?: string}, recurring?: array{interval: string, interval_count?: int, meter?: string, trial_period_days?: int, usage_type?: string}, tax_behavior?: string, tiers?: (array{flat_amount?: int, flat_amount_decimal?: string, unit_amount?: int, unit_amount_decimal?: string, up_to: array|int|string})[], tiers_mode?: string, transfer_lookup_key?: bool, transform_quantity?: array{divide_by: int, round: string}, unit_amount?: int, unit_amount_decimal?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Price + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -47,12 +49,12 @@ class PriceService extends \Stripe\Service\AbstractService * Retrieves the price with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Price + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -67,12 +69,12 @@ class PriceService extends \Stripe\Service\AbstractService * Occasionally, propagation of new or updated data can be up to an hour behind * during outages. Search functionality is not available to merchants in India. * - * @param null|array $params + * @param null|array{expand?: string[], limit?: int, page?: string, query: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SearchResult<\Stripe\Price> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function search($params = null, $opts = null) { @@ -84,12 +86,12 @@ class PriceService extends \Stripe\Service\AbstractService * parameters not provided are left unchanged. * * @param string $id - * @param null|array $params + * @param null|array{active?: bool, currency_options?: null|array, expand?: string[], lookup_key?: string, metadata?: null|array, nickname?: string, tax_behavior?: string, transfer_lookup_key?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Price + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/ProductService.php b/plugins/stripe-php/lib/Service/ProductService.php index d3aee577..72db2281 100644 --- a/plugins/stripe-php/lib/Service/ProductService.php +++ b/plugins/stripe-php/lib/Service/ProductService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class ProductService extends \Stripe\Service\AbstractService +class ProductService extends AbstractService { /** * Returns a list of your products. The products are returned sorted by creation * date, with the most recently created products appearing first. * - * @param null|array $params + * @param null|array{active?: bool, created?: array|int, ending_before?: string, expand?: string[], ids?: string[], limit?: int, shippable?: bool, starting_after?: string, type?: string, url?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Product> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class ProductService extends \Stripe\Service\AbstractService * Retrieve a list of features for a product. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\ProductFeature> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allFeatures($parentId, $params = null, $opts = null) { @@ -45,12 +46,12 @@ class ProductService extends \Stripe\Service\AbstractService /** * Creates a new product object. * - * @param null|array $params + * @param null|array{active?: bool, default_price_data?: array{currency: string, currency_options?: array, custom_unit_amount?: array{enabled: bool, maximum?: int, minimum?: int, preset?: int}, metadata?: array, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, description?: string, expand?: string[], id?: string, images?: string[], marketing_features?: array{name: string}[], metadata?: array, name: string, package_dimensions?: array{height: float, length: float, weight: float, width: float}, shippable?: bool, statement_descriptor?: string, tax_code?: string, type?: string, unit_label?: string, url?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Product + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -61,12 +62,12 @@ class ProductService extends \Stripe\Service\AbstractService * Creates a product_feature, which represents a feature attachment to a product. * * @param string $parentId - * @param null|array $params + * @param null|array{entitlement_feature: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ProductFeature + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createFeature($parentId, $params = null, $opts = null) { @@ -82,9 +83,9 @@ class ProductService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Product + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -99,9 +100,9 @@ class ProductService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ProductFeature + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deleteFeature($parentId, $id, $params = null, $opts = null) { @@ -114,12 +115,12 @@ class ProductService extends \Stripe\Service\AbstractService * the corresponding product information. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Product + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -131,12 +132,12 @@ class ProductService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ProductFeature + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveFeature($parentId, $id, $params = null, $opts = null) { @@ -151,12 +152,12 @@ class ProductService extends \Stripe\Service\AbstractService * Occasionally, propagation of new or updated data can be up to an hour behind * during outages. Search functionality is not available to merchants in India. * - * @param null|array $params + * @param null|array{expand?: string[], limit?: int, page?: string, query: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SearchResult<\Stripe\Product> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function search($params = null, $opts = null) { @@ -168,12 +169,12 @@ class ProductService extends \Stripe\Service\AbstractService * parameters not provided will be left unchanged. * * @param string $id - * @param null|array $params + * @param null|array{active?: bool, default_price?: string, description?: null|string, expand?: string[], images?: null|string[], marketing_features?: null|array{name: string}[], metadata?: null|array, name?: string, package_dimensions?: null|array{height: float, length: float, weight: float, width: float}, shippable?: bool, statement_descriptor?: string, tax_code?: null|string, unit_label?: null|string, url?: null|string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Product + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/PromotionCodeService.php b/plugins/stripe-php/lib/Service/PromotionCodeService.php index 8e24e73c..97c901d5 100644 --- a/plugins/stripe-php/lib/Service/PromotionCodeService.php +++ b/plugins/stripe-php/lib/Service/PromotionCodeService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class PromotionCodeService extends \Stripe\Service\AbstractService +class PromotionCodeService extends AbstractService { /** * Returns a list of your promotion codes. * - * @param null|array $params + * @param null|array{active?: bool, code?: string, coupon?: string, created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\PromotionCode> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class PromotionCodeService extends \Stripe\Service\AbstractService * A promotion code points to a coupon. You can optionally restrict the code to a * specific customer, redemption limit, and expiration date. * - * @param null|array $params + * @param null|array{active?: bool, code?: string, coupon: string, customer?: string, expand?: string[], expires_at?: int, max_redemptions?: int, metadata?: array, restrictions?: array{currency_options?: array, first_time_transaction?: bool, minimum_amount?: int, minimum_amount_currency?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PromotionCode + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -48,12 +49,12 @@ class PromotionCodeService extends \Stripe\Service\AbstractService * code. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PromotionCode + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -65,12 +66,12 @@ class PromotionCodeService extends \Stripe\Service\AbstractService * passed. Most fields are, by design, not editable. * * @param string $id - * @param null|array $params + * @param null|array{active?: bool, expand?: string[], metadata?: null|array, restrictions?: array{currency_options?: array}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\PromotionCode + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/QuoteService.php b/plugins/stripe-php/lib/Service/QuoteService.php index 09ff03a4..e02e21a4 100644 --- a/plugins/stripe-php/lib/Service/QuoteService.php +++ b/plugins/stripe-php/lib/Service/QuoteService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class QuoteService extends \Stripe\Service\AbstractService +class QuoteService extends AbstractService { /** * Accepts the specified quote. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Quote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function accept($id, $params = null, $opts = null) { @@ -29,12 +30,12 @@ class QuoteService extends \Stripe\Service\AbstractService /** * Returns a list of your quotes. * - * @param null|array $params + * @param null|array{customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, test_clock?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Quote> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -48,12 +49,12 @@ class QuoteService extends \Stripe\Service\AbstractService * you can retrieve the full (paginated) list of upfront line items. * * @param string $id - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\LineItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allComputedUpfrontLineItems($id, $params = null, $opts = null) { @@ -66,12 +67,12 @@ class QuoteService extends \Stripe\Service\AbstractService * you can retrieve the full (paginated) list of line items. * * @param string $id - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\LineItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allLineItems($id, $params = null, $opts = null) { @@ -82,12 +83,12 @@ class QuoteService extends \Stripe\Service\AbstractService * Cancels the quote. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Quote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -100,12 +101,12 @@ class QuoteService extends \Stripe\Service\AbstractService * expires_at can be set in the dashboard via the quote template. * - * @param null|array $params + * @param null|array{application_fee_amount?: null|int, application_fee_percent?: null|float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, collection_method?: string, customer?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], expires_at?: int, footer?: null|string, from_quote?: array{is_revision?: bool, quote: string}, header?: null|string, invoice_settings?: array{days_until_due?: int, issuer?: array{account?: string, type: string}}, line_items?: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: array, on_behalf_of?: null|string, subscription_data?: array{description?: string, effective_date?: null|array|int|string, metadata?: array, trial_period_days?: null|int}, test_clock?: string, transfer_data?: null|array{amount?: int, amount_percent?: float, destination: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Quote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -116,12 +117,12 @@ class QuoteService extends \Stripe\Service\AbstractService * Finalizes the quote. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], expires_at?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Quote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function finalizeQuote($id, $params = null, $opts = null) { @@ -134,12 +135,12 @@ class QuoteService extends \Stripe\Service\AbstractService * * @param string $id * @param callable $readBodyChunkCallable - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return mixed + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null) { @@ -155,12 +156,12 @@ class QuoteService extends \Stripe\Service\AbstractService * Retrieves the quote with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Quote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -171,12 +172,12 @@ class QuoteService extends \Stripe\Service\AbstractService * A quote models prices and services for a customer. * * @param string $id - * @param null|array $params + * @param null|array{application_fee_amount?: null|int, application_fee_percent?: null|float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, collection_method?: string, customer?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], expires_at?: int, footer?: null|string, header?: null|string, invoice_settings?: array{days_until_due?: int, issuer?: array{account?: string, type: string}}, line_items?: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id?: string, price?: string, price_data?: array{currency: string, product: string, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: array, on_behalf_of?: null|string, subscription_data?: array{description?: null|string, effective_date?: null|array|int|string, metadata?: array, trial_period_days?: null|int}, transfer_data?: null|array{amount?: int, amount_percent?: float, destination: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Quote + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php b/plugins/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php index 3047a984..0a2a5cb7 100644 --- a/plugins/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php +++ b/plugins/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Radar; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class EarlyFraudWarningService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class EarlyFraudWarningService extends \Stripe\Service\AbstractService /** * Returns a list of early fraud warnings. * - * @param null|array $params + * @param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Radar\EarlyFraudWarning> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -33,12 +34,12 @@ class EarlyFraudWarningService extends \Stripe\Service\AbstractService * warning object reference for more details. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Radar\EarlyFraudWarning + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Radar/ValueListItemService.php b/plugins/stripe-php/lib/Service/Radar/ValueListItemService.php index 0113f12b..cbc963f8 100644 --- a/plugins/stripe-php/lib/Service/Radar/ValueListItemService.php +++ b/plugins/stripe-php/lib/Service/Radar/ValueListItemService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Radar; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ValueListItemService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class ValueListItemService extends \Stripe\Service\AbstractService * descending order by creation date, with the most recently created object * appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, value?: string, value_list: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Radar\ValueListItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -31,12 +32,12 @@ class ValueListItemService extends \Stripe\Service\AbstractService * Creates a new ValueListItem object, which is added to the specified * parent value list. * - * @param null|array $params + * @param null|array{expand?: string[], value: string, value_list: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Radar\ValueListItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -51,9 +52,9 @@ class ValueListItemService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Radar\ValueListItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -64,12 +65,12 @@ class ValueListItemService extends \Stripe\Service\AbstractService * Retrieves a ValueListItem object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Radar\ValueListItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Radar/ValueListService.php b/plugins/stripe-php/lib/Service/Radar/ValueListService.php index 125f5d5d..01dd3128 100644 --- a/plugins/stripe-php/lib/Service/Radar/ValueListService.php +++ b/plugins/stripe-php/lib/Service/Radar/ValueListService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Radar; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ValueListService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class ValueListService extends \Stripe\Service\AbstractService * descending order by creation date, with the most recently created object * appearing first. * - * @param null|array $params + * @param null|array{alias?: string, contains?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Radar\ValueList> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -31,12 +32,12 @@ class ValueListService extends \Stripe\Service\AbstractService * Creates a new ValueList object, which can then be referenced in * rules. * - * @param null|array $params + * @param null|array{alias: string, expand?: string[], item_type?: string, metadata?: array, name: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Radar\ValueList + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -52,9 +53,9 @@ class ValueListService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Radar\ValueList + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -65,12 +66,12 @@ class ValueListService extends \Stripe\Service\AbstractService * Retrieves a ValueList object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Radar\ValueList + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -83,12 +84,12 @@ class ValueListService extends \Stripe\Service\AbstractService * item_type is immutable. * * @param string $id - * @param null|array $params + * @param null|array{alias?: string, expand?: string[], metadata?: array, name?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Radar\ValueList + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/RefundService.php b/plugins/stripe-php/lib/Service/RefundService.php index f86b2090..0dcad0b3 100644 --- a/plugins/stripe-php/lib/Service/RefundService.php +++ b/plugins/stripe-php/lib/Service/RefundService.php @@ -6,21 +6,22 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class RefundService extends \Stripe\Service\AbstractService +class RefundService extends AbstractService { /** * Returns a list of all refunds you created. We return the refunds in sorted * order, with the most recent refunds appearing first. The 10 most recent refunds * are always available by default on the Charge object. * - * @param null|array $params + * @param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Refund> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -34,12 +35,12 @@ class RefundService extends \Stripe\Service\AbstractService * require customer action can enter the requires_action state. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Refund + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -61,12 +62,12 @@ class RefundService extends \Stripe\Service\AbstractService * an error when called on an already-refunded charge, or when trying to refund * more money than is left on a charge. * - * @param null|array $params + * @param null|array{amount?: int, charge?: string, currency?: string, customer?: string, expand?: string[], instructions_email?: string, metadata?: null|array, origin?: string, payment_intent?: string, reason?: string, refund_application_fee?: bool, reverse_transfer?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Refund + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -77,12 +78,12 @@ class RefundService extends \Stripe\Service\AbstractService * Retrieves the details of an existing refund. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Refund + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -96,12 +97,12 @@ class RefundService extends \Stripe\Service\AbstractService * This request only accepts metadata as an argument. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Refund + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Reporting/ReportRunService.php b/plugins/stripe-php/lib/Service/Reporting/ReportRunService.php index 569bd247..0f8e3601 100644 --- a/plugins/stripe-php/lib/Service/Reporting/ReportRunService.php +++ b/plugins/stripe-php/lib/Service/Reporting/ReportRunService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Reporting; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ReportRunService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class ReportRunService extends \Stripe\Service\AbstractService /** * Returns a list of Report Runs, with the most recent appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Reporting\ReportRun> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class ReportRunService extends \Stripe\Service\AbstractService * Creates a new object and begin running the report. (Certain report types require * a live-mode API key.). * - * @param null|array $params + * @param null|array{expand?: string[], parameters?: array{columns?: string[], connected_account?: string, currency?: string, interval_end?: int, interval_start?: int, payout?: string, reporting_category?: string, timezone?: string}, report_type: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Reporting\ReportRun + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -45,12 +46,12 @@ class ReportRunService extends \Stripe\Service\AbstractService * Retrieves the details of an existing Report Run. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Reporting\ReportRun + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Reporting/ReportTypeService.php b/plugins/stripe-php/lib/Service/Reporting/ReportTypeService.php index 0b2dde53..b839d7bc 100644 --- a/plugins/stripe-php/lib/Service/Reporting/ReportTypeService.php +++ b/plugins/stripe-php/lib/Service/Reporting/ReportTypeService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Reporting; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ReportTypeService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class ReportTypeService extends \Stripe\Service\AbstractService /** * Returns a full list of Report Types. * - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Reporting\ReportType> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class ReportTypeService extends \Stripe\Service\AbstractService * href="https://stripe.com/docs/keys#test-live-modes">live-mode API key.). * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Reporting\ReportType + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/ReviewService.php b/plugins/stripe-php/lib/Service/ReviewService.php index b04a8d9e..465ad861 100644 --- a/plugins/stripe-php/lib/Service/ReviewService.php +++ b/plugins/stripe-php/lib/Service/ReviewService.php @@ -6,21 +6,22 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class ReviewService extends \Stripe\Service\AbstractService +class ReviewService extends AbstractService { /** * Returns a list of Review objects that have open set to * true. The objects are sorted in descending order by creation date, * with the most recently created object appearing first. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Review> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -32,12 +33,12 @@ class ReviewService extends \Stripe\Service\AbstractService * of reviews. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Review + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function approve($id, $params = null, $opts = null) { @@ -48,12 +49,12 @@ class ReviewService extends \Stripe\Service\AbstractService * Retrieves a Review object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Review + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/SetupAttemptService.php b/plugins/stripe-php/lib/Service/SetupAttemptService.php index b6ddbff5..303e3395 100644 --- a/plugins/stripe-php/lib/Service/SetupAttemptService.php +++ b/plugins/stripe-php/lib/Service/SetupAttemptService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class SetupAttemptService extends \Stripe\Service\AbstractService +class SetupAttemptService extends AbstractService { /** * Returns a list of SetupAttempts that associate with a provided SetupIntent. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, setup_intent: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\SetupAttempt> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/SetupIntentService.php b/plugins/stripe-php/lib/Service/SetupIntentService.php index e3428da5..cca1edab 100644 --- a/plugins/stripe-php/lib/Service/SetupIntentService.php +++ b/plugins/stripe-php/lib/Service/SetupIntentService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class SetupIntentService extends \Stripe\Service\AbstractService +class SetupIntentService extends AbstractService { /** * Returns a list of SetupIntents. * - * @param null|array $params + * @param null|array{attach_to_self?: bool, created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, payment_method?: string, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\SetupIntent> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -36,12 +37,12 @@ class SetupIntentService extends \Stripe\Service\AbstractService * instead. * * @param string $id - * @param null|array $params + * @param null|array{cancellation_reason?: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SetupIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -62,12 +63,12 @@ class SetupIntentService extends \Stripe\Service\AbstractService * or the canceled status if the confirmation limit is reached. * * @param string $id - * @param null|array $params + * @param null|array{confirmation_token?: string, expand?: string[], mandate_data?: null|array{customer_acceptance?: array{accepted_at?: int, offline?: array{}, online?: array{ip_address?: string, user_agent?: string}, type: string}}, payment_method?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, return_url?: string, use_stripe_sdk?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SetupIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function confirm($id, $params = null, $opts = null) { @@ -81,12 +82,12 @@ class SetupIntentService extends \Stripe\Service\AbstractService * href="/docs/api/setup_intents/confirm">confirm it to collect any required * permissions to charge the payment method later. * - * @param null|array $params + * @param null|array{attach_to_self?: bool, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, confirm?: bool, confirmation_token?: string, customer?: string, description?: string, expand?: string[], flow_directions?: string[], mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, on_behalf_of?: string, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[], return_url?: string, single_use?: array{amount: int, currency: string}, usage?: string, use_stripe_sdk?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SetupIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -104,12 +105,12 @@ class SetupIntentService extends \Stripe\Service\AbstractService * object reference for more details. * * @param string $id - * @param null|array $params + * @param null|array{client_secret?: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SetupIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -120,12 +121,12 @@ class SetupIntentService extends \Stripe\Service\AbstractService * Updates a SetupIntent object. * * @param string $id - * @param null|array $params + * @param null|array{attach_to_self?: bool, customer?: string, description?: string, expand?: string[], flow_directions?: string[], metadata?: null|array, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SetupIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -136,12 +137,12 @@ class SetupIntentService extends \Stripe\Service\AbstractService * Verifies microdeposits on a SetupIntent object. * * @param string $id - * @param null|array $params + * @param null|array{amounts?: int[], descriptor_code?: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SetupIntent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function verifyMicrodeposits($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/ShippingRateService.php b/plugins/stripe-php/lib/Service/ShippingRateService.php index c9015b7f..df7e4cc3 100644 --- a/plugins/stripe-php/lib/Service/ShippingRateService.php +++ b/plugins/stripe-php/lib/Service/ShippingRateService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class ShippingRateService extends \Stripe\Service\AbstractService +class ShippingRateService extends AbstractService { /** * Returns a list of your shipping rates. * - * @param null|array $params + * @param null|array{active?: bool, created?: array|int, currency?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\ShippingRate> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class ShippingRateService extends \Stripe\Service\AbstractService /** * Creates a new shipping rate object. * - * @param null|array $params + * @param null|array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, expand?: string[], fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ShippingRate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -44,12 +45,12 @@ class ShippingRateService extends \Stripe\Service\AbstractService * Returns the shipping rate object with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ShippingRate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -60,12 +61,12 @@ class ShippingRateService extends \Stripe\Service\AbstractService * Updates an existing shipping rate object. * * @param string $id - * @param null|array $params + * @param null|array{active?: bool, expand?: string[], fixed_amount?: array{currency_options?: array}, metadata?: null|array, tax_behavior?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ShippingRate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php b/plugins/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php index 79562e20..f6eccd83 100644 --- a/plugins/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php +++ b/plugins/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Sigma; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ScheduledQueryRunService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class ScheduledQueryRunService extends \Stripe\Service\AbstractService /** * Returns a list of scheduled query runs. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Sigma\ScheduledQueryRun> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class ScheduledQueryRunService extends \Stripe\Service\AbstractService * Retrieves the details of an scheduled query run. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Sigma\ScheduledQueryRun + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/SourceService.php b/plugins/stripe-php/lib/Service/SourceService.php index 9b94aeb1..ccef3c9c 100644 --- a/plugins/stripe-php/lib/Service/SourceService.php +++ b/plugins/stripe-php/lib/Service/SourceService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class SourceService extends \Stripe\Service\AbstractService +class SourceService extends AbstractService { /** * List source transactions for a given source. * * @param string $id - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\SourceTransaction> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allSourceTransactions($id, $params = null, $opts = null) { @@ -29,12 +30,12 @@ class SourceService extends \Stripe\Service\AbstractService /** * Creates a new source object. * - * @param null|array $params + * @param null|array{amount?: int, currency?: string, customer?: string, expand?: string[], flow?: string, mandate?: array{acceptance?: array{date?: int, ip?: string, offline?: array{contact_email: string}, online?: array{date?: int, ip?: string, user_agent?: string}, status: string, type?: string, user_agent?: string}, amount?: null|int, currency?: string, interval?: string, notification_method?: string}, metadata?: array, original_source?: string, owner?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: string, name?: string, phone?: string}, receiver?: array{refund_attributes_method?: string}, redirect?: array{return_url: string}, source_order?: array{items?: array{amount?: int, currency?: string, description?: string, parent?: string, quantity?: int, type?: string}[], shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name?: string, phone?: string, tracking_number?: string}}, statement_descriptor?: string, token?: string, type?: string, usage?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Source + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -46,12 +47,12 @@ class SourceService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function detach($parentId, $id, $params = null, $opts = null) { @@ -64,12 +65,12 @@ class SourceService extends \Stripe\Service\AbstractService * object information. * * @param string $id - * @param null|array $params + * @param null|array{client_secret?: string, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Source + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -86,12 +87,12 @@ class SourceService extends \Stripe\Service\AbstractService * guides for more detail. * * @param string $id - * @param null|array $params + * @param null|array{amount?: int, expand?: string[], mandate?: array{acceptance?: array{date?: int, ip?: string, offline?: array{contact_email: string}, online?: array{date?: int, ip?: string, user_agent?: string}, status: string, type?: string, user_agent?: string}, amount?: null|int, currency?: string, interval?: string, notification_method?: string}, metadata?: null|array, owner?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: string, name?: string, phone?: string}, source_order?: array{items?: array{amount?: int, currency?: string, description?: string, parent?: string, quantity?: int, type?: string}[], shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name?: string, phone?: string, tracking_number?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Source + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -102,12 +103,12 @@ class SourceService extends \Stripe\Service\AbstractService * Verify a given source. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], values: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Source + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function verify($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/SubscriptionItemService.php b/plugins/stripe-php/lib/Service/SubscriptionItemService.php index 133542f6..9e1181f2 100644 --- a/plugins/stripe-php/lib/Service/SubscriptionItemService.php +++ b/plugins/stripe-php/lib/Service/SubscriptionItemService.php @@ -6,115 +6,53 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class SubscriptionItemService extends \Stripe\Service\AbstractService +class SubscriptionItemService extends AbstractService { /** * Returns a list of your subscription items for a given subscription. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, subscription: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\SubscriptionItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { return $this->requestCollection('get', '/v1/subscription_items', $params, $opts); } - /** - * For the specified subscription item, returns a list of summary objects. Each - * object in the list provides usage information that’s been summarized from - * multiple usage records and over a subscription billing period (e.g., 15 usage - * records in the month of September). - * - * The list is sorted in reverse-chronological order (newest first). The first list - * item represents the most current usage period that hasn’t ended yet. Since new - * usage records can still be added, the returned summary information for the - * subscription item’s ID should be seen as unstable until the subscription billing - * period ends. - * - * @param string $parentId - * @param null|array $params - * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\UsageRecordSummary> - */ - public function allUsageRecordSummaries($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/subscription_items/%s/usage_record_summaries', $parentId), $params, $opts); - } - /** * Adds a new item to an existing subscription. No existing items will be changed * or replaced. * - * @param null|array $params + * @param null|array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: array, payment_behavior?: string, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, proration_behavior?: string, proration_date?: int, quantity?: int, subscription: string, tax_rates?: null|string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SubscriptionItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { return $this->request('post', '/v1/subscription_items', $params, $opts); } - /** - * Creates a usage record for a specified subscription item and date, and fills it - * with a quantity. - * - * Usage records provide quantity information that Stripe uses to - * track how much a customer is using your service. With usage information and the - * pricing model set up by the metered - * billing plan, Stripe helps you send accurate invoices to your customers. - * - * The default calculation for usage is to add up all the quantity - * values of the usage records within a billing period. You can change this default - * behavior with the billing plan’s aggregate_usage parameter. When - * there is more than one usage record with the same timestamp, Stripe adds the - * quantity values together. In most cases, this is the desired - * resolution, however, you can change this behavior with the action - * parameter. - * - * The default pricing model for metered billing is per-unit pricing. - * For finer granularity, you can configure metered billing to have a tiered pricing - * model. - * - * @param string $parentId - * @param null|array $params - * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\UsageRecord - */ - public function createUsageRecord($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_items/%s/usage_records', $parentId), $params, $opts); - } - /** * Deletes an item from the subscription. Removing a subscription item from a * subscription will not cancel the subscription. * * @param string $id - * @param null|array $params + * @param null|array{clear_usage?: bool, proration_behavior?: string, proration_date?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SubscriptionItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -125,12 +63,12 @@ class SubscriptionItemService extends \Stripe\Service\AbstractService * Retrieves the subscription item with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SubscriptionItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -141,12 +79,12 @@ class SubscriptionItemService extends \Stripe\Service\AbstractService * Updates the plan or quantity of an item on a current subscription. * * @param string $id - * @param null|array $params + * @param null|array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, off_session?: bool, payment_behavior?: string, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, proration_behavior?: string, proration_date?: int, quantity?: int, tax_rates?: null|string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SubscriptionItem + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/SubscriptionScheduleService.php b/plugins/stripe-php/lib/Service/SubscriptionScheduleService.php index 3145b312..4e45a18b 100644 --- a/plugins/stripe-php/lib/Service/SubscriptionScheduleService.php +++ b/plugins/stripe-php/lib/Service/SubscriptionScheduleService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class SubscriptionScheduleService extends \Stripe\Service\AbstractService +class SubscriptionScheduleService extends AbstractService { /** * Retrieves the list of your subscription schedules. * - * @param null|array $params + * @param null|array{canceled_at?: array|int, completed_at?: array|int, created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, released_at?: array|int, scheduled?: bool, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\SubscriptionSchedule> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -32,12 +33,12 @@ class SubscriptionScheduleService extends \Stripe\Service\AbstractService * active. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], invoice_now?: bool, prorate?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SubscriptionSchedule + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -48,12 +49,12 @@ class SubscriptionScheduleService extends \Stripe\Service\AbstractService * Creates a new subscription schedule object. Each customer can have up to 500 * active or scheduled subscriptions. * - * @param null|array $params + * @param null|array{customer?: string, default_settings?: array{application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, collection_method?: string, default_payment_method?: string, description?: null|string, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, on_behalf_of?: null|string, transfer_data?: null|array{amount_percent?: float, destination: string}}, end_behavior?: string, expand?: string[], from_subscription?: string, metadata?: null|array, phases?: (array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, collection_method?: string, currency?: string, default_payment_method?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], end_date?: int, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, items: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], iterations?: int, metadata?: array, on_behalf_of?: string, proration_behavior?: string, transfer_data?: array{amount_percent?: float, destination: string}, trial?: bool, trial_end?: int})[], start_date?: array|int|string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SubscriptionSchedule + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -69,12 +70,12 @@ class SubscriptionScheduleService extends \Stripe\Service\AbstractService * ID to the released_subscription property. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], preserve_cancel_date?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SubscriptionSchedule + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function release($id, $params = null, $opts = null) { @@ -87,12 +88,12 @@ class SubscriptionScheduleService extends \Stripe\Service\AbstractService * subscription schedule creation. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SubscriptionSchedule + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -103,12 +104,12 @@ class SubscriptionScheduleService extends \Stripe\Service\AbstractService * Updates an existing subscription schedule. * * @param string $id - * @param null|array $params + * @param null|array{default_settings?: array{application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, collection_method?: string, default_payment_method?: string, description?: null|string, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, on_behalf_of?: null|string, transfer_data?: null|array{amount_percent?: float, destination: string}}, end_behavior?: string, expand?: string[], metadata?: null|array, phases?: (array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, collection_method?: string, currency?: string, default_payment_method?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], end_date?: array|int|string, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, items: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], iterations?: int, metadata?: array, on_behalf_of?: string, proration_behavior?: string, start_date?: array|int|string, transfer_data?: array{amount_percent?: float, destination: string}, trial?: bool, trial_end?: array|int|string})[], proration_behavior?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SubscriptionSchedule + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/SubscriptionService.php b/plugins/stripe-php/lib/Service/SubscriptionService.php index 922be94c..37a46013 100644 --- a/plugins/stripe-php/lib/Service/SubscriptionService.php +++ b/plugins/stripe-php/lib/Service/SubscriptionService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class SubscriptionService extends \Stripe\Service\AbstractService +class SubscriptionService extends AbstractService { /** * By default, returns a list of subscriptions that have not been canceled. In * order to list canceled subscriptions, specify status=canceled. * - * @param null|array $params + * @param null|array{automatic_tax?: array{enabled: bool}, collection_method?: string, created?: array|int, current_period_end?: array|int, current_period_start?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, plan?: string, price?: string, starting_after?: string, status?: string, test_clock?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Subscription> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -35,7 +36,8 @@ class SubscriptionService extends \Stripe\Service\AbstractService * the period, unless manually deleted. If you’ve * set the subscription to cancel at the end of the period, any pending prorations * are also left in place and collected at the end of the period. But if the - * subscription is set to cancel immediately, pending prorations are removed. + * subscription is set to cancel immediately, pending prorations are removed if + * invoice_now and prorate are both set to true. * * By default, upon subscription cancellation, Stripe stops automatic collection of * all finalized invoices for the customer. This is intended to prevent unexpected @@ -45,12 +47,12 @@ class SubscriptionService extends \Stripe\Service\AbstractService * allowing the customer to cancel the subscription at all. * * @param string $id - * @param null|array $params + * @param null|array{cancellation_details?: array{comment?: null|string, feedback?: null|string}, expand?: string[], invoice_now?: bool, prorate?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Subscription + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -72,12 +74,12 @@ class SubscriptionService extends \Stripe\Service\AbstractService * schedules instead. Schedules provide the flexibility to model more complex * billing configurations that change over time. * - * @param null|array $params + * @param null|array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: null|float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, backdate_start_date?: int, billing_cycle_anchor?: int, billing_cycle_anchor_config?: array{day_of_month: int, hour?: int, minute?: int, month?: int, second?: int}, cancel_at?: int, cancel_at_period_end?: bool, collection_method?: string, currency?: string, customer: string, days_until_due?: int, default_payment_method?: string, default_source?: string, default_tax_rates?: null|string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice_settings?: array{account_tax_ids?: null|string[], issuer?: array{account?: string, type: string}}, items?: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: null|array, off_session?: bool, on_behalf_of?: null|string, payment_behavior?: string, payment_settings?: array{payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{mandate_options?: array{amount?: int, amount_type?: string, description?: string}, network?: string, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[], save_default_payment_method?: string}, pending_invoice_item_interval?: null|array{interval: string, interval_count?: int}, proration_behavior?: string, transfer_data?: array{amount_percent?: float, destination: string}, trial_end?: array|int|string, trial_from_plan?: bool, trial_period_days?: int, trial_settings?: array{end_behavior: array{missing_payment_method: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Subscription + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -91,9 +93,9 @@ class SubscriptionService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Discount + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deleteDiscount($id, $params = null, $opts = null) { @@ -109,12 +111,12 @@ class SubscriptionService extends \Stripe\Service\AbstractService * invoice will void automatically if not paid by the expiration date. * * @param string $id - * @param null|array $params + * @param null|array{billing_cycle_anchor?: string, expand?: string[], proration_behavior?: string, proration_date?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Subscription + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function resume($id, $params = null, $opts = null) { @@ -125,12 +127,12 @@ class SubscriptionService extends \Stripe\Service\AbstractService * Retrieves the subscription with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Subscription + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -145,12 +147,12 @@ class SubscriptionService extends \Stripe\Service\AbstractService * Occasionally, propagation of new or updated data can be up to an hour behind * during outages. Search functionality is not available to merchants in India. * - * @param null|array $params + * @param null|array{expand?: string[], limit?: int, page?: string, query: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\SearchResult<\Stripe\Subscription> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function search($params = null, $opts = null) { @@ -209,12 +211,12 @@ class SubscriptionService extends \Stripe\Service\AbstractService * href="/docs/billing/subscriptions/usage-based">usage-based billing instead. * * @param string $id - * @param null|array $params + * @param null|array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: null|float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, cancel_at?: null|int, cancel_at_period_end?: bool, cancellation_details?: array{comment?: null|string, feedback?: null|string}, collection_method?: string, days_until_due?: int, default_payment_method?: string, default_source?: null|string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice_settings?: array{account_tax_ids?: null|string[], issuer?: array{account?: string, type: string}}, items?: (array{clear_usage?: bool, deleted?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id?: string, metadata?: null|array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: null|array, off_session?: bool, on_behalf_of?: null|string, pause_collection?: null|array{behavior: string, resumes_at?: int}, payment_behavior?: string, payment_settings?: array{payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{mandate_options?: array{amount?: int, amount_type?: string, description?: string}, network?: string, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[], save_default_payment_method?: string}, pending_invoice_item_interval?: null|array{interval: string, interval_count?: int}, proration_behavior?: string, proration_date?: int, transfer_data?: null|array{amount_percent?: float, destination: string}, trial_end?: array|int|string, trial_from_plan?: bool, trial_settings?: array{end_behavior: array{missing_payment_method: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Subscription + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Tax/CalculationService.php b/plugins/stripe-php/lib/Service/Tax/CalculationService.php index 68a1f048..f28e6685 100644 --- a/plugins/stripe-php/lib/Service/Tax/CalculationService.php +++ b/plugins/stripe-php/lib/Service/Tax/CalculationService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Tax; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class CalculationService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class CalculationService extends \Stripe\Service\AbstractService * calculation hasn’t expired. * * @param string $id - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Tax\CalculationLineItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allLineItems($id, $params = null, $opts = null) { @@ -31,12 +32,12 @@ class CalculationService extends \Stripe\Service\AbstractService * Calculates tax based on the input and returns a Tax Calculation * object. * - * @param null|array $params + * @param null|array{currency: string, customer?: string, customer_details?: array{address?: array{city?: null|string, country: string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}, address_source?: string, ip_address?: string, tax_ids?: array{type: string, value: string}[], taxability_override?: string}, expand?: string[], line_items: array{amount: int, product?: string, quantity?: int, reference?: string, tax_behavior?: string, tax_code?: string}[], ship_from_details?: array{address: array{city?: null|string, country: string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}}, shipping_cost?: array{amount?: int, shipping_rate?: string, tax_behavior?: string, tax_code?: string}, tax_date?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Tax\Calculation + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -48,12 +49,12 @@ class CalculationService extends \Stripe\Service\AbstractService * expired. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Tax\Calculation + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Tax/RegistrationService.php b/plugins/stripe-php/lib/Service/Tax/RegistrationService.php index db05503a..6b532e11 100644 --- a/plugins/stripe-php/lib/Service/Tax/RegistrationService.php +++ b/plugins/stripe-php/lib/Service/Tax/RegistrationService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Tax; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class RegistrationService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class RegistrationService extends \Stripe\Service\AbstractService /** * Returns a list of Tax Registration objects. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Tax\Registration> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class RegistrationService extends \Stripe\Service\AbstractService /** * Creates a new Tax Registration object. * - * @param null|array $params + * @param null|array{active_from: array|int|string, country: string, country_options: array{ae?: array{type: string}, al?: array{type: string}, am?: array{type: string}, ao?: array{type: string}, at?: array{standard?: array{place_of_supply_scheme: string}, type: string}, au?: array{type: string}, aw?: array{type: string}, az?: array{type: string}, ba?: array{type: string}, bb?: array{type: string}, bd?: array{type: string}, be?: array{standard?: array{place_of_supply_scheme: string}, type: string}, bf?: array{type: string}, bg?: array{standard?: array{place_of_supply_scheme: string}, type: string}, bh?: array{type: string}, bj?: array{type: string}, bs?: array{type: string}, by?: array{type: string}, ca?: array{province_standard?: array{province: string}, type: string}, cd?: array{type: string}, ch?: array{type: string}, cl?: array{type: string}, cm?: array{type: string}, co?: array{type: string}, cr?: array{type: string}, cv?: array{type: string}, cy?: array{standard?: array{place_of_supply_scheme: string}, type: string}, cz?: array{standard?: array{place_of_supply_scheme: string}, type: string}, de?: array{standard?: array{place_of_supply_scheme: string}, type: string}, dk?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ec?: array{type: string}, ee?: array{standard?: array{place_of_supply_scheme: string}, type: string}, eg?: array{type: string}, es?: array{standard?: array{place_of_supply_scheme: string}, type: string}, et?: array{type: string}, fi?: array{standard?: array{place_of_supply_scheme: string}, type: string}, fr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, gb?: array{type: string}, ge?: array{type: string}, gn?: array{type: string}, gr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, hr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, hu?: array{standard?: array{place_of_supply_scheme: string}, type: string}, id?: array{type: string}, ie?: array{standard?: array{place_of_supply_scheme: string}, type: string}, in?: array{type: string}, is?: array{type: string}, it?: array{standard?: array{place_of_supply_scheme: string}, type: string}, jp?: array{type: string}, ke?: array{type: string}, kg?: array{type: string}, kh?: array{type: string}, kr?: array{type: string}, kz?: array{type: string}, la?: array{type: string}, lt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, lu?: array{standard?: array{place_of_supply_scheme: string}, type: string}, lv?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ma?: array{type: string}, md?: array{type: string}, me?: array{type: string}, mk?: array{type: string}, mr?: array{type: string}, mt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, mx?: array{type: string}, my?: array{type: string}, ng?: array{type: string}, nl?: array{standard?: array{place_of_supply_scheme: string}, type: string}, no?: array{type: string}, np?: array{type: string}, nz?: array{type: string}, om?: array{type: string}, pe?: array{type: string}, ph?: array{type: string}, pl?: array{standard?: array{place_of_supply_scheme: string}, type: string}, pt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ro?: array{standard?: array{place_of_supply_scheme: string}, type: string}, rs?: array{type: string}, ru?: array{type: string}, sa?: array{type: string}, se?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sg?: array{type: string}, si?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sk?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sn?: array{type: string}, sr?: array{type: string}, th?: array{type: string}, tj?: array{type: string}, tr?: array{type: string}, tz?: array{type: string}, ug?: array{type: string}, us?: array{local_amusement_tax?: array{jurisdiction: string}, local_lease_tax?: array{jurisdiction: string}, state: string, state_sales_tax?: array{elections: array{jurisdiction?: string, type: string}[]}, type: string}, uy?: array{type: string}, uz?: array{type: string}, vn?: array{type: string}, za?: array{type: string}, zm?: array{type: string}, zw?: array{type: string}}, expand?: string[], expires_at?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Tax\Registration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -44,12 +45,12 @@ class RegistrationService extends \Stripe\Service\AbstractService * Returns a Tax Registration object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Tax\Registration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -63,12 +64,12 @@ class RegistrationService extends \Stripe\Service\AbstractService * registration you may do so by setting expires_at. * * @param string $id - * @param null|array $params + * @param null|array{active_from?: array|int|string, expand?: string[], expires_at?: null|array|int|string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Tax\Registration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Tax/SettingsService.php b/plugins/stripe-php/lib/Service/Tax/SettingsService.php index 38d02cc5..dc625bbe 100644 --- a/plugins/stripe-php/lib/Service/Tax/SettingsService.php +++ b/plugins/stripe-php/lib/Service/Tax/SettingsService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Tax; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class SettingsService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class SettingsService extends \Stripe\Service\AbstractService /** * Retrieves Tax Settings for a merchant. * - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Tax\Settings + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($params = null, $opts = null) { @@ -29,12 +30,12 @@ class SettingsService extends \Stripe\Service\AbstractService * Updates Tax Settings parameters used in tax calculations. All * parameters are editable but none can be removed once set. * - * @param null|array $params + * @param null|array{defaults?: array{tax_behavior?: string, tax_code?: string}, expand?: string[], head_office?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Tax\Settings + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Tax/TransactionService.php b/plugins/stripe-php/lib/Service/Tax/TransactionService.php index 416332ee..bcf3f740 100644 --- a/plugins/stripe-php/lib/Service/Tax/TransactionService.php +++ b/plugins/stripe-php/lib/Service/Tax/TransactionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Tax; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class TransactionService extends \Stripe\Service\AbstractService @@ -14,12 +15,12 @@ class TransactionService extends \Stripe\Service\AbstractService * Retrieves the line items of a committed standalone transaction as a collection. * * @param string $id - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Tax\TransactionLineItem> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allLineItems($id, $params = null, $opts = null) { @@ -30,12 +31,12 @@ class TransactionService extends \Stripe\Service\AbstractService * Creates a Tax Transaction from a calculation, if that calculation hasn’t * expired. Calculations expire after 90 days. * - * @param null|array $params + * @param null|array{calculation: string, expand?: string[], metadata?: array, posted_at?: int, reference: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Tax\Transaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createFromCalculation($params = null, $opts = null) { @@ -45,12 +46,12 @@ class TransactionService extends \Stripe\Service\AbstractService /** * Partially or fully reverses a previously created Transaction. * - * @param null|array $params + * @param null|array{expand?: string[], flat_amount?: int, line_items?: array{amount: int, amount_tax: int, metadata?: array, original_line_item: string, quantity?: int, reference: string}[], metadata?: array, mode: string, original_transaction: string, reference: string, shipping_cost?: array{amount: int, amount_tax: int}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Tax\Transaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createReversal($params = null, $opts = null) { @@ -61,12 +62,12 @@ class TransactionService extends \Stripe\Service\AbstractService * Retrieves a Tax Transaction object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Tax\Transaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TaxCodeService.php b/plugins/stripe-php/lib/Service/TaxCodeService.php index 7baf4d74..1766d789 100644 --- a/plugins/stripe-php/lib/Service/TaxCodeService.php +++ b/plugins/stripe-php/lib/Service/TaxCodeService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class TaxCodeService extends \Stripe\Service\AbstractService +class TaxCodeService extends AbstractService { /** * A list of all tax codes * available to add to Products in order to allow specific tax calculations. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\TaxCode> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -31,12 +32,12 @@ class TaxCodeService extends \Stripe\Service\AbstractService * Stripe will return the corresponding tax code information. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TaxCode + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TaxIdService.php b/plugins/stripe-php/lib/Service/TaxIdService.php index 6593387f..8bc60f47 100644 --- a/plugins/stripe-php/lib/Service/TaxIdService.php +++ b/plugins/stripe-php/lib/Service/TaxIdService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class TaxIdService extends \Stripe\Service\AbstractService +class TaxIdService extends AbstractService { /** * Returns a list of tax IDs. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, owner?: array{account?: string, customer?: string, type: string}, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\TaxId> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class TaxIdService extends \Stripe\Service\AbstractService /** * Creates a new account or customer tax_id object. * - * @param null|array $params + * @param null|array{expand?: string[], owner?: array{account?: string, customer?: string, type: string}, type: string, value: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TaxId + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -47,9 +48,9 @@ class TaxIdService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TaxId + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -60,12 +61,12 @@ class TaxIdService extends \Stripe\Service\AbstractService * Retrieves an account or customer tax_id object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TaxId + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TaxRateService.php b/plugins/stripe-php/lib/Service/TaxRateService.php index 5763f099..36850705 100644 --- a/plugins/stripe-php/lib/Service/TaxRateService.php +++ b/plugins/stripe-php/lib/Service/TaxRateService.php @@ -6,20 +6,21 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class TaxRateService extends \Stripe\Service\AbstractService +class TaxRateService extends AbstractService { /** * Returns a list of your tax rates. Tax rates are returned sorted by creation * date, with the most recently created tax rates appearing first. * - * @param null|array $params + * @param null|array{active?: bool, created?: array|int, ending_before?: string, expand?: string[], inclusive?: bool, limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\TaxRate> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class TaxRateService extends \Stripe\Service\AbstractService /** * Creates a new tax rate. * - * @param null|array $params + * @param null|array{active?: bool, country?: string, description?: string, display_name: string, expand?: string[], inclusive: bool, jurisdiction?: string, metadata?: array, percentage: float, state?: string, tax_type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TaxRate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -45,12 +46,12 @@ class TaxRateService extends \Stripe\Service\AbstractService * Retrieves a tax rate with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TaxRate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -61,12 +62,12 @@ class TaxRateService extends \Stripe\Service\AbstractService * Updates an existing tax rate. * * @param string $id - * @param null|array $params + * @param null|array{active?: bool, country?: string, description?: string, display_name?: string, expand?: string[], jurisdiction?: string, metadata?: null|array, state?: string, tax_type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TaxRate + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Terminal/ConfigurationService.php b/plugins/stripe-php/lib/Service/Terminal/ConfigurationService.php index 62350082..217c08e2 100644 --- a/plugins/stripe-php/lib/Service/Terminal/ConfigurationService.php +++ b/plugins/stripe-php/lib/Service/Terminal/ConfigurationService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Terminal; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ConfigurationService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class ConfigurationService extends \Stripe\Service\AbstractService /** * Returns a list of Configuration objects. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], is_account_default?: bool, limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Terminal\Configuration> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class ConfigurationService extends \Stripe\Service\AbstractService /** * Creates a new Configuration object. * - * @param null|array $params + * @param null|array{bbpos_wisepos_e?: array{splashscreen?: null|string}, expand?: string[], name?: string, offline?: null|array{enabled: bool}, reboot_window?: array{end_hour: int, start_hour: int}, stripe_s700?: array{splashscreen?: null|string}, tipping?: null|array{aud?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, cad?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, chf?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, czk?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, dkk?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, eur?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, gbp?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, hkd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, jpy?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, myr?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, nok?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, nzd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, pln?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, sek?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, sgd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, usd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}}, verifone_p400?: array{splashscreen?: null|string}, wifi?: null|array{enterprise_eap_peap?: array{ca_certificate_file?: string, password: string, ssid: string, username: string}, enterprise_eap_tls?: array{ca_certificate_file?: string, client_certificate_file: string, private_key_file: string, private_key_file_password?: string, ssid: string}, personal_psk?: array{password: string, ssid: string}, type: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Configuration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -47,9 +48,9 @@ class ConfigurationService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Configuration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -60,12 +61,12 @@ class ConfigurationService extends \Stripe\Service\AbstractService * Retrieves a Configuration object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Configuration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -76,12 +77,12 @@ class ConfigurationService extends \Stripe\Service\AbstractService * Updates a new Configuration object. * * @param string $id - * @param null|array $params + * @param null|array{bbpos_wisepos_e?: null|array{splashscreen?: null|string}, expand?: string[], name?: string, offline?: null|array{enabled: bool}, reboot_window?: null|array{end_hour: int, start_hour: int}, stripe_s700?: null|array{splashscreen?: null|string}, tipping?: null|array{aud?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, cad?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, chf?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, czk?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, dkk?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, eur?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, gbp?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, hkd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, jpy?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, myr?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, nok?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, nzd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, pln?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, sek?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, sgd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, usd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}}, verifone_p400?: null|array{splashscreen?: null|string}, wifi?: null|array{enterprise_eap_peap?: array{ca_certificate_file?: string, password: string, ssid: string, username: string}, enterprise_eap_tls?: array{ca_certificate_file?: string, client_certificate_file: string, private_key_file: string, private_key_file_password?: string, ssid: string}, personal_psk?: array{password: string, ssid: string}, type: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Configuration + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Terminal/ConnectionTokenService.php b/plugins/stripe-php/lib/Service/Terminal/ConnectionTokenService.php index 8c8235d6..4abfaa74 100644 --- a/plugins/stripe-php/lib/Service/Terminal/ConnectionTokenService.php +++ b/plugins/stripe-php/lib/Service/Terminal/ConnectionTokenService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Terminal; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ConnectionTokenService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class ConnectionTokenService extends \Stripe\Service\AbstractService * connection token from Stripe, proxied through your server. On your backend, add * an endpoint that creates and returns a connection token. * - * @param null|array $params + * @param null|array{expand?: string[], location?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\ConnectionToken + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Terminal/LocationService.php b/plugins/stripe-php/lib/Service/Terminal/LocationService.php index 980c318a..80b350d3 100644 --- a/plugins/stripe-php/lib/Service/Terminal/LocationService.php +++ b/plugins/stripe-php/lib/Service/Terminal/LocationService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Terminal; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class LocationService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class LocationService extends \Stripe\Service\AbstractService /** * Returns a list of Location objects. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Terminal\Location> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class LocationService extends \Stripe\Service\AbstractService * address fields are required in each country, see the Manage locations guide. * - * @param null|array $params + * @param null|array{address: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string}, configuration_overrides?: string, display_name: string, expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Location + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -49,9 +50,9 @@ class LocationService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Location + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -62,12 +63,12 @@ class LocationService extends \Stripe\Service\AbstractService * Retrieves a Location object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Location + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -79,12 +80,12 @@ class LocationService extends \Stripe\Service\AbstractService * passed. Any parameters not provided will be left unchanged. * * @param string $id - * @param null|array $params + * @param null|array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, configuration_overrides?: null|string, display_name?: string, expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Location + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Terminal/ReaderService.php b/plugins/stripe-php/lib/Service/Terminal/ReaderService.php index f119f8e2..3d49bdc4 100644 --- a/plugins/stripe-php/lib/Service/Terminal/ReaderService.php +++ b/plugins/stripe-php/lib/Service/Terminal/ReaderService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Terminal; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ReaderService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class ReaderService extends \Stripe\Service\AbstractService /** * Returns a list of Reader objects. * - * @param null|array $params + * @param null|array{device_type?: string, ending_before?: string, expand?: string[], limit?: int, location?: string, serial_number?: string, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Terminal\Reader> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class ReaderService extends \Stripe\Service\AbstractService * Cancels the current reader action. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Reader + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancelAction($id, $params = null, $opts = null) { @@ -44,12 +45,12 @@ class ReaderService extends \Stripe\Service\AbstractService /** * Creates a new Reader object. * - * @param null|array $params + * @param null|array{expand?: string[], label?: string, location?: string, metadata?: null|array, registration_code: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Reader + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -63,9 +64,9 @@ class ReaderService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Reader + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -76,12 +77,12 @@ class ReaderService extends \Stripe\Service\AbstractService * Initiates a payment flow on a Reader. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], payment_intent: string, process_config?: array{allow_redisplay?: string, enable_customer_cancellation?: bool, skip_tipping?: bool, tipping?: array{amount_eligible?: int}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Reader + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function processPaymentIntent($id, $params = null, $opts = null) { @@ -92,12 +93,12 @@ class ReaderService extends \Stripe\Service\AbstractService * Initiates a setup intent flow on a Reader. * * @param string $id - * @param null|array $params + * @param null|array{allow_redisplay: string, expand?: string[], process_config?: array{enable_customer_cancellation?: bool}, setup_intent: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Reader + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function processSetupIntent($id, $params = null, $opts = null) { @@ -108,12 +109,12 @@ class ReaderService extends \Stripe\Service\AbstractService * Initiates a refund on a Reader. * * @param string $id - * @param null|array $params + * @param null|array{amount?: int, charge?: string, expand?: string[], metadata?: array, payment_intent?: string, refund_application_fee?: bool, refund_payment_config?: array{enable_customer_cancellation?: bool}, reverse_transfer?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Reader + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function refundPayment($id, $params = null, $opts = null) { @@ -124,12 +125,12 @@ class ReaderService extends \Stripe\Service\AbstractService * Retrieves a Reader object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Reader + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -140,12 +141,12 @@ class ReaderService extends \Stripe\Service\AbstractService * Sets reader display to show cart details. * * @param string $id - * @param null|array $params + * @param null|array{cart?: array{currency: string, line_items: array{amount: int, description: string, quantity: int}[], tax?: int, total: int}, expand?: string[], type: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Reader + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function setReaderDisplay($id, $params = null, $opts = null) { @@ -157,12 +158,12 @@ class ReaderService extends \Stripe\Service\AbstractService * passed. Any parameters not provided will be left unchanged. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], label?: null|string, metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Reader + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/ConfirmationTokenService.php b/plugins/stripe-php/lib/Service/TestHelpers/ConfirmationTokenService.php index a98c0e3a..88fd5d53 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/ConfirmationTokenService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/ConfirmationTokenService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ConfirmationTokenService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class ConfirmationTokenService extends \Stripe\Service\AbstractService /** * Creates a test mode Confirmation Token server side for your integration tests. * - * @param null|array $params + * @param null|array{expand?: string[], payment_method?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{card?: array{installments?: array{plan: array{count?: int, interval?: string, type: string}}}}, return_url?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\ConfirmationToken + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/CustomerService.php b/plugins/stripe-php/lib/Service/TestHelpers/CustomerService.php index 902a9333..df6e5c91 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/CustomerService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/CustomerService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class CustomerService extends \Stripe\Service\AbstractService @@ -14,12 +15,12 @@ class CustomerService extends \Stripe\Service\AbstractService * Create an incoming testmode bank transfer. * * @param string $id - * @param null|array $params + * @param null|array{amount: int, currency: string, expand?: string[], reference?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\CustomerCashBalanceTransaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function fundCashBalance($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Issuing/AuthorizationService.php b/plugins/stripe-php/lib/Service/TestHelpers/Issuing/AuthorizationService.php index 22d3ff8e..5ae1ac8f 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Issuing/AuthorizationService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Issuing/AuthorizationService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class AuthorizationService extends \Stripe\Service\AbstractService @@ -14,12 +15,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * Capture a test-mode authorization. * * @param string $id - * @param null|array $params + * @param null|array{capture_amount?: int, close_authorization?: bool, expand?: string[], purchase_details?: array{fleet?: array{cardholder_prompt_data?: array{driver_id?: string, odometer?: int, unspecified_id?: string, user_id?: string, vehicle_number?: string}, purchase_type?: string, reported_breakdown?: array{fuel?: array{gross_amount_decimal?: string}, non_fuel?: array{gross_amount_decimal?: string}, tax?: array{local_amount_decimal?: string, national_amount_decimal?: string}}, service_type?: string}, flight?: array{departure_at?: int, passenger_name?: string, refundable?: bool, segments?: array{arrival_airport_code?: string, carrier?: string, departure_airport_code?: string, flight_number?: string, service_class?: string, stopover_allowed?: bool}[], travel_agency?: string}, fuel?: array{industry_product_code?: string, quantity_decimal?: string, type?: string, unit?: string, unit_cost_decimal?: string}, lodging?: array{check_in_at?: int, nights?: int}, receipt?: array{description?: string, quantity?: string, total?: int, unit_cost?: int}[], reference?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function capture($id, $params = null, $opts = null) { @@ -29,12 +30,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService /** * Create a test-mode authorization. * - * @param null|array $params + * @param null|array{amount?: int, amount_details?: array{atm_fee?: int, cashback_amount?: int}, authorization_method?: string, card: string, currency?: string, expand?: string[], fleet?: array{cardholder_prompt_data?: array{driver_id?: string, odometer?: int, unspecified_id?: string, user_id?: string, vehicle_number?: string}, purchase_type?: string, reported_breakdown?: array{fuel?: array{gross_amount_decimal?: string}, non_fuel?: array{gross_amount_decimal?: string}, tax?: array{local_amount_decimal?: string, national_amount_decimal?: string}}, service_type?: string}, fuel?: array{industry_product_code?: string, quantity_decimal?: string, type?: string, unit?: string, unit_cost_decimal?: string}, is_amount_controllable?: bool, merchant_amount?: int, merchant_currency?: string, merchant_data?: array{category?: string, city?: string, country?: string, name?: string, network_id?: string, postal_code?: string, state?: string, terminal_id?: string, url?: string}, network_data?: array{acquiring_institution_id?: string}, verification_data?: array{address_line1_check?: string, address_postal_code_check?: string, authentication_exemption?: array{claimed_by: string, type: string}, cvc_check?: string, expiry_check?: string, three_d_secure?: array{result: string}}, wallet?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -45,12 +46,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * Expire a test-mode Authorization. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function expire($id, $params = null, $opts = null) { @@ -62,12 +63,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * authorization was for an estimated amount. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], final_amount: int, fleet?: array{cardholder_prompt_data?: array{driver_id?: string, odometer?: int, unspecified_id?: string, user_id?: string, vehicle_number?: string}, purchase_type?: string, reported_breakdown?: array{fuel?: array{gross_amount_decimal?: string}, non_fuel?: array{gross_amount_decimal?: string}, tax?: array{local_amount_decimal?: string, national_amount_decimal?: string}}, service_type?: string}, fuel?: array{industry_product_code?: string, quantity_decimal?: string, type?: string, unit?: string, unit_cost_decimal?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function finalizeAmount($id, $params = null, $opts = null) { @@ -78,12 +79,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * Increment a test-mode Authorization. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], increment_amount: int, is_amount_controllable?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function increment($id, $params = null, $opts = null) { @@ -95,12 +96,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * either a confirmation of fraud or a correction of legitimacy. * * @param string $id - * @param null|array $params + * @param null|array{confirmed: bool, expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function respond($id, $params = null, $opts = null) { @@ -111,12 +112,12 @@ class AuthorizationService extends \Stripe\Service\AbstractService * Reverse a test-mode Authorization. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], reverse_amount?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Authorization + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function reverse($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Issuing/CardService.php b/plugins/stripe-php/lib/Service/TestHelpers/Issuing/CardService.php index b74b9edb..bacfabfa 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Issuing/CardService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Issuing/CardService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class CardService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class CardService extends \Stripe\Service\AbstractService * delivered. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deliverCard($id, $params = null, $opts = null) { @@ -32,12 +33,12 @@ class CardService extends \Stripe\Service\AbstractService * failure. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function failCard($id, $params = null, $opts = null) { @@ -49,12 +50,12 @@ class CardService extends \Stripe\Service\AbstractService * returned. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function returnCard($id, $params = null, $opts = null) { @@ -66,12 +67,12 @@ class CardService extends \Stripe\Service\AbstractService * shipped. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function shipCard($id, $params = null, $opts = null) { @@ -84,12 +85,12 @@ class CardService extends \Stripe\Service\AbstractService * or later. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Card + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function submitCard($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Issuing/PersonalizationDesignService.php b/plugins/stripe-php/lib/Service/TestHelpers/Issuing/PersonalizationDesignService.php index 386fc955..3c3292ad 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Issuing/PersonalizationDesignService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Issuing/PersonalizationDesignService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class PersonalizationDesignService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class PersonalizationDesignService extends \Stripe\Service\AbstractService * object to active. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\PersonalizationDesign + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function activate($id, $params = null, $opts = null) { @@ -32,12 +33,12 @@ class PersonalizationDesignService extends \Stripe\Service\AbstractService * object to inactive. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\PersonalizationDesign + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function deactivate($id, $params = null, $opts = null) { @@ -49,12 +50,12 @@ class PersonalizationDesignService extends \Stripe\Service\AbstractService * object to rejected. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], rejection_reasons: array{card_logo?: string[], carrier_text?: string[]}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\PersonalizationDesign + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function reject($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Issuing/TransactionService.php b/plugins/stripe-php/lib/Service/TestHelpers/Issuing/TransactionService.php index 0142ecfd..e5fc0904 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Issuing/TransactionService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Issuing/TransactionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers\Issuing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class TransactionService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class TransactionService extends \Stripe\Service\AbstractService /** * Allows the user to capture an arbitrary amount, also known as a forced capture. * - * @param null|array $params + * @param null|array{amount: int, card: string, currency?: string, expand?: string[], merchant_data?: array{category?: string, city?: string, country?: string, name?: string, network_id?: string, postal_code?: string, state?: string, terminal_id?: string, url?: string}, purchase_details?: array{fleet?: array{cardholder_prompt_data?: array{driver_id?: string, odometer?: int, unspecified_id?: string, user_id?: string, vehicle_number?: string}, purchase_type?: string, reported_breakdown?: array{fuel?: array{gross_amount_decimal?: string}, non_fuel?: array{gross_amount_decimal?: string}, tax?: array{local_amount_decimal?: string, national_amount_decimal?: string}}, service_type?: string}, flight?: array{departure_at?: int, passenger_name?: string, refundable?: bool, segments?: array{arrival_airport_code?: string, carrier?: string, departure_airport_code?: string, flight_number?: string, service_class?: string, stopover_allowed?: bool}[], travel_agency?: string}, fuel?: array{industry_product_code?: string, quantity_decimal?: string, type?: string, unit?: string, unit_cost_decimal?: string}, lodging?: array{check_in_at?: int, nights?: int}, receipt?: array{description?: string, quantity?: string, total?: int, unit_cost?: int}[], reference?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Transaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createForceCapture($params = null, $opts = null) { @@ -28,12 +29,12 @@ class TransactionService extends \Stripe\Service\AbstractService /** * Allows the user to refund an arbitrary amount, also known as a unlinked refund. * - * @param null|array $params + * @param null|array{amount: int, card: string, currency?: string, expand?: string[], merchant_data?: array{category?: string, city?: string, country?: string, name?: string, network_id?: string, postal_code?: string, state?: string, terminal_id?: string, url?: string}, purchase_details?: array{fleet?: array{cardholder_prompt_data?: array{driver_id?: string, odometer?: int, unspecified_id?: string, user_id?: string, vehicle_number?: string}, purchase_type?: string, reported_breakdown?: array{fuel?: array{gross_amount_decimal?: string}, non_fuel?: array{gross_amount_decimal?: string}, tax?: array{local_amount_decimal?: string, national_amount_decimal?: string}}, service_type?: string}, flight?: array{departure_at?: int, passenger_name?: string, refundable?: bool, segments?: array{arrival_airport_code?: string, carrier?: string, departure_airport_code?: string, flight_number?: string, service_class?: string, stopover_allowed?: bool}[], travel_agency?: string}, fuel?: array{industry_product_code?: string, quantity_decimal?: string, type?: string, unit?: string, unit_cost_decimal?: string}, lodging?: array{check_in_at?: int, nights?: int}, receipt?: array{description?: string, quantity?: string, total?: int, unit_cost?: int}[], reference?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Transaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createUnlinkedRefund($params = null, $opts = null) { @@ -44,12 +45,12 @@ class TransactionService extends \Stripe\Service\AbstractService * Refund a test-mode Transaction. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], refund_amount?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Issuing\Transaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function refund($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/RefundService.php b/plugins/stripe-php/lib/Service/TestHelpers/RefundService.php index 51234044..f671362a 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/RefundService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/RefundService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class RefundService extends \Stripe\Service\AbstractService @@ -14,12 +15,12 @@ class RefundService extends \Stripe\Service\AbstractService * Expire a refund with a status of requires_action. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Refund + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function expire($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php b/plugins/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php index afdecb55..244497d3 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers\Terminal; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ReaderService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class ReaderService extends \Stripe\Service\AbstractService * accepting a payment, saving a card or refunding a transaction. * * @param string $id - * @param null|array $params + * @param null|array{amount_tip?: int, card_present?: array{number?: string}, expand?: string[], interac_present?: array{number?: string}, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Terminal\Reader + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function presentPaymentMethod($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/TestClockService.php b/plugins/stripe-php/lib/Service/TestHelpers/TestClockService.php index d938a96b..7d47271c 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/TestClockService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/TestClockService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class TestClockService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class TestClockService extends \Stripe\Service\AbstractService * done when status changes to Ready. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], frozen_time: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TestHelpers\TestClock + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function advance($id, $params = null, $opts = null) { @@ -30,12 +31,12 @@ class TestClockService extends \Stripe\Service\AbstractService /** * Returns a list of your test clocks. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\TestHelpers\TestClock> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -45,12 +46,12 @@ class TestClockService extends \Stripe\Service\AbstractService /** * Creates a new test clock that can be attached to new customers and quotes. * - * @param null|array $params + * @param null|array{expand?: string[], frozen_time: int, name?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TestHelpers\TestClock + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -64,9 +65,9 @@ class TestClockService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TestHelpers\TestClock + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -77,12 +78,12 @@ class TestClockService extends \Stripe\Service\AbstractService * Retrieves a test clock. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TestHelpers\TestClock + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Treasury/InboundTransferService.php b/plugins/stripe-php/lib/Service/TestHelpers/Treasury/InboundTransferService.php index e293e4fa..5b3b25b9 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Treasury/InboundTransferService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Treasury/InboundTransferService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class InboundTransferService extends \Stripe\Service\AbstractService @@ -16,12 +17,12 @@ class InboundTransferService extends \Stripe\Service\AbstractService * state. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], failure_details?: array{code?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\InboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function fail($id, $params = null, $opts = null) { @@ -34,12 +35,12 @@ class InboundTransferService extends \Stripe\Service\AbstractService * succeeded state. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\InboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function returnInboundTransfer($id, $params = null, $opts = null) { @@ -52,12 +53,12 @@ class InboundTransferService extends \Stripe\Service\AbstractService * state. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\InboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function succeed($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Treasury/OutboundPaymentService.php b/plugins/stripe-php/lib/Service/TestHelpers/Treasury/OutboundPaymentService.php index 49902252..db838a87 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Treasury/OutboundPaymentService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Treasury/OutboundPaymentService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class OutboundPaymentService extends \Stripe\Service\AbstractService @@ -16,12 +17,12 @@ class OutboundPaymentService extends \Stripe\Service\AbstractService * state. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundPayment + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function fail($id, $params = null, $opts = null) { @@ -34,12 +35,12 @@ class OutboundPaymentService extends \Stripe\Service\AbstractService * state. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundPayment + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function post($id, $params = null, $opts = null) { @@ -52,12 +53,12 @@ class OutboundPaymentService extends \Stripe\Service\AbstractService * state. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], returned_details?: array{code?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundPayment + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function returnOutboundPayment($id, $params = null, $opts = null) { @@ -70,12 +71,12 @@ class OutboundPaymentService extends \Stripe\Service\AbstractService * canceled or failed states. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], tracking_details: array{ach?: array{trace_id: string}, type: string, us_domestic_wire?: array{chips?: string, imad?: string, omad?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundPayment + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Treasury/OutboundTransferService.php b/plugins/stripe-php/lib/Service/TestHelpers/Treasury/OutboundTransferService.php index c1528800..0286991c 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Treasury/OutboundTransferService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Treasury/OutboundTransferService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class OutboundTransferService extends \Stripe\Service\AbstractService @@ -16,12 +17,12 @@ class OutboundTransferService extends \Stripe\Service\AbstractService * state. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function fail($id, $params = null, $opts = null) { @@ -34,12 +35,12 @@ class OutboundTransferService extends \Stripe\Service\AbstractService * state. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function post($id, $params = null, $opts = null) { @@ -52,12 +53,12 @@ class OutboundTransferService extends \Stripe\Service\AbstractService * state. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], returned_details?: array{code?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function returnOutboundTransfer($id, $params = null, $opts = null) { @@ -70,12 +71,12 @@ class OutboundTransferService extends \Stripe\Service\AbstractService * canceled or failed states. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], tracking_details: array{ach?: array{trace_id: string}, type: string, us_domestic_wire?: array{chips?: string, imad?: string, omad?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedCreditService.php b/plugins/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedCreditService.php index b1d865c1..ed0e5f07 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedCreditService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedCreditService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ReceivedCreditService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class ReceivedCreditService extends \Stripe\Service\AbstractService * party. In live mode, you can’t directly create ReceivedCredits initiated by * third parties. * - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, expand?: string[], financial_account: string, initiating_payment_method_details?: array{type: string, us_bank_account?: array{account_holder_name?: string, account_number?: string, routing_number?: string}}, network: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\ReceivedCredit + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedDebitService.php b/plugins/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedDebitService.php index bbd0cc9f..5555d2ea 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedDebitService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedDebitService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\TestHelpers\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ReceivedDebitService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class ReceivedDebitService extends \Stripe\Service\AbstractService * party. In live mode, you can’t directly create ReceivedDebits initiated by third * parties. * - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, expand?: string[], financial_account: string, initiating_payment_method_details?: array{type: string, us_bank_account?: array{account_holder_name?: string, account_number?: string, routing_number?: string}}, network: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\ReceivedDebit + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TokenService.php b/plugins/stripe-php/lib/Service/TokenService.php index 3e90aa92..25aa6e26 100644 --- a/plugins/stripe-php/lib/Service/TokenService.php +++ b/plugins/stripe-php/lib/Service/TokenService.php @@ -6,9 +6,10 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class TokenService extends \Stripe\Service\AbstractService +class TokenService extends AbstractService { /** * Creates a single-use token that represents a bank account’s details. You can use @@ -18,12 +19,12 @@ class TokenService extends \Stripe\Service\AbstractService * href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection * is application, which includes Custom accounts. * - * @param null|array $params + * @param null|array{account?: array{business_type?: string, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_declaration_shown_and_signed?: bool, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, tos_shown_and_accepted?: bool}, bank_account?: array{account_holder_name?: string, account_holder_type?: string, account_number: string, account_type?: string, country: string, currency?: string, payment_method?: string, routing_number?: string}, card?: array|string, customer?: string, cvc_update?: array{cvc: string}, expand?: string[], person?: array{additional_tos_acceptances?: array{account?: array{date?: int, ip?: string, user_agent?: null|string}}, address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files?: string[]}, passport?: array{files?: string[]}, visa?: array{files?: string[]}}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, nationality?: string, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{authorizer?: bool, director?: bool, executive?: bool, legal_guardian?: bool, owner?: bool, percent_ownership?: null|float, representative?: bool, title?: string}, ssn_last_4?: string, us_cfpb_data?: array{ethnicity_details?: array{ethnicity?: string[], ethnicity_other?: string}, race_details?: array{race?: string[], race_other?: string}, self_identified_gender?: string}, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, pii?: array{id_number?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Token + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -34,12 +35,12 @@ class TokenService extends \Stripe\Service\AbstractService * Retrieves the token with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Token + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TopupService.php b/plugins/stripe-php/lib/Service/TopupService.php index 2d11619f..d7cb146c 100644 --- a/plugins/stripe-php/lib/Service/TopupService.php +++ b/plugins/stripe-php/lib/Service/TopupService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class TopupService extends \Stripe\Service\AbstractService +class TopupService extends AbstractService { /** * Returns a list of top-ups. * - * @param null|array $params + * @param null|array{amount?: array|int, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Topup> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class TopupService extends \Stripe\Service\AbstractService * Cancels a top-up. Only pending top-ups can be canceled. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Topup + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -44,12 +45,12 @@ class TopupService extends \Stripe\Service\AbstractService /** * Top up the balance of an account. * - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, expand?: string[], metadata?: null|array, source?: string, statement_descriptor?: string, transfer_group?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Topup + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -62,12 +63,12 @@ class TopupService extends \Stripe\Service\AbstractService * return the corresponding top-up information. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Topup + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -79,12 +80,12 @@ class TopupService extends \Stripe\Service\AbstractService * design. * * @param string $id - * @param null|array $params + * @param null|array{description?: string, expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Topup + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/TransferService.php b/plugins/stripe-php/lib/Service/TransferService.php index 26ec45ef..71c26613 100644 --- a/plugins/stripe-php/lib/Service/TransferService.php +++ b/plugins/stripe-php/lib/Service/TransferService.php @@ -6,21 +6,22 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class TransferService extends \Stripe\Service\AbstractService +class TransferService extends AbstractService { /** * Returns a list of existing transfers sent to connected accounts. The transfers * are returned in sorted order, with the most recently created transfers appearing * first. * - * @param null|array $params + * @param null|array{created?: array|int, destination?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, transfer_group?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Transfer> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -35,12 +36,12 @@ class TransferService extends \Stripe\Service\AbstractService * additional reversals. * * @param string $parentId - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\TransferReversal> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function allReversals($parentId, $params = null, $opts = null) { @@ -52,12 +53,12 @@ class TransferService extends \Stripe\Service\AbstractService * transfer object. Your Stripe balance must be able to * cover the transfer amount, or you’ll receive an “Insufficient Funds” error. * - * @param null|array $params + * @param null|array{amount?: int, currency: string, description?: string, destination: string, expand?: string[], metadata?: array, source_transaction?: string, source_type?: string, transfer_group?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Transfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -75,12 +76,12 @@ class TransferService extends \Stripe\Service\AbstractService * reverse more money than is left on a transfer. * * @param string $parentId - * @param null|array $params + * @param null|array{amount?: int, description?: string, expand?: string[], metadata?: null|array, refund_application_fee?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TransferReversal + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function createReversal($parentId, $params = null, $opts = null) { @@ -93,12 +94,12 @@ class TransferService extends \Stripe\Service\AbstractService * return the corresponding transfer information. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Transfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -112,12 +113,12 @@ class TransferService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TransferReversal + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveReversal($parentId, $id, $params = null, $opts = null) { @@ -131,12 +132,12 @@ class TransferService extends \Stripe\Service\AbstractService * This request accepts only metadata as an argument. * * @param string $id - * @param null|array $params + * @param null|array{description?: string, expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Transfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -151,12 +152,12 @@ class TransferService extends \Stripe\Service\AbstractService * * @param string $parentId * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], metadata?: null|array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\TransferReversal + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateReversal($parentId, $id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Treasury/CreditReversalService.php b/plugins/stripe-php/lib/Service/Treasury/CreditReversalService.php index 5cd42226..d37fcde9 100644 --- a/plugins/stripe-php/lib/Service/Treasury/CreditReversalService.php +++ b/plugins/stripe-php/lib/Service/Treasury/CreditReversalService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class CreditReversalService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class CreditReversalService extends \Stripe\Service\AbstractService /** * Returns a list of CreditReversals. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, received_credit?: string, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Treasury\CreditReversal> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class CreditReversalService extends \Stripe\Service\AbstractService /** * Reverses a ReceivedCredit and creates a CreditReversal object. * - * @param null|array $params + * @param null|array{expand?: string[], metadata?: array, received_credit: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\CreditReversal + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -46,12 +47,12 @@ class CreditReversalService extends \Stripe\Service\AbstractService * CreditReversal list. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\CreditReversal + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Treasury/DebitReversalService.php b/plugins/stripe-php/lib/Service/Treasury/DebitReversalService.php index cbeaa111..611783e0 100644 --- a/plugins/stripe-php/lib/Service/Treasury/DebitReversalService.php +++ b/plugins/stripe-php/lib/Service/Treasury/DebitReversalService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class DebitReversalService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class DebitReversalService extends \Stripe\Service\AbstractService /** * Returns a list of DebitReversals. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, received_debit?: string, resolution?: string, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Treasury\DebitReversal> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class DebitReversalService extends \Stripe\Service\AbstractService /** * Reverses a ReceivedDebit and creates a DebitReversal object. * - * @param null|array $params + * @param null|array{expand?: string[], metadata?: array, received_debit: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\DebitReversal + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -44,12 +45,12 @@ class DebitReversalService extends \Stripe\Service\AbstractService * Retrieves a DebitReversal object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\DebitReversal + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Treasury/FinancialAccountService.php b/plugins/stripe-php/lib/Service/Treasury/FinancialAccountService.php index f8ec126f..7d5f7229 100644 --- a/plugins/stripe-php/lib/Service/Treasury/FinancialAccountService.php +++ b/plugins/stripe-php/lib/Service/Treasury/FinancialAccountService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class FinancialAccountService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class FinancialAccountService extends \Stripe\Service\AbstractService /** * Returns a list of FinancialAccounts. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Treasury\FinancialAccount> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -26,15 +27,33 @@ class FinancialAccountService extends \Stripe\Service\AbstractService } /** - * Creates a new FinancialAccount. For now, each connected account can only have - * one FinancialAccount. + * Closes a FinancialAccount. A FinancialAccount can only be closed if it has a + * zero balance, has no pending InboundTransfers, and has canceled all attached + * Issuing cards. * - * @param null|array $params + * @param string $id + * @param null|array{expand?: string[], forwarding_settings?: array{financial_account?: string, payment_method?: string, type: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * + * @return \Stripe\Treasury\FinancialAccount + * * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + public function close($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/treasury/financial_accounts/%s/close', $id), $params, $opts); + } + + /** + * Creates a new FinancialAccount. Each connected account can have up to three + * FinancialAccounts by default. + * + * @param null|array{expand?: string[], features?: array{card_issuing?: array{requested: bool}, deposit_insurance?: array{requested: bool}, financial_addresses?: array{aba?: array{requested: bool}}, inbound_transfers?: array{ach?: array{requested: bool}}, intra_stripe_flows?: array{requested: bool}, outbound_payments?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}, outbound_transfers?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}}, metadata?: array, nickname?: null|string, platform_restrictions?: array{inbound_flows?: string, outbound_flows?: string}, supported_currencies: string[]} $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Treasury\FinancialAccount + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -45,12 +64,12 @@ class FinancialAccountService extends \Stripe\Service\AbstractService * Retrieves the details of a FinancialAccount. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\FinancialAccount + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -61,12 +80,12 @@ class FinancialAccountService extends \Stripe\Service\AbstractService * Retrieves Features information associated with the FinancialAccount. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\FinancialAccountFeatures + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveFeatures($id, $params = null, $opts = null) { @@ -77,12 +96,12 @@ class FinancialAccountService extends \Stripe\Service\AbstractService * Updates the details of a FinancialAccount. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[], features?: array{card_issuing?: array{requested: bool}, deposit_insurance?: array{requested: bool}, financial_addresses?: array{aba?: array{requested: bool}}, inbound_transfers?: array{ach?: array{requested: bool}}, intra_stripe_flows?: array{requested: bool}, outbound_payments?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}, outbound_transfers?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}}, forwarding_settings?: array{financial_account?: string, payment_method?: string, type: string}, metadata?: array, nickname?: null|string, platform_restrictions?: array{inbound_flows?: string, outbound_flows?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\FinancialAccount + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { @@ -93,12 +112,12 @@ class FinancialAccountService extends \Stripe\Service\AbstractService * Updates the Features associated with a FinancialAccount. * * @param string $id - * @param null|array $params + * @param null|array{card_issuing?: array{requested: bool}, deposit_insurance?: array{requested: bool}, expand?: string[], financial_addresses?: array{aba?: array{requested: bool}}, inbound_transfers?: array{ach?: array{requested: bool}}, intra_stripe_flows?: array{requested: bool}, outbound_payments?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}, outbound_transfers?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\FinancialAccountFeatures + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateFeatures($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Treasury/InboundTransferService.php b/plugins/stripe-php/lib/Service/Treasury/InboundTransferService.php index 95c7fdc6..d76c81c9 100644 --- a/plugins/stripe-php/lib/Service/Treasury/InboundTransferService.php +++ b/plugins/stripe-php/lib/Service/Treasury/InboundTransferService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class InboundTransferService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class InboundTransferService extends \Stripe\Service\AbstractService /** * Returns a list of InboundTransfers sent from the specified FinancialAccount. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Treasury\InboundTransfer> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class InboundTransferService extends \Stripe\Service\AbstractService * Cancels an InboundTransfer. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\InboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -44,12 +45,12 @@ class InboundTransferService extends \Stripe\Service\AbstractService /** * Creates an InboundTransfer. * - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, expand?: string[], financial_account: string, metadata?: array, origin_payment_method: string, statement_descriptor?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\InboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -60,12 +61,12 @@ class InboundTransferService extends \Stripe\Service\AbstractService * Retrieves the details of an existing InboundTransfer. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\InboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Treasury/OutboundPaymentService.php b/plugins/stripe-php/lib/Service/Treasury/OutboundPaymentService.php index 53a5e02a..4c600dd1 100644 --- a/plugins/stripe-php/lib/Service/Treasury/OutboundPaymentService.php +++ b/plugins/stripe-php/lib/Service/Treasury/OutboundPaymentService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class OutboundPaymentService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class OutboundPaymentService extends \Stripe\Service\AbstractService /** * Returns a list of OutboundPayments sent from the specified FinancialAccount. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Treasury\OutboundPayment> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class OutboundPaymentService extends \Stripe\Service\AbstractService * Cancel an OutboundPayment. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundPayment + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -44,12 +45,12 @@ class OutboundPaymentService extends \Stripe\Service\AbstractService /** * Creates an OutboundPayment. * - * @param null|array $params + * @param null|array{amount: int, currency: string, customer?: string, description?: string, destination_payment_method?: string, destination_payment_method_data?: array{billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string}, financial_account?: string, metadata?: array, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}}, destination_payment_method_options?: array{us_bank_account?: null|array{network?: string}}, end_user_details?: array{ip_address?: string, present: bool}, expand?: string[], financial_account: string, metadata?: array, statement_descriptor?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundPayment + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -62,12 +63,12 @@ class OutboundPaymentService extends \Stripe\Service\AbstractService * OutboundPayment list. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundPayment + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Treasury/OutboundTransferService.php b/plugins/stripe-php/lib/Service/Treasury/OutboundTransferService.php index 0b2a2738..7437e565 100644 --- a/plugins/stripe-php/lib/Service/Treasury/OutboundTransferService.php +++ b/plugins/stripe-php/lib/Service/Treasury/OutboundTransferService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class OutboundTransferService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class OutboundTransferService extends \Stripe\Service\AbstractService /** * Returns a list of OutboundTransfers sent from the specified FinancialAccount. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Treasury\OutboundTransfer> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class OutboundTransferService extends \Stripe\Service\AbstractService * An OutboundTransfer can be canceled if the funds have not yet been paid out. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($id, $params = null, $opts = null) { @@ -44,12 +45,12 @@ class OutboundTransferService extends \Stripe\Service\AbstractService /** * Creates an OutboundTransfer. * - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, destination_payment_method?: string, destination_payment_method_data?: array{financial_account?: string, type: string}, destination_payment_method_options?: array{us_bank_account?: null|array{network?: string}}, expand?: string[], financial_account: string, metadata?: array, statement_descriptor?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -62,12 +63,12 @@ class OutboundTransferService extends \Stripe\Service\AbstractService * OutboundTransfer list. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\OutboundTransfer + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Treasury/ReceivedCreditService.php b/plugins/stripe-php/lib/Service/Treasury/ReceivedCreditService.php index 8c741265..a42e0990 100644 --- a/plugins/stripe-php/lib/Service/Treasury/ReceivedCreditService.php +++ b/plugins/stripe-php/lib/Service/Treasury/ReceivedCreditService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ReceivedCreditService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class ReceivedCreditService extends \Stripe\Service\AbstractService /** * Returns a list of ReceivedCredits. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, linked_flows?: array{source_flow_type: string}, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Treasury\ReceivedCredit> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class ReceivedCreditService extends \Stripe\Service\AbstractService * ReceivedCredit ID from the ReceivedCredit list. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\ReceivedCredit + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Treasury/ReceivedDebitService.php b/plugins/stripe-php/lib/Service/Treasury/ReceivedDebitService.php index 8d856881..a7564e63 100644 --- a/plugins/stripe-php/lib/Service/Treasury/ReceivedDebitService.php +++ b/plugins/stripe-php/lib/Service/Treasury/ReceivedDebitService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class ReceivedDebitService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class ReceivedDebitService extends \Stripe\Service\AbstractService /** * Returns a list of ReceivedDebits. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Treasury\ReceivedDebit> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -30,12 +31,12 @@ class ReceivedDebitService extends \Stripe\Service\AbstractService * ReceivedDebit ID from the ReceivedDebit list. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\ReceivedDebit + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Treasury/TransactionEntryService.php b/plugins/stripe-php/lib/Service/Treasury/TransactionEntryService.php index 52af51d5..979fd71d 100644 --- a/plugins/stripe-php/lib/Service/Treasury/TransactionEntryService.php +++ b/plugins/stripe-php/lib/Service/Treasury/TransactionEntryService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class TransactionEntryService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class TransactionEntryService extends \Stripe\Service\AbstractService /** * Retrieves a list of TransactionEntry objects. * - * @param null|array $params + * @param null|array{created?: array|int, effective_at?: array|int, ending_before?: string, expand?: string[], financial_account: string, limit?: int, order_by?: string, starting_after?: string, transaction?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Treasury\TransactionEntry> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class TransactionEntryService extends \Stripe\Service\AbstractService * Retrieves a TransactionEntry object. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\TransactionEntry + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/Treasury/TransactionService.php b/plugins/stripe-php/lib/Service/Treasury/TransactionService.php index 11eb6a54..4ef6beca 100644 --- a/plugins/stripe-php/lib/Service/Treasury/TransactionService.php +++ b/plugins/stripe-php/lib/Service/Treasury/TransactionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\Treasury; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class TransactionService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class TransactionService extends \Stripe\Service\AbstractService /** * Retrieves a list of Transaction objects. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], financial_account: string, limit?: int, order_by?: string, starting_after?: string, status?: string, status_transitions?: array{posted_at?: array|int}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\Treasury\Transaction> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -29,12 +30,12 @@ class TransactionService extends \Stripe\Service\AbstractService * Retrieves the details of an existing Transaction. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Treasury\Transaction + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/V2/Billing/MeterEventAdjustmentService.php b/plugins/stripe-php/lib/Service/V2/Billing/MeterEventAdjustmentService.php index c3c542e9..f4698a68 100644 --- a/plugins/stripe-php/lib/Service/V2/Billing/MeterEventAdjustmentService.php +++ b/plugins/stripe-php/lib/Service/V2/Billing/MeterEventAdjustmentService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\V2\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class MeterEventAdjustmentService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class MeterEventAdjustmentService extends \Stripe\Service\AbstractService /** * Creates a meter event adjustment to cancel a previously sent meter event. * - * @param null|array $params + * @param null|array{cancel: array{identifier: string}, event_name: string, type: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\Billing\MeterEventAdjustment + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/V2/Billing/MeterEventService.php b/plugins/stripe-php/lib/Service/V2/Billing/MeterEventService.php index 7a13a19a..857f10b0 100644 --- a/plugins/stripe-php/lib/Service/V2/Billing/MeterEventService.php +++ b/plugins/stripe-php/lib/Service/V2/Billing/MeterEventService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\V2\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class MeterEventService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class MeterEventService extends \Stripe\Service\AbstractService * asynchronously. Supports up to 1,000 events per second in livemode. For higher * rate-limits, please use meter event streams instead. * - * @param null|array $params + * @param null|array{event_name: string, identifier?: string, payload: array, timestamp?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\Billing\MeterEvent + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/V2/Billing/MeterEventSessionService.php b/plugins/stripe-php/lib/Service/V2/Billing/MeterEventSessionService.php index d1ca99da..b46ac83d 100644 --- a/plugins/stripe-php/lib/Service/V2/Billing/MeterEventSessionService.php +++ b/plugins/stripe-php/lib/Service/V2/Billing/MeterEventSessionService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\V2\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class MeterEventSessionService extends \Stripe\Service\AbstractService @@ -18,9 +19,9 @@ class MeterEventSessionService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\Billing\MeterEventSession + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/V2/Billing/MeterEventStreamService.php b/plugins/stripe-php/lib/Service/V2/Billing/MeterEventStreamService.php index e4ae2b7f..9d4d3a68 100644 --- a/plugins/stripe-php/lib/Service/V2/Billing/MeterEventStreamService.php +++ b/plugins/stripe-php/lib/Service/V2/Billing/MeterEventStreamService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\V2\Billing; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class MeterEventStreamService extends \Stripe\Service\AbstractService @@ -15,12 +16,12 @@ class MeterEventStreamService extends \Stripe\Service\AbstractService * Requires a meter event session for authentication. Supports up to 10,000 * requests per second in livemode. For even higher rate-limits, contact sales. * - * @param null|array $params + * @param null|array{events: array{event_name: string, identifier?: string, payload: array, timestamp?: string}[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\TemporarySessionExpiredException - * * @return void + * + * @throws \Stripe\Exception\TemporarySessionExpiredException */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/V2/Core/EventDestinationService.php b/plugins/stripe-php/lib/Service/V2/Core/EventDestinationService.php index b633967d..7524caa6 100644 --- a/plugins/stripe-php/lib/Service/V2/Core/EventDestinationService.php +++ b/plugins/stripe-php/lib/Service/V2/Core/EventDestinationService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\V2\Core; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class EventDestinationService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class EventDestinationService extends \Stripe\Service\AbstractService /** * Lists all event destinations. * - * @param null|array $params + * @param null|array{include?: string[], limit?: int} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\Collection<\Stripe\V2\EventDestination> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -28,12 +29,12 @@ class EventDestinationService extends \Stripe\Service\AbstractService /** * Create a new event destination. * - * @param null|array $params + * @param null|array{description?: string, enabled_events: string[], event_payload: string, events_from?: string[], include?: string[], metadata?: array, name: string, snapshot_api_version?: string, type: string, amazon_eventbridge?: array{aws_account_id: string, aws_region: string}, webhook_endpoint?: array{url: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\EventDestination + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -47,9 +48,9 @@ class EventDestinationService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\EventDestination + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -63,9 +64,9 @@ class EventDestinationService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\EventDestination + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function disable($id, $params = null, $opts = null) { @@ -79,9 +80,9 @@ class EventDestinationService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\EventDestination + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function enable($id, $params = null, $opts = null) { @@ -95,9 +96,9 @@ class EventDestinationService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\Event + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function ping($id, $params = null, $opts = null) { @@ -108,12 +109,12 @@ class EventDestinationService extends \Stripe\Service\AbstractService * Retrieves the details of an event destination. * * @param string $id - * @param null|array $params + * @param null|array{include?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\EventDestination + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -124,12 +125,12 @@ class EventDestinationService extends \Stripe\Service\AbstractService * Update the details of an event destination. * * @param string $id - * @param null|array $params + * @param null|array{description?: string, enabled_events?: string[], include?: string[], metadata?: array, name?: string, webhook_endpoint?: array{url: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\EventDestination + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/V2/Core/EventService.php b/plugins/stripe-php/lib/Service/V2/Core/EventService.php index fdc5aaaa..2e9bfd47 100644 --- a/plugins/stripe-php/lib/Service/V2/Core/EventService.php +++ b/plugins/stripe-php/lib/Service/V2/Core/EventService.php @@ -6,6 +6,7 @@ namespace Stripe\Service\V2\Core; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ class EventService extends \Stripe\Service\AbstractService @@ -13,12 +14,12 @@ class EventService extends \Stripe\Service\AbstractService /** * List events, going back up to 30 days. * - * @param null|array $params + * @param null|array{limit?: int, object_id: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\Collection<\Stripe\V2\Event> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -32,9 +33,9 @@ class EventService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\V2\Event + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/WebhookEndpointService.php b/plugins/stripe-php/lib/Service/WebhookEndpointService.php index 913f01a7..9ffb94be 100644 --- a/plugins/stripe-php/lib/Service/WebhookEndpointService.php +++ b/plugins/stripe-php/lib/Service/WebhookEndpointService.php @@ -6,19 +6,20 @@ namespace Stripe\Service; /** * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions + * * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions */ -class WebhookEndpointService extends \Stripe\Service\AbstractService +class WebhookEndpointService extends AbstractService { /** * Returns a list of your webhook endpoints. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\Collection<\Stripe\WebhookEndpoint> + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { @@ -36,12 +37,12 @@ class WebhookEndpointService extends \Stripe\Service\AbstractService * href="https://dashboard.stripe.com/account/webhooks">webhooks settings * section of the Dashboard. * - * @param null|array $params + * @param null|array{api_version?: string, connect?: bool, description?: null|string, enabled_events: string[], expand?: string[], metadata?: null|array, url: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\WebhookEndpoint + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { @@ -57,9 +58,9 @@ class WebhookEndpointService extends \Stripe\Service\AbstractService * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\WebhookEndpoint + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { @@ -70,12 +71,12 @@ class WebhookEndpointService extends \Stripe\Service\AbstractService * Retrieves the webhook endpoint with the given ID. * * @param string $id - * @param null|array $params + * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\WebhookEndpoint + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { @@ -87,12 +88,12 @@ class WebhookEndpointService extends \Stripe\Service\AbstractService * enabled_events, and the status of your endpoint. * * @param string $id - * @param null|array $params + * @param null|array{description?: null|string, disabled?: bool, enabled_events?: string[], expand?: string[], metadata?: null|array, url?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return \Stripe\WebhookEndpoint + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/SetupAttempt.php b/plugins/stripe-php/lib/SetupAttempt.php index e766c9b2..98da28fb 100644 --- a/plugins/stripe-php/lib/SetupAttempt.php +++ b/plugins/stripe-php/lib/SetupAttempt.php @@ -12,17 +12,17 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\Application $application The value of application on the SetupIntent at the time of this confirmation. + * @property null|Application|string $application The value of application on the SetupIntent at the time of this confirmation. * @property null|bool $attach_to_self

      If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.

      It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.

      * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer The value of customer on the SetupIntent at the time of this confirmation. + * @property null|Customer|string $customer The value of customer on the SetupIntent at the time of this confirmation. * @property null|string[] $flow_directions

      Indicates the directions of money movement for which this payment method is intended to be used.

      Include inbound if you intend to use the payment method as the origin to pull funds from. Include outbound if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.

      * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Account $on_behalf_of The value of on_behalf_of on the SetupIntent at the time of this confirmation. - * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupAttempt. - * @property \Stripe\StripeObject $payment_method_details - * @property null|\Stripe\StripeObject $setup_error The error encountered during this attempt to confirm the SetupIntent, if any. - * @property string|\Stripe\SetupIntent $setup_intent ID of the SetupIntent that this attempt belongs to. + * @property null|Account|string $on_behalf_of The value of on_behalf_of on the SetupIntent at the time of this confirmation. + * @property PaymentMethod|string $payment_method ID of the payment method used with this SetupAttempt. + * @property (object{acss_debit?: (object{}&StripeObject), amazon_pay?: (object{}&StripeObject), au_becs_debit?: (object{}&StripeObject), bacs_debit?: (object{}&StripeObject), bancontact?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), boleto?: (object{}&StripeObject), card?: (object{brand: null|string, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description?: null|string, exp_month: null|int, exp_year: null|int, fingerprint?: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, network: null|string, three_d_secure: null|(object{authentication_flow: null|string, electronic_commerce_indicator: null|string, result: null|string, result_reason: null|string, transaction_id: null|string, version: null|string}&StripeObject), wallet: null|(object{apple_pay?: (object{}&StripeObject), google_pay?: (object{}&StripeObject), type: string}&StripeObject)}&StripeObject), card_present?: (object{generated_card: null|PaymentMethod|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject)}&StripeObject), cashapp?: (object{}&StripeObject), ideal?: (object{bank: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, verified_name: null|string}&StripeObject), kakao_pay?: (object{}&StripeObject), klarna?: (object{}&StripeObject), kr_card?: (object{}&StripeObject), link?: (object{}&StripeObject), naver_pay?: (object{buyer_id?: string}&StripeObject), nz_bank_account?: (object{}&StripeObject), paypal?: (object{}&StripeObject), revolut_pay?: (object{}&StripeObject), sepa_debit?: (object{}&StripeObject), sofort?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), type: string, us_bank_account?: (object{}&StripeObject)}&StripeObject) $payment_method_details + * @property null|(object{advice_code?: string, charge?: string, code?: string, decline_code?: string, doc_url?: string, message?: string, network_advice_code?: string, network_decline_code?: string, param?: string, payment_intent?: PaymentIntent, payment_method?: PaymentMethod, payment_method_type?: string, request_log_url?: string, setup_intent?: SetupIntent, source?: Account|BankAccount|Card|Source, type: string}&StripeObject) $setup_error The error encountered during this attempt to confirm the SetupIntent, if any. + * @property SetupIntent|string $setup_intent ID of the SetupIntent that this attempt belongs to. * @property string $status Status of this SetupAttempt, one of requires_confirmation, requires_action, processing, succeeded, failed, or abandoned. * @property string $usage The value of usage on the SetupIntent at the time of this confirmation, one of off_session or on_session. */ @@ -33,17 +33,17 @@ class SetupAttempt extends ApiResource /** * Returns a list of SetupAttempts that associate with a provided SetupIntent. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, setup_intent: string, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\SetupAttempt> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } } diff --git a/plugins/stripe-php/lib/SetupIntent.php b/plugins/stripe-php/lib/SetupIntent.php index d4010f4a..6f7340e2 100644 --- a/plugins/stripe-php/lib/SetupIntent.php +++ b/plugins/stripe-php/lib/SetupIntent.php @@ -29,27 +29,27 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\Application $application ID of the Connect application that created the SetupIntent. + * @property null|Application|string $application ID of the Connect application that created the SetupIntent. * @property null|bool $attach_to_self

      If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.

      It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.

      - * @property null|\Stripe\StripeObject $automatic_payment_methods Settings for dynamic payment methods compatible with this Setup Intent + * @property null|(object{allow_redirects?: string, enabled: null|bool}&StripeObject) $automatic_payment_methods Settings for dynamic payment methods compatible with this Setup Intent * @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate. * @property null|string $client_secret

      The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.

      The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

      * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer

      ID of the Customer this SetupIntent belongs to, if one exists.

      If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

      + * @property null|Customer|string $customer

      ID of the Customer this SetupIntent belongs to, if one exists.

      If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

      * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|string[] $flow_directions

      Indicates the directions of money movement for which this payment method is intended to be used.

      Include inbound if you intend to use the payment method as the origin to pull funds from. Include outbound if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.

      - * @property null|\Stripe\StripeObject $last_setup_error The error encountered in the previous SetupIntent confirmation. - * @property null|string|\Stripe\SetupAttempt $latest_attempt The most recent SetupAttempt for this SetupIntent. + * @property null|(object{advice_code?: string, charge?: string, code?: string, decline_code?: string, doc_url?: string, message?: string, network_advice_code?: string, network_decline_code?: string, param?: string, payment_intent?: PaymentIntent, payment_method?: PaymentMethod, payment_method_type?: string, request_log_url?: string, setup_intent?: SetupIntent, source?: Account|BankAccount|Card|Source, type: string}&StripeObject) $last_setup_error The error encountered in the previous SetupIntent confirmation. + * @property null|SetupAttempt|string $latest_attempt The most recent SetupAttempt for this SetupIntent. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Mandate $mandate ID of the multi use Mandate generated by the SetupIntent. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended. - * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent. If the payment method is card_present and isn't a digital wallet, then the generated_card associated with the latest_attempt is attached to the Customer instead. - * @property null|\Stripe\StripeObject $payment_method_configuration_details Information about the payment method configuration used for this Setup Intent. - * @property null|\Stripe\StripeObject $payment_method_options Payment method-specific configuration for this SetupIntent. + * @property null|Mandate|string $mandate ID of the multi use Mandate generated by the SetupIntent. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|(object{cashapp_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, mobile_auth_url: string, qr_code: (object{expires_at: int, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), redirect_to_url?: (object{return_url: null|string, url: null|string}&StripeObject), type: string, use_stripe_sdk?: StripeObject, verify_with_microdeposits?: (object{arrival_date: int, hosted_verification_url: string, microdeposit_type: null|string}&StripeObject)}&StripeObject) $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + * @property null|Account|string $on_behalf_of The account (if any) for which the setup is intended. + * @property null|PaymentMethod|string $payment_method ID of the payment method used with this SetupIntent. If the payment method is card_present and isn't a digital wallet, then the generated_card associated with the latest_attempt is attached to the Customer instead. + * @property null|(object{id: string, parent: null|string}&StripeObject) $payment_method_configuration_details Information about the payment method configuration used for this Setup Intent. + * @property null|(object{acss_debit?: (object{currency: null|string, mandate_options?: (object{custom_mandate_url?: string, default_for?: string[], interval_description: null|string, payment_schedule: null|string, transaction_type: null|string}&StripeObject), verification_method?: string}&StripeObject), amazon_pay?: (object{}&StripeObject), bacs_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject)}&StripeObject), card?: (object{mandate_options: null|(object{amount: int, amount_type: string, currency: string, description: null|string, end_date: null|int, interval: string, interval_count: null|int, reference: string, start_date: int, supported_types: null|string[]}&StripeObject), network: null|string, request_three_d_secure: null|string}&StripeObject), card_present?: (object{}&StripeObject), link?: (object{persistent_token: null|string}&StripeObject), paypal?: (object{billing_agreement_id: null|string}&StripeObject), sepa_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject)}&StripeObject), us_bank_account?: (object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&StripeObject), permissions?: string[], prefetch: null|string[], return_url?: string}&StripeObject), mandate_options?: (object{collection_method?: string}&StripeObject), verification_method?: string}&StripeObject)}&StripeObject) $payment_method_options Payment method-specific configuration for this SetupIntent. * @property string[] $payment_method_types The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. - * @property null|string|\Stripe\Mandate $single_use_mandate ID of the single_use Mandate generated by the SetupIntent. + * @property null|Mandate|string $single_use_mandate ID of the single_use Mandate generated by the SetupIntent. * @property string $status Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded. * @property string $usage

      Indicates how the payment method is intended to be used in the future.

      Use on_session if you intend to only reuse the payment method when the customer is in your checkout flow. Use off_session if your customer may or may not be in your checkout flow. If not provided, this value defaults to off_session.

      */ @@ -77,12 +77,12 @@ class SetupIntent extends ApiResource * href="/docs/api/setup_intents/confirm">confirm it to collect any required * permissions to charge the payment method later. * - * @param null|array $params + * @param null|array{attach_to_self?: bool, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, confirm?: bool, confirmation_token?: string, customer?: string, description?: string, expand?: string[], flow_directions?: string[], mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, on_behalf_of?: string, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[], return_url?: string, single_use?: array{amount: int, currency: string}, usage?: string, use_stripe_sdk?: bool} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SetupIntent the created resource * - * @return \Stripe\SetupIntent the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -90,7 +90,7 @@ class SetupIntent extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -99,18 +99,18 @@ class SetupIntent extends ApiResource /** * Returns a list of SetupIntents. * - * @param null|array $params + * @param null|array{attach_to_self?: bool, created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, payment_method?: string, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\SetupIntent> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -126,13 +126,13 @@ class SetupIntent extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SetupIntent * - * @return \Stripe\SetupIntent + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -143,12 +143,12 @@ class SetupIntent extends ApiResource * Updates a SetupIntent object. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{attach_to_self?: bool, customer?: string, description?: string, expand?: string[], flow_directions?: string[], metadata?: null|array, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[]} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SetupIntent the updated resource * - * @return \Stripe\SetupIntent the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -156,7 +156,7 @@ class SetupIntent extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -166,9 +166,9 @@ class SetupIntent extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SetupIntent the canceled setup intent * - * @return \Stripe\SetupIntent the canceled setup intent + * @throws Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { @@ -183,9 +183,9 @@ class SetupIntent extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SetupIntent the confirmed setup intent * - * @return \Stripe\SetupIntent the confirmed setup intent + * @throws Exception\ApiErrorException if the request fails */ public function confirm($params = null, $opts = null) { @@ -200,9 +200,9 @@ class SetupIntent extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SetupIntent the verified setup intent * - * @return \Stripe\SetupIntent the verified setup intent + * @throws Exception\ApiErrorException if the request fails */ public function verifyMicrodeposits($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/ShippingRate.php b/plugins/stripe-php/lib/ShippingRate.php index e90b40c0..140d9e2b 100644 --- a/plugins/stripe-php/lib/ShippingRate.php +++ b/plugins/stripe-php/lib/ShippingRate.php @@ -12,13 +12,13 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Whether the shipping rate can be used for new purchases. Defaults to true. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $delivery_estimate The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + * @property null|(object{maximum: null|(object{unit: string, value: int}&StripeObject), minimum: null|(object{unit: string, value: int}&StripeObject)}&StripeObject) $delivery_estimate The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. * @property null|string $display_name The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. - * @property null|\Stripe\StripeObject $fixed_amount + * @property null|(object{amount: int, currency: string, currency_options?: StripeObject}&StripeObject) $fixed_amount * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $tax_behavior Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. - * @property null|string|\Stripe\TaxCode $tax_code A tax code ID. The Shipping tax code is txcd_92010001. + * @property null|string|TaxCode $tax_code A tax code ID. The Shipping tax code is txcd_92010001. * @property string $type The type of calculation to use on the shipping rate. */ class ShippingRate extends ApiResource @@ -36,12 +36,12 @@ class ShippingRate extends ApiResource /** * Creates a new shipping rate object. * - * @param null|array $params + * @param null|array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, expand?: string[], fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ShippingRate the created resource * - * @return \Stripe\ShippingRate the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -49,7 +49,7 @@ class ShippingRate extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -58,18 +58,18 @@ class ShippingRate extends ApiResource /** * Returns a list of your shipping rates. * - * @param null|array $params + * @param null|array{active?: bool, created?: array|int, currency?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\ShippingRate> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -78,13 +78,13 @@ class ShippingRate extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ShippingRate * - * @return \Stripe\ShippingRate + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -95,12 +95,12 @@ class ShippingRate extends ApiResource * Updates an existing shipping rate object. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{active?: bool, expand?: string[], fixed_amount?: array{currency_options?: array}, metadata?: null|array, tax_behavior?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ShippingRate the updated resource * - * @return \Stripe\ShippingRate the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -108,7 +108,7 @@ class ShippingRate extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/Sigma/ScheduledQueryRun.php b/plugins/stripe-php/lib/Sigma/ScheduledQueryRun.php index 5efd1cd8..002de439 100644 --- a/plugins/stripe-php/lib/Sigma/ScheduledQueryRun.php +++ b/plugins/stripe-php/lib/Sigma/ScheduledQueryRun.php @@ -14,7 +14,7 @@ namespace Stripe\Sigma; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property int $data_load_time When the query was run, Sigma contained a snapshot of your Stripe data at this time. - * @property null|\Stripe\StripeObject $error + * @property null|(object{message: string}&\Stripe\StripeObject) $error * @property null|\Stripe\File $file The file object representing the results of the query. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property int $result_available_until Time at which the result expires and is no longer available for download. @@ -29,12 +29,12 @@ class ScheduledQueryRun extends \Stripe\ApiResource /** * Returns a list of scheduled query runs. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Sigma\ScheduledQueryRun> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -49,9 +49,9 @@ class ScheduledQueryRun extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ScheduledQueryRun * - * @return \Stripe\Sigma\ScheduledQueryRun + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Source.php b/plugins/stripe-php/lib/Source.php index 2e8aa0d5..4643e732 100644 --- a/plugins/stripe-php/lib/Source.php +++ b/plugins/stripe-php/lib/Source.php @@ -18,43 +18,43 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $ach_credit_transfer - * @property null|\Stripe\StripeObject $ach_debit - * @property null|\Stripe\StripeObject $acss_debit - * @property null|\Stripe\StripeObject $alipay + * @property null|(object{account_number?: null|string, bank_name?: null|string, fingerprint?: null|string, refund_account_holder_name?: null|string, refund_account_holder_type?: null|string, refund_routing_number?: null|string, routing_number?: null|string, swift_code?: null|string}&StripeObject) $ach_credit_transfer + * @property null|(object{bank_name?: null|string, country?: null|string, fingerprint?: null|string, last4?: null|string, routing_number?: null|string, type?: null|string}&StripeObject) $ach_debit + * @property null|(object{bank_address_city?: null|string, bank_address_line_1?: null|string, bank_address_line_2?: null|string, bank_address_postal_code?: null|string, bank_name?: null|string, category?: null|string, country?: null|string, fingerprint?: null|string, last4?: null|string, routing_number?: null|string}&StripeObject) $acss_debit + * @property null|(object{data_string?: null|string, native_url?: null|string, statement_descriptor?: null|string}&StripeObject) $alipay * @property null|string $allow_redisplay This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. * @property null|int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. - * @property null|\Stripe\StripeObject $au_becs_debit - * @property null|\Stripe\StripeObject $bancontact - * @property null|\Stripe\StripeObject $card - * @property null|\Stripe\StripeObject $card_present + * @property null|(object{bsb_number?: null|string, fingerprint?: null|string, last4?: null|string}&StripeObject) $au_becs_debit + * @property null|(object{bank_code?: null|string, bank_name?: null|string, bic?: null|string, iban_last4?: null|string, preferred_language?: null|string, statement_descriptor?: null|string}&StripeObject) $bancontact + * @property null|(object{address_line1_check?: null|string, address_zip_check?: null|string, brand?: null|string, country?: null|string, cvc_check?: null|string, description?: string, dynamic_last4?: null|string, exp_month?: null|int, exp_year?: null|int, fingerprint?: string, funding?: null|string, iin?: string, issuer?: string, last4?: null|string, name?: null|string, three_d_secure?: string, tokenization_method?: null|string}&StripeObject) $card + * @property null|(object{application_cryptogram?: string, application_preferred_name?: string, authorization_code?: null|string, authorization_response_code?: string, brand?: null|string, country?: null|string, cvm_type?: string, data_type?: null|string, dedicated_file_name?: string, description?: string, emv_auth_data?: string, evidence_customer_signature?: null|string, evidence_transaction_certificate?: null|string, exp_month?: null|int, exp_year?: null|int, fingerprint?: string, funding?: null|string, iin?: string, issuer?: string, last4?: null|string, pos_device_id?: null|string, pos_entry_mode?: string, read_method?: null|string, reader?: null|string, terminal_verification_results?: string, transaction_status_information?: string}&StripeObject) $card_present * @property string $client_secret The client secret of the source. Used for client-side retrieval using a publishable key. - * @property null|\Stripe\StripeObject $code_verification + * @property null|(object{attempts_remaining: int, status: string}&StripeObject) $code_verification * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources. * @property null|string $customer The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. - * @property null|\Stripe\StripeObject $eps + * @property null|(object{reference?: null|string, statement_descriptor?: null|string}&StripeObject) $eps * @property string $flow The authentication flow of the source. flow is one of redirect, receiver, code_verification, none. - * @property null|\Stripe\StripeObject $giropay - * @property null|\Stripe\StripeObject $ideal - * @property null|\Stripe\StripeObject $klarna + * @property null|(object{bank_code?: null|string, bank_name?: null|string, bic?: null|string, statement_descriptor?: null|string}&StripeObject) $giropay + * @property null|(object{bank?: null|string, bic?: null|string, iban_last4?: null|string, statement_descriptor?: null|string}&StripeObject) $ideal + * @property null|(object{background_image_url?: string, client_token?: null|string, first_name?: string, last_name?: string, locale?: string, logo_url?: string, page_title?: string, pay_later_asset_urls_descriptive?: string, pay_later_asset_urls_standard?: string, pay_later_name?: string, pay_later_redirect_url?: string, pay_now_asset_urls_descriptive?: string, pay_now_asset_urls_standard?: string, pay_now_name?: string, pay_now_redirect_url?: string, pay_over_time_asset_urls_descriptive?: string, pay_over_time_asset_urls_standard?: string, pay_over_time_name?: string, pay_over_time_redirect_url?: string, payment_method_categories?: string, purchase_country?: string, purchase_type?: string, redirect_url?: string, shipping_delay?: int, shipping_first_name?: string, shipping_last_name?: string}&StripeObject) $klarna * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $multibanco - * @property null|\Stripe\StripeObject $owner Information about the owner of the payment instrument that may be used or required by particular source types. - * @property null|\Stripe\StripeObject $p24 - * @property null|\Stripe\StripeObject $receiver - * @property null|\Stripe\StripeObject $redirect - * @property null|\Stripe\StripeObject $sepa_credit_transfer - * @property null|\Stripe\StripeObject $sepa_debit - * @property null|\Stripe\StripeObject $sofort - * @property null|\Stripe\StripeObject $source_order + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|(object{entity?: null|string, reference?: null|string, refund_account_holder_address_city?: null|string, refund_account_holder_address_country?: null|string, refund_account_holder_address_line1?: null|string, refund_account_holder_address_line2?: null|string, refund_account_holder_address_postal_code?: null|string, refund_account_holder_address_state?: null|string, refund_account_holder_name?: null|string, refund_iban?: null|string}&StripeObject) $multibanco + * @property null|(object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string, verified_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), verified_email: null|string, verified_name: null|string, verified_phone: null|string}&StripeObject) $owner Information about the owner of the payment instrument that may be used or required by particular source types. + * @property null|(object{reference?: null|string}&StripeObject) $p24 + * @property null|(object{address: null|string, amount_charged: int, amount_received: int, amount_returned: int, refund_attributes_method: string, refund_attributes_status: string}&StripeObject) $receiver + * @property null|(object{failure_reason: null|string, return_url: string, status: string, url: string}&StripeObject) $redirect + * @property null|(object{bank_name?: null|string, bic?: null|string, iban?: null|string, refund_account_holder_address_city?: null|string, refund_account_holder_address_country?: null|string, refund_account_holder_address_line1?: null|string, refund_account_holder_address_line2?: null|string, refund_account_holder_address_postal_code?: null|string, refund_account_holder_address_state?: null|string, refund_account_holder_name?: null|string, refund_iban?: null|string}&StripeObject) $sepa_credit_transfer + * @property null|(object{bank_code?: null|string, branch_code?: null|string, country?: null|string, fingerprint?: null|string, last4?: null|string, mandate_reference?: null|string, mandate_url?: null|string}&StripeObject) $sepa_debit + * @property null|(object{bank_code?: null|string, bank_name?: null|string, bic?: null|string, country?: null|string, iban_last4?: null|string, preferred_language?: null|string, statement_descriptor?: null|string}&StripeObject) $sofort + * @property null|(object{amount: int, currency: string, email?: string, items: null|((object{amount: null|int, currency: null|string, description: null|string, parent: null|string, quantity?: int, type: null|string}&StripeObject))[], shipping?: (object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), carrier?: null|string, name?: string, phone?: null|string, tracking_number?: null|string}&StripeObject)}&StripeObject) $source_order * @property null|string $statement_descriptor Extra information about a source. This will appear on your customer's statement every time you charge the source. * @property string $status The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge. - * @property null|\Stripe\StripeObject $three_d_secure + * @property null|(object{address_line1_check?: null|string, address_zip_check?: null|string, authenticated?: null|bool, brand?: null|string, card?: null|string, country?: null|string, customer?: null|string, cvc_check?: null|string, description?: string, dynamic_last4?: null|string, exp_month?: null|int, exp_year?: null|int, fingerprint?: string, funding?: null|string, iin?: string, issuer?: string, last4?: null|string, name?: null|string, three_d_secure?: string, tokenization_method?: null|string}&StripeObject) $three_d_secure * @property string $type The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used. * @property null|string $usage Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. - * @property null|\Stripe\StripeObject $wechat + * @property null|(object{prepay_id?: string, qr_code_url?: null|string, statement_descriptor?: string}&StripeObject) $wechat */ class Source extends ApiResource { @@ -103,12 +103,12 @@ class Source extends ApiResource /** * Creates a new source object. * - * @param null|array $params + * @param null|array{amount?: int, currency?: string, customer?: string, expand?: string[], flow?: string, mandate?: array{acceptance?: array{date?: int, ip?: string, offline?: array{contact_email: string}, online?: array{date?: int, ip?: string, user_agent?: string}, status: string, type?: string, user_agent?: string}, amount?: null|int, currency?: string, interval?: string, notification_method?: string}, metadata?: array, original_source?: string, owner?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: string, name?: string, phone?: string}, receiver?: array{refund_attributes_method?: string}, redirect?: array{return_url: string}, source_order?: array{items?: array{amount?: int, currency?: string, description?: string, parent?: string, quantity?: int, type?: string}[], shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name?: string, phone?: string, tracking_number?: string}}, statement_descriptor?: string, token?: string, type?: string, usage?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Source the created resource * - * @return \Stripe\Source the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -116,7 +116,7 @@ class Source extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -130,13 +130,13 @@ class Source extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Source * - * @return \Stripe\Source + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -153,12 +153,12 @@ class Source extends ApiResource * guides for more detail. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{amount?: int, expand?: string[], mandate?: array{acceptance?: array{date?: int, ip?: string, offline?: array{contact_email: string}, online?: array{date?: int, ip?: string, user_agent?: string}, status: string, type?: string, user_agent?: string}, amount?: null|int, currency?: string, interval?: string, notification_method?: string}, metadata?: null|array, owner?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: string, name?: string, phone?: string}, source_order?: array{items?: array{amount?: int, currency?: string, description?: string, parent?: string, quantity?: int, type?: string}[], shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name?: string, phone?: string, tracking_number?: string}}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Source the updated resource * - * @return \Stripe\Source the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -166,7 +166,7 @@ class Source extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -178,10 +178,10 @@ class Source extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\UnexpectedValueException if the source is not attached to a customer - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Source the detached source * - * @return \Stripe\Source the detached source + * @throws Exception\UnexpectedValueException if the source is not attached to a customer + * @throws Exception\ApiErrorException if the request fails */ public function detach($params = null, $opts = null) { @@ -218,15 +218,15 @@ class Source extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection list of source transactions * - * @return \Stripe\Collection<\Stripe\SourceTransaction> list of source transactions + * @throws Exception\ApiErrorException if the request fails */ public static function allSourceTransactions($id, $params = null, $opts = null) { $url = static::resourceUrl($id) . '/source_transactions'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -236,9 +236,9 @@ class Source extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Source the verified source * - * @return \Stripe\Source the verified source + * @throws Exception\ApiErrorException if the request fails */ public function verify($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/SourceMandateNotification.php b/plugins/stripe-php/lib/SourceMandateNotification.php index 11960527..d4e8c907 100644 --- a/plugins/stripe-php/lib/SourceMandateNotification.php +++ b/plugins/stripe-php/lib/SourceMandateNotification.php @@ -11,14 +11,14 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $acss_debit + * @property null|(object{statement_descriptor?: string}&StripeObject) $acss_debit * @property null|int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount associated with the mandate notification. The amount is expressed in the currency of the underlying source. Required if the notification type is debit_initiated. - * @property null|\Stripe\StripeObject $bacs_debit + * @property null|(object{last4?: string}&StripeObject) $bacs_debit * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $reason The reason of the mandate notification. Valid reasons are mandate_confirmed or debit_initiated. - * @property null|\Stripe\StripeObject $sepa_debit - * @property \Stripe\Source $source

      Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

      Stripe doesn't recommend using the deprecated Sources API. We recommend that you adopt the PaymentMethods API. This newer API provides access to our latest features and payment method types.

      Related guides: Sources API and Sources & Customers.

      + * @property null|(object{creditor_identifier?: string, last4?: string, mandate_reference?: string}&StripeObject) $sepa_debit + * @property Source $source

      Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

      Stripe doesn't recommend using the deprecated Sources API. We recommend that you adopt the PaymentMethods API. This newer API provides access to our latest features and payment method types.

      Related guides: Sources API and Sources & Customers.

      * @property string $status The status of the mandate notification. Valid statuses are pending or submitted. * @property string $type The type of source this mandate notification is attached to. Should be the source type identifier code for the payment method, such as three_d_secure. */ diff --git a/plugins/stripe-php/lib/SourceTransaction.php b/plugins/stripe-php/lib/SourceTransaction.php index 38c218e0..79966b75 100644 --- a/plugins/stripe-php/lib/SourceTransaction.php +++ b/plugins/stripe-php/lib/SourceTransaction.php @@ -12,15 +12,15 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $ach_credit_transfer + * @property null|(object{customer_data?: string, fingerprint?: string, last4?: string, routing_number?: string}&StripeObject) $ach_credit_transfer * @property int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount your customer has pushed to the receiver. - * @property null|\Stripe\StripeObject $chf_credit_transfer + * @property null|(object{reference?: string, sender_address_country?: string, sender_address_line1?: string, sender_iban?: string, sender_name?: string}&StripeObject) $chf_credit_transfer * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|\Stripe\StripeObject $gbp_credit_transfer + * @property null|(object{fingerprint?: string, funding_method?: string, last4?: string, reference?: string, sender_account_number?: string, sender_name?: string, sender_sort_code?: string}&StripeObject) $gbp_credit_transfer * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $paper_check - * @property null|\Stripe\StripeObject $sepa_credit_transfer + * @property null|(object{available_at?: string, invoices?: string}&StripeObject) $paper_check + * @property null|(object{reference?: string, sender_iban?: string, sender_name?: string}&StripeObject) $sepa_credit_transfer * @property string $source The ID of the source this transaction is attached to. * @property string $status The status of the transaction, one of succeeded, pending, or failed. * @property string $type The type of source this transaction is attached to. diff --git a/plugins/stripe-php/lib/Stripe.php b/plugins/stripe-php/lib/Stripe.php index 14285a5e..dd454283 100644 --- a/plugins/stripe-php/lib/Stripe.php +++ b/plugins/stripe-php/lib/Stripe.php @@ -23,7 +23,7 @@ class Stripe public static $apiUploadBase = 'https://files.stripe.com'; /** @var string The version of the Stripe API to use for requests. */ - public static $apiVersion = \Stripe\Util\ApiVersion::CURRENT; + public static $apiVersion = Util\ApiVersion::CURRENT; /** @var null|string The account ID for connected accounts requests. */ public static $accountId = null; @@ -64,7 +64,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '16.4.0'; + const VERSION = '17.2.1'; /** * @return string the API key used for requests @@ -230,7 +230,9 @@ class Stripe } /** - * @param int $maxNetworkRetries Maximum number of request retries + * > NOTE: this value is only read during client creation, so creating a client and _then_ calling this method won't affect your client's behavior. + * + * @param int $maxNetworkRetries maximum number of request retries */ public static function setMaxNetworkRetries($maxNetworkRetries) { diff --git a/plugins/stripe-php/lib/StripeClient.php b/plugins/stripe-php/lib/StripeClient.php index f8c07d4d..ffa39193 100644 --- a/plugins/stripe-php/lib/StripeClient.php +++ b/plugins/stripe-php/lib/StripeClient.php @@ -5,83 +5,84 @@ namespace Stripe; /** * Client used to send requests to Stripe's API. * - * @property \Stripe\Service\OAuthService $oauth + * @property Service\OAuthService $oauth * // The beginning of the section generated from our OpenAPI spec - * @property \Stripe\Service\AccountLinkService $accountLinks - * @property \Stripe\Service\AccountService $accounts - * @property \Stripe\Service\AccountSessionService $accountSessions - * @property \Stripe\Service\ApplePayDomainService $applePayDomains - * @property \Stripe\Service\ApplicationFeeService $applicationFees - * @property \Stripe\Service\Apps\AppsServiceFactory $apps - * @property \Stripe\Service\BalanceService $balance - * @property \Stripe\Service\BalanceTransactionService $balanceTransactions - * @property \Stripe\Service\Billing\BillingServiceFactory $billing - * @property \Stripe\Service\BillingPortal\BillingPortalServiceFactory $billingPortal - * @property \Stripe\Service\ChargeService $charges - * @property \Stripe\Service\Checkout\CheckoutServiceFactory $checkout - * @property \Stripe\Service\Climate\ClimateServiceFactory $climate - * @property \Stripe\Service\ConfirmationTokenService $confirmationTokens - * @property \Stripe\Service\CountrySpecService $countrySpecs - * @property \Stripe\Service\CouponService $coupons - * @property \Stripe\Service\CreditNoteService $creditNotes - * @property \Stripe\Service\CustomerService $customers - * @property \Stripe\Service\CustomerSessionService $customerSessions - * @property \Stripe\Service\DisputeService $disputes - * @property \Stripe\Service\Entitlements\EntitlementsServiceFactory $entitlements - * @property \Stripe\Service\EphemeralKeyService $ephemeralKeys - * @property \Stripe\Service\EventService $events - * @property \Stripe\Service\ExchangeRateService $exchangeRates - * @property \Stripe\Service\FileLinkService $fileLinks - * @property \Stripe\Service\FileService $files - * @property \Stripe\Service\FinancialConnections\FinancialConnectionsServiceFactory $financialConnections - * @property \Stripe\Service\Forwarding\ForwardingServiceFactory $forwarding - * @property \Stripe\Service\Identity\IdentityServiceFactory $identity - * @property \Stripe\Service\InvoiceItemService $invoiceItems - * @property \Stripe\Service\InvoiceRenderingTemplateService $invoiceRenderingTemplates - * @property \Stripe\Service\InvoiceService $invoices - * @property \Stripe\Service\Issuing\IssuingServiceFactory $issuing - * @property \Stripe\Service\MandateService $mandates - * @property \Stripe\Service\PaymentIntentService $paymentIntents - * @property \Stripe\Service\PaymentLinkService $paymentLinks - * @property \Stripe\Service\PaymentMethodConfigurationService $paymentMethodConfigurations - * @property \Stripe\Service\PaymentMethodDomainService $paymentMethodDomains - * @property \Stripe\Service\PaymentMethodService $paymentMethods - * @property \Stripe\Service\PayoutService $payouts - * @property \Stripe\Service\PlanService $plans - * @property \Stripe\Service\PriceService $prices - * @property \Stripe\Service\ProductService $products - * @property \Stripe\Service\PromotionCodeService $promotionCodes - * @property \Stripe\Service\QuoteService $quotes - * @property \Stripe\Service\Radar\RadarServiceFactory $radar - * @property \Stripe\Service\RefundService $refunds - * @property \Stripe\Service\Reporting\ReportingServiceFactory $reporting - * @property \Stripe\Service\ReviewService $reviews - * @property \Stripe\Service\SetupAttemptService $setupAttempts - * @property \Stripe\Service\SetupIntentService $setupIntents - * @property \Stripe\Service\ShippingRateService $shippingRates - * @property \Stripe\Service\Sigma\SigmaServiceFactory $sigma - * @property \Stripe\Service\SourceService $sources - * @property \Stripe\Service\SubscriptionItemService $subscriptionItems - * @property \Stripe\Service\SubscriptionService $subscriptions - * @property \Stripe\Service\SubscriptionScheduleService $subscriptionSchedules - * @property \Stripe\Service\Tax\TaxServiceFactory $tax - * @property \Stripe\Service\TaxCodeService $taxCodes - * @property \Stripe\Service\TaxIdService $taxIds - * @property \Stripe\Service\TaxRateService $taxRates - * @property \Stripe\Service\Terminal\TerminalServiceFactory $terminal - * @property \Stripe\Service\TestHelpers\TestHelpersServiceFactory $testHelpers - * @property \Stripe\Service\TokenService $tokens - * @property \Stripe\Service\TopupService $topups - * @property \Stripe\Service\TransferService $transfers - * @property \Stripe\Service\Treasury\TreasuryServiceFactory $treasury - * @property \Stripe\Service\V2\V2ServiceFactory $v2 - * @property \Stripe\Service\WebhookEndpointService $webhookEndpoints + * @property Service\AccountLinkService $accountLinks + * @property Service\AccountService $accounts + * @property Service\AccountSessionService $accountSessions + * @property Service\ApplePayDomainService $applePayDomains + * @property Service\ApplicationFeeService $applicationFees + * @property Service\Apps\AppsServiceFactory $apps + * @property Service\BalanceService $balance + * @property Service\BalanceTransactionService $balanceTransactions + * @property Service\Billing\BillingServiceFactory $billing + * @property Service\BillingPortal\BillingPortalServiceFactory $billingPortal + * @property Service\ChargeService $charges + * @property Service\Checkout\CheckoutServiceFactory $checkout + * @property Service\Climate\ClimateServiceFactory $climate + * @property Service\ConfirmationTokenService $confirmationTokens + * @property Service\CountrySpecService $countrySpecs + * @property Service\CouponService $coupons + * @property Service\CreditNoteService $creditNotes + * @property Service\CustomerService $customers + * @property Service\CustomerSessionService $customerSessions + * @property Service\DisputeService $disputes + * @property Service\Entitlements\EntitlementsServiceFactory $entitlements + * @property Service\EphemeralKeyService $ephemeralKeys + * @property Service\EventService $events + * @property Service\ExchangeRateService $exchangeRates + * @property Service\FileLinkService $fileLinks + * @property Service\FileService $files + * @property Service\FinancialConnections\FinancialConnectionsServiceFactory $financialConnections + * @property Service\Forwarding\ForwardingServiceFactory $forwarding + * @property Service\Identity\IdentityServiceFactory $identity + * @property Service\InvoiceItemService $invoiceItems + * @property Service\InvoicePaymentService $invoicePayments + * @property Service\InvoiceRenderingTemplateService $invoiceRenderingTemplates + * @property Service\InvoiceService $invoices + * @property Service\Issuing\IssuingServiceFactory $issuing + * @property Service\MandateService $mandates + * @property Service\PaymentIntentService $paymentIntents + * @property Service\PaymentLinkService $paymentLinks + * @property Service\PaymentMethodConfigurationService $paymentMethodConfigurations + * @property Service\PaymentMethodDomainService $paymentMethodDomains + * @property Service\PaymentMethodService $paymentMethods + * @property Service\PayoutService $payouts + * @property Service\PlanService $plans + * @property Service\PriceService $prices + * @property Service\ProductService $products + * @property Service\PromotionCodeService $promotionCodes + * @property Service\QuoteService $quotes + * @property Service\Radar\RadarServiceFactory $radar + * @property Service\RefundService $refunds + * @property Service\Reporting\ReportingServiceFactory $reporting + * @property Service\ReviewService $reviews + * @property Service\SetupAttemptService $setupAttempts + * @property Service\SetupIntentService $setupIntents + * @property Service\ShippingRateService $shippingRates + * @property Service\Sigma\SigmaServiceFactory $sigma + * @property Service\SourceService $sources + * @property Service\SubscriptionItemService $subscriptionItems + * @property Service\SubscriptionService $subscriptions + * @property Service\SubscriptionScheduleService $subscriptionSchedules + * @property Service\Tax\TaxServiceFactory $tax + * @property Service\TaxCodeService $taxCodes + * @property Service\TaxIdService $taxIds + * @property Service\TaxRateService $taxRates + * @property Service\Terminal\TerminalServiceFactory $terminal + * @property Service\TestHelpers\TestHelpersServiceFactory $testHelpers + * @property Service\TokenService $tokens + * @property Service\TopupService $topups + * @property Service\TransferService $transfers + * @property Service\Treasury\TreasuryServiceFactory $treasury + * @property Service\V2\V2ServiceFactory $v2 + * @property Service\WebhookEndpointService $webhookEndpoints * // The end of the section generated from our OpenAPI spec */ class StripeClient extends BaseStripeClient { /** - * @var \Stripe\Service\CoreServiceFactory + * @var Service\CoreServiceFactory */ private $coreServiceFactory; @@ -93,7 +94,7 @@ class StripeClient extends BaseStripeClient public function getService($name) { if (null === $this->coreServiceFactory) { - $this->coreServiceFactory = new \Stripe\Service\CoreServiceFactory($this); + $this->coreServiceFactory = new Service\CoreServiceFactory($this); } return $this->coreServiceFactory->getService($name); diff --git a/plugins/stripe-php/lib/StripeClientInterface.php b/plugins/stripe-php/lib/StripeClientInterface.php index a18308d7..ca4e88ff 100644 --- a/plugins/stripe-php/lib/StripeClientInterface.php +++ b/plugins/stripe-php/lib/StripeClientInterface.php @@ -13,9 +13,33 @@ interface StripeClientInterface extends BaseStripeClientInterface * @param 'delete'|'get'|'post' $method the HTTP method * @param string $path the path of the request * @param array $params the parameters of the request - * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * @param array|Util\RequestOptions $opts the special modifiers of the request * - * @return \Stripe\StripeObject the object returned by Stripe's API + * @return StripeObject the object returned by Stripe's API */ public function request($method, $path, $params, $opts); + + /** + * Sends a request to Stripe's API and expects to return a SearchResult. + * + * @param 'get' $method the HTTP method + * @param string $path the path of the request + * @param array $params the parameters of the request + * @param array|Util\RequestOptions $opts the special modifiers of the request + * + * @return SearchResult of ApiResources + */ + public function requestSearchResult($method, $path, $params, $opts); + + /** + * Sends a request to Stripe's API and expects to return a Collection|V2\Collection. + * + * @param 'get' $method the HTTP method + * @param string $path the path of the request + * @param array $params the parameters of the request + * @param array|Util\RequestOptions $opts the special modifiers of the request + * + * @return Collection|V2\Collection of ApiResources + */ + public function requestCollection($method, $path, $params, $opts); } diff --git a/plugins/stripe-php/lib/StripeObject.php b/plugins/stripe-php/lib/StripeObject.php index 7e973755..58eb1098 100644 --- a/plugins/stripe-php/lib/StripeObject.php +++ b/plugins/stripe-php/lib/StripeObject.php @@ -133,8 +133,8 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable { if (static::getPermanentAttributes()->includes($k)) { throw new Exception\InvalidArgumentException( - "Cannot set {$k} on this object. HINT: you can't set: " . - \implode(', ', static::getPermanentAttributes()->toArray()) + "Cannot set {$k} on this object. HINT: you can't set: " + . \implode(', ', static::getPermanentAttributes()->toArray()) ); } @@ -331,7 +331,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable // This is necessary in case metadata is empty, as PHP arrays do // not differentiate between lists and hashes, and we consider // empty arrays to be lists. - if (('metadata' === $k) && (\is_array($v))) { + if (('metadata' === $k) && \is_array($v)) { $this->_values[$k] = StripeObject::constructFrom($v, $opts, $apiMode); } else { $this->_values[$k] = Util\Util::convertToStripeObject($v, $opts, $apiMode); @@ -379,7 +379,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable // value that we shouldn't appear in the serialized form of the object return \array_filter( $updateParams, - function ($v) { + static function ($v) { return null !== $v; } ); @@ -421,9 +421,9 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable } throw new Exception\InvalidArgumentException( - "Cannot save property `{$key}` containing an API resource of type " . - \get_class($value) . ". It doesn't appear to be persisted and is " . - 'not marked as `saveWithParent`.' + "Cannot save property `{$key}` containing an API resource of type " + . \get_class($value) . ". It doesn't appear to be persisted and is " + . 'not marked as `saveWithParent`.' ); } if (\is_array($value)) { @@ -470,7 +470,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable */ public function toArray() { - $maybeToArray = function ($value) { + $maybeToArray = static function ($value) { if (null === $value) { return null; } diff --git a/plugins/stripe-php/lib/Subscription.php b/plugins/stripe-php/lib/Subscription.php index 6d1dc8ca..4b8c735a 100644 --- a/plugins/stripe-php/lib/Subscription.php +++ b/plugins/stripe-php/lib/Subscription.php @@ -11,49 +11,45 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\Application $application ID of the Connect Application that created the subscription. + * @property null|Application|string $application ID of the Connect Application that created the subscription. * @property null|float $application_fee_percent A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - * @property \Stripe\StripeObject $automatic_tax + * @property (object{disabled_reason: null|string, enabled: bool, liability: null|(object{account?: Account|string, type: string}&StripeObject)}&StripeObject) $automatic_tax * @property int $billing_cycle_anchor The reference point that aligns future billing cycle dates. It sets the day of week for week intervals, the day of month for month and year intervals, and the month of year for year intervals. The timestamp is in UTC format. - * @property null|\Stripe\StripeObject $billing_cycle_anchor_config The fixed values used to calculate the billing_cycle_anchor. - * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + * @property null|(object{day_of_month: int, hour: null|int, minute: null|int, month: null|int, second: null|int}&StripeObject) $billing_cycle_anchor_config The fixed values used to calculate the billing_cycle_anchor. * @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled * @property bool $cancel_at_period_end Whether this subscription will (if status=active) or did (if status=canceled) cancel at the end of the current billing period. * @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end, canceled_at will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. - * @property null|\Stripe\StripeObject $cancellation_details Details about why this subscription was cancelled + * @property null|(object{comment: null|string, feedback: null|string, reason: null|string}&StripeObject) $cancellation_details Details about why this subscription was cancelled * @property string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as active. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property int $current_period_end End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. - * @property int $current_period_start Start of the current period that the subscription has been invoiced for. - * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription. + * @property Customer|string $customer ID of the customer who owns the subscription. * @property null|int $days_until_due Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically. - * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. - * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If default_payment_method is also set, default_payment_method will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. - * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have tax_rates set. Invoices created will have their default_tax_rates populated from the subscription. + * @property null|PaymentMethod|string $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. + * @property null|Account|BankAccount|Card|Source|string $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If default_payment_method is also set, default_payment_method will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. + * @property null|TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have tax_rates set. Invoices created will have their default_tax_rates populated from the subscription. * @property null|string $description The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - * @property null|\Stripe\Discount $discount Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. This field has been deprecated and will be removed in a future API version. Use discounts instead. - * @property (string|\Stripe\Discount)[] $discounts The discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use expand[]=discounts to expand each discount. + * @property (Discount|string)[] $discounts The discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use expand[]=discounts to expand each discount. * @property null|int $ended_at If the subscription has ended, the date the subscription ended. - * @property \Stripe\StripeObject $invoice_settings - * @property \Stripe\Collection<\Stripe\SubscriptionItem> $items List of subscription items, each with an attached price. - * @property null|string|\Stripe\Invoice $latest_invoice The most recent invoice this subscription has generated. + * @property (object{account_tax_ids: null|(string|TaxId)[], issuer: (object{account?: Account|string, type: string}&StripeObject)}&StripeObject) $invoice_settings + * @property Collection $items List of subscription items, each with an attached price. + * @property null|Invoice|string $latest_invoice The most recent invoice this subscription has generated. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|int $next_pending_invoice_item_invoice Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at pending_invoice_item_interval. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) the charge was made on behalf of for charges associated with this subscription. See the Connect documentation for details. - * @property null|\Stripe\StripeObject $pause_collection If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to paused. Learn more about pausing collection. - * @property null|\Stripe\StripeObject $payment_settings Payment settings passed on to invoices created by the subscription. - * @property null|\Stripe\StripeObject $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. - * @property null|string|\Stripe\SetupIntent $pending_setup_intent You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide. - * @property null|\Stripe\StripeObject $pending_update If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid. - * @property null|string|\Stripe\SubscriptionSchedule $schedule The schedule attached to the subscription + * @property null|Account|string $on_behalf_of The account (if any) the charge was made on behalf of for charges associated with this subscription. See the Connect documentation for details. + * @property null|(object{behavior: string, resumes_at: null|int}&StripeObject) $pause_collection If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to paused. Learn more about pausing collection. + * @property null|(object{payment_method_options: null|(object{acss_debit: null|(object{mandate_options?: (object{transaction_type: null|string}&StripeObject), verification_method?: string}&StripeObject), bancontact: null|(object{preferred_language: string}&StripeObject), card: null|(object{mandate_options?: (object{amount: null|int, amount_type: null|string, description: null|string}&StripeObject), network: null|string, request_three_d_secure: null|string}&StripeObject), customer_balance: null|(object{bank_transfer?: (object{eu_bank_transfer?: (object{country: string}&StripeObject), type: null|string}&StripeObject), funding_type: null|string}&StripeObject), konbini: null|(object{}&StripeObject), sepa_debit: null|(object{}&StripeObject), us_bank_account: null|(object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&StripeObject), permissions?: string[], prefetch: null|string[]}&StripeObject), verification_method?: string}&StripeObject)}&StripeObject), payment_method_types: null|string[], save_default_payment_method: null|string}&StripeObject) $payment_settings Payment settings passed on to invoices created by the subscription. + * @property null|(object{interval: string, interval_count: int}&StripeObject) $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. + * @property null|SetupIntent|string $pending_setup_intent You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide. + * @property null|(object{billing_cycle_anchor: null|int, expires_at: int, subscription_items: null|SubscriptionItem[], trial_end: null|int, trial_from_plan: null|bool}&StripeObject) $pending_update If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid. + * @property null|string|SubscriptionSchedule $schedule The schedule attached to the subscription * @property int $start_date Date when the subscription was first created. The date might differ from the created date due to backdating. * @property string $status

      Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, unpaid, or paused.

      For collection_method=charge_automatically a subscription moves into incomplete if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an active status. If the first invoice is not paid within 23 hours, the subscription transitions to incomplete_expired. This is a terminal status, the open invoice will be voided and no further invoices will be generated.

      A subscription that is currently in a trial period is trialing and moves to active when the trial period is over.

      A subscription can only enter a paused status when a trial ends without a payment method. A paused subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The paused status is different from pausing collection, which still generates invoices and leaves the subscription's status unchanged.

      If subscription collection_method=charge_automatically, it becomes past_due when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become canceled or unpaid (depending on your subscriptions settings).

      If subscription collection_method=send_invoice it becomes past_due when its invoice is not paid by the due date, and canceled or unpaid if it is still not paid by an additional deadline after that. Note that when a subscription has a status of unpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.

      - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this subscription belongs to. - * @property null|\Stripe\StripeObject $transfer_data The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + * @property null|string|TestHelpers\TestClock $test_clock ID of the test clock this subscription belongs to. + * @property null|(object{amount_percent: null|float, destination: Account|string}&StripeObject) $transfer_data The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. * @property null|int $trial_end If the subscription has a trial, the end of that trial. - * @property null|\Stripe\StripeObject $trial_settings Settings related to subscription trials. + * @property null|(object{end_behavior: (object{missing_payment_method: string}&StripeObject)}&StripeObject) $trial_settings Settings related to subscription trials. * @property null|int $trial_start If the subscription has a trial, the beginning of that trial. */ class Subscription extends ApiResource @@ -89,12 +85,12 @@ class Subscription extends ApiResource * schedules instead. Schedules provide the flexibility to model more complex * billing configurations that change over time. * - * @param null|array $params + * @param null|array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: null|float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, backdate_start_date?: int, billing_cycle_anchor?: int, billing_cycle_anchor_config?: array{day_of_month: int, hour?: int, minute?: int, month?: int, second?: int}, cancel_at?: int, cancel_at_period_end?: bool, collection_method?: string, currency?: string, customer: string, days_until_due?: int, default_payment_method?: string, default_source?: string, default_tax_rates?: null|string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice_settings?: array{account_tax_ids?: null|string[], issuer?: array{account?: string, type: string}}, items?: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: null|array, off_session?: bool, on_behalf_of?: null|string, payment_behavior?: string, payment_settings?: array{payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{mandate_options?: array{amount?: int, amount_type?: string, description?: string}, network?: string, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[], save_default_payment_method?: string}, pending_invoice_item_interval?: null|array{interval: string, interval_count?: int}, proration_behavior?: string, transfer_data?: array{amount_percent?: float, destination: string}, trial_end?: array|int|string, trial_from_plan?: bool, trial_period_days?: int, trial_settings?: array{end_behavior: array{missing_payment_method: string}}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Subscription the created resource * - * @return \Stripe\Subscription the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -102,7 +98,7 @@ class Subscription extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -112,18 +108,18 @@ class Subscription extends ApiResource * By default, returns a list of subscriptions that have not been canceled. In * order to list canceled subscriptions, specify status=canceled. * - * @param null|array $params + * @param null|array{automatic_tax?: array{enabled: bool}, collection_method?: string, created?: array|int, current_period_end?: array|int, current_period_start?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, plan?: string, price?: string, starting_after?: string, status?: string, test_clock?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Subscription> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -132,13 +128,13 @@ class Subscription extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Subscription * - * @return \Stripe\Subscription + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -197,12 +193,12 @@ class Subscription extends ApiResource * href="/docs/billing/subscriptions/usage-based">usage-based billing instead. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: null|float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, cancel_at?: null|int, cancel_at_period_end?: bool, cancellation_details?: array{comment?: null|string, feedback?: null|string}, collection_method?: string, days_until_due?: int, default_payment_method?: string, default_source?: null|string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice_settings?: array{account_tax_ids?: null|string[], issuer?: array{account?: string, type: string}}, items?: (array{clear_usage?: bool, deleted?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id?: string, metadata?: null|array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: null|array, off_session?: bool, on_behalf_of?: null|string, pause_collection?: null|array{behavior: string, resumes_at?: int}, payment_behavior?: string, payment_settings?: array{payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{mandate_options?: array{amount?: int, amount_type?: string, description?: string}, network?: string, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[], save_default_payment_method?: string}, pending_invoice_item_interval?: null|array{interval: string, interval_count?: int}, proration_behavior?: string, proration_date?: int, transfer_data?: null|array{amount_percent?: float, destination: string}, trial_end?: array|int|string, trial_from_plan?: bool, trial_settings?: array{end_behavior: array{missing_payment_method: string}}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Subscription the updated resource * - * @return \Stripe\Subscription the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -210,7 +206,7 @@ class Subscription extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -218,7 +214,7 @@ class Subscription extends ApiResource use ApiOperations\Delete { delete as protected _delete; - } + } public static function getSavedNestedResources() { @@ -236,9 +232,9 @@ class Subscription extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Subscription the updated subscription * - * @return \Stripe\Subscription the updated subscription + * @throws Exception\ApiErrorException if the request fails */ public function deleteDiscount($params = null, $opts = null) { @@ -262,9 +258,9 @@ class Subscription extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Subscription the canceled subscription * - * @return \Stripe\Subscription the canceled subscription + * @throws Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { @@ -279,9 +275,9 @@ class Subscription extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Subscription the resumed subscription * - * @return \Stripe\Subscription the resumed subscription + * @throws Exception\ApiErrorException if the request fails */ public function resume($params = null, $opts = null) { @@ -296,14 +292,14 @@ class Subscription extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SearchResult the subscription search results * - * @return \Stripe\SearchResult<\Stripe\Subscription> the subscription search results + * @throws Exception\ApiErrorException if the request fails */ public static function search($params = null, $opts = null) { $url = '/v1/subscriptions/search'; - return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts); + return static::_requestPage($url, SearchResult::class, $params, $opts); } } diff --git a/plugins/stripe-php/lib/SubscriptionItem.php b/plugins/stripe-php/lib/SubscriptionItem.php index fe74493c..1c6862ff 100644 --- a/plugins/stripe-php/lib/SubscriptionItem.php +++ b/plugins/stripe-php/lib/SubscriptionItem.php @@ -10,33 +10,33 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property (string|\Stripe\Discount)[] $discounts The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use expand[]=discounts to expand each discount. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Plan $plan

      You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.

      Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.

      For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.

      Related guides: Set up a subscription and more about products and prices.

      - * @property \Stripe\Price $price

      Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.

      For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.

      Related guides: Set up a subscription, create an invoice, and more about products and prices.

      + * @property int $current_period_end The end time of this subscription item's current billing period. + * @property int $current_period_start The start time of this subscription item's current billing period. + * @property (Discount|string)[] $discounts The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use expand[]=discounts to expand each discount. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property Plan $plan

      You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.

      Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.

      For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.

      Related guides: Set up a subscription and more about products and prices.

      + * @property Price $price

      Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.

      For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.

      Related guides: Set up a subscription, create an invoice, and more about products and prices.

      * @property null|int $quantity The quantity of the plan to which the customer should be subscribed. * @property string $subscription The subscription this subscription_item belongs to. - * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to this subscription_item. When set, the default_tax_rates on the subscription do not apply to this subscription_item. + * @property null|TaxRate[] $tax_rates The tax rates which apply to this subscription_item. When set, the default_tax_rates on the subscription do not apply to this subscription_item. */ class SubscriptionItem extends ApiResource { const OBJECT_NAME = 'subscription_item'; - use ApiOperations\NestedResource; use ApiOperations\Update; /** * Adds a new item to an existing subscription. No existing items will be changed * or replaced. * - * @param null|array $params + * @param null|array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: array, payment_behavior?: string, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, proration_behavior?: string, proration_date?: int, quantity?: int, subscription: string, tax_rates?: null|string[]} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SubscriptionItem the created resource * - * @return \Stripe\SubscriptionItem the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -44,7 +44,7 @@ class SubscriptionItem extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -54,12 +54,12 @@ class SubscriptionItem extends ApiResource * Deletes an item from the subscription. Removing a subscription item from a * subscription will not cancel the subscription. * - * @param null|array $params + * @param null|array{clear_usage?: bool, proration_behavior?: string, proration_date?: int} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SubscriptionItem the deleted resource * - * @return \Stripe\SubscriptionItem the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -75,18 +75,18 @@ class SubscriptionItem extends ApiResource /** * Returns a list of your subscription items for a given subscription. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, subscription: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\SubscriptionItem> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -95,13 +95,13 @@ class SubscriptionItem extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SubscriptionItem * - * @return \Stripe\SubscriptionItem + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -112,12 +112,12 @@ class SubscriptionItem extends ApiResource * Updates the plan or quantity of an item on a current subscription. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, off_session?: bool, payment_behavior?: string, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, proration_behavior?: string, proration_date?: int, quantity?: int, tax_rates?: null|string[]} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SubscriptionItem the updated resource * - * @return \Stripe\SubscriptionItem the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -125,40 +125,9 @@ class SubscriptionItem extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; } - - const PATH_USAGE_RECORDS = '/usage_records'; - - /** - * @param string $id the ID of the subscription item on which to create the usage record - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\UsageRecord - */ - public static function createUsageRecord($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_USAGE_RECORDS, $params, $opts); - } - const PATH_USAGE_RECORD_SUMMARIES = '/usage_record_summaries'; - - /** - * @param string $id the ID of the subscription item on which to retrieve the usage record summaries - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\UsageRecordSummary> the list of usage record summaries - */ - public static function allUsageRecordSummaries($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_USAGE_RECORD_SUMMARIES, $params, $opts); - } } diff --git a/plugins/stripe-php/lib/SubscriptionSchedule.php b/plugins/stripe-php/lib/SubscriptionSchedule.php index 24220e58..34286895 100644 --- a/plugins/stripe-php/lib/SubscriptionSchedule.php +++ b/plugins/stripe-php/lib/SubscriptionSchedule.php @@ -11,22 +11,22 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\Application $application ID of the Connect Application that created the schedule. + * @property null|Application|string $application ID of the Connect Application that created the schedule. * @property null|int $canceled_at Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. * @property null|int $completed_at Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $current_phase Object representing the start and end dates for the current phase of the subscription schedule, if it is active. - * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription schedule. - * @property \Stripe\StripeObject $default_settings + * @property null|(object{end_date: int, start_date: int}&StripeObject) $current_phase Object representing the start and end dates for the current phase of the subscription schedule, if it is active. + * @property Customer|string $customer ID of the customer who owns the subscription schedule. + * @property (object{application_fee_percent: null|float, automatic_tax?: (object{disabled_reason: null|string, enabled: bool, liability: null|(object{account?: Account|string, type: string}&StripeObject)}&StripeObject), billing_cycle_anchor: string, collection_method: null|string, default_payment_method: null|PaymentMethod|string, description: null|string, invoice_settings: (object{account_tax_ids: null|(string|TaxId)[], days_until_due: null|int, issuer: (object{account?: Account|string, type: string}&StripeObject)}&StripeObject), on_behalf_of: null|Account|string, transfer_data: null|(object{amount_percent: null|float, destination: Account|string}&StripeObject)}&StripeObject) $default_settings * @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release or cancel with the default being release. release will end the subscription schedule and keep the underlying subscription running. cancel will end the subscription schedule and cancel the underlying subscription. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject[] $phases Configuration for the subscription schedule's phases. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property ((object{add_invoice_items: ((object{discounts: ((object{coupon: null|Coupon|string, discount: null|Discount|string, promotion_code: null|PromotionCode|string}&StripeObject))[], price: Price|string, quantity: null|int, tax_rates?: null|TaxRate[]}&StripeObject))[], application_fee_percent: null|float, automatic_tax?: (object{disabled_reason: null|string, enabled: bool, liability: null|(object{account?: Account|string, type: string}&StripeObject)}&StripeObject), billing_cycle_anchor: null|string, collection_method: null|string, currency: string, default_payment_method: null|PaymentMethod|string, default_tax_rates?: null|TaxRate[], description: null|string, discounts: ((object{coupon: null|Coupon|string, discount: null|Discount|string, promotion_code: null|PromotionCode|string}&StripeObject))[], end_date: int, invoice_settings: null|(object{account_tax_ids: null|(string|TaxId)[], days_until_due: null|int, issuer: null|(object{account?: Account|string, type: string}&StripeObject)}&StripeObject), items: ((object{discounts: ((object{coupon: null|Coupon|string, discount: null|Discount|string, promotion_code: null|PromotionCode|string}&StripeObject))[], metadata: null|StripeObject, plan: Plan|string, price: Price|string, quantity?: int, tax_rates?: null|TaxRate[]}&StripeObject))[], metadata: null|StripeObject, on_behalf_of: null|Account|string, proration_behavior: string, start_date: int, transfer_data: null|(object{amount_percent: null|float, destination: Account|string}&StripeObject), trial_end: null|int}&StripeObject))[] $phases Configuration for the subscription schedule's phases. * @property null|int $released_at Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. * @property null|string $released_subscription ID of the subscription once managed by the subscription schedule (if it is released). * @property string $status The present status of the subscription schedule. Possible values are not_started, active, completed, released, and canceled. You can read more about the different states in our behavior guide. - * @property null|string|\Stripe\Subscription $subscription ID of the subscription managed by the subscription schedule. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this subscription schedule belongs to. + * @property null|string|Subscription $subscription ID of the subscription managed by the subscription schedule. + * @property null|string|TestHelpers\TestClock $test_clock ID of the test clock this subscription schedule belongs to. */ class SubscriptionSchedule extends ApiResource { @@ -49,12 +49,12 @@ class SubscriptionSchedule extends ApiResource * Creates a new subscription schedule object. Each customer can have up to 500 * active or scheduled subscriptions. * - * @param null|array $params + * @param null|array{customer?: string, default_settings?: array{application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, collection_method?: string, default_payment_method?: string, description?: null|string, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, on_behalf_of?: null|string, transfer_data?: null|array{amount_percent?: float, destination: string}}, end_behavior?: string, expand?: string[], from_subscription?: string, metadata?: null|array, phases?: (array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, collection_method?: string, currency?: string, default_payment_method?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], end_date?: int, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, items: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], iterations?: int, metadata?: array, on_behalf_of?: string, proration_behavior?: string, transfer_data?: array{amount_percent?: float, destination: string}, trial?: bool, trial_end?: int})[], start_date?: array|int|string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SubscriptionSchedule the created resource * - * @return \Stripe\SubscriptionSchedule the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -62,7 +62,7 @@ class SubscriptionSchedule extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -71,18 +71,18 @@ class SubscriptionSchedule extends ApiResource /** * Retrieves the list of your subscription schedules. * - * @param null|array $params + * @param null|array{canceled_at?: array|int, completed_at?: array|int, created?: array|int, customer?: string, ending_before?: string, expand?: string[], limit?: int, released_at?: array|int, scheduled?: bool, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\SubscriptionSchedule> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -93,13 +93,13 @@ class SubscriptionSchedule extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SubscriptionSchedule * - * @return \Stripe\SubscriptionSchedule + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -110,12 +110,12 @@ class SubscriptionSchedule extends ApiResource * Updates an existing subscription schedule. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{default_settings?: array{application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, collection_method?: string, default_payment_method?: string, description?: null|string, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, on_behalf_of?: null|string, transfer_data?: null|array{amount_percent?: float, destination: string}}, end_behavior?: string, expand?: string[], metadata?: null|array, phases?: (array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, collection_method?: string, currency?: string, default_payment_method?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], end_date?: array|int|string, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, items: (array{discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], iterations?: int, metadata?: array, on_behalf_of?: string, proration_behavior?: string, start_date?: array|int|string, transfer_data?: array{amount_percent?: float, destination: string}, trial?: bool, trial_end?: array|int|string})[], proration_behavior?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SubscriptionSchedule the updated resource * - * @return \Stripe\SubscriptionSchedule the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -123,7 +123,7 @@ class SubscriptionSchedule extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -133,9 +133,9 @@ class SubscriptionSchedule extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SubscriptionSchedule the canceled subscription schedule * - * @return \Stripe\SubscriptionSchedule the canceled subscription schedule + * @throws Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { @@ -150,9 +150,9 @@ class SubscriptionSchedule extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return SubscriptionSchedule the released subscription schedule * - * @return \Stripe\SubscriptionSchedule the released subscription schedule + * @throws Exception\ApiErrorException if the request fails */ public function release($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Tax/Calculation.php b/plugins/stripe-php/lib/Tax/Calculation.php index 0e56bfd4..8ac63d49 100644 --- a/plugins/stripe-php/lib/Tax/Calculation.php +++ b/plugins/stripe-php/lib/Tax/Calculation.php @@ -14,15 +14,15 @@ namespace Stripe\Tax; * @property int $amount_total Total amount after taxes in the smallest currency unit. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $customer The ID of an existing Customer used for the resource. - * @property \Stripe\StripeObject $customer_details + * @property (object{address: null|(object{city: null|string, country: string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), address_source: null|string, ip_address: null|string, tax_ids: (object{type: string, value: string}&\Stripe\StripeObject)[], taxability_override: string}&\Stripe\StripeObject) $customer_details * @property null|int $expires_at Timestamp of date at which the tax calculation will expire. - * @property null|\Stripe\Collection<\Stripe\Tax\CalculationLineItem> $line_items The list of items the customer is purchasing. + * @property null|\Stripe\Collection $line_items The list of items the customer is purchasing. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $ship_from_details The details of the ship from location, such as the address. - * @property null|\Stripe\StripeObject $shipping_cost The shipping cost details for the calculation. + * @property null|(object{address: (object{city: null|string, country: string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $ship_from_details The details of the ship from location, such as the address. + * @property null|(object{amount: int, amount_tax: int, shipping_rate?: string, tax_behavior: string, tax_breakdown?: ((object{amount: int, jurisdiction: (object{country: string, display_name: string, level: string, state: null|string}&\Stripe\StripeObject), sourcing: string, tax_rate_details: null|(object{display_name: string, percentage_decimal: string, tax_type: string}&\Stripe\StripeObject), taxability_reason: string, taxable_amount: int}&\Stripe\StripeObject))[], tax_code: string}&\Stripe\StripeObject) $shipping_cost The shipping cost details for the calculation. * @property int $tax_amount_exclusive The amount of tax to be collected on top of the line item prices. * @property int $tax_amount_inclusive The amount of tax already included in the line item prices. - * @property \Stripe\StripeObject[] $tax_breakdown Breakdown of individual tax amounts that add up to the total. + * @property ((object{amount: int, inclusive: bool, tax_rate_details: (object{country: null|string, flat_amount: null|(object{amount: int, currency: string}&\Stripe\StripeObject), percentage_decimal: string, rate_type: null|string, state: null|string, tax_type: null|string}&\Stripe\StripeObject), taxability_reason: string, taxable_amount: int}&\Stripe\StripeObject))[] $tax_breakdown Breakdown of individual tax amounts that add up to the total. * @property int $tax_date Timestamp of date at which the tax rules and rates in effect applies for the calculation. */ class Calculation extends \Stripe\ApiResource @@ -33,12 +33,12 @@ class Calculation extends \Stripe\ApiResource * Calculates tax based on the input and returns a Tax Calculation * object. * - * @param null|array $params + * @param null|array{currency: string, customer?: string, customer_details?: array{address?: array{city?: null|string, country: string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}, address_source?: string, ip_address?: string, tax_ids?: array{type: string, value: string}[], taxability_override?: string}, expand?: string[], line_items: array{amount: int, product?: string, quantity?: int, reference?: string, tax_behavior?: string, tax_code?: string}[], ship_from_details?: array{address: array{city?: null|string, country: string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}}, shipping_cost?: array{amount?: int, shipping_rate?: string, tax_behavior?: string, tax_code?: string}, tax_date?: int} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Calculation the created resource * - * @return \Stripe\Tax\Calculation the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -59,9 +59,9 @@ class Calculation extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Calculation * - * @return \Stripe\Tax\Calculation + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -77,9 +77,9 @@ class Calculation extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection list of calculation line items * - * @return \Stripe\Collection<\Stripe\Tax\CalculationLineItem> list of calculation line items + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function allLineItems($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Tax/CalculationLineItem.php b/plugins/stripe-php/lib/Tax/CalculationLineItem.php index 70c711e2..fd6c1c65 100644 --- a/plugins/stripe-php/lib/Tax/CalculationLineItem.php +++ b/plugins/stripe-php/lib/Tax/CalculationLineItem.php @@ -12,9 +12,9 @@ namespace Stripe\Tax; * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $product The ID of an existing Product. * @property int $quantity The number of units of the item being purchased. For reversals, this is the quantity reversed. - * @property null|string $reference A custom identifier for this line item. + * @property string $reference A custom identifier for this line item. * @property string $tax_behavior Specifies whether the amount includes taxes. If tax_behavior=inclusive, then the amount includes taxes. - * @property null|\Stripe\StripeObject[] $tax_breakdown Detailed account of taxes relevant to this line item. + * @property null|((object{amount: int, jurisdiction: (object{country: string, display_name: string, level: string, state: null|string}&\Stripe\StripeObject), sourcing: string, tax_rate_details: null|(object{display_name: string, percentage_decimal: string, tax_type: string}&\Stripe\StripeObject), taxability_reason: string, taxable_amount: int}&\Stripe\StripeObject))[] $tax_breakdown Detailed account of taxes relevant to this line item. * @property string $tax_code The tax code ID used for this resource. */ class CalculationLineItem extends \Stripe\ApiResource diff --git a/plugins/stripe-php/lib/Tax/Registration.php b/plugins/stripe-php/lib/Tax/Registration.php index 2126e1e9..1d925b77 100644 --- a/plugins/stripe-php/lib/Tax/Registration.php +++ b/plugins/stripe-php/lib/Tax/Registration.php @@ -15,7 +15,7 @@ namespace Stripe\Tax; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $active_from Time at which the registration becomes active. Measured in seconds since the Unix epoch. * @property string $country Two-letter country code (ISO 3166-1 alpha-2). - * @property \Stripe\StripeObject $country_options + * @property (object{ae?: (object{type: string}&\Stripe\StripeObject), al?: (object{type: string}&\Stripe\StripeObject), am?: (object{type: string}&\Stripe\StripeObject), ao?: (object{type: string}&\Stripe\StripeObject), at?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), au?: (object{type: string}&\Stripe\StripeObject), aw?: (object{type: string}&\Stripe\StripeObject), az?: (object{type: string}&\Stripe\StripeObject), ba?: (object{type: string}&\Stripe\StripeObject), bb?: (object{type: string}&\Stripe\StripeObject), bd?: (object{type: string}&\Stripe\StripeObject), be?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), bf?: (object{type: string}&\Stripe\StripeObject), bg?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), bh?: (object{type: string}&\Stripe\StripeObject), bj?: (object{type: string}&\Stripe\StripeObject), bs?: (object{type: string}&\Stripe\StripeObject), by?: (object{type: string}&\Stripe\StripeObject), ca?: (object{province_standard?: (object{province: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), cd?: (object{type: string}&\Stripe\StripeObject), ch?: (object{type: string}&\Stripe\StripeObject), cl?: (object{type: string}&\Stripe\StripeObject), cm?: (object{type: string}&\Stripe\StripeObject), co?: (object{type: string}&\Stripe\StripeObject), cr?: (object{type: string}&\Stripe\StripeObject), cv?: (object{type: string}&\Stripe\StripeObject), cy?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), cz?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), de?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), dk?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ec?: (object{type: string}&\Stripe\StripeObject), ee?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), eg?: (object{type: string}&\Stripe\StripeObject), es?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), et?: (object{type: string}&\Stripe\StripeObject), fi?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), fr?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), gb?: (object{type: string}&\Stripe\StripeObject), ge?: (object{type: string}&\Stripe\StripeObject), gn?: (object{type: string}&\Stripe\StripeObject), gr?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), hr?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), hu?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), id?: (object{type: string}&\Stripe\StripeObject), ie?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), in?: (object{type: string}&\Stripe\StripeObject), is?: (object{type: string}&\Stripe\StripeObject), it?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), jp?: (object{type: string}&\Stripe\StripeObject), ke?: (object{type: string}&\Stripe\StripeObject), kg?: (object{type: string}&\Stripe\StripeObject), kh?: (object{type: string}&\Stripe\StripeObject), kr?: (object{type: string}&\Stripe\StripeObject), kz?: (object{type: string}&\Stripe\StripeObject), la?: (object{type: string}&\Stripe\StripeObject), lt?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), lu?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), lv?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ma?: (object{type: string}&\Stripe\StripeObject), md?: (object{type: string}&\Stripe\StripeObject), me?: (object{type: string}&\Stripe\StripeObject), mk?: (object{type: string}&\Stripe\StripeObject), mr?: (object{type: string}&\Stripe\StripeObject), mt?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), mx?: (object{type: string}&\Stripe\StripeObject), my?: (object{type: string}&\Stripe\StripeObject), ng?: (object{type: string}&\Stripe\StripeObject), nl?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), no?: (object{type: string}&\Stripe\StripeObject), np?: (object{type: string}&\Stripe\StripeObject), nz?: (object{type: string}&\Stripe\StripeObject), om?: (object{type: string}&\Stripe\StripeObject), pe?: (object{type: string}&\Stripe\StripeObject), ph?: (object{type: string}&\Stripe\StripeObject), pl?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), pt?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ro?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), rs?: (object{type: string}&\Stripe\StripeObject), ru?: (object{type: string}&\Stripe\StripeObject), sa?: (object{type: string}&\Stripe\StripeObject), se?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), sg?: (object{type: string}&\Stripe\StripeObject), si?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), sk?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), sn?: (object{type: string}&\Stripe\StripeObject), sr?: (object{type: string}&\Stripe\StripeObject), th?: (object{type: string}&\Stripe\StripeObject), tj?: (object{type: string}&\Stripe\StripeObject), tr?: (object{type: string}&\Stripe\StripeObject), tz?: (object{type: string}&\Stripe\StripeObject), ug?: (object{type: string}&\Stripe\StripeObject), us?: (object{local_amusement_tax?: (object{jurisdiction: string}&\Stripe\StripeObject), local_lease_tax?: (object{jurisdiction: string}&\Stripe\StripeObject), state: string, state_sales_tax?: (object{elections?: (object{jurisdiction?: string, type: string}&\Stripe\StripeObject)[]}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), uy?: (object{type: string}&\Stripe\StripeObject), uz?: (object{type: string}&\Stripe\StripeObject), vn?: (object{type: string}&\Stripe\StripeObject), za?: (object{type: string}&\Stripe\StripeObject), zm?: (object{type: string}&\Stripe\StripeObject), zw?: (object{type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $country_options * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|int $expires_at If set, the registration stops being active at this time. If not set, the registration will be active indefinitely. Measured in seconds since the Unix epoch. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. @@ -34,12 +34,12 @@ class Registration extends \Stripe\ApiResource /** * Creates a new Tax Registration object. * - * @param null|array $params + * @param null|array{active_from: array|int|string, country: string, country_options: array{ae?: array{type: string}, al?: array{type: string}, am?: array{type: string}, ao?: array{type: string}, at?: array{standard?: array{place_of_supply_scheme: string}, type: string}, au?: array{type: string}, aw?: array{type: string}, az?: array{type: string}, ba?: array{type: string}, bb?: array{type: string}, bd?: array{type: string}, be?: array{standard?: array{place_of_supply_scheme: string}, type: string}, bf?: array{type: string}, bg?: array{standard?: array{place_of_supply_scheme: string}, type: string}, bh?: array{type: string}, bj?: array{type: string}, bs?: array{type: string}, by?: array{type: string}, ca?: array{province_standard?: array{province: string}, type: string}, cd?: array{type: string}, ch?: array{type: string}, cl?: array{type: string}, cm?: array{type: string}, co?: array{type: string}, cr?: array{type: string}, cv?: array{type: string}, cy?: array{standard?: array{place_of_supply_scheme: string}, type: string}, cz?: array{standard?: array{place_of_supply_scheme: string}, type: string}, de?: array{standard?: array{place_of_supply_scheme: string}, type: string}, dk?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ec?: array{type: string}, ee?: array{standard?: array{place_of_supply_scheme: string}, type: string}, eg?: array{type: string}, es?: array{standard?: array{place_of_supply_scheme: string}, type: string}, et?: array{type: string}, fi?: array{standard?: array{place_of_supply_scheme: string}, type: string}, fr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, gb?: array{type: string}, ge?: array{type: string}, gn?: array{type: string}, gr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, hr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, hu?: array{standard?: array{place_of_supply_scheme: string}, type: string}, id?: array{type: string}, ie?: array{standard?: array{place_of_supply_scheme: string}, type: string}, in?: array{type: string}, is?: array{type: string}, it?: array{standard?: array{place_of_supply_scheme: string}, type: string}, jp?: array{type: string}, ke?: array{type: string}, kg?: array{type: string}, kh?: array{type: string}, kr?: array{type: string}, kz?: array{type: string}, la?: array{type: string}, lt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, lu?: array{standard?: array{place_of_supply_scheme: string}, type: string}, lv?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ma?: array{type: string}, md?: array{type: string}, me?: array{type: string}, mk?: array{type: string}, mr?: array{type: string}, mt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, mx?: array{type: string}, my?: array{type: string}, ng?: array{type: string}, nl?: array{standard?: array{place_of_supply_scheme: string}, type: string}, no?: array{type: string}, np?: array{type: string}, nz?: array{type: string}, om?: array{type: string}, pe?: array{type: string}, ph?: array{type: string}, pl?: array{standard?: array{place_of_supply_scheme: string}, type: string}, pt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ro?: array{standard?: array{place_of_supply_scheme: string}, type: string}, rs?: array{type: string}, ru?: array{type: string}, sa?: array{type: string}, se?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sg?: array{type: string}, si?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sk?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sn?: array{type: string}, sr?: array{type: string}, th?: array{type: string}, tj?: array{type: string}, tr?: array{type: string}, tz?: array{type: string}, ug?: array{type: string}, us?: array{local_amusement_tax?: array{jurisdiction: string}, local_lease_tax?: array{jurisdiction: string}, state: string, state_sales_tax?: array{elections: array{jurisdiction?: string, type: string}[]}, type: string}, uy?: array{type: string}, uz?: array{type: string}, vn?: array{type: string}, za?: array{type: string}, zm?: array{type: string}, zw?: array{type: string}}, expand?: string[], expires_at?: int} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Registration the created resource * - * @return \Stripe\Tax\Registration the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -56,12 +56,12 @@ class Registration extends \Stripe\ApiResource /** * Returns a list of Tax Registration objects. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Tax\Registration> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -76,9 +76,9 @@ class Registration extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Registration * - * @return \Stripe\Tax\Registration + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -96,12 +96,12 @@ class Registration extends \Stripe\ApiResource * registration you may do so by setting expires_at. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{active_from?: array|int|string, expand?: string[], expires_at?: null|array|int|string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Registration the updated resource * - * @return \Stripe\Tax\Registration the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Tax/Settings.php b/plugins/stripe-php/lib/Tax/Settings.php index 16dcdc2e..2d8a9453 100644 --- a/plugins/stripe-php/lib/Tax/Settings.php +++ b/plugins/stripe-php/lib/Tax/Settings.php @@ -10,11 +10,11 @@ namespace Stripe\Tax; * Related guide: Using the Settings API * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $defaults - * @property null|\Stripe\StripeObject $head_office The place where your business is located. + * @property (object{tax_behavior: null|string, tax_code: null|string}&\Stripe\StripeObject) $defaults + * @property null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $head_office The place where your business is located. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $status The status of the Tax Settings. - * @property \Stripe\StripeObject $status_details + * @property (object{active?: (object{}&\Stripe\StripeObject), pending?: (object{missing_fields: null|string[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $status_details */ class Settings extends \Stripe\SingletonApiResource { @@ -28,9 +28,9 @@ class Settings extends \Stripe\SingletonApiResource * * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Settings * - * @return \Stripe\Tax\Settings + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($opts = null) { @@ -45,9 +45,9 @@ class Settings extends \Stripe\SingletonApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return static the updated resource + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($params = null, $opts = null) { @@ -64,10 +64,10 @@ class Settings extends \Stripe\SingletonApiResource /** * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return static the saved resource * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * * @deprecated The `save` method is deprecated and will be removed in a * future major version of the library. Use the static method `update` * on the resource instead. diff --git a/plugins/stripe-php/lib/Tax/Transaction.php b/plugins/stripe-php/lib/Tax/Transaction.php index 13304b8e..5329f715 100644 --- a/plugins/stripe-php/lib/Tax/Transaction.php +++ b/plugins/stripe-php/lib/Tax/Transaction.php @@ -14,15 +14,15 @@ namespace Stripe\Tax; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $customer The ID of an existing Customer used for the resource. - * @property \Stripe\StripeObject $customer_details - * @property null|\Stripe\Collection<\Stripe\Tax\TransactionLineItem> $line_items The tax collected or refunded, by line item. + * @property (object{address: null|(object{city: null|string, country: string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), address_source: null|string, ip_address: null|string, tax_ids: (object{type: string, value: string}&\Stripe\StripeObject)[], taxability_override: string}&\Stripe\StripeObject) $customer_details + * @property null|\Stripe\Collection $line_items The tax collected or refunded, by line item. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property int $posted_at The Unix timestamp representing when the tax liability is assumed or reduced. * @property string $reference A custom unique identifier, such as 'myOrder_123'. - * @property null|\Stripe\StripeObject $reversal If type=reversal, contains information about what was reversed. - * @property null|\Stripe\StripeObject $ship_from_details The details of the ship from location, such as the address. - * @property null|\Stripe\StripeObject $shipping_cost The shipping cost details for the transaction. + * @property null|(object{original_transaction: null|string}&\Stripe\StripeObject) $reversal If type=reversal, contains information about what was reversed. + * @property null|(object{address: (object{city: null|string, country: string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $ship_from_details The details of the ship from location, such as the address. + * @property null|(object{amount: int, amount_tax: int, shipping_rate?: string, tax_behavior: string, tax_breakdown?: ((object{amount: int, jurisdiction: (object{country: string, display_name: string, level: string, state: null|string}&\Stripe\StripeObject), sourcing: string, tax_rate_details: null|(object{display_name: string, percentage_decimal: string, tax_type: string}&\Stripe\StripeObject), taxability_reason: string, taxable_amount: int}&\Stripe\StripeObject))[], tax_code: string}&\Stripe\StripeObject) $shipping_cost The shipping cost details for the transaction. * @property int $tax_date Timestamp of date at which the tax rules and rates in effect applies for the calculation. * @property string $type If reversal, this transaction reverses an earlier transaction. */ @@ -39,9 +39,9 @@ class Transaction extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Transaction * - * @return \Stripe\Tax\Transaction + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -56,9 +56,9 @@ class Transaction extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Transaction the created transaction * - * @return \Stripe\Tax\Transaction the created transaction + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function createFromCalculation($params = null, $opts = null) { @@ -74,9 +74,9 @@ class Transaction extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Transaction the created transaction * - * @return \Stripe\Tax\Transaction the created transaction + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function createReversal($params = null, $opts = null) { @@ -93,9 +93,9 @@ class Transaction extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection list of transaction line items * - * @return \Stripe\Collection<\Stripe\Tax\TransactionLineItem> list of transaction line items + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function allLineItems($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Tax/TransactionLineItem.php b/plugins/stripe-php/lib/Tax/TransactionLineItem.php index a506c6d8..e793b0a8 100644 --- a/plugins/stripe-php/lib/Tax/TransactionLineItem.php +++ b/plugins/stripe-php/lib/Tax/TransactionLineItem.php @@ -14,7 +14,7 @@ namespace Stripe\Tax; * @property null|string $product The ID of an existing Product. * @property int $quantity The number of units of the item being purchased. For reversals, this is the quantity reversed. * @property string $reference A custom identifier for this line item in the transaction. - * @property null|\Stripe\StripeObject $reversal If type=reversal, contains information about what was reversed. + * @property null|(object{original_line_item: string}&\Stripe\StripeObject) $reversal If type=reversal, contains information about what was reversed. * @property string $tax_behavior Specifies whether the amount includes taxes. If tax_behavior=inclusive, then the amount includes taxes. * @property string $tax_code The tax code ID used for this resource. * @property string $type If reversal, this line item reverses an earlier transaction. diff --git a/plugins/stripe-php/lib/TaxCode.php b/plugins/stripe-php/lib/TaxCode.php index f57caaad..4d50d232 100644 --- a/plugins/stripe-php/lib/TaxCode.php +++ b/plugins/stripe-php/lib/TaxCode.php @@ -20,18 +20,18 @@ class TaxCode extends ApiResource * A list of all tax codes * available to add to Products in order to allow specific tax calculations. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\TaxCode> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -41,13 +41,13 @@ class TaxCode extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TaxCode * - * @return \Stripe\TaxCode + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/TaxId.php b/plugins/stripe-php/lib/TaxId.php index 62479f84..51bf0284 100644 --- a/plugins/stripe-php/lib/TaxId.php +++ b/plugins/stripe-php/lib/TaxId.php @@ -14,12 +14,12 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string $country Two-letter ISO code representing the country of the tax ID. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer ID of the customer. + * @property null|Customer|string $customer ID of the customer. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $owner The account or customer the tax ID belongs to. - * @property string $type Type of the tax ID, one of ad_nrt, ae_trn, al_tin, am_tin, ao_tin, ar_cuit, au_abn, au_arn, ba_tin, bb_tin, bg_uic, bh_vat, bo_tin, br_cnpj, br_cpf, bs_tin, by_tin, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, cd_nif, ch_uid, ch_vat, cl_tin, cn_tin, co_nit, cr_tin, de_stn, do_rcn, ec_ruc, eg_tin, es_cif, eu_oss_vat, eu_vat, gb_vat, ge_vat, gn_nif, hk_br, hr_oib, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, jp_trn, ke_pin, kh_tin, kr_brn, kz_bin, li_uid, li_vat, ma_vat, md_vat, me_pib, mk_vat, mr_nif, mx_rfc, my_frp, my_itn, my_sst, ng_tin, no_vat, no_voec, np_pan, nz_gst, om_vat, pe_ruc, ph_tin, ro_tin, rs_pib, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, sn_ninea, sr_fin, sv_nit, th_vat, tj_tin, tr_tin, tw_vat, tz_vat, ua_vat, ug_tin, us_ein, uy_ruc, uz_tin, uz_vat, ve_rif, vn_tin, za_vat, zm_tin, or zw_tin. Note that some legacy tax IDs have type unknown + * @property null|(object{account?: Account|string, application?: Application|string, customer?: Customer|string, type: string}&StripeObject) $owner The account or customer the tax ID belongs to. + * @property string $type Type of the tax ID, one of ad_nrt, ae_trn, al_tin, am_tin, ao_tin, ar_cuit, au_abn, au_arn, aw_tin, az_tin, ba_tin, bb_tin, bd_bin, bf_ifu, bg_uic, bh_vat, bj_ifu, bo_tin, br_cnpj, br_cpf, bs_tin, by_tin, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, cd_nif, ch_uid, ch_vat, cl_tin, cm_niu, cn_tin, co_nit, cr_tin, cv_nif, de_stn, do_rcn, ec_ruc, eg_tin, es_cif, et_tin, eu_oss_vat, eu_vat, gb_vat, ge_vat, gn_nif, hk_br, hr_oib, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, jp_trn, ke_pin, kg_tin, kh_tin, kr_brn, kz_bin, la_tin, li_uid, li_vat, ma_vat, md_vat, me_pib, mk_vat, mr_nif, mx_rfc, my_frp, my_itn, my_sst, ng_tin, no_vat, no_voec, np_pan, nz_gst, om_vat, pe_ruc, ph_tin, ro_tin, rs_pib, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, sn_ninea, sr_fin, sv_nit, th_vat, tj_tin, tr_tin, tw_vat, tz_vat, ua_vat, ug_tin, us_ein, uy_ruc, uz_tin, uz_vat, ve_rif, vn_tin, za_vat, zm_tin, or zw_tin. Note that some legacy tax IDs have type unknown * @property string $value Value of the tax ID. - * @property null|\Stripe\StripeObject $verification Tax ID verification information. + * @property null|(object{status: string, verified_address: null|string, verified_name: null|string}&StripeObject) $verification Tax ID verification information. */ class TaxId extends ApiResource { @@ -33,10 +33,15 @@ class TaxId extends ApiResource const TYPE_AR_CUIT = 'ar_cuit'; const TYPE_AU_ABN = 'au_abn'; const TYPE_AU_ARN = 'au_arn'; + const TYPE_AW_TIN = 'aw_tin'; + const TYPE_AZ_TIN = 'az_tin'; const TYPE_BA_TIN = 'ba_tin'; const TYPE_BB_TIN = 'bb_tin'; + const TYPE_BD_BIN = 'bd_bin'; + const TYPE_BF_IFU = 'bf_ifu'; const TYPE_BG_UIC = 'bg_uic'; const TYPE_BH_VAT = 'bh_vat'; + const TYPE_BJ_IFU = 'bj_ifu'; const TYPE_BO_TIN = 'bo_tin'; const TYPE_BR_CNPJ = 'br_cnpj'; const TYPE_BR_CPF = 'br_cpf'; @@ -52,14 +57,17 @@ class TaxId extends ApiResource const TYPE_CH_UID = 'ch_uid'; const TYPE_CH_VAT = 'ch_vat'; const TYPE_CL_TIN = 'cl_tin'; + const TYPE_CM_NIU = 'cm_niu'; const TYPE_CN_TIN = 'cn_tin'; const TYPE_CO_NIT = 'co_nit'; const TYPE_CR_TIN = 'cr_tin'; + const TYPE_CV_NIF = 'cv_nif'; const TYPE_DE_STN = 'de_stn'; const TYPE_DO_RCN = 'do_rcn'; const TYPE_EC_RUC = 'ec_ruc'; const TYPE_EG_TIN = 'eg_tin'; const TYPE_ES_CIF = 'es_cif'; + const TYPE_ET_TIN = 'et_tin'; const TYPE_EU_OSS_VAT = 'eu_oss_vat'; const TYPE_EU_VAT = 'eu_vat'; const TYPE_GB_VAT = 'gb_vat'; @@ -76,9 +84,11 @@ class TaxId extends ApiResource const TYPE_JP_RN = 'jp_rn'; const TYPE_JP_TRN = 'jp_trn'; const TYPE_KE_PIN = 'ke_pin'; + const TYPE_KG_TIN = 'kg_tin'; const TYPE_KH_TIN = 'kh_tin'; const TYPE_KR_BRN = 'kr_brn'; const TYPE_KZ_BIN = 'kz_bin'; + const TYPE_LA_TIN = 'la_tin'; const TYPE_LI_UID = 'li_uid'; const TYPE_LI_VAT = 'li_vat'; const TYPE_MA_VAT = 'ma_vat'; @@ -130,12 +140,12 @@ class TaxId extends ApiResource /** * Creates a new account or customer tax_id object. * - * @param null|array $params + * @param null|array{expand?: string[], owner?: array{account?: string, customer?: string, type: string}, type: string, value: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TaxId the created resource * - * @return \Stripe\TaxId the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -143,7 +153,7 @@ class TaxId extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -155,9 +165,9 @@ class TaxId extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TaxId the deleted resource * - * @return \Stripe\TaxId the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -173,18 +183,18 @@ class TaxId extends ApiResource /** * Returns a list of tax IDs. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, owner?: array{account?: string, customer?: string, type: string}, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\TaxId> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -193,13 +203,13 @@ class TaxId extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TaxId * - * @return \Stripe\TaxId + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/TaxRate.php b/plugins/stripe-php/lib/TaxRate.php index fc564ff1..f9e7f468 100644 --- a/plugins/stripe-php/lib/TaxRate.php +++ b/plugins/stripe-php/lib/TaxRate.php @@ -5,9 +5,9 @@ namespace Stripe; /** - * Tax rates can be applied to invoices, subscriptions and Checkout Sessions to collect tax. + * Tax rates can be applied to invoices, subscriptions and Checkout Sessions to collect tax. * - * Related guide: Tax rates + * Related guide: Tax rates * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. @@ -17,15 +17,15 @@ namespace Stripe; * @property null|string $description An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. * @property string $display_name The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. * @property null|float $effective_percentage Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage reflects the rate actually used to calculate tax based on the product's taxability and whether the user is registered to collect taxes in the corresponding jurisdiction. - * @property null|\Stripe\StripeObject $flat_amount The amount of the tax rate when the rate_type is flat_amount. Tax rates with rate_type percentage can vary based on the transaction, resulting in this field being null. This field exposes the amount and currency of the flat tax rate. + * @property null|(object{amount: int, currency: string}&StripeObject) $flat_amount The amount of the tax rate when the rate_type is flat_amount. Tax rates with rate_type percentage can vary based on the transaction, resulting in this field being null. This field exposes the amount and currency of the flat tax rate. * @property bool $inclusive This specifies if the tax rate is inclusive or exclusive. * @property null|string $jurisdiction The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. * @property null|string $jurisdiction_level The level of the jurisdiction that imposes this tax rate. Will be null for manually defined tax rates. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property float $percentage Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. - * @property null|string $rate_type Indicates the type of tax rate applied to the taxable amount. This value can be null when no tax applies to the location. - * @property null|string $state ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. + * @property null|string $rate_type Indicates the type of tax rate applied to the taxable amount. This value can be null when no tax applies to the location. This field is only present for TaxRates created by Stripe Tax. + * @property null|string $state ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. * @property null|string $tax_type The high-level tax type, such as vat or sales_tax. */ class TaxRate extends ApiResource @@ -62,12 +62,12 @@ class TaxRate extends ApiResource /** * Creates a new tax rate. * - * @param null|array $params + * @param null|array{active?: bool, country?: string, description?: string, display_name: string, expand?: string[], inclusive: bool, jurisdiction?: string, metadata?: array, percentage: float, state?: string, tax_type?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TaxRate the created resource * - * @return \Stripe\TaxRate the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -75,7 +75,7 @@ class TaxRate extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -85,18 +85,18 @@ class TaxRate extends ApiResource * Returns a list of your tax rates. Tax rates are returned sorted by creation * date, with the most recently created tax rates appearing first. * - * @param null|array $params + * @param null|array{active?: bool, created?: array|int, ending_before?: string, expand?: string[], inclusive?: bool, limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\TaxRate> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -105,13 +105,13 @@ class TaxRate extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TaxRate * - * @return \Stripe\TaxRate + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -122,12 +122,12 @@ class TaxRate extends ApiResource * Updates an existing tax rate. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{active?: bool, country?: string, description?: string, display_name?: string, expand?: string[], jurisdiction?: string, metadata?: null|array, state?: string, tax_type?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TaxRate the updated resource * - * @return \Stripe\TaxRate the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -135,7 +135,7 @@ class TaxRate extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/Terminal/Configuration.php b/plugins/stripe-php/lib/Terminal/Configuration.php index 66a6e667..aa8e4fc8 100644 --- a/plugins/stripe-php/lib/Terminal/Configuration.php +++ b/plugins/stripe-php/lib/Terminal/Configuration.php @@ -9,15 +9,16 @@ namespace Stripe\Terminal; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $bbpos_wisepos_e + * @property null|(object{splashscreen?: string|\Stripe\File}&\Stripe\StripeObject) $bbpos_wisepos_e * @property null|bool $is_account_default Whether this Configuration is the default for your account * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $name String indicating the name of the Configuration object, set by the user - * @property null|\Stripe\StripeObject $offline - * @property null|\Stripe\StripeObject $reboot_window - * @property null|\Stripe\StripeObject $stripe_s700 - * @property null|\Stripe\StripeObject $tipping - * @property null|\Stripe\StripeObject $verifone_p400 + * @property null|(object{enabled: null|bool}&\Stripe\StripeObject) $offline + * @property null|(object{end_hour: int, start_hour: int}&\Stripe\StripeObject) $reboot_window + * @property null|(object{splashscreen?: string|\Stripe\File}&\Stripe\StripeObject) $stripe_s700 + * @property null|(object{aud?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), cad?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), chf?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), czk?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), dkk?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), eur?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), gbp?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), hkd?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), jpy?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), myr?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), nok?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), nzd?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), pln?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), sek?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), sgd?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject), usd?: (object{fixed_amounts?: null|int[], percentages?: null|int[], smart_tip_threshold?: int}&\Stripe\StripeObject)}&\Stripe\StripeObject) $tipping + * @property null|(object{splashscreen?: string|\Stripe\File}&\Stripe\StripeObject) $verifone_p400 + * @property null|(object{enterprise_eap_peap?: (object{ca_certificate_file?: string, password: string, ssid: string, username: string}&\Stripe\StripeObject), enterprise_eap_tls?: (object{ca_certificate_file?: string, client_certificate_file: string, private_key_file: string, private_key_file_password?: string, ssid: string}&\Stripe\StripeObject), personal_psk?: (object{password: string, ssid: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $wifi */ class Configuration extends \Stripe\ApiResource { @@ -28,12 +29,12 @@ class Configuration extends \Stripe\ApiResource /** * Creates a new Configuration object. * - * @param null|array $params + * @param null|array{bbpos_wisepos_e?: array{splashscreen?: null|string}, expand?: string[], name?: string, offline?: null|array{enabled: bool}, reboot_window?: array{end_hour: int, start_hour: int}, stripe_s700?: array{splashscreen?: null|string}, tipping?: null|array{aud?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, cad?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, chf?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, czk?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, dkk?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, eur?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, gbp?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, hkd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, jpy?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, myr?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, nok?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, nzd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, pln?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, sek?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, sgd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, usd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}}, verifone_p400?: array{splashscreen?: null|string}, wifi?: null|array{enterprise_eap_peap?: array{ca_certificate_file?: string, password: string, ssid: string, username: string}, enterprise_eap_tls?: array{ca_certificate_file?: string, client_certificate_file: string, private_key_file: string, private_key_file_password?: string, ssid: string}, personal_psk?: array{password: string, ssid: string}, type: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Configuration the created resource * - * @return \Stripe\Terminal\Configuration the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -53,9 +54,9 @@ class Configuration extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Configuration the deleted resource * - * @return \Stripe\Terminal\Configuration the deleted resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -71,12 +72,12 @@ class Configuration extends \Stripe\ApiResource /** * Returns a list of Configuration objects. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], is_account_default?: bool, limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Terminal\Configuration> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -91,9 +92,9 @@ class Configuration extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Configuration * - * @return \Stripe\Terminal\Configuration + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -108,12 +109,12 @@ class Configuration extends \Stripe\ApiResource * Updates a new Configuration object. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{bbpos_wisepos_e?: null|array{splashscreen?: null|string}, expand?: string[], name?: string, offline?: null|array{enabled: bool}, reboot_window?: null|array{end_hour: int, start_hour: int}, stripe_s700?: null|array{splashscreen?: null|string}, tipping?: null|array{aud?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, cad?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, chf?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, czk?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, dkk?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, eur?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, gbp?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, hkd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, jpy?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, myr?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, nok?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, nzd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, pln?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, sek?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, sgd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}, usd?: array{fixed_amounts?: int[], percentages?: int[], smart_tip_threshold?: int}}, verifone_p400?: null|array{splashscreen?: null|string}, wifi?: null|array{enterprise_eap_peap?: array{ca_certificate_file?: string, password: string, ssid: string, username: string}, enterprise_eap_tls?: array{ca_certificate_file?: string, client_certificate_file: string, private_key_file: string, private_key_file_password?: string, ssid: string}, personal_psk?: array{password: string, ssid: string}, type: string}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Configuration the updated resource * - * @return \Stripe\Terminal\Configuration the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Terminal/ConnectionToken.php b/plugins/stripe-php/lib/Terminal/ConnectionToken.php index 276ec2ad..13d8a288 100644 --- a/plugins/stripe-php/lib/Terminal/ConnectionToken.php +++ b/plugins/stripe-php/lib/Terminal/ConnectionToken.php @@ -22,12 +22,12 @@ class ConnectionToken extends \Stripe\ApiResource * connection token from Stripe, proxied through your server. On your backend, add * an endpoint that creates and returns a connection token. * - * @param null|array $params + * @param null|array{expand?: string[], location?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ConnectionToken the created resource * - * @return \Stripe\Terminal\ConnectionToken the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { diff --git a/plugins/stripe-php/lib/Terminal/Location.php b/plugins/stripe-php/lib/Terminal/Location.php index 11a6f0f0..f3c97d8a 100644 --- a/plugins/stripe-php/lib/Terminal/Location.php +++ b/plugins/stripe-php/lib/Terminal/Location.php @@ -11,7 +11,7 @@ namespace Stripe\Terminal; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $address + * @property (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject) $address * @property null|string $configuration_overrides The ID of a configuration that will be used to customize all readers in this location. * @property string $display_name The display name of the location. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. @@ -28,12 +28,12 @@ class Location extends \Stripe\ApiResource * address fields are required in each country, see the Manage locations guide. * - * @param null|array $params + * @param null|array{address: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string}, configuration_overrides?: string, display_name: string, expand?: string[], metadata?: null|array} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Location the created resource * - * @return \Stripe\Terminal\Location the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -53,9 +53,9 @@ class Location extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Location the deleted resource * - * @return \Stripe\Terminal\Location the deleted resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -71,12 +71,12 @@ class Location extends \Stripe\ApiResource /** * Returns a list of Location objects. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Terminal\Location> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -91,9 +91,9 @@ class Location extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Location * - * @return \Stripe\Terminal\Location + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -109,12 +109,12 @@ class Location extends \Stripe\ApiResource * passed. Any parameters not provided will be left unchanged. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, configuration_overrides?: null|string, display_name?: string, expand?: string[], metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Location the updated resource * - * @return \Stripe\Terminal\Location the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Terminal/Reader.php b/plugins/stripe-php/lib/Terminal/Reader.php index abb8a0d5..0ea4a371 100644 --- a/plugins/stripe-php/lib/Terminal/Reader.php +++ b/plugins/stripe-php/lib/Terminal/Reader.php @@ -11,13 +11,13 @@ namespace Stripe\Terminal; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $action The most recent action performed by the reader. + * @property null|(object{failure_code: null|string, failure_message: null|string, process_payment_intent?: (object{payment_intent: string|\Stripe\PaymentIntent, process_config?: (object{enable_customer_cancellation?: bool, skip_tipping?: bool, tipping?: (object{amount_eligible?: int}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject), process_setup_intent?: (object{generated_card?: string, process_config?: (object{enable_customer_cancellation?: bool}&\Stripe\StripeObject), setup_intent: string|\Stripe\SetupIntent}&\Stripe\StripeObject), refund_payment?: (object{amount?: int, charge?: string|\Stripe\Charge, metadata?: \Stripe\StripeObject, payment_intent?: string|\Stripe\PaymentIntent, reason?: string, refund?: string|\Stripe\Refund, refund_application_fee?: bool, refund_payment_config?: (object{enable_customer_cancellation?: bool}&\Stripe\StripeObject), reverse_transfer?: bool}&\Stripe\StripeObject), set_reader_display?: (object{cart: null|(object{currency: string, line_items: (object{amount: int, description: string, quantity: int}&\Stripe\StripeObject)[], tax: null|int, total: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), status: string, type: string}&\Stripe\StripeObject) $action The most recent action performed by the reader. * @property null|string $device_sw_version The current software version of the reader. * @property string $device_type Type of reader, one of bbpos_wisepad3, stripe_m2, stripe_s700, bbpos_chipper2x, bbpos_wisepos_e, verifone_P400, simulated_wisepos_e, or mobile_phone_reader. * @property null|string $ip_address The local IP address of the reader. * @property string $label Custom label given to the reader for easier identification. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Terminal\Location $location The location identifier of the reader. + * @property null|Location|string $location The location identifier of the reader. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $serial_number Serial number of the reader. * @property null|string $status The networking status of the reader. We do not recommend using this field in flows that may block taking payments. @@ -43,12 +43,12 @@ class Reader extends \Stripe\ApiResource /** * Creates a new Reader object. * - * @param null|array $params + * @param null|array{expand?: string[], label?: string, location?: string, metadata?: null|array, registration_code: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Reader the created resource * - * @return \Stripe\Terminal\Reader the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -68,9 +68,9 @@ class Reader extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Reader the deleted resource * - * @return \Stripe\Terminal\Reader the deleted resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -86,12 +86,12 @@ class Reader extends \Stripe\ApiResource /** * Returns a list of Reader objects. * - * @param null|array $params + * @param null|array{device_type?: string, ending_before?: string, expand?: string[], limit?: int, location?: string, serial_number?: string, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Terminal\Reader> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -106,9 +106,9 @@ class Reader extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Reader * - * @return \Stripe\Terminal\Reader + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -124,12 +124,12 @@ class Reader extends \Stripe\ApiResource * passed. Any parameters not provided will be left unchanged. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], label?: null|string, metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Reader the updated resource * - * @return \Stripe\Terminal\Reader the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -147,9 +147,9 @@ class Reader extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Reader the canceled reader * - * @return \Stripe\Terminal\Reader the canceled reader + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancelAction($params = null, $opts = null) { @@ -164,9 +164,9 @@ class Reader extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Reader the processed reader * - * @return \Stripe\Terminal\Reader the processed reader + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function processPaymentIntent($params = null, $opts = null) { @@ -181,9 +181,9 @@ class Reader extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Reader the processed reader * - * @return \Stripe\Terminal\Reader the processed reader + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function processSetupIntent($params = null, $opts = null) { @@ -198,9 +198,9 @@ class Reader extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Reader the refunded reader * - * @return \Stripe\Terminal\Reader the refunded reader + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function refundPayment($params = null, $opts = null) { @@ -215,9 +215,9 @@ class Reader extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Reader the seted reader * - * @return \Stripe\Terminal\Reader the seted reader + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function setReaderDisplay($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/TestHelpers/TestClock.php b/plugins/stripe-php/lib/TestHelpers/TestClock.php index 361b2692..61d86f1d 100644 --- a/plugins/stripe-php/lib/TestHelpers/TestClock.php +++ b/plugins/stripe-php/lib/TestHelpers/TestClock.php @@ -17,7 +17,7 @@ namespace Stripe\TestHelpers; * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $name The custom name supplied at creation. * @property string $status The status of the Test Clock. - * @property \Stripe\StripeObject $status_details + * @property (object{advancing?: (object{target_frozen_time: int}&\Stripe\StripeObject)}&\Stripe\StripeObject) $status_details */ class TestClock extends \Stripe\ApiResource { @@ -30,12 +30,12 @@ class TestClock extends \Stripe\ApiResource /** * Creates a new test clock that can be attached to new customers and quotes. * - * @param null|array $params + * @param null|array{expand?: string[], frozen_time: int, name?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TestClock the created resource * - * @return \Stripe\TestHelpers\TestClock the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -55,9 +55,9 @@ class TestClock extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TestClock the deleted resource * - * @return \Stripe\TestHelpers\TestClock the deleted resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -73,12 +73,12 @@ class TestClock extends \Stripe\ApiResource /** * Returns a list of your test clocks. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\TestHelpers\TestClock> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -93,9 +93,9 @@ class TestClock extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TestClock * - * @return \Stripe\TestHelpers\TestClock + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -110,9 +110,9 @@ class TestClock extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TestClock the advanced test clock * - * @return \Stripe\TestHelpers\TestClock the advanced test clock + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function advance($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Token.php b/plugins/stripe-php/lib/Token.php index 83e53700..ba3d67ce 100644 --- a/plugins/stripe-php/lib/Token.php +++ b/plugins/stripe-php/lib/Token.php @@ -28,8 +28,8 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\BankAccount $bank_account

      These bank accounts are payment methods on Customer objects.

      On the other hand External Accounts are transfer destinations on Account objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above.

      Related guide: Bank debits and transfers

      - * @property null|\Stripe\Card $card

      You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

      Related guide: Card payments with Sources

      + * @property null|BankAccount $bank_account

      These bank accounts are payment methods on Customer objects.

      On the other hand External Accounts are transfer destinations on Account objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above.

      Related guide: Bank debits and transfers

      + * @property null|Card $card

      You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

      Related guide: Card payments with Sources

      * @property null|string $client_ip IP address of the client that generates the token. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. @@ -53,12 +53,12 @@ class Token extends ApiResource * href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection * is application, which includes Custom accounts. * - * @param null|array $params + * @param null|array{account?: array{business_type?: string, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_declaration_shown_and_signed?: bool, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, tos_shown_and_accepted?: bool}, bank_account?: array{account_holder_name?: string, account_holder_type?: string, account_number: string, account_type?: string, country: string, currency?: string, payment_method?: string, routing_number?: string}, card?: array|string, customer?: string, cvc_update?: array{cvc: string}, expand?: string[], person?: array{additional_tos_acceptances?: array{account?: array{date?: int, ip?: string, user_agent?: null|string}}, address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files?: string[]}, passport?: array{files?: string[]}, visa?: array{files?: string[]}}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, nationality?: string, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{authorizer?: bool, director?: bool, executive?: bool, legal_guardian?: bool, owner?: bool, percent_ownership?: null|float, representative?: bool, title?: string}, ssn_last_4?: string, us_cfpb_data?: array{ethnicity_details?: array{ethnicity?: string[], ethnicity_other?: string}, race_details?: array{race?: string[], race_other?: string}, self_identified_gender?: string}, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, pii?: array{id_number?: string}} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Token the created resource * - * @return \Stripe\Token the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -66,7 +66,7 @@ class Token extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -78,13 +78,13 @@ class Token extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Token * - * @return \Stripe\Token + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); diff --git a/plugins/stripe-php/lib/Topup.php b/plugins/stripe-php/lib/Topup.php index 2954a7d1..1860185f 100644 --- a/plugins/stripe-php/lib/Topup.php +++ b/plugins/stripe-php/lib/Topup.php @@ -14,7 +14,7 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Amount transferred. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up. + * @property null|BalanceTransaction|string $balance_transaction ID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. @@ -22,8 +22,8 @@ namespace Stripe; * @property null|string $failure_code Error code explaining reason for top-up failure if available (see the errors section for a list of codes). * @property null|string $failure_message Message to user further explaining reason for top-up failure if available. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\Source $source The source field is deprecated. It might not always be present in the API response. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|Source $source The source field is deprecated. It might not always be present in the API response. * @property null|string $statement_descriptor Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. * @property string $status The status of the top-up is either canceled, failed, pending, reversed, or succeeded. * @property null|string $transfer_group A string that identifies this top-up as part of a group. @@ -43,12 +43,12 @@ class Topup extends ApiResource /** * Top up the balance of an account. * - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, expand?: string[], metadata?: null|array, source?: string, statement_descriptor?: string, transfer_group?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Topup the created resource * - * @return \Stripe\Topup the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -56,7 +56,7 @@ class Topup extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -65,18 +65,18 @@ class Topup extends ApiResource /** * Returns a list of top-ups. * - * @param null|array $params + * @param null|array{amount?: array|int, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Topup> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -87,13 +87,13 @@ class Topup extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Topup * - * @return \Stripe\Topup + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -105,12 +105,12 @@ class Topup extends ApiResource * design. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{description?: string, expand?: string[], metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Topup the updated resource * - * @return \Stripe\Topup the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -118,7 +118,7 @@ class Topup extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -128,9 +128,9 @@ class Topup extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Topup the canceled topup * - * @return \Stripe\Topup the canceled topup + * @throws Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Transfer.php b/plugins/stripe-php/lib/Transfer.php index 16c7b1b2..ff68deb5 100644 --- a/plugins/stripe-php/lib/Transfer.php +++ b/plugins/stripe-php/lib/Transfer.php @@ -20,17 +20,17 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Amount in cents (or local equivalent) to be transferred. * @property int $amount_reversed Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact of this transfer on your account balance. + * @property null|BalanceTransaction|string $balance_transaction Balance transaction that describes the impact of this transfer on your account balance. * @property int $created Time that this record of the transfer was first created. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\Account $destination ID of the Stripe account the transfer was sent to. - * @property null|string|\Stripe\Charge $destination_payment If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. + * @property null|Account|string $destination ID of the Stripe account the transfer was sent to. + * @property null|Charge|string $destination_payment If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Collection<\Stripe\TransferReversal> $reversals A list of reversals that have been applied to the transfer. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property Collection $reversals A list of reversals that have been applied to the transfer. * @property bool $reversed Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. - * @property null|string|\Stripe\Charge $source_transaction ID of the charge that was used to fund the transfer. If null, the transfer was funded from the available balance. + * @property null|Charge|string $source_transaction ID of the charge that was used to fund the transfer. If null, the transfer was funded from the available balance. * @property null|string $source_type The source balance this transfer came from. One of card, fpx, or bank_account. * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. */ @@ -50,12 +50,12 @@ class Transfer extends ApiResource * transfer object. Your Stripe balance must be able to * cover the transfer amount, or you’ll receive an “Insufficient Funds” error. * - * @param null|array $params + * @param null|array{amount?: int, currency: string, description?: string, destination: string, expand?: string[], metadata?: array, source_transaction?: string, source_type?: string, transfer_group?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Transfer the created resource * - * @return \Stripe\Transfer the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -63,7 +63,7 @@ class Transfer extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -74,18 +74,18 @@ class Transfer extends ApiResource * are returned in sorted order, with the most recently created transfers appearing * first. * - * @param null|array $params + * @param null|array{created?: array|int, destination?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, transfer_group?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Transfer> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -96,13 +96,13 @@ class Transfer extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Transfer * - * @return \Stripe\Transfer + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -116,12 +116,12 @@ class Transfer extends ApiResource * This request accepts only metadata as an argument. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{description?: string, expand?: string[], metadata?: null|array} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Transfer the updated resource * - * @return \Stripe\Transfer the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -129,7 +129,7 @@ class Transfer extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -142,9 +142,9 @@ class Transfer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection the list of transfer reversals * - * @return \Stripe\Collection<\Stripe\TransferReversal> the list of transfer reversals + * @throws Exception\ApiErrorException if the request fails */ public static function allReversals($id, $params = null, $opts = null) { @@ -156,9 +156,9 @@ class Transfer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TransferReversal * - * @return \Stripe\TransferReversal + * @throws Exception\ApiErrorException if the request fails */ public static function createReversal($id, $params = null, $opts = null) { @@ -171,9 +171,9 @@ class Transfer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TransferReversal * - * @return \Stripe\TransferReversal + * @throws Exception\ApiErrorException if the request fails */ public static function retrieveReversal($id, $reversalId, $params = null, $opts = null) { @@ -186,9 +186,9 @@ class Transfer extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TransferReversal * - * @return \Stripe\TransferReversal + * @throws Exception\ApiErrorException if the request fails */ public static function updateReversal($id, $reversalId, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/TransferReversal.php b/plugins/stripe-php/lib/TransferReversal.php index 36e8ebe4..b7f07441 100644 --- a/plugins/stripe-php/lib/TransferReversal.php +++ b/plugins/stripe-php/lib/TransferReversal.php @@ -22,13 +22,13 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Amount, in cents (or local equivalent). - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property null|BalanceTransaction|string $balance_transaction Balance transaction that describes the impact on your account balance. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Refund $destination_payment_refund Linked payment refund for the transfer reversal. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string|\Stripe\Refund $source_refund ID of the refund responsible for the transfer reversal. - * @property string|\Stripe\Transfer $transfer ID of the transfer that was reversed. + * @property null|Refund|string $destination_payment_refund Linked payment refund for the transfer reversal. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|Refund|string $source_refund ID of the refund responsible for the transfer reversal. + * @property string|Transfer $transfer ID of the transfer that was reversed. */ class TransferReversal extends ApiResource { @@ -47,8 +47,8 @@ class TransferReversal extends ApiResource $transfer = $this['transfer']; if (!$id) { throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", + 'Could not determine which URL to request: ' + . "class instance has invalid ID: {$id}", null ); } @@ -65,9 +65,9 @@ class TransferReversal extends ApiResource /** * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * * @return TransferReversal the saved reversal + * + * @throws Exception\ApiErrorException if the request fails */ public function save($opts = null) { diff --git a/plugins/stripe-php/lib/Treasury/CreditReversal.php b/plugins/stripe-php/lib/Treasury/CreditReversal.php index c0df1448..644be118 100644 --- a/plugins/stripe-php/lib/Treasury/CreditReversal.php +++ b/plugins/stripe-php/lib/Treasury/CreditReversal.php @@ -19,8 +19,8 @@ namespace Stripe\Treasury; * @property string $network The rails used to reverse the funds. * @property string $received_credit The ReceivedCredit being reversed. * @property string $status Status of the CreditReversal - * @property \Stripe\StripeObject $status_transitions - * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + * @property (object{posted_at: null|int}&\Stripe\StripeObject) $status_transitions + * @property null|string|Transaction $transaction The Transaction associated with this object. */ class CreditReversal extends \Stripe\ApiResource { @@ -36,12 +36,12 @@ class CreditReversal extends \Stripe\ApiResource /** * Reverses a ReceivedCredit and creates a CreditReversal object. * - * @param null|array $params + * @param null|array{expand?: string[], metadata?: array, received_credit: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditReversal the created resource * - * @return \Stripe\Treasury\CreditReversal the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -58,12 +58,12 @@ class CreditReversal extends \Stripe\ApiResource /** * Returns a list of CreditReversals. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, received_credit?: string, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Treasury\CreditReversal> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -80,9 +80,9 @@ class CreditReversal extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return CreditReversal * - * @return \Stripe\Treasury\CreditReversal + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Treasury/DebitReversal.php b/plugins/stripe-php/lib/Treasury/DebitReversal.php index 4b83967c..b6b22155 100644 --- a/plugins/stripe-php/lib/Treasury/DebitReversal.php +++ b/plugins/stripe-php/lib/Treasury/DebitReversal.php @@ -14,14 +14,14 @@ namespace Stripe\Treasury; * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $financial_account The FinancialAccount to reverse funds from. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - * @property null|\Stripe\StripeObject $linked_flows Other flows linked to a DebitReversal. + * @property null|(object{issuing_dispute: null|string}&\Stripe\StripeObject) $linked_flows Other flows linked to a DebitReversal. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $network The rails used to reverse the funds. * @property string $received_debit The ReceivedDebit being reversed. * @property string $status Status of the DebitReversal - * @property \Stripe\StripeObject $status_transitions - * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + * @property (object{completed_at: null|int}&\Stripe\StripeObject) $status_transitions + * @property null|string|Transaction $transaction The Transaction associated with this object. */ class DebitReversal extends \Stripe\ApiResource { @@ -37,12 +37,12 @@ class DebitReversal extends \Stripe\ApiResource /** * Reverses a ReceivedDebit and creates a DebitReversal object. * - * @param null|array $params + * @param null|array{expand?: string[], metadata?: array, received_debit: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return DebitReversal the created resource * - * @return \Stripe\Treasury\DebitReversal the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -59,12 +59,12 @@ class DebitReversal extends \Stripe\ApiResource /** * Returns a list of DebitReversals. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, received_debit?: string, resolution?: string, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Treasury\DebitReversal> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -79,9 +79,9 @@ class DebitReversal extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return DebitReversal * - * @return \Stripe\Treasury\DebitReversal + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Treasury/FinancialAccount.php b/plugins/stripe-php/lib/Treasury/FinancialAccount.php index db77d186..e3c04764 100644 --- a/plugins/stripe-php/lib/Treasury/FinancialAccount.php +++ b/plugins/stripe-php/lib/Treasury/FinancialAccount.php @@ -11,18 +11,20 @@ namespace Stripe\Treasury; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string[] $active_features The array of paths to active Features in the Features hash. - * @property \Stripe\StripeObject $balance Balance information for the FinancialAccount + * @property (object{cash: \Stripe\StripeObject, inbound_pending: \Stripe\StripeObject, outbound_pending: \Stripe\StripeObject}&\Stripe\StripeObject) $balance Balance information for the FinancialAccount * @property string $country Two-letter country code (ISO 3166-1 alpha-2). * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\Treasury\FinancialAccountFeatures $features Encodes whether a FinancialAccount has access to a particular Feature, with a status enum and associated status_details. Stripe or the platform can control Features via the requested field. - * @property \Stripe\StripeObject[] $financial_addresses The set of credentials that resolve to a FinancialAccount. + * @property null|FinancialAccountFeatures $features Encodes whether a FinancialAccount has access to a particular Feature, with a status enum and associated status_details. Stripe or the platform can control Features via the requested field. + * @property ((object{aba?: (object{account_holder_name: string, account_number?: null|string, account_number_last4: string, bank_name: string, routing_number: string}&\Stripe\StripeObject), supported_networks?: string[], type: string}&\Stripe\StripeObject))[] $financial_addresses The set of credentials that resolve to a FinancialAccount. + * @property null|bool $is_default * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $nickname The nickname for the FinancialAccount. * @property null|string[] $pending_features The array of paths to pending Features in the Features hash. - * @property null|\Stripe\StripeObject $platform_restrictions The set of functionalities that the platform can restrict on the FinancialAccount. + * @property null|(object{inbound_flows: null|string, outbound_flows: null|string}&\Stripe\StripeObject) $platform_restrictions The set of functionalities that the platform can restrict on the FinancialAccount. * @property null|string[] $restricted_features The array of paths to restricted Features in the Features hash. * @property string $status Status of this FinancialAccount. - * @property \Stripe\StripeObject $status_details + * @property (object{closed: null|(object{reasons: string[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $status_details * @property string[] $supported_currencies The currencies the FinancialAccount can hold a balance in. Three-letter ISO currency code, in lowercase. */ class FinancialAccount extends \Stripe\ApiResource @@ -35,15 +37,15 @@ class FinancialAccount extends \Stripe\ApiResource const STATUS_OPEN = 'open'; /** - * Creates a new FinancialAccount. For now, each connected account can only have - * one FinancialAccount. + * Creates a new FinancialAccount. Each connected account can have up to three + * FinancialAccounts by default. * - * @param null|array $params + * @param null|array{expand?: string[], features?: array{card_issuing?: array{requested: bool}, deposit_insurance?: array{requested: bool}, financial_addresses?: array{aba?: array{requested: bool}}, inbound_transfers?: array{ach?: array{requested: bool}}, intra_stripe_flows?: array{requested: bool}, outbound_payments?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}, outbound_transfers?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}}, metadata?: array, nickname?: null|string, platform_restrictions?: array{inbound_flows?: string, outbound_flows?: string}, supported_currencies: string[]} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return FinancialAccount the created resource * - * @return \Stripe\Treasury\FinancialAccount the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -60,12 +62,12 @@ class FinancialAccount extends \Stripe\ApiResource /** * Returns a list of FinancialAccounts. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Treasury\FinancialAccount> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -80,9 +82,9 @@ class FinancialAccount extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return FinancialAccount * - * @return \Stripe\Treasury\FinancialAccount + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -97,12 +99,12 @@ class FinancialAccount extends \Stripe\ApiResource * Updates the details of a FinancialAccount. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{expand?: string[], features?: array{card_issuing?: array{requested: bool}, deposit_insurance?: array{requested: bool}, financial_addresses?: array{aba?: array{requested: bool}}, inbound_transfers?: array{ach?: array{requested: bool}}, intra_stripe_flows?: array{requested: bool}, outbound_payments?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}, outbound_transfers?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}}, forwarding_settings?: array{financial_account?: string, payment_method?: string, type: string}, metadata?: array, nickname?: null|string, platform_restrictions?: array{inbound_flows?: string, outbound_flows?: string}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return FinancialAccount the updated resource * - * @return \Stripe\Treasury\FinancialAccount the updated resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -120,9 +122,26 @@ class FinancialAccount extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return FinancialAccount the closed financial account * - * @return \Stripe\Treasury\FinancialAccountFeatures the retrieved financial account features + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + public function close($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/close'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @return FinancialAccountFeatures the retrieved financial account features + * + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieveFeatures($params = null, $opts = null) { @@ -138,9 +157,9 @@ class FinancialAccount extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return FinancialAccountFeatures the updated financial account features * - * @return \Stripe\Treasury\FinancialAccountFeatures the updated financial account features + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function updateFeatures($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Treasury/FinancialAccountFeatures.php b/plugins/stripe-php/lib/Treasury/FinancialAccountFeatures.php index 0854f485..08419a8d 100644 --- a/plugins/stripe-php/lib/Treasury/FinancialAccountFeatures.php +++ b/plugins/stripe-php/lib/Treasury/FinancialAccountFeatures.php @@ -9,13 +9,13 @@ namespace Stripe\Treasury; * Stripe or the platform can control Features via the requested field. * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $card_issuing Toggle settings for enabling/disabling a feature - * @property null|\Stripe\StripeObject $deposit_insurance Toggle settings for enabling/disabling a feature - * @property null|\Stripe\StripeObject $financial_addresses Settings related to Financial Addresses features on a Financial Account - * @property null|\Stripe\StripeObject $inbound_transfers InboundTransfers contains inbound transfers features for a FinancialAccount. - * @property null|\Stripe\StripeObject $intra_stripe_flows Toggle settings for enabling/disabling a feature - * @property null|\Stripe\StripeObject $outbound_payments Settings related to Outbound Payments features on a Financial Account - * @property null|\Stripe\StripeObject $outbound_transfers OutboundTransfers contains outbound transfers features for a FinancialAccount. + * @property null|(object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject) $card_issuing Toggle settings for enabling/disabling a feature + * @property null|(object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject) $deposit_insurance Toggle settings for enabling/disabling a feature + * @property null|(object{aba?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $financial_addresses Settings related to Financial Addresses features on a Financial Account + * @property null|(object{ach?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $inbound_transfers InboundTransfers contains inbound transfers features for a FinancialAccount. + * @property null|(object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject) $intra_stripe_flows Toggle settings for enabling/disabling a feature + * @property null|(object{ach?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject), us_domestic_wire?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $outbound_payments Settings related to Outbound Payments features on a Financial Account + * @property null|(object{ach?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject), us_domestic_wire?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $outbound_transfers OutboundTransfers contains outbound transfers features for a FinancialAccount. */ class FinancialAccountFeatures extends \Stripe\ApiResource { diff --git a/plugins/stripe-php/lib/Treasury/InboundTransfer.php b/plugins/stripe-php/lib/Treasury/InboundTransfer.php index 5ae219bc..632572c1 100644 --- a/plugins/stripe-php/lib/Treasury/InboundTransfer.php +++ b/plugins/stripe-php/lib/Treasury/InboundTransfer.php @@ -16,19 +16,19 @@ namespace Stripe\Treasury; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\StripeObject $failure_details Details about this InboundTransfer's failure. Only set when status is failed. + * @property null|(object{code: string}&\Stripe\StripeObject) $failure_details Details about this InboundTransfer's failure. Only set when status is failed. * @property string $financial_account The FinancialAccount that received the funds. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - * @property \Stripe\StripeObject $linked_flows + * @property (object{received_debit: null|string}&\Stripe\StripeObject) $linked_flows * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $origin_payment_method The origin payment method to be debited for an InboundTransfer. - * @property null|\Stripe\StripeObject $origin_payment_method_details Details about the PaymentMethod for an InboundTransfer. + * @property null|(object{billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, fingerprint: null|string, last4: null|string, mandate?: string|\Stripe\Mandate, network: string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $origin_payment_method_details Details about the PaymentMethod for an InboundTransfer. * @property null|bool $returned Returns true if the funds for an InboundTransfer were returned after the InboundTransfer went to the succeeded state. * @property string $statement_descriptor Statement descriptor shown when funds are debited from the source. Not all payment networks support statement_descriptor. * @property string $status Status of the InboundTransfer: processing, succeeded, failed, and canceled. An InboundTransfer is processing if it is created and pending. The status changes to succeeded once the funds have been "confirmed" and a transaction is created and posted. The status changes to failed if the transfer fails. - * @property \Stripe\StripeObject $status_transitions - * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + * @property (object{canceled_at?: null|int, failed_at: null|int, succeeded_at: null|int}&\Stripe\StripeObject) $status_transitions + * @property null|string|Transaction $transaction The Transaction associated with this object. */ class InboundTransfer extends \Stripe\ApiResource { @@ -42,12 +42,12 @@ class InboundTransfer extends \Stripe\ApiResource /** * Creates an InboundTransfer. * - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, expand?: string[], financial_account: string, metadata?: array, origin_payment_method: string, statement_descriptor?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InboundTransfer the created resource * - * @return \Stripe\Treasury\InboundTransfer the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -64,12 +64,12 @@ class InboundTransfer extends \Stripe\ApiResource /** * Returns a list of InboundTransfers sent from the specified FinancialAccount. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Treasury\InboundTransfer> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -84,9 +84,9 @@ class InboundTransfer extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InboundTransfer * - * @return \Stripe\Treasury\InboundTransfer + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -101,9 +101,9 @@ class InboundTransfer extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return InboundTransfer the canceled inbound transfer * - * @return \Stripe\Treasury\InboundTransfer the canceled inbound transfer + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Treasury/OutboundPayment.php b/plugins/stripe-php/lib/Treasury/OutboundPayment.php index 5d3b541f..fdb7631f 100644 --- a/plugins/stripe-php/lib/Treasury/OutboundPayment.php +++ b/plugins/stripe-php/lib/Treasury/OutboundPayment.php @@ -20,19 +20,19 @@ namespace Stripe\Treasury; * @property null|string $customer ID of the customer to whom an OutboundPayment is sent. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|string $destination_payment_method The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using destination_payment_method_data. - * @property null|\Stripe\StripeObject $destination_payment_method_details Details about the PaymentMethod for an OutboundPayment. - * @property null|\Stripe\StripeObject $end_user_details Details about the end user. + * @property null|(object{billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), financial_account?: (object{id: string, network: string}&\Stripe\StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, fingerprint: null|string, last4: null|string, mandate?: string|\Stripe\Mandate, network: string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $destination_payment_method_details Details about the PaymentMethod for an OutboundPayment. + * @property null|(object{ip_address: null|string, present: bool}&\Stripe\StripeObject) $end_user_details Details about the end user. * @property int $expected_arrival_date The date when funds are expected to arrive in the destination account. * @property string $financial_account The FinancialAccount that funds were pulled from. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $returned_details Details about a returned OutboundPayment. Only set when the status is returned. + * @property null|(object{code: string, transaction: string|Transaction}&\Stripe\StripeObject) $returned_details Details about a returned OutboundPayment. Only set when the status is returned. * @property string $statement_descriptor The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). * @property string $status Current status of the OutboundPayment: processing, failed, posted, returned, canceled. An OutboundPayment is processing if it has been created and is pending. The status changes to posted once the OutboundPayment has been "confirmed" and funds have left the account, or to failed or canceled. If an OutboundPayment fails to arrive at its destination, its status will change to returned. - * @property \Stripe\StripeObject $status_transitions - * @property null|\Stripe\StripeObject $tracking_details Details about network-specific tracking information if available. - * @property string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + * @property (object{canceled_at: null|int, failed_at: null|int, posted_at: null|int, returned_at: null|int}&\Stripe\StripeObject) $status_transitions + * @property null|(object{ach?: (object{trace_id: string}&\Stripe\StripeObject), type: string, us_domestic_wire?: (object{chips: null|string, imad: null|string, omad: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $tracking_details Details about network-specific tracking information if available. + * @property string|Transaction $transaction The Transaction associated with this object. */ class OutboundPayment extends \Stripe\ApiResource { @@ -47,12 +47,12 @@ class OutboundPayment extends \Stripe\ApiResource /** * Creates an OutboundPayment. * - * @param null|array $params + * @param null|array{amount: int, currency: string, customer?: string, description?: string, destination_payment_method?: string, destination_payment_method_data?: array{billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string}, financial_account?: string, metadata?: array, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}}, destination_payment_method_options?: array{us_bank_account?: null|array{network?: string}}, end_user_details?: array{ip_address?: string, present: bool}, expand?: string[], financial_account: string, metadata?: array, statement_descriptor?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return OutboundPayment the created resource * - * @return \Stripe\Treasury\OutboundPayment the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -69,12 +69,12 @@ class OutboundPayment extends \Stripe\ApiResource /** * Returns a list of OutboundPayments sent from the specified FinancialAccount. * - * @param null|array $params + * @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Treasury\OutboundPayment> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -91,9 +91,9 @@ class OutboundPayment extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return OutboundPayment * - * @return \Stripe\Treasury\OutboundPayment + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -108,9 +108,9 @@ class OutboundPayment extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return OutboundPayment the canceled outbound payment * - * @return \Stripe\Treasury\OutboundPayment the canceled outbound payment + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Treasury/OutboundTransfer.php b/plugins/stripe-php/lib/Treasury/OutboundTransfer.php index 595d5985..06996fb8 100644 --- a/plugins/stripe-php/lib/Treasury/OutboundTransfer.php +++ b/plugins/stripe-php/lib/Treasury/OutboundTransfer.php @@ -19,18 +19,18 @@ namespace Stripe\Treasury; * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|string $destination_payment_method The PaymentMethod used as the payment instrument for an OutboundTransfer. - * @property \Stripe\StripeObject $destination_payment_method_details + * @property (object{billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), financial_account?: (object{id: string, network: string}&\Stripe\StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, fingerprint: null|string, last4: null|string, mandate?: string|\Stripe\Mandate, network: string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $destination_payment_method_details * @property int $expected_arrival_date The date when funds are expected to arrive in the destination account. * @property string $financial_account The FinancialAccount that funds were pulled from. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $returned_details Details about a returned OutboundTransfer. Only set when the status is returned. + * @property null|(object{code: string, transaction: string|Transaction}&\Stripe\StripeObject) $returned_details Details about a returned OutboundTransfer. Only set when the status is returned. * @property string $statement_descriptor Information about the OutboundTransfer to be sent to the recipient account. * @property string $status Current status of the OutboundTransfer: processing, failed, canceled, posted, returned. An OutboundTransfer is processing if it has been created and is pending. The status changes to posted once the OutboundTransfer has been "confirmed" and funds have left the account, or to failed or canceled. If an OutboundTransfer fails to arrive at its destination, its status will change to returned. - * @property \Stripe\StripeObject $status_transitions - * @property null|\Stripe\StripeObject $tracking_details Details about network-specific tracking information if available. - * @property string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + * @property (object{canceled_at: null|int, failed_at: null|int, posted_at: null|int, returned_at: null|int}&\Stripe\StripeObject) $status_transitions + * @property null|(object{ach?: (object{trace_id: string}&\Stripe\StripeObject), type: string, us_domestic_wire?: (object{chips: null|string, imad: null|string, omad: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $tracking_details Details about network-specific tracking information if available. + * @property string|Transaction $transaction The Transaction associated with this object. */ class OutboundTransfer extends \Stripe\ApiResource { @@ -45,12 +45,12 @@ class OutboundTransfer extends \Stripe\ApiResource /** * Creates an OutboundTransfer. * - * @param null|array $params + * @param null|array{amount: int, currency: string, description?: string, destination_payment_method?: string, destination_payment_method_data?: array{financial_account?: string, type: string}, destination_payment_method_options?: array{us_bank_account?: null|array{network?: string}}, expand?: string[], financial_account: string, metadata?: array, statement_descriptor?: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return OutboundTransfer the created resource * - * @return \Stripe\Treasury\OutboundTransfer the created resource + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -67,12 +67,12 @@ class OutboundTransfer extends \Stripe\ApiResource /** * Returns a list of OutboundTransfers sent from the specified FinancialAccount. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Treasury\OutboundTransfer> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -89,9 +89,9 @@ class OutboundTransfer extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return OutboundTransfer * - * @return \Stripe\Treasury\OutboundTransfer + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { @@ -106,9 +106,9 @@ class OutboundTransfer extends \Stripe\ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return OutboundTransfer the canceled outbound transfer * - * @return \Stripe\Treasury\OutboundTransfer the canceled outbound transfer + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function cancel($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Treasury/ReceivedCredit.php b/plugins/stripe-php/lib/Treasury/ReceivedCredit.php index a2a1cd17..5f9b924b 100644 --- a/plugins/stripe-php/lib/Treasury/ReceivedCredit.php +++ b/plugins/stripe-php/lib/Treasury/ReceivedCredit.php @@ -16,13 +16,13 @@ namespace Stripe\Treasury; * @property null|string $failure_code Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. * @property null|string $financial_account The FinancialAccount that received the funds. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - * @property \Stripe\StripeObject $initiating_payment_method_details - * @property \Stripe\StripeObject $linked_flows + * @property (object{balance?: string, billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), financial_account?: (object{id: string, network: string}&\Stripe\StripeObject), issuing_card?: string, type: string, us_bank_account?: (object{bank_name: null|string, last4: null|string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $initiating_payment_method_details + * @property (object{credit_reversal: null|string, issuing_authorization: null|string, issuing_transaction: null|string, source_flow: null|string, source_flow_details?: null|(object{credit_reversal?: CreditReversal, outbound_payment?: OutboundPayment, outbound_transfer?: OutboundTransfer, payout?: \Stripe\Payout, type: string}&\Stripe\StripeObject), source_flow_type: null|string}&\Stripe\StripeObject) $linked_flows * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $network The rails used to send the funds. - * @property null|\Stripe\StripeObject $reversal_details Details describing when a ReceivedCredit may be reversed. + * @property null|(object{deadline: null|int, restricted_reason: null|string}&\Stripe\StripeObject) $reversal_details Details describing when a ReceivedCredit may be reversed. * @property string $status Status of the ReceivedCredit. ReceivedCredits are created either succeeded (approved) or failed (declined). If a ReceivedCredit is declined, the failure reason can be found in the failure_code field. - * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + * @property null|string|Transaction $transaction The Transaction associated with this object. */ class ReceivedCredit extends \Stripe\ApiResource { @@ -44,12 +44,12 @@ class ReceivedCredit extends \Stripe\ApiResource /** * Returns a list of ReceivedCredits. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, linked_flows?: array{source_flow_type: string}, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Treasury\ReceivedCredit> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -65,9 +65,9 @@ class ReceivedCredit extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ReceivedCredit * - * @return \Stripe\Treasury\ReceivedCredit + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Treasury/ReceivedDebit.php b/plugins/stripe-php/lib/Treasury/ReceivedDebit.php index ba9bf482..75e1e8a1 100644 --- a/plugins/stripe-php/lib/Treasury/ReceivedDebit.php +++ b/plugins/stripe-php/lib/Treasury/ReceivedDebit.php @@ -16,13 +16,13 @@ namespace Stripe\Treasury; * @property null|string $failure_code Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. * @property null|string $financial_account The FinancialAccount that funds were pulled from. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - * @property null|\Stripe\StripeObject $initiating_payment_method_details - * @property \Stripe\StripeObject $linked_flows + * @property null|(object{balance?: string, billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), financial_account?: (object{id: string, network: string}&\Stripe\StripeObject), issuing_card?: string, type: string, us_bank_account?: (object{bank_name: null|string, last4: null|string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $initiating_payment_method_details + * @property (object{debit_reversal: null|string, inbound_transfer: null|string, issuing_authorization: null|string, issuing_transaction: null|string, payout: null|string}&\Stripe\StripeObject) $linked_flows * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $network The network used for the ReceivedDebit. - * @property null|\Stripe\StripeObject $reversal_details Details describing when a ReceivedDebit might be reversed. + * @property null|(object{deadline: null|int, restricted_reason: null|string}&\Stripe\StripeObject) $reversal_details Details describing when a ReceivedDebit might be reversed. * @property string $status Status of the ReceivedDebit. ReceivedDebits are created with a status of either succeeded (approved) or failed (declined). The failure reason can be found under the failure_code. - * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + * @property null|string|Transaction $transaction The Transaction associated with this object. */ class ReceivedDebit extends \Stripe\ApiResource { @@ -44,12 +44,12 @@ class ReceivedDebit extends \Stripe\ApiResource /** * Returns a list of ReceivedDebits. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Treasury\ReceivedDebit> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -65,9 +65,9 @@ class ReceivedDebit extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return ReceivedDebit * - * @return \Stripe\Treasury\ReceivedDebit + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Treasury/Transaction.php b/plugins/stripe-php/lib/Treasury/Transaction.php index b694d68a..95d43e80 100644 --- a/plugins/stripe-php/lib/Treasury/Transaction.php +++ b/plugins/stripe-php/lib/Treasury/Transaction.php @@ -10,18 +10,18 @@ namespace Stripe\Treasury; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Amount (in cents) transferred. - * @property \Stripe\StripeObject $balance_impact Change to a FinancialAccount's balance + * @property (object{cash: int, inbound_pending: int, outbound_pending: int}&\Stripe\StripeObject) $balance_impact Change to a FinancialAccount's balance * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\Collection<\Stripe\Treasury\TransactionEntry> $entries A list of TransactionEntries that are part of this Transaction. This cannot be expanded in any list endpoints. + * @property null|\Stripe\Collection $entries A list of TransactionEntries that are part of this Transaction. This cannot be expanded in any list endpoints. * @property string $financial_account The FinancialAccount associated with this object. * @property null|string $flow ID of the flow that created the Transaction. - * @property null|\Stripe\StripeObject $flow_details Details of the flow that created the Transaction. + * @property null|(object{credit_reversal?: CreditReversal, debit_reversal?: DebitReversal, inbound_transfer?: InboundTransfer, issuing_authorization?: \Stripe\Issuing\Authorization, outbound_payment?: OutboundPayment, outbound_transfer?: OutboundTransfer, received_credit?: ReceivedCredit, received_debit?: ReceivedDebit, type: string}&\Stripe\StripeObject) $flow_details Details of the flow that created the Transaction. * @property string $flow_type Type of the flow that created the Transaction. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $status Status of the Transaction. - * @property \Stripe\StripeObject $status_transitions + * @property (object{posted_at: null|int, void_at: null|int}&\Stripe\StripeObject) $status_transitions */ class Transaction extends \Stripe\ApiResource { @@ -44,12 +44,12 @@ class Transaction extends \Stripe\ApiResource /** * Retrieves a list of Transaction objects. * - * @param null|array $params + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], financial_account: string, limit?: int, order_by?: string, starting_after?: string, status?: string, status_transitions?: array{posted_at?: array|int}} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Treasury\Transaction> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -64,9 +64,9 @@ class Transaction extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Transaction * - * @return \Stripe\Treasury\Transaction + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/Treasury/TransactionEntry.php b/plugins/stripe-php/lib/Treasury/TransactionEntry.php index fcef7eff..59296a99 100644 --- a/plugins/stripe-php/lib/Treasury/TransactionEntry.php +++ b/plugins/stripe-php/lib/Treasury/TransactionEntry.php @@ -9,16 +9,16 @@ namespace Stripe\Treasury; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $balance_impact Change to a FinancialAccount's balance + * @property (object{cash: int, inbound_pending: int, outbound_pending: int}&\Stripe\StripeObject) $balance_impact Change to a FinancialAccount's balance * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property int $effective_at When the TransactionEntry will impact the FinancialAccount's balance. * @property string $financial_account The FinancialAccount associated with this object. * @property null|string $flow Token of the flow associated with the TransactionEntry. - * @property null|\Stripe\StripeObject $flow_details Details of the flow associated with the TransactionEntry. + * @property null|(object{credit_reversal?: CreditReversal, debit_reversal?: DebitReversal, inbound_transfer?: InboundTransfer, issuing_authorization?: \Stripe\Issuing\Authorization, outbound_payment?: OutboundPayment, outbound_transfer?: OutboundTransfer, received_credit?: ReceivedCredit, received_debit?: ReceivedDebit, type: string}&\Stripe\StripeObject) $flow_details Details of the flow associated with the TransactionEntry. * @property string $flow_type Type of the flow associated with the TransactionEntry. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + * @property string|Transaction $transaction The Transaction associated with this object. * @property string $type The specific money movement that generated the TransactionEntry. */ class TransactionEntry extends \Stripe\ApiResource @@ -59,12 +59,12 @@ class TransactionEntry extends \Stripe\ApiResource /** * Retrieves a list of TransactionEntry objects. * - * @param null|array $params + * @param null|array{created?: array|int, effective_at?: array|int, ending_before?: string, expand?: string[], financial_account: string, limit?: int, order_by?: string, starting_after?: string, transaction?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return \Stripe\Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\Treasury\TransactionEntry> of ApiResources + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { @@ -79,9 +79,9 @@ class TransactionEntry extends \Stripe\ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return TransactionEntry * - * @return \Stripe\Treasury\TransactionEntry + * @throws \Stripe\Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { diff --git a/plugins/stripe-php/lib/UsageRecord.php b/plugins/stripe-php/lib/UsageRecord.php deleted file mode 100644 index 13dd1ccf..00000000 --- a/plugins/stripe-php/lib/UsageRecord.php +++ /dev/null @@ -1,25 +0,0 @@ -Metered billing - * - * This is our legacy usage-based billing API. See the updated usage-based billing docs. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $quantity The usage quantity for the specified date. - * @property string $subscription_item The ID of the subscription item this usage record contains data for. - * @property int $timestamp The timestamp when this usage occurred. - */ -class UsageRecord extends ApiResource -{ - const OBJECT_NAME = 'usage_record'; -} diff --git a/plugins/stripe-php/lib/UsageRecordSummary.php b/plugins/stripe-php/lib/UsageRecordSummary.php deleted file mode 100644 index d9a98392..00000000 --- a/plugins/stripe-php/lib/UsageRecordSummary.php +++ /dev/null @@ -1,21 +0,0 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $period - * @property string $subscription_item The ID of the subscription item this summary is describing. - * @property int $total_usage The total usage within this usage period. - */ -class UsageRecordSummary extends ApiResource -{ - const OBJECT_NAME = 'usage_record_summary'; -} diff --git a/plugins/stripe-php/lib/Util/ApiVersion.php b/plugins/stripe-php/lib/Util/ApiVersion.php index e8a11904..ed5944c4 100644 --- a/plugins/stripe-php/lib/Util/ApiVersion.php +++ b/plugins/stripe-php/lib/Util/ApiVersion.php @@ -6,5 +6,5 @@ namespace Stripe\Util; class ApiVersion { - const CURRENT = '2024-12-18.acacia'; + const CURRENT = '2025-04-30.basil'; } diff --git a/plugins/stripe-php/lib/Util/EventTypes.php b/plugins/stripe-php/lib/Util/EventTypes.php index 8badd284..d1d2271d 100644 --- a/plugins/stripe-php/lib/Util/EventTypes.php +++ b/plugins/stripe-php/lib/Util/EventTypes.php @@ -8,6 +8,7 @@ class EventTypes // The beginning of the section generated from our OpenAPI spec \Stripe\Events\V1BillingMeterErrorReportTriggeredEvent::LOOKUP_TYPE => \Stripe\Events\V1BillingMeterErrorReportTriggeredEvent::class, \Stripe\Events\V1BillingMeterNoMeterFoundEvent::LOOKUP_TYPE => \Stripe\Events\V1BillingMeterNoMeterFoundEvent::class, + \Stripe\Events\V2CoreEventDestinationPingEvent::LOOKUP_TYPE => \Stripe\Events\V2CoreEventDestinationPingEvent::class, // The end of the section generated from our OpenAPI spec ]; } diff --git a/plugins/stripe-php/lib/Util/ObjectTypes.php b/plugins/stripe-php/lib/Util/ObjectTypes.php index df368635..83043e0c 100644 --- a/plugins/stripe-php/lib/Util/ObjectTypes.php +++ b/plugins/stripe-php/lib/Util/ObjectTypes.php @@ -7,8 +7,8 @@ class ObjectTypes /** * @var array Mapping from object types to resource classes */ - const mapping = - [ + const mapping + = [ \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, \Stripe\SearchResult::OBJECT_NAME => \Stripe\SearchResult::class, @@ -76,6 +76,7 @@ class ObjectTypes \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, + \Stripe\InvoicePayment::OBJECT_NAME => \Stripe\InvoicePayment::class, \Stripe\InvoiceRenderingTemplate::OBJECT_NAME => \Stripe\InvoiceRenderingTemplate::class, \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, @@ -149,8 +150,6 @@ class ObjectTypes \Stripe\Treasury\ReceivedDebit::OBJECT_NAME => \Stripe\Treasury\ReceivedDebit::class, \Stripe\Treasury\Transaction::OBJECT_NAME => \Stripe\Treasury\Transaction::class, \Stripe\Treasury\TransactionEntry::OBJECT_NAME => \Stripe\Treasury\TransactionEntry::class, - \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class, - \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class, \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class, // object classes: The end of the section generated from our OpenAPI spec ]; diff --git a/plugins/stripe-php/lib/Util/RequestOptions.php b/plugins/stripe-php/lib/Util/RequestOptions.php index 62412ebd..2f5e4eb8 100644 --- a/plugins/stripe-php/lib/Util/RequestOptions.php +++ b/plugins/stripe-php/lib/Util/RequestOptions.php @@ -3,8 +3,9 @@ namespace Stripe\Util; /** - * @phpstan-type RequestOptionsArray array{api_key?: string, idempotency_key?: string, stripe_account?: string, stripe_context?: string, stripe_version?: string, api_base?: string } - * @psalm-type RequestOptionsArray = array{api_key?: string, idempotency_key?: string, stripe_account?: string, stripe_context?: string, stripe_version?: string, api_base?: string } + * @phpstan-type RequestOptionsArray array{api_key?: string, idempotency_key?: string, stripe_account?: string, stripe_context?: string, stripe_version?: string, api_base?: string, max_network_retries?: int } + * + * @psalm-type RequestOptionsArray = array{api_key?: string, idempotency_key?: string, stripe_account?: string, stripe_context?: string, stripe_version?: string, api_base?: string, max_network_retries?: int } */ class RequestOptions { @@ -25,16 +26,21 @@ class RequestOptions /** @var null|string */ public $apiBase; + /** @var null|int */ + public $maxNetworkRetries; + /** * @param null|string $key * @param array $headers * @param null|string $base + * @param null|int $maxNetworkRetries */ - public function __construct($key = null, $headers = [], $base = null) + public function __construct($key = null, $headers = [], $base = null, $maxNetworkRetries = null) { $this->apiKey = $key; $this->headers = $headers; $this->apiBase = $base; + $this->maxNetworkRetries = $maxNetworkRetries; } /** @@ -46,6 +52,7 @@ class RequestOptions 'apiKey' => $this->redactedApiKey(), 'headers' => $this->headers, 'apiBase' => $this->apiBase, + 'maxNetworkRetries' => $this->maxNetworkRetries, ]; } @@ -67,6 +74,9 @@ class RequestOptions if (null === $other_options->apiBase) { $other_options->apiBase = $this->apiBase; } + if (null === $other_options->maxNetworkRetries) { + $other_options->maxNetworkRetries = $this->maxNetworkRetries; + } $other_options->headers = \array_merge($this->headers, $other_options->headers); return $other_options; @@ -90,9 +100,9 @@ class RequestOptions * @param null|array|RequestOptions|string $options a key => value array * @param bool $strict when true, forbid string form and arbitrary keys in array form * - * @throws \Stripe\Exception\InvalidArgumentException - * * @return RequestOptions + * + * @throws \Stripe\Exception\InvalidArgumentException */ public static function parse($options, $strict = false) { @@ -119,6 +129,7 @@ class RequestOptions $headers = []; $key = null; $base = null; + $maxNetworkRetries = null; if (\array_key_exists('api_key', $options)) { $key = $options['api_key']; @@ -146,6 +157,12 @@ class RequestOptions } unset($options['stripe_version']); } + if (\array_key_exists('max_network_retries', $options)) { + if (null !== $options['max_network_retries']) { + $maxNetworkRetries = $options['max_network_retries']; + } + unset($options['max_network_retries']); + } if (\array_key_exists('api_base', $options)) { $base = $options['api_base']; unset($options['api_base']); @@ -157,7 +174,7 @@ class RequestOptions throw new \Stripe\Exception\InvalidArgumentException($message); } - return new RequestOptions($key, $headers, $base); + return new RequestOptions($key, $headers, $base, $maxNetworkRetries); } $message = 'The second argument to Stripe API method calls is an ' diff --git a/plugins/stripe-php/lib/Util/Set.php b/plugins/stripe-php/lib/Util/Set.php index aaa811d5..f68c6dbe 100644 --- a/plugins/stripe-php/lib/Util/Set.php +++ b/plugins/stripe-php/lib/Util/Set.php @@ -2,10 +2,7 @@ namespace Stripe\Util; -use ArrayIterator; -use IteratorAggregate; - -class Set implements IteratorAggregate +class Set implements \IteratorAggregate { private $_elts; @@ -38,11 +35,11 @@ class Set implements IteratorAggregate } /** - * @return ArrayIterator + * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() { - return new ArrayIterator($this->toArray()); + return new \ArrayIterator($this->toArray()); } } diff --git a/plugins/stripe-php/lib/Util/Util.php b/plugins/stripe-php/lib/Util/Util.php index f0ba9bb8..bcf24339 100644 --- a/plugins/stripe-php/lib/Util/Util.php +++ b/plugins/stripe-php/lib/Util/Util.php @@ -44,8 +44,8 @@ abstract class Util */ public static function convertToStripeObject($resp, $opts, $apiMode = 'v1') { - $types = 'v1' === $apiMode ? \Stripe\Util\ObjectTypes::mapping - : \Stripe\Util\ObjectTypes::v2Mapping; + $types = 'v1' === $apiMode ? ObjectTypes::mapping + : ObjectTypes::v2Mapping; if (self::isList($resp)) { $mapped = []; foreach ($resp as $i) { @@ -60,11 +60,11 @@ abstract class Util ) { $class = $types[$resp['object']]; if ('v2' === $apiMode && ('v2.core.event' === $resp['object'])) { - $eventTypes = \Stripe\Util\EventTypes::thinEventMapping; + $eventTypes = EventTypes::thinEventMapping; if (\array_key_exists('type', $resp) && \array_key_exists($resp['type'], $eventTypes)) { $class = $eventTypes[$resp['type']]; } else { - $class = \Stripe\StripeObject::class; + $class = \Stripe\V2\Event::class; } } } elseif (\array_key_exists('data', $resp) && \array_key_exists('next_page_url', $resp)) { @@ -72,7 +72,7 @@ abstract class Util // to return something for `object` here. $class = \Stripe\V2\Collection::class; } else { - $class = \Stripe\StripeObject::class; + $class = StripeObject::class; } return $class::constructFrom($resp, $opts, $apiMode); @@ -130,12 +130,10 @@ abstract class Util if (!self::$isMbstringAvailable) { \trigger_error( - 'It looks like the mbstring extension is not enabled. ' . - 'UTF-8 strings will not properly be encoded. Ask your system ' - . - 'administrator to enable the mbstring extension, or write to ' - . - 'support@stripe.com if you have any questions.', + 'It looks like the mbstring extension is not enabled. ' + . 'UTF-8 strings will not properly be encoded. Ask your system ' + . 'administrator to enable the mbstring extension, or write to ' + . 'support@stripe.com if you have any questions.', \E_USER_WARNING ); } @@ -262,7 +260,7 @@ abstract class Util self::flattenParams($value, $calculatedKey, $apiMode) ); } else { - \array_push($result, [$calculatedKey, $value]); + $result[] = [$calculatedKey, $value]; } } @@ -296,9 +294,9 @@ abstract class Util ); } else { if ('v2' === $apiMode) { - \array_push($result, ["{$calculatedKey}", $elem]); + $result[] = ["{$calculatedKey}", $elem]; } else { - \array_push($result, ["{$calculatedKey}[{$i}]", $elem]); + $result[] = ["{$calculatedKey}[{$i}]", $elem]; } } } diff --git a/plugins/stripe-php/lib/V2/Billing/MeterEventAdjustment.php b/plugins/stripe-php/lib/V2/Billing/MeterEventAdjustment.php index aa10ce37..042d8e96 100644 --- a/plugins/stripe-php/lib/V2/Billing/MeterEventAdjustment.php +++ b/plugins/stripe-php/lib/V2/Billing/MeterEventAdjustment.php @@ -7,7 +7,7 @@ namespace Stripe\V2\Billing; /** * @property string $id The unique id of this meter event adjustment. * @property string $object String representing the object's type. Objects of the same type share the same value of the object field. - * @property \Stripe\StripeObject $cancel Specifies which event to cancel. + * @property (object{identifier: string}&\Stripe\StripeObject) $cancel Specifies which event to cancel. * @property int $created The time the adjustment was created. * @property string $event_name The name of the meter event. Corresponds with the event_name field on a meter. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. diff --git a/plugins/stripe-php/lib/V2/Collection.php b/plugins/stripe-php/lib/V2/Collection.php index d8a1ded6..f9721d8c 100644 --- a/plugins/stripe-php/lib/V2/Collection.php +++ b/plugins/stripe-php/lib/V2/Collection.php @@ -6,6 +6,7 @@ namespace Stripe\V2; * Class V2 Collection. * * @template TStripeObject of \Stripe\StripeObject + * * @template-implements \IteratorAggregate * * @property null|string $next_page_url @@ -35,10 +36,10 @@ class Collection extends \Stripe\StripeObject implements \Countable, \IteratorAg if (\is_string($k)) { return parent::offsetGet($k); } - $msg = "You tried to access the {$k} index, but V2Collection " . - 'types only support string keys. (HINT: List calls ' . - 'return an object with a `data` (which is the data ' . - "array). You likely want to call ->data[{$k}])"; + $msg = "You tried to access the {$k} index, but V2Collection " + . 'types only support string keys. (HINT: List calls ' + . 'return an object with a `data` (which is the data ' + . "array). You likely want to call ->data[{$k}])"; throw new \Stripe\Exception\InvalidArgumentException($msg); } @@ -72,12 +73,12 @@ class Collection extends \Stripe\StripeObject implements \Countable, \IteratorAg } /** - * @throws \Stripe\Exception\ApiErrorException - * * @return \Generator|TStripeObject[] A generator that can be used to * iterate across all objects across all pages. As page boundaries are * encountered, the next page will be fetched automatically for * continued iteration. + * + * @throws \Stripe\Exception\ApiErrorException */ public function autoPagingIterator() { diff --git a/plugins/stripe-php/lib/V2/Event.php b/plugins/stripe-php/lib/V2/Event.php index a8ac4dbb..9b87f294 100644 --- a/plugins/stripe-php/lib/V2/Event.php +++ b/plugins/stripe-php/lib/V2/Event.php @@ -3,6 +3,11 @@ namespace Stripe\V2; /** + * Base class for V2 events. + * + * This is concrete for use in our generated tests. Events returned from the \Stripe\V2\Core\EventService + * will be a subtype of \Stripe\V2\Event. + * * @property string $id Unique identifier for the event. * @property string $object String representing the object's type. Objects of the same type share the same value of the object field. * @property int $created Time at which the object was created. @@ -10,7 +15,7 @@ namespace Stripe\V2; * @property string $type The type of the event. * @property null|string $context The Stripe account of the event */ -abstract class Event extends \Stripe\ApiResource +class Event extends \Stripe\ApiResource { const OBJECT_NAME = 'v2.core.event'; } diff --git a/plugins/stripe-php/lib/V2/EventDestination.php b/plugins/stripe-php/lib/V2/EventDestination.php index 39da95ff..21d3c6ae 100644 --- a/plugins/stripe-php/lib/V2/EventDestination.php +++ b/plugins/stripe-php/lib/V2/EventDestination.php @@ -5,9 +5,11 @@ namespace Stripe\V2; /** + * Set up an event destination to receive events from Stripe across multiple destination types, including webhook endpoints and Amazon EventBridge. Event destinations support receiving thin events and snapshot events. + * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value of the object field. - * @property null|\Stripe\StripeObject $amazon_eventbridge Amazon EventBridge configuration. + * @property null|(object{aws_account_id: string, aws_event_source_arn: string, aws_event_source_status: string}&\Stripe\StripeObject) $amazon_eventbridge Amazon EventBridge configuration. * @property int $created Time at which the object was created. * @property string $description An optional description of what the event destination is used for. * @property string[] $enabled_events The list of events to enable for this endpoint. @@ -18,10 +20,10 @@ namespace Stripe\V2; * @property string $name Event destination name. * @property null|string $snapshot_api_version If using the snapshot event payload, the API version events are rendered as. * @property string $status Status. It can be set to either enabled or disabled. - * @property null|\Stripe\StripeObject $status_details Additional information about event destination status. + * @property null|(object{disabled: null|(object{reason: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $status_details Additional information about event destination status. * @property string $type Event destination type. * @property int $updated Time at which the object was last updated. - * @property null|\Stripe\StripeObject $webhook_endpoint Webhook endpoint configuration. + * @property null|(object{signing_secret: null|string, url: null|string}&\Stripe\StripeObject) $webhook_endpoint Webhook endpoint configuration. */ class EventDestination extends \Stripe\ApiResource { diff --git a/plugins/stripe-php/lib/Webhook.php b/plugins/stripe-php/lib/Webhook.php index 9d92b0ef..6f4e9c3c 100644 --- a/plugins/stripe-php/lib/Webhook.php +++ b/plugins/stripe-php/lib/Webhook.php @@ -19,10 +19,10 @@ abstract class Webhook * @param int $tolerance maximum difference allowed between the header's * timestamp and the current time * + * @return Event the Events instance + * * @throws Exception\UnexpectedValueException if the payload is not valid JSON, * @throws Exception\SignatureVerificationException if the verification fails - * - * @return Event the Events instance */ public static function constructEvent($payload, $sigHeader, $secret, $tolerance = self::DEFAULT_TOLERANCE) { diff --git a/plugins/stripe-php/lib/WebhookEndpoint.php b/plugins/stripe-php/lib/WebhookEndpoint.php index 0d500f29..4d33e832 100644 --- a/plugins/stripe-php/lib/WebhookEndpoint.php +++ b/plugins/stripe-php/lib/WebhookEndpoint.php @@ -21,7 +21,7 @@ namespace Stripe; * @property null|string $description An optional description of what the webhook is used for. * @property string[] $enabled_events The list of events to enable for this endpoint. ['*'] indicates that all events are enabled, except those that require explicit selection. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $secret The endpoint's secret, used to generate webhook signatures. Only returned at creation. * @property string $status The status of the webhook. It can be enabled or disabled. * @property string $url The URL of the webhook endpoint. @@ -43,12 +43,12 @@ class WebhookEndpoint extends ApiResource * href="https://dashboard.stripe.com/account/webhooks">webhooks settings * section of the Dashboard. * - * @param null|array $params + * @param null|array{api_version?: string, connect?: bool, description?: null|string, enabled_events: string[], expand?: string[], metadata?: null|array, url: string} $params * @param null|array|string $options * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return WebhookEndpoint the created resource * - * @return \Stripe\WebhookEndpoint the created resource + * @throws Exception\ApiErrorException if the request fails */ public static function create($params = null, $options = null) { @@ -56,7 +56,7 @@ class WebhookEndpoint extends ApiResource $url = static::classUrl(); list($response, $opts) = static::_staticRequest('post', $url, $params, $options); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -70,9 +70,9 @@ class WebhookEndpoint extends ApiResource * @param null|array $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return WebhookEndpoint the deleted resource * - * @return \Stripe\WebhookEndpoint the deleted resource + * @throws Exception\ApiErrorException if the request fails */ public function delete($params = null, $opts = null) { @@ -88,18 +88,18 @@ class WebhookEndpoint extends ApiResource /** * Returns a list of your webhook endpoints. * - * @param null|array $params + * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return Collection of ApiResources * - * @return \Stripe\Collection<\Stripe\WebhookEndpoint> of ApiResources + * @throws Exception\ApiErrorException if the request fails */ public static function all($params = null, $opts = null) { $url = static::classUrl(); - return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + return static::_requestPage($url, Collection::class, $params, $opts); } /** @@ -108,13 +108,13 @@ class WebhookEndpoint extends ApiResource * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return WebhookEndpoint * - * @return \Stripe\WebhookEndpoint + * @throws Exception\ApiErrorException if the request fails */ public static function retrieve($id, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); + $opts = Util\RequestOptions::parse($opts); $instance = new static($id, $opts); $instance->refresh(); @@ -126,12 +126,12 @@ class WebhookEndpoint extends ApiResource * enabled_events, and the status of your endpoint. * * @param string $id the ID of the resource to update - * @param null|array $params + * @param null|array{description?: null|string, disabled?: bool, enabled_events?: string[], expand?: string[], metadata?: null|array, url?: string} $params * @param null|array|string $opts * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @return WebhookEndpoint the updated resource * - * @return \Stripe\WebhookEndpoint the updated resource + * @throws Exception\ApiErrorException if the request fails */ public static function update($id, $params = null, $opts = null) { @@ -139,7 +139,7 @@ class WebhookEndpoint extends ApiResource $url = static::resourceUrl($id); list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; diff --git a/plugins/stripe-php/lib/WebhookSignature.php b/plugins/stripe-php/lib/WebhookSignature.php index 46cbb28b..edd4fb92 100644 --- a/plugins/stripe-php/lib/WebhookSignature.php +++ b/plugins/stripe-php/lib/WebhookSignature.php @@ -18,9 +18,9 @@ abstract class WebhookSignature * @param int $tolerance maximum difference allowed between the header's * timestamp and the current time * - * @throws Exception\SignatureVerificationException if the verification fails - * * @return bool + * + * @throws Exception\SignatureVerificationException if the verification fails */ public static function verifyHeader($payload, $header, $secret, $tolerance = null) { @@ -93,7 +93,7 @@ abstract class WebhookSignature return -1; } - return (int) ($itemParts[1]); + return (int) $itemParts[1]; } }