Test fixes

This commit is contained in:
Dennis Eichhorn 2024-05-16 02:14:55 +00:00
parent 2ffb129021
commit 876867f744
286 changed files with 24843 additions and 24067 deletions

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -38,7 +38,7 @@ namespace Stripe;
*/
class Account extends ApiResource
{
const OBJECT_NAME = 'account';
public const OBJECT_NAME = 'account';
use ApiOperations\All;
use ApiOperations\Create;
@ -46,14 +46,19 @@ class Account extends ApiResource
use ApiOperations\NestedResource;
use ApiOperations\Update;
const BUSINESS_TYPE_COMPANY = 'company';
const BUSINESS_TYPE_GOVERNMENT_ENTITY = 'government_entity';
const BUSINESS_TYPE_INDIVIDUAL = 'individual';
const BUSINESS_TYPE_NON_PROFIT = 'non_profit';
public const BUSINESS_TYPE_COMPANY = 'company';
const TYPE_CUSTOM = 'custom';
const TYPE_EXPRESS = 'express';
const TYPE_STANDARD = 'standard';
public const BUSINESS_TYPE_GOVERNMENT_ENTITY = 'government_entity';
public const BUSINESS_TYPE_INDIVIDUAL = 'individual';
public const BUSINESS_TYPE_NON_PROFIT = 'non_profit';
public const TYPE_CUSTOM = 'custom';
public const TYPE_EXPRESS = 'express';
public const TYPE_STANDARD = 'standard';
use ApiOperations\Retrieve {
retrieve as protected _retrieve;
@ -62,7 +67,7 @@ class Account extends ApiResource
public static function getSavedNestedResources()
{
static $savedNestedResources = null;
if (null === $savedNestedResources) {
if ($savedNestedResources === null) {
$savedNestedResources = new Util\Set([
'external_account',
'bank_account',
@ -74,7 +79,7 @@ class Account extends ApiResource
public function instanceUrl()
{
if (null === $this['id']) {
if ($this['id'] === null) {
return '/v1/account';
}
@ -92,7 +97,7 @@ class Account extends ApiResource
*/
public static function retrieve($id = null, $opts = null)
{
if (!$opts && \is_string($id) && 'sk_' === \substr($id, 0, 3)) {
if (!$opts && \is_string($id) && \substr($id, 0, 3) === 'sk_') {
$opts = $id;
$id = null;
}
@ -139,7 +144,7 @@ class Account extends ApiResource
foreach ($additionalOwners as $i => $v) {
$update = ($v instanceof StripeObject) ? $v->serializeParameters() : $v;
if ([] !== $update) {
if ($update !== []) {
if (!$originalValue
|| !\array_key_exists($i, $originalValue)
|| ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) {
@ -186,7 +191,7 @@ class Account extends ApiResource
return $this;
}
const PATH_CAPABILITIES = '/capabilities';
public const PATH_CAPABILITIES = '/capabilities';
/**
* @param string $id the ID of the account on which to retrieve the capabilities
@ -231,7 +236,8 @@ class Account extends ApiResource
{
return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
}
const PATH_EXTERNAL_ACCOUNTS = '/external_accounts';
public const PATH_EXTERNAL_ACCOUNTS = '/external_accounts';
/**
* @param string $id the ID of the account on which to retrieve the external accounts
@ -305,7 +311,8 @@ class Account extends ApiResource
{
return self::_updateNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts);
}
const PATH_LOGIN_LINKS = '/login_links';
public const PATH_LOGIN_LINKS = '/login_links';
/**
* @param string $id the ID of the account on which to create the login link
@ -320,7 +327,8 @@ class Account extends ApiResource
{
return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts);
}
const PATH_PERSONS = '/persons';
public const PATH_PERSONS = '/persons';
/**
* @param string $id the ID of the account on which to retrieve the persons

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -20,7 +20,7 @@ namespace Stripe;
*/
class AccountLink extends ApiResource
{
const OBJECT_NAME = 'account_link';
public const OBJECT_NAME = 'account_link';
use ApiOperations\Create;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\ApiOperations;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\ApiOperations;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\ApiOperations;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\ApiOperations;
@ -38,7 +38,7 @@ trait NestedResource
protected static function _nestedResourceUrl($id, $nestedPath, $nestedId = null)
{
$url = static::resourceUrl($id) . $nestedPath;
if (null !== $nestedId) {
if ($nestedId !== null) {
$url .= "/{$nestedId}";
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\ApiOperations;
@ -14,7 +14,7 @@ trait Request
*
* @throws \Stripe\Exception\InvalidArgumentException if $params exists and is not an array
*/
protected static function _validateParams($params = null)
protected static function _validateParams($params = null) : void
{
if ($params && !\is_array($params)) {
$message = 'You must pass an array as the first argument to Stripe API '
@ -54,7 +54,7 @@ trait Request
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
protected function _requestStream($method, $url, $readBodyChunk, $params = [], $options = null)
protected function _requestStream($method, $url, $readBodyChunk, $params = [], $options = null) : void
{
$opts = $this->_opts->merge($options);
static::_staticStreamingRequest($method, $url, $readBodyChunk, $params, $opts);
@ -90,7 +90,7 @@ trait Request
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
protected static function _staticStreamingRequest($method, $url, $readBodyChunk, $params, $options)
protected static function _staticStreamingRequest($method, $url, $readBodyChunk, $params, $options) : void
{
$opts = \Stripe\Util\RequestOptions::parse($options);
$baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl();

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\ApiOperations;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\ApiOperations;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\ApiOperations;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\ApiOperations;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe;
@ -21,6 +21,7 @@ class ApiRequestor
* @var HttpClient\ClientInterface
*/
private static $_httpClient;
/**
* @var HttpClient\StreamingClientInterface
*/
@ -67,7 +68,7 @@ class ApiRequestor
];
$result = \json_encode($payload);
if (false !== $result) {
if ($result !== false) {
return $result;
}
Stripe::getLogger()->error('Serializing telemetry payload failed!');
@ -87,10 +88,10 @@ class ApiRequestor
if ($d instanceof ApiResource) {
return Util\Util::utf8($d->id);
}
if (true === $d) {
if ($d === true) {
return 'true';
}
if (false === $d) {
if ($d === false) {
return 'false';
}
if (\is_array($d)) {
@ -119,8 +120,7 @@ class ApiRequestor
{
$params = $params ?: [];
$headers = $headers ?: [];
list($rbody, $rcode, $rheaders, $myApiKey) =
$this->_requestRaw($method, $url, $params, $headers);
list($rbody, $rcode, $rheaders, $myApiKey) = $this->_requestRaw($method, $url, $params, $headers);
$json = $this->_interpretResponse($rbody, $rcode, $rheaders);
$resp = new ApiResponse($rbody, $rcode, $rheaders, $json);
@ -136,12 +136,11 @@ class ApiRequestor
*
* @throws Exception\ApiErrorException
*/
public function requestStream($method, $url, $readBodyChunkCallable, $params = null, $headers = null)
public function requestStream($method, $url, $readBodyChunkCallable, $params = null, $headers = null) : void
{
$params = $params ?: [];
$headers = $headers ?: [];
list($rbody, $rcode, $rheaders, $myApiKey) =
$this->_requestRawStreaming($method, $url, $params, $headers, $readBodyChunkCallable);
list($rbody, $rcode, $rheaders, $myApiKey) = $this->_requestRawStreaming($method, $url, $params, $headers, $readBodyChunkCallable);
if ($rcode >= 300) {
$this->_interpretResponse($rbody, $rcode, $rheaders);
}
@ -156,7 +155,7 @@ class ApiRequestor
* @throws Exception\UnexpectedValueException
* @throws Exception\ApiErrorException
*/
public function handleErrorResponse($rbody, $rcode, $rheaders, $resp)
public function handleErrorResponse($rbody, $rcode, $rheaders, $resp) : void
{
if (!\is_array($resp) || !isset($resp['error'])) {
$msg = "Invalid response object from API: {$rbody} "
@ -201,29 +200,24 @@ class ApiRequestor
case 400:
// 'rate_limit' code is deprecated, but left here for backwards compatibility
// for API versions earlier than 2015-09-08
if ('rate_limit' === $code) {
if ($code === 'rate_limit') {
return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param);
}
if ('idempotency_error' === $type) {
if ($type === 'idempotency_error') {
return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
}
// no break
case 404:
return Exception\InvalidRequestException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param);
case 401:
return Exception\AuthenticationException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
case 402:
return Exception\CardException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $declineCode, $param);
case 403:
return Exception\PermissionException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
case 429:
return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param);
default:
return Exception\UnknownApiErrorException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
}
@ -247,22 +241,16 @@ class ApiRequestor
switch ($errorCode) {
case 'invalid_client':
return Exception\OAuth\InvalidClientException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
case 'invalid_grant':
return Exception\OAuth\InvalidGrantException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
case 'invalid_request':
return Exception\OAuth\InvalidRequestException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
case 'invalid_scope':
return Exception\OAuth\InvalidScopeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
case 'unsupported_grant_type':
return Exception\OAuth\UnsupportedGrantTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
case 'unsupported_response_type':
return Exception\OAuth\UnsupportedResponseTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
default:
return Exception\OAuth\UnknownOAuthErrorException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
}
@ -277,12 +265,12 @@ class ApiRequestor
*/
private static function _formatAppInfo($appInfo)
{
if (null !== $appInfo) {
if ($appInfo !== null) {
$string = $appInfo['name'];
if (null !== $appInfo['version']) {
if ($appInfo['version'] !== null) {
$string .= '/' . $appInfo['version'];
}
if (null !== $appInfo['url']) {
if ($appInfo['url'] !== null) {
$string .= ' (' . $appInfo['url'] . ')';
}
@ -339,7 +327,7 @@ class ApiRequestor
if ($clientInfo) {
$ua = \array_merge($clientInfo, $ua);
}
if (null !== $appInfo) {
if ($appInfo !== null) {
$uaString .= ' ' . self::_formatAppInfo($appInfo);
$ua['application'] = $appInfo;
}
@ -401,7 +389,7 @@ class ApiRequestor
$defaultHeaders['Stripe-Account'] = Stripe::$accountId;
}
if (Stripe::$enableTelemetry && null !== self::$requestTelemetry) {
if (Stripe::$enableTelemetry && self::$requestTelemetry !== null) {
$defaultHeaders['X-Stripe-Client-Telemetry'] = self::_telemetryJson(self::$requestTelemetry);
}
@ -458,7 +446,7 @@ class ApiRequestor
if (isset($rheaders['request-id'])
&& \is_string($rheaders['request-id'])
&& '' !== $rheaders['request-id']) {
&& $rheaders['request-id'] !== '') {
self::$requestTelemetry = new RequestTelemetry(
$rheaders['request-id'],
Util\Util::currentTimeMillis() - $requestStartMs
@ -497,7 +485,7 @@ class ApiRequestor
if (isset($rheaders['request-id'])
&& \is_string($rheaders['request-id'])
&& '' !== $rheaders['request-id']) {
&& $rheaders['request-id'] !== '') {
self::$requestTelemetry = new RequestTelemetry(
$rheaders['request-id'],
Util\Util::currentTimeMillis() - $requestStartMs
@ -516,14 +504,14 @@ class ApiRequestor
*/
private function _processResourceParam($resource)
{
if ('stream' !== \get_resource_type($resource)) {
if (\get_resource_type($resource) !== 'stream') {
throw new Exception\InvalidArgumentException(
'Attempted to upload a resource that is not a stream'
);
}
$metaData = \stream_get_meta_data($resource);
if ('plainfile' !== $metaData['wrapper_type']) {
if ($metaData['wrapper_type'] !== 'plainfile') {
throw new Exception\InvalidArgumentException(
'Only plainfile resource streams are supported'
);
@ -547,7 +535,7 @@ class ApiRequestor
{
$resp = \json_decode($rbody, true);
$jsonError = \json_last_error();
if (null === $resp && \JSON_ERROR_NONE !== $jsonError) {
if ($resp === null && $jsonError !== \JSON_ERROR_NONE) {
$msg = "Invalid response body from API: {$rbody} "
. "(HTTP response code was {$rcode}, json_last_error() was {$jsonError})";
@ -566,7 +554,7 @@ class ApiRequestor
*
* @param HttpClient\ClientInterface $client
*/
public static function setHttpClient($client)
public static function setHttpClient($client) : void
{
self::$_httpClient = $client;
}
@ -576,7 +564,7 @@ class ApiRequestor
*
* @param HttpClient\StreamingClientInterface $client
*/
public static function setStreamingHttpClient($client)
public static function setStreamingHttpClient($client) : void
{
self::$_streamingHttpClient = $client;
}
@ -586,7 +574,7 @@ class ApiRequestor
*
* Resets any stateful telemetry data
*/
public static function resetTelemetry()
public static function resetTelemetry() : void
{
self::$requestTelemetry = null;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe;
@ -19,7 +19,7 @@ abstract class ApiResource extends StripeObject
public static function getSavedNestedResources()
{
static $savedNestedResources = null;
if (null === $savedNestedResources) {
if ($savedNestedResources === null) {
$savedNestedResources = new Util\Set();
}
@ -35,12 +35,12 @@ abstract class ApiResource extends StripeObject
*/
public $saveWithParent = false;
public function __set($k, $v)
public function __set($k, $v) : void
{
parent::__set($k, $v);
$v = $this->{$k};
if ((static::getSavedNestedResources()->includes($k))
&& ($v instanceof ApiResource)) {
&& ($v instanceof self)) {
$v->saveWithParent = true;
}
}
@ -98,7 +98,7 @@ abstract class ApiResource extends StripeObject
*/
public static function resourceUrl($id)
{
if (null === $id) {
if ($id === null) {
$class = static::class;
$message = 'Could not determine which URL to request: '
. "{$class} instance has invalid ID: {$id}";

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -13,7 +13,7 @@ namespace Stripe;
*/
class ApplePayDomain extends ApiResource
{
const OBJECT_NAME = 'apple_pay_domain';
public const OBJECT_NAME = 'apple_pay_domain';
use ApiOperations\All;
use ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -22,13 +22,13 @@ namespace Stripe;
*/
class ApplicationFee extends ApiResource
{
const OBJECT_NAME = 'application_fee';
public const OBJECT_NAME = 'application_fee';
use ApiOperations\All;
use ApiOperations\NestedResource;
use ApiOperations\Retrieve;
const PATH_REFUNDS = '/refunds';
public const PATH_REFUNDS = '/refunds';
/**
* @param string $id the ID of the application fee on which to retrieve the fee refunds

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -24,7 +24,7 @@ namespace Stripe;
*/
class ApplicationFeeRefund extends ApiResource
{
const OBJECT_NAME = 'fee_refund';
public const OBJECT_NAME = 'fee_refund';
use ApiOperations\Update {
save as protected _save;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -36,7 +36,7 @@ namespace Stripe\Apps;
*/
class Secret extends \Stripe\ApiResource
{
const OBJECT_NAME = 'apps.secret';
public const OBJECT_NAME = 'apps.secret';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -29,7 +29,7 @@ namespace Stripe;
*/
class Balance extends SingletonApiResource
{
const OBJECT_NAME = 'balance';
public const OBJECT_NAME = 'balance';
use ApiOperations\SingletonRetrieve;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -31,41 +31,72 @@ namespace Stripe;
*/
class BalanceTransaction extends ApiResource
{
const OBJECT_NAME = 'balance_transaction';
public const OBJECT_NAME = 'balance_transaction';
use ApiOperations\All;
use ApiOperations\Retrieve;
const TYPE_ADJUSTMENT = 'adjustment';
const TYPE_ADVANCE = 'advance';
const TYPE_ADVANCE_FUNDING = 'advance_funding';
const TYPE_ANTICIPATION_REPAYMENT = 'anticipation_repayment';
const TYPE_APPLICATION_FEE = 'application_fee';
const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund';
const TYPE_CHARGE = 'charge';
const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer';
const TYPE_CONTRIBUTION = 'contribution';
const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold';
const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release';
const TYPE_ISSUING_DISPUTE = 'issuing_dispute';
const TYPE_ISSUING_TRANSACTION = 'issuing_transaction';
const TYPE_PAYMENT = 'payment';
const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund';
const TYPE_PAYMENT_REFUND = 'payment_refund';
const TYPE_PAYOUT = 'payout';
const TYPE_PAYOUT_CANCEL = 'payout_cancel';
const TYPE_PAYOUT_FAILURE = 'payout_failure';
const TYPE_REFUND = 'refund';
const TYPE_REFUND_FAILURE = 'refund_failure';
const TYPE_RESERVE_TRANSACTION = 'reserve_transaction';
const TYPE_RESERVED_FUNDS = 'reserved_funds';
const TYPE_STRIPE_FEE = 'stripe_fee';
const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee';
const TYPE_TAX_FEE = 'tax_fee';
const TYPE_TOPUP = 'topup';
const TYPE_TOPUP_REVERSAL = 'topup_reversal';
const TYPE_TRANSFER = 'transfer';
const TYPE_TRANSFER_CANCEL = 'transfer_cancel';
const TYPE_TRANSFER_FAILURE = 'transfer_failure';
const TYPE_TRANSFER_REFUND = 'transfer_refund';
public const TYPE_ADJUSTMENT = 'adjustment';
public const TYPE_ADVANCE = 'advance';
public const TYPE_ADVANCE_FUNDING = 'advance_funding';
public const TYPE_ANTICIPATION_REPAYMENT = 'anticipation_repayment';
public const TYPE_APPLICATION_FEE = 'application_fee';
public const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund';
public const TYPE_CHARGE = 'charge';
public const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer';
public const TYPE_CONTRIBUTION = 'contribution';
public const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold';
public const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release';
public const TYPE_ISSUING_DISPUTE = 'issuing_dispute';
public const TYPE_ISSUING_TRANSACTION = 'issuing_transaction';
public const TYPE_PAYMENT = 'payment';
public const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund';
public const TYPE_PAYMENT_REFUND = 'payment_refund';
public const TYPE_PAYOUT = 'payout';
public const TYPE_PAYOUT_CANCEL = 'payout_cancel';
public const TYPE_PAYOUT_FAILURE = 'payout_failure';
public const TYPE_REFUND = 'refund';
public const TYPE_REFUND_FAILURE = 'refund_failure';
public const TYPE_RESERVE_TRANSACTION = 'reserve_transaction';
public const TYPE_RESERVED_FUNDS = 'reserved_funds';
public const TYPE_STRIPE_FEE = 'stripe_fee';
public const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee';
public const TYPE_TAX_FEE = 'tax_fee';
public const TYPE_TOPUP = 'topup';
public const TYPE_TOPUP_REVERSAL = 'topup_reversal';
public const TYPE_TRANSFER = 'transfer';
public const TYPE_TRANSFER_CANCEL = 'transfer_cancel';
public const TYPE_TRANSFER_FAILURE = 'transfer_failure';
public const TYPE_TRANSFER_REFUND = 'transfer_refund';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -38,7 +38,7 @@ namespace Stripe;
*/
class BankAccount extends ApiResource
{
const OBJECT_NAME = 'bank_account';
public const OBJECT_NAME = 'bank_account';
use ApiOperations\Delete;
use ApiOperations\Update;
@ -48,11 +48,15 @@ class BankAccount extends ApiResource
*
* @see https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status
*/
const STATUS_NEW = 'new';
const STATUS_VALIDATED = 'validated';
const STATUS_VERIFIED = 'verified';
const STATUS_VERIFICATION_FAILED = 'verification_failed';
const STATUS_ERRORED = 'errored';
public const STATUS_NEW = 'new';
public const STATUS_VALIDATED = 'validated';
public const STATUS_VERIFIED = 'verified';
public const STATUS_VERIFICATION_FAILED = 'verification_failed';
public const STATUS_ERRORED = 'errored';
/**
* @return string The instance URL for this resource. It needs to be special
@ -85,7 +89,7 @@ class BankAccount extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
public static function retrieve($_id, $_opts = null) : void
{
$msg = 'Bank accounts cannot be retrieved without a customer ID or ' .
'an account ID. Retrieve a bank account using ' .
@ -103,7 +107,7 @@ class BankAccount extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
public static function update($_id, $_params = null, $_options = null) : void
{
$msg = 'Bank accounts cannot be updated without a customer ID or an ' .
'account ID. Update a bank account using ' .

View File

@ -1,17 +1,17 @@
<?php
<?php declare(strict_types=1);
namespace Stripe;
class BaseStripeClient implements StripeClientInterface, StripeStreamingClientInterface
{
/** @var string default base URL for Stripe's API */
const DEFAULT_API_BASE = 'https://api.stripe.com';
public const DEFAULT_API_BASE = 'https://api.stripe.com';
/** @var string default base URL for Stripe's OAuth API */
const DEFAULT_CONNECT_BASE = 'https://connect.stripe.com';
public const DEFAULT_CONNECT_BASE = 'https://connect.stripe.com';
/** @var string default base URL for Stripe's Files API */
const DEFAULT_FILES_BASE = 'https://files.stripe.com';
public const DEFAULT_FILES_BASE = 'https://files.stripe.com';
/** @var array<string, mixed> */
private $config;
@ -150,7 +150,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
* @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request
* with chunks of bytes from the body if the request is successful
*/
public function requestStream($method, $path, $readBodyChunkCallable, $params, $opts)
public function requestStream($method, $path, $readBodyChunkCallable, $params, $opts) : void
{
$opts = $this->defaultOpts->merge($opts, true);
$baseUrl = $opts->apiBase ?: $this->getApiBase();
@ -217,7 +217,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
{
$apiKey = $opts->apiKey ?: $this->getApiKey();
if (null === $apiKey) {
if ($apiKey === null) {
$msg = 'No API key provided. Set your API key when constructing the '
. 'StripeClient instance, or provide it on a per-request basis '
. 'using the `api_key` key in the $opts argument.';
@ -251,37 +251,37 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
*
* @throws \Stripe\Exception\InvalidArgumentException
*/
private function validateConfig($config)
private function validateConfig($config) : void
{
// api_key
if (null !== $config['api_key'] && !\is_string($config['api_key'])) {
if ($config['api_key'] !== null && !\is_string($config['api_key'])) {
throw new \Stripe\Exception\InvalidArgumentException('api_key must be null or a string');
}
if (null !== $config['api_key'] && ('' === $config['api_key'])) {
if ($config['api_key'] !== null && ($config['api_key'] === '')) {
$msg = 'api_key cannot be the empty string';
throw new \Stripe\Exception\InvalidArgumentException($msg);
}
if (null !== $config['api_key'] && (\preg_match('/\s/', $config['api_key']))) {
if ($config['api_key'] !== null && (\preg_match('/\s/', $config['api_key']))) {
$msg = 'api_key cannot contain whitespace';
throw new \Stripe\Exception\InvalidArgumentException($msg);
}
// client_id
if (null !== $config['client_id'] && !\is_string($config['client_id'])) {
if ($config['client_id'] !== null && !\is_string($config['client_id'])) {
throw new \Stripe\Exception\InvalidArgumentException('client_id must be null or a string');
}
// stripe_account
if (null !== $config['stripe_account'] && !\is_string($config['stripe_account'])) {
if ($config['stripe_account'] !== null && !\is_string($config['stripe_account'])) {
throw new \Stripe\Exception\InvalidArgumentException('stripe_account must be null or a string');
}
// stripe_version
if (null !== $config['stripe_version'] && !\is_string($config['stripe_version'])) {
if ($config['stripe_version'] !== null && !\is_string($config['stripe_version'])) {
throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be null or a string');
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -24,7 +24,7 @@ namespace Stripe\BillingPortal;
*/
class Configuration extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing_portal.configuration';
public const OBJECT_NAME = 'billing_portal.configuration';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -36,7 +36,7 @@ namespace Stripe\BillingPortal;
*/
class Session extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing_portal.session';
public const OBJECT_NAME = 'billing_portal.session';
use \Stripe\ApiOperations\Create;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -22,14 +22,17 @@ namespace Stripe;
*/
class Capability extends ApiResource
{
const OBJECT_NAME = 'capability';
public const OBJECT_NAME = 'capability';
use ApiOperations\Update;
const STATUS_ACTIVE = 'active';
const STATUS_INACTIVE = 'inactive';
const STATUS_PENDING = 'pending';
const STATUS_UNREQUESTED = 'unrequested';
public const STATUS_ACTIVE = 'active';
public const STATUS_INACTIVE = 'inactive';
public const STATUS_PENDING = 'pending';
public const STATUS_UNREQUESTED = 'unrequested';
/**
* @return string the API URL for this Stripe account reversal
@ -61,7 +64,7 @@ class Capability extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
public static function retrieve($_id, $_opts = null) : void
{
$msg = 'Capabilities cannot be retrieved without an account ID. ' .
'Retrieve a capability using `Account::retrieveCapability(' .
@ -77,7 +80,7 @@ class Capability extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
public static function update($_id, $_params = null, $_options = null) : void
{
$msg = 'Capabilities cannot be updated without an account ID. ' .
'Update a capability using `Account::updateCapability(' .

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -43,7 +43,7 @@ namespace Stripe;
*/
class Card extends ApiResource
{
const OBJECT_NAME = 'card';
public const OBJECT_NAME = 'card';
use ApiOperations\Delete;
use ApiOperations\Update;
@ -53,28 +53,35 @@ class Card extends ApiResource
*
* @see https://stripe.com/docs/api/cards/object#card_object-cvc_check
*/
const CVC_CHECK_FAIL = 'fail';
const CVC_CHECK_PASS = 'pass';
const CVC_CHECK_UNAVAILABLE = 'unavailable';
const CVC_CHECK_UNCHECKED = 'unchecked';
public const CVC_CHECK_FAIL = 'fail';
public const CVC_CHECK_PASS = 'pass';
public const CVC_CHECK_UNAVAILABLE = 'unavailable';
public const CVC_CHECK_UNCHECKED = 'unchecked';
/**
* Possible string representations of the funding of the card.
*
* @see https://stripe.com/docs/api/cards/object#card_object-funding
*/
const FUNDING_CREDIT = 'credit';
const FUNDING_DEBIT = 'debit';
const FUNDING_PREPAID = 'prepaid';
const FUNDING_UNKNOWN = 'unknown';
public const FUNDING_CREDIT = 'credit';
public const FUNDING_DEBIT = 'debit';
public const FUNDING_PREPAID = 'prepaid';
public const FUNDING_UNKNOWN = 'unknown';
/**
* Possible string representations of the tokenization method when using Apple Pay or Google Pay.
*
* @see https://stripe.com/docs/api/cards/object#card_object-tokenization_method
*/
const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay';
const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay';
public const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay';
public const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay';
/**
* @return string The instance URL for this resource. It needs to be special
@ -108,7 +115,7 @@ class Card extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
public static function retrieve($_id, $_opts = null) : void
{
$msg = 'Cards cannot be retrieved without a customer ID or an ' .
'account ID. Retrieve a card using ' .
@ -125,7 +132,7 @@ class Card extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
public static function update($_id, $_params = null, $_options = null) : void
{
$msg = 'Cards cannot be updated without a customer ID or an ' .
'account ID. Update a card using ' .

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -17,7 +17,7 @@ namespace Stripe;
*/
class CashBalance extends ApiResource
{
const OBJECT_NAME = 'cash_balance';
public const OBJECT_NAME = 'cash_balance';
/**
* @return string the API URL for this balance transaction
@ -39,7 +39,7 @@ class CashBalance extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
public static function retrieve($_id, $_opts = null) : void
{
$msg = 'Customer Cash Balance cannot be retrieved without a ' .
'customer ID. Retrieve a Customer Cash Balance using ' .
@ -55,7 +55,7 @@ class CashBalance extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
public static function update($_id, $_params = null, $_options = null) : void
{
$msg = 'Customer Cash Balance cannot be updated without a ' .
'customer ID. Retrieve a Customer Cash Balance using ' .

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -67,7 +67,7 @@ namespace Stripe;
*/
class Charge extends ApiResource
{
const OBJECT_NAME = 'charge';
public const OBJECT_NAME = 'charge';
use ApiOperations\All;
use ApiOperations\Create;
@ -75,9 +75,11 @@ class Charge extends ApiResource
use ApiOperations\Search;
use ApiOperations\Update;
const STATUS_FAILED = 'failed';
const STATUS_PENDING = 'pending';
const STATUS_SUCCEEDED = 'succeeded';
public const STATUS_FAILED = 'failed';
public const STATUS_PENDING = 'pending';
public const STATUS_SUCCEEDED = 'succeeded';
/**
* Possible string representations of decline codes.
@ -85,52 +87,97 @@ class Charge extends ApiResource
*
* @see https://stripe.com/docs/declines/codes
*/
const DECLINED_AUTHENTICATION_REQUIRED = 'authentication_required';
const DECLINED_APPROVE_WITH_ID = 'approve_with_id';
const DECLINED_CALL_ISSUER = 'call_issuer';
const DECLINED_CARD_NOT_SUPPORTED = 'card_not_supported';
const DECLINED_CARD_VELOCITY_EXCEEDED = 'card_velocity_exceeded';
const DECLINED_CURRENCY_NOT_SUPPORTED = 'currency_not_supported';
const DECLINED_DO_NOT_HONOR = 'do_not_honor';
const DECLINED_DO_NOT_TRY_AGAIN = 'do_not_try_again';
const DECLINED_DUPLICATED_TRANSACTION = 'duplicate_transaction';
const DECLINED_EXPIRED_CARD = 'expired_card';
const DECLINED_FRAUDULENT = 'fraudulent';
const DECLINED_GENERIC_DECLINE = 'generic_decline';
const DECLINED_INCORRECT_NUMBER = 'incorrect_number';
const DECLINED_INCORRECT_CVC = 'incorrect_cvc';
const DECLINED_INCORRECT_PIN = 'incorrect_pin';
const DECLINED_INCORRECT_ZIP = 'incorrect_zip';
const DECLINED_INSUFFICIENT_FUNDS = 'insufficient_funds';
const DECLINED_INVALID_ACCOUNT = 'invalid_account';
const DECLINED_INVALID_AMOUNT = 'invalid_amount';
const DECLINED_INVALID_CVC = 'invalid_cvc';
const DECLINED_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
const DECLINED_INVALID_NUMBER = 'invalid_number';
const DECLINED_INVALID_PIN = 'invalid_pin';
const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available';
const DECLINED_LOST_CARD = 'lost_card';
const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist';
const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available';
const DECLINED_NO_ACTION_TAKEN = 'no_action_taken';
const DECLINED_NOT_PERMITTED = 'not_permitted';
const DECLINED_OFFLINE_PIN_REQUIRED = 'offline_pin_required';
const DECLINED_ONLINE_OR_OFFLINE_PIN_REQUIRED = 'online_or_offline_pin_required';
const DECLINED_PICKUP_CARD = 'pickup_card';
const DECLINED_PIN_TRY_EXCEEDED = 'pin_try_exceeded';
const DECLINED_PROCESSING_ERROR = 'processing_error';
const DECLINED_REENTER_TRANSACTION = 'reenter_transaction';
const DECLINED_RESTRICTED_CARD = 'restricted_card';
const DECLINED_REVOCATION_OF_ALL_AUTHORIZATIONS = 'revocation_of_all_authorizations';
const DECLINED_REVOCATION_OF_AUTHORIZATION = 'revocation_of_authorization';
const DECLINED_SECURITY_VIOLATION = 'security_violation';
const DECLINED_SERVICE_NOT_ALLOWED = 'service_not_allowed';
const DECLINED_STOLEN_CARD = 'stolen_card';
const DECLINED_STOP_PAYMENT_ORDER = 'stop_payment_order';
const DECLINED_TESTMODE_DECLINE = 'testmode_decline';
const DECLINED_TRANSACTION_NOT_ALLOWED = 'transaction_not_allowed';
const DECLINED_TRY_AGAIN_LATER = 'try_again_later';
const DECLINED_WITHDRAWAL_COUNT_LIMIT_EXCEEDED = 'withdrawal_count_limit_exceeded';
public const DECLINED_AUTHENTICATION_REQUIRED = 'authentication_required';
public const DECLINED_APPROVE_WITH_ID = 'approve_with_id';
public const DECLINED_CALL_ISSUER = 'call_issuer';
public const DECLINED_CARD_NOT_SUPPORTED = 'card_not_supported';
public const DECLINED_CARD_VELOCITY_EXCEEDED = 'card_velocity_exceeded';
public const DECLINED_CURRENCY_NOT_SUPPORTED = 'currency_not_supported';
public const DECLINED_DO_NOT_HONOR = 'do_not_honor';
public const DECLINED_DO_NOT_TRY_AGAIN = 'do_not_try_again';
public const DECLINED_DUPLICATED_TRANSACTION = 'duplicate_transaction';
public const DECLINED_EXPIRED_CARD = 'expired_card';
public const DECLINED_FRAUDULENT = 'fraudulent';
public const DECLINED_GENERIC_DECLINE = 'generic_decline';
public const DECLINED_INCORRECT_NUMBER = 'incorrect_number';
public const DECLINED_INCORRECT_CVC = 'incorrect_cvc';
public const DECLINED_INCORRECT_PIN = 'incorrect_pin';
public const DECLINED_INCORRECT_ZIP = 'incorrect_zip';
public const DECLINED_INSUFFICIENT_FUNDS = 'insufficient_funds';
public const DECLINED_INVALID_ACCOUNT = 'invalid_account';
public const DECLINED_INVALID_AMOUNT = 'invalid_amount';
public const DECLINED_INVALID_CVC = 'invalid_cvc';
public const DECLINED_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
public const DECLINED_INVALID_NUMBER = 'invalid_number';
public const DECLINED_INVALID_PIN = 'invalid_pin';
public const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available';
public const DECLINED_LOST_CARD = 'lost_card';
public const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist';
public const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available';
public const DECLINED_NO_ACTION_TAKEN = 'no_action_taken';
public const DECLINED_NOT_PERMITTED = 'not_permitted';
public const DECLINED_OFFLINE_PIN_REQUIRED = 'offline_pin_required';
public const DECLINED_ONLINE_OR_OFFLINE_PIN_REQUIRED = 'online_or_offline_pin_required';
public const DECLINED_PICKUP_CARD = 'pickup_card';
public const DECLINED_PIN_TRY_EXCEEDED = 'pin_try_exceeded';
public const DECLINED_PROCESSING_ERROR = 'processing_error';
public const DECLINED_REENTER_TRANSACTION = 'reenter_transaction';
public const DECLINED_RESTRICTED_CARD = 'restricted_card';
public const DECLINED_REVOCATION_OF_ALL_AUTHORIZATIONS = 'revocation_of_all_authorizations';
public const DECLINED_REVOCATION_OF_AUTHORIZATION = 'revocation_of_authorization';
public const DECLINED_SECURITY_VIOLATION = 'security_violation';
public const DECLINED_SERVICE_NOT_ALLOWED = 'service_not_allowed';
public const DECLINED_STOLEN_CARD = 'stolen_card';
public const DECLINED_STOP_PAYMENT_ORDER = 'stop_payment_order';
public const DECLINED_TESTMODE_DECLINE = 'testmode_decline';
public const DECLINED_TRANSACTION_NOT_ALLOWED = 'transaction_not_allowed';
public const DECLINED_TRY_AGAIN_LATER = 'try_again_later';
public const DECLINED_WITHDRAWAL_COUNT_LIMIT_EXCEEDED = 'withdrawal_count_limit_exceeded';
/**
* @param null|array $params

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -73,37 +73,49 @@ namespace Stripe\Checkout;
*/
class Session extends \Stripe\ApiResource
{
const OBJECT_NAME = 'checkout.session';
public const OBJECT_NAME = 'checkout.session';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
const BILLING_ADDRESS_COLLECTION_AUTO = 'auto';
const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required';
public const BILLING_ADDRESS_COLLECTION_AUTO = 'auto';
const CUSTOMER_CREATION_ALWAYS = 'always';
const CUSTOMER_CREATION_IF_REQUIRED = 'if_required';
public const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required';
const MODE_PAYMENT = 'payment';
const MODE_SETUP = 'setup';
const MODE_SUBSCRIPTION = 'subscription';
public const CUSTOMER_CREATION_ALWAYS = 'always';
const PAYMENT_METHOD_COLLECTION_ALWAYS = 'always';
const PAYMENT_METHOD_COLLECTION_IF_REQUIRED = 'if_required';
public const CUSTOMER_CREATION_IF_REQUIRED = 'if_required';
const PAYMENT_STATUS_NO_PAYMENT_REQUIRED = 'no_payment_required';
const PAYMENT_STATUS_PAID = 'paid';
const PAYMENT_STATUS_UNPAID = 'unpaid';
public const MODE_PAYMENT = 'payment';
const STATUS_COMPLETE = 'complete';
const STATUS_EXPIRED = 'expired';
const STATUS_OPEN = 'open';
public const MODE_SETUP = 'setup';
const SUBMIT_TYPE_AUTO = 'auto';
const SUBMIT_TYPE_BOOK = 'book';
const SUBMIT_TYPE_DONATE = 'donate';
const SUBMIT_TYPE_PAY = 'pay';
public const MODE_SUBSCRIPTION = 'subscription';
public const PAYMENT_METHOD_COLLECTION_ALWAYS = 'always';
public const PAYMENT_METHOD_COLLECTION_IF_REQUIRED = 'if_required';
public const PAYMENT_STATUS_NO_PAYMENT_REQUIRED = 'no_payment_required';
public const PAYMENT_STATUS_PAID = 'paid';
public const PAYMENT_STATUS_UNPAID = 'unpaid';
public const STATUS_COMPLETE = 'complete';
public const STATUS_EXPIRED = 'expired';
public const STATUS_OPEN = 'open';
public const SUBMIT_TYPE_AUTO = 'auto';
public const SUBMIT_TYPE_BOOK = 'book';
public const SUBMIT_TYPE_DONATE = 'donate';
public const SUBMIT_TYPE_PAY = 'pay';
/**
* @param null|array $params

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe;
@ -15,7 +15,7 @@ namespace Stripe;
*/
class Collection extends StripeObject implements \Countable, \IteratorAggregate
{
const OBJECT_NAME = 'list';
public const OBJECT_NAME = 'list';
use ApiOperations\Request;
@ -45,7 +45,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
*
* @param array $filters the filters
*/
public function setFilters($filters)
public function setFilters($filters) : void
{
$this->filters = $filters;
}
@ -82,9 +82,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)) {
if (!($obj instanceof self)) {
throw new \Stripe\Exception\UnexpectedValueException(
'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.'
'Expected type ' . self::class . ', got "' . \get_class($obj) . '" instead.'
);
}
$obj->setFilters($params);
@ -206,7 +206,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
*/
public static function emptyCollection($opts = null)
{
return Collection::constructFrom(['data' => []], $opts);
return self::constructFrom(['data' => []], $opts);
}
/**

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -23,7 +23,7 @@ namespace Stripe;
*/
class CountrySpec extends ApiResource
{
const OBJECT_NAME = 'country_spec';
public const OBJECT_NAME = 'country_spec';
use ApiOperations\All;
use ApiOperations\Retrieve;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -35,7 +35,7 @@ namespace Stripe;
*/
class Coupon extends ApiResource
{
const OBJECT_NAME = 'coupon';
public const OBJECT_NAME = 'coupon';
use ApiOperations\All;
use ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -41,7 +41,7 @@ namespace Stripe;
*/
class CreditNote extends ApiResource
{
const OBJECT_NAME = 'credit_note';
public const OBJECT_NAME = 'credit_note';
use ApiOperations\All;
use ApiOperations\Create;
@ -49,16 +49,21 @@ class CreditNote extends ApiResource
use ApiOperations\Retrieve;
use ApiOperations\Update;
const REASON_DUPLICATE = 'duplicate';
const REASON_FRAUDULENT = 'fraudulent';
const REASON_ORDER_CHANGE = 'order_change';
const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory';
public const REASON_DUPLICATE = 'duplicate';
const STATUS_ISSUED = 'issued';
const STATUS_VOID = 'void';
public const REASON_FRAUDULENT = 'fraudulent';
const TYPE_POST_PAYMENT = 'post_payment';
const TYPE_PRE_PAYMENT = 'pre_payment';
public const REASON_ORDER_CHANGE = 'order_change';
public const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory';
public const STATUS_ISSUED = 'issued';
public const STATUS_VOID = 'void';
public const TYPE_POST_PAYMENT = 'post_payment';
public const TYPE_PRE_PAYMENT = 'pre_payment';
/**
* @param null|array $params
@ -113,7 +118,7 @@ class CreditNote extends ApiResource
return $this;
}
const PATH_LINES = '/lines';
public const PATH_LINES = '/lines';
/**
* @param string $id the ID of the credit note on which to retrieve the credit note line items

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -24,5 +24,5 @@ namespace Stripe;
*/
class CreditNoteLineItem extends ApiResource
{
const OBJECT_NAME = 'credit_note_line_item';
public const OBJECT_NAME = 'credit_note_line_item';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -43,7 +43,7 @@ namespace Stripe;
*/
class Customer extends ApiResource
{
const OBJECT_NAME = 'customer';
public const OBJECT_NAME = 'customer';
use ApiOperations\All;
use ApiOperations\Create;
@ -53,14 +53,16 @@ class Customer extends ApiResource
use ApiOperations\Search;
use ApiOperations\Update;
const TAX_EXEMPT_EXEMPT = 'exempt';
const TAX_EXEMPT_NONE = 'none';
const TAX_EXEMPT_REVERSE = 'reverse';
public const TAX_EXEMPT_EXEMPT = 'exempt';
public const TAX_EXEMPT_NONE = 'none';
public const TAX_EXEMPT_REVERSE = 'reverse';
public static function getSavedNestedResources()
{
static $savedNestedResources = null;
if (null === $savedNestedResources) {
if ($savedNestedResources === null) {
$savedNestedResources = new Util\Set([
'source',
]);
@ -137,7 +139,7 @@ class Customer extends ApiResource
return self::_searchResource($url, $params, $opts);
}
const PATH_CASH_BALANCE = '/cash_balance';
public const PATH_CASH_BALANCE = '/cash_balance';
/**
* @param string $id the ID of the customer to which the cash balance belongs
@ -168,7 +170,8 @@ class Customer extends ApiResource
{
return self::_updateNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts);
}
const PATH_BALANCE_TRANSACTIONS = '/balance_transactions';
public const PATH_BALANCE_TRANSACTIONS = '/balance_transactions';
/**
* @param string $id the ID of the customer on which to retrieve the customer balance transactions
@ -227,7 +230,8 @@ class Customer extends ApiResource
{
return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
}
const PATH_CASH_BALANCE_TRANSACTIONS = '/cash_balance_transactions';
public 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
@ -257,7 +261,8 @@ class Customer extends ApiResource
{
return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $cashBalanceTransactionId, $params, $opts);
}
const PATH_SOURCES = '/sources';
public const PATH_SOURCES = '/sources';
/**
* @param string $id the ID of the customer on which to retrieve the payment sources
@ -331,7 +336,8 @@ class Customer extends ApiResource
{
return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
}
const PATH_TAX_IDS = '/tax_ids';
public const PATH_TAX_IDS = '/tax_ids';
/**
* @param string $id the ID of the customer on which to retrieve the tax ids

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -33,18 +33,25 @@ namespace Stripe;
*/
class CustomerBalanceTransaction extends ApiResource
{
const OBJECT_NAME = 'customer_balance_transaction';
public const OBJECT_NAME = 'customer_balance_transaction';
const TYPE_ADJUSTMENT = 'adjustment';
const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice';
const TYPE_CREDIT_NOTE = 'credit_note';
const TYPE_INITIAL = 'initial';
const TYPE_INVOICE_OVERPAID = 'invoice_overpaid';
const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large';
const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small';
const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit';
public const TYPE_ADJUSTMENT = 'adjustment';
const TYPE_ADJUSTEMENT = 'adjustment';
public const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice';
public const TYPE_CREDIT_NOTE = 'credit_note';
public const TYPE_INITIAL = 'initial';
public const TYPE_INVOICE_OVERPAID = 'invoice_overpaid';
public const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large';
public const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small';
public const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit';
public const TYPE_ADJUSTEMENT = 'adjustment';
/**
* @return string the API URL for this balance transaction
@ -75,7 +82,7 @@ class CustomerBalanceTransaction extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
public static function retrieve($_id, $_opts = null) : void
{
$msg = 'Customer Balance Transactions cannot be retrieved without a ' .
'customer ID. Retrieve a Customer Balance Transaction using ' .
@ -92,7 +99,7 @@ class CustomerBalanceTransaction extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
public static function update($_id, $_params = null, $_options = null) : void
{
$msg = 'Customer Balance Transactions cannot be updated without a ' .
'customer ID. Update a Customer Balance Transaction using ' .

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -27,15 +27,20 @@ namespace Stripe;
*/
class CustomerCashBalanceTransaction extends ApiResource
{
const OBJECT_NAME = 'customer_cash_balance_transaction';
public const OBJECT_NAME = 'customer_cash_balance_transaction';
use ApiOperations\All;
use ApiOperations\Retrieve;
const TYPE_APPLIED_TO_PAYMENT = 'applied_to_payment';
const TYPE_FUNDED = 'funded';
const TYPE_REFUNDED_FROM_PAYMENT = 'refunded_from_payment';
const TYPE_RETURN_CANCELED = 'return_canceled';
const TYPE_RETURN_INITIATED = 'return_initiated';
const TYPE_UNAPPLIED_FROM_PAYMENT = 'unapplied_from_payment';
public const TYPE_APPLIED_TO_PAYMENT = 'applied_to_payment';
public const TYPE_FUNDED = 'funded';
public const TYPE_REFUNDED_FROM_PAYMENT = 'refunded_from_payment';
public const TYPE_RETURN_CANCELED = 'return_canceled';
public const TYPE_RETURN_INITIATED = 'return_initiated';
public const TYPE_UNAPPLIED_FROM_PAYMENT = 'unapplied_from_payment';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe;
@ -19,5 +19,5 @@ namespace Stripe;
*/
class Discount extends StripeObject
{
const OBJECT_NAME = 'discount';
public const OBJECT_NAME = 'discount';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -33,35 +33,55 @@ namespace Stripe;
*/
class Dispute extends ApiResource
{
const OBJECT_NAME = 'dispute';
public const OBJECT_NAME = 'dispute';
use ApiOperations\All;
use ApiOperations\Retrieve;
use ApiOperations\Update;
const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process';
const REASON_CHECK_RETURNED = 'check_returned';
const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed';
const REASON_CUSTOMER_INITIATED = 'customer_initiated';
const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized';
const REASON_DUPLICATE = 'duplicate';
const REASON_FRAUDULENT = 'fraudulent';
const REASON_GENERAL = 'general';
const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details';
const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds';
const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received';
const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable';
const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled';
const REASON_UNRECOGNIZED = 'unrecognized';
public const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process';
const STATUS_CHARGE_REFUNDED = 'charge_refunded';
const STATUS_LOST = 'lost';
const STATUS_NEEDS_RESPONSE = 'needs_response';
const STATUS_UNDER_REVIEW = 'under_review';
const STATUS_WARNING_CLOSED = 'warning_closed';
const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response';
const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review';
const STATUS_WON = 'won';
public const REASON_CHECK_RETURNED = 'check_returned';
public const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed';
public const REASON_CUSTOMER_INITIATED = 'customer_initiated';
public const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized';
public const REASON_DUPLICATE = 'duplicate';
public const REASON_FRAUDULENT = 'fraudulent';
public const REASON_GENERAL = 'general';
public const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details';
public const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds';
public const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received';
public const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable';
public const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled';
public const REASON_UNRECOGNIZED = 'unrecognized';
public const STATUS_CHARGE_REFUNDED = 'charge_refunded';
public const STATUS_LOST = 'lost';
public const STATUS_NEEDS_RESPONSE = 'needs_response';
public const STATUS_UNDER_REVIEW = 'under_review';
public const STATUS_WARNING_CLOSED = 'warning_closed';
public const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response';
public const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review';
public const STATUS_WON = 'won';
/**
* @param null|array $params

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -14,7 +14,7 @@ namespace Stripe;
*/
class EphemeralKey extends ApiResource
{
const OBJECT_NAME = 'ephemeral_key';
public const OBJECT_NAME = 'ephemeral_key';
use ApiOperations\Create {
create as protected _create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe;
@ -42,141 +42,275 @@ class ErrorObject extends StripeObject
*
* @see https://stripe.com/docs/error-codes
*/
const CODE_ACCOUNT_COUNTRY_INVALID_ADDRESS = 'account_country_invalid_address';
const CODE_ACCOUNT_ERROR_COUNTRY_CHANGE_REQUIRES_ADDITIONAL_STEPS = 'account_error_country_change_requires_additional_steps';
const CODE_ACCOUNT_INFORMATION_MISMATCH = 'account_information_mismatch';
const CODE_ACCOUNT_INVALID = 'account_invalid';
const CODE_ACCOUNT_NUMBER_INVALID = 'account_number_invalid';
const CODE_ACSS_DEBIT_SESSION_INCOMPLETE = 'acss_debit_session_incomplete';
const CODE_ALIPAY_UPGRADE_REQUIRED = 'alipay_upgrade_required';
const CODE_AMOUNT_TOO_LARGE = 'amount_too_large';
const CODE_AMOUNT_TOO_SMALL = 'amount_too_small';
const CODE_API_KEY_EXPIRED = 'api_key_expired';
const CODE_AUTHENTICATION_REQUIRED = 'authentication_required';
const CODE_BALANCE_INSUFFICIENT = 'balance_insufficient';
const CODE_BANK_ACCOUNT_BAD_ROUTING_NUMBERS = 'bank_account_bad_routing_numbers';
const CODE_BANK_ACCOUNT_DECLINED = 'bank_account_declined';
const CODE_BANK_ACCOUNT_EXISTS = 'bank_account_exists';
const CODE_BANK_ACCOUNT_UNUSABLE = 'bank_account_unusable';
const CODE_BANK_ACCOUNT_UNVERIFIED = 'bank_account_unverified';
const CODE_BANK_ACCOUNT_VERIFICATION_FAILED = 'bank_account_verification_failed';
const CODE_BILLING_INVALID_MANDATE = 'billing_invalid_mandate';
const CODE_BITCOIN_UPGRADE_REQUIRED = 'bitcoin_upgrade_required';
const CODE_CARD_DECLINE_RATE_LIMIT_EXCEEDED = 'card_decline_rate_limit_exceeded';
const CODE_CARD_DECLINED = 'card_declined';
const CODE_CARDHOLDER_PHONE_NUMBER_REQUIRED = 'cardholder_phone_number_required';
const CODE_CHARGE_ALREADY_CAPTURED = 'charge_already_captured';
const CODE_CHARGE_ALREADY_REFUNDED = 'charge_already_refunded';
const CODE_CHARGE_DISPUTED = 'charge_disputed';
const CODE_CHARGE_EXCEEDS_SOURCE_LIMIT = 'charge_exceeds_source_limit';
const CODE_CHARGE_EXPIRED_FOR_CAPTURE = 'charge_expired_for_capture';
const CODE_CHARGE_INVALID_PARAMETER = 'charge_invalid_parameter';
const CODE_CLEARING_CODE_UNSUPPORTED = 'clearing_code_unsupported';
const CODE_COUNTRY_CODE_INVALID = 'country_code_invalid';
const CODE_COUNTRY_UNSUPPORTED = 'country_unsupported';
const CODE_COUPON_EXPIRED = 'coupon_expired';
const CODE_CUSTOMER_MAX_PAYMENT_METHODS = 'customer_max_payment_methods';
const CODE_CUSTOMER_MAX_SUBSCRIPTIONS = 'customer_max_subscriptions';
const CODE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized';
const CODE_EMAIL_INVALID = 'email_invalid';
const CODE_EXPIRED_CARD = 'expired_card';
const CODE_IDEMPOTENCY_KEY_IN_USE = 'idempotency_key_in_use';
const CODE_INCORRECT_ADDRESS = 'incorrect_address';
const CODE_INCORRECT_CVC = 'incorrect_cvc';
const CODE_INCORRECT_NUMBER = 'incorrect_number';
const CODE_INCORRECT_ZIP = 'incorrect_zip';
const CODE_INSTANT_PAYOUTS_LIMIT_EXCEEDED = 'instant_payouts_limit_exceeded';
const CODE_INSTANT_PAYOUTS_UNSUPPORTED = 'instant_payouts_unsupported';
const CODE_INSUFFICIENT_FUNDS = 'insufficient_funds';
const CODE_INTENT_INVALID_STATE = 'intent_invalid_state';
const CODE_INTENT_VERIFICATION_METHOD_MISSING = 'intent_verification_method_missing';
const CODE_INVALID_CARD_TYPE = 'invalid_card_type';
const CODE_INVALID_CHARACTERS = 'invalid_characters';
const CODE_INVALID_CHARGE_AMOUNT = 'invalid_charge_amount';
const CODE_INVALID_CVC = 'invalid_cvc';
const CODE_INVALID_EXPIRY_MONTH = 'invalid_expiry_month';
const CODE_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
const CODE_INVALID_NUMBER = 'invalid_number';
const CODE_INVALID_SOURCE_USAGE = 'invalid_source_usage';
const CODE_INVOICE_NO_CUSTOMER_LINE_ITEMS = 'invoice_no_customer_line_items';
const CODE_INVOICE_NO_PAYMENT_METHOD_TYPES = 'invoice_no_payment_method_types';
const CODE_INVOICE_NO_SUBSCRIPTION_LINE_ITEMS = 'invoice_no_subscription_line_items';
const CODE_INVOICE_NOT_EDITABLE = 'invoice_not_editable';
const CODE_INVOICE_ON_BEHALF_OF_NOT_EDITABLE = 'invoice_on_behalf_of_not_editable';
const CODE_INVOICE_PAYMENT_INTENT_REQUIRES_ACTION = 'invoice_payment_intent_requires_action';
const CODE_INVOICE_UPCOMING_NONE = 'invoice_upcoming_none';
const CODE_LIVEMODE_MISMATCH = 'livemode_mismatch';
const CODE_LOCK_TIMEOUT = 'lock_timeout';
const CODE_MISSING = 'missing';
const CODE_NO_ACCOUNT = 'no_account';
const CODE_NOT_ALLOWED_ON_STANDARD_ACCOUNT = 'not_allowed_on_standard_account';
const CODE_OUT_OF_INVENTORY = 'out_of_inventory';
const CODE_PARAMETER_INVALID_EMPTY = 'parameter_invalid_empty';
const CODE_PARAMETER_INVALID_INTEGER = 'parameter_invalid_integer';
const CODE_PARAMETER_INVALID_STRING_BLANK = 'parameter_invalid_string_blank';
const CODE_PARAMETER_INVALID_STRING_EMPTY = 'parameter_invalid_string_empty';
const CODE_PARAMETER_MISSING = 'parameter_missing';
const CODE_PARAMETER_UNKNOWN = 'parameter_unknown';
const CODE_PARAMETERS_EXCLUSIVE = 'parameters_exclusive';
const CODE_PAYMENT_INTENT_ACTION_REQUIRED = 'payment_intent_action_required';
const CODE_PAYMENT_INTENT_AUTHENTICATION_FAILURE = 'payment_intent_authentication_failure';
const CODE_PAYMENT_INTENT_INCOMPATIBLE_PAYMENT_METHOD = 'payment_intent_incompatible_payment_method';
const CODE_PAYMENT_INTENT_INVALID_PARAMETER = 'payment_intent_invalid_parameter';
const CODE_PAYMENT_INTENT_KONBINI_REJECTED_CONFIRMATION_NUMBER = 'payment_intent_konbini_rejected_confirmation_number';
const CODE_PAYMENT_INTENT_MANDATE_INVALID = 'payment_intent_mandate_invalid';
const CODE_PAYMENT_INTENT_PAYMENT_ATTEMPT_EXPIRED = 'payment_intent_payment_attempt_expired';
const CODE_PAYMENT_INTENT_PAYMENT_ATTEMPT_FAILED = 'payment_intent_payment_attempt_failed';
const CODE_PAYMENT_INTENT_UNEXPECTED_STATE = 'payment_intent_unexpected_state';
const CODE_PAYMENT_METHOD_BANK_ACCOUNT_ALREADY_VERIFIED = 'payment_method_bank_account_already_verified';
const CODE_PAYMENT_METHOD_BANK_ACCOUNT_BLOCKED = 'payment_method_bank_account_blocked';
const CODE_PAYMENT_METHOD_BILLING_DETAILS_ADDRESS_MISSING = 'payment_method_billing_details_address_missing';
const CODE_PAYMENT_METHOD_CURRENCY_MISMATCH = 'payment_method_currency_mismatch';
const CODE_PAYMENT_METHOD_INVALID_PARAMETER = 'payment_method_invalid_parameter';
const CODE_PAYMENT_METHOD_INVALID_PARAMETER_TESTMODE = 'payment_method_invalid_parameter_testmode';
const CODE_PAYMENT_METHOD_MICRODEPOSIT_FAILED = 'payment_method_microdeposit_failed';
const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_AMOUNTS_INVALID = 'payment_method_microdeposit_verification_amounts_invalid';
const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_AMOUNTS_MISMATCH = 'payment_method_microdeposit_verification_amounts_mismatch';
const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_ATTEMPTS_EXCEEDED = 'payment_method_microdeposit_verification_attempts_exceeded';
const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_DESCRIPTOR_CODE_MISMATCH = 'payment_method_microdeposit_verification_descriptor_code_mismatch';
const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_TIMEOUT = 'payment_method_microdeposit_verification_timeout';
const CODE_PAYMENT_METHOD_PROVIDER_DECLINE = 'payment_method_provider_decline';
const CODE_PAYMENT_METHOD_PROVIDER_TIMEOUT = 'payment_method_provider_timeout';
const CODE_PAYMENT_METHOD_UNACTIVATED = 'payment_method_unactivated';
const CODE_PAYMENT_METHOD_UNEXPECTED_STATE = 'payment_method_unexpected_state';
const CODE_PAYMENT_METHOD_UNSUPPORTED_TYPE = 'payment_method_unsupported_type';
const CODE_PAYOUTS_NOT_ALLOWED = 'payouts_not_allowed';
const CODE_PLATFORM_ACCOUNT_REQUIRED = 'platform_account_required';
const CODE_PLATFORM_API_KEY_EXPIRED = 'platform_api_key_expired';
const CODE_POSTAL_CODE_INVALID = 'postal_code_invalid';
const CODE_PROCESSING_ERROR = 'processing_error';
const CODE_PRODUCT_INACTIVE = 'product_inactive';
const CODE_RATE_LIMIT = 'rate_limit';
const CODE_REFER_TO_CUSTOMER = 'refer_to_customer';
const CODE_REFUND_DISPUTED_PAYMENT = 'refund_disputed_payment';
const CODE_RESOURCE_ALREADY_EXISTS = 'resource_already_exists';
const CODE_RESOURCE_MISSING = 'resource_missing';
const CODE_RETURN_INTENT_ALREADY_PROCESSED = 'return_intent_already_processed';
const CODE_ROUTING_NUMBER_INVALID = 'routing_number_invalid';
const CODE_SECRET_KEY_REQUIRED = 'secret_key_required';
const CODE_SEPA_UNSUPPORTED_ACCOUNT = 'sepa_unsupported_account';
const CODE_SETUP_ATTEMPT_FAILED = 'setup_attempt_failed';
const CODE_SETUP_INTENT_AUTHENTICATION_FAILURE = 'setup_intent_authentication_failure';
const CODE_SETUP_INTENT_INVALID_PARAMETER = 'setup_intent_invalid_parameter';
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_CALCULATION_FAILED = 'shipping_calculation_failed';
const CODE_SKU_INACTIVE = 'sku_inactive';
const CODE_STATE_UNSUPPORTED = 'state_unsupported';
const CODE_TAX_ID_INVALID = 'tax_id_invalid';
const CODE_TAXES_CALCULATION_FAILED = 'taxes_calculation_failed';
const CODE_TERMINAL_LOCATION_COUNTRY_UNSUPPORTED = 'terminal_location_country_unsupported';
const CODE_TESTMODE_CHARGES_ONLY = 'testmode_charges_only';
const CODE_TLS_VERSION_UNSUPPORTED = 'tls_version_unsupported';
const CODE_TOKEN_ALREADY_USED = 'token_already_used';
const CODE_TOKEN_IN_USE = 'token_in_use';
const CODE_TRANSFER_SOURCE_BALANCE_PARAMETERS_MISMATCH = 'transfer_source_balance_parameters_mismatch';
const CODE_TRANSFERS_NOT_ALLOWED = 'transfers_not_allowed';
const CODE_URL_INVALID = 'url_invalid';
public const CODE_ACCOUNT_COUNTRY_INVALID_ADDRESS = 'account_country_invalid_address';
public const CODE_ACCOUNT_ERROR_COUNTRY_CHANGE_REQUIRES_ADDITIONAL_STEPS = 'account_error_country_change_requires_additional_steps';
public const CODE_ACCOUNT_INFORMATION_MISMATCH = 'account_information_mismatch';
public const CODE_ACCOUNT_INVALID = 'account_invalid';
public const CODE_ACCOUNT_NUMBER_INVALID = 'account_number_invalid';
public const CODE_ACSS_DEBIT_SESSION_INCOMPLETE = 'acss_debit_session_incomplete';
public const CODE_ALIPAY_UPGRADE_REQUIRED = 'alipay_upgrade_required';
public const CODE_AMOUNT_TOO_LARGE = 'amount_too_large';
public const CODE_AMOUNT_TOO_SMALL = 'amount_too_small';
public const CODE_API_KEY_EXPIRED = 'api_key_expired';
public const CODE_AUTHENTICATION_REQUIRED = 'authentication_required';
public const CODE_BALANCE_INSUFFICIENT = 'balance_insufficient';
public const CODE_BANK_ACCOUNT_BAD_ROUTING_NUMBERS = 'bank_account_bad_routing_numbers';
public const CODE_BANK_ACCOUNT_DECLINED = 'bank_account_declined';
public const CODE_BANK_ACCOUNT_EXISTS = 'bank_account_exists';
public const CODE_BANK_ACCOUNT_UNUSABLE = 'bank_account_unusable';
public const CODE_BANK_ACCOUNT_UNVERIFIED = 'bank_account_unverified';
public const CODE_BANK_ACCOUNT_VERIFICATION_FAILED = 'bank_account_verification_failed';
public const CODE_BILLING_INVALID_MANDATE = 'billing_invalid_mandate';
public const CODE_BITCOIN_UPGRADE_REQUIRED = 'bitcoin_upgrade_required';
public const CODE_CARD_DECLINE_RATE_LIMIT_EXCEEDED = 'card_decline_rate_limit_exceeded';
public const CODE_CARD_DECLINED = 'card_declined';
public const CODE_CARDHOLDER_PHONE_NUMBER_REQUIRED = 'cardholder_phone_number_required';
public const CODE_CHARGE_ALREADY_CAPTURED = 'charge_already_captured';
public const CODE_CHARGE_ALREADY_REFUNDED = 'charge_already_refunded';
public const CODE_CHARGE_DISPUTED = 'charge_disputed';
public const CODE_CHARGE_EXCEEDS_SOURCE_LIMIT = 'charge_exceeds_source_limit';
public const CODE_CHARGE_EXPIRED_FOR_CAPTURE = 'charge_expired_for_capture';
public const CODE_CHARGE_INVALID_PARAMETER = 'charge_invalid_parameter';
public const CODE_CLEARING_CODE_UNSUPPORTED = 'clearing_code_unsupported';
public const CODE_COUNTRY_CODE_INVALID = 'country_code_invalid';
public const CODE_COUNTRY_UNSUPPORTED = 'country_unsupported';
public const CODE_COUPON_EXPIRED = 'coupon_expired';
public const CODE_CUSTOMER_MAX_PAYMENT_METHODS = 'customer_max_payment_methods';
public const CODE_CUSTOMER_MAX_SUBSCRIPTIONS = 'customer_max_subscriptions';
public const CODE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized';
public const CODE_EMAIL_INVALID = 'email_invalid';
public const CODE_EXPIRED_CARD = 'expired_card';
public const CODE_IDEMPOTENCY_KEY_IN_USE = 'idempotency_key_in_use';
public const CODE_INCORRECT_ADDRESS = 'incorrect_address';
public const CODE_INCORRECT_CVC = 'incorrect_cvc';
public const CODE_INCORRECT_NUMBER = 'incorrect_number';
public const CODE_INCORRECT_ZIP = 'incorrect_zip';
public const CODE_INSTANT_PAYOUTS_LIMIT_EXCEEDED = 'instant_payouts_limit_exceeded';
public const CODE_INSTANT_PAYOUTS_UNSUPPORTED = 'instant_payouts_unsupported';
public const CODE_INSUFFICIENT_FUNDS = 'insufficient_funds';
public const CODE_INTENT_INVALID_STATE = 'intent_invalid_state';
public const CODE_INTENT_VERIFICATION_METHOD_MISSING = 'intent_verification_method_missing';
public const CODE_INVALID_CARD_TYPE = 'invalid_card_type';
public const CODE_INVALID_CHARACTERS = 'invalid_characters';
public const CODE_INVALID_CHARGE_AMOUNT = 'invalid_charge_amount';
public const CODE_INVALID_CVC = 'invalid_cvc';
public const CODE_INVALID_EXPIRY_MONTH = 'invalid_expiry_month';
public const CODE_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
public const CODE_INVALID_NUMBER = 'invalid_number';
public const CODE_INVALID_SOURCE_USAGE = 'invalid_source_usage';
public const CODE_INVOICE_NO_CUSTOMER_LINE_ITEMS = 'invoice_no_customer_line_items';
public const CODE_INVOICE_NO_PAYMENT_METHOD_TYPES = 'invoice_no_payment_method_types';
public const CODE_INVOICE_NO_SUBSCRIPTION_LINE_ITEMS = 'invoice_no_subscription_line_items';
public const CODE_INVOICE_NOT_EDITABLE = 'invoice_not_editable';
public const CODE_INVOICE_ON_BEHALF_OF_NOT_EDITABLE = 'invoice_on_behalf_of_not_editable';
public const CODE_INVOICE_PAYMENT_INTENT_REQUIRES_ACTION = 'invoice_payment_intent_requires_action';
public const CODE_INVOICE_UPCOMING_NONE = 'invoice_upcoming_none';
public const CODE_LIVEMODE_MISMATCH = 'livemode_mismatch';
public const CODE_LOCK_TIMEOUT = 'lock_timeout';
public const CODE_MISSING = 'missing';
public const CODE_NO_ACCOUNT = 'no_account';
public const CODE_NOT_ALLOWED_ON_STANDARD_ACCOUNT = 'not_allowed_on_standard_account';
public const CODE_OUT_OF_INVENTORY = 'out_of_inventory';
public const CODE_PARAMETER_INVALID_EMPTY = 'parameter_invalid_empty';
public const CODE_PARAMETER_INVALID_INTEGER = 'parameter_invalid_integer';
public const CODE_PARAMETER_INVALID_STRING_BLANK = 'parameter_invalid_string_blank';
public const CODE_PARAMETER_INVALID_STRING_EMPTY = 'parameter_invalid_string_empty';
public const CODE_PARAMETER_MISSING = 'parameter_missing';
public const CODE_PARAMETER_UNKNOWN = 'parameter_unknown';
public const CODE_PARAMETERS_EXCLUSIVE = 'parameters_exclusive';
public const CODE_PAYMENT_INTENT_ACTION_REQUIRED = 'payment_intent_action_required';
public const CODE_PAYMENT_INTENT_AUTHENTICATION_FAILURE = 'payment_intent_authentication_failure';
public const CODE_PAYMENT_INTENT_INCOMPATIBLE_PAYMENT_METHOD = 'payment_intent_incompatible_payment_method';
public const CODE_PAYMENT_INTENT_INVALID_PARAMETER = 'payment_intent_invalid_parameter';
public const CODE_PAYMENT_INTENT_KONBINI_REJECTED_CONFIRMATION_NUMBER = 'payment_intent_konbini_rejected_confirmation_number';
public const CODE_PAYMENT_INTENT_MANDATE_INVALID = 'payment_intent_mandate_invalid';
public const CODE_PAYMENT_INTENT_PAYMENT_ATTEMPT_EXPIRED = 'payment_intent_payment_attempt_expired';
public const CODE_PAYMENT_INTENT_PAYMENT_ATTEMPT_FAILED = 'payment_intent_payment_attempt_failed';
public const CODE_PAYMENT_INTENT_UNEXPECTED_STATE = 'payment_intent_unexpected_state';
public const CODE_PAYMENT_METHOD_BANK_ACCOUNT_ALREADY_VERIFIED = 'payment_method_bank_account_already_verified';
public const CODE_PAYMENT_METHOD_BANK_ACCOUNT_BLOCKED = 'payment_method_bank_account_blocked';
public const CODE_PAYMENT_METHOD_BILLING_DETAILS_ADDRESS_MISSING = 'payment_method_billing_details_address_missing';
public const CODE_PAYMENT_METHOD_CURRENCY_MISMATCH = 'payment_method_currency_mismatch';
public const CODE_PAYMENT_METHOD_INVALID_PARAMETER = 'payment_method_invalid_parameter';
public const CODE_PAYMENT_METHOD_INVALID_PARAMETER_TESTMODE = 'payment_method_invalid_parameter_testmode';
public const CODE_PAYMENT_METHOD_MICRODEPOSIT_FAILED = 'payment_method_microdeposit_failed';
public const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_AMOUNTS_INVALID = 'payment_method_microdeposit_verification_amounts_invalid';
public const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_AMOUNTS_MISMATCH = 'payment_method_microdeposit_verification_amounts_mismatch';
public const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_ATTEMPTS_EXCEEDED = 'payment_method_microdeposit_verification_attempts_exceeded';
public const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_DESCRIPTOR_CODE_MISMATCH = 'payment_method_microdeposit_verification_descriptor_code_mismatch';
public const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_TIMEOUT = 'payment_method_microdeposit_verification_timeout';
public const CODE_PAYMENT_METHOD_PROVIDER_DECLINE = 'payment_method_provider_decline';
public const CODE_PAYMENT_METHOD_PROVIDER_TIMEOUT = 'payment_method_provider_timeout';
public const CODE_PAYMENT_METHOD_UNACTIVATED = 'payment_method_unactivated';
public const CODE_PAYMENT_METHOD_UNEXPECTED_STATE = 'payment_method_unexpected_state';
public const CODE_PAYMENT_METHOD_UNSUPPORTED_TYPE = 'payment_method_unsupported_type';
public const CODE_PAYOUTS_NOT_ALLOWED = 'payouts_not_allowed';
public const CODE_PLATFORM_ACCOUNT_REQUIRED = 'platform_account_required';
public const CODE_PLATFORM_API_KEY_EXPIRED = 'platform_api_key_expired';
public const CODE_POSTAL_CODE_INVALID = 'postal_code_invalid';
public const CODE_PROCESSING_ERROR = 'processing_error';
public const CODE_PRODUCT_INACTIVE = 'product_inactive';
public const CODE_RATE_LIMIT = 'rate_limit';
public const CODE_REFER_TO_CUSTOMER = 'refer_to_customer';
public const CODE_REFUND_DISPUTED_PAYMENT = 'refund_disputed_payment';
public const CODE_RESOURCE_ALREADY_EXISTS = 'resource_already_exists';
public const CODE_RESOURCE_MISSING = 'resource_missing';
public const CODE_RETURN_INTENT_ALREADY_PROCESSED = 'return_intent_already_processed';
public const CODE_ROUTING_NUMBER_INVALID = 'routing_number_invalid';
public const CODE_SECRET_KEY_REQUIRED = 'secret_key_required';
public const CODE_SEPA_UNSUPPORTED_ACCOUNT = 'sepa_unsupported_account';
public const CODE_SETUP_ATTEMPT_FAILED = 'setup_attempt_failed';
public const CODE_SETUP_INTENT_AUTHENTICATION_FAILURE = 'setup_intent_authentication_failure';
public const CODE_SETUP_INTENT_INVALID_PARAMETER = 'setup_intent_invalid_parameter';
public const CODE_SETUP_INTENT_SETUP_ATTEMPT_EXPIRED = 'setup_intent_setup_attempt_expired';
public const CODE_SETUP_INTENT_UNEXPECTED_STATE = 'setup_intent_unexpected_state';
public const CODE_SHIPPING_CALCULATION_FAILED = 'shipping_calculation_failed';
public const CODE_SKU_INACTIVE = 'sku_inactive';
public const CODE_STATE_UNSUPPORTED = 'state_unsupported';
public const CODE_TAX_ID_INVALID = 'tax_id_invalid';
public const CODE_TAXES_CALCULATION_FAILED = 'taxes_calculation_failed';
public const CODE_TERMINAL_LOCATION_COUNTRY_UNSUPPORTED = 'terminal_location_country_unsupported';
public const CODE_TESTMODE_CHARGES_ONLY = 'testmode_charges_only';
public const CODE_TLS_VERSION_UNSUPPORTED = 'tls_version_unsupported';
public const CODE_TOKEN_ALREADY_USED = 'token_already_used';
public const CODE_TOKEN_IN_USE = 'token_in_use';
public const CODE_TRANSFER_SOURCE_BALANCE_PARAMETERS_MISMATCH = 'transfer_source_balance_parameters_mismatch';
public const CODE_TRANSFERS_NOT_ALLOWED = 'transfers_not_allowed';
public const CODE_URL_INVALID = 'url_invalid';
/**
* Refreshes this object using the provided values.
@ -185,7 +319,7 @@ class ErrorObject extends StripeObject
* @param null|array|string|Util\RequestOptions $opts
* @param bool $partial defaults to false
*/
public function refreshFrom($values, $opts, $partial = false)
public function refreshFrom($values, $opts, $partial = false) : void
{
// Unlike most other API resources, the API will omit attributes in
// error objects when they have a null value. We manually set default

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -55,226 +55,442 @@ namespace Stripe;
*/
class Event extends ApiResource
{
const OBJECT_NAME = 'event';
public const OBJECT_NAME = 'event';
use ApiOperations\All;
use ApiOperations\Retrieve;
const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized';
const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized';
const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created';
const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted';
const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated';
const ACCOUNT_UPDATED = 'account.updated';
const APPLICATION_FEE_CREATED = 'application_fee.created';
const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
const APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
const BALANCE_AVAILABLE = 'balance.available';
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';
const CAPABILITY_UPDATED = 'capability.updated';
const CASH_BALANCE_FUNDS_AVAILABLE = 'cash_balance.funds_available';
const CHARGE_CAPTURED = 'charge.captured';
const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed';
const CHARGE_DISPUTE_CREATED = 'charge.dispute.created';
const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated';
const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn';
const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated';
const CHARGE_EXPIRED = 'charge.expired';
const CHARGE_FAILED = 'charge.failed';
const CHARGE_PENDING = 'charge.pending';
const CHARGE_REFUND_UPDATED = 'charge.refund.updated';
const CHARGE_REFUNDED = 'charge.refunded';
const CHARGE_SUCCEEDED = 'charge.succeeded';
const CHARGE_UPDATED = 'charge.updated';
const CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED = 'checkout.session.async_payment_failed';
const CHECKOUT_SESSION_ASYNC_PAYMENT_SUCCEEDED = 'checkout.session.async_payment_succeeded';
const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed';
const CHECKOUT_SESSION_EXPIRED = 'checkout.session.expired';
const COUPON_CREATED = 'coupon.created';
const COUPON_DELETED = 'coupon.deleted';
const COUPON_UPDATED = 'coupon.updated';
const CREDIT_NOTE_CREATED = 'credit_note.created';
const CREDIT_NOTE_UPDATED = 'credit_note.updated';
const CREDIT_NOTE_VOIDED = 'credit_note.voided';
const CUSTOMER_CREATED = 'customer.created';
const CUSTOMER_DELETED = 'customer.deleted';
const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created';
const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted';
const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated';
const CUSTOMER_SOURCE_CREATED = 'customer.source.created';
const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted';
const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring';
const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated';
const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created';
const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted';
const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied';
const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired';
const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created';
const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted';
const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated';
const CUSTOMER_UPDATED = 'customer.updated';
const CUSTOMER_CASH_BALANCE_TRANSACTION_CREATED = 'customer_cash_balance_transaction.created';
const FILE_CREATED = 'file.created';
const FINANCIAL_CONNECTIONS_ACCOUNT_CREATED = 'financial_connections.account.created';
const FINANCIAL_CONNECTIONS_ACCOUNT_DEACTIVATED = 'financial_connections.account.deactivated';
const FINANCIAL_CONNECTIONS_ACCOUNT_DISCONNECTED = 'financial_connections.account.disconnected';
const FINANCIAL_CONNECTIONS_ACCOUNT_REACTIVATED = 'financial_connections.account.reactivated';
const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_BALANCE = 'financial_connections.account.refreshed_balance';
const IDENTITY_VERIFICATION_SESSION_CANCELED = 'identity.verification_session.canceled';
const IDENTITY_VERIFICATION_SESSION_CREATED = 'identity.verification_session.created';
const IDENTITY_VERIFICATION_SESSION_PROCESSING = 'identity.verification_session.processing';
const IDENTITY_VERIFICATION_SESSION_REDACTED = 'identity.verification_session.redacted';
const IDENTITY_VERIFICATION_SESSION_REQUIRES_INPUT = 'identity.verification_session.requires_input';
const IDENTITY_VERIFICATION_SESSION_VERIFIED = 'identity.verification_session.verified';
const INVOICE_CREATED = 'invoice.created';
const INVOICE_DELETED = 'invoice.deleted';
const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed';
const INVOICE_FINALIZED = 'invoice.finalized';
const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
const INVOICE_PAID = 'invoice.paid';
const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required';
const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed';
const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded';
const INVOICE_SENT = 'invoice.sent';
const INVOICE_UPCOMING = 'invoice.upcoming';
const INVOICE_UPDATED = 'invoice.updated';
const INVOICE_VOIDED = 'invoice.voided';
const INVOICEITEM_CREATED = 'invoiceitem.created';
const INVOICEITEM_DELETED = 'invoiceitem.deleted';
const INVOICEITEM_UPDATED = 'invoiceitem.updated';
const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created';
const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request';
const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated';
const ISSUING_CARD_CREATED = 'issuing_card.created';
const ISSUING_CARD_UPDATED = 'issuing_card.updated';
const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed';
const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created';
const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated';
const ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted';
const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated';
const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
const MANDATE_UPDATED = 'mandate.updated';
const ORDER_CREATED = 'order.created';
const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated';
const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled';
const PAYMENT_INTENT_CREATED = 'payment_intent.created';
const PAYMENT_INTENT_PARTIALLY_FUNDED = 'payment_intent.partially_funded';
const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed';
const PAYMENT_INTENT_PROCESSING = 'payment_intent.processing';
const PAYMENT_INTENT_REQUIRES_ACTION = 'payment_intent.requires_action';
const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
const PAYMENT_LINK_CREATED = 'payment_link.created';
const PAYMENT_LINK_UPDATED = 'payment_link.updated';
const PAYMENT_METHOD_ATTACHED = 'payment_method.attached';
const PAYMENT_METHOD_AUTOMATICALLY_UPDATED = 'payment_method.automatically_updated';
const PAYMENT_METHOD_DETACHED = 'payment_method.detached';
const PAYMENT_METHOD_UPDATED = 'payment_method.updated';
const PAYOUT_CANCELED = 'payout.canceled';
const PAYOUT_CREATED = 'payout.created';
const PAYOUT_FAILED = 'payout.failed';
const PAYOUT_PAID = 'payout.paid';
const PAYOUT_UPDATED = 'payout.updated';
const PERSON_CREATED = 'person.created';
const PERSON_DELETED = 'person.deleted';
const PERSON_UPDATED = 'person.updated';
const PLAN_CREATED = 'plan.created';
const PLAN_DELETED = 'plan.deleted';
const PLAN_UPDATED = 'plan.updated';
const PRICE_CREATED = 'price.created';
const PRICE_DELETED = 'price.deleted';
const PRICE_UPDATED = 'price.updated';
const PRODUCT_CREATED = 'product.created';
const PRODUCT_DELETED = 'product.deleted';
const PRODUCT_UPDATED = 'product.updated';
const PROMOTION_CODE_CREATED = 'promotion_code.created';
const PROMOTION_CODE_UPDATED = 'promotion_code.updated';
const QUOTE_ACCEPTED = 'quote.accepted';
const QUOTE_CANCELED = 'quote.canceled';
const QUOTE_CREATED = 'quote.created';
const QUOTE_FINALIZED = 'quote.finalized';
const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created';
const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated';
const RECIPIENT_CREATED = 'recipient.created';
const RECIPIENT_DELETED = 'recipient.deleted';
const RECIPIENT_UPDATED = 'recipient.updated';
const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed';
const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded';
const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated';
const REVIEW_CLOSED = 'review.closed';
const REVIEW_OPENED = 'review.opened';
const SETUP_INTENT_CANCELED = 'setup_intent.canceled';
const SETUP_INTENT_CREATED = 'setup_intent.created';
const SETUP_INTENT_REQUIRES_ACTION = 'setup_intent.requires_action';
const SETUP_INTENT_SETUP_FAILED = 'setup_intent.setup_failed';
const SETUP_INTENT_SUCCEEDED = 'setup_intent.succeeded';
const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created';
const SKU_CREATED = 'sku.created';
const SKU_DELETED = 'sku.deleted';
const SKU_UPDATED = 'sku.updated';
const SOURCE_CANCELED = 'source.canceled';
const SOURCE_CHARGEABLE = 'source.chargeable';
const SOURCE_FAILED = 'source.failed';
const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification';
const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required';
const SOURCE_TRANSACTION_CREATED = 'source.transaction.created';
const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated';
const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted';
const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled';
const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed';
const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created';
const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring';
const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released';
const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated';
const TAX_RATE_CREATED = 'tax_rate.created';
const TAX_RATE_UPDATED = 'tax_rate.updated';
const TERMINAL_READER_ACTION_FAILED = 'terminal.reader.action_failed';
const TERMINAL_READER_ACTION_SUCCEEDED = 'terminal.reader.action_succeeded';
const TEST_HELPERS_TEST_CLOCK_ADVANCING = 'test_helpers.test_clock.advancing';
const TEST_HELPERS_TEST_CLOCK_CREATED = 'test_helpers.test_clock.created';
const TEST_HELPERS_TEST_CLOCK_DELETED = 'test_helpers.test_clock.deleted';
const TEST_HELPERS_TEST_CLOCK_INTERNAL_FAILURE = 'test_helpers.test_clock.internal_failure';
const TEST_HELPERS_TEST_CLOCK_READY = 'test_helpers.test_clock.ready';
const TOPUP_CANCELED = 'topup.canceled';
const TOPUP_CREATED = 'topup.created';
const TOPUP_FAILED = 'topup.failed';
const TOPUP_REVERSED = 'topup.reversed';
const TOPUP_SUCCEEDED = 'topup.succeeded';
const TRANSFER_CREATED = 'transfer.created';
const TRANSFER_REVERSED = 'transfer.reversed';
const TRANSFER_UPDATED = 'transfer.updated';
const TREASURY_CREDIT_REVERSAL_CREATED = 'treasury.credit_reversal.created';
const TREASURY_CREDIT_REVERSAL_POSTED = 'treasury.credit_reversal.posted';
const TREASURY_DEBIT_REVERSAL_COMPLETED = 'treasury.debit_reversal.completed';
const TREASURY_DEBIT_REVERSAL_CREATED = 'treasury.debit_reversal.created';
const TREASURY_DEBIT_REVERSAL_INITIAL_CREDIT_GRANTED = 'treasury.debit_reversal.initial_credit_granted';
const TREASURY_FINANCIAL_ACCOUNT_CLOSED = 'treasury.financial_account.closed';
const TREASURY_FINANCIAL_ACCOUNT_CREATED = 'treasury.financial_account.created';
const TREASURY_FINANCIAL_ACCOUNT_FEATURES_STATUS_UPDATED = 'treasury.financial_account.features_status_updated';
const TREASURY_INBOUND_TRANSFER_CANCELED = 'treasury.inbound_transfer.canceled';
const TREASURY_INBOUND_TRANSFER_CREATED = 'treasury.inbound_transfer.created';
const TREASURY_INBOUND_TRANSFER_FAILED = 'treasury.inbound_transfer.failed';
const TREASURY_INBOUND_TRANSFER_SUCCEEDED = 'treasury.inbound_transfer.succeeded';
const TREASURY_OUTBOUND_PAYMENT_CANCELED = 'treasury.outbound_payment.canceled';
const TREASURY_OUTBOUND_PAYMENT_CREATED = 'treasury.outbound_payment.created';
const TREASURY_OUTBOUND_PAYMENT_EXPECTED_ARRIVAL_DATE_UPDATED = 'treasury.outbound_payment.expected_arrival_date_updated';
const TREASURY_OUTBOUND_PAYMENT_FAILED = 'treasury.outbound_payment.failed';
const TREASURY_OUTBOUND_PAYMENT_POSTED = 'treasury.outbound_payment.posted';
const TREASURY_OUTBOUND_PAYMENT_RETURNED = 'treasury.outbound_payment.returned';
const TREASURY_OUTBOUND_TRANSFER_CANCELED = 'treasury.outbound_transfer.canceled';
const TREASURY_OUTBOUND_TRANSFER_CREATED = 'treasury.outbound_transfer.created';
const TREASURY_OUTBOUND_TRANSFER_EXPECTED_ARRIVAL_DATE_UPDATED = 'treasury.outbound_transfer.expected_arrival_date_updated';
const TREASURY_OUTBOUND_TRANSFER_FAILED = 'treasury.outbound_transfer.failed';
const TREASURY_OUTBOUND_TRANSFER_POSTED = 'treasury.outbound_transfer.posted';
const TREASURY_OUTBOUND_TRANSFER_RETURNED = 'treasury.outbound_transfer.returned';
const TREASURY_RECEIVED_CREDIT_CREATED = 'treasury.received_credit.created';
const TREASURY_RECEIVED_CREDIT_FAILED = 'treasury.received_credit.failed';
const TREASURY_RECEIVED_CREDIT_SUCCEEDED = 'treasury.received_credit.succeeded';
const TREASURY_RECEIVED_DEBIT_CREATED = 'treasury.received_debit.created';
public const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized';
public const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized';
public const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created';
public const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted';
public const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated';
public const ACCOUNT_UPDATED = 'account.updated';
public const APPLICATION_FEE_CREATED = 'application_fee.created';
public const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
public const APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
public const BALANCE_AVAILABLE = 'balance.available';
public const BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created';
public const BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated';
public const BILLING_PORTAL_SESSION_CREATED = 'billing_portal.session.created';
public const CAPABILITY_UPDATED = 'capability.updated';
public const CASH_BALANCE_FUNDS_AVAILABLE = 'cash_balance.funds_available';
public const CHARGE_CAPTURED = 'charge.captured';
public const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed';
public const CHARGE_DISPUTE_CREATED = 'charge.dispute.created';
public const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated';
public const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn';
public const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated';
public const CHARGE_EXPIRED = 'charge.expired';
public const CHARGE_FAILED = 'charge.failed';
public const CHARGE_PENDING = 'charge.pending';
public const CHARGE_REFUND_UPDATED = 'charge.refund.updated';
public const CHARGE_REFUNDED = 'charge.refunded';
public const CHARGE_SUCCEEDED = 'charge.succeeded';
public const CHARGE_UPDATED = 'charge.updated';
public const CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED = 'checkout.session.async_payment_failed';
public const CHECKOUT_SESSION_ASYNC_PAYMENT_SUCCEEDED = 'checkout.session.async_payment_succeeded';
public const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed';
public const CHECKOUT_SESSION_EXPIRED = 'checkout.session.expired';
public const COUPON_CREATED = 'coupon.created';
public const COUPON_DELETED = 'coupon.deleted';
public const COUPON_UPDATED = 'coupon.updated';
public const CREDIT_NOTE_CREATED = 'credit_note.created';
public const CREDIT_NOTE_UPDATED = 'credit_note.updated';
public const CREDIT_NOTE_VOIDED = 'credit_note.voided';
public const CUSTOMER_CREATED = 'customer.created';
public const CUSTOMER_DELETED = 'customer.deleted';
public const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created';
public const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted';
public const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated';
public const CUSTOMER_SOURCE_CREATED = 'customer.source.created';
public const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted';
public const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring';
public const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated';
public const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created';
public const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted';
public const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied';
public const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired';
public const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
public const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
public const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created';
public const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted';
public const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated';
public const CUSTOMER_UPDATED = 'customer.updated';
public const CUSTOMER_CASH_BALANCE_TRANSACTION_CREATED = 'customer_cash_balance_transaction.created';
public const FILE_CREATED = 'file.created';
public const FINANCIAL_CONNECTIONS_ACCOUNT_CREATED = 'financial_connections.account.created';
public const FINANCIAL_CONNECTIONS_ACCOUNT_DEACTIVATED = 'financial_connections.account.deactivated';
public const FINANCIAL_CONNECTIONS_ACCOUNT_DISCONNECTED = 'financial_connections.account.disconnected';
public const FINANCIAL_CONNECTIONS_ACCOUNT_REACTIVATED = 'financial_connections.account.reactivated';
public const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_BALANCE = 'financial_connections.account.refreshed_balance';
public const IDENTITY_VERIFICATION_SESSION_CANCELED = 'identity.verification_session.canceled';
public const IDENTITY_VERIFICATION_SESSION_CREATED = 'identity.verification_session.created';
public const IDENTITY_VERIFICATION_SESSION_PROCESSING = 'identity.verification_session.processing';
public const IDENTITY_VERIFICATION_SESSION_REDACTED = 'identity.verification_session.redacted';
public const IDENTITY_VERIFICATION_SESSION_REQUIRES_INPUT = 'identity.verification_session.requires_input';
public const IDENTITY_VERIFICATION_SESSION_VERIFIED = 'identity.verification_session.verified';
public const INVOICE_CREATED = 'invoice.created';
public const INVOICE_DELETED = 'invoice.deleted';
public const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed';
public const INVOICE_FINALIZED = 'invoice.finalized';
public const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
public const INVOICE_PAID = 'invoice.paid';
public const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required';
public const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed';
public const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded';
public const INVOICE_SENT = 'invoice.sent';
public const INVOICE_UPCOMING = 'invoice.upcoming';
public const INVOICE_UPDATED = 'invoice.updated';
public const INVOICE_VOIDED = 'invoice.voided';
public const INVOICEITEM_CREATED = 'invoiceitem.created';
public const INVOICEITEM_DELETED = 'invoiceitem.deleted';
public const INVOICEITEM_UPDATED = 'invoiceitem.updated';
public const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created';
public const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request';
public const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated';
public const ISSUING_CARD_CREATED = 'issuing_card.created';
public const ISSUING_CARD_UPDATED = 'issuing_card.updated';
public const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
public const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
public const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed';
public const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created';
public const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated';
public const ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted';
public const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated';
public const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
public const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
public const MANDATE_UPDATED = 'mandate.updated';
public const ORDER_CREATED = 'order.created';
public const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated';
public const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled';
public const PAYMENT_INTENT_CREATED = 'payment_intent.created';
public const PAYMENT_INTENT_PARTIALLY_FUNDED = 'payment_intent.partially_funded';
public const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed';
public const PAYMENT_INTENT_PROCESSING = 'payment_intent.processing';
public const PAYMENT_INTENT_REQUIRES_ACTION = 'payment_intent.requires_action';
public const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
public const PAYMENT_LINK_CREATED = 'payment_link.created';
public const PAYMENT_LINK_UPDATED = 'payment_link.updated';
public const PAYMENT_METHOD_ATTACHED = 'payment_method.attached';
public const PAYMENT_METHOD_AUTOMATICALLY_UPDATED = 'payment_method.automatically_updated';
public const PAYMENT_METHOD_DETACHED = 'payment_method.detached';
public const PAYMENT_METHOD_UPDATED = 'payment_method.updated';
public const PAYOUT_CANCELED = 'payout.canceled';
public const PAYOUT_CREATED = 'payout.created';
public const PAYOUT_FAILED = 'payout.failed';
public const PAYOUT_PAID = 'payout.paid';
public const PAYOUT_UPDATED = 'payout.updated';
public const PERSON_CREATED = 'person.created';
public const PERSON_DELETED = 'person.deleted';
public const PERSON_UPDATED = 'person.updated';
public const PLAN_CREATED = 'plan.created';
public const PLAN_DELETED = 'plan.deleted';
public const PLAN_UPDATED = 'plan.updated';
public const PRICE_CREATED = 'price.created';
public const PRICE_DELETED = 'price.deleted';
public const PRICE_UPDATED = 'price.updated';
public const PRODUCT_CREATED = 'product.created';
public const PRODUCT_DELETED = 'product.deleted';
public const PRODUCT_UPDATED = 'product.updated';
public const PROMOTION_CODE_CREATED = 'promotion_code.created';
public const PROMOTION_CODE_UPDATED = 'promotion_code.updated';
public const QUOTE_ACCEPTED = 'quote.accepted';
public const QUOTE_CANCELED = 'quote.canceled';
public const QUOTE_CREATED = 'quote.created';
public const QUOTE_FINALIZED = 'quote.finalized';
public const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created';
public const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated';
public const RECIPIENT_CREATED = 'recipient.created';
public const RECIPIENT_DELETED = 'recipient.deleted';
public const RECIPIENT_UPDATED = 'recipient.updated';
public const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed';
public const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded';
public const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated';
public const REVIEW_CLOSED = 'review.closed';
public const REVIEW_OPENED = 'review.opened';
public const SETUP_INTENT_CANCELED = 'setup_intent.canceled';
public const SETUP_INTENT_CREATED = 'setup_intent.created';
public const SETUP_INTENT_REQUIRES_ACTION = 'setup_intent.requires_action';
public const SETUP_INTENT_SETUP_FAILED = 'setup_intent.setup_failed';
public const SETUP_INTENT_SUCCEEDED = 'setup_intent.succeeded';
public const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created';
public const SKU_CREATED = 'sku.created';
public const SKU_DELETED = 'sku.deleted';
public const SKU_UPDATED = 'sku.updated';
public const SOURCE_CANCELED = 'source.canceled';
public const SOURCE_CHARGEABLE = 'source.chargeable';
public const SOURCE_FAILED = 'source.failed';
public const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification';
public const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required';
public const SOURCE_TRANSACTION_CREATED = 'source.transaction.created';
public const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated';
public const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted';
public const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled';
public const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed';
public const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created';
public const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring';
public const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released';
public const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated';
public const TAX_RATE_CREATED = 'tax_rate.created';
public const TAX_RATE_UPDATED = 'tax_rate.updated';
public const TERMINAL_READER_ACTION_FAILED = 'terminal.reader.action_failed';
public const TERMINAL_READER_ACTION_SUCCEEDED = 'terminal.reader.action_succeeded';
public const TEST_HELPERS_TEST_CLOCK_ADVANCING = 'test_helpers.test_clock.advancing';
public const TEST_HELPERS_TEST_CLOCK_CREATED = 'test_helpers.test_clock.created';
public const TEST_HELPERS_TEST_CLOCK_DELETED = 'test_helpers.test_clock.deleted';
public const TEST_HELPERS_TEST_CLOCK_INTERNAL_FAILURE = 'test_helpers.test_clock.internal_failure';
public const TEST_HELPERS_TEST_CLOCK_READY = 'test_helpers.test_clock.ready';
public const TOPUP_CANCELED = 'topup.canceled';
public const TOPUP_CREATED = 'topup.created';
public const TOPUP_FAILED = 'topup.failed';
public const TOPUP_REVERSED = 'topup.reversed';
public const TOPUP_SUCCEEDED = 'topup.succeeded';
public const TRANSFER_CREATED = 'transfer.created';
public const TRANSFER_REVERSED = 'transfer.reversed';
public const TRANSFER_UPDATED = 'transfer.updated';
public const TREASURY_CREDIT_REVERSAL_CREATED = 'treasury.credit_reversal.created';
public const TREASURY_CREDIT_REVERSAL_POSTED = 'treasury.credit_reversal.posted';
public const TREASURY_DEBIT_REVERSAL_COMPLETED = 'treasury.debit_reversal.completed';
public const TREASURY_DEBIT_REVERSAL_CREATED = 'treasury.debit_reversal.created';
public const TREASURY_DEBIT_REVERSAL_INITIAL_CREDIT_GRANTED = 'treasury.debit_reversal.initial_credit_granted';
public const TREASURY_FINANCIAL_ACCOUNT_CLOSED = 'treasury.financial_account.closed';
public const TREASURY_FINANCIAL_ACCOUNT_CREATED = 'treasury.financial_account.created';
public const TREASURY_FINANCIAL_ACCOUNT_FEATURES_STATUS_UPDATED = 'treasury.financial_account.features_status_updated';
public const TREASURY_INBOUND_TRANSFER_CANCELED = 'treasury.inbound_transfer.canceled';
public const TREASURY_INBOUND_TRANSFER_CREATED = 'treasury.inbound_transfer.created';
public const TREASURY_INBOUND_TRANSFER_FAILED = 'treasury.inbound_transfer.failed';
public const TREASURY_INBOUND_TRANSFER_SUCCEEDED = 'treasury.inbound_transfer.succeeded';
public const TREASURY_OUTBOUND_PAYMENT_CANCELED = 'treasury.outbound_payment.canceled';
public const TREASURY_OUTBOUND_PAYMENT_CREATED = 'treasury.outbound_payment.created';
public const TREASURY_OUTBOUND_PAYMENT_EXPECTED_ARRIVAL_DATE_UPDATED = 'treasury.outbound_payment.expected_arrival_date_updated';
public const TREASURY_OUTBOUND_PAYMENT_FAILED = 'treasury.outbound_payment.failed';
public const TREASURY_OUTBOUND_PAYMENT_POSTED = 'treasury.outbound_payment.posted';
public const TREASURY_OUTBOUND_PAYMENT_RETURNED = 'treasury.outbound_payment.returned';
public const TREASURY_OUTBOUND_TRANSFER_CANCELED = 'treasury.outbound_transfer.canceled';
public const TREASURY_OUTBOUND_TRANSFER_CREATED = 'treasury.outbound_transfer.created';
public const TREASURY_OUTBOUND_TRANSFER_EXPECTED_ARRIVAL_DATE_UPDATED = 'treasury.outbound_transfer.expected_arrival_date_updated';
public const TREASURY_OUTBOUND_TRANSFER_FAILED = 'treasury.outbound_transfer.failed';
public const TREASURY_OUTBOUND_TRANSFER_POSTED = 'treasury.outbound_transfer.posted';
public const TREASURY_OUTBOUND_TRANSFER_RETURNED = 'treasury.outbound_transfer.returned';
public const TREASURY_RECEIVED_CREDIT_CREATED = 'treasury.received_credit.created';
public const TREASURY_RECEIVED_CREDIT_FAILED = 'treasury.received_credit.failed';
public const TREASURY_RECEIVED_CREDIT_SUCCEEDED = 'treasury.received_credit.succeeded';
public const TREASURY_RECEIVED_DEBIT_CREATED = 'treasury.received_debit.created';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;
@ -8,11 +8,17 @@ namespace Stripe\Exception;
abstract class ApiErrorException extends \Exception implements ExceptionInterface
{
protected $error;
protected $httpBody;
protected $httpHeaders;
protected $httpStatus;
protected $jsonBody;
protected $requestId;
protected $stripeCode;
/**
@ -67,7 +73,7 @@ abstract class ApiErrorException extends \Exception implements ExceptionInterfac
*
* @param null|\Stripe\ErrorObject $error
*/
public function setError($error)
public function setError($error) : void
{
$this->error = $error;
}
@ -87,7 +93,7 @@ abstract class ApiErrorException extends \Exception implements ExceptionInterfac
*
* @param null|string $httpBody
*/
public function setHttpBody($httpBody)
public function setHttpBody($httpBody) : void
{
$this->httpBody = $httpBody;
}
@ -107,7 +113,7 @@ abstract class ApiErrorException extends \Exception implements ExceptionInterfac
*
* @param null|array|\Stripe\Util\CaseInsensitiveArray $httpHeaders
*/
public function setHttpHeaders($httpHeaders)
public function setHttpHeaders($httpHeaders) : void
{
$this->httpHeaders = $httpHeaders;
}
@ -127,7 +133,7 @@ abstract class ApiErrorException extends \Exception implements ExceptionInterfac
*
* @param null|int $httpStatus
*/
public function setHttpStatus($httpStatus)
public function setHttpStatus($httpStatus) : void
{
$this->httpStatus = $httpStatus;
}
@ -147,7 +153,7 @@ abstract class ApiErrorException extends \Exception implements ExceptionInterfac
*
* @param null|array<string, mixed> $jsonBody
*/
public function setJsonBody($jsonBody)
public function setJsonBody($jsonBody) : void
{
$this->jsonBody = $jsonBody;
}
@ -167,7 +173,7 @@ abstract class ApiErrorException extends \Exception implements ExceptionInterfac
*
* @param null|string $requestId
*/
public function setRequestId($requestId)
public function setRequestId($requestId) : void
{
$this->requestId = $requestId;
}
@ -190,7 +196,7 @@ abstract class ApiErrorException extends \Exception implements ExceptionInterfac
*
* @param null|string $stripeCode
*/
public function setStripeCode($stripeCode)
public function setStripeCode($stripeCode) : void
{
$this->stripeCode = $stripeCode;
}
@ -202,15 +208,15 @@ abstract class ApiErrorException extends \Exception implements ExceptionInterfac
*/
public function __toString()
{
$statusStr = (null === $this->getHttpStatus()) ? '' : "(Status {$this->getHttpStatus()}) ";
$idStr = (null === $this->getRequestId()) ? '' : "(Request {$this->getRequestId()}) ";
$statusStr = ($this->getHttpStatus() === null) ? '' : "(Status {$this->getHttpStatus()}) ";
$idStr = ($this->getRequestId() === null) ? '' : "(Request {$this->getRequestId()}) ";
return "{$statusStr}{$idStr}{$this->getMessage()}";
}
protected function constructErrorObject()
{
if (null === $this->jsonBody || !\array_key_exists('error', $this->jsonBody)) {
if ($this->jsonBody === null || !\array_key_exists('error', $this->jsonBody)) {
return null;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;
@ -9,6 +9,7 @@ namespace Stripe\Exception;
class CardException extends ApiErrorException
{
protected $declineCode;
protected $stripeParam;
/**
@ -57,7 +58,7 @@ class CardException extends ApiErrorException
*
* @param null|string $declineCode
*/
public function setDeclineCode($declineCode)
public function setDeclineCode($declineCode) : void
{
$this->declineCode = $declineCode;
}
@ -77,7 +78,7 @@ class CardException extends ApiErrorException
*
* @param null|string $stripeParam
*/
public function setStripeParam($stripeParam)
public function setStripeParam($stripeParam) : void
{
$this->stripeParam = $stripeParam;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;
@ -53,7 +53,7 @@ class InvalidRequestException extends ApiErrorException
*
* @param null|string $stripeParam
*/
public function setStripeParam($stripeParam)
public function setStripeParam($stripeParam) : void
{
$this->stripeParam = $stripeParam;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception\OAuth;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception\OAuth;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception\OAuth;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception\OAuth;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception\OAuth;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception\OAuth;
@ -10,7 +10,7 @@ abstract class OAuthErrorException extends \Stripe\Exception\ApiErrorException
{
protected function constructErrorObject()
{
if (null === $this->jsonBody) {
if ($this->jsonBody === null) {
return null;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception\OAuth;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception\OAuth;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception\OAuth;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;
@ -9,6 +9,7 @@ namespace Stripe\Exception;
class SignatureVerificationException extends \Exception implements ExceptionInterface
{
protected $httpBody;
protected $sigHeader;
/**
@ -47,7 +48,7 @@ class SignatureVerificationException extends \Exception implements ExceptionInte
*
* @param null|string $httpBody
*/
public function setHttpBody($httpBody)
public function setHttpBody($httpBody) : void
{
$this->httpBody = $httpBody;
}
@ -67,7 +68,7 @@ class SignatureVerificationException extends \Exception implements ExceptionInte
*
* @param null|string $sigHeader
*/
public function setSigHeader($sigHeader)
public function setSigHeader($sigHeader) : void
{
$this->sigHeader = $sigHeader;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Exception;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -23,7 +23,7 @@ namespace Stripe;
*/
class ExchangeRate extends ApiResource
{
const OBJECT_NAME = 'exchange_rate';
public const OBJECT_NAME = 'exchange_rate';
use ApiOperations\All;
use ApiOperations\Retrieve;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -29,32 +29,46 @@ namespace Stripe;
*/
class File extends ApiResource
{
const OBJECT_NAME = 'file';
public const OBJECT_NAME = 'file';
use ApiOperations\All;
use ApiOperations\Retrieve;
const PURPOSE_ACCOUNT_REQUIREMENT = 'account_requirement';
const PURPOSE_ADDITIONAL_VERIFICATION = 'additional_verification';
const PURPOSE_BUSINESS_ICON = 'business_icon';
const PURPOSE_BUSINESS_LOGO = 'business_logo';
const PURPOSE_CUSTOMER_SIGNATURE = 'customer_signature';
const PURPOSE_DISPUTE_EVIDENCE = 'dispute_evidence';
const PURPOSE_DOCUMENT_PROVIDER_IDENTITY_DOCUMENT = 'document_provider_identity_document';
const PURPOSE_FINANCE_REPORT_RUN = 'finance_report_run';
const PURPOSE_IDENTITY_DOCUMENT = 'identity_document';
const PURPOSE_IDENTITY_DOCUMENT_DOWNLOADABLE = 'identity_document_downloadable';
const PURPOSE_PCI_DOCUMENT = 'pci_document';
const PURPOSE_SELFIE = 'selfie';
const PURPOSE_SIGMA_SCHEDULED_QUERY = 'sigma_scheduled_query';
const PURPOSE_TAX_DOCUMENT_USER_UPLOAD = 'tax_document_user_upload';
const PURPOSE_TERMINAL_READER_SPLASHSCREEN = 'terminal_reader_splashscreen';
public const PURPOSE_ACCOUNT_REQUIREMENT = 'account_requirement';
public const PURPOSE_ADDITIONAL_VERIFICATION = 'additional_verification';
public const PURPOSE_BUSINESS_ICON = 'business_icon';
public const PURPOSE_BUSINESS_LOGO = 'business_logo';
public const PURPOSE_CUSTOMER_SIGNATURE = 'customer_signature';
public const PURPOSE_DISPUTE_EVIDENCE = 'dispute_evidence';
public const PURPOSE_DOCUMENT_PROVIDER_IDENTITY_DOCUMENT = 'document_provider_identity_document';
public const PURPOSE_FINANCE_REPORT_RUN = 'finance_report_run';
public const PURPOSE_IDENTITY_DOCUMENT = 'identity_document';
public const PURPOSE_IDENTITY_DOCUMENT_DOWNLOADABLE = 'identity_document_downloadable';
public const PURPOSE_PCI_DOCUMENT = 'pci_document';
public const PURPOSE_SELFIE = 'selfie';
public const PURPOSE_SIGMA_SCHEDULED_QUERY = 'sigma_scheduled_query';
public const PURPOSE_TAX_DOCUMENT_USER_UPLOAD = 'tax_document_user_upload';
public const PURPOSE_TERMINAL_READER_SPLASHSCREEN = 'terminal_reader_splashscreen';
// This resource can have two different object names. In latter API
// versions, only `file` is used, but since stripe-php may be used with
// any API version, we need to support deserializing the older
// `file_upload` object into the same class.
const OBJECT_NAME_ALT = 'file_upload';
public const OBJECT_NAME_ALT = 'file_upload';
use ApiOperations\Create {
create as protected _create;
@ -71,7 +85,7 @@ class File extends ApiResource
public static function create($params = null, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
if (null === $opts->apiBase) {
if ($opts->apiBase === null) {
$opts->apiBase = Stripe::$apiUploadBase;
}
// Manually flatten params, otherwise curl's multipart encoder will

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -21,7 +21,7 @@ namespace Stripe;
*/
class FileLink extends ApiResource
{
const OBJECT_NAME = 'file_link';
public const OBJECT_NAME = 'file_link';
use ApiOperations\All;
use ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -28,26 +28,36 @@ namespace Stripe\FinancialConnections;
*/
class Account extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.account';
public const OBJECT_NAME = 'financial_connections.account';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Retrieve;
const CATEGORY_CASH = 'cash';
const CATEGORY_CREDIT = 'credit';
const CATEGORY_INVESTMENT = 'investment';
const CATEGORY_OTHER = 'other';
public const CATEGORY_CASH = 'cash';
const STATUS_ACTIVE = 'active';
const STATUS_DISCONNECTED = 'disconnected';
const STATUS_INACTIVE = 'inactive';
public const CATEGORY_CREDIT = 'credit';
const SUBCATEGORY_CHECKING = 'checking';
const SUBCATEGORY_CREDIT_CARD = 'credit_card';
const SUBCATEGORY_LINE_OF_CREDIT = 'line_of_credit';
const SUBCATEGORY_MORTGAGE = 'mortgage';
const SUBCATEGORY_OTHER = 'other';
const SUBCATEGORY_SAVINGS = 'savings';
public const CATEGORY_INVESTMENT = 'investment';
public const CATEGORY_OTHER = 'other';
public const STATUS_ACTIVE = 'active';
public const STATUS_DISCONNECTED = 'disconnected';
public const STATUS_INACTIVE = 'inactive';
public const SUBCATEGORY_CHECKING = 'checking';
public const SUBCATEGORY_CREDIT_CARD = 'credit_card';
public const SUBCATEGORY_LINE_OF_CREDIT = 'line_of_credit';
public const SUBCATEGORY_MORTGAGE = 'mortgage';
public const SUBCATEGORY_OTHER = 'other';
public const SUBCATEGORY_SAVINGS = 'savings';
/**
* @param null|array $params

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -16,5 +16,5 @@ namespace Stripe\FinancialConnections;
*/
class AccountOwner extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.account_owner';
public const OBJECT_NAME = 'financial_connections.account_owner';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -14,5 +14,5 @@ namespace Stripe\FinancialConnections;
*/
class AccountOwnership extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.account_ownership';
public const OBJECT_NAME = 'financial_connections.account_ownership';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -20,7 +20,7 @@ namespace Stripe\FinancialConnections;
*/
class Session extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.session';
public const OBJECT_NAME = 'financial_connections.session';
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -22,7 +22,7 @@ namespace Stripe;
*/
class FundingInstructions extends ApiResource
{
const OBJECT_NAME = 'funding_instructions';
public const OBJECT_NAME = 'funding_instructions';
const FUNDING_TYPE_BANK_TRANSFER = 'bank_transfer';
public const FUNDING_TYPE_BANK_TRANSFER = 'bank_transfer';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\HttpClient;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\HttpClient;
@ -80,7 +80,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
$this->closeCurlHandle();
}
public function initUserAgentInfo()
public function initUserAgentInfo() : void
{
$curlVersion = \curl_version();
$this->userAgentInfo = [
@ -110,7 +110,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
/**
* @param bool $enable
*/
public function setEnablePersistentConnections($enable)
public function setEnablePersistentConnections($enable) : void
{
$this->enablePersistentConnections = $enable;
}
@ -126,7 +126,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
/**
* @param bool $enable
*/
public function setEnableHttp2($enable)
public function setEnableHttp2($enable) : void
{
$this->enableHttp2 = $enable;
}
@ -154,17 +154,19 @@ class CurlClient implements ClientInterface, StreamingClientInterface
*
* @param null|callable $requestStatusCallback
*/
public function setRequestStatusCallback($requestStatusCallback)
public function setRequestStatusCallback($requestStatusCallback) : void
{
$this->requestStatusCallback = $requestStatusCallback;
}
// USER DEFINED TIMEOUTS
const DEFAULT_TIMEOUT = 80;
const DEFAULT_CONNECT_TIMEOUT = 30;
public const DEFAULT_TIMEOUT = 80;
public const DEFAULT_CONNECT_TIMEOUT = 30;
private $timeout = self::DEFAULT_TIMEOUT;
private $connectTimeout = self::DEFAULT_CONNECT_TIMEOUT;
public function setTimeout($seconds)
@ -209,7 +211,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
$params = Util\Util::objectsToIds($params);
if ('get' === $method) {
if ($method === 'get') {
if ($hasFile) {
throw new Exception\UnexpectedValueException(
'Issuing a GET request with a file parameter'
@ -220,10 +222,10 @@ class CurlClient implements ClientInterface, StreamingClientInterface
$encoded = Util\Util::encodeParameters($params);
$absUrl = "{$absUrl}?{$encoded}";
}
} elseif ('post' === $method) {
} elseif ($method === 'post') {
$opts[\CURLOPT_POST] = 1;
$opts[\CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::encodeParameters($params);
} elseif ('delete' === $method) {
} elseif ($method === 'delete') {
$opts[\CURLOPT_CUSTOMREQUEST] = 'DELETE';
if (\count($params) > 0) {
$encoded = Util\Util::encodeParameters($params);
@ -235,7 +237,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
// It is only safe to retry network failures on POST requests if we
// add an Idempotency-Key header
if (('post' === $method) && (Stripe::$maxNetworkRetries > 0)) {
if (($method === 'post') && (Stripe::$maxNetworkRetries > 0)) {
if (!$this->hasHeader($headers, 'Idempotency-Key')) {
$headers[] = 'Idempotency-Key: ' . $this->randomGenerator->uuid();
}
@ -329,7 +331,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
$writeCallback = null;
$writeCallbackWrapper = function ($curl, $data) use (&$writeCallback, &$rheaders, &$determineWriteCallback) {
if (null === $writeCallback) {
if ($writeCallback === null) {
$writeCallback = \call_user_func_array($determineWriteCallback, [$rheaders]);
}
@ -341,7 +343,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
private static function parseLineIntoHeaderArray($line, &$headers)
{
if (false === \strpos($line, ':')) {
if (\strpos($line, ':') === false) {
return \strlen($line);
}
list($key, $value) = \explode(':', \trim($line), 2);
@ -445,7 +447,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
\curl_setopt_array($this->curlHandle, $opts);
$result = \curl_exec($this->curlHandle);
$errno = \curl_errno($this->curlHandle);
if (0 !== $errno) {
if ($errno !== 0) {
$message = \curl_error($this->curlHandle);
}
if (!$this->getEnablePersistentConnections()) {
@ -468,7 +470,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
}
}
if (0 !== $errno) {
if ($errno !== 0) {
$this->handleCurlError($absUrl, $errno, $message, $numRetries);
}
@ -499,7 +501,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
\curl_setopt_array($this->curlHandle, $opts);
$rbody = \curl_exec($this->curlHandle);
if (false === $rbody) {
if ($rbody === false) {
$errno = \curl_errno($this->curlHandle);
$message = \curl_error($this->curlHandle);
} else {
@ -527,7 +529,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
}
}
if (false === $rbody) {
if ($rbody === false) {
$this->handleCurlError($absUrl, $errno, $message, $numRetries);
}
@ -542,7 +544,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
*
* @throws Exception\ApiConnectionException
*/
private function handleCurlError($url, $errno, $message, $numRetries)
private function handleCurlError($url, $errno, $message, $numRetries) : void
{
switch ($errno) {
case \CURLE_COULDNT_CONNECT:
@ -554,7 +556,6 @@ class CurlClient implements ClientInterface, StreamingClientInterface
. 'https://twitter.com/stripestatus, or';
break;
case \CURLE_SSL_CACERT:
case \CURLE_SSL_PEER_CERTIFICATE:
$msg = "Could not verify Stripe's SSL certificate. Please make sure "
@ -563,7 +564,6 @@ class CurlClient implements ClientInterface, StreamingClientInterface
. 'If this problem persists,';
break;
default:
$msg = 'Unexpected error communicating with Stripe. '
. 'If this problem persists,';
@ -598,30 +598,30 @@ class CurlClient implements ClientInterface, StreamingClientInterface
}
// Retry on timeout-related problems (either on open or read).
if (\CURLE_OPERATION_TIMEOUTED === $errno) {
if ($errno === \CURLE_OPERATION_TIMEOUTED) {
return true;
}
// Destination refused the connection, the connection was reset, or a
// variety of other connection failures. This could occur from a single
// saturated server, so retry in case it's intermittent.
if (\CURLE_COULDNT_CONNECT === $errno) {
if ($errno === \CURLE_COULDNT_CONNECT) {
return true;
}
// The API may ask us not to retry (eg; if doing so would be a no-op)
// or advise us to retry (eg; in cases of lock timeouts); we defer to that.
if (isset($rheaders['stripe-should-retry'])) {
if ('false' === $rheaders['stripe-should-retry']) {
if ($rheaders['stripe-should-retry'] === 'false') {
return false;
}
if ('true' === $rheaders['stripe-should-retry']) {
if ($rheaders['stripe-should-retry'] === 'true') {
return true;
}
}
// 409 Conflict
if (409 === $rcode) {
if ($rcode === 409) {
return true;
}
@ -674,7 +674,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
/**
* Initializes the curl handle. If already initialized, the handle is closed first.
*/
private function initCurlHandle()
private function initCurlHandle() : void
{
$this->closeCurlHandle();
$this->curlHandle = \curl_init();
@ -683,9 +683,9 @@ class CurlClient implements ClientInterface, StreamingClientInterface
/**
* Closes the curl handle if initialized. Do nothing if already closed.
*/
private function closeCurlHandle()
private function closeCurlHandle() : void
{
if (null !== $this->curlHandle) {
if ($this->curlHandle !== null) {
\curl_close($this->curlHandle);
$this->curlHandle = null;
}
@ -695,9 +695,9 @@ class CurlClient implements ClientInterface, StreamingClientInterface
* Resets the curl handle. If the handle is not already initialized, or if persistent
* connections are disabled, the handle is reinitialized instead.
*/
private function resetCurlHandle()
private function resetCurlHandle() : void
{
if (null !== $this->curlHandle && $this->getEnablePersistentConnections()) {
if ($this->curlHandle !== null && $this->getEnablePersistentConnections()) {
\curl_reset($this->curlHandle);
} else {
$this->initCurlHandle();
@ -729,7 +729,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
private function hasHeader($headers, $name)
{
foreach ($headers as $header) {
if (0 === \strncasecmp($header, "{$name}: ", \strlen($name) + 2)) {
if (\strncasecmp($header, "{$name}: ", \strlen($name) + 2) === 0) {
return true;
}
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\HttpClient;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -35,11 +35,12 @@ namespace Stripe\Identity;
*/
class VerificationReport extends \Stripe\ApiResource
{
const OBJECT_NAME = 'identity.verification_report';
public const OBJECT_NAME = 'identity.verification_report';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Retrieve;
const TYPE_DOCUMENT = 'document';
const TYPE_ID_NUMBER = 'id_number';
public const TYPE_DOCUMENT = 'document';
public const TYPE_ID_NUMBER = 'id_number';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -37,20 +37,24 @@ namespace Stripe\Identity;
*/
class VerificationSession extends \Stripe\ApiResource
{
const OBJECT_NAME = 'identity.verification_session';
public const OBJECT_NAME = 'identity.verification_session';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
use \Stripe\ApiOperations\Update;
const STATUS_CANCELED = 'canceled';
const STATUS_PROCESSING = 'processing';
const STATUS_REQUIRES_INPUT = 'requires_input';
const STATUS_VERIFIED = 'verified';
public const STATUS_CANCELED = 'canceled';
const TYPE_DOCUMENT = 'document';
const TYPE_ID_NUMBER = 'id_number';
public const STATUS_PROCESSING = 'processing';
public const STATUS_REQUIRES_INPUT = 'requires_input';
public const STATUS_VERIFIED = 'verified';
public const TYPE_DOCUMENT = 'document';
public const TYPE_ID_NUMBER = 'id_number';
/**
* @param null|array $params

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -120,7 +120,7 @@ namespace Stripe;
*/
class Invoice extends ApiResource
{
const OBJECT_NAME = 'invoice';
public const OBJECT_NAME = 'invoice';
use ApiOperations\All;
use ApiOperations\Create;
@ -130,28 +130,43 @@ class Invoice extends ApiResource
use ApiOperations\Search;
use ApiOperations\Update;
const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically';
const BILLING_SEND_INVOICE = 'send_invoice';
public const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically';
const BILLING_REASON_AUTOMATIC_PENDING_INVOICE_ITEM_INVOICE = 'automatic_pending_invoice_item_invoice';
const BILLING_REASON_MANUAL = 'manual';
const BILLING_REASON_QUOTE_ACCEPT = 'quote_accept';
const BILLING_REASON_SUBSCRIPTION = 'subscription';
const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create';
const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle';
const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold';
const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update';
const BILLING_REASON_UPCOMING = 'upcoming';
public const BILLING_SEND_INVOICE = 'send_invoice';
const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically';
const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice';
public const BILLING_REASON_AUTOMATIC_PENDING_INVOICE_ITEM_INVOICE = 'automatic_pending_invoice_item_invoice';
const STATUS_DELETED = 'deleted';
const STATUS_DRAFT = 'draft';
const STATUS_OPEN = 'open';
const STATUS_PAID = 'paid';
const STATUS_UNCOLLECTIBLE = 'uncollectible';
const STATUS_VOID = 'void';
public const BILLING_REASON_MANUAL = 'manual';
public const BILLING_REASON_QUOTE_ACCEPT = 'quote_accept';
public const BILLING_REASON_SUBSCRIPTION = 'subscription';
public const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create';
public const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle';
public const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold';
public const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update';
public const BILLING_REASON_UPCOMING = 'upcoming';
public const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically';
public const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice';
public const STATUS_DELETED = 'deleted';
public const STATUS_DRAFT = 'draft';
public const STATUS_OPEN = 'open';
public const STATUS_PAID = 'paid';
public const STATUS_UNCOLLECTIBLE = 'uncollectible';
public const STATUS_VOID = 'void';
/**
* @param null|array $params
@ -289,7 +304,7 @@ class Invoice extends ApiResource
return self::_searchResource($url, $params, $opts);
}
const PATH_LINES = '/lines';
public const PATH_LINES = '/lines';
/**
* @param string $id the ID of the invoice on which to retrieve the line items

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -40,7 +40,7 @@ namespace Stripe;
*/
class InvoiceItem extends ApiResource
{
const OBJECT_NAME = 'invoiceitem';
public const OBJECT_NAME = 'invoiceitem';
use ApiOperations\All;
use ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -32,5 +32,5 @@ namespace Stripe;
*/
class InvoiceLineItem extends ApiResource
{
const OBJECT_NAME = 'line_item';
public const OBJECT_NAME = 'line_item';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -41,7 +41,7 @@ namespace Stripe\Issuing;
*/
class Authorization extends \Stripe\ApiResource
{
const OBJECT_NAME = 'issuing.authorization';
public const OBJECT_NAME = 'issuing.authorization';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Retrieve;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -34,7 +34,7 @@ namespace Stripe\Issuing;
*/
class Card extends \Stripe\ApiResource
{
const OBJECT_NAME = 'issuing.card';
public const OBJECT_NAME = 'issuing.card';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe\Issuing;
@ -15,5 +15,5 @@ namespace Stripe\Issuing;
*/
class CardDetails extends \Stripe\ApiResource
{
const OBJECT_NAME = 'issuing.card_details';
public const OBJECT_NAME = 'issuing.card_details';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -30,7 +30,7 @@ namespace Stripe\Issuing;
*/
class Cardholder extends \Stripe\ApiResource
{
const OBJECT_NAME = 'issuing.cardholder';
public const OBJECT_NAME = 'issuing.cardholder';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -28,7 +28,7 @@ namespace Stripe\Issuing;
*/
class Dispute extends \Stripe\ApiResource
{
const OBJECT_NAME = 'issuing.dispute';
public const OBJECT_NAME = 'issuing.dispute';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -37,7 +37,7 @@ namespace Stripe\Issuing;
*/
class Transaction extends \Stripe\ApiResource
{
const OBJECT_NAME = 'issuing.transaction';
public const OBJECT_NAME = 'issuing.transaction';
use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Retrieve;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -22,5 +22,5 @@ namespace Stripe;
*/
class LineItem extends ApiResource
{
const OBJECT_NAME = 'item';
public const OBJECT_NAME = 'item';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -11,5 +11,5 @@ namespace Stripe;
*/
class LoginLink extends ApiResource
{
const OBJECT_NAME = 'login_link';
public const OBJECT_NAME = 'login_link';
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -21,7 +21,7 @@ namespace Stripe;
*/
class Mandate extends ApiResource
{
const OBJECT_NAME = 'mandate';
public const OBJECT_NAME = 'mandate';
use ApiOperations\Retrieve;
}

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe;
@ -81,10 +81,10 @@ abstract class OAuth
private static function _getClientId($params = null)
{
$clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null;
if (null === $clientId) {
if ($clientId === null) {
$clientId = Stripe::getClientId();
}
if (null === $clientId) {
if ($clientId === null) {
$msg = 'No client_id provided. (HINT: set your client_id using '
. '"Stripe::setClientId(<CLIENT-ID>)". You can find your client_ids '
. 'in your Stripe dashboard at '

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace Stripe;
@ -17,7 +17,7 @@ class OAuthErrorObject extends StripeObject
* @param null|array|string|Util\RequestOptions $opts
* @param bool $partial defaults to false
*/
public function refreshFrom($values, $opts, $partial = false)
public function refreshFrom($values, $opts, $partial = false) : void
{
// Unlike most other API resources, the API will omit attributes in
// error objects when they have a null value. We manually set default

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -60,7 +60,7 @@ namespace Stripe;
*/
class PaymentIntent extends ApiResource
{
const OBJECT_NAME = 'payment_intent';
public const OBJECT_NAME = 'payment_intent';
use ApiOperations\All;
use ApiOperations\Create;
@ -68,13 +68,19 @@ class PaymentIntent extends ApiResource
use ApiOperations\Search;
use ApiOperations\Update;
const STATUS_CANCELED = 'canceled';
const STATUS_PROCESSING = 'processing';
const STATUS_REQUIRES_ACTION = 'requires_action';
const STATUS_REQUIRES_CAPTURE = 'requires_capture';
const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation';
const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method';
const STATUS_SUCCEEDED = 'succeeded';
public const STATUS_CANCELED = 'canceled';
public const STATUS_PROCESSING = 'processing';
public const STATUS_REQUIRES_ACTION = 'requires_action';
public const STATUS_REQUIRES_CAPTURE = 'requires_capture';
public const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation';
public const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method';
public const STATUS_SUCCEEDED = 'succeeded';
/**
* @param null|array $params

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -48,26 +48,32 @@ namespace Stripe;
*/
class PaymentLink extends ApiResource
{
const OBJECT_NAME = 'payment_link';
public const OBJECT_NAME = 'payment_link';
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
const BILLING_ADDRESS_COLLECTION_AUTO = 'auto';
const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required';
public const BILLING_ADDRESS_COLLECTION_AUTO = 'auto';
const CUSTOMER_CREATION_ALWAYS = 'always';
const CUSTOMER_CREATION_IF_REQUIRED = 'if_required';
public const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required';
const PAYMENT_METHOD_COLLECTION_ALWAYS = 'always';
const PAYMENT_METHOD_COLLECTION_IF_REQUIRED = 'if_required';
public const CUSTOMER_CREATION_ALWAYS = 'always';
const SUBMIT_TYPE_AUTO = 'auto';
const SUBMIT_TYPE_BOOK = 'book';
const SUBMIT_TYPE_DONATE = 'donate';
const SUBMIT_TYPE_PAY = 'pay';
public const CUSTOMER_CREATION_IF_REQUIRED = 'if_required';
public const PAYMENT_METHOD_COLLECTION_ALWAYS = 'always';
public const PAYMENT_METHOD_COLLECTION_IF_REQUIRED = 'if_required';
public const SUBMIT_TYPE_AUTO = 'auto';
public const SUBMIT_TYPE_BOOK = 'book';
public const SUBMIT_TYPE_DONATE = 'donate';
public const SUBMIT_TYPE_PAY = 'pay';
/**
* @param string $id

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -58,7 +58,7 @@ namespace Stripe;
*/
class PaymentMethod extends ApiResource
{
const OBJECT_NAME = 'payment_method';
public const OBJECT_NAME = 'payment_method';
use ApiOperations\All;
use ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -39,40 +39,60 @@ namespace Stripe;
*/
class Payout extends ApiResource
{
const OBJECT_NAME = 'payout';
public const OBJECT_NAME = 'payout';
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
const FAILURE_ACCOUNT_CLOSED = 'account_closed';
const FAILURE_ACCOUNT_FROZEN = 'account_frozen';
const FAILURE_BANK_ACCOUNT_RESTRICTED = 'bank_account_restricted';
const FAILURE_BANK_OWNERSHIP_CHANGED = 'bank_ownership_changed';
const FAILURE_COULD_NOT_PROCESS = 'could_not_process';
const FAILURE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized';
const FAILURE_DECLINED = 'declined';
const FAILURE_INCORRECT_ACCOUNT_HOLDER_ADDRESS = 'incorrect_account_holder_address';
const FAILURE_INCORRECT_ACCOUNT_HOLDER_NAME = 'incorrect_account_holder_name';
const FAILURE_INCORRECT_ACCOUNT_HOLDER_TAX_ID = 'incorrect_account_holder_tax_id';
const FAILURE_INSUFFICIENT_FUNDS = 'insufficient_funds';
const FAILURE_INVALID_ACCOUNT_NUMBER = 'invalid_account_number';
const FAILURE_INVALID_CURRENCY = 'invalid_currency';
const FAILURE_NO_ACCOUNT = 'no_account';
const FAILURE_UNSUPPORTED_CARD = 'unsupported_card';
public const FAILURE_ACCOUNT_CLOSED = 'account_closed';
const METHOD_INSTANT = 'instant';
const METHOD_STANDARD = 'standard';
public const FAILURE_ACCOUNT_FROZEN = 'account_frozen';
const STATUS_CANCELED = 'canceled';
const STATUS_FAILED = 'failed';
const STATUS_IN_TRANSIT = 'in_transit';
const STATUS_PAID = 'paid';
const STATUS_PENDING = 'pending';
public const FAILURE_BANK_ACCOUNT_RESTRICTED = 'bank_account_restricted';
const TYPE_BANK_ACCOUNT = 'bank_account';
const TYPE_CARD = 'card';
public const FAILURE_BANK_OWNERSHIP_CHANGED = 'bank_ownership_changed';
public const FAILURE_COULD_NOT_PROCESS = 'could_not_process';
public const FAILURE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized';
public const FAILURE_DECLINED = 'declined';
public const FAILURE_INCORRECT_ACCOUNT_HOLDER_ADDRESS = 'incorrect_account_holder_address';
public const FAILURE_INCORRECT_ACCOUNT_HOLDER_NAME = 'incorrect_account_holder_name';
public const FAILURE_INCORRECT_ACCOUNT_HOLDER_TAX_ID = 'incorrect_account_holder_tax_id';
public const FAILURE_INSUFFICIENT_FUNDS = 'insufficient_funds';
public const FAILURE_INVALID_ACCOUNT_NUMBER = 'invalid_account_number';
public const FAILURE_INVALID_CURRENCY = 'invalid_currency';
public const FAILURE_NO_ACCOUNT = 'no_account';
public const FAILURE_UNSUPPORTED_CARD = 'unsupported_card';
public const METHOD_INSTANT = 'instant';
public const METHOD_STANDARD = 'standard';
public const STATUS_CANCELED = 'canceled';
public const STATUS_FAILED = 'failed';
public const STATUS_IN_TRANSIT = 'in_transit';
public const STATUS_PAID = 'paid';
public const STATUS_PENDING = 'pending';
public const TYPE_BANK_ACCOUNT = 'bank_account';
public const TYPE_CARD = 'card';
/**
* @param null|array $params

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -52,20 +52,24 @@ namespace Stripe;
*/
class Person extends ApiResource
{
const OBJECT_NAME = 'person';
public const OBJECT_NAME = 'person';
use ApiOperations\Delete;
use ApiOperations\Update;
const GENDER_FEMALE = 'female';
const GENDER_MALE = 'male';
public const GENDER_FEMALE = 'female';
const POLITICAL_EXPOSURE_EXISTING = 'existing';
const POLITICAL_EXPOSURE_NONE = 'none';
public const GENDER_MALE = 'male';
const VERIFICATION_STATUS_PENDING = 'pending';
const VERIFICATION_STATUS_UNVERIFIED = 'unverified';
const VERIFICATION_STATUS_VERIFIED = 'verified';
public const POLITICAL_EXPOSURE_EXISTING = 'existing';
public const POLITICAL_EXPOSURE_NONE = 'none';
public const VERIFICATION_STATUS_PENDING = 'pending';
public const VERIFICATION_STATUS_UNVERIFIED = 'unverified';
public const VERIFICATION_STATUS_VERIFIED = 'verified';
/**
* @return string the API URL for this Stripe account reversal
@ -97,7 +101,7 @@ class Person extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function retrieve($_id, $_opts = null)
public static function retrieve($_id, $_opts = null) : void
{
$msg = 'Persons cannot be retrieved without an account ID. Retrieve ' .
"a person using `Account::retrievePerson('account_id', " .
@ -113,7 +117,7 @@ class Person extends ApiResource
*
* @throws \Stripe\Exception\BadMethodCallException
*/
public static function update($_id, $_params = null, $_options = null)
public static function update($_id, $_params = null, $_options = null) : void
{
$msg = 'Persons cannot be updated without an account ID. Update ' .
"a person using `Account::updatePerson('account_id', " .

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -47,7 +47,7 @@ namespace Stripe;
*/
class Plan extends ApiResource
{
const OBJECT_NAME = 'plan';
public const OBJECT_NAME = 'plan';
use ApiOperations\All;
use ApiOperations\Create;

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
// File generated from our OpenAPI spec
@ -47,7 +47,7 @@ namespace Stripe;
*/
class Price extends ApiResource
{
const OBJECT_NAME = 'price';
public const OBJECT_NAME = 'price';
use ApiOperations\All;
use ApiOperations\Create;
@ -55,18 +55,23 @@ class Price extends ApiResource
use ApiOperations\Search;
use ApiOperations\Update;
const BILLING_SCHEME_PER_UNIT = 'per_unit';
const BILLING_SCHEME_TIERED = 'tiered';
public const BILLING_SCHEME_PER_UNIT = 'per_unit';
const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive';
const TAX_BEHAVIOR_INCLUSIVE = 'inclusive';
const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified';
public const BILLING_SCHEME_TIERED = 'tiered';
const TIERS_MODE_GRADUATED = 'graduated';
const TIERS_MODE_VOLUME = 'volume';
public const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive';
const TYPE_ONE_TIME = 'one_time';
const TYPE_RECURRING = 'recurring';
public const TAX_BEHAVIOR_INCLUSIVE = 'inclusive';
public const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified';
public const TIERS_MODE_GRADUATED = 'graduated';
public const TIERS_MODE_VOLUME = 'volume';
public const TYPE_ONE_TIME = 'one_time';
public const TYPE_RECURRING = 'recurring';
/**
* @param null|array $params

Some files were not shown because too many files have changed in this diff Show More