mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Bump stripe-php from 16.4.0 to 17.2.1
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -24,12 +24,12 @@ class AccountLink extends ApiResource
|
||||
* platform can redirect their user to in order to take them through the Connect
|
||||
* Onboarding flow.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{account: string, collect?: string, collection_options?: array{fields?: string, future_requirements?: string}, expand?: string[], refresh_url?: string, return_url?: string, type: string} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return AccountLink the created resource
|
||||
*
|
||||
* @return \Stripe\AccountLink the created resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -37,7 +37,7 @@ class AccountLink extends ApiResource
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Stripe;
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property string $account The ID of the account the AccountSession was created for
|
||||
* @property string $client_secret <p>The client secret of this AccountSession. Used on the client to set up secure access to the given <code>account</code>.</p><p>The client secret can be used to provide access to <code>account</code> from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.</p><p>Refer to our docs to <a href="https://stripe.com/docs/connect/get-started-connect-embedded-components">setup Connect embedded components</a> and learn about how <code>client_secret</code> should be handled.</p>
|
||||
* @property \Stripe\StripeObject $components
|
||||
* @property (object{account_management: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool}&StripeObject)}&StripeObject), account_onboarding: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool}&StripeObject)}&StripeObject), balances: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, edit_payout_schedule: bool, external_account_collection: bool, instant_payouts: bool, standard_payouts: bool}&StripeObject)}&StripeObject), documents: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject), financial_account: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool, send_money: bool, transfer_balance: bool}&StripeObject)}&StripeObject), financial_account_transactions: (object{enabled: bool, features: (object{card_spend_dispute_management: bool}&StripeObject)}&StripeObject), issuing_card: (object{enabled: bool, features: (object{card_management: bool, card_spend_dispute_management: bool, cardholder_management: bool, spend_control_management: bool}&StripeObject)}&StripeObject), issuing_cards_list: (object{enabled: bool, features: (object{card_management: bool, card_spend_dispute_management: bool, cardholder_management: bool, disable_stripe_user_authentication: bool, spend_control_management: bool}&StripeObject)}&StripeObject), notification_banner: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool}&StripeObject)}&StripeObject), payment_details: (object{enabled: bool, features: (object{capture_payments: bool, destination_on_behalf_of_charge_management: bool, dispute_management: bool, refund_management: bool}&StripeObject)}&StripeObject), payments: (object{enabled: bool, features: (object{capture_payments: bool, destination_on_behalf_of_charge_management: bool, dispute_management: bool, refund_management: bool}&StripeObject)}&StripeObject), payouts: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, edit_payout_schedule: bool, external_account_collection: bool, instant_payouts: bool, standard_payouts: bool}&StripeObject)}&StripeObject), payouts_list: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject), tax_registrations: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject), tax_settings: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject)}&StripeObject) $components
|
||||
* @property int $expires_at The timestamp at which this AccountSession will expire.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
*/
|
||||
@@ -28,12 +28,12 @@ class AccountSession extends ApiResource
|
||||
* Creates a AccountSession object that includes a single-use token that the
|
||||
* platform can use on their front-end to grant client-side API access.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{account: string, components: array{account_management?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, account_onboarding?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, balances?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, edit_payout_schedule?: bool, external_account_collection?: bool, instant_payouts?: bool, standard_payouts?: bool}}, documents?: array{enabled: bool, features?: array{}}, financial_account?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool, send_money?: bool, transfer_balance?: bool}}, financial_account_transactions?: array{enabled: bool, features?: array{card_spend_dispute_management?: bool}}, issuing_card?: array{enabled: bool, features?: array{card_management?: bool, card_spend_dispute_management?: bool, cardholder_management?: bool, spend_control_management?: bool}}, issuing_cards_list?: array{enabled: bool, features?: array{card_management?: bool, card_spend_dispute_management?: bool, cardholder_management?: bool, disable_stripe_user_authentication?: bool, spend_control_management?: bool}}, notification_banner?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, payment_details?: array{enabled: bool, features?: array{capture_payments?: bool, destination_on_behalf_of_charge_management?: bool, dispute_management?: bool, refund_management?: bool}}, payments?: array{enabled: bool, features?: array{capture_payments?: bool, destination_on_behalf_of_charge_management?: bool, dispute_management?: bool, refund_management?: bool}}, payouts?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, edit_payout_schedule?: bool, external_account_collection?: bool, instant_payouts?: bool, standard_payouts?: bool}}, payouts_list?: array{enabled: bool, features?: array{}}, tax_registrations?: array{enabled: bool, features?: array{}}, tax_settings?: array{enabled: bool, features?: array{}}}, expand?: string[]} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return AccountSession the created resource
|
||||
*
|
||||
* @return \Stripe\AccountSession the created resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -41,7 +41,7 @@ class AccountSession extends ApiResource
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
|
||||
@@ -13,9 +13,9 @@ trait All
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\Collection of ApiResources
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -13,9 +13,9 @@ trait Create
|
||||
* @param null|array $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static the created resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
|
||||
@@ -13,9 +13,9 @@ trait Delete
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static the deleted resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function delete($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -51,9 +51,9 @@ trait NestedResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
protected static function _createNestedResource($id, $nestedPath, $params = null, $options = null)
|
||||
{
|
||||
@@ -69,9 +69,9 @@ trait NestedResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
protected static function _retrieveNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null)
|
||||
{
|
||||
@@ -87,9 +87,9 @@ trait NestedResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
protected static function _updateNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null)
|
||||
{
|
||||
@@ -105,9 +105,9 @@ trait NestedResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
protected static function _deleteNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null)
|
||||
{
|
||||
@@ -122,9 +122,9 @@ trait NestedResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
protected static function _allNestedResources($id, $nestedPath, $params = null, $options = null)
|
||||
{
|
||||
|
||||
@@ -34,9 +34,9 @@ trait Request
|
||||
* @param string[] $usage names of tracked behaviors associated with this request
|
||||
* @param 'v1'|'v2' $apiMode
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return array tuple containing (the JSON response, $options)
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
protected function _request($method, $url, $params = [], $options = null, $usage = [], $apiMode = 'v1')
|
||||
{
|
||||
@@ -49,14 +49,14 @@ trait Request
|
||||
|
||||
/**
|
||||
* @param string $url URL for the request
|
||||
* @param class-string< \Stripe\SearchResult|\Stripe\Collection > $resultClass indicating what type of paginated result is returned
|
||||
* @param class-string< \Stripe\Collection|\Stripe\SearchResult > $resultClass indicating what type of paginated result is returned
|
||||
* @param null|array $params list of parameters for the request
|
||||
* @param null|array|string $options
|
||||
* @param string[] $usage names of tracked behaviors associated with this request
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\Collection|\Stripe\SearchResult
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
protected static function _requestPage($url, $resultClass, $params = null, $options = null, $usage = [])
|
||||
{
|
||||
@@ -64,7 +64,7 @@ trait Request
|
||||
|
||||
list($response, $opts) = static::_staticRequest('get', $url, $params, $options, $usage);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
if (!($obj instanceof $resultClass)) {
|
||||
if (!$obj instanceof $resultClass) {
|
||||
throw new \Stripe\Exception\UnexpectedValueException(
|
||||
'Expected type ' . $resultClass . ', got "' . \get_class($obj) . '" instead.'
|
||||
);
|
||||
@@ -99,9 +99,9 @@ trait Request
|
||||
* @param string[] $usage names of tracked behaviors associated with this request
|
||||
* @param 'v1'|'v2' $apiMode
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return array tuple containing (the JSON response, $options)
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
protected static function _staticRequest($method, $url, $params, $options, $usage = [], $apiMode = 'v1')
|
||||
{
|
||||
|
||||
@@ -15,9 +15,9 @@ trait Retrieve
|
||||
* or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\ApiOperations;
|
||||
|
||||
/**
|
||||
* Trait for searchable resources.
|
||||
*
|
||||
* This trait should only be applied to classes that derive from StripeObject.
|
||||
*/
|
||||
trait Search
|
||||
{
|
||||
/**
|
||||
* @param string $searchUrl
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\SearchResult of ApiResources
|
||||
*/
|
||||
protected static function _searchResource($searchUrl, $params = null, $opts = null)
|
||||
{
|
||||
return static::_requestPage($searchUrl, \Stripe\SearchResult::class, $params, $opts);
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,9 @@ trait SingletonRetrieve
|
||||
* @param null|array|string $opts the ID of the API resource to retrieve,
|
||||
* or an options array containing an `id` key
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($opts = null)
|
||||
{
|
||||
|
||||
@@ -15,9 +15,9 @@ trait Update
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static the updated resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -34,10 +34,10 @@ trait Update
|
||||
/**
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static the saved resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @deprecated The `save` method is deprecated and will be removed in a
|
||||
* future major version of the library. Use the static method `update`
|
||||
* on the resource instead.
|
||||
|
||||
@@ -122,17 +122,18 @@ class ApiRequestor
|
||||
* @param null|array $headers
|
||||
* @param 'v1'|'v2' $apiMode
|
||||
* @param string[] $usage
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
* @param null|int $maxNetworkRetries
|
||||
*
|
||||
* @return array tuple containing (ApiReponse, API key)
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function request($method, $url, $params = null, $headers = null, $apiMode = 'v1', $usage = [])
|
||||
public function request($method, $url, $params = null, $headers = null, $apiMode = 'v1', $usage = [], $maxNetworkRetries = null)
|
||||
{
|
||||
$params = $params ?: [];
|
||||
$headers = $headers ?: [];
|
||||
list($rbody, $rcode, $rheaders, $myApiKey) =
|
||||
$this->_requestRaw($method, $url, $params, $headers, $apiMode, $usage);
|
||||
list($rbody, $rcode, $rheaders, $myApiKey)
|
||||
= $this->_requestRaw($method, $url, $params, $headers, $apiMode, $usage, $maxNetworkRetries);
|
||||
$json = $this->_interpretResponse($rbody, $rcode, $rheaders, $apiMode);
|
||||
$resp = new ApiResponse($rbody, $rcode, $rheaders, $json);
|
||||
|
||||
@@ -147,15 +148,16 @@ class ApiRequestor
|
||||
* @param null|array $headers
|
||||
* @param 'v1'|'v2' $apiMode
|
||||
* @param string[] $usage
|
||||
* @param null|int $maxNetworkRetries
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function requestStream($method, $url, $readBodyChunkCallable, $params = null, $headers = null, $apiMode = 'v1', $usage = [])
|
||||
public function requestStream($method, $url, $readBodyChunkCallable, $params = null, $headers = null, $apiMode = 'v1', $usage = [], $maxNetworkRetries = null)
|
||||
{
|
||||
$params = $params ?: [];
|
||||
$headers = $headers ?: [];
|
||||
list($rbody, $rcode, $rheaders, $myApiKey) =
|
||||
$this->_requestRawStreaming($method, $url, $params, $headers, $apiMode, $usage, $readBodyChunkCallable);
|
||||
list($rbody, $rcode, $rheaders, $myApiKey)
|
||||
= $this->_requestRawStreaming($method, $url, $params, $headers, $apiMode, $usage, $readBodyChunkCallable, $maxNetworkRetries);
|
||||
if ($rcode >= 300) {
|
||||
$this->_interpretResponse($rbody, $rcode, $rheaders, $apiMode);
|
||||
}
|
||||
@@ -224,8 +226,8 @@ class ApiRequestor
|
||||
return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
|
||||
}
|
||||
|
||||
// fall through in generic 400 or 404, returns InvalidRequestException by default
|
||||
// no break
|
||||
// fall through in generic 400 or 404, returns InvalidRequestException by default
|
||||
// no break
|
||||
case 404:
|
||||
return Exception\InvalidRequestException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param);
|
||||
|
||||
@@ -266,7 +268,8 @@ class ApiRequestor
|
||||
switch ($type) {
|
||||
case 'idempotency_error':
|
||||
return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
|
||||
// The beginning of the section generated from our OpenAPI spec
|
||||
|
||||
// The beginning of the section generated from our OpenAPI spec
|
||||
case 'temporary_session_expired':
|
||||
return Exception\TemporarySessionExpiredException::factory(
|
||||
$msg,
|
||||
@@ -277,7 +280,7 @@ class ApiRequestor
|
||||
$code
|
||||
);
|
||||
|
||||
// The end of the section generated from our OpenAPI spec
|
||||
// The end of the section generated from our OpenAPI spec
|
||||
default:
|
||||
return self::_specificV1APIError($rbody, $rcode, $rheaders, $resp, $errorData);
|
||||
}
|
||||
@@ -436,14 +439,14 @@ class ApiRequestor
|
||||
// X-Stripe-Client-User-Agent header via the optional getUserAgentInfo()
|
||||
// method
|
||||
$clientUAInfo = null;
|
||||
if (\method_exists($this->httpClient(), 'getUserAgentInfo')) {
|
||||
$clientUAInfo = $this->httpClient()->getUserAgentInfo();
|
||||
if (\method_exists(self::httpClient(), 'getUserAgentInfo')) {
|
||||
$clientUAInfo = self::httpClient()->getUserAgentInfo();
|
||||
}
|
||||
|
||||
if ($params && \is_array($params)) {
|
||||
$optionKeysInParams = \array_filter(
|
||||
self::$OPTIONS_KEYS,
|
||||
function ($key) use ($params) {
|
||||
static function ($key) use ($params) {
|
||||
return \array_key_exists($key, $params);
|
||||
}
|
||||
);
|
||||
@@ -506,25 +509,33 @@ class ApiRequestor
|
||||
* @param array $headers
|
||||
* @param 'v1'|'v2' $apiMode
|
||||
* @param string[] $usage
|
||||
* @param null|int $maxNetworkRetries
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws Exception\AuthenticationException
|
||||
* @throws Exception\ApiConnectionException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function _requestRaw($method, $url, $params, $headers, $apiMode, $usage)
|
||||
private function _requestRaw($method, $url, $params, $headers, $apiMode, $usage, $maxNetworkRetries)
|
||||
{
|
||||
list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers, $apiMode);
|
||||
|
||||
// for some reason, PHP users will sometimes include null bytes in their paths, which leads to cryptic server 400s.
|
||||
// we'll be louder about this to help catch issues earlier.
|
||||
if (false !== \strpos($absUrl, "\0") || false !== \strpos($absUrl, '%00')) {
|
||||
throw new Exception\InvalidRequestException("URLs may not contain null bytes ('\\0'); double check any IDs you're including with the request.");
|
||||
}
|
||||
|
||||
$requestStartMs = Util\Util::currentTimeMillis();
|
||||
|
||||
list($rbody, $rcode, $rheaders) = $this->httpClient()->request(
|
||||
list($rbody, $rcode, $rheaders) = self::httpClient()->request(
|
||||
$method,
|
||||
$absUrl,
|
||||
$rawHeaders,
|
||||
$params,
|
||||
$hasFile,
|
||||
$apiMode
|
||||
$apiMode,
|
||||
$maxNetworkRetries
|
||||
);
|
||||
|
||||
if (
|
||||
@@ -550,25 +561,27 @@ class ApiRequestor
|
||||
* @param string[] $usage
|
||||
* @param callable $readBodyChunkCallable
|
||||
* @param 'v1'|'v2' $apiMode
|
||||
* @param int $maxNetworkRetries
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws Exception\AuthenticationException
|
||||
* @throws Exception\ApiConnectionException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function _requestRawStreaming($method, $url, $params, $headers, $apiMode, $usage, $readBodyChunkCallable)
|
||||
private function _requestRawStreaming($method, $url, $params, $headers, $apiMode, $usage, $readBodyChunkCallable, $maxNetworkRetries)
|
||||
{
|
||||
list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers, $apiMode);
|
||||
|
||||
$requestStartMs = Util\Util::currentTimeMillis();
|
||||
|
||||
list($rbody, $rcode, $rheaders) = $this->streamingHttpClient()->requestStream(
|
||||
list($rbody, $rcode, $rheaders) = self::streamingHttpClient()->requestStream(
|
||||
$method,
|
||||
$absUrl,
|
||||
$rawHeaders,
|
||||
$params,
|
||||
$hasFile,
|
||||
$readBodyChunkCallable
|
||||
$readBodyChunkCallable,
|
||||
$maxNetworkRetries
|
||||
);
|
||||
|
||||
if (
|
||||
@@ -588,9 +601,9 @@ class ApiRequestor
|
||||
/**
|
||||
* @param resource $resource
|
||||
*
|
||||
* @throws Exception\InvalidArgumentException
|
||||
*
|
||||
* @return \CURLFile|string
|
||||
*
|
||||
* @throws Exception\InvalidArgumentException
|
||||
*/
|
||||
private function _processResourceParam($resource)
|
||||
{
|
||||
@@ -617,10 +630,10 @@ class ApiRequestor
|
||||
* @param array $rheaders
|
||||
* @param 'v1'|'v2' $apiMode
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws Exception\UnexpectedValueException
|
||||
* @throws Exception\ApiErrorException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function _interpretResponse($rbody, $rcode, $rheaders, $apiMode)
|
||||
{
|
||||
@@ -673,7 +686,7 @@ class ApiRequestor
|
||||
/**
|
||||
* @return HttpClient\ClientInterface
|
||||
*/
|
||||
private function httpClient()
|
||||
public static function httpClient()
|
||||
{
|
||||
if (!self::$_httpClient) {
|
||||
self::$_httpClient = HttpClient\CurlClient::instance();
|
||||
@@ -685,7 +698,7 @@ class ApiRequestor
|
||||
/**
|
||||
* @return HttpClient\StreamingClientInterface
|
||||
*/
|
||||
private function streamingHttpClient()
|
||||
public static function streamingHttpClient()
|
||||
{
|
||||
if (!self::$_streamingHttpClient) {
|
||||
self::$_streamingHttpClient = HttpClient\CurlClient::instance();
|
||||
|
||||
@@ -11,7 +11,7 @@ abstract class ApiResource extends StripeObject
|
||||
use ApiOperations\Request;
|
||||
|
||||
/**
|
||||
* @return \Stripe\Util\Set A list of fields that can be their own type of
|
||||
* @return Util\Set A list of fields that can be their own type of
|
||||
* API resource (say a nested card under an account for example), and if
|
||||
* that resource is set, it should be transmitted to the API on a create or
|
||||
* update. Doing so is not the default behavior because API resources
|
||||
@@ -40,16 +40,16 @@ abstract class ApiResource extends StripeObject
|
||||
{
|
||||
parent::__set($k, $v);
|
||||
$v = $this->{$k};
|
||||
if ((static::getSavedNestedResources()->includes($k))
|
||||
if (static::getSavedNestedResources()->includes($k)
|
||||
&& ($v instanceof ApiResource)) {
|
||||
$v->saveWithParent = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception\ApiErrorException
|
||||
*
|
||||
* @return ApiResource the refreshed resource
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function refresh()
|
||||
{
|
||||
@@ -93,9 +93,9 @@ abstract class ApiResource extends StripeObject
|
||||
/**
|
||||
* @param null|string $id the ID of the resource
|
||||
*
|
||||
* @throws Exception\UnexpectedValueException if $id is null
|
||||
*
|
||||
* @return string the instance endpoint URL for the given class
|
||||
*
|
||||
* @throws Exception\UnexpectedValueException if $id is null
|
||||
*/
|
||||
public static function resourceUrl($id)
|
||||
{
|
||||
|
||||
@@ -18,12 +18,12 @@ class ApplePayDomain extends ApiResource
|
||||
/**
|
||||
* Create an apple pay domain.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{domain_name: string, expand?: string[]} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return ApplePayDomain the created resource
|
||||
*
|
||||
* @return \Stripe\ApplePayDomain the created resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -31,7 +31,7 @@ class ApplePayDomain extends ApiResource
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -43,9 +43,9 @@ class ApplePayDomain extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return ApplePayDomain the deleted resource
|
||||
*
|
||||
* @return \Stripe\ApplePayDomain the deleted resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function delete($params = null, $opts = null)
|
||||
{
|
||||
@@ -61,18 +61,18 @@ class ApplePayDomain extends ApiResource
|
||||
/**
|
||||
* List apple pay domains.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{domain_name?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<ApplePayDomain> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\ApplePayDomain> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,13 +81,13 @@ class ApplePayDomain extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return ApplePayDomain
|
||||
*
|
||||
* @return \Stripe\ApplePayDomain
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
|
||||
@@ -7,19 +7,19 @@ namespace Stripe;
|
||||
/**
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property string|\Stripe\Account $account ID of the Stripe account this fee was taken from.
|
||||
* @property Account|string $account ID of the Stripe account this fee was taken from.
|
||||
* @property int $amount Amount earned, in cents (or local equivalent).
|
||||
* @property int $amount_refunded Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued)
|
||||
* @property string|\Stripe\Application $application ID of the Connect application that earned the fee.
|
||||
* @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds).
|
||||
* @property string|\Stripe\Charge $charge ID of the charge that the application fee was taken from.
|
||||
* @property Application|string $application ID of the Connect application that earned the fee.
|
||||
* @property null|BalanceTransaction|string $balance_transaction Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds).
|
||||
* @property Charge|string $charge ID of the charge that the application fee was taken from.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property null|\Stripe\StripeObject $fee_source Polymorphic source of the application fee. Includes the ID of the object the application fee was created from.
|
||||
* @property null|(object{charge?: string, payout?: string, type: string}&StripeObject) $fee_source Polymorphic source of the application fee. Includes the ID of the object the application fee was created from.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|string|\Stripe\Charge $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the <code>destination</code> parameter.
|
||||
* @property null|Charge|string $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the <code>destination</code> parameter.
|
||||
* @property bool $refunded Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false.
|
||||
* @property \Stripe\Collection<\Stripe\ApplicationFeeRefund> $refunds A list of refunds that have been applied to the fee.
|
||||
* @property Collection<ApplicationFeeRefund> $refunds A list of refunds that have been applied to the fee.
|
||||
*/
|
||||
class ApplicationFee extends ApiResource
|
||||
{
|
||||
@@ -31,18 +31,18 @@ class ApplicationFee extends ApiResource
|
||||
* Returns a list of application fees you’ve previously collected. The application
|
||||
* fees are returned in sorted order, with the most recent fees appearing first.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<ApplicationFee> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\ApplicationFee> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,13 +52,13 @@ class ApplicationFee extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return ApplicationFee
|
||||
*
|
||||
* @return \Stripe\ApplicationFee
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
@@ -72,9 +72,9 @@ class ApplicationFee extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<ApplicationFeeRefund> the list of application fee refunds
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\ApplicationFeeRefund> the list of application fee refunds
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allRefunds($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -86,9 +86,9 @@ class ApplicationFee extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return ApplicationFeeRefund
|
||||
*
|
||||
* @return \Stripe\ApplicationFeeRefund
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function createRefund($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -101,9 +101,9 @@ class ApplicationFee extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return ApplicationFeeRefund
|
||||
*
|
||||
* @return \Stripe\ApplicationFeeRefund
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieveRefund($id, $refundId, $params = null, $opts = null)
|
||||
{
|
||||
@@ -116,9 +116,9 @@ class ApplicationFee extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return ApplicationFeeRefund
|
||||
*
|
||||
* @return \Stripe\ApplicationFeeRefund
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function updateRefund($id, $refundId, $params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -14,11 +14,11 @@ namespace Stripe;
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $amount Amount, in cents (or local equivalent).
|
||||
* @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance.
|
||||
* @property null|BalanceTransaction|string $balance_transaction Balance transaction that describes the impact on your account balance.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded.
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property ApplicationFee|string $fee ID of the application fee that was refunded.
|
||||
* @property null|StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
*/
|
||||
class ApplicationFeeRefund extends ApiResource
|
||||
{
|
||||
@@ -37,8 +37,8 @@ class ApplicationFeeRefund extends ApiResource
|
||||
$fee = $this['fee'];
|
||||
if (!$id) {
|
||||
throw new Exception\UnexpectedValueException(
|
||||
'Could not determine which URL to request: ' .
|
||||
"class instance has invalid ID: {$id}",
|
||||
'Could not determine which URL to request: '
|
||||
. "class instance has invalid ID: {$id}",
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Stripe\Apps;
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property string $name A name for the secret that's unique within the scope.
|
||||
* @property null|string $payload The plaintext secret value to be stored.
|
||||
* @property \Stripe\StripeObject $scope
|
||||
* @property (object{type: string, user?: string}&\Stripe\StripeObject) $scope
|
||||
*/
|
||||
class Secret extends \Stripe\ApiResource
|
||||
{
|
||||
@@ -32,12 +32,12 @@ class Secret extends \Stripe\ApiResource
|
||||
/**
|
||||
* Create or replace a secret in the secret store.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{expand?: string[], expires_at?: int, name: string, payload: string, scope: array{type: string, user?: string}} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Secret the created resource
|
||||
*
|
||||
* @return \Stripe\Apps\Secret the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -54,12 +54,12 @@ class Secret extends \Stripe\ApiResource
|
||||
/**
|
||||
* List all secrets stored on the given scope.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{ending_before?: string, expand?: string[], limit?: int, scope: array{type: string, user?: string}, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Secret> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Apps\Secret> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -72,9 +72,9 @@ class Secret extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Secret the deleted secret
|
||||
*
|
||||
* @return \Stripe\Apps\Secret the deleted secret
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function deleteWhere($params = null, $opts = null)
|
||||
{
|
||||
@@ -90,9 +90,9 @@ class Secret extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Secret the finded secret
|
||||
*
|
||||
* @return \Stripe\Apps\Secret the finded secret
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function find($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -18,12 +18,12 @@ namespace Stripe;
|
||||
* Related guide: <a href="https://stripe.com/docs/connect/account-balances">Understanding Connect account balances</a>
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property \Stripe\StripeObject[] $available Available funds that you can transfer or pay out automatically by Stripe or explicitly through the <a href="https://stripe.com/docs/api#transfers">Transfers API</a> or <a href="https://stripe.com/docs/api#payouts">Payouts API</a>. You can find the available balance for each currency and payment type in the <code>source_types</code> property.
|
||||
* @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected accounts where <a href="/api/accounts/object#account_object-controller-requirement_collection">account.controller.requirement_collection</a> is <code>application</code>, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the <code>source_types</code> property.
|
||||
* @property null|\Stripe\StripeObject[] $instant_available Funds that you can pay out using Instant Payouts.
|
||||
* @property null|\Stripe\StripeObject $issuing
|
||||
* @property (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $available Available funds that you can transfer or pay out automatically by Stripe or explicitly through the <a href="https://stripe.com/docs/api#transfers">Transfers API</a> or <a href="https://stripe.com/docs/api#payouts">Payouts API</a>. You can find the available balance for each currency and payment type in the <code>source_types</code> property.
|
||||
* @property null|(object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $connect_reserved Funds held due to negative balances on connected accounts where <a href="/api/accounts/object#account_object-controller-requirement_collection">account.controller.requirement_collection</a> is <code>application</code>, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the <code>source_types</code> property.
|
||||
* @property null|(object{amount: int, currency: string, net_available?: (object{amount: int, destination: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[], source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $instant_available Funds that you can pay out using Instant Payouts.
|
||||
* @property null|(object{available: (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[]}&StripeObject) $issuing
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject[] $pending Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the <code>source_types</code> property.
|
||||
* @property (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $pending Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the <code>source_types</code> property.
|
||||
*/
|
||||
class Balance extends SingletonApiResource
|
||||
{
|
||||
@@ -37,13 +37,13 @@ class Balance extends SingletonApiResource
|
||||
*
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Balance
|
||||
*
|
||||
* @return \Stripe\Balance
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static(null, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@ namespace Stripe;
|
||||
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
|
||||
* @property null|float $exchange_rate If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the <code>amount</code> in currency A, multipled by the <code>exchange_rate</code>, equals the <code>amount</code> in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's <code>amount</code> is <code>1000</code> and <code>currency</code> is <code>eur</code>. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's <code>amount</code> is <code>1234</code>, its <code>currency</code> is <code>usd</code>, and the <code>exchange_rate</code> is <code>1.234</code>.
|
||||
* @property int $fee Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed.
|
||||
* @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction.
|
||||
* @property ((object{amount: int, application: null|string, currency: string, description: null|string, type: string}&StripeObject))[] $fee_details Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction.
|
||||
* @property int $net Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by <code>amount</code> - <code>fee</code>
|
||||
* @property string $reporting_category Learn more about how <a href="https://stripe.com/docs/reports/reporting-categories">reporting categories</a> can help you understand balance transactions from an accounting perspective.
|
||||
* @property null|string|\Stripe\ApplicationFee|\Stripe\ApplicationFeeRefund|\Stripe\Charge|\Stripe\ConnectCollectionTransfer|\Stripe\CustomerCashBalanceTransaction|\Stripe\Dispute|\Stripe\Issuing\Authorization|\Stripe\Issuing\Dispute|\Stripe\Issuing\Transaction|\Stripe\Payout|\Stripe\Refund|\Stripe\ReserveTransaction|\Stripe\TaxDeductedAtSource|\Stripe\Topup|\Stripe\Transfer|\Stripe\TransferReversal $source This transaction relates to the Stripe object.
|
||||
* @property null|ApplicationFee|ApplicationFeeRefund|Charge|ConnectCollectionTransfer|CustomerCashBalanceTransaction|Dispute|Issuing\Authorization|Issuing\Dispute|Issuing\Transaction|Payout|Refund|ReserveTransaction|string|TaxDeductedAtSource|Topup|Transfer|TransferReversal $source This transaction relates to the Stripe object.
|
||||
* @property string $status The transaction's net funds status in the Stripe balance, which are either <code>available</code> or <code>pending</code>.
|
||||
* @property string $type Transaction type: <code>adjustment</code>, <code>advance</code>, <code>advance_funding</code>, <code>anticipation_repayment</code>, <code>application_fee</code>, <code>application_fee_refund</code>, <code>charge</code>, <code>climate_order_purchase</code>, <code>climate_order_refund</code>, <code>connect_collection_transfer</code>, <code>contribution</code>, <code>issuing_authorization_hold</code>, <code>issuing_authorization_release</code>, <code>issuing_dispute</code>, <code>issuing_transaction</code>, <code>obligation_outbound</code>, <code>obligation_reversal_inbound</code>, <code>payment</code>, <code>payment_failure_refund</code>, <code>payment_network_reserve_hold</code>, <code>payment_network_reserve_release</code>, <code>payment_refund</code>, <code>payment_reversal</code>, <code>payment_unreconciled</code>, <code>payout</code>, <code>payout_cancel</code>, <code>payout_failure</code>, <code>payout_minimum_balance_hold</code>, <code>payout_minimum_balance_release</code>, <code>refund</code>, <code>refund_failure</code>, <code>reserve_transaction</code>, <code>reserved_funds</code>, <code>stripe_fee</code>, <code>stripe_fx_fee</code>, <code>tax_fee</code>, <code>topup</code>, <code>topup_reversal</code>, <code>transfer</code>, <code>transfer_cancel</code>, <code>transfer_failure</code>, or <code>transfer_refund</code>. Learn more about <a href="https://stripe.com/docs/reports/balance-transaction-types">balance transaction types and what they represent</a>. To classify transactions for accounting purposes, consider <code>reporting_category</code> instead.
|
||||
* @property string $type Transaction type: <code>adjustment</code>, <code>advance</code>, <code>advance_funding</code>, <code>anticipation_repayment</code>, <code>application_fee</code>, <code>application_fee_refund</code>, <code>charge</code>, <code>climate_order_purchase</code>, <code>climate_order_refund</code>, <code>connect_collection_transfer</code>, <code>contribution</code>, <code>issuing_authorization_hold</code>, <code>issuing_authorization_release</code>, <code>issuing_dispute</code>, <code>issuing_transaction</code>, <code>obligation_outbound</code>, <code>obligation_reversal_inbound</code>, <code>payment</code>, <code>payment_failure_refund</code>, <code>payment_network_reserve_hold</code>, <code>payment_network_reserve_release</code>, <code>payment_refund</code>, <code>payment_reversal</code>, <code>payment_unreconciled</code>, <code>payout</code>, <code>payout_cancel</code>, <code>payout_failure</code>, <code>payout_minimum_balance_hold</code>, <code>payout_minimum_balance_release</code>, <code>refund</code>, <code>refund_failure</code>, <code>reserve_transaction</code>, <code>reserved_funds</code>, <code>stripe_fee</code>, <code>stripe_fx_fee</code>, <code>stripe_balance_payment_debit</code>, <code>stripe_balance_payment_debit_reversal</code>, <code>tax_fee</code>, <code>topup</code>, <code>topup_reversal</code>, <code>transfer</code>, <code>transfer_cancel</code>, <code>transfer_failure</code>, or <code>transfer_refund</code>. Learn more about <a href="https://stripe.com/docs/reports/balance-transaction-types">balance transaction types and what they represent</a>. To classify transactions for accounting purposes, consider <code>reporting_category</code> instead.
|
||||
*/
|
||||
class BalanceTransaction extends ApiResource
|
||||
{
|
||||
@@ -63,6 +63,8 @@ class BalanceTransaction extends ApiResource
|
||||
const TYPE_REFUND_FAILURE = 'refund_failure';
|
||||
const TYPE_RESERVED_FUNDS = 'reserved_funds';
|
||||
const TYPE_RESERVE_TRANSACTION = 'reserve_transaction';
|
||||
const TYPE_STRIPE_BALANCE_PAYMENT_DEBIT = 'stripe_balance_payment_debit';
|
||||
const TYPE_STRIPE_BALANCE_PAYMENT_DEBIT_REVERSAL = 'stripe_balance_payment_debit_reversal';
|
||||
const TYPE_STRIPE_FEE = 'stripe_fee';
|
||||
const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee';
|
||||
const TYPE_TAX_FEE = 'tax_fee';
|
||||
@@ -81,18 +83,18 @@ class BalanceTransaction extends ApiResource
|
||||
* Note that this endpoint was previously called “Balance history” and used the
|
||||
* path <code>/v1/balance/history</code>.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{created?: array|int, currency?: string, ending_before?: string, expand?: string[], limit?: int, payout?: string, source?: string, starting_after?: string, type?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<BalanceTransaction> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\BalanceTransaction> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,13 +106,13 @@ class BalanceTransaction extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return BalanceTransaction
|
||||
*
|
||||
* @return \Stripe\BalanceTransaction
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Stripe;
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|string|\Stripe\Account $account The ID of the account that the bank account is associated with.
|
||||
* @property null|Account|string $account The account this bank account belongs to. Only applicable on Accounts (not customers or recipients) This property is only available when returned as an <a href="/api/external_account_bank_accounts/object">External Account</a> where <a href="/api/accounts/object#account_object-controller-is_controller">controller.is_controller</a> is <code>true</code>.
|
||||
* @property null|string $account_holder_name The name of the person or business that owns the bank account.
|
||||
* @property null|string $account_holder_type The type of entity that holds the account. This can be either <code>individual</code> or <code>company</code>.
|
||||
* @property null|string $account_type The bank account type. This can only be <code>checking</code> or <code>savings</code> in most countries. In Japan, this can only be <code>futsu</code> or <code>toza</code>.
|
||||
@@ -23,13 +23,13 @@ namespace Stripe;
|
||||
* @property null|string $bank_name Name of the bank associated with the routing number (e.g., <code>WELLS FARGO</code>).
|
||||
* @property string $country Two-letter ISO code representing the country the bank account is located in.
|
||||
* @property string $currency Three-letter <a href="https://stripe.com/docs/payouts">ISO code for the currency</a> paid out to the bank account.
|
||||
* @property null|string|\Stripe\Customer $customer The ID of the customer that the bank account is associated with.
|
||||
* @property null|Customer|string $customer The ID of the customer that the bank account is associated with.
|
||||
* @property null|bool $default_for_currency Whether this bank account is the default external account for its currency.
|
||||
* @property null|string $fingerprint Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
|
||||
* @property null|\Stripe\StripeObject $future_requirements Information about the <a href="https://stripe.com/docs/connect/custom-accounts/future-requirements">upcoming new requirements for the bank account</a>, including what information needs to be collected, and by when.
|
||||
* @property null|(object{currently_due: null|string[], errors: null|(object{code: string, reason: string, requirement: string}&StripeObject)[], past_due: null|string[], pending_verification: null|string[]}&StripeObject) $future_requirements Information about the <a href="https://stripe.com/docs/connect/custom-accounts/future-requirements">upcoming new requirements for the bank account</a>, including what information needs to be collected, and by when.
|
||||
* @property string $last4 The last four digits of the bank account number.
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|\Stripe\StripeObject $requirements Information about the requirements for the bank account, including what information needs to be collected.
|
||||
* @property null|StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|(object{currently_due: null|string[], errors: null|(object{code: string, reason: string, requirement: string}&StripeObject)[], past_due: null|string[], pending_verification: null|string[]}&StripeObject) $requirements Information about the requirements for the bank account, including what information needs to be collected.
|
||||
* @property null|string $routing_number The routing transit number for the bank account.
|
||||
* @property string $status <p>For bank accounts, possible values are <code>new</code>, <code>validated</code>, <code>verified</code>, <code>verification_failed</code>, or <code>errored</code>. A bank account that hasn't had any activity or validation performed is <code>new</code>. If Stripe can determine that the bank account exists, its status will be <code>validated</code>. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be <code>verified</code>. If the verification failed for any reason, such as microdeposit failure, the status will be <code>verification_failed</code>. If a payout sent to this bank account fails, we'll set the status to <code>errored</code> and will not continue to send <a href="https://stripe.com/docs/payouts#payout-schedule">scheduled payouts</a> until the bank details are updated.</p><p>For external accounts, possible values are <code>new</code>, <code>errored</code> and <code>verification_failed</code>. If a payout fails, the status is set to <code>errored</code> and scheduled payouts are stopped until account details are updated. In the US and India, if we can't <a href="https://support.stripe.com/questions/bank-account-ownership-verification">verify the owner of the bank account</a>, we'll set the status to <code>verification_failed</code>. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.</p>
|
||||
*/
|
||||
@@ -43,9 +43,9 @@ class BankAccount extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return BankAccount the deleted resource
|
||||
*
|
||||
* @return \Stripe\BankAccount the deleted resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function delete($params = null, $opts = null)
|
||||
{
|
||||
@@ -98,15 +98,15 @@ class BankAccount extends ApiResource
|
||||
* @param array|string $_id
|
||||
* @param null|array|string $_opts
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
* @throws Exception\BadMethodCallException
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = 'Bank accounts cannot be retrieved without a customer ID or ' .
|
||||
'an account ID. Retrieve a bank account using ' .
|
||||
"`Customer::retrieveSource('customer_id', " .
|
||||
"'bank_account_id')` or `Account::retrieveExternalAccount(" .
|
||||
"'account_id', 'bank_account_id')`.";
|
||||
$msg = 'Bank accounts cannot be retrieved without a customer ID or '
|
||||
. 'an account ID. Retrieve a bank account using '
|
||||
. "`Customer::retrieveSource('customer_id', "
|
||||
. "'bank_account_id')` or `Account::retrieveExternalAccount("
|
||||
. "'account_id', 'bank_account_id')`.";
|
||||
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
@@ -116,15 +116,15 @@ class BankAccount extends ApiResource
|
||||
* @param null|array $_params
|
||||
* @param null|array|string $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
* @throws Exception\BadMethodCallException
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = 'Bank accounts cannot be updated without a customer ID or an ' .
|
||||
'account ID. Update a bank account using ' .
|
||||
"`Customer::updateSource('customer_id', 'bank_account_id', " .
|
||||
'$updateParams)` or `Account::updateExternalAccount(' .
|
||||
"'account_id', 'bank_account_id', \$updateParams)`.";
|
||||
$msg = 'Bank accounts cannot be updated without a customer ID or an '
|
||||
. 'account ID. Update a bank account using '
|
||||
. "`Customer::updateSource('customer_id', 'bank_account_id', "
|
||||
. '$updateParams)` or `Account::updateExternalAccount('
|
||||
. "'account_id', 'bank_account_id', \$updateParams)`.";
|
||||
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
@@ -132,10 +132,10 @@ class BankAccount extends ApiResource
|
||||
/**
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static the saved resource
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @deprecated The `save` method is deprecated and will be removed in a
|
||||
* future major version of the library. Use the static method `update`
|
||||
* on the resource instead.
|
||||
@@ -156,9 +156,9 @@ class BankAccount extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return BankAccount the verified bank account
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function verify($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
/** @var string default base URL for Stripe's Meter Events API */
|
||||
const DEFAULT_METER_EVENTS_BASE = 'https://meter-events.stripe.com';
|
||||
|
||||
/** @var array<string, null|string> */
|
||||
/** @var array<string, null|int|string> */
|
||||
const DEFAULT_CONFIG = [
|
||||
'api_key' => null,
|
||||
'app_info' => null,
|
||||
@@ -30,6 +30,8 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
'connect_base' => self::DEFAULT_CONNECT_BASE,
|
||||
'files_base' => self::DEFAULT_FILES_BASE,
|
||||
'meter_events_base' => self::DEFAULT_METER_EVENTS_BASE,
|
||||
// inherit from global
|
||||
'max_network_retries' => null,
|
||||
];
|
||||
|
||||
/** @var array<string, mixed> */
|
||||
@@ -56,6 +58,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
* will automatically use the {@code Stripe-Context} header with that ID.
|
||||
* - stripe_version (null|string): a Stripe API version. If set, all requests sent by the client
|
||||
* will include the {@code Stripe-Version} header with that API version.
|
||||
* - max_network_retries (null|int): the number of times this client should retry API failures; defaults to 0.
|
||||
*
|
||||
* The following configuration settings are also available, though setting these should rarely be necessary
|
||||
* (only useful if you want to send requests to a mock server like stripe-mock):
|
||||
@@ -77,7 +80,12 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
if (\is_string($config)) {
|
||||
$config = ['api_key' => $config];
|
||||
} elseif (!\is_array($config)) {
|
||||
throw new \Stripe\Exception\InvalidArgumentException('$config must be a string or an array');
|
||||
throw new Exception\InvalidArgumentException('$config must be a string or an array');
|
||||
}
|
||||
|
||||
if (!\array_key_exists('max_network_retries', $config)) {
|
||||
// if no value is passed, inherit the global value at the time of client creation
|
||||
$config['max_network_retries'] = Stripe::getMaxNetworkRetries();
|
||||
}
|
||||
|
||||
$config = \array_merge(self::DEFAULT_CONFIG, $config);
|
||||
@@ -89,6 +97,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
'stripe_account' => $config['stripe_account'],
|
||||
'stripe_context' => $config['stripe_context'],
|
||||
'stripe_version' => $config['stripe_version'],
|
||||
'max_network_retries' => $config['max_network_retries'],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -152,6 +161,16 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
return $this->config['meter_events_base'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the configured number of retries.
|
||||
*
|
||||
* @return int the number of times this client will retry failed requests
|
||||
*/
|
||||
public function getMaxNetworkRetries()
|
||||
{
|
||||
return $this->config['max_network_retries'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the app info for this client.
|
||||
*
|
||||
@@ -170,24 +189,24 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
* @param array $params the parameters of the request
|
||||
* @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request
|
||||
*
|
||||
* @return \Stripe\StripeObject the object returned by Stripe's API
|
||||
* @return StripeObject the object returned by Stripe's API
|
||||
*/
|
||||
public function request($method, $path, $params, $opts)
|
||||
{
|
||||
$defaultRequestOpts = $this->defaultOpts;
|
||||
$apiMode = \Stripe\Util\Util::getApiMode($path);
|
||||
$apiMode = Util::getApiMode($path);
|
||||
|
||||
$opts = $defaultRequestOpts->merge($opts, true);
|
||||
|
||||
$baseUrl = $opts->apiBase ?: $this->getApiBase();
|
||||
$requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl, $this->getAppInfo());
|
||||
list($response, $opts->apiKey) = $requestor->request($method, $path, $params, $opts->headers, $apiMode, ['stripe_client']);
|
||||
$requestor = new ApiRequestor($this->apiKeyForRequest($opts), $baseUrl, $this->getAppInfo());
|
||||
list($response, $opts->apiKey) = $requestor->request($method, $path, $params, $opts->headers, $apiMode, ['stripe_client'], $opts->maxNetworkRetries);
|
||||
$opts->discardNonPersistentHeaders();
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts, $apiMode);
|
||||
$obj = Util::convertToStripeObject($response->json, $opts, $apiMode);
|
||||
if (\is_array($obj)) {
|
||||
// Edge case for v2 endpoints that return empty/void response
|
||||
// Example: client->v2->billing->meterEventStream->create
|
||||
$obj = new \Stripe\StripeObject();
|
||||
$obj = new StripeObject();
|
||||
}
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
@@ -203,15 +222,16 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
* @param string $path the path of the request
|
||||
* @param null|array $params the parameters of the request
|
||||
* @param array $opts the special modifiers of the request
|
||||
* @param null|int $maxNetworkRetries
|
||||
*
|
||||
* @return \Stripe\ApiResponse
|
||||
* @return ApiResponse
|
||||
*/
|
||||
public function rawRequest($method, $path, $params = null, $opts = [])
|
||||
public function rawRequest($method, $path, $params = null, $opts = [], $maxNetworkRetries = null)
|
||||
{
|
||||
if ('post' !== $method && null !== $params) {
|
||||
throw new Exception\InvalidArgumentException('Error: rawRequest only supports $params on post requests. Please pass null and add your parameters to $path');
|
||||
}
|
||||
$apiMode = \Stripe\Util\Util::getApiMode($path);
|
||||
$apiMode = Util::getApiMode($path);
|
||||
$headers = [];
|
||||
if (\is_array($opts) && \array_key_exists('headers', $opts)) {
|
||||
$headers = $opts['headers'] ?: [];
|
||||
@@ -229,8 +249,8 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
// Concatenate $headers to $opts->headers, removing duplicates.
|
||||
$opts->headers = \array_merge($opts->headers, $headers);
|
||||
$baseUrl = $opts->apiBase ?: $this->getApiBase();
|
||||
$requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl);
|
||||
list($response) = $requestor->request($method, $path, $params, $opts->headers, $apiMode, ['raw_request']);
|
||||
$requestor = new ApiRequestor($this->apiKeyForRequest($opts), $baseUrl);
|
||||
list($response) = $requestor->request($method, $path, $params, $opts->headers, $apiMode, ['raw_request'], $maxNetworkRetries);
|
||||
|
||||
return $response;
|
||||
}
|
||||
@@ -251,8 +271,8 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
{
|
||||
$opts = $this->defaultOpts->merge($opts, true);
|
||||
$baseUrl = $opts->apiBase ?: $this->getApiBase();
|
||||
$requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl, $this->getAppInfo());
|
||||
$apiMode = \Stripe\Util\Util::getApiMode($path);
|
||||
$requestor = new ApiRequestor($this->apiKeyForRequest($opts), $baseUrl, $this->getAppInfo());
|
||||
$apiMode = Util::getApiMode($path);
|
||||
list($response, $opts->apiKey) = $requestor->requestStream($method, $path, $readBodyChunkCallable, $params, $opts->headers, $apiMode, ['stripe_client']);
|
||||
}
|
||||
|
||||
@@ -264,26 +284,26 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
* @param array $params the parameters of the request
|
||||
* @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request
|
||||
*
|
||||
* @return \Stripe\Collection|\Stripe\V2\Collection of ApiResources
|
||||
* @return Collection|V2\Collection of ApiResources
|
||||
*/
|
||||
public function requestCollection($method, $path, $params, $opts)
|
||||
{
|
||||
$obj = $this->request($method, $path, $params, $opts);
|
||||
$apiMode = \Stripe\Util\Util::getApiMode($path);
|
||||
$apiMode = Util::getApiMode($path);
|
||||
if ('v1' === $apiMode) {
|
||||
if (!($obj instanceof \Stripe\Collection)) {
|
||||
if (!$obj instanceof Collection) {
|
||||
$received_class = \get_class($obj);
|
||||
$msg = "Expected to receive `Stripe\\Collection` object from Stripe API. Instead received `{$received_class}`.";
|
||||
|
||||
throw new \Stripe\Exception\UnexpectedValueException($msg);
|
||||
throw new Exception\UnexpectedValueException($msg);
|
||||
}
|
||||
$obj->setFilters($params);
|
||||
} else {
|
||||
if (!($obj instanceof \Stripe\V2\Collection)) {
|
||||
if (!$obj instanceof V2\Collection) {
|
||||
$received_class = \get_class($obj);
|
||||
$msg = "Expected to receive `Stripe\\V2\\Collection` object from Stripe API. Instead received `{$received_class}`.";
|
||||
|
||||
throw new \Stripe\Exception\UnexpectedValueException($msg);
|
||||
throw new Exception\UnexpectedValueException($msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,16 +318,16 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
* @param array $params the parameters of the request
|
||||
* @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request
|
||||
*
|
||||
* @return \Stripe\SearchResult of ApiResources
|
||||
* @return SearchResult of ApiResources
|
||||
*/
|
||||
public function requestSearchResult($method, $path, $params, $opts)
|
||||
{
|
||||
$obj = $this->request($method, $path, $params, $opts);
|
||||
if (!($obj instanceof \Stripe\SearchResult)) {
|
||||
if (!$obj instanceof SearchResult) {
|
||||
$received_class = \get_class($obj);
|
||||
$msg = "Expected to receive `Stripe\\SearchResult` object from Stripe API. Instead received `{$received_class}`.";
|
||||
|
||||
throw new \Stripe\Exception\UnexpectedValueException($msg);
|
||||
throw new Exception\UnexpectedValueException($msg);
|
||||
}
|
||||
$obj->setFilters($params);
|
||||
|
||||
@@ -317,9 +337,9 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
/**
|
||||
* @param \Stripe\Util\RequestOptions $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\AuthenticationException
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws Exception\AuthenticationException
|
||||
*/
|
||||
private function apiKeyForRequest($opts)
|
||||
{
|
||||
@@ -330,7 +350,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
. 'StripeClient instance, or provide it on a per-request basis '
|
||||
. 'using the `api_key` key in the $opts argument.';
|
||||
|
||||
throw new \Stripe\Exception\AuthenticationException($msg);
|
||||
throw new Exception\AuthenticationException($msg);
|
||||
}
|
||||
|
||||
return $apiKey;
|
||||
@@ -339,72 +359,77 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
/**
|
||||
* @param array<string, mixed> $config
|
||||
*
|
||||
* @throws \Stripe\Exception\InvalidArgumentException
|
||||
* @throws Exception\InvalidArgumentException
|
||||
*/
|
||||
private function validateConfig($config)
|
||||
{
|
||||
// api_key
|
||||
if (null !== $config['api_key'] && !\is_string($config['api_key'])) {
|
||||
throw new \Stripe\Exception\InvalidArgumentException('api_key must be null or a string');
|
||||
throw new Exception\InvalidArgumentException('api_key must be null or a string');
|
||||
}
|
||||
|
||||
if (null !== $config['api_key'] && ('' === $config['api_key'])) {
|
||||
$msg = 'api_key cannot be the empty string';
|
||||
|
||||
throw new \Stripe\Exception\InvalidArgumentException($msg);
|
||||
throw new Exception\InvalidArgumentException($msg);
|
||||
}
|
||||
|
||||
if (null !== $config['api_key'] && (\preg_match('/\s/', $config['api_key']))) {
|
||||
if (null !== $config['api_key'] && \preg_match('/\s/', $config['api_key'])) {
|
||||
$msg = 'api_key cannot contain whitespace';
|
||||
|
||||
throw new \Stripe\Exception\InvalidArgumentException($msg);
|
||||
throw new Exception\InvalidArgumentException($msg);
|
||||
}
|
||||
|
||||
// client_id
|
||||
if (null !== $config['client_id'] && !\is_string($config['client_id'])) {
|
||||
throw new \Stripe\Exception\InvalidArgumentException('client_id must be null or a string');
|
||||
throw new Exception\InvalidArgumentException('client_id must be null or a string');
|
||||
}
|
||||
|
||||
// stripe_account
|
||||
if (null !== $config['stripe_account'] && !\is_string($config['stripe_account'])) {
|
||||
throw new \Stripe\Exception\InvalidArgumentException('stripe_account must be null or a string');
|
||||
throw new Exception\InvalidArgumentException('stripe_account must be null or a string');
|
||||
}
|
||||
|
||||
// stripe_context
|
||||
if (null !== $config['stripe_context'] && !\is_string($config['stripe_context'])) {
|
||||
throw new \Stripe\Exception\InvalidArgumentException('stripe_context must be null or a string');
|
||||
throw new Exception\InvalidArgumentException('stripe_context must be null or a string');
|
||||
}
|
||||
|
||||
// stripe_version
|
||||
if (null !== $config['stripe_version'] && !\is_string($config['stripe_version'])) {
|
||||
throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be null or a string');
|
||||
throw new Exception\InvalidArgumentException('stripe_version must be null or a string');
|
||||
}
|
||||
|
||||
// api_base
|
||||
if (!\is_string($config['api_base'])) {
|
||||
throw new \Stripe\Exception\InvalidArgumentException('api_base must be a string');
|
||||
throw new Exception\InvalidArgumentException('api_base must be a string');
|
||||
}
|
||||
|
||||
// connect_base
|
||||
if (!\is_string($config['connect_base'])) {
|
||||
throw new \Stripe\Exception\InvalidArgumentException('connect_base must be a string');
|
||||
throw new Exception\InvalidArgumentException('connect_base must be a string');
|
||||
}
|
||||
|
||||
// files_base
|
||||
if (!\is_string($config['files_base'])) {
|
||||
throw new \Stripe\Exception\InvalidArgumentException('files_base must be a string');
|
||||
throw new Exception\InvalidArgumentException('files_base must be a string');
|
||||
}
|
||||
|
||||
// app info
|
||||
if (null !== $config['app_info'] && !\is_array($config['app_info'])) {
|
||||
throw new \Stripe\Exception\InvalidArgumentException('app_info must be an array');
|
||||
throw new Exception\InvalidArgumentException('app_info must be an array');
|
||||
}
|
||||
|
||||
// max_network_retries
|
||||
if (!\is_int($config['max_network_retries'])) {
|
||||
throw new Exception\InvalidArgumentException('max_network_retries must an int');
|
||||
}
|
||||
|
||||
$appInfoKeys = ['name', 'version', 'url', 'partner_id'];
|
||||
if (null !== $config['app_info'] && array_diff_key($config['app_info'], array_flip($appInfoKeys))) {
|
||||
$msg = 'app_info must be of type array{name: string, version?: string, url?: string, partner_id?: string}';
|
||||
|
||||
throw new \Stripe\Exception\InvalidArgumentException($msg);
|
||||
throw new Exception\InvalidArgumentException($msg);
|
||||
}
|
||||
|
||||
// check absence of extra keys
|
||||
@@ -413,7 +438,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
// Wrap in single quote to more easily catch trailing spaces errors
|
||||
$invalidKeys = "'" . \implode("', '", $extraConfigKeys) . "'";
|
||||
|
||||
throw new \Stripe\Exception\InvalidArgumentException('Found unknown key(s) in configuration array: ' . $invalidKeys);
|
||||
throw new Exception\InvalidArgumentException('Found unknown key(s) in configuration array: ' . $invalidKeys);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,11 +448,11 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
* @param string $json
|
||||
* @param 'v1'|'v2' $apiMode
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
* @return StripeObject
|
||||
* */
|
||||
public function deserialize($json, $apiMode = 'v1')
|
||||
{
|
||||
return \Stripe\Util\Util::convertToStripeObject(\json_decode($json, true), [], $apiMode);
|
||||
return Util::convertToStripeObject(\json_decode($json, true), [], $apiMode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -443,10 +468,10 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
* @param int $tolerance maximum difference allowed between the header's
|
||||
* timestamp and the current time. Defaults to 300 seconds (5 min)
|
||||
*
|
||||
* @return ThinEvent
|
||||
*
|
||||
* @throws Exception\SignatureVerificationException if the verification fails
|
||||
* @throws Exception\UnexpectedValueException if the payload is not valid JSON,
|
||||
*
|
||||
* @return \Stripe\ThinEvent
|
||||
*/
|
||||
public function parseThinEvent($payload, $sigHeader, $secret, $tolerance = Webhook::DEFAULT_TOLERANCE)
|
||||
{
|
||||
@@ -460,7 +485,7 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
|
||||
);
|
||||
} catch (\ReflectionException $e) {
|
||||
// Fail gracefully
|
||||
return new \Stripe\ThinEvent();
|
||||
return new ThinEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Stripe\Billing;
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|string $status Status of the alert. This can be active, inactive or archived.
|
||||
* @property string $title Title of the alert.
|
||||
* @property null|\Stripe\StripeObject $usage_threshold Encapsulates configuration of the alert to monitor usage on a specific <a href="https://stripe.com/docs/api/billing/meter">Billing Meter</a>.
|
||||
* @property null|(object{filters: null|((object{customer: null|string|\Stripe\Customer, type: string}&\Stripe\StripeObject))[], gte: int, meter: Meter|string, recurrence: string}&\Stripe\StripeObject) $usage_threshold Encapsulates configuration of the alert to monitor usage on a specific <a href="https://stripe.com/docs/api/billing/meter">Billing Meter</a>.
|
||||
*/
|
||||
class Alert extends \Stripe\ApiResource
|
||||
{
|
||||
@@ -26,12 +26,12 @@ class Alert extends \Stripe\ApiResource
|
||||
/**
|
||||
* Creates a billing alert.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{alert_type: string, expand?: string[], title: string, usage_threshold?: array{filters?: array{customer?: string, type: string}[], gte: int, meter?: string, recurrence: string}} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Alert the created resource
|
||||
*
|
||||
* @return \Stripe\Billing\Alert the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -48,12 +48,12 @@ class Alert extends \Stripe\ApiResource
|
||||
/**
|
||||
* Lists billing active and inactive alerts.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{alert_type?: string, ending_before?: string, expand?: string[], limit?: int, meter?: string, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Alert> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Billing\Alert> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -68,9 +68,9 @@ class Alert extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Alert
|
||||
*
|
||||
* @return \Stripe\Billing\Alert
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
@@ -85,9 +85,9 @@ class Alert extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Alert the activated alert
|
||||
*
|
||||
* @return \Stripe\Billing\Alert the activated alert
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function activate($params = null, $opts = null)
|
||||
{
|
||||
@@ -102,9 +102,9 @@ class Alert extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Alert the archived alert
|
||||
*
|
||||
* @return \Stripe\Billing\Alert the archived alert
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function archive($params = null, $opts = null)
|
||||
{
|
||||
@@ -119,9 +119,9 @@ class Alert extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Alert the deactivated alert
|
||||
*
|
||||
* @return \Stripe\Billing\Alert the deactivated alert
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function deactivate($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Stripe\Billing;
|
||||
|
||||
/**
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property \Stripe\Billing\Alert $alert A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
|
||||
* @property Alert $alert A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string $customer ID of customer for which the alert triggered
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Stripe\Billing;
|
||||
* Indicates the billing credit balance for billing credits granted to a customer.
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property \Stripe\StripeObject[] $balances The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry.
|
||||
* @property ((object{available_balance: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ledger_balance: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject))[] $balances The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry.
|
||||
* @property string|\Stripe\Customer $customer The customer the balance is for.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
*/
|
||||
@@ -21,9 +21,9 @@ class CreditBalanceSummary extends \Stripe\SingletonApiResource
|
||||
*
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditBalanceSummary
|
||||
*
|
||||
* @return \Stripe\Billing\CreditBalanceSummary
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($opts = null)
|
||||
{
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Stripe\Billing;
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|\Stripe\StripeObject $credit Credit details for this credit balance transaction. Only present if type is <code>credit</code>.
|
||||
* @property string|\Stripe\Billing\CreditGrant $credit_grant The credit grant associated with this credit balance transaction.
|
||||
* @property null|\Stripe\StripeObject $debit Debit details for this credit balance transaction. Only present if type is <code>debit</code>.
|
||||
* @property null|(object{amount: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), credits_application_invoice_voided: null|(object{invoice: string|\Stripe\Invoice, invoice_line_item: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $credit Credit details for this credit balance transaction. Only present if type is <code>credit</code>.
|
||||
* @property CreditGrant|string $credit_grant The credit grant associated with this credit balance transaction.
|
||||
* @property null|(object{amount: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), credits_applied: null|(object{invoice: string|\Stripe\Invoice, invoice_line_item: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $debit Debit details for this credit balance transaction. Only present if type is <code>debit</code>.
|
||||
* @property int $effective_at The effective time of this credit balance transaction.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this credit balance transaction belongs to.
|
||||
@@ -28,12 +28,12 @@ class CreditBalanceTransaction extends \Stripe\ApiResource
|
||||
/**
|
||||
* Retrieve a list of credit balance transactions.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{credit_grant?: string, customer: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<CreditBalanceTransaction> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Billing\CreditBalanceTransaction> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -48,9 +48,9 @@ class CreditBalanceTransaction extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditBalanceTransaction
|
||||
*
|
||||
* @return \Stripe\Billing\CreditBalanceTransaction
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
|
||||
@@ -11,8 +11,8 @@ namespace Stripe\Billing;
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property \Stripe\StripeObject $amount
|
||||
* @property \Stripe\StripeObject $applicability_config
|
||||
* @property (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $amount
|
||||
* @property (object{scope: (object{price_type?: string, prices?: ((object{id: null|string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $applicability_config
|
||||
* @property string $category The category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string|\Stripe\Customer $customer ID of the customer receiving the billing credits.
|
||||
@@ -21,6 +21,7 @@ namespace Stripe\Billing;
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|string $name A descriptive name shown in dashboard.
|
||||
* @property null|int $priority The priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
|
||||
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this credit grant belongs to.
|
||||
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
|
||||
* @property null|int $voided_at The time when this credit grant was voided. If not present, the credit grant hasn't been voided.
|
||||
@@ -37,12 +38,12 @@ class CreditGrant extends \Stripe\ApiResource
|
||||
/**
|
||||
* Creates a credit grant.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{amount: array{monetary?: array{currency: string, value: int}, type: string}, applicability_config: array{scope: array{price_type?: string, prices?: array{id: string}[]}}, category: string, customer: string, effective_at?: int, expand?: string[], expires_at?: int, metadata?: array<string, string>, name?: string, priority?: int} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditGrant the created resource
|
||||
*
|
||||
* @return \Stripe\Billing\CreditGrant the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -59,12 +60,12 @@ class CreditGrant extends \Stripe\ApiResource
|
||||
/**
|
||||
* Retrieve a list of credit grants.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<CreditGrant> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Billing\CreditGrant> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -79,9 +80,9 @@ class CreditGrant extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditGrant
|
||||
*
|
||||
* @return \Stripe\Billing\CreditGrant
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
@@ -96,12 +97,12 @@ class CreditGrant extends \Stripe\ApiResource
|
||||
* Updates a credit grant.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{expand?: string[], expires_at?: null|int, metadata?: array<string, string>} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditGrant the updated resource
|
||||
*
|
||||
* @return \Stripe\Billing\CreditGrant the updated resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -119,9 +120,9 @@ class CreditGrant extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditGrant the expired credit grant
|
||||
*
|
||||
* @return \Stripe\Billing\CreditGrant the expired credit grant
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function expire($params = null, $opts = null)
|
||||
{
|
||||
@@ -136,9 +137,9 @@ class CreditGrant extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditGrant the voided credit grant
|
||||
*
|
||||
* @return \Stripe\Billing\CreditGrant the voided credit grant
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function voidGrant($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -12,16 +12,16 @@ namespace Stripe\Billing;
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property \Stripe\StripeObject $customer_mapping
|
||||
* @property \Stripe\StripeObject $default_aggregation
|
||||
* @property (object{event_payload_key: string, type: string}&\Stripe\StripeObject) $customer_mapping
|
||||
* @property (object{formula: string}&\Stripe\StripeObject) $default_aggregation
|
||||
* @property string $display_name The meter's name.
|
||||
* @property string $event_name The name of the meter event to record usage for. Corresponds with the <code>event_name</code> field on meter events.
|
||||
* @property null|string $event_time_window The time window to pre-aggregate meter events for, if any.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property string $status The meter's status.
|
||||
* @property \Stripe\StripeObject $status_transitions
|
||||
* @property (object{deactivated_at: null|int}&\Stripe\StripeObject) $status_transitions
|
||||
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
|
||||
* @property \Stripe\StripeObject $value_settings
|
||||
* @property (object{event_payload_key: string}&\Stripe\StripeObject) $value_settings
|
||||
*/
|
||||
class Meter extends \Stripe\ApiResource
|
||||
{
|
||||
@@ -39,12 +39,12 @@ class Meter extends \Stripe\ApiResource
|
||||
/**
|
||||
* Creates a billing meter.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{customer_mapping?: array{event_payload_key: string, type: string}, default_aggregation: array{formula: string}, display_name: string, event_name: string, event_time_window?: string, expand?: string[], value_settings?: array{event_payload_key: string}} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Meter the created resource
|
||||
*
|
||||
* @return \Stripe\Billing\Meter the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -61,12 +61,12 @@ class Meter extends \Stripe\ApiResource
|
||||
/**
|
||||
* Retrieve a list of billing meters.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Meter> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Billing\Meter> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -81,9 +81,9 @@ class Meter extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Meter
|
||||
*
|
||||
* @return \Stripe\Billing\Meter
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
@@ -98,12 +98,12 @@ class Meter extends \Stripe\ApiResource
|
||||
* Updates a billing meter.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{display_name?: string, expand?: string[]} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Meter the updated resource
|
||||
*
|
||||
* @return \Stripe\Billing\Meter the updated resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -121,9 +121,9 @@ class Meter extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Meter the deactivated meter
|
||||
*
|
||||
* @return \Stripe\Billing\Meter the deactivated meter
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function deactivate($params = null, $opts = null)
|
||||
{
|
||||
@@ -138,9 +138,9 @@ class Meter extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Meter the reactivated meter
|
||||
*
|
||||
* @return \Stripe\Billing\Meter the reactivated meter
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function reactivate($params = null, $opts = null)
|
||||
{
|
||||
@@ -158,9 +158,9 @@ class Meter extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<MeterEventSummary> the list of meter event summaries
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Billing\MeterEventSummary> the list of meter event summaries
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allEventSummaries($id, $params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -22,12 +22,12 @@ class MeterEvent extends \Stripe\ApiResource
|
||||
/**
|
||||
* Creates a billing meter event.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{event_name: string, expand?: string[], identifier?: string, payload: array<string, string>, timestamp?: int} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return MeterEvent the created resource
|
||||
*
|
||||
* @return \Stripe\Billing\MeterEvent the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Stripe\Billing;
|
||||
* A billing meter event adjustment is a resource that allows you to cancel a meter event. For example, you might create a billing meter event adjustment to cancel a meter event that was created in error or attached to the wrong customer.
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|\Stripe\StripeObject $cancel Specifies which event to cancel.
|
||||
* @property null|(object{identifier: null|string}&\Stripe\StripeObject) $cancel Specifies which event to cancel.
|
||||
* @property string $event_name The name of the meter event. Corresponds with the <code>event_name</code> field on a meter.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property string $status The meter event adjustment's status.
|
||||
@@ -24,12 +24,12 @@ class MeterEventAdjustment extends \Stripe\ApiResource
|
||||
/**
|
||||
* Creates a billing meter event adjustment.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{cancel?: array{identifier?: string}, event_name: string, expand?: string[], type: string} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return MeterEventAdjustment the created resource
|
||||
*
|
||||
* @return \Stripe\Billing\MeterEventAdjustment the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace Stripe\Billing;
|
||||
* A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much
|
||||
* usage was accrued by a customer for that period.
|
||||
*
|
||||
* Note: Meters events are aggregated asynchronously so the meter event summaries provide an eventually consistent view of the reported usage.
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property float $aggregated_value Aggregated value of all the events within <code>start_time</code> (inclusive) and <code>end_time</code> (inclusive). The aggregation strategy is defined on meter via <code>default_aggregation</code>.
|
||||
|
||||
@@ -11,13 +11,13 @@ namespace Stripe\BillingPortal;
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property bool $active Whether the configuration is active and can be used to create portal sessions.
|
||||
* @property null|string|\Stripe\Application $application ID of the Connect Application that created the configuration.
|
||||
* @property \Stripe\StripeObject $business_profile
|
||||
* @property (object{headline: null|string, privacy_policy_url: null|string, terms_of_service_url: null|string}&\Stripe\StripeObject) $business_profile
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|string $default_return_url The default URL to redirect customers to when they click on the portal's link to return to your website. This can be <a href="https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url">overriden</a> when creating the session.
|
||||
* @property \Stripe\StripeObject $features
|
||||
* @property (object{customer_update: (object{allowed_updates: string[], enabled: bool}&\Stripe\StripeObject), invoice_history: (object{enabled: bool}&\Stripe\StripeObject), payment_method_update: (object{enabled: bool}&\Stripe\StripeObject), subscription_cancel: (object{cancellation_reason: (object{enabled: bool, options: string[]}&\Stripe\StripeObject), enabled: bool, mode: string, proration_behavior: string}&\Stripe\StripeObject), subscription_update: (object{default_allowed_updates: string[], enabled: bool, products?: null|(object{prices: string[], product: string}&\Stripe\StripeObject)[], proration_behavior: string, schedule_at_period_end: (object{conditions: (object{type: string}&\Stripe\StripeObject)[]}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject) $features
|
||||
* @property bool $is_default Whether the configuration is the default. If <code>true</code>, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject $login_page
|
||||
* @property (object{enabled: bool, url: null|string}&\Stripe\StripeObject) $login_page
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
|
||||
*/
|
||||
@@ -31,12 +31,12 @@ class Configuration extends \Stripe\ApiResource
|
||||
* Creates a configuration that describes the functionality and behavior of a
|
||||
* PortalSession.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{business_profile?: array{headline?: null|string, privacy_policy_url?: string, terms_of_service_url?: string}, default_return_url?: null|string, expand?: string[], features: array{customer_update?: array{allowed_updates?: null|string[], enabled: bool}, invoice_history?: array{enabled: bool}, payment_method_update?: array{enabled: bool}, subscription_cancel?: array{cancellation_reason?: array{enabled: bool, options: null|string[]}, enabled: bool, mode?: string, proration_behavior?: string}, subscription_update?: array{default_allowed_updates?: null|string[], enabled: bool, products?: null|array{prices: string[], product: string}[], proration_behavior?: string, schedule_at_period_end?: array{conditions?: array{type: string}[]}}}, login_page?: array{enabled: bool}, metadata?: array<string, string>} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Configuration the created resource
|
||||
*
|
||||
* @return \Stripe\BillingPortal\Configuration the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -54,12 +54,12 @@ class Configuration extends \Stripe\ApiResource
|
||||
* Returns a list of configurations that describe the functionality of the customer
|
||||
* portal.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{active?: bool, ending_before?: string, expand?: string[], is_default?: bool, limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Configuration> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\BillingPortal\Configuration> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -75,9 +75,9 @@ class Configuration extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Configuration
|
||||
*
|
||||
* @return \Stripe\BillingPortal\Configuration
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
@@ -92,12 +92,12 @@ class Configuration extends \Stripe\ApiResource
|
||||
* Updates a configuration that describes the functionality of the customer portal.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{active?: bool, business_profile?: array{headline?: null|string, privacy_policy_url?: null|string, terms_of_service_url?: null|string}, default_return_url?: null|string, expand?: string[], features?: array{customer_update?: array{allowed_updates?: null|string[], enabled?: bool}, invoice_history?: array{enabled: bool}, payment_method_update?: array{enabled: bool}, subscription_cancel?: array{cancellation_reason?: array{enabled: bool, options?: null|string[]}, enabled?: bool, mode?: string, proration_behavior?: string}, subscription_update?: array{default_allowed_updates?: null|string[], enabled?: bool, products?: null|array{prices: string[], product: string}[], proration_behavior?: string, schedule_at_period_end?: array{conditions?: null|array{type: string}[]}}}, login_page?: array{enabled: bool}, metadata?: null|array<string, string>} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Configuration the updated resource
|
||||
*
|
||||
* @return \Stripe\BillingPortal\Configuration the updated resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -22,10 +22,10 @@ namespace Stripe\BillingPortal;
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property string|\Stripe\BillingPortal\Configuration $configuration The configuration used by this session, describing the features available.
|
||||
* @property Configuration|string $configuration The configuration used by this session, describing the features available.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string $customer The ID of the customer for this session.
|
||||
* @property null|\Stripe\StripeObject $flow Information about a specific flow for the customer to go through. See the <a href="https://stripe.com/docs/customer-management/portal-deep-links">docs</a> to learn more about using customer portal deep links and flows.
|
||||
* @property null|(object{after_completion: (object{hosted_confirmation: null|(object{custom_message: null|string}&\Stripe\StripeObject), redirect: null|(object{return_url: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), subscription_cancel: null|(object{retention: null|(object{coupon_offer: null|(object{coupon: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), subscription: string}&\Stripe\StripeObject), subscription_update: null|(object{subscription: string}&\Stripe\StripeObject), subscription_update_confirm: null|(object{discounts: null|((object{coupon: null|string, promotion_code: null|string}&\Stripe\StripeObject))[], items: ((object{id: null|string, price: null|string, quantity?: int}&\Stripe\StripeObject))[], subscription: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $flow Information about a specific flow for the customer to go through. See the <a href="https://stripe.com/docs/customer-management/portal-deep-links">docs</a> to learn more about using customer portal deep links and flows.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|string $locale The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s <code>preferred_locales</code> or browser’s locale is used.
|
||||
* @property null|string $on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this <code>on_behalf_of</code> account appear in the portal. For more information, see the <a href="https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant">docs</a>. Use the <a href="https://stripe.com/docs/api/accounts/object#account_object-settings-branding">Accounts API</a> to modify the <code>on_behalf_of</code> account's branding settings, which the portal displays.
|
||||
@@ -39,12 +39,12 @@ class Session extends \Stripe\ApiResource
|
||||
/**
|
||||
* Creates a session of the customer portal.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{configuration?: string, customer: string, expand?: string[], flow_data?: array{after_completion?: array{hosted_confirmation?: array{custom_message?: string}, redirect?: array{return_url: string}, type: string}, subscription_cancel?: array{retention?: array{coupon_offer: array{coupon: string}, type: string}, subscription: string}, subscription_update?: array{subscription: string}, subscription_update_confirm?: array{discounts?: array{coupon?: string, promotion_code?: string}[], items: array{id: string, price?: string, quantity?: int}[], subscription: string}, type: string}, locale?: string, on_behalf_of?: string, return_url?: string} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Session the created resource
|
||||
*
|
||||
* @return \Stripe\BillingPortal\Session the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
|
||||
@@ -11,11 +11,11 @@ namespace Stripe;
|
||||
*
|
||||
* @property string $id The identifier for the capability.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property string|\Stripe\Account $account The account for which the capability enables functionality.
|
||||
* @property null|\Stripe\StripeObject $future_requirements
|
||||
* @property Account|string $account The account for which the capability enables functionality.
|
||||
* @property null|(object{alternatives: null|(object{alternative_fields_due: string[], original_fields_due: string[]}&StripeObject)[], current_deadline: null|int, currently_due: string[], disabled_reason: null|string, errors: (object{code: string, reason: string, requirement: string}&StripeObject)[], eventually_due: string[], past_due: string[], pending_verification: string[]}&StripeObject) $future_requirements
|
||||
* @property bool $requested Whether the capability has been requested.
|
||||
* @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch.
|
||||
* @property null|\Stripe\StripeObject $requirements
|
||||
* @property null|(object{alternatives: null|(object{alternative_fields_due: string[], original_fields_due: string[]}&StripeObject)[], current_deadline: null|int, currently_due: string[], disabled_reason: null|string, errors: (object{code: string, reason: string, requirement: string}&StripeObject)[], eventually_due: string[], past_due: string[], pending_verification: string[]}&StripeObject) $requirements
|
||||
* @property string $status The status of the capability.
|
||||
*/
|
||||
class Capability extends ApiResource
|
||||
@@ -36,8 +36,8 @@ class Capability extends ApiResource
|
||||
$account = $this['account'];
|
||||
if (!$id) {
|
||||
throw new Exception\UnexpectedValueException(
|
||||
'Could not determine which URL to request: ' .
|
||||
"class instance has invalid ID: {$id}",
|
||||
'Could not determine which URL to request: '
|
||||
. "class instance has invalid ID: {$id}",
|
||||
null
|
||||
);
|
||||
}
|
||||
@@ -55,13 +55,13 @@ class Capability extends ApiResource
|
||||
* @param array|string $_id
|
||||
* @param null|array|string $_opts
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
* @throws Exception\BadMethodCallException
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = 'Capabilities cannot be retrieved without an account ID. ' .
|
||||
'Retrieve a capability using `Account::retrieveCapability(' .
|
||||
"'account_id', 'capability_id')`.";
|
||||
$msg = 'Capabilities cannot be retrieved without an account ID. '
|
||||
. 'Retrieve a capability using `Account::retrieveCapability('
|
||||
. "'account_id', 'capability_id')`.";
|
||||
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
@@ -71,13 +71,13 @@ class Capability extends ApiResource
|
||||
* @param null|array $_params
|
||||
* @param null|array|string $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
* @throws Exception\BadMethodCallException
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = 'Capabilities cannot be updated without an account ID. ' .
|
||||
'Update a capability using `Account::updateCapability(' .
|
||||
"'account_id', 'capability_id', \$updateParams)`.";
|
||||
$msg = 'Capabilities cannot be updated without an account ID. '
|
||||
. 'Update a capability using `Account::updateCapability('
|
||||
. "'account_id', 'capability_id', \$updateParams)`.";
|
||||
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
@@ -85,10 +85,10 @@ class Capability extends ApiResource
|
||||
/**
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static the saved resource
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @deprecated The `save` method is deprecated and will be removed in a
|
||||
* future major version of the library. Use the static method `update`
|
||||
* on the resource instead.
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Stripe;
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|string|\Stripe\Account $account The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. This property is only available for accounts where <a href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a> is <code>application</code>, which includes Custom accounts.
|
||||
* @property null|Account|string $account
|
||||
* @property null|string $address_city City/District/Suburb/Town/Village.
|
||||
* @property null|string $address_country Billing address country, if provided when creating card.
|
||||
* @property null|string $address_line1 Address line 1 (Street address/PO Box/Company name).
|
||||
@@ -26,8 +26,8 @@ namespace Stripe;
|
||||
* @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the <code>method</code> when creating a payout.
|
||||
* @property string $brand Card brand. Can be <code>American Express</code>, <code>Diners Club</code>, <code>Discover</code>, <code>Eftpos Australia</code>, <code>Girocard</code>, <code>JCB</code>, <code>MasterCard</code>, <code>UnionPay</code>, <code>Visa</code>, or <code>Unknown</code>.
|
||||
* @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
|
||||
* @property null|string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO code for currency</a> in lowercase. Must be a <a href="https://docs.stripe.com/currencies">supported currency</a>. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where <a href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a> is <code>application</code>, which includes Custom accounts.
|
||||
* @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
|
||||
* @property null|string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO code for currency</a> in lowercase. Must be a <a href="https://docs.stripe.com/currencies">supported currency</a>. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available when returned as an <a href="/api/external_account_cards/object">External Account</a> where <a href="/api/accounts/object#account_object-controller-is_controller">controller.is_controller</a> is <code>true</code>.
|
||||
* @property null|Customer|string $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
|
||||
* @property null|string $cvc_check If a CVC was provided, results of the check: <code>pass</code>, <code>fail</code>, <code>unavailable</code>, or <code>unchecked</code>. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see <a href="https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge">Check if a card is valid without a charge</a>.
|
||||
* @property null|bool $default_for_currency Whether this card is the default external account for its currency. This property is only available for accounts where <a href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a> is <code>application</code>, which includes Custom accounts.
|
||||
* @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number.
|
||||
@@ -36,9 +36,9 @@ namespace Stripe;
|
||||
* @property null|string $fingerprint <p>Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.</p><p><em>As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.</em></p>
|
||||
* @property string $funding Card funding type. Can be <code>credit</code>, <code>debit</code>, <code>prepaid</code>, or <code>unknown</code>.
|
||||
* @property string $last4 The last four digits of the card.
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|string $name Cardholder name.
|
||||
* @property null|\Stripe\StripeObject $networks
|
||||
* @property null|(object{preferred: null|string}&StripeObject) $networks
|
||||
* @property null|string $regulated_status Status of a card based on the card issuer.
|
||||
* @property null|string $status For external accounts that are cards, possible values are <code>new</code> and <code>errored</code>. If a payout fails, the status is set to <code>errored</code> and <a href="https://stripe.com/docs/payouts#payout-schedule">scheduled payouts</a> are stopped until account details are updated.
|
||||
* @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be <code>android_pay</code> (includes Google Pay), <code>apple_pay</code>, <code>masterpass</code>, <code>visa_checkout</code>, or null.
|
||||
@@ -60,9 +60,9 @@ class Card extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Card the deleted resource
|
||||
*
|
||||
* @return \Stripe\Card the deleted resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function delete($params = null, $opts = null)
|
||||
{
|
||||
@@ -133,14 +133,14 @@ class Card extends ApiResource
|
||||
* @param array|string $_id
|
||||
* @param null|array|string $_opts
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
* @throws Exception\BadMethodCallException
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = 'Cards cannot be retrieved without a customer ID or an ' .
|
||||
'account ID. Retrieve a card using ' .
|
||||
"`Customer::retrieveSource('customer_id', 'card_id')` or " .
|
||||
"`Account::retrieveExternalAccount('account_id', 'card_id')`.";
|
||||
$msg = 'Cards cannot be retrieved without a customer ID or an '
|
||||
. 'account ID. Retrieve a card using '
|
||||
. "`Customer::retrieveSource('customer_id', 'card_id')` or "
|
||||
. "`Account::retrieveExternalAccount('account_id', 'card_id')`.";
|
||||
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
@@ -150,15 +150,15 @@ class Card extends ApiResource
|
||||
* @param null|array $_params
|
||||
* @param null|array|string $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
* @throws Exception\BadMethodCallException
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = 'Cards cannot be updated without a customer ID or an ' .
|
||||
'account ID. Update a card using ' .
|
||||
"`Customer::updateSource('customer_id', 'card_id', " .
|
||||
'$updateParams)` or `Account::updateExternalAccount(' .
|
||||
"'account_id', 'card_id', \$updateParams)`.";
|
||||
$msg = 'Cards cannot be updated without a customer ID or an '
|
||||
. 'account ID. Update a card using '
|
||||
. "`Customer::updateSource('customer_id', 'card_id', "
|
||||
. '$updateParams)` or `Account::updateExternalAccount('
|
||||
. "'account_id', 'card_id', \$updateParams)`.";
|
||||
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
@@ -166,10 +166,10 @@ class Card extends ApiResource
|
||||
/**
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static the saved resource
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @deprecated The `save` method is deprecated and will be removed in a
|
||||
* future major version of the library. Use the static method `update`
|
||||
* on the resource instead.
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace Stripe;
|
||||
* A customer's <code>Cash balance</code> represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account.
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|\Stripe\StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
|
||||
* @property null|StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
|
||||
* @property string $customer The ID of the customer whose cash balance this object represents.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject $settings
|
||||
* @property (object{reconciliation_mode: string, using_merchant_default: bool}&StripeObject) $settings
|
||||
*/
|
||||
class CashBalance extends ApiResource
|
||||
{
|
||||
@@ -35,13 +35,13 @@ class CashBalance extends ApiResource
|
||||
* @param array|string $_id
|
||||
* @param null|array|string $_opts
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
* @throws Exception\BadMethodCallException
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = 'Customer Cash Balance cannot be retrieved without a ' .
|
||||
'customer ID. Retrieve a Customer Cash Balance using ' .
|
||||
"`Customer::retrieveCashBalance('customer_id')`.";
|
||||
$msg = 'Customer Cash Balance cannot be retrieved without a '
|
||||
. 'customer ID. Retrieve a Customer Cash Balance using '
|
||||
. "`Customer::retrieveCashBalance('customer_id')`.";
|
||||
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
@@ -51,13 +51,13 @@ class CashBalance extends ApiResource
|
||||
* @param null|array $_params
|
||||
* @param null|array|string $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
* @throws Exception\BadMethodCallException
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = 'Customer Cash Balance cannot be updated without a ' .
|
||||
'customer ID. Retrieve a Customer Cash Balance using ' .
|
||||
"`Customer::updateCashBalance('customer_id')`.";
|
||||
$msg = 'Customer Cash Balance cannot be updated without a '
|
||||
. 'customer ID. Retrieve a Customer Cash Balance using '
|
||||
. "`Customer::updateCashBalance('customer_id')`.";
|
||||
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@ namespace Stripe\Climate;
|
||||
* @property int $amount_fees Total amount of <a href="https://frontierclimate.com/">Frontier</a>'s service fees in the currency's smallest unit.
|
||||
* @property int $amount_subtotal Total amount of the carbon removal in the currency's smallest unit.
|
||||
* @property int $amount_total Total amount of the order including fees in the currency's smallest unit.
|
||||
* @property null|\Stripe\StripeObject $beneficiary
|
||||
* @property null|(object{public_name: string}&\Stripe\StripeObject) $beneficiary
|
||||
* @property null|int $canceled_at Time at which the order was canceled. Measured in seconds since the Unix epoch.
|
||||
* @property null|string $cancellation_reason Reason for the cancellation of this order.
|
||||
* @property null|string $certificate For delivered orders, a URL to a delivery certificate for the order.
|
||||
@@ -22,12 +22,12 @@ namespace Stripe\Climate;
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase, representing the currency for this order.
|
||||
* @property null|int $delayed_at Time at which the order's expected_delivery_year was delayed. Measured in seconds since the Unix epoch.
|
||||
* @property null|int $delivered_at Time at which the order was delivered. Measured in seconds since the Unix epoch.
|
||||
* @property \Stripe\StripeObject[] $delivery_details Details about the delivery of carbon removal for this order.
|
||||
* @property ((object{delivered_at: int, location: null|(object{city: null|string, country: string, latitude: null|float, longitude: null|float, region: null|string}&\Stripe\StripeObject), metric_tons: string, registry_url: null|string, supplier: Supplier}&\Stripe\StripeObject))[] $delivery_details Details about the delivery of carbon removal for this order.
|
||||
* @property int $expected_delivery_year The year this order is expected to be delivered.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property string $metric_tons Quantity of carbon removal that is included in this order.
|
||||
* @property string|\Stripe\Climate\Product $product Unique ID for the Climate <code>Product</code> this order is purchasing.
|
||||
* @property Product|string $product Unique ID for the Climate <code>Product</code> this order is purchasing.
|
||||
* @property null|int $product_substituted_at Time at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch.
|
||||
* @property string $status The current status of this order.
|
||||
*/
|
||||
@@ -52,12 +52,12 @@ class Order extends \Stripe\ApiResource
|
||||
* processed immediately after creation and payment will be deducted your Stripe
|
||||
* balance.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{amount?: int, beneficiary?: array{public_name: string}, currency?: string, expand?: string[], metadata?: array<string, string>, metric_tons?: string, product: string} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Order the created resource
|
||||
*
|
||||
* @return \Stripe\Climate\Order the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -75,12 +75,12 @@ class Order extends \Stripe\ApiResource
|
||||
* Lists all Climate order objects. The orders are returned sorted by creation
|
||||
* date, with the most recently created orders appearing first.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Order> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Climate\Order> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -95,9 +95,9 @@ class Order extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Order
|
||||
*
|
||||
* @return \Stripe\Climate\Order
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
@@ -112,12 +112,12 @@ class Order extends \Stripe\ApiResource
|
||||
* Updates the specified order by setting the values of the parameters passed.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{beneficiary?: null|array{public_name: null|string}, expand?: string[], metadata?: array<string, string>} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Order the updated resource
|
||||
*
|
||||
* @return \Stripe\Climate\Order the updated resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -135,9 +135,9 @@ class Order extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Order the canceled order
|
||||
*
|
||||
* @return \Stripe\Climate\Order the canceled order
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function cancel($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Stripe\Climate;
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property string $metric_tons_available The quantity of metric tons available for reservation.
|
||||
* @property string $name The Climate product's name.
|
||||
* @property \Stripe\Climate\Supplier[] $suppliers The carbon removal suppliers that fulfill orders for this Climate product.
|
||||
* @property Supplier[] $suppliers The carbon removal suppliers that fulfill orders for this Climate product.
|
||||
*/
|
||||
class Product extends \Stripe\ApiResource
|
||||
{
|
||||
@@ -25,12 +25,12 @@ class Product extends \Stripe\ApiResource
|
||||
/**
|
||||
* Lists all available Climate product objects.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Product> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Climate\Product> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -45,9 +45,9 @@ class Product extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Product
|
||||
*
|
||||
* @return \Stripe\Climate\Product
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Stripe\Climate;
|
||||
* @property string $object String representing the object’s type. Objects of the same type share the same value.
|
||||
* @property string $info_url Link to a webpage to learn more about the supplier.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject[] $locations The locations in which this supplier operates.
|
||||
* @property ((object{city: null|string, country: string, latitude: null|float, longitude: null|float, region: null|string}&\Stripe\StripeObject))[] $locations The locations in which this supplier operates.
|
||||
* @property string $name Name of this carbon removal supplier.
|
||||
* @property string $removal_pathway The scientific pathway used for carbon removal.
|
||||
*/
|
||||
@@ -26,12 +26,12 @@ class Supplier extends \Stripe\ApiResource
|
||||
/**
|
||||
* Lists all available Climate supplier objects.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Supplier> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Climate\Supplier> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -46,9 +46,9 @@ class Supplier extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Supplier
|
||||
*
|
||||
* @return \Stripe\Climate\Supplier
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Stripe;
|
||||
* Class Collection.
|
||||
*
|
||||
* @template TStripeObject of StripeObject
|
||||
*
|
||||
* @template-implements \IteratorAggregate<TStripeObject>
|
||||
*
|
||||
* @property string $object
|
||||
@@ -59,10 +60,10 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
||||
if (\is_string($k)) {
|
||||
return parent::offsetGet($k);
|
||||
}
|
||||
$msg = "You tried to access the {$k} index, but Collection " .
|
||||
'types only support string keys. (HINT: List calls ' .
|
||||
'return an object with a `data` (which is the data ' .
|
||||
"array). You likely want to call ->data[{$k}])";
|
||||
$msg = "You tried to access the {$k} index, but Collection "
|
||||
. 'types only support string keys. (HINT: List calls '
|
||||
. 'return an object with a `data` (which is the data '
|
||||
. "array). You likely want to call ->data[{$k}])";
|
||||
|
||||
throw new Exception\InvalidArgumentException($msg);
|
||||
}
|
||||
@@ -71,9 +72,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*
|
||||
* @return Collection<TStripeObject>
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -82,9 +83,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
||||
|
||||
list($response, $opts) = $this->_request('get', $url, $params, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response, $opts);
|
||||
if (!($obj instanceof \Stripe\Collection)) {
|
||||
throw new \Stripe\Exception\UnexpectedValueException(
|
||||
'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.'
|
||||
if (!$obj instanceof Collection) {
|
||||
throw new Exception\UnexpectedValueException(
|
||||
'Expected type ' . Collection::class . ', got "' . \get_class($obj) . '" instead.'
|
||||
);
|
||||
}
|
||||
$obj->setFilters($params);
|
||||
@@ -96,9 +97,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*
|
||||
* @return TStripeObject
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function create($params = null, $opts = null)
|
||||
{
|
||||
@@ -115,9 +116,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*
|
||||
* @return TStripeObject
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function retrieve($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -165,12 +166,12 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception\ApiErrorException
|
||||
*
|
||||
* @return \Generator|TStripeObject[] A generator that can be used to
|
||||
* iterate across all objects across all pages. As page boundaries are
|
||||
* encountered, the next page will be fetched automatically for
|
||||
* continued iteration.
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function autoPagingIterator()
|
||||
{
|
||||
@@ -230,9 +231,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*
|
||||
* @return Collection<TStripeObject>
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function nextPage($params = null, $opts = null)
|
||||
{
|
||||
@@ -260,9 +261,9 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*
|
||||
* @return Collection<TStripeObject>
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function previousPage($params = null, $opts = null)
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -9,7 +9,7 @@ namespace Stripe;
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $amount Amount transferred, in cents (or local equivalent).
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property string|\Stripe\Account $destination ID of the account that funds are being collected for.
|
||||
* @property Account|string $destination ID of the account that funds are being collected for.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
*/
|
||||
class ConnectCollectionTransfer extends ApiResource
|
||||
|
||||
@@ -15,11 +15,11 @@ namespace Stripe;
|
||||
* @property string $id Unique identifier for the object. Represented as the ISO country code for this country.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property string $default_currency The default currency for this country. This applies to both payment methods and bank accounts.
|
||||
* @property \Stripe\StripeObject $supported_bank_account_currencies Currencies that can be accepted in the specific country (for transfers).
|
||||
* @property StripeObject $supported_bank_account_currencies Currencies that can be accepted in the specific country (for transfers).
|
||||
* @property string[] $supported_payment_currencies Currencies that can be accepted in the specified country (for payments).
|
||||
* @property string[] $supported_payment_methods Payment methods available in the specified country. You may need to enable some payment methods (e.g., <a href="https://stripe.com/docs/ach">ACH</a>) on your account before they appear in this list. The <code>stripe</code> payment method refers to <a href="https://stripe.com/docs/connect/destination-charges">charging through your platform</a>.
|
||||
* @property string[] $supported_transfer_countries Countries that can accept transfers from the specified country.
|
||||
* @property \Stripe\StripeObject $verification_fields
|
||||
* @property (object{company: (object{additional: string[], minimum: string[]}&StripeObject), individual: (object{additional: string[], minimum: string[]}&StripeObject)}&StripeObject) $verification_fields
|
||||
*/
|
||||
class CountrySpec extends ApiResource
|
||||
{
|
||||
@@ -28,18 +28,18 @@ class CountrySpec extends ApiResource
|
||||
/**
|
||||
* Lists all Country Spec objects available in the API.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<CountrySpec> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\CountrySpec> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,13 +48,13 @@ class CountrySpec extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CountrySpec
|
||||
*
|
||||
* @return \Stripe\CountrySpec
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
|
||||
@@ -12,15 +12,15 @@ namespace Stripe;
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|int $amount_off Amount (in the <code>currency</code> specified) that will be taken off the subtotal of any invoices for this customer.
|
||||
* @property null|\Stripe\StripeObject $applies_to
|
||||
* @property null|(object{products: string[]}&StripeObject) $applies_to
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|string $currency If <code>amount_off</code> has been set, the three-letter <a href="https://stripe.com/docs/currencies">ISO code for the currency</a> of the amount to take off.
|
||||
* @property null|\Stripe\StripeObject $currency_options Coupons defined in each available currency option. Each key must be a three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> and a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property string $duration One of <code>forever</code>, <code>once</code>, and <code>repeating</code>. Describes how long a customer who applies this coupon will get the discount.
|
||||
* @property null|StripeObject $currency_options Coupons defined in each available currency option. Each key must be a three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> and a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property string $duration One of <code>forever</code>, <code>once</code>, or <code>repeating</code>. Describes how long a customer who applies this coupon will get the discount.
|
||||
* @property null|int $duration_in_months If <code>duration</code> is <code>repeating</code>, the number of months the coupon applies. Null if coupon <code>duration</code> is <code>forever</code> or <code>once</code>.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|int $max_redemptions Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid.
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|string $name Name of the coupon displayed to customers on for instance invoices or receipts.
|
||||
* @property null|float $percent_off Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead.
|
||||
* @property null|int $redeem_by Date after which the coupon can no longer be redeemed.
|
||||
@@ -53,12 +53,12 @@ class Coupon extends ApiResource
|
||||
* a coupon with an <code>amount_off</code> of <amount>200</amount> is applied to
|
||||
* it.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{amount_off?: int, applies_to?: array{products?: string[]}, currency?: string, currency_options?: array<string, array{amount_off: int}>, duration?: string, duration_in_months?: int, expand?: string[], id?: string, max_redemptions?: int, metadata?: null|array<string, string>, name?: string, percent_off?: float, redeem_by?: int} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Coupon the created resource
|
||||
*
|
||||
* @return \Stripe\Coupon the created resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -66,7 +66,7 @@ class Coupon extends ApiResource
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -82,9 +82,9 @@ class Coupon extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Coupon the deleted resource
|
||||
*
|
||||
* @return \Stripe\Coupon the deleted resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function delete($params = null, $opts = null)
|
||||
{
|
||||
@@ -100,18 +100,18 @@ class Coupon extends ApiResource
|
||||
/**
|
||||
* Returns a list of your coupons.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<Coupon> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Coupon> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,13 +120,13 @@ class Coupon extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Coupon
|
||||
*
|
||||
* @return \Stripe\Coupon
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
@@ -138,12 +138,12 @@ class Coupon extends ApiResource
|
||||
* amount_off) are, by design, not editable.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{currency_options?: array<string, array{amount_off: int}>, expand?: string[], metadata?: null|array<string, string>, name?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Coupon the updated resource
|
||||
*
|
||||
* @return \Stripe\Coupon the updated resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -151,7 +151,7 @@ class Coupon extends ApiResource
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
|
||||
@@ -15,29 +15,29 @@ namespace Stripe;
|
||||
* @property int $amount_shipping This is the sum of all the shipping amounts.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property string|\Stripe\Customer $customer ID of the customer.
|
||||
* @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note.
|
||||
* @property Customer|string $customer ID of the customer.
|
||||
* @property null|CustomerBalanceTransaction|string $customer_balance_transaction Customer balance transaction related to this credit note.
|
||||
* @property int $discount_amount The integer amount in cents (or local equivalent) representing the total amount of discount that was credited.
|
||||
* @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items.
|
||||
* @property ((object{amount: int, discount: Discount|string}&StripeObject))[] $discount_amounts The aggregate amounts calculated per discount for all line items.
|
||||
* @property null|int $effective_at The date when this credit note is in effect. Same as <code>created</code> unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF.
|
||||
* @property string|\Stripe\Invoice $invoice ID of the invoice.
|
||||
* @property \Stripe\Collection<\Stripe\CreditNoteLineItem> $lines Line items that make up the credit note
|
||||
* @property Invoice|string $invoice ID of the invoice.
|
||||
* @property Collection<CreditNoteLineItem> $lines Line items that make up the credit note
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|string $memo Customer-facing text that appears on the credit note PDF.
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.
|
||||
* @property null|int $out_of_band_amount Amount that was credited outside of Stripe.
|
||||
* @property string $pdf The link to download the PDF of the credit note.
|
||||
* @property null|\Stripe\StripeObject[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for all line items.
|
||||
* @property ((object{amount: int, credit_balance_transaction?: Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for all line items.
|
||||
* @property null|string $reason Reason for issuing this credit note, one of <code>duplicate</code>, <code>fraudulent</code>, <code>order_change</code>, or <code>product_unsatisfactory</code>
|
||||
* @property null|string|\Stripe\Refund $refund Refund related to this credit note.
|
||||
* @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied to the invoice.
|
||||
* @property ((object{amount_refunded: int, refund: Refund|string}&StripeObject))[] $refunds Refunds related to this credit note.
|
||||
* @property null|(object{amount_subtotal: int, amount_tax: int, amount_total: int, shipping_rate: null|ShippingRate|string, taxes?: ((object{amount: int, rate: TaxRate, taxability_reason: null|string, taxable_amount: null|int}&StripeObject))[]}&StripeObject) $shipping_cost The details of the cost of shipping, including the ShippingRate applied to the invoice.
|
||||
* @property string $status Status of this credit note, one of <code>issued</code> or <code>void</code>. Learn more about <a href="https://stripe.com/docs/billing/invoices/credit-notes#voiding">voiding credit notes</a>.
|
||||
* @property int $subtotal The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
|
||||
* @property null|int $subtotal_excluding_tax The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts.
|
||||
* @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items.
|
||||
* @property int $total The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount.
|
||||
* @property null|int $total_excluding_tax The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts.
|
||||
* @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $total_taxes The aggregate tax information for all line items.
|
||||
* @property string $type Type of this credit note, one of <code>pre_payment</code> or <code>post_payment</code>. A <code>pre_payment</code> credit note means it was issued when the invoice was open. A <code>post_payment</code> credit note means it was issued when the invoice was paid.
|
||||
* @property null|int $voided_at The time that the credit note was voided.
|
||||
*/
|
||||
@@ -64,7 +64,7 @@ class CreditNote extends ApiResource
|
||||
* <code>status=open</code> invoice, a credit note reduces its
|
||||
* <code>amount_due</code>. For a <code>status=paid</code> invoice, a credit note
|
||||
* does not affect its <code>amount_due</code>. Instead, it can result in any
|
||||
* combination of the following:.
|
||||
* combination of the following:
|
||||
*
|
||||
* <ul> <li>Refund: create a new refund (using <code>refund_amount</code>) or link
|
||||
* an existing refund (using <code>refund</code>).</li> <li>Customer balance
|
||||
@@ -81,12 +81,12 @@ class CreditNote extends ApiResource
|
||||
* <code>post_payment_credit_notes_amount</code> depending on its
|
||||
* <code>status</code> at the time of credit note creation.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array<string, string>, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, refund?: string}[], shipping_cost?: array{shipping_rate?: string}} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditNote the created resource
|
||||
*
|
||||
* @return \Stripe\CreditNote the created resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ class CreditNote extends ApiResource
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -103,18 +103,18 @@ class CreditNote extends ApiResource
|
||||
/**
|
||||
* Returns a list of credit notes.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], invoice?: string, limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<CreditNote> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\CreditNote> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,13 +123,13 @@ class CreditNote extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditNote
|
||||
*
|
||||
* @return \Stripe\CreditNote
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
@@ -140,12 +140,12 @@ class CreditNote extends ApiResource
|
||||
* Updates an existing credit note.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{expand?: string[], memo?: string, metadata?: array<string, string>} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditNote the updated resource
|
||||
*
|
||||
* @return \Stripe\CreditNote the updated resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -153,7 +153,7 @@ class CreditNote extends ApiResource
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -163,15 +163,15 @@ class CreditNote extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditNote the previewed credit note
|
||||
*
|
||||
* @return \Stripe\CreditNote the previewed credit note
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function preview($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl() . '/preview';
|
||||
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -181,15 +181,15 @@ class CreditNote extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<CreditNoteLineItem> list of credit note line items
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\CreditNoteLineItem> list of credit note line items
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function previewLines($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl() . '/preview/lines';
|
||||
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -199,9 +199,9 @@ class CreditNote extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CreditNote the voided credit note
|
||||
*
|
||||
* @return \Stripe\CreditNote the voided credit note
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function voidCreditNote($params = null, $opts = null)
|
||||
{
|
||||
@@ -219,9 +219,9 @@ class CreditNote extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<CreditNoteLineItem> the list of credit note line items
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\CreditNoteLineItem> the list of credit note line items
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allLines($id, $params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -10,20 +10,18 @@ namespace Stripe;
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $amount The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
|
||||
* @property null|int $amount_excluding_tax The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts.
|
||||
* @property null|string $description Description of the item being credited.
|
||||
* @property int $discount_amount The integer amount in cents (or local equivalent) representing the discount being credited for this line item.
|
||||
* @property \Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item
|
||||
* @property ((object{amount: int, discount: Discount|string}&StripeObject))[] $discount_amounts The amount of discount calculated per discount for this line item
|
||||
* @property null|string $invoice_line_item ID of the invoice line item being credited
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|\Stripe\StripeObject[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for this line item.
|
||||
* @property ((object{amount: int, credit_balance_transaction?: Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for this line item.
|
||||
* @property null|int $quantity The number of units of product being credited.
|
||||
* @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item
|
||||
* @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item.
|
||||
* @property TaxRate[] $tax_rates The tax rates which apply to the line item.
|
||||
* @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $taxes The tax information of the line item.
|
||||
* @property string $type The type of the credit note line item, one of <code>invoice_line_item</code> or <code>custom_line_item</code>. When the type is <code>invoice_line_item</code> there is an additional <code>invoice_line_item</code> property on the resource the value of which is the id of the credited line item on the invoice.
|
||||
* @property null|int $unit_amount The cost of each unit of product being credited.
|
||||
* @property null|string $unit_amount_decimal Same as <code>unit_amount</code>, but contains a decimal value with at most 12 decimal places.
|
||||
* @property null|string $unit_amount_excluding_tax The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts.
|
||||
*/
|
||||
class CreditNoteLineItem extends ApiResource
|
||||
{
|
||||
|
||||
@@ -10,32 +10,32 @@ namespace Stripe;
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|\Stripe\StripeObject $address The customer's address.
|
||||
* @property null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject) $address The customer's address.
|
||||
* @property null|int $balance The current balance, if any, that's stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize.
|
||||
* @property null|\Stripe\CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The <code>settings[reconciliation_mode]</code> field describes if these funds apply to these payment intents manually or automatically.
|
||||
* @property null|CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The <code>settings[reconciliation_mode]</code> field describes if these funds apply to these payment intents manually or automatically.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|string $currency Three-letter <a href="https://stripe.com/docs/currencies">ISO code for the currency</a> the customer can be charged in for recurring billing purposes.
|
||||
* @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source <p>ID of the default payment source for the customer.</p><p>If you use payment methods created through the PaymentMethods API, see the <a href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a> field instead.</p>
|
||||
* @property null|Account|BankAccount|Card|Source|string $default_source <p>ID of the default payment source for the customer.</p><p>If you use payment methods created through the PaymentMethods API, see the <a href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a> field instead.</p>
|
||||
* @property null|bool $delinquent <p>Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the <code>invoice.due_date</code> will set this field to <code>true</code>.</p><p>If an invoice becomes uncollectible by <a href="https://stripe.com/docs/billing/automatic-collection">dunning</a>, <code>delinquent</code> doesn't reset to <code>false</code>.</p><p>If you care whether the customer has paid their most recent subscription invoice, use <code>subscription.status</code> instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to <code>false</code>.</p>
|
||||
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
|
||||
* @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one.
|
||||
* @property null|Discount $discount Describes the current discount active on the customer, if there is one.
|
||||
* @property null|string $email The customer's email address.
|
||||
* @property null|\Stripe\StripeObject $invoice_credit_balance The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes.
|
||||
* @property null|StripeObject $invoice_credit_balance The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes.
|
||||
* @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers.
|
||||
* @property null|\Stripe\StripeObject $invoice_settings
|
||||
* @property null|(object{custom_fields: null|(object{name: string, value: string}&StripeObject)[], default_payment_method: null|PaymentMethod|string, footer: null|string, rendering_options: null|(object{amount_tax_display: null|string, template: null|string}&StripeObject)}&StripeObject) $invoice_settings
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|string $name The customer's full name or business name.
|
||||
* @property null|int $next_invoice_sequence The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses.
|
||||
* @property null|string $phone The customer's phone number.
|
||||
* @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference.
|
||||
* @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
|
||||
* @property null|\Stripe\Collection<\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source> $sources The customer's payment sources, if any.
|
||||
* @property null|\Stripe\Collection<\Stripe\Subscription> $subscriptions The customer's current subscriptions, if any.
|
||||
* @property null|\Stripe\StripeObject $tax
|
||||
* @property null|(object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), carrier?: null|string, name?: string, phone?: null|string, tracking_number?: null|string}&StripeObject) $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
|
||||
* @property null|Collection<Account|BankAccount|Card|Source> $sources The customer's payment sources, if any.
|
||||
* @property null|Collection<Subscription> $subscriptions The customer's current subscriptions, if any.
|
||||
* @property null|(object{automatic_tax: string, ip_address: null|string, location: null|(object{country: string, source: string, state: null|string}&StripeObject)}&StripeObject) $tax
|
||||
* @property null|string $tax_exempt Describes the customer's tax exemption status, which is <code>none</code>, <code>exempt</code>, or <code>reverse</code>. When set to <code>reverse</code>, invoice and receipt PDFs include the following text: <strong>"Reverse charge"</strong>.
|
||||
* @property null|\Stripe\Collection<\Stripe\TaxId> $tax_ids The customer's tax IDs.
|
||||
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock that this customer belongs to.
|
||||
* @property null|Collection<TaxId> $tax_ids The customer's tax IDs.
|
||||
* @property null|string|TestHelpers\TestClock $test_clock ID of the test clock that this customer belongs to.
|
||||
*/
|
||||
class Customer extends ApiResource
|
||||
{
|
||||
@@ -51,12 +51,12 @@ class Customer extends ApiResource
|
||||
/**
|
||||
* Creates a new customer object.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, balance?: int, cash_balance?: array{settings?: array{reconciliation_mode?: string}}, description?: string, email?: string, expand?: string[], invoice_prefix?: string, invoice_settings?: array{custom_fields?: null|array{name: string, value: string}[], default_payment_method?: string, footer?: string, rendering_options?: null|array{amount_tax_display?: null|string, template?: string}}, metadata?: null|array<string, string>, name?: string, next_invoice_sequence?: int, payment_method?: string, phone?: string, preferred_locales?: string[], shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: string}, source?: string, tax?: array{ip_address?: null|string, validate_location?: string}, tax_exempt?: null|string, tax_id_data?: array{type: string, value: string}[], test_clock?: string, validate?: bool} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Customer the created resource
|
||||
*
|
||||
* @return \Stripe\Customer the created resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -64,7 +64,7 @@ class Customer extends ApiResource
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -77,9 +77,9 @@ class Customer extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Customer the deleted resource
|
||||
*
|
||||
* @return \Stripe\Customer the deleted resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function delete($params = null, $opts = null)
|
||||
{
|
||||
@@ -96,18 +96,18 @@ class Customer extends ApiResource
|
||||
* Returns a list of your customers. The customers are returned sorted by creation
|
||||
* date, with the most recent customers appearing first.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{created?: array|int, email?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, test_clock?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<Customer> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Customer> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,13 +116,13 @@ class Customer extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Customer
|
||||
*
|
||||
* @return \Stripe\Customer
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
@@ -145,12 +145,12 @@ class Customer extends ApiResource
|
||||
* This request accepts mostly the same arguments as the customer creation call.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, balance?: int, cash_balance?: array{settings?: array{reconciliation_mode?: string}}, default_source?: string, description?: string, email?: string, expand?: string[], invoice_prefix?: string, invoice_settings?: array{custom_fields?: null|array{name: string, value: string}[], default_payment_method?: string, footer?: string, rendering_options?: null|array{amount_tax_display?: null|string, template?: string}}, metadata?: null|array<string, string>, name?: string, next_invoice_sequence?: int, phone?: string, preferred_locales?: string[], shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: string}, source?: string, tax?: array{ip_address?: null|string, validate_location?: string}, tax_exempt?: null|string, validate?: bool} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Customer the updated resource
|
||||
*
|
||||
* @return \Stripe\Customer the updated resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -158,7 +158,7 @@ class Customer extends ApiResource
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -180,7 +180,7 @@ class Customer extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return \Stripe\Customer the updated customer
|
||||
* @return Customer the updated customer
|
||||
*/
|
||||
public function deleteDiscount($params = null, $opts = null)
|
||||
{
|
||||
@@ -196,15 +196,15 @@ class Customer extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<PaymentMethod> list of payment methods
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\PaymentMethod> list of payment methods
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allPaymentMethods($id, $params = null, $opts = null)
|
||||
{
|
||||
$url = static::resourceUrl($id) . '/payment_methods';
|
||||
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -215,15 +215,15 @@ class Customer extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return PaymentMethod the retrieved payment method
|
||||
*
|
||||
* @return \Stripe\PaymentMethod the retrieved payment method
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function retrievePaymentMethod($payment_method, $params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/payment_methods/' . $payment_method;
|
||||
list($response, $opts) = $this->_request('get', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -233,180 +233,17 @@ class Customer extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return SearchResult<Customer> the customer search results
|
||||
*
|
||||
* @return \Stripe\SearchResult<\Stripe\Customer> the customer search results
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function search($params = null, $opts = null)
|
||||
{
|
||||
$url = '/v1/customers/search';
|
||||
|
||||
return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts);
|
||||
return static::_requestPage($url, SearchResult::class, $params, $opts);
|
||||
}
|
||||
|
||||
const PATH_BALANCE_TRANSACTIONS = '/balance_transactions';
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer on which to retrieve the customer balance transactions
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\CustomerBalanceTransaction> the list of customer balance transactions
|
||||
*/
|
||||
public static function allBalanceTransactions($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer on which to create the customer balance transaction
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\CustomerBalanceTransaction
|
||||
*/
|
||||
public static function createBalanceTransaction($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the customer balance transaction belongs
|
||||
* @param string $balanceTransactionId the ID of the customer balance transaction to retrieve
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\CustomerBalanceTransaction
|
||||
*/
|
||||
public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the customer balance transaction belongs
|
||||
* @param string $balanceTransactionId the ID of the customer balance transaction to update
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\CustomerBalanceTransaction
|
||||
*/
|
||||
public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
|
||||
}
|
||||
const PATH_CASH_BALANCE_TRANSACTIONS = '/cash_balance_transactions';
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer on which to retrieve the customer cash balance transactions
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\CustomerCashBalanceTransaction> the list of customer cash balance transactions
|
||||
*/
|
||||
public static function allCashBalanceTransactions($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the customer cash balance transaction belongs
|
||||
* @param string $cashBalanceTransactionId the ID of the customer cash balance transaction to retrieve
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\CustomerCashBalanceTransaction
|
||||
*/
|
||||
public static function retrieveCashBalanceTransaction($id, $cashBalanceTransactionId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $cashBalanceTransactionId, $params, $opts);
|
||||
}
|
||||
const PATH_SOURCES = '/sources';
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer on which to retrieve the payment sources
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card|\Stripe\Source> the list of payment sources (BankAccount, Card or Source)
|
||||
*/
|
||||
public static function allSources($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer on which to create the payment source
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source
|
||||
*/
|
||||
public static function createSource($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the payment source belongs
|
||||
* @param string $sourceId the ID of the payment source to delete
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source
|
||||
*/
|
||||
public static function deleteSource($id, $sourceId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the payment source belongs
|
||||
* @param string $sourceId the ID of the payment source to retrieve
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source
|
||||
*/
|
||||
public static function retrieveSource($id, $sourceId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the payment source belongs
|
||||
* @param string $sourceId the ID of the payment source to update
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source
|
||||
*/
|
||||
public static function updateSource($id, $sourceId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
|
||||
}
|
||||
const PATH_CASH_BALANCE = '/cash_balance';
|
||||
|
||||
/**
|
||||
@@ -415,9 +252,9 @@ class Customer extends ApiResource
|
||||
* @param null|array|string $opts
|
||||
* @param mixed $cashBalanceId
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CashBalance
|
||||
*
|
||||
* @return \Stripe\CashBalance
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieveCashBalance($id, $cashBalanceId, $params = null, $opts = null)
|
||||
{
|
||||
@@ -430,14 +267,177 @@ class Customer extends ApiResource
|
||||
* @param null|array|string $opts
|
||||
* @param mixed $cashBalanceId
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CashBalance
|
||||
*
|
||||
* @return \Stripe\CashBalance
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function updateCashBalance($id, $cashBalanceId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts);
|
||||
}
|
||||
const PATH_BALANCE_TRANSACTIONS = '/balance_transactions';
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer on which to retrieve the customer balance transactions
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Collection<CustomerBalanceTransaction> the list of customer balance transactions
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allBalanceTransactions($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer on which to create the customer balance transaction
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return CustomerBalanceTransaction
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function createBalanceTransaction($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the customer balance transaction belongs
|
||||
* @param string $balanceTransactionId the ID of the customer balance transaction to retrieve
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return CustomerBalanceTransaction
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the customer balance transaction belongs
|
||||
* @param string $balanceTransactionId the ID of the customer balance transaction to update
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return CustomerBalanceTransaction
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
|
||||
}
|
||||
const PATH_CASH_BALANCE_TRANSACTIONS = '/cash_balance_transactions';
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer on which to retrieve the customer cash balance transactions
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Collection<CustomerCashBalanceTransaction> the list of customer cash balance transactions
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allCashBalanceTransactions($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the customer cash balance transaction belongs
|
||||
* @param string $cashBalanceTransactionId the ID of the customer cash balance transaction to retrieve
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return CustomerCashBalanceTransaction
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieveCashBalanceTransaction($id, $cashBalanceTransactionId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $cashBalanceTransactionId, $params, $opts);
|
||||
}
|
||||
const PATH_SOURCES = '/sources';
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer on which to retrieve the payment sources
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Collection<BankAccount|Card|Source> the list of payment sources (BankAccount, Card or Source)
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allSources($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer on which to create the payment source
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return BankAccount|Card|Source
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function createSource($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the payment source belongs
|
||||
* @param string $sourceId the ID of the payment source to delete
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return BankAccount|Card|Source
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function deleteSource($id, $sourceId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the payment source belongs
|
||||
* @param string $sourceId the ID of the payment source to retrieve
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return BankAccount|Card|Source
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieveSource($id, $sourceId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the customer to which the payment source belongs
|
||||
* @param string $sourceId the ID of the payment source to update
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return BankAccount|Card|Source
|
||||
*
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function updateSource($id, $sourceId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
|
||||
}
|
||||
const PATH_TAX_IDS = '/tax_ids';
|
||||
|
||||
/**
|
||||
@@ -445,9 +445,9 @@ class Customer extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<TaxId> the list of tax ids
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\TaxId> the list of tax ids
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allTaxIds($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -459,9 +459,9 @@ class Customer extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return TaxId
|
||||
*
|
||||
* @return \Stripe\TaxId
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function createTaxId($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -474,9 +474,9 @@ class Customer extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return TaxId
|
||||
*
|
||||
* @return \Stripe\TaxId
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null)
|
||||
{
|
||||
@@ -489,9 +489,9 @@ class Customer extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return TaxId
|
||||
*
|
||||
* @return \Stripe\TaxId
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -15,16 +15,17 @@ namespace Stripe;
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $amount The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's <code>balance</code>.
|
||||
* @property null|Checkout\Session|string $checkout_session The ID of the checkout session (if any) that created the transaction.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|string|\Stripe\CreditNote $credit_note The ID of the credit note (if any) related to the transaction.
|
||||
* @property null|CreditNote|string $credit_note The ID of the credit note (if any) related to the transaction.
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property string|\Stripe\Customer $customer The ID of the customer the transaction belongs to.
|
||||
* @property Customer|string $customer The ID of the customer the transaction belongs to.
|
||||
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
|
||||
* @property int $ending_balance The customer's <code>balance</code> after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice.
|
||||
* @property null|string|\Stripe\Invoice $invoice The ID of the invoice (if any) related to the transaction.
|
||||
* @property null|Invoice|string $invoice The ID of the invoice (if any) related to the transaction.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property string $type Transaction type: <code>adjustment</code>, <code>applied_to_invoice</code>, <code>credit_note</code>, <code>initial</code>, <code>invoice_overpaid</code>, <code>invoice_too_large</code>, <code>invoice_too_small</code>, <code>unspent_receiver_credit</code>, or <code>unapplied_from_invoice</code>. See the <a href="https://stripe.com/docs/billing/customer/balance#types">Customer Balance page</a> to learn more about transaction types.
|
||||
* @property null|StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property string $type Transaction type: <code>adjustment</code>, <code>applied_to_invoice</code>, <code>credit_note</code>, <code>initial</code>, <code>invoice_overpaid</code>, <code>invoice_too_large</code>, <code>invoice_too_small</code>, <code>unspent_receiver_credit</code>, <code>unapplied_from_invoice</code>, <code>checkout_session_subscription_payment</code>, or <code>checkout_session_subscription_payment_canceled</code>. See the <a href="https://stripe.com/docs/billing/customer/balance#types">Customer Balance page</a> to learn more about transaction types.
|
||||
*/
|
||||
class CustomerBalanceTransaction extends ApiResource
|
||||
{
|
||||
@@ -32,6 +33,8 @@ class CustomerBalanceTransaction extends ApiResource
|
||||
|
||||
const TYPE_ADJUSTMENT = 'adjustment';
|
||||
const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice';
|
||||
const TYPE_CHECKOUT_SESSION_SUBSCRIPTION_PAYMENT = 'checkout_session_subscription_payment';
|
||||
const TYPE_CHECKOUT_SESSION_SUBSCRIPTION_PAYMENT_CANCELED = 'checkout_session_subscription_payment_canceled';
|
||||
const TYPE_CREDIT_NOTE = 'credit_note';
|
||||
const TYPE_INITIAL = 'initial';
|
||||
const TYPE_INVOICE_OVERPAID = 'invoice_overpaid';
|
||||
@@ -68,14 +71,14 @@ class CustomerBalanceTransaction extends ApiResource
|
||||
* @param array|string $_id
|
||||
* @param null|array|string $_opts
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
* @throws Exception\BadMethodCallException
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = 'Customer Balance Transactions cannot be retrieved without a ' .
|
||||
'customer ID. Retrieve a Customer Balance Transaction using ' .
|
||||
"`Customer::retrieveBalanceTransaction('customer_id', " .
|
||||
"'balance_transaction_id')`.";
|
||||
$msg = 'Customer Balance Transactions cannot be retrieved without a '
|
||||
. 'customer ID. Retrieve a Customer Balance Transaction using '
|
||||
. "`Customer::retrieveBalanceTransaction('customer_id', "
|
||||
. "'balance_transaction_id')`.";
|
||||
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
@@ -85,14 +88,14 @@ class CustomerBalanceTransaction extends ApiResource
|
||||
* @param null|array $_params
|
||||
* @param null|array|string $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
* @throws Exception\BadMethodCallException
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = 'Customer Balance Transactions cannot be updated without a ' .
|
||||
'customer ID. Update a Customer Balance Transaction using ' .
|
||||
"`Customer::updateBalanceTransaction('customer_id', " .
|
||||
"'balance_transaction_id', \$updateParams)`.";
|
||||
$msg = 'Customer Balance Transactions cannot be updated without a '
|
||||
. 'customer ID. Update a Customer Balance Transaction using '
|
||||
. "`Customer::updateBalanceTransaction('customer_id', "
|
||||
. "'balance_transaction_id', \$updateParams)`.";
|
||||
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
|
||||
@@ -12,19 +12,19 @@ namespace Stripe;
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|\Stripe\StripeObject $adjusted_for_overdraft
|
||||
* @property null|\Stripe\StripeObject $applied_to_payment
|
||||
* @property null|(object{balance_transaction: BalanceTransaction|string, linked_transaction: CustomerCashBalanceTransaction|string}&StripeObject) $adjusted_for_overdraft
|
||||
* @property null|(object{payment_intent: PaymentIntent|string}&StripeObject) $applied_to_payment
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property string|\Stripe\Customer $customer The customer whose available cash balance changed as a result of this transaction.
|
||||
* @property Customer|string $customer The customer whose available cash balance changed as a result of this transaction.
|
||||
* @property int $ending_balance The total available cash balance for the specified currency after this transaction was applied. Represented in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
|
||||
* @property null|\Stripe\StripeObject $funded
|
||||
* @property null|(object{bank_transfer: (object{eu_bank_transfer?: (object{bic: null|string, iban_last4: null|string, sender_name: null|string}&StripeObject), gb_bank_transfer?: (object{account_number_last4: null|string, sender_name: null|string, sort_code: null|string}&StripeObject), jp_bank_transfer?: (object{sender_bank: null|string, sender_branch: null|string, sender_name: null|string}&StripeObject), reference: null|string, type: string, us_bank_transfer?: (object{network?: string, sender_name: null|string}&StripeObject)}&StripeObject)}&StripeObject) $funded
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property int $net_amount The amount by which the cash balance changed, represented in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>. A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance.
|
||||
* @property null|\Stripe\StripeObject $refunded_from_payment
|
||||
* @property null|\Stripe\StripeObject $transferred_to_balance
|
||||
* @property null|(object{refund: Refund|string}&StripeObject) $refunded_from_payment
|
||||
* @property null|(object{balance_transaction: BalanceTransaction|string}&StripeObject) $transferred_to_balance
|
||||
* @property string $type The type of the cash balance transaction. New types may be added in future. See <a href="https://stripe.com/docs/payments/customer-balance#types">Customer Balance</a> to learn more about these types.
|
||||
* @property null|\Stripe\StripeObject $unapplied_from_payment
|
||||
* @property null|(object{payment_intent: PaymentIntent|string}&StripeObject) $unapplied_from_payment
|
||||
*/
|
||||
class CustomerCashBalanceTransaction extends ApiResource
|
||||
{
|
||||
|
||||
@@ -14,9 +14,9 @@ namespace Stripe;
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property string $client_secret <p>The client secret of this Customer Session. Used on the client to set up secure access to the given <code>customer</code>.</p><p>The client secret can be used to provide access to <code>customer</code> from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.</p>
|
||||
* @property null|\Stripe\StripeObject $components Configuration for the components supported by this Customer Session.
|
||||
* @property null|(object{buy_button: (object{enabled: bool}&StripeObject), payment_element: (object{enabled: bool, features: null|(object{payment_method_allow_redisplay_filters: string[], payment_method_redisplay: string, payment_method_redisplay_limit: null|int, payment_method_remove: string, payment_method_save: string, payment_method_save_usage: null|string}&StripeObject)}&StripeObject), pricing_table: (object{enabled: bool}&StripeObject)}&StripeObject) $components Configuration for the components supported by this Customer Session.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string|\Stripe\Customer $customer The Customer the Customer Session was created for.
|
||||
* @property Customer|string $customer The Customer the Customer Session was created for.
|
||||
* @property int $expires_at The timestamp at which this Customer Session will expire.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
*/
|
||||
@@ -29,12 +29,12 @@ class CustomerSession extends ApiResource
|
||||
* you can use on your front-end to grant client-side API access for certain
|
||||
* customer resources.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{components: array{buy_button?: array{enabled: bool}, payment_element?: array{enabled: bool, features?: array{payment_method_allow_redisplay_filters?: string[], payment_method_redisplay?: string, payment_method_redisplay_limit?: int, payment_method_remove?: string, payment_method_save?: string, payment_method_save_usage?: string}}, pricing_table?: array{enabled: bool}}, customer: string, expand?: string[]} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return CustomerSession the created resource
|
||||
*
|
||||
* @return \Stripe\CustomerSession the created resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -42,7 +42,7 @@ class CustomerSession extends ApiResource
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
|
||||
@@ -13,12 +13,12 @@ namespace Stripe;
|
||||
* @property string $id The ID of the discount object. Discounts cannot be fetched by ID. Use <code>expand[]=discounts</code> in API calls to expand discount IDs in an array.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|string $checkout_session The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode.
|
||||
* @property \Stripe\Coupon $coupon A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to <a href="https://stripe.com/docs/api#subscriptions">subscriptions</a>, <a href="https://stripe.com/docs/api#invoices">invoices</a>, <a href="https://stripe.com/docs/api/checkout/sessions">checkout sessions</a>, <a href="https://stripe.com/docs/api#quotes">quotes</a>, and more. Coupons do not work with conventional one-off <a href="https://stripe.com/docs/api#create_charge">charges</a> or <a href="https://stripe.com/docs/api/payment_intents">payment intents</a>.
|
||||
* @property null|string|\Stripe\Customer $customer The ID of the customer associated with this discount.
|
||||
* @property Coupon $coupon A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to <a href="https://stripe.com/docs/api#subscriptions">subscriptions</a>, <a href="https://stripe.com/docs/api#invoices">invoices</a>, <a href="https://stripe.com/docs/api/checkout/sessions">checkout sessions</a>, <a href="https://stripe.com/docs/api#quotes">quotes</a>, and more. Coupons do not work with conventional one-off <a href="https://stripe.com/docs/api#create_charge">charges</a> or <a href="https://stripe.com/docs/api/payment_intents">payment intents</a>.
|
||||
* @property null|Customer|string $customer The ID of the customer associated with this discount.
|
||||
* @property null|int $end If the coupon has a duration of <code>repeating</code>, the date that this discount will end. If the coupon has a duration of <code>once</code> or <code>forever</code>, this attribute will be null.
|
||||
* @property null|string $invoice The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
|
||||
* @property null|string $invoice_item The invoice item <code>id</code> (or invoice line item <code>id</code> for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.
|
||||
* @property null|string|\Stripe\PromotionCode $promotion_code The promotion code applied to create this discount.
|
||||
* @property null|PromotionCode|string $promotion_code The promotion code applied to create this discount.
|
||||
* @property int $start Date that the coupon was applied.
|
||||
* @property null|string $subscription The subscription that this coupon is applied to, if it is applied to a particular subscription.
|
||||
* @property null|string $subscription_item The subscription item that this coupon is applied to, if it is applied to a particular subscription item.
|
||||
|
||||
@@ -14,19 +14,19 @@ namespace Stripe;
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $amount Disputed amount. Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed).
|
||||
* @property \Stripe\BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute.
|
||||
* @property string|\Stripe\Charge $charge ID of the charge that's disputed.
|
||||
* @property BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute.
|
||||
* @property Charge|string $charge ID of the charge that's disputed.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property string[] $enhanced_eligibility_types List of eligibility types that are included in <code>enhanced_evidence</code>.
|
||||
* @property \Stripe\StripeObject $evidence
|
||||
* @property \Stripe\StripeObject $evidence_details
|
||||
* @property (object{access_activity_log: null|string, billing_address: null|string, cancellation_policy: null|File|string, cancellation_policy_disclosure: null|string, cancellation_rebuttal: null|string, customer_communication: null|File|string, customer_email_address: null|string, customer_name: null|string, customer_purchase_ip: null|string, customer_signature: null|File|string, duplicate_charge_documentation: null|File|string, duplicate_charge_explanation: null|string, duplicate_charge_id: null|string, enhanced_evidence: (object{visa_compelling_evidence_3?: (object{disputed_transaction: null|(object{customer_account_id: null|string, customer_device_fingerprint: null|string, customer_device_id: null|string, customer_email_address: null|string, customer_purchase_ip: null|string, merchandise_or_services: null|string, product_description: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject), prior_undisputed_transactions: ((object{charge: string, customer_account_id: null|string, customer_device_fingerprint: null|string, customer_device_id: null|string, customer_email_address: null|string, customer_purchase_ip: null|string, product_description: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject))[]}&StripeObject), visa_compliance?: (object{fee_acknowledged: bool}&StripeObject)}&StripeObject), product_description: null|string, receipt: null|File|string, refund_policy: null|File|string, refund_policy_disclosure: null|string, refund_refusal_explanation: null|string, service_date: null|string, service_documentation: null|File|string, shipping_address: null|string, shipping_carrier: null|string, shipping_date: null|string, shipping_documentation: null|File|string, shipping_tracking_number: null|string, uncategorized_file: null|File|string, uncategorized_text: null|string}&StripeObject) $evidence
|
||||
* @property (object{due_by: null|int, enhanced_eligibility: (object{visa_compelling_evidence_3?: (object{required_actions: string[], status: string}&StripeObject), visa_compliance?: (object{status: string}&StripeObject)}&StripeObject), has_evidence: bool, past_due: bool, submission_count: int}&StripeObject) $evidence_details
|
||||
* @property bool $is_charge_refundable If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|string $network_reason_code Network-dependent reason code for the dispute.
|
||||
* @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that's disputed.
|
||||
* @property null|\Stripe\StripeObject $payment_method_details
|
||||
* @property null|PaymentIntent|string $payment_intent ID of the PaymentIntent that's disputed.
|
||||
* @property null|(object{amazon_pay?: (object{dispute_type: null|string}&StripeObject), card?: (object{brand: string, case_type: string, network_reason_code: null|string}&StripeObject), klarna?: (object{reason_code: null|string}&StripeObject), paypal?: (object{case_id: null|string, reason_code: null|string}&StripeObject), type: string}&StripeObject) $payment_method_details
|
||||
* @property string $reason Reason given by cardholder for dispute. Possible values are <code>bank_cannot_process</code>, <code>check_returned</code>, <code>credit_not_processed</code>, <code>customer_initiated</code>, <code>debit_not_authorized</code>, <code>duplicate</code>, <code>fraudulent</code>, <code>general</code>, <code>incorrect_account_details</code>, <code>insufficient_funds</code>, <code>product_not_received</code>, <code>product_unacceptable</code>, <code>subscription_canceled</code>, or <code>unrecognized</code>. Learn more about <a href="https://stripe.com/docs/disputes/categories">dispute reasons</a>.
|
||||
* @property string $status Current status of dispute. Possible values are <code>warning_needs_response</code>, <code>warning_under_review</code>, <code>warning_closed</code>, <code>needs_response</code>, <code>under_review</code>, <code>won</code>, or <code>lost</code>.
|
||||
*/
|
||||
@@ -62,18 +62,18 @@ class Dispute extends ApiResource
|
||||
/**
|
||||
* Returns a list of your disputes.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{charge?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, payment_intent?: string, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<Dispute> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Dispute> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,13 +82,13 @@ class Dispute extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Dispute
|
||||
*
|
||||
* @return \Stripe\Dispute
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
@@ -107,12 +107,12 @@ class Dispute extends ApiResource
|
||||
* see our <a href="/docs/disputes/categories">guide to dispute types</a>.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{evidence?: array{access_activity_log?: string, billing_address?: string, cancellation_policy?: string, cancellation_policy_disclosure?: string, cancellation_rebuttal?: string, customer_communication?: string, customer_email_address?: string, customer_name?: string, customer_purchase_ip?: string, customer_signature?: string, duplicate_charge_documentation?: string, duplicate_charge_explanation?: string, duplicate_charge_id?: string, enhanced_evidence?: null|array{visa_compelling_evidence_3?: array{disputed_transaction?: array{customer_account_id?: null|string, customer_device_fingerprint?: null|string, customer_device_id?: null|string, customer_email_address?: null|string, customer_purchase_ip?: null|string, merchandise_or_services?: string, product_description?: null|string, shipping_address?: array{city?: null|string, country?: null|string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}}, prior_undisputed_transactions?: (array{charge: string, customer_account_id?: null|string, customer_device_fingerprint?: null|string, customer_device_id?: null|string, customer_email_address?: null|string, customer_purchase_ip?: null|string, product_description?: null|string, shipping_address?: array{city?: null|string, country?: null|string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}})[]}, visa_compliance?: array{fee_acknowledged?: bool}}, product_description?: string, receipt?: string, refund_policy?: string, refund_policy_disclosure?: string, refund_refusal_explanation?: string, service_date?: string, service_documentation?: string, shipping_address?: string, shipping_carrier?: string, shipping_date?: string, shipping_documentation?: string, shipping_tracking_number?: string, uncategorized_file?: string, uncategorized_text?: string}, expand?: string[], metadata?: null|array<string, string>, submit?: bool} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Dispute the updated resource
|
||||
*
|
||||
* @return \Stripe\Dispute the updated resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ class Dispute extends ApiResource
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -130,9 +130,9 @@ class Dispute extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Dispute the closed dispute
|
||||
*
|
||||
* @return \Stripe\Dispute the closed dispute
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function close($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Stripe\Entitlements;
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property string|\Stripe\Entitlements\Feature $feature The <a href="https://stripe.com/docs/api/entitlements/feature">Feature</a> that the customer is entitled to.
|
||||
* @property Feature|string $feature The <a href="https://stripe.com/docs/api/entitlements/feature">Feature</a> that the customer is entitled to.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property string $lookup_key A unique key you provide as your own system identifier. This may be up to 80 characters.
|
||||
*/
|
||||
@@ -20,12 +20,12 @@ class ActiveEntitlement extends \Stripe\ApiResource
|
||||
/**
|
||||
* Retrieve a list of active entitlements for a customer.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{customer: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<ActiveEntitlement> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Entitlements\ActiveEntitlement> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -40,9 +40,9 @@ class ActiveEntitlement extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return ActiveEntitlement
|
||||
*
|
||||
* @return \Stripe\Entitlements\ActiveEntitlement
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Stripe\Entitlements;
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property string $customer The customer that is entitled to this feature.
|
||||
* @property \Stripe\Collection<\Stripe\Entitlements\ActiveEntitlement> $entitlements The list of entitlements this customer has.
|
||||
* @property \Stripe\Collection<ActiveEntitlement> $entitlements The list of entitlements this customer has.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
*/
|
||||
class ActiveEntitlementSummary extends \Stripe\ApiResource
|
||||
|
||||
@@ -25,12 +25,12 @@ class Feature extends \Stripe\ApiResource
|
||||
/**
|
||||
* Creates a feature.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{expand?: string[], lookup_key: string, metadata?: array<string, string>, name: string} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Feature the created resource
|
||||
*
|
||||
* @return \Stripe\Entitlements\Feature the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -47,12 +47,12 @@ class Feature extends \Stripe\ApiResource
|
||||
/**
|
||||
* Retrieve a list of features.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{archived?: bool, ending_before?: string, expand?: string[], limit?: int, lookup_key?: string, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Feature> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Entitlements\Feature> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -67,9 +67,9 @@ class Feature extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Feature
|
||||
*
|
||||
* @return \Stripe\Entitlements\Feature
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
@@ -84,12 +84,12 @@ class Feature extends \Stripe\ApiResource
|
||||
* Update a feature’s metadata or permanently deactivate it.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{active?: bool, expand?: string[], metadata?: null|array<string, string>, name?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Feature the updated resource
|
||||
*
|
||||
* @return \Stripe\Entitlements\Feature the updated resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -19,12 +19,12 @@ class EphemeralKey extends ApiResource
|
||||
/**
|
||||
* Invalidates a short-lived API key for a given resource.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{expand?: string[]} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return EphemeralKey the deleted resource
|
||||
*
|
||||
* @return \Stripe\EphemeralKey the deleted resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function delete($params = null, $opts = null)
|
||||
{
|
||||
@@ -45,10 +45,10 @@ class EphemeralKey extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return EphemeralKey the created key
|
||||
*
|
||||
* @return \Stripe\EphemeralKey the created key
|
||||
* @throws Exception\InvalidArgumentException if stripe_version is missing
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -94,6 +94,7 @@ class ErrorObject extends StripeObject
|
||||
const CODE_FINANCIAL_CONNECTIONS_NO_SUCCESSFUL_TRANSACTION_REFRESH = 'financial_connections_no_successful_transaction_refresh';
|
||||
const CODE_FORWARDING_API_INACTIVE = 'forwarding_api_inactive';
|
||||
const CODE_FORWARDING_API_INVALID_PARAMETER = 'forwarding_api_invalid_parameter';
|
||||
const CODE_FORWARDING_API_RETRYABLE_UPSTREAM_ERROR = 'forwarding_api_retryable_upstream_error';
|
||||
const CODE_FORWARDING_API_UPSTREAM_CONNECTION_ERROR = 'forwarding_api_upstream_connection_error';
|
||||
const CODE_FORWARDING_API_UPSTREAM_CONNECTION_TIMEOUT = 'forwarding_api_upstream_connection_timeout';
|
||||
const CODE_IDEMPOTENCY_KEY_IN_USE = 'idempotency_key_in_use';
|
||||
@@ -190,6 +191,7 @@ class ErrorObject extends StripeObject
|
||||
const CODE_SETUP_INTENT_AUTHENTICATION_FAILURE = 'setup_intent_authentication_failure';
|
||||
const CODE_SETUP_INTENT_INVALID_PARAMETER = 'setup_intent_invalid_parameter';
|
||||
const CODE_SETUP_INTENT_MANDATE_INVALID = 'setup_intent_mandate_invalid';
|
||||
const CODE_SETUP_INTENT_MOBILE_WALLET_UNSUPPORTED = 'setup_intent_mobile_wallet_unsupported';
|
||||
const CODE_SETUP_INTENT_SETUP_ATTEMPT_EXPIRED = 'setup_intent_setup_attempt_expired';
|
||||
const CODE_SETUP_INTENT_UNEXPECTED_STATE = 'setup_intent_unexpected_state';
|
||||
const CODE_SHIPPING_ADDRESS_INVALID = 'shipping_address_invalid';
|
||||
@@ -199,6 +201,7 @@ class ErrorObject extends StripeObject
|
||||
const CODE_STATUS_TRANSITION_INVALID = 'status_transition_invalid';
|
||||
const CODE_STRIPE_TAX_INACTIVE = 'stripe_tax_inactive';
|
||||
const CODE_TAX_ID_INVALID = 'tax_id_invalid';
|
||||
const CODE_TAX_ID_PROHIBITED = 'tax_id_prohibited';
|
||||
const CODE_TAXES_CALCULATION_FAILED = 'taxes_calculation_failed';
|
||||
const CODE_TERMINAL_LOCATION_COUNTRY_UNSUPPORTED = 'terminal_location_country_unsupported';
|
||||
const CODE_TERMINAL_READER_BUSY = 'terminal_reader_busy';
|
||||
|
||||
@@ -43,11 +43,12 @@ namespace Stripe;
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|string $account The connected account that originates the event.
|
||||
* @property null|string $api_version The Stripe API version used to render <code>data</code>. This property is populated only for events on or after October 31, 2014.
|
||||
* @property null|string $context
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property \Stripe\StripeObject $data
|
||||
* @property (object{object: StripeObject, previous_attributes?: StripeObject}&StripeObject) $data
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property int $pending_webhooks Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify.
|
||||
* @property null|\Stripe\StripeObject $request Information on the API request that triggers the event.
|
||||
* @property null|(object{id: null|string, idempotency_key: null|string}&StripeObject) $request Information on the API request that triggers the event.
|
||||
* @property string $type Description of the event (for example, <code>invoice.created</code> or <code>charge.refunded</code>).
|
||||
*/
|
||||
class Event extends ApiResource
|
||||
@@ -65,6 +66,13 @@ class Event extends ApiResource
|
||||
const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
|
||||
const BALANCE_AVAILABLE = 'balance.available';
|
||||
const BILLING_ALERT_TRIGGERED = 'billing.alert.triggered';
|
||||
const BILLING_CREDIT_BALANCE_TRANSACTION_CREATED = 'billing.credit_balance_transaction.created';
|
||||
const BILLING_CREDIT_GRANT_CREATED = 'billing.credit_grant.created';
|
||||
const BILLING_CREDIT_GRANT_UPDATED = 'billing.credit_grant.updated';
|
||||
const BILLING_METER_CREATED = 'billing.meter.created';
|
||||
const BILLING_METER_DEACTIVATED = 'billing.meter.deactivated';
|
||||
const BILLING_METER_REACTIVATED = 'billing.meter.reactivated';
|
||||
const BILLING_METER_UPDATED = 'billing.meter.updated';
|
||||
const BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created';
|
||||
const BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated';
|
||||
const BILLING_PORTAL_SESSION_CREATED = 'billing_portal.session.created';
|
||||
@@ -145,6 +153,7 @@ class Event extends ApiResource
|
||||
const INVOICE_FINALIZED = 'invoice.finalized';
|
||||
const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
|
||||
const INVOICE_OVERDUE = 'invoice.overdue';
|
||||
const INVOICE_OVERPAID = 'invoice.overpaid';
|
||||
const INVOICE_PAID = 'invoice.paid';
|
||||
const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required';
|
||||
const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed';
|
||||
@@ -305,6 +314,10 @@ class Event extends ApiResource
|
||||
const TYPE_APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
|
||||
const TYPE_BALANCE_AVAILABLE = 'balance.available';
|
||||
const TYPE_BILLING_ALERT_TRIGGERED = 'billing.alert.triggered';
|
||||
const TYPE_BILLING_METER_CREATED = 'billing.meter.created';
|
||||
const TYPE_BILLING_METER_DEACTIVATED = 'billing.meter.deactivated';
|
||||
const TYPE_BILLING_METER_REACTIVATED = 'billing.meter.reactivated';
|
||||
const TYPE_BILLING_METER_UPDATED = 'billing.meter.updated';
|
||||
const TYPE_BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created';
|
||||
const TYPE_BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated';
|
||||
const TYPE_BILLING_PORTAL_SESSION_CREATED = 'billing_portal.session.created';
|
||||
@@ -385,6 +398,7 @@ class Event extends ApiResource
|
||||
const TYPE_INVOICE_FINALIZED = 'invoice.finalized';
|
||||
const TYPE_INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
|
||||
const TYPE_INVOICE_OVERDUE = 'invoice.overdue';
|
||||
const TYPE_INVOICE_OVERPAID = 'invoice.overpaid';
|
||||
const TYPE_INVOICE_PAID = 'invoice.paid';
|
||||
const TYPE_INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required';
|
||||
const TYPE_INVOICE_PAYMENT_FAILED = 'invoice.payment_failed';
|
||||
@@ -541,18 +555,18 @@ class Event extends ApiResource
|
||||
* <code>api_version</code> attribute (not according to your current Stripe API
|
||||
* version or <code>Stripe-Version</code> header).
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{created?: array|int, delivery_success?: bool, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string, types?: string[]} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<Event> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Event> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -562,13 +576,13 @@ class Event extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Event
|
||||
*
|
||||
* @return \Stripe\Event
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
|
||||
@@ -6,10 +6,8 @@ namespace Stripe\EventData;
|
||||
|
||||
/**
|
||||
* @property string $developer_message_summary Extra field included in the event's <code>data</code> when fetched from /v2/events.
|
||||
* @property \Stripe\StripeObject $reason This contains information about why meter error happens.
|
||||
* @property (object{error_count: int, error_types: (object{code: string, error_count: int, sample_errors: (object{error_message: string, request: (object{identifier: string}&\Stripe\StripeObject)}&\Stripe\StripeObject)[]}&\Stripe\StripeObject)[]}&\Stripe\StripeObject) $reason This contains information about why meter error happens.
|
||||
* @property int $validation_end The end of the window that is encapsulated by this summary.
|
||||
* @property int $validation_start The start of the window that is encapsulated by this summary.
|
||||
*/
|
||||
class V1BillingMeterErrorReportTriggeredEventData extends \Stripe\StripeObject
|
||||
{
|
||||
}
|
||||
class V1BillingMeterErrorReportTriggeredEventData extends \Stripe\StripeObject {}
|
||||
|
||||
@@ -6,10 +6,8 @@ namespace Stripe\EventData;
|
||||
|
||||
/**
|
||||
* @property string $developer_message_summary Extra field included in the event's <code>data</code> when fetched from /v2/events.
|
||||
* @property \Stripe\StripeObject $reason This contains information about why meter error happens.
|
||||
* @property (object{error_count: int, error_types: (object{code: string, error_count: int, sample_errors: (object{error_message: string, request: (object{identifier: string}&\Stripe\StripeObject)}&\Stripe\StripeObject)[]}&\Stripe\StripeObject)[]}&\Stripe\StripeObject) $reason This contains information about why meter error happens.
|
||||
* @property int $validation_end The end of the window that is encapsulated by this summary.
|
||||
* @property int $validation_start The start of the window that is encapsulated by this summary.
|
||||
*/
|
||||
class V1BillingMeterNoMeterFoundEventData extends \Stripe\StripeObject
|
||||
{
|
||||
}
|
||||
class V1BillingMeterNoMeterFoundEventData extends \Stripe\StripeObject {}
|
||||
|
||||
@@ -15,9 +15,9 @@ class V1BillingMeterErrorReportTriggeredEvent extends \Stripe\V2\Event
|
||||
/**
|
||||
* Retrieves the related object from the API. Make an API request on every call.
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\Billing\Meter
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function fetchRelatedObject()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\Events;
|
||||
|
||||
/**
|
||||
* @property \Stripe\RelatedObject $related_object Object containing the reference to API resource relevant to the event
|
||||
*/
|
||||
class V2CoreEventDestinationPingEvent extends \Stripe\V2\Event
|
||||
{
|
||||
const LOOKUP_TYPE = 'v2.core.event_destination.ping';
|
||||
|
||||
/**
|
||||
* Retrieves the related object from the API. Make an API request on every call.
|
||||
*
|
||||
* @return \Stripe\V2\EventDestination
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function fetchRelatedObject()
|
||||
{
|
||||
$apiMode = \Stripe\Util\Util::getApiMode($this->related_object->url);
|
||||
list($object, $options) = $this->_request(
|
||||
'get',
|
||||
$this->related_object->url,
|
||||
[],
|
||||
['stripe_account' => $this->context],
|
||||
[],
|
||||
$apiMode
|
||||
);
|
||||
|
||||
return \Stripe\Util\Util::convertToStripeObject($object, $options, $apiMode);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,4 @@ namespace Stripe\Exception;
|
||||
* servers. That can be for a variety of different reasons from a downed
|
||||
* network to a bad TLS certificate.
|
||||
*/
|
||||
class ApiConnectionException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
class ApiConnectionException extends ApiErrorException {}
|
||||
|
||||
@@ -6,6 +6,4 @@ namespace Stripe\Exception;
|
||||
* AuthenticationException is thrown when invalid credentials are used to
|
||||
* connect to Stripe's servers.
|
||||
*/
|
||||
class AuthenticationException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
class AuthenticationException extends ApiErrorException {}
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface
|
||||
{
|
||||
}
|
||||
class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface {}
|
||||
|
||||
@@ -7,16 +7,12 @@ if (\interface_exists(\Throwable::class, false)) {
|
||||
/**
|
||||
* The base interface for all Stripe exceptions.
|
||||
*/
|
||||
interface ExceptionInterface extends \Throwable
|
||||
{
|
||||
}
|
||||
interface ExceptionInterface extends \Throwable {}
|
||||
} else {
|
||||
/**
|
||||
* The base interface for all Stripe exceptions.
|
||||
*/
|
||||
// phpcs:disable PSR1.Classes.ClassDeclaration.MultipleClasses
|
||||
interface ExceptionInterface
|
||||
{
|
||||
}
|
||||
interface ExceptionInterface {}
|
||||
// phpcs:enable
|
||||
}
|
||||
|
||||
@@ -6,6 +6,4 @@ namespace Stripe\Exception;
|
||||
* IdempotencyException is thrown in cases where an idempotency key was used
|
||||
* improperly.
|
||||
*/
|
||||
class IdempotencyException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
class IdempotencyException extends ApiErrorException {}
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
|
||||
{
|
||||
}
|
||||
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface {}
|
||||
|
||||
@@ -5,6 +5,4 @@ namespace Stripe\Exception\OAuth;
|
||||
/**
|
||||
* The base interface for all Stripe OAuth exceptions.
|
||||
*/
|
||||
interface ExceptionInterface extends \Stripe\Exception\ExceptionInterface
|
||||
{
|
||||
}
|
||||
interface ExceptionInterface extends \Stripe\Exception\ExceptionInterface {}
|
||||
|
||||
@@ -7,6 +7,4 @@ namespace Stripe\Exception\OAuth;
|
||||
* the stripe_user_id does not exist or is not connected to your application,
|
||||
* or the API key mode (live or test mode) does not match the client_id mode.
|
||||
*/
|
||||
class InvalidClientException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
class InvalidClientException extends OAuthErrorException {}
|
||||
|
||||
@@ -8,6 +8,4 @@ namespace Stripe\Exception\OAuth;
|
||||
* exist, or doesn't belong to you; or if an API key's mode (live or test)
|
||||
* doesn't match the mode of a code or refresh token.
|
||||
*/
|
||||
class InvalidGrantException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
class InvalidGrantException extends OAuthErrorException {}
|
||||
|
||||
@@ -6,6 +6,4 @@ namespace Stripe\Exception\OAuth;
|
||||
* InvalidRequestException is thrown when a code, refresh token, or grant
|
||||
* type parameter is not provided, but was required.
|
||||
*/
|
||||
class InvalidRequestException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
class InvalidRequestException extends OAuthErrorException {}
|
||||
|
||||
@@ -5,6 +5,4 @@ namespace Stripe\Exception\OAuth;
|
||||
/**
|
||||
* InvalidScopeException is thrown when an invalid scope parameter is provided.
|
||||
*/
|
||||
class InvalidScopeException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
class InvalidScopeException extends OAuthErrorException {}
|
||||
|
||||
@@ -7,6 +7,4 @@ namespace Stripe\Exception\OAuth;
|
||||
* error from the OAuth API it doesn't know about. Receiving this error usually
|
||||
* means that your client library is outdated and should be upgraded.
|
||||
*/
|
||||
class UnknownOAuthErrorException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
class UnknownOAuthErrorException extends OAuthErrorException {}
|
||||
|
||||
@@ -6,6 +6,4 @@ namespace Stripe\Exception\OAuth;
|
||||
* UnsupportedGrantTypeException is thrown when an unuspported grant type
|
||||
* parameter is specified.
|
||||
*/
|
||||
class UnsupportedGrantTypeException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
class UnsupportedGrantTypeException extends OAuthErrorException {}
|
||||
|
||||
@@ -6,6 +6,4 @@ namespace Stripe\Exception\OAuth;
|
||||
* UnsupportedResponseTypeException is thrown when an unsupported response type
|
||||
* parameter is specified.
|
||||
*/
|
||||
class UnsupportedResponseTypeException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
class UnsupportedResponseTypeException extends OAuthErrorException {}
|
||||
|
||||
@@ -6,6 +6,4 @@ namespace Stripe\Exception;
|
||||
* PermissionException is thrown in cases where access was attempted on a
|
||||
* resource that wasn't allowed.
|
||||
*/
|
||||
class PermissionException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
class PermissionException extends ApiErrorException {}
|
||||
|
||||
@@ -7,6 +7,4 @@ namespace Stripe\Exception;
|
||||
* load on Stripe's API servers (usually by performing too many requests).
|
||||
* Please back off on request rate.
|
||||
*/
|
||||
class RateLimitException extends InvalidRequestException
|
||||
{
|
||||
}
|
||||
class RateLimitException extends InvalidRequestException {}
|
||||
|
||||
@@ -4,6 +4,4 @@
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
class TemporarySessionExpiredException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
class TemporarySessionExpiredException extends ApiErrorException {}
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
class UnexpectedValueException extends \UnexpectedValueException implements ExceptionInterface
|
||||
{
|
||||
}
|
||||
class UnexpectedValueException extends \UnexpectedValueException implements ExceptionInterface {}
|
||||
|
||||
@@ -7,6 +7,4 @@ namespace Stripe\Exception;
|
||||
* error from the API it doesn't know about. Receiving this error usually
|
||||
* means that your client library is outdated and should be upgraded.
|
||||
*/
|
||||
class UnknownApiErrorException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
class UnknownApiErrorException extends ApiErrorException {}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Stripe;
|
||||
*
|
||||
* @property string $id Unique identifier for the object. Represented as the three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> in lowercase.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property \Stripe\StripeObject $rates Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency.
|
||||
* @property StripeObject $rates Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency.
|
||||
*/
|
||||
class ExchangeRate extends ApiResource
|
||||
{
|
||||
@@ -44,18 +44,18 @@ class ExchangeRate extends ApiResource
|
||||
* Returns a list of objects that contain the rates at which foreign currencies are
|
||||
* converted to one another. Only shows the currencies for which Stripe supports.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<ExchangeRate> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\ExchangeRate> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,13 +65,13 @@ class ExchangeRate extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return ExchangeRate
|
||||
*
|
||||
* @return \Stripe\ExchangeRate
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Stripe;
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|int $expires_at The file expires and isn't available at this time in epoch seconds.
|
||||
* @property null|string $filename The suitable name for saving the file to a filesystem.
|
||||
* @property null|\Stripe\Collection<\Stripe\FileLink> $links A list of <a href="https://stripe.com/docs/api#file_links">file links</a> that point at this file.
|
||||
* @property null|Collection<FileLink> $links A list of <a href="https://stripe.com/docs/api#file_links">file links</a> that point at this file.
|
||||
* @property string $purpose The <a href="https://stripe.com/docs/file-upload#uploading-a-file">purpose</a> of the uploaded file.
|
||||
* @property int $size The size of the file object in bytes.
|
||||
* @property null|string $title A suitable title for the document.
|
||||
@@ -52,18 +52,18 @@ class File extends ApiResource
|
||||
* returns the files by their creation dates, placing the most recently created
|
||||
* files at the top.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, purpose?: string, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<File> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\File> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,13 +74,13 @@ class File extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return File
|
||||
*
|
||||
* @return \Stripe\File
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
@@ -101,19 +101,19 @@ class File extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return File the created file
|
||||
*
|
||||
* @return \Stripe\File the created file
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
if (null === $opts->apiBase) {
|
||||
$opts->apiBase = Stripe::$apiUploadBase;
|
||||
}
|
||||
// Manually flatten params, otherwise curl's multipart encoder will
|
||||
// choke on nested arrays.
|
||||
$flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0);
|
||||
$flatParams = \array_column(Util\Util::flattenParams($params), 1, 0);
|
||||
|
||||
return static::_create($flatParams, $opts);
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ namespace Stripe;
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property bool $expired Returns if the link is already expired.
|
||||
* @property null|int $expires_at Time that the link expires.
|
||||
* @property string|\Stripe\File $file The file object this link points to.
|
||||
* @property File|string $file The file object this link points to.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|string $url The publicly accessible URL to download the file.
|
||||
*/
|
||||
class FileLink extends ApiResource
|
||||
@@ -28,12 +28,12 @@ class FileLink extends ApiResource
|
||||
/**
|
||||
* Creates a new file link object.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{expand?: string[], expires_at?: int, file: string, metadata?: null|array<string, string>} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return FileLink the created resource
|
||||
*
|
||||
* @return \Stripe\FileLink the created resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -41,7 +41,7 @@ class FileLink extends ApiResource
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -50,18 +50,18 @@ class FileLink extends ApiResource
|
||||
/**
|
||||
* Returns a list of file links.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{created?: array|int, ending_before?: string, expand?: string[], expired?: bool, file?: string, limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<FileLink> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\FileLink> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,13 +70,13 @@ class FileLink extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return FileLink
|
||||
*
|
||||
* @return \Stripe\FileLink
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
@@ -87,12 +87,12 @@ class FileLink extends ApiResource
|
||||
* Updates an existing file link object. Expired links can no longer be updated.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{expand?: string[], expires_at?: null|array|int|string, metadata?: null|array<string, string>} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return FileLink the updated resource
|
||||
*
|
||||
* @return \Stripe\FileLink the updated resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -100,7 +100,7 @@ class FileLink extends ApiResource
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
|
||||
@@ -9,23 +9,23 @@ namespace Stripe\FinancialConnections;
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|\Stripe\StripeObject $account_holder The account holder that this account belongs to.
|
||||
* @property null|\Stripe\StripeObject $balance The most recent information about the account's balance.
|
||||
* @property null|\Stripe\StripeObject $balance_refresh The state of the most recent attempt to refresh the account balance.
|
||||
* @property null|(object{account?: string|\Stripe\Account, customer?: string|\Stripe\Customer, type: string}&\Stripe\StripeObject) $account_holder The account holder that this account belongs to.
|
||||
* @property null|(object{as_of: int, cash?: (object{available: null|\Stripe\StripeObject}&\Stripe\StripeObject), credit?: (object{used: null|\Stripe\StripeObject}&\Stripe\StripeObject), current: \Stripe\StripeObject, type: string}&\Stripe\StripeObject) $balance The most recent information about the account's balance.
|
||||
* @property null|(object{last_attempted_at: int, next_refresh_available_at: null|int, status: string}&\Stripe\StripeObject) $balance_refresh The state of the most recent attempt to refresh the account balance.
|
||||
* @property string $category The type of the account. Account category is further divided in <code>subcategory</code>.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|string $display_name A human-readable name that has been assigned to this account, either by the account holder or by the institution.
|
||||
* @property string $institution_name The name of the institution that holds this account.
|
||||
* @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|string|\Stripe\FinancialConnections\AccountOwnership $ownership The most recent information about the account's owners.
|
||||
* @property null|\Stripe\StripeObject $ownership_refresh The state of the most recent attempt to refresh the account owners.
|
||||
* @property null|AccountOwnership|string $ownership The most recent information about the account's owners.
|
||||
* @property null|(object{last_attempted_at: int, next_refresh_available_at: null|int, status: string}&\Stripe\StripeObject) $ownership_refresh The state of the most recent attempt to refresh the account owners.
|
||||
* @property null|string[] $permissions The list of permissions granted by this account.
|
||||
* @property string $status The status of the link to the account.
|
||||
* @property string $subcategory <p>If <code>category</code> is <code>cash</code>, one of:</p><p>- <code>checking</code> - <code>savings</code> - <code>other</code></p><p>If <code>category</code> is <code>credit</code>, one of:</p><p>- <code>mortgage</code> - <code>line_of_credit</code> - <code>credit_card</code> - <code>other</code></p><p>If <code>category</code> is <code>investment</code> or <code>other</code>, this will be <code>other</code>.</p>
|
||||
* @property null|string[] $subscriptions The list of data refresh subscriptions requested on this account.
|
||||
* @property string[] $supported_payment_method_types The <a href="https://stripe.com/docs/api/payment_methods/object#payment_method_object-type">PaymentMethod type</a>(s) that can be created from this account.
|
||||
* @property null|\Stripe\StripeObject $transaction_refresh The state of the most recent attempt to refresh the account transactions.
|
||||
* @property null|(object{id: string, last_attempted_at: int, next_refresh_available_at: null|int, status: string}&\Stripe\StripeObject) $transaction_refresh The state of the most recent attempt to refresh the account transactions.
|
||||
*/
|
||||
class Account extends \Stripe\ApiResource
|
||||
{
|
||||
@@ -50,12 +50,12 @@ class Account extends \Stripe\ApiResource
|
||||
/**
|
||||
* Returns a list of Financial Connections <code>Account</code> objects.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{account_holder?: array{account?: string, customer?: string}, ending_before?: string, expand?: string[], limit?: int, session?: string, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Account> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\FinancialConnections\Account> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -70,9 +70,9 @@ class Account extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Account
|
||||
*
|
||||
* @return \Stripe\FinancialConnections\Account
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
@@ -87,9 +87,9 @@ class Account extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Account the disconnected account
|
||||
*
|
||||
* @return \Stripe\FinancialConnections\Account the disconnected account
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function disconnect($params = null, $opts = null)
|
||||
{
|
||||
@@ -105,9 +105,9 @@ class Account extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<AccountOwner> list of account owners
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\FinancialConnections\AccountOwner> list of account owners
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allOwners($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -123,9 +123,9 @@ class Account extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Account the refreshed account
|
||||
*
|
||||
* @return \Stripe\FinancialConnections\Account the refreshed account
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function refreshAccount($params = null, $opts = null)
|
||||
{
|
||||
@@ -140,9 +140,9 @@ class Account extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Account the subscribed account
|
||||
*
|
||||
* @return \Stripe\FinancialConnections\Account the subscribed account
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function subscribe($params = null, $opts = null)
|
||||
{
|
||||
@@ -157,9 +157,9 @@ class Account extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Account the unsubscribed account
|
||||
*
|
||||
* @return \Stripe\FinancialConnections\Account the unsubscribed account
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function unsubscribe($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Stripe\FinancialConnections;
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property \Stripe\Collection<\Stripe\FinancialConnections\AccountOwner> $owners A paginated list of owners for this account.
|
||||
* @property \Stripe\Collection<AccountOwner> $owners A paginated list of owners for this account.
|
||||
*/
|
||||
class AccountOwnership extends \Stripe\ApiResource
|
||||
{
|
||||
|
||||
@@ -9,10 +9,10 @@ namespace Stripe\FinancialConnections;
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|\Stripe\StripeObject $account_holder The account holder for whom accounts are collected in this session.
|
||||
* @property \Stripe\Collection<\Stripe\FinancialConnections\Account> $accounts The accounts that were collected as part of this Session.
|
||||
* @property null|(object{account?: string|\Stripe\Account, customer?: string|\Stripe\Customer, type: string}&\Stripe\StripeObject) $account_holder The account holder for whom accounts are collected in this session.
|
||||
* @property \Stripe\Collection<Account> $accounts The accounts that were collected as part of this Session.
|
||||
* @property string $client_secret A value that will be passed to the client to launch the authentication flow.
|
||||
* @property null|\Stripe\StripeObject $filters
|
||||
* @property null|(object{account_subcategories: null|string[], countries: null|string[]}&\Stripe\StripeObject) $filters
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property string[] $permissions Permissions requested for accounts collected during this session.
|
||||
* @property null|string[] $prefetch Data features requested to be retrieved upon account creation.
|
||||
@@ -27,12 +27,12 @@ class Session extends \Stripe\ApiResource
|
||||
* <code>Session</code>. The session’s <code>client_secret</code> can be used to
|
||||
* launch the flow using Stripe.js.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{account_holder: array{account?: string, customer?: string, type: string}, expand?: string[], filters?: array{account_subcategories?: string[], countries?: string[]}, permissions: string[], prefetch?: string[], return_url?: string} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Session the created resource
|
||||
*
|
||||
* @return \Stripe\FinancialConnections\Session the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -52,9 +52,9 @@ class Session extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Session
|
||||
*
|
||||
* @return \Stripe\FinancialConnections\Session
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Stripe\FinancialConnections;
|
||||
* @property string $description The description of this transaction.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property string $status The status of the transaction.
|
||||
* @property \Stripe\StripeObject $status_transitions
|
||||
* @property (object{posted_at: null|int, void_at: null|int}&\Stripe\StripeObject) $status_transitions
|
||||
* @property int $transacted_at Time at which the transaction was transacted. Measured in seconds since the Unix epoch.
|
||||
* @property string $transaction_refresh The token of the transaction refresh that last updated or created this transaction.
|
||||
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
|
||||
@@ -31,12 +31,12 @@ class Transaction extends \Stripe\ApiResource
|
||||
/**
|
||||
* Returns a list of Financial Connections <code>Transaction</code> objects.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{account: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, transacted_at?: array|int, transaction_refresh?: array{after: string}} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Transaction> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\FinancialConnections\Transaction> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -51,9 +51,9 @@ class Transaction extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Transaction
|
||||
*
|
||||
* @return \Stripe\FinancialConnections\Transaction
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
|
||||
@@ -29,9 +29,9 @@ namespace Stripe\Forwarding;
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property string $payment_method The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
|
||||
* @property string[] $replacements The field kinds to be replaced in the forwarded request.
|
||||
* @property null|\Stripe\StripeObject $request_context Context about the request from Stripe's servers to the destination endpoint.
|
||||
* @property null|\Stripe\StripeObject $request_details The request that was sent to the destination endpoint. We redact any sensitive fields.
|
||||
* @property null|\Stripe\StripeObject $response_details The response that the destination endpoint returned to us. We redact any sensitive fields.
|
||||
* @property null|(object{destination_duration: int, destination_ip_address: string}&\Stripe\StripeObject) $request_context Context about the request from Stripe's servers to the destination endpoint.
|
||||
* @property null|(object{body: string, headers: (object{name: string, value: string}&\Stripe\StripeObject)[], http_method: string}&\Stripe\StripeObject) $request_details The request that was sent to the destination endpoint. We redact any sensitive fields.
|
||||
* @property null|(object{body: string, headers: (object{name: string, value: string}&\Stripe\StripeObject)[], status: int}&\Stripe\StripeObject) $response_details The response that the destination endpoint returned to us. We redact any sensitive fields.
|
||||
* @property null|string $url The destination URL for the forwarded request. Must be supported by the config.
|
||||
*/
|
||||
class Request extends \Stripe\ApiResource
|
||||
@@ -41,12 +41,12 @@ class Request extends \Stripe\ApiResource
|
||||
/**
|
||||
* Creates a ForwardingRequest object.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{expand?: string[], metadata?: array<string, string>, payment_method: string, replacements: string[], request: array{body?: string, headers?: array{name: string, value: string}[]}, url: string} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Request the created resource
|
||||
*
|
||||
* @return \Stripe\Forwarding\Request the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -63,12 +63,12 @@ class Request extends \Stripe\ApiResource
|
||||
/**
|
||||
* Lists all ForwardingRequest objects.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{created?: array{gt?: int, gte?: int, lt?: int, lte?: int}, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<Request> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Forwarding\Request> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -83,9 +83,9 @@ class Request extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Request
|
||||
*
|
||||
* @return \Stripe\Forwarding\Request
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Stripe;
|
||||
* Related guide: <a href="https://stripe.com/docs/payments/customer-balance/funding-instructions">Customer balance funding instructions</a>.
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property \Stripe\StripeObject $bank_transfer
|
||||
* @property (object{country: string, financial_addresses: ((object{aba?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, routing_number: string}&StripeObject), iban?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bic: string, country: string, iban: string}&StripeObject), sort_code?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), sort_code: string}&StripeObject), spei?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: string, bank_name: string, clabe: string}&StripeObject), supported_networks?: string[], swift?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, swift_code: string}&StripeObject), type: string, zengin?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: null|string, account_number: null|string, account_type: null|string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: null|string, bank_name: null|string, branch_code: null|string, branch_name: null|string}&StripeObject)}&StripeObject))[], type: string}&StripeObject) $bank_transfer
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property string $funding_type The <code>funding_type</code> of the returned instructions
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
|
||||
@@ -12,12 +12,13 @@ interface ClientInterface
|
||||
* @param bool $hasFile Whether or not $params references a file (via an @ prefix or
|
||||
* CURLFile)
|
||||
* @param 'v1'|'v2' $apiMode Specifies if this is a v1 or v2 request
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiConnectionException
|
||||
* @throws \Stripe\Exception\UnexpectedValueException
|
||||
* @param null|int $maxNetworkRetries
|
||||
*
|
||||
* @return array an array whose first element is raw request body, second
|
||||
* element is HTTP status code and third array of HTTP headers
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiConnectionException
|
||||
* @throws \Stripe\Exception\UnexpectedValueException
|
||||
*/
|
||||
public function request($method, $absUrl, $headers, $params, $hasFile, $apiMode = 'v1');
|
||||
public function request($method, $absUrl, $headers, $params, $hasFile, $apiMode = 'v1', $maxNetworkRetries = null);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
|
||||
protected $defaultOptions;
|
||||
|
||||
/** @var \Stripe\Util\RandomGenerator */
|
||||
/** @var Util\RandomGenerator */
|
||||
protected $randomGenerator;
|
||||
|
||||
protected $userAgentInfo;
|
||||
@@ -64,7 +64,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
* throw an exception if $defaultOptions returns a non-array value.
|
||||
*
|
||||
* @param null|array|callable $defaultOptions
|
||||
* @param null|\Stripe\Util\RandomGenerator $randomGenerator
|
||||
* @param null|Util\RandomGenerator $randomGenerator
|
||||
*/
|
||||
public function __construct($defaultOptions = null, $randomGenerator = null)
|
||||
{
|
||||
@@ -340,11 +340,12 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
* @param array $params
|
||||
* @param bool $hasFile
|
||||
* @param 'v1'|'v2' $apiMode
|
||||
* @param null|int $maxNetworkRetries
|
||||
*/
|
||||
public function request($method, $absUrl, $headers, $params, $hasFile, $apiMode = 'v1')
|
||||
public function request($method, $absUrl, $headers, $params, $hasFile, $apiMode = 'v1', $maxNetworkRetries = null)
|
||||
{
|
||||
list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile, $apiMode);
|
||||
list($rbody, $rcode, $rheaders) = $this->executeRequestWithRetries($opts, $absUrl);
|
||||
list($rbody, $rcode, $rheaders) = $this->executeRequestWithRetries($opts, $absUrl, $maxNetworkRetries);
|
||||
|
||||
return [$rbody, $rcode, $rheaders];
|
||||
}
|
||||
@@ -357,12 +358,13 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
* @param bool $hasFile
|
||||
* @param callable $readBodyChunk
|
||||
* @param 'v1'|'v2' $apiMode
|
||||
* @param null|int $maxNetworkRetries
|
||||
*/
|
||||
public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunk, $apiMode = 'v1')
|
||||
public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunk, $apiMode = 'v1', $maxNetworkRetries = null)
|
||||
{
|
||||
list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile, $apiMode);
|
||||
$opts[\CURLOPT_RETURNTRANSFER] = false;
|
||||
list($rbody, $rcode, $rheaders) = $this->executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk);
|
||||
list($rbody, $rcode, $rheaders) = $this->executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk, $maxNetworkRetries);
|
||||
|
||||
return [$rbody, $rcode, $rheaders];
|
||||
}
|
||||
@@ -388,12 +390,12 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
private function useHeadersToDetermineWriteCallback($opts, $determineWriteCallback)
|
||||
{
|
||||
$rheaders = new Util\CaseInsensitiveArray();
|
||||
$headerCallback = function ($curl, $header_line) use (&$rheaders) {
|
||||
$headerCallback = static function ($curl, $header_line) use (&$rheaders) {
|
||||
return self::parseLineIntoHeaderArray($header_line, $rheaders);
|
||||
};
|
||||
|
||||
$writeCallback = null;
|
||||
$writeCallbackWrapper = function ($curl, $data) use (&$writeCallback, &$rheaders, &$determineWriteCallback) {
|
||||
$writeCallbackWrapper = static function ($curl, $data) use (&$writeCallback, &$rheaders, &$determineWriteCallback) {
|
||||
if (null === $writeCallback) {
|
||||
$writeCallback = \call_user_func_array($determineWriteCallback, [$rheaders]);
|
||||
}
|
||||
@@ -426,10 +428,11 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
* @param array $opts cURL options
|
||||
* @param string $absUrl
|
||||
* @param callable $readBodyChunk
|
||||
* @param null|int $maxNetworkRetries
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk)
|
||||
public function executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk, $maxNetworkRetries = null)
|
||||
{
|
||||
/** @var bool */
|
||||
$shouldRetry = false;
|
||||
@@ -452,7 +455,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
$errno = null;
|
||||
$message = null;
|
||||
|
||||
$determineWriteCallback = function ($rheaders) use (&$readBodyChunk, &$shouldRetry, &$rbody, &$numRetries, &$rcode, &$lastRHeaders, &$errno) {
|
||||
$determineWriteCallback = function ($rheaders) use (&$readBodyChunk, &$shouldRetry, &$rbody, &$numRetries, &$rcode, &$lastRHeaders, &$errno, &$maxNetworkRetries) {
|
||||
$lastRHeaders = $rheaders;
|
||||
$errno = \curl_errno($this->curlHandle);
|
||||
|
||||
@@ -462,7 +465,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
if ($rcode < 300) {
|
||||
$rbody = null;
|
||||
|
||||
return function ($curl, $data) use (&$readBodyChunk) {
|
||||
return static function ($curl, $data) use (&$readBodyChunk) {
|
||||
// Don't expose the $curl handle to the user, and don't require them to
|
||||
// return the length of $data.
|
||||
\call_user_func_array($readBodyChunk, [$data]);
|
||||
@@ -471,11 +474,11 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
};
|
||||
}
|
||||
|
||||
$shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries);
|
||||
$shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries, $maxNetworkRetries);
|
||||
|
||||
// Discard the body from an unsuccessful request that should be retried.
|
||||
if ($shouldRetry) {
|
||||
return function ($curl, $data) {
|
||||
return static function ($curl, $data) {
|
||||
return \strlen($data);
|
||||
};
|
||||
} else {
|
||||
@@ -483,7 +486,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
// which exception to throw to the user.
|
||||
$rbody = '';
|
||||
|
||||
return function ($curl, $data) use (&$rbody) {
|
||||
return static function ($curl, $data) use (&$rbody) {
|
||||
$rbody .= $data;
|
||||
|
||||
return \strlen($data);
|
||||
@@ -535,8 +538,9 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
/**
|
||||
* @param array $opts cURL options
|
||||
* @param string $absUrl
|
||||
* @param null|int $maxNetworkRetries
|
||||
*/
|
||||
public function executeRequestWithRetries($opts, $absUrl)
|
||||
public function executeRequestWithRetries($opts, $absUrl, $maxNetworkRetries = null)
|
||||
{
|
||||
$numRetries = 0;
|
||||
|
||||
@@ -547,7 +551,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
|
||||
// Create a callback to capture HTTP headers for the response
|
||||
$rheaders = new Util\CaseInsensitiveArray();
|
||||
$headerCallback = function ($curl, $header_line) use (&$rheaders) {
|
||||
$headerCallback = static function ($curl, $header_line) use (&$rheaders) {
|
||||
return CurlClient::parseLineIntoHeaderArray($header_line, $rheaders);
|
||||
};
|
||||
$opts[\CURLOPT_HEADERFUNCTION] = $headerCallback;
|
||||
@@ -566,7 +570,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
$this->closeCurlHandle();
|
||||
}
|
||||
|
||||
$shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries);
|
||||
$shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries, $maxNetworkRetries);
|
||||
|
||||
if (\is_callable($this->getRequestStatusCallback())) {
|
||||
\call_user_func_array(
|
||||
@@ -643,14 +647,20 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
*
|
||||
* @param int $errno
|
||||
* @param int $rcode
|
||||
* @param array|\Stripe\Util\CaseInsensitiveArray $rheaders
|
||||
* @param array|Util\CaseInsensitiveArray $rheaders
|
||||
* @param int $numRetries
|
||||
* @param null|int $maxNetworkRetries
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function shouldRetry($errno, $rcode, $rheaders, $numRetries)
|
||||
private function shouldRetry($errno, $rcode, $rheaders, $numRetries, $maxNetworkRetries)
|
||||
{
|
||||
if ($numRetries >= Stripe::getMaxNetworkRetries()) {
|
||||
if (null === $maxNetworkRetries) {
|
||||
// all calls from a StripeClient have a number here, so we only see `null` (and use the global configuration) if coming from a non-client call.
|
||||
$maxNetworkRetries = Stripe::getMaxNetworkRetries();
|
||||
}
|
||||
|
||||
if ($numRetries >= $maxNetworkRetries) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -698,7 +708,7 @@ class CurlClient implements ClientInterface, StreamingClientInterface
|
||||
* Provides the number of seconds to wait before retrying a request.
|
||||
*
|
||||
* @param int $numRetries
|
||||
* @param array|\Stripe\Util\CaseInsensitiveArray $rheaders
|
||||
* @param array|Util\CaseInsensitiveArray $rheaders
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
|
||||
@@ -12,12 +12,13 @@ interface StreamingClientInterface
|
||||
* @param bool $hasFile Whether or not $params references a file (via an @ prefix or
|
||||
* CURLFile)
|
||||
* @param callable $readBodyChunkCallable a function that will be called with chunks of bytes from the body if the request is successful
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiConnectionException
|
||||
* @throws \Stripe\Exception\UnexpectedValueException
|
||||
* @param null|int $maxNetworkRetries
|
||||
*
|
||||
* @return array an array whose first element is raw request body, second
|
||||
* element is HTTP status code and third array of HTTP headers
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiConnectionException
|
||||
* @throws \Stripe\Exception\UnexpectedValueException
|
||||
*/
|
||||
public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunkCallable);
|
||||
public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunkCallable, $maxNetworkRetries = null);
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ namespace Stripe\Identity;
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|string $client_reference_id A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|\Stripe\StripeObject $document Result from a document check
|
||||
* @property null|\Stripe\StripeObject $email Result from a email check
|
||||
* @property null|\Stripe\StripeObject $id_number Result from an id_number check
|
||||
* @property null|(object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), dob?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), expiration_date?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), files: null|string[], first_name: null|string, issued_date: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), issuing_country: null|string, last_name: null|string, number?: null|string, status: string, type: null|string}&\Stripe\StripeObject) $document Result from a document check
|
||||
* @property null|(object{email: null|string, error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), status: string}&\Stripe\StripeObject) $email Result from a email check
|
||||
* @property null|(object{dob?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), first_name: null|string, id_number?: null|string, id_number_type: null|string, last_name: null|string, status: string}&\Stripe\StripeObject) $id_number Result from an id_number check
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|\Stripe\StripeObject $options
|
||||
* @property null|\Stripe\StripeObject $phone Result from a phone check
|
||||
* @property null|\Stripe\StripeObject $selfie Result from a selfie check
|
||||
* @property null|(object{document?: (object{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}&\Stripe\StripeObject), id_number?: (object{}&\Stripe\StripeObject)}&\Stripe\StripeObject) $options
|
||||
* @property null|(object{error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), phone: null|string, status: string}&\Stripe\StripeObject) $phone Result from a phone check
|
||||
* @property null|(object{document: null|string, error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), selfie: null|string, status: string}&\Stripe\StripeObject) $selfie Result from a selfie check
|
||||
* @property string $type Type of report.
|
||||
* @property null|string $verification_flow The configuration token of a verification flow from the dashboard.
|
||||
* @property null|string $verification_session ID of the VerificationSession that created this report.
|
||||
@@ -43,12 +43,12 @@ class VerificationReport extends \Stripe\ApiResource
|
||||
/**
|
||||
* List all verification reports.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{client_reference_id?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string, verification_session?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<VerificationReport> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Identity\VerificationReport> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -63,9 +63,9 @@ class VerificationReport extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return VerificationReport
|
||||
*
|
||||
* @return \Stripe\Identity\VerificationReport
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
|
||||
@@ -22,19 +22,19 @@ namespace Stripe\Identity;
|
||||
* @property null|string $client_reference_id A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems.
|
||||
* @property null|string $client_secret The short-lived client secret used by Stripe.js to <a href="https://stripe.com/docs/js/identity/modal">show a verification modal</a> inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on <a href="https://stripe.com/docs/identity/verification-sessions#client-secret">passing the client secret to the frontend</a> to learn more.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|\Stripe\StripeObject $last_error If present, this property tells you the last error encountered when processing the verification.
|
||||
* @property null|string|\Stripe\Identity\VerificationReport $last_verification_report ID of the most recent VerificationReport. <a href="https://stripe.com/docs/identity/verification-sessions#results">Learn more about accessing detailed verification results.</a>
|
||||
* @property null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject) $last_error If present, this property tells you the last error encountered when processing the verification.
|
||||
* @property null|string|VerificationReport $last_verification_report ID of the most recent VerificationReport. <a href="https://stripe.com/docs/identity/verification-sessions#results">Learn more about accessing detailed verification results.</a>
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|\Stripe\StripeObject $options A set of options for the session’s verification checks.
|
||||
* @property null|\Stripe\StripeObject $provided_details Details provided about the user being verified. These details may be shown to the user.
|
||||
* @property null|\Stripe\StripeObject $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
|
||||
* @property null|string $related_customer Token referencing a Customer resource.
|
||||
* @property null|(object{document?: (object{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}&\Stripe\StripeObject), email?: (object{require_verification?: bool}&\Stripe\StripeObject), id_number?: (object{}&\Stripe\StripeObject), phone?: (object{require_verification?: bool}&\Stripe\StripeObject)}&\Stripe\StripeObject) $options A set of options for the session’s verification checks.
|
||||
* @property null|(object{email?: string, phone?: string}&\Stripe\StripeObject) $provided_details Details provided about the user being verified. These details may be shown to the user.
|
||||
* @property null|(object{status: string}&\Stripe\StripeObject) $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
|
||||
* @property null|string $related_customer Customer ID
|
||||
* @property string $status Status of this VerificationSession. <a href="https://stripe.com/docs/identity/how-sessions-work">Learn more about the lifecycle of sessions</a>.
|
||||
* @property string $type The type of <a href="https://stripe.com/docs/identity/verification-checks">verification check</a> to be performed.
|
||||
* @property null|string $url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on <a href="https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect">verifying identity documents</a> to learn how to redirect users to Stripe.
|
||||
* @property null|string $verification_flow The configuration token of a verification flow from the dashboard.
|
||||
* @property null|\Stripe\StripeObject $verified_outputs The user’s verified data.
|
||||
* @property null|(object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), dob?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), email: null|string, first_name: null|string, id_number?: null|string, id_number_type: null|string, last_name: null|string, phone: null|string}&\Stripe\StripeObject) $verified_outputs The user’s verified data.
|
||||
*/
|
||||
class VerificationSession extends \Stripe\ApiResource
|
||||
{
|
||||
@@ -64,12 +64,12 @@ class VerificationSession extends \Stripe\ApiResource
|
||||
* Related guide: <a href="/docs/identity/verify-identity-documents">Verify your
|
||||
* users’ identity documents</a>
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{client_reference_id?: string, expand?: string[], metadata?: array<string, string>, options?: array{document?: null|array{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}}, provided_details?: array{email?: string, phone?: string}, related_customer?: string, return_url?: string, type?: string, verification_flow?: string} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return VerificationSession the created resource
|
||||
*
|
||||
* @return \Stripe\Identity\VerificationSession the created resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -86,12 +86,12 @@ class VerificationSession extends \Stripe\ApiResource
|
||||
/**
|
||||
* Returns a list of VerificationSessions.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{client_reference_id?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, related_customer?: string, starting_after?: string, status?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return \Stripe\Collection<VerificationSession> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Identity\VerificationSession> of ApiResources
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
@@ -110,9 +110,9 @@ class VerificationSession extends \Stripe\ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return VerificationSession
|
||||
*
|
||||
* @return \Stripe\Identity\VerificationSession
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
@@ -130,12 +130,12 @@ class VerificationSession extends \Stripe\ApiResource
|
||||
* to update the verification check and options.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{expand?: string[], metadata?: array<string, string>, options?: array{document?: null|array{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}}, provided_details?: array{email?: string, phone?: string}, type?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return VerificationSession the updated resource
|
||||
*
|
||||
* @return \Stripe\Identity\VerificationSession the updated resource
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -153,9 +153,9 @@ class VerificationSession extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return VerificationSession the canceled verification session
|
||||
*
|
||||
* @return \Stripe\Identity\VerificationSession the canceled verification session
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function cancel($params = null, $opts = null)
|
||||
{
|
||||
@@ -170,9 +170,9 @@ class VerificationSession extends \Stripe\ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return VerificationSession the redacted verification session
|
||||
*
|
||||
* @return \Stripe\Identity\VerificationSession the redacted verification session
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function redact($params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -42,85 +42,77 @@ namespace Stripe;
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|string $account_country The country of the business associated with this invoice, most often the business creating the invoice.
|
||||
* @property null|string $account_name The public name of the business associated with this invoice, most often the business creating the invoice.
|
||||
* @property null|(string|\Stripe\TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
|
||||
* @property null|(string|TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
|
||||
* @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the <code>amount_due</code> may be 0. If there is a positive <code>starting_balance</code> for the invoice (the customer owes money), the <code>amount_due</code> will also take that into account. The charge that gets generated for the invoice will be for the amount specified in <code>amount_due</code>.
|
||||
* @property int $amount_overpaid Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance.
|
||||
* @property int $amount_paid The amount, in cents (or local equivalent), that was paid.
|
||||
* @property int $amount_remaining The difference between amount_due and amount_paid, in cents (or local equivalent).
|
||||
* @property int $amount_shipping This is the sum of all the shipping amounts.
|
||||
* @property null|string|\Stripe\Application $application ID of the Connect Application that created the invoice.
|
||||
* @property null|int $application_fee_amount The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.
|
||||
* @property null|Application|string $application ID of the Connect Application that created the invoice.
|
||||
* @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
|
||||
* @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the <code>invoice.created</code> webhook, for example, so you might not want to display that invoice as unpaid to your users.
|
||||
* @property null|bool $auto_advance Controls whether Stripe performs <a href="https://stripe.com/docs/invoicing/integration/automatic-advancement-collection">automatic collection</a> of the invoice. If <code>false</code>, the invoice's state doesn't automatically advance without an explicit action.
|
||||
* @property \Stripe\StripeObject $automatic_tax
|
||||
* @property (object{disabled_reason: null|string, enabled: bool, liability: null|(object{account?: Account|string, type: string}&StripeObject), provider: null|string, status: null|string}&StripeObject) $automatic_tax
|
||||
* @property null|int $automatically_finalizes_at The time when this invoice is currently scheduled to be automatically finalized. The field will be <code>null</code> if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be <code>null</code> - see <code>finalized_at</code> for the time when an already-finalized invoice was finalized.
|
||||
* @property null|string $billing_reason <p>Indicates the reason why the invoice was created.</p><p>* <code>manual</code>: Unrelated to a subscription, for example, created via the invoice editor. * <code>subscription</code>: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * <code>subscription_create</code>: A new subscription was created. * <code>subscription_cycle</code>: A subscription advanced into a new period. * <code>subscription_threshold</code>: A subscription reached a billing threshold. * <code>subscription_update</code>: A subscription was updated. * <code>upcoming</code>: Reserved for simulated invoices, per the upcoming invoice endpoint.</p>
|
||||
* @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any.
|
||||
* @property string $collection_method Either <code>charge_automatically</code>, or <code>send_invoice</code>. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.
|
||||
* @property null|(object{client_secret: string, type: string}&StripeObject) $confirmation_secret The confirmation secret associated with this invoice. Currently, this contains the client_secret of the PaymentIntent that Stripe creates during invoice finalization.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property null|\Stripe\StripeObject[] $custom_fields Custom fields displayed on the invoice.
|
||||
* @property null|string|\Stripe\Customer $customer The ID of the customer who will be billed.
|
||||
* @property null|\Stripe\StripeObject $customer_address The customer's address. Until the invoice is finalized, this field will equal <code>customer.address</code>. Once the invoice is finalized, this field will no longer be updated.
|
||||
* @property null|(object{name: string, value: string}&StripeObject)[] $custom_fields Custom fields displayed on the invoice.
|
||||
* @property null|Customer|string $customer The ID of the customer who will be billed.
|
||||
* @property null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject) $customer_address The customer's address. Until the invoice is finalized, this field will equal <code>customer.address</code>. Once the invoice is finalized, this field will no longer be updated.
|
||||
* @property null|string $customer_email The customer's email. Until the invoice is finalized, this field will equal <code>customer.email</code>. Once the invoice is finalized, this field will no longer be updated.
|
||||
* @property null|string $customer_name The customer's name. Until the invoice is finalized, this field will equal <code>customer.name</code>. Once the invoice is finalized, this field will no longer be updated.
|
||||
* @property null|string $customer_phone The customer's phone number. Until the invoice is finalized, this field will equal <code>customer.phone</code>. Once the invoice is finalized, this field will no longer be updated.
|
||||
* @property null|\Stripe\StripeObject $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal <code>customer.shipping</code>. Once the invoice is finalized, this field will no longer be updated.
|
||||
* @property null|(object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), carrier?: null|string, name?: string, phone?: null|string, tracking_number?: null|string}&StripeObject) $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal <code>customer.shipping</code>. Once the invoice is finalized, this field will no longer be updated.
|
||||
* @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal <code>customer.tax_exempt</code>. Once the invoice is finalized, this field will no longer be updated.
|
||||
* @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as <code>customer.tax_ids</code>. Once the invoice is finalized, this field will no longer be updated.
|
||||
* @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
|
||||
* @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
|
||||
* @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any.
|
||||
* @property null|((object{type: string, value: null|string}&StripeObject))[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as <code>customer.tax_ids</code>. Once the invoice is finalized, this field will no longer be updated.
|
||||
* @property null|PaymentMethod|string $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
|
||||
* @property null|Account|BankAccount|Card|Source|string $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
|
||||
* @property TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any.
|
||||
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
|
||||
* @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts.
|
||||
* @property (string|\Stripe\Discount)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
|
||||
* @property (Discount|string)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
|
||||
* @property null|int $due_date The date on which payment for this invoice is due. This value will be <code>null</code> for invoices where <code>collection_method=charge_automatically</code>.
|
||||
* @property null|int $effective_at The date when this invoice is in effect. Same as <code>finalized_at</code> unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
|
||||
* @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
|
||||
* @property null|string $footer Footer displayed on the invoice.
|
||||
* @property null|\Stripe\StripeObject $from_invoice Details of the invoice that was cloned. See the <a href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for more details.
|
||||
* @property null|(object{action: string, invoice: Invoice|string}&StripeObject) $from_invoice Details of the invoice that was cloned. See the <a href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for more details.
|
||||
* @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
|
||||
* @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
|
||||
* @property \Stripe\StripeObject $issuer
|
||||
* @property null|\Stripe\StripeObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
|
||||
* @property null|string|\Stripe\Invoice $latest_revision The ID of the most recent non-draft revision of this invoice
|
||||
* @property \Stripe\Collection<\Stripe\InvoiceLineItem> $lines The individual line items that make up the invoice. <code>lines</code> is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
|
||||
* @property (object{account?: Account|string, type: string}&StripeObject) $issuer
|
||||
* @property null|(object{advice_code?: string, charge?: string, code?: string, decline_code?: string, doc_url?: string, message?: string, network_advice_code?: string, network_decline_code?: string, param?: string, payment_intent?: PaymentIntent, payment_method?: PaymentMethod, payment_method_type?: string, request_log_url?: string, setup_intent?: SetupIntent, source?: Account|BankAccount|Card|Source, type: string}&StripeObject) $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
|
||||
* @property null|Invoice|string $latest_revision The ID of the most recent non-draft revision of this invoice
|
||||
* @property Collection<InvoiceLineItem> $lines The individual line items that make up the invoice. <code>lines</code> is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|int $next_payment_attempt The time at which payment will next be attempted. This value will be <code>null</code> for invoices where <code>collection_method=send_invoice</code>.
|
||||
* @property null|string $number A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
|
||||
* @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a> documentation for details.
|
||||
* @property bool $paid Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.
|
||||
* @property bool $paid_out_of_band Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe.
|
||||
* @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent.
|
||||
* @property \Stripe\StripeObject $payment_settings
|
||||
* @property null|Account|string $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a> documentation for details.
|
||||
* @property null|(object{quote_details: null|(object{quote: string}&StripeObject), subscription_details: null|(object{metadata: null|StripeObject, subscription: string|Subscription, subscription_proration_date?: int}&StripeObject), type: string}&StripeObject) $parent The parent that generated this invoice
|
||||
* @property (object{default_mandate: null|string, payment_method_options: null|(object{acss_debit: null|(object{mandate_options?: (object{transaction_type: null|string}&StripeObject), verification_method?: string}&StripeObject), bancontact: null|(object{preferred_language: string}&StripeObject), card: null|(object{installments?: (object{enabled: null|bool}&StripeObject), request_three_d_secure: null|string}&StripeObject), customer_balance: null|(object{bank_transfer?: (object{eu_bank_transfer?: (object{country: string}&StripeObject), type: null|string}&StripeObject), funding_type: null|string}&StripeObject), konbini: null|(object{}&StripeObject), sepa_debit: null|(object{}&StripeObject), us_bank_account: null|(object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&StripeObject), permissions?: string[], prefetch: null|string[]}&StripeObject), verification_method?: string}&StripeObject)}&StripeObject), payment_method_types: null|string[]}&StripeObject) $payment_settings
|
||||
* @property null|Collection<InvoicePayment> $payments Payments for this invoice
|
||||
* @property int $period_end End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the <a href="/api/invoices/line_item#invoice_line_item_object-period">line item period</a> to get the service period for each price.
|
||||
* @property int $period_start Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the <a href="/api/invoices/line_item#invoice_line_item_object-period">line item period</a> to get the service period for each price.
|
||||
* @property int $post_payment_credit_notes_amount Total amount of all post-payment credit notes issued for this invoice.
|
||||
* @property int $pre_payment_credit_notes_amount Total amount of all pre-payment credit notes issued for this invoice.
|
||||
* @property null|string|\Stripe\Quote $quote The quote this invoice was generated from.
|
||||
* @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice.
|
||||
* @property null|\Stripe\StripeObject $rendering The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
|
||||
* @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied on the invoice.
|
||||
* @property null|\Stripe\StripeObject $shipping_details Shipping details for the invoice. The Invoice PDF will use the <code>shipping_details</code> value if it is set, otherwise the PDF will render the shipping address from the customer.
|
||||
* @property null|(object{amount_tax_display: null|string, pdf: null|(object{page_size: null|string}&StripeObject), template: null|string, template_version: null|int}&StripeObject) $rendering The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
|
||||
* @property null|(object{amount_subtotal: int, amount_tax: int, amount_total: int, shipping_rate: null|ShippingRate|string, taxes?: ((object{amount: int, rate: TaxRate, taxability_reason: null|string, taxable_amount: null|int}&StripeObject))[]}&StripeObject) $shipping_cost The details of the cost of shipping, including the ShippingRate applied on the invoice.
|
||||
* @property null|(object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), carrier?: null|string, name?: string, phone?: null|string, tracking_number?: null|string}&StripeObject) $shipping_details Shipping details for the invoice. The Invoice PDF will use the <code>shipping_details</code> value if it is set, otherwise the PDF will render the shipping address from the customer.
|
||||
* @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
|
||||
* @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement.
|
||||
* @property null|string $status The status of the invoice, one of <code>draft</code>, <code>open</code>, <code>paid</code>, <code>uncollectible</code>, or <code>void</code>. <a href="https://stripe.com/docs/billing/invoices/workflow#workflow-overview">Learn more</a>
|
||||
* @property \Stripe\StripeObject $status_transitions
|
||||
* @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any.
|
||||
* @property null|\Stripe\StripeObject $subscription_details Details about the subscription that created this invoice.
|
||||
* @property null|int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
|
||||
* @property (object{finalized_at: null|int, marked_uncollectible_at: null|int, paid_at: null|int, voided_at: null|int}&StripeObject) $status_transitions
|
||||
* @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
|
||||
* @property null|int $subtotal_excluding_tax The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
|
||||
* @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
|
||||
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice belongs to.
|
||||
* @property null|\Stripe\StripeObject $threshold_reason
|
||||
* @property null|string|TestHelpers\TestClock $test_clock ID of the test clock this invoice belongs to.
|
||||
* @property null|(object{amount_gte: null|int, item_reasons: (object{line_item_ids: string[], usage_gte: int}&StripeObject)[]}&StripeObject) $threshold_reason
|
||||
* @property int $total Total after discounts and taxes.
|
||||
* @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items.
|
||||
* @property null|((object{amount: int, discount: Discount|string}&StripeObject))[] $total_discount_amounts The aggregate amounts calculated per discount across all line items.
|
||||
* @property null|int $total_excluding_tax The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
|
||||
* @property null|\Stripe\StripeObject[] $total_pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
|
||||
* @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items.
|
||||
* @property null|\Stripe\StripeObject $transfer_data The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.
|
||||
* @property null|((object{amount: int, credit_balance_transaction?: null|Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $total_pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
|
||||
* @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $total_taxes The aggregate tax information of all line items.
|
||||
* @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have <a href="https://stripe.com/docs/billing/webhooks#understand">been exhausted</a>. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
|
||||
*/
|
||||
class Invoice extends ApiResource
|
||||
@@ -159,12 +151,12 @@ class Invoice extends ApiResource
|
||||
* allows you to <a href="#pay_invoice">pay</a> or <a href="#send_invoice">send</a>
|
||||
* the invoice to your customers.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{account_tax_ids?: null|string[], application_fee_amount?: int, auto_advance?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, automatically_finalizes_at?: int, collection_method?: string, currency?: string, custom_fields?: null|array{name: string, value: string}[], customer?: string, days_until_due?: int, default_payment_method?: string, default_source?: string, default_tax_rates?: string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], due_date?: int, effective_at?: int, expand?: string[], footer?: string, from_invoice?: array{action: string, invoice: string}, issuer?: array{account?: string, type: string}, metadata?: null|array<string, string>, number?: string, on_behalf_of?: string, payment_settings?: array{default_mandate?: null|string, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[]}, pending_invoice_items_behavior?: string, rendering?: array{amount_tax_display?: null|string, pdf?: array{page_size?: string}, template?: string, template_version?: null|int}, shipping_cost?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array<string, array{amount: int, tax_behavior?: string}>}, metadata?: array<string, string>, tax_behavior?: string, tax_code?: string, type?: string}}, shipping_details?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}, statement_descriptor?: string, subscription?: string, transfer_data?: array{amount?: int, destination: string}} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the created resource
|
||||
*
|
||||
* @return \Stripe\Invoice the created resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -172,7 +164,7 @@ class Invoice extends ApiResource
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -187,9 +179,9 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the deleted resource
|
||||
*
|
||||
* @return \Stripe\Invoice the deleted resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function delete($params = null, $opts = null)
|
||||
{
|
||||
@@ -207,18 +199,18 @@ class Invoice extends ApiResource
|
||||
* invoices are returned sorted by creation date, with the most recently created
|
||||
* invoices appearing first.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{collection_method?: string, created?: array|int, customer?: string, due_date?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string, subscription?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<Invoice> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\Invoice> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,13 +219,13 @@ class Invoice extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice
|
||||
*
|
||||
* @return \Stripe\Invoice
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
@@ -251,12 +243,12 @@ class Invoice extends ApiResource
|
||||
* invoices, pass <code>auto_advance=false</code>.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{account_tax_ids?: null|string[], application_fee_amount?: int, auto_advance?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, automatically_finalizes_at?: int, collection_method?: string, custom_fields?: null|array{name: string, value: string}[], days_until_due?: int, default_payment_method?: string, default_source?: null|string, default_tax_rates?: null|string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], due_date?: int, effective_at?: null|int, expand?: string[], footer?: string, issuer?: array{account?: string, type: string}, metadata?: null|array<string, string>, number?: null|string, on_behalf_of?: null|string, payment_settings?: array{default_mandate?: null|string, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[]}, rendering?: array{amount_tax_display?: null|string, pdf?: array{page_size?: string}, template?: string, template_version?: null|int}, shipping_cost?: null|array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array<string, array{amount: int, tax_behavior?: string}>}, metadata?: array<string, string>, tax_behavior?: string, tax_code?: string, type?: string}}, shipping_details?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}, statement_descriptor?: string, transfer_data?: null|array{amount?: int, destination: string}} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the updated resource
|
||||
*
|
||||
* @return \Stripe\Invoice the updated resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -264,7 +256,7 @@ class Invoice extends ApiResource
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -277,9 +269,9 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the added invoice
|
||||
*
|
||||
* @return \Stripe\Invoice the added invoice
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function addLines($params = null, $opts = null)
|
||||
{
|
||||
@@ -294,15 +286,15 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the created invoice
|
||||
*
|
||||
* @return \Stripe\Invoice the created invoice
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function createPreview($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl() . '/create_preview';
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -312,9 +304,9 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the finalized invoice
|
||||
*
|
||||
* @return \Stripe\Invoice the finalized invoice
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function finalizeInvoice($params = null, $opts = null)
|
||||
{
|
||||
@@ -329,9 +321,9 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the uncollectible invoice
|
||||
*
|
||||
* @return \Stripe\Invoice the uncollectible invoice
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function markUncollectible($params = null, $opts = null)
|
||||
{
|
||||
@@ -346,9 +338,9 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the paid invoice
|
||||
*
|
||||
* @return \Stripe\Invoice the paid invoice
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function pay($params = null, $opts = null)
|
||||
{
|
||||
@@ -363,9 +355,9 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the removed invoice
|
||||
*
|
||||
* @return \Stripe\Invoice the removed invoice
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function removeLines($params = null, $opts = null)
|
||||
{
|
||||
@@ -380,9 +372,9 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the sent invoice
|
||||
*
|
||||
* @return \Stripe\Invoice the sent invoice
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function sendInvoice($params = null, $opts = null)
|
||||
{
|
||||
@@ -397,45 +389,9 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the updated invoice
|
||||
*
|
||||
* @return \Stripe\Invoice the upcoming invoice
|
||||
*/
|
||||
public static function upcoming($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl() . '/upcoming';
|
||||
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\InvoiceLineItem> list of invoice line items
|
||||
*/
|
||||
public static function upcomingLines($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl() . '/upcoming/lines';
|
||||
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\Invoice the updated invoice
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function updateLines($params = null, $opts = null)
|
||||
{
|
||||
@@ -450,9 +406,9 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Invoice the voided invoice
|
||||
*
|
||||
* @return \Stripe\Invoice the voided invoice
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function voidInvoice($params = null, $opts = null)
|
||||
{
|
||||
@@ -467,15 +423,15 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return SearchResult<Invoice> the invoice search results
|
||||
*
|
||||
* @return \Stripe\SearchResult<\Stripe\Invoice> the invoice search results
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function search($params = null, $opts = null)
|
||||
{
|
||||
$url = '/v1/invoices/search';
|
||||
|
||||
return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts);
|
||||
return static::_requestPage($url, SearchResult::class, $params, $opts);
|
||||
}
|
||||
|
||||
const PATH_LINES = '/lines';
|
||||
@@ -485,9 +441,9 @@ class Invoice extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<InvoiceLineItem> the list of invoice line items
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\InvoiceLineItem> the list of invoice line items
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allLines($id, $params = null, $opts = null)
|
||||
{
|
||||
|
||||
@@ -21,25 +21,21 @@ namespace Stripe;
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $amount Amount (in the <code>currency</code> specified) of the invoice item. This should always be equal to <code>unit_amount * quantity</code>.
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property string|\Stripe\Customer $customer The ID of the customer who will be billed when this invoice item is billed.
|
||||
* @property Customer|string $customer The ID of the customer who will be billed when this invoice item is billed.
|
||||
* @property int $date Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
|
||||
* @property bool $discountable If true, discounts will apply to this invoice item. Always false for prorations.
|
||||
* @property null|(string|\Stripe\Discount)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
|
||||
* @property null|string|\Stripe\Invoice $invoice The ID of the invoice this invoice item belongs to.
|
||||
* @property null|(Discount|string)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
|
||||
* @property null|Invoice|string $invoice The ID of the invoice this invoice item belongs to.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property \Stripe\StripeObject $period
|
||||
* @property null|\Stripe\Plan $plan If the invoice item is a proration, the plan of the subscription that the proration was computed for.
|
||||
* @property null|\Stripe\Price $price The price of the invoice item.
|
||||
* @property null|StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|(object{subscription_details: null|(object{subscription: string, subscription_item?: string}&StripeObject), type: string}&StripeObject) $parent The parent that generated this invoice
|
||||
* @property (object{end: int, start: int}&StripeObject) $period
|
||||
* @property null|(object{price_details?: (object{price: string, product: string}&StripeObject), type: string, unit_amount_decimal: null|string}&StripeObject) $pricing The pricing information of the invoice item.
|
||||
* @property bool $proration Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.
|
||||
* @property int $quantity Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for.
|
||||
* @property null|string|\Stripe\Subscription $subscription The subscription that this invoice item has been created for, if any.
|
||||
* @property null|string $subscription_item The subscription item that this invoice item has been created for, if any.
|
||||
* @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the <code>default_tax_rates</code> on the invoice do not apply to this invoice item.
|
||||
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice item belongs to.
|
||||
* @property null|int $unit_amount Unit amount (in the <code>currency</code> specified) of the invoice item.
|
||||
* @property null|string $unit_amount_decimal Same as <code>unit_amount</code>, but contains a decimal value with at most 12 decimal places.
|
||||
* @property null|TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the <code>default_tax_rates</code> on the invoice do not apply to this invoice item.
|
||||
* @property null|string|TestHelpers\TestClock $test_clock ID of the test clock this invoice item belongs to.
|
||||
*/
|
||||
class InvoiceItem extends ApiResource
|
||||
{
|
||||
@@ -52,12 +48,12 @@ class InvoiceItem extends ApiResource
|
||||
* no invoice is specified, the item will be on the next invoice created for the
|
||||
* customer specified.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{amount?: int, currency?: string, customer: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice?: string, metadata?: null|array<string, string>, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, subscription?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: string[], unit_amount_decimal?: string} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return InvoiceItem the created resource
|
||||
*
|
||||
* @return \Stripe\InvoiceItem the created resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
@@ -65,7 +61,7 @@ class InvoiceItem extends ApiResource
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
@@ -79,9 +75,9 @@ class InvoiceItem extends ApiResource
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return InvoiceItem the deleted resource
|
||||
*
|
||||
* @return \Stripe\InvoiceItem the deleted resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function delete($params = null, $opts = null)
|
||||
{
|
||||
@@ -98,18 +94,18 @@ class InvoiceItem extends ApiResource
|
||||
* Returns a list of your invoice items. Invoice items are returned sorted by
|
||||
* creation date, with the most recently created invoice items appearing first.
|
||||
*
|
||||
* @param null|array $params
|
||||
* @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], invoice?: string, limit?: int, pending?: bool, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return Collection<InvoiceItem> of ApiResources
|
||||
*
|
||||
* @return \Stripe\Collection<\Stripe\InvoiceItem> of ApiResources
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
return static::_requestPage($url, Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,13 +114,13 @@ class InvoiceItem extends ApiResource
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return InvoiceItem
|
||||
*
|
||||
* @return \Stripe\InvoiceItem
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$opts = Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
@@ -137,12 +133,12 @@ class InvoiceItem extends ApiResource
|
||||
* closed.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array<string, string>, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount_decimal?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return InvoiceItem the updated resource
|
||||
*
|
||||
* @return \Stripe\InvoiceItem the updated resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -150,7 +146,7 @@ class InvoiceItem extends ApiResource
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
|
||||
@@ -12,29 +12,21 @@ namespace Stripe;
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $amount The amount, in cents (or local equivalent).
|
||||
* @property null|int $amount_excluding_tax The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts.
|
||||
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
|
||||
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
|
||||
* @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item.
|
||||
* @property null|((object{amount: int, discount: Discount|string}&StripeObject))[] $discount_amounts The amount of discount calculated per discount for this line item.
|
||||
* @property bool $discountable If true, discounts will apply to this line item. Always false for prorations.
|
||||
* @property (string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
|
||||
* @property (Discount|string)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
|
||||
* @property null|string $invoice The ID of the invoice that contains this line item.
|
||||
* @property null|string|\Stripe\InvoiceItem $invoice_item The ID of the <a href="https://stripe.com/docs/api/invoiceitems">invoice item</a> associated with this line item if any.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with <code>type=subscription</code>, <code>metadata</code> reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
|
||||
* @property \Stripe\StripeObject $period
|
||||
* @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration.
|
||||
* @property null|\Stripe\StripeObject[] $pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.
|
||||
* @property null|\Stripe\Price $price The price of the line item.
|
||||
* @property bool $proration Whether this is a proration.
|
||||
* @property null|\Stripe\StripeObject $proration_details Additional details for proration line items
|
||||
* @property StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with <code>type=subscription</code>, <code>metadata</code> reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
|
||||
* @property null|(object{invoice_item_details: null|(object{invoice_item: string, proration: bool, proration_details: null|(object{credited_items: null|(object{invoice: string, invoice_line_items: string[]}&StripeObject)}&StripeObject), subscription: null|string}&StripeObject), subscription_item_details: null|(object{invoice_item: null|string, proration: bool, proration_details: null|(object{credited_items: null|(object{invoice: string, invoice_line_items: string[]}&StripeObject)}&StripeObject), subscription: null|string, subscription_item: string}&StripeObject), type: string}&StripeObject) $parent The parent that generated this invoice
|
||||
* @property (object{end: int, start: int}&StripeObject) $period
|
||||
* @property null|((object{amount: int, credit_balance_transaction?: null|Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.
|
||||
* @property null|(object{price_details?: (object{price: string, product: string}&StripeObject), type: string, unit_amount_decimal: null|string}&StripeObject) $pricing The pricing information of the line item.
|
||||
* @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration.
|
||||
* @property null|string|\Stripe\Subscription $subscription The subscription that the invoice item pertains to, if any.
|
||||
* @property null|string|\Stripe\SubscriptionItem $subscription_item The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription.
|
||||
* @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item
|
||||
* @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item.
|
||||
* @property string $type A string identifying the type of the source of this line item, either an <code>invoiceitem</code> or a <code>subscription</code>.
|
||||
* @property null|string $unit_amount_excluding_tax The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts.
|
||||
* @property null|string|Subscription $subscription
|
||||
* @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $taxes The tax information of the line item.
|
||||
*/
|
||||
class InvoiceLineItem extends ApiResource
|
||||
{
|
||||
@@ -51,12 +43,12 @@ class InvoiceLineItem extends ApiResource
|
||||
* before the invoice is finalized.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array $params
|
||||
* @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array<string, string>, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array<string, string>, name: string, tax_code?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
* @return InvoiceLineItem the updated resource
|
||||
*
|
||||
* @return \Stripe\InvoiceLineItem the updated resource
|
||||
* @throws Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
@@ -64,7 +56,7 @@ class InvoiceLineItem extends ApiResource
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user