X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/restate/vendor/stripe/stripe-php/lib
home
/
gfecatvj
/
sites
/
restate
/
vendor
/
stripe
/
stripe-php
/
lib
/
📁
..
📄
Account.php
(15.84 KB)
📄
AccountLink.php
(789 B)
📄
AlipayAccount.php
(2.33 KB)
📁
ApiOperations
📄
ApiRequestor.php
(14.37 KB)
📄
ApiResource.php
(3.37 KB)
📄
ApiResponse.php
(712 B)
📄
ApplePayDomain.php
(975 B)
📄
ApplicationFee.php
(4.06 KB)
📄
ApplicationFeeRefund.php
(2.4 KB)
📄
Balance.php
(2.16 KB)
📄
BalanceTransaction.php
(5.43 KB)
📄
BankAccount.php
(6.68 KB)
📄
BaseStripeClient.php
(9.17 KB)
📁
BillingPortal
📄
BitcoinReceiver.php
(4.09 KB)
📄
BitcoinTransaction.php
(844 B)
📄
Capability.php
(2.83 KB)
📄
Card.php
(7.64 KB)
📄
Charge.php
(11.99 KB)
📁
Checkout
📄
Collection.php
(7 KB)
📄
CountrySpec.php
(1.7 KB)
📄
Coupon.php
(2.82 KB)
📄
CreditNote.php
(5.51 KB)
📄
CreditNoteLineItem.php
(1.73 KB)
📄
Customer.php
(12.36 KB)
📄
CustomerBalanceTransaction.php
(5.17 KB)
📄
Discount.php
(298 B)
📄
Dispute.php
(5.03 KB)
📄
EphemeralKey.php
(1.51 KB)
📄
ErrorObject.php
(8.46 KB)
📄
Event.php
(11.85 KB)
📁
Exception
📄
ExchangeRate.php
(1.37 KB)
📄
File.php
(3.24 KB)
📄
FileLink.php
(1.41 KB)
📁
HttpClient
📄
Invoice.php
(18.07 KB)
📄
InvoiceItem.php
(3.59 KB)
📄
InvoiceLineItem.php
(2.65 KB)
📁
Issuing
📄
LineItem.php
(1.99 KB)
📄
LoginLink.php
(385 B)
📄
Mandate.php
(1.04 KB)
📄
OAuth.php
(3.31 KB)
📄
OAuthErrorObject.php
(861 B)
📄
Order.php
(5.06 KB)
📄
OrderItem.php
(333 B)
📄
OrderReturn.php
(1.61 KB)
📄
PaymentIntent.php
(10.92 KB)
📄
PaymentMethod.php
(3.32 KB)
📄
Payout.php
(5.86 KB)
📄
Person.php
(4.47 KB)
📄
Plan.php
(5.41 KB)
📄
Price.php
(4.55 KB)
📄
Product.php
(4.12 KB)
📁
Radar
📄
Recipient.php
(2.65 KB)
📄
RecipientTransfer.php
(918 B)
📄
Refund.php
(4 KB)
📁
Reporting
📄
RequestTelemetry.php
(539 B)
📄
Review.php
(3.25 KB)
📄
SKU.php
(2.78 KB)
📁
Service
📄
SetupIntent.php
(6.88 KB)
📁
Sigma
📄
SingletonApiResource.php
(917 B)
📄
Source.php
(8.33 KB)
📄
SourceTransaction.php
(408 B)
📄
Stripe.php
(7.05 KB)
📄
StripeClient.php
(3.32 KB)
📄
StripeClientInterface.php
(1.4 KB)
📄
StripeObject.php
(18.43 KB)
📄
Subscription.php
(10.57 KB)
📄
SubscriptionItem.php
(5.43 KB)
📄
SubscriptionSchedule.php
(3.78 KB)
📄
TaxId.php
(4.19 KB)
📄
TaxRate.php
(2.08 KB)
📁
Terminal
📄
ThreeDSecure.php
(2.5 KB)
📄
Token.php
(3.5 KB)
📄
Topup.php
(3.86 KB)
📄
Transfer.php
(6.13 KB)
📄
TransferReversal.php
(3.2 KB)
📄
UsageRecord.php
(939 B)
📄
UsageRecordSummary.php
(771 B)
📁
Util
📄
Webhook.php
(1.48 KB)
📄
WebhookEndpoint.php
(2.22 KB)
📄
WebhookSignature.php
(4.28 KB)
Editing: BaseStripeClient.php
<?php namespace Stripe; class BaseStripeClient implements StripeClientInterface { /** @var string default base URL for Stripe's API */ const DEFAULT_API_BASE = 'https://api.stripe.com'; /** @var string default base URL for Stripe's OAuth API */ const DEFAULT_CONNECT_BASE = 'https://connect.stripe.com'; /** @var string default base URL for Stripe's Files API */ const DEFAULT_FILES_BASE = 'https://files.stripe.com'; /** @var array<string, mixed> */ private $config; /** @var \Stripe\Util\RequestOptions */ private $defaultOpts; /** * Initializes a new instance of the {@link BaseStripeClient} class. * * The constructor takes a single argument. The argument can be a string, in which case it * should be the API key. It can also be an array with various configuration settings. * * Configuration settings include the following options: * * - api_key (null|string): the Stripe API key, to be used in regular API requests. * - client_id (null|string): the Stripe client ID, to be used in OAuth requests. * - stripe_account (null|string): a Stripe account ID. If set, all requests sent by the client * will automatically use the {@code Stripe-Account} header with that account ID. * - stripe_version (null|string): a Stripe API verion. If set, all requests sent by the client * will include the {@code Stripe-Version} header with that API version. * * 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): * * - api_base (string): the base URL for regular API requests. Defaults to * {@link DEFAULT_API_BASE}. * - connect_base (string): the base URL for OAuth requests. Defaults to * {@link DEFAULT_CONNECT_BASE}. * - files_base (string): the base URL for file creation requests. Defaults to * {@link DEFAULT_FILES_BASE}. * * @param array<string, mixed>|string $config the API key as a string, or an array containing * the client configuration settings */ public function __construct($config = []) { 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'); } $config = \array_merge($this->getDefaultConfig(), $config); $this->validateConfig($config); $this->config = $config; $this->defaultOpts = \Stripe\Util\RequestOptions::parse([ 'stripe_account' => $config['stripe_account'], 'stripe_version' => $config['stripe_version'], ]); } /** * Gets the API key used by the client to send requests. * * @return null|string the API key used by the client to send requests */ public function getApiKey() { return $this->config['api_key']; } /** * Gets the client ID used by the client in OAuth requests. * * @return null|string the client ID used by the client in OAuth requests */ public function getClientId() { return $this->config['client_id']; } /** * Gets the base URL for Stripe's API. * * @return string the base URL for Stripe's API */ public function getApiBase() { return $this->config['api_base']; } /** * Gets the base URL for Stripe's OAuth API. * * @return string the base URL for Stripe's OAuth API */ public function getConnectBase() { return $this->config['connect_base']; } /** * Gets the base URL for Stripe's Files API. * * @return string the base URL for Stripe's Files API */ public function getFilesBase() { return $this->config['files_base']; } /** * Sends a request to Stripe's API. * * @param string $method the HTTP method * @param string $path the path of the request * @param array $params the parameters of the request * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request * * @return \Stripe\StripeObject the object returned by Stripe's API */ public function request($method, $path, $params, $opts) { $opts = $this->defaultOpts->merge($opts, true); $baseUrl = $opts->apiBase ?: $this->getApiBase(); $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); list($response, $opts->apiKey) = $requestor->request($method, $path, $params, $opts->headers); $opts->discardNonPersistentHeaders(); $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; } /** * Sends a request to Stripe's API. * * @param string $method the HTTP method * @param string $path the path of the request * @param array $params the parameters of the request * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request * * @return \Stripe\Collection of ApiResources */ public function requestCollection($method, $path, $params, $opts) { $obj = $this->request($method, $path, $params, $opts); if (!($obj instanceof \Stripe\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); } $obj->setFilters($params); return $obj; } /** * @param \Stripe\Util\RequestOptions $opts * * @throws \Stripe\Exception\AuthenticationException * * @return string */ private function apiKeyForRequest($opts) { $apiKey = $opts->apiKey ?: $this->getApiKey(); if (null === $apiKey) { $msg = 'No API key provided. Set your API key when constructing the ' . 'StripeClient instance, or provide it on a per-request basis ' . 'using the `api_key` key in the $opts argument.'; throw new \Stripe\Exception\AuthenticationException($msg); } return $apiKey; } /** * TODO: replace this with a private constant when we drop support for PHP < 5. * * @return array<string, mixed> */ private function getDefaultConfig() { return [ 'api_key' => null, 'client_id' => null, 'stripe_account' => null, 'stripe_version' => null, 'api_base' => self::DEFAULT_API_BASE, 'connect_base' => self::DEFAULT_CONNECT_BASE, 'files_base' => self::DEFAULT_FILES_BASE, ]; } /** * @param array<string, mixed> $config * * @throws \Stripe\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'); } if (null !== $config['api_key'] && ('' === $config['api_key'])) { $msg = 'api_key cannot be the empty string'; throw new \Stripe\Exception\InvalidArgumentException($msg); } if (null !== $config['api_key'] && (\preg_match('/\s/', $config['api_key']))) { $msg = 'api_key cannot contain whitespace'; throw new \Stripe\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'); } // 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'); } // 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'); } // api_base if (!\is_string($config['api_base'])) { throw new \Stripe\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'); } // files_base if (!\is_string($config['files_base'])) { throw new \Stripe\Exception\InvalidArgumentException('files_base must be a string'); } // check absence of extra keys $extraConfigKeys = \array_diff(\array_keys($config), \array_keys($this->getDefaultConfig())); if (!empty($extraConfigKeys)) { throw new \Stripe\Exception\InvalidArgumentException('Found unknown key(s) in configuration array: ' . \implode(',', $extraConfigKeys)); } } }
Upload File
Create Folder