Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wpforms-.../vendor_p.../stripe/stripe-p.../lib
File: Account.php
<?php
[0] Fix | Delete
[1] Fix | Delete
// File generated from our OpenAPI spec
[2] Fix | Delete
namespace WPForms\Vendor\Stripe;
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* This is an object representing a Stripe account. You can retrieve it to see
[6] Fix | Delete
* properties on the account like its current requirements or if the account is
[7] Fix | Delete
* enabled to make live charges or receive payouts.
[8] Fix | Delete
*
[9] Fix | Delete
* For Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that
[10] Fix | Delete
* account has started to go through Connect Onboarding. Once you create an <a href="https://stripe.com/docs/api/account_links">Account Link</a> or <a href="https://stripe.com/docs/api/account_sessions">Account Session</a>,
[11] Fix | Delete
* some properties are only returned for Custom accounts. Learn about the differences <a href="https://stripe.com/docs/connect/accounts">between accounts</a>.
[12] Fix | Delete
*
[13] Fix | Delete
* @property string $id Unique identifier for the object.
[14] Fix | Delete
* @property string $object String representing the object's type. Objects of the same type share the same value.
[15] Fix | Delete
* @property null|\Stripe\StripeObject $business_profile Business information about the account.
[16] Fix | Delete
* @property null|string $business_type The business type. Once you create an <a href="https://stripe.com/docs/api/account_links">Account Link</a> or <a href="https://stripe.com/docs/api/account_sessions">Account Session</a>, this property is only returned for Custom accounts.
[17] Fix | Delete
* @property null|\Stripe\StripeObject $capabilities
[18] Fix | Delete
* @property null|bool $charges_enabled Whether the account can create live charges.
[19] Fix | Delete
* @property null|\Stripe\StripeObject $company
[20] Fix | Delete
* @property null|\Stripe\StripeObject $controller
[21] Fix | Delete
* @property null|string $country The account's country.
[22] Fix | Delete
* @property null|int $created Time at which the account was connected. Measured in seconds since the Unix epoch.
[23] Fix | Delete
* @property null|string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that <a href="https://stripe.com/docs/payouts">Stripe supports in the account's country</a>.
[24] Fix | Delete
* @property null|bool $details_submitted Whether account details have been submitted. Standard accounts cannot receive payouts before this is true.
[25] Fix | Delete
* @property null|string $email An email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform.
[26] Fix | Delete
* @property null|\Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> $external_accounts External accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where <code>controller[is_controller]</code> is true.
[27] Fix | Delete
* @property null|\Stripe\StripeObject $future_requirements
[28] Fix | Delete
* @property null|\Stripe\Person $individual <p>This is an object representing a person associated with a Stripe account.</p><p>A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. See the <a href="https://stripe.com/docs/connect/standard-accounts">Standard onboarding</a> or <a href="https://stripe.com/docs/connect/express-accounts">Express onboarding documentation</a> for information about platform prefilling and account onboarding steps.</p><p>Related guide: <a href="https://stripe.com/docs/connect/handling-api-verification#person-information">Handling identity verification with the API</a></p>
[29] Fix | Delete
* @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.
[30] Fix | Delete
* @property null|bool $payouts_enabled Whether Stripe can send payouts to this account.
[31] Fix | Delete
* @property null|\Stripe\StripeObject $requirements
[32] Fix | Delete
* @property null|\Stripe\StripeObject $settings Options for customizing how the account functions within Stripe.
[33] Fix | Delete
* @property null|\Stripe\StripeObject $tos_acceptance
[34] Fix | Delete
* @property null|string $type The Stripe account type. Can be <code>standard</code>, <code>express</code>, or <code>custom</code>.
[35] Fix | Delete
*/
[36] Fix | Delete
class Account extends ApiResource
[37] Fix | Delete
{
[38] Fix | Delete
const OBJECT_NAME = 'account';
[39] Fix | Delete
use ApiOperations\All;
[40] Fix | Delete
use ApiOperations\Create;
[41] Fix | Delete
use ApiOperations\Delete;
[42] Fix | Delete
use ApiOperations\NestedResource;
[43] Fix | Delete
use ApiOperations\Update;
[44] Fix | Delete
const BUSINESS_TYPE_COMPANY = 'company';
[45] Fix | Delete
const BUSINESS_TYPE_GOVERNMENT_ENTITY = 'government_entity';
[46] Fix | Delete
const BUSINESS_TYPE_INDIVIDUAL = 'individual';
[47] Fix | Delete
const BUSINESS_TYPE_NON_PROFIT = 'non_profit';
[48] Fix | Delete
const TYPE_CUSTOM = 'custom';
[49] Fix | Delete
const TYPE_EXPRESS = 'express';
[50] Fix | Delete
const TYPE_STANDARD = 'standard';
[51] Fix | Delete
use ApiOperations\Retrieve {
[52] Fix | Delete
retrieve as protected _retrieve;
[53] Fix | Delete
}
[54] Fix | Delete
public static function getSavedNestedResources()
[55] Fix | Delete
{
[56] Fix | Delete
static $savedNestedResources = null;
[57] Fix | Delete
if (null === $savedNestedResources) {
[58] Fix | Delete
$savedNestedResources = new Util\Set(['external_account', 'bank_account']);
[59] Fix | Delete
}
[60] Fix | Delete
return $savedNestedResources;
[61] Fix | Delete
}
[62] Fix | Delete
public function instanceUrl()
[63] Fix | Delete
{
[64] Fix | Delete
if (null === $this['id']) {
[65] Fix | Delete
return '/v1/account';
[66] Fix | Delete
}
[67] Fix | Delete
return parent::instanceUrl();
[68] Fix | Delete
}
[69] Fix | Delete
/**
[70] Fix | Delete
* @param null|array|string $id the ID of the account to retrieve, or an
[71] Fix | Delete
* options array containing an `id` key
[72] Fix | Delete
* @param null|array|string $opts
[73] Fix | Delete
*
[74] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[75] Fix | Delete
*
[76] Fix | Delete
* @return \Stripe\Account
[77] Fix | Delete
*/
[78] Fix | Delete
public static function retrieve($id = null, $opts = null)
[79] Fix | Delete
{
[80] Fix | Delete
if (!$opts && \is_string($id) && 'sk_' === \substr($id, 0, 3)) {
[81] Fix | Delete
$opts = $id;
[82] Fix | Delete
$id = null;
[83] Fix | Delete
}
[84] Fix | Delete
return self::_retrieve($id, $opts);
[85] Fix | Delete
}
[86] Fix | Delete
public function serializeParameters($force = \false)
[87] Fix | Delete
{
[88] Fix | Delete
$update = parent::serializeParameters($force);
[89] Fix | Delete
if (isset($this->_values['legal_entity'])) {
[90] Fix | Delete
$entity = $this['legal_entity'];
[91] Fix | Delete
if (isset($entity->_values['additional_owners'])) {
[92] Fix | Delete
$owners = $entity['additional_owners'];
[93] Fix | Delete
$entityUpdate = isset($update['legal_entity']) ? $update['legal_entity'] : [];
[94] Fix | Delete
$entityUpdate['additional_owners'] = $this->serializeAdditionalOwners($entity, $owners);
[95] Fix | Delete
$update['legal_entity'] = $entityUpdate;
[96] Fix | Delete
}
[97] Fix | Delete
}
[98] Fix | Delete
if (isset($this->_values['individual'])) {
[99] Fix | Delete
$individual = $this['individual'];
[100] Fix | Delete
if ($individual instanceof Person && !isset($update['individual'])) {
[101] Fix | Delete
$update['individual'] = $individual->serializeParameters($force);
[102] Fix | Delete
}
[103] Fix | Delete
}
[104] Fix | Delete
return $update;
[105] Fix | Delete
}
[106] Fix | Delete
private function serializeAdditionalOwners($legalEntity, $additionalOwners)
[107] Fix | Delete
{
[108] Fix | Delete
if (isset($legalEntity->_originalValues['additional_owners'])) {
[109] Fix | Delete
$originalValue = $legalEntity->_originalValues['additional_owners'];
[110] Fix | Delete
} else {
[111] Fix | Delete
$originalValue = [];
[112] Fix | Delete
}
[113] Fix | Delete
if ($originalValue && \count($originalValue) > \count($additionalOwners)) {
[114] Fix | Delete
throw new Exception\InvalidArgumentException('You cannot delete an item from an array, you must instead set a new array');
[115] Fix | Delete
}
[116] Fix | Delete
$updateArr = [];
[117] Fix | Delete
foreach ($additionalOwners as $i => $v) {
[118] Fix | Delete
$update = $v instanceof StripeObject ? $v->serializeParameters() : $v;
[119] Fix | Delete
if ([] !== $update) {
[120] Fix | Delete
if (!$originalValue || !\array_key_exists($i, $originalValue) || $update !== $legalEntity->serializeParamsValue($originalValue[$i], null, \false, \true)) {
[121] Fix | Delete
$updateArr[$i] = $update;
[122] Fix | Delete
}
[123] Fix | Delete
}
[124] Fix | Delete
}
[125] Fix | Delete
return $updateArr;
[126] Fix | Delete
}
[127] Fix | Delete
/**
[128] Fix | Delete
* @param null|array $clientId
[129] Fix | Delete
* @param null|array|string $opts
[130] Fix | Delete
*
[131] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[132] Fix | Delete
*
[133] Fix | Delete
* @return \Stripe\StripeObject object containing the response from the API
[134] Fix | Delete
*/
[135] Fix | Delete
public function deauthorize($clientId = null, $opts = null)
[136] Fix | Delete
{
[137] Fix | Delete
$params = ['client_id' => $clientId, 'stripe_user_id' => $this->id];
[138] Fix | Delete
return OAuth::deauthorize($params, $opts);
[139] Fix | Delete
}
[140] Fix | Delete
/**
[141] Fix | Delete
* @param null|array $params
[142] Fix | Delete
* @param null|array|string $opts
[143] Fix | Delete
*
[144] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[145] Fix | Delete
*
[146] Fix | Delete
* @return \Stripe\Account the rejected account
[147] Fix | Delete
*/
[148] Fix | Delete
public function reject($params = null, $opts = null)
[149] Fix | Delete
{
[150] Fix | Delete
$url = $this->instanceUrl() . '/reject';
[151] Fix | Delete
list($response, $opts) = $this->_request('post', $url, $params, $opts);
[152] Fix | Delete
$this->refreshFrom($response, $opts);
[153] Fix | Delete
return $this;
[154] Fix | Delete
}
[155] Fix | Delete
const PATH_CAPABILITIES = '/capabilities';
[156] Fix | Delete
/**
[157] Fix | Delete
* @param string $id the ID of the account on which to retrieve the capabilities
[158] Fix | Delete
* @param null|array $params
[159] Fix | Delete
* @param null|array|string $opts
[160] Fix | Delete
*
[161] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[162] Fix | Delete
*
[163] Fix | Delete
* @return \Stripe\Collection<\Stripe\Capability> the list of capabilities
[164] Fix | Delete
*/
[165] Fix | Delete
public static function allCapabilities($id, $params = null, $opts = null)
[166] Fix | Delete
{
[167] Fix | Delete
return self::_allNestedResources($id, static::PATH_CAPABILITIES, $params, $opts);
[168] Fix | Delete
}
[169] Fix | Delete
/**
[170] Fix | Delete
* @param string $id the ID of the account to which the capability belongs
[171] Fix | Delete
* @param string $capabilityId the ID of the capability to retrieve
[172] Fix | Delete
* @param null|array $params
[173] Fix | Delete
* @param null|array|string $opts
[174] Fix | Delete
*
[175] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[176] Fix | Delete
*
[177] Fix | Delete
* @return \Stripe\Capability
[178] Fix | Delete
*/
[179] Fix | Delete
public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null)
[180] Fix | Delete
{
[181] Fix | Delete
return self::_retrieveNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
[182] Fix | Delete
}
[183] Fix | Delete
/**
[184] Fix | Delete
* @param string $id the ID of the account to which the capability belongs
[185] Fix | Delete
* @param string $capabilityId the ID of the capability to update
[186] Fix | Delete
* @param null|array $params
[187] Fix | Delete
* @param null|array|string $opts
[188] Fix | Delete
*
[189] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[190] Fix | Delete
*
[191] Fix | Delete
* @return \Stripe\Capability
[192] Fix | Delete
*/
[193] Fix | Delete
public static function updateCapability($id, $capabilityId, $params = null, $opts = null)
[194] Fix | Delete
{
[195] Fix | Delete
return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
[196] Fix | Delete
}
[197] Fix | Delete
const PATH_EXTERNAL_ACCOUNTS = '/external_accounts';
[198] Fix | Delete
/**
[199] Fix | Delete
* @param string $id the ID of the account on which to retrieve the external accounts
[200] Fix | Delete
* @param null|array $params
[201] Fix | Delete
* @param null|array|string $opts
[202] Fix | Delete
*
[203] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[204] Fix | Delete
*
[205] Fix | Delete
* @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> the list of external accounts (BankAccount or Card)
[206] Fix | Delete
*/
[207] Fix | Delete
public static function allExternalAccounts($id, $params = null, $opts = null)
[208] Fix | Delete
{
[209] Fix | Delete
return self::_allNestedResources($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts);
[210] Fix | Delete
}
[211] Fix | Delete
/**
[212] Fix | Delete
* @param string $id the ID of the account on which to create the external account
[213] Fix | Delete
* @param null|array $params
[214] Fix | Delete
* @param null|array|string $opts
[215] Fix | Delete
*
[216] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[217] Fix | Delete
*
[218] Fix | Delete
* @return \Stripe\BankAccount|\Stripe\Card
[219] Fix | Delete
*/
[220] Fix | Delete
public static function createExternalAccount($id, $params = null, $opts = null)
[221] Fix | Delete
{
[222] Fix | Delete
return self::_createNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts);
[223] Fix | Delete
}
[224] Fix | Delete
/**
[225] Fix | Delete
* @param string $id the ID of the account to which the external account belongs
[226] Fix | Delete
* @param string $externalAccountId the ID of the external account to delete
[227] Fix | Delete
* @param null|array $params
[228] Fix | Delete
* @param null|array|string $opts
[229] Fix | Delete
*
[230] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[231] Fix | Delete
*
[232] Fix | Delete
* @return \Stripe\BankAccount|\Stripe\Card
[233] Fix | Delete
*/
[234] Fix | Delete
public static function deleteExternalAccount($id, $externalAccountId, $params = null, $opts = null)
[235] Fix | Delete
{
[236] Fix | Delete
return self::_deleteNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts);
[237] Fix | Delete
}
[238] Fix | Delete
/**
[239] Fix | Delete
* @param string $id the ID of the account to which the external account belongs
[240] Fix | Delete
* @param string $externalAccountId the ID of the external account to retrieve
[241] Fix | Delete
* @param null|array $params
[242] Fix | Delete
* @param null|array|string $opts
[243] Fix | Delete
*
[244] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[245] Fix | Delete
*
[246] Fix | Delete
* @return \Stripe\BankAccount|\Stripe\Card
[247] Fix | Delete
*/
[248] Fix | Delete
public static function retrieveExternalAccount($id, $externalAccountId, $params = null, $opts = null)
[249] Fix | Delete
{
[250] Fix | Delete
return self::_retrieveNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts);
[251] Fix | Delete
}
[252] Fix | Delete
/**
[253] Fix | Delete
* @param string $id the ID of the account to which the external account belongs
[254] Fix | Delete
* @param string $externalAccountId the ID of the external account to update
[255] Fix | Delete
* @param null|array $params
[256] Fix | Delete
* @param null|array|string $opts
[257] Fix | Delete
*
[258] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[259] Fix | Delete
*
[260] Fix | Delete
* @return \Stripe\BankAccount|\Stripe\Card
[261] Fix | Delete
*/
[262] Fix | Delete
public static function updateExternalAccount($id, $externalAccountId, $params = null, $opts = null)
[263] Fix | Delete
{
[264] Fix | Delete
return self::_updateNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts);
[265] Fix | Delete
}
[266] Fix | Delete
const PATH_LOGIN_LINKS = '/login_links';
[267] Fix | Delete
/**
[268] Fix | Delete
* @param string $id the ID of the account on which to create the login link
[269] Fix | Delete
* @param null|array $params
[270] Fix | Delete
* @param null|array|string $opts
[271] Fix | Delete
*
[272] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[273] Fix | Delete
*
[274] Fix | Delete
* @return \Stripe\LoginLink
[275] Fix | Delete
*/
[276] Fix | Delete
public static function createLoginLink($id, $params = null, $opts = null)
[277] Fix | Delete
{
[278] Fix | Delete
return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts);
[279] Fix | Delete
}
[280] Fix | Delete
const PATH_PERSONS = '/persons';
[281] Fix | Delete
/**
[282] Fix | Delete
* @param string $id the ID of the account on which to retrieve the persons
[283] Fix | Delete
* @param null|array $params
[284] Fix | Delete
* @param null|array|string $opts
[285] Fix | Delete
*
[286] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[287] Fix | Delete
*
[288] Fix | Delete
* @return \Stripe\Collection<\Stripe\Person> the list of persons
[289] Fix | Delete
*/
[290] Fix | Delete
public static function allPersons($id, $params = null, $opts = null)
[291] Fix | Delete
{
[292] Fix | Delete
return self::_allNestedResources($id, static::PATH_PERSONS, $params, $opts);
[293] Fix | Delete
}
[294] Fix | Delete
/**
[295] Fix | Delete
* @param string $id the ID of the account on which to create the person
[296] Fix | Delete
* @param null|array $params
[297] Fix | Delete
* @param null|array|string $opts
[298] Fix | Delete
*
[299] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[300] Fix | Delete
*
[301] Fix | Delete
* @return \Stripe\Person
[302] Fix | Delete
*/
[303] Fix | Delete
public static function createPerson($id, $params = null, $opts = null)
[304] Fix | Delete
{
[305] Fix | Delete
return self::_createNestedResource($id, static::PATH_PERSONS, $params, $opts);
[306] Fix | Delete
}
[307] Fix | Delete
/**
[308] Fix | Delete
* @param string $id the ID of the account to which the person belongs
[309] Fix | Delete
* @param string $personId the ID of the person to delete
[310] Fix | Delete
* @param null|array $params
[311] Fix | Delete
* @param null|array|string $opts
[312] Fix | Delete
*
[313] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[314] Fix | Delete
*
[315] Fix | Delete
* @return \Stripe\Person
[316] Fix | Delete
*/
[317] Fix | Delete
public static function deletePerson($id, $personId, $params = null, $opts = null)
[318] Fix | Delete
{
[319] Fix | Delete
return self::_deleteNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts);
[320] Fix | Delete
}
[321] Fix | Delete
/**
[322] Fix | Delete
* @param string $id the ID of the account to which the person belongs
[323] Fix | Delete
* @param string $personId the ID of the person to retrieve
[324] Fix | Delete
* @param null|array $params
[325] Fix | Delete
* @param null|array|string $opts
[326] Fix | Delete
*
[327] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[328] Fix | Delete
*
[329] Fix | Delete
* @return \Stripe\Person
[330] Fix | Delete
*/
[331] Fix | Delete
public static function retrievePerson($id, $personId, $params = null, $opts = null)
[332] Fix | Delete
{
[333] Fix | Delete
return self::_retrieveNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts);
[334] Fix | Delete
}
[335] Fix | Delete
/**
[336] Fix | Delete
* @param string $id the ID of the account to which the person belongs
[337] Fix | Delete
* @param string $personId the ID of the person to update
[338] Fix | Delete
* @param null|array $params
[339] Fix | Delete
* @param null|array|string $opts
[340] Fix | Delete
*
[341] Fix | Delete
* @throws \Stripe\Exception\ApiErrorException if the request fails
[342] Fix | Delete
*
[343] Fix | Delete
* @return \Stripe\Person
[344] Fix | Delete
*/
[345] Fix | Delete
public static function updatePerson($id, $personId, $params = null, $opts = null)
[346] Fix | Delete
{
[347] Fix | Delete
return self::_updateNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts);
[348] Fix | Delete
}
[349] Fix | Delete
}
[350] Fix | Delete
[351] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function