$37 GRAYBYTE WORDPRESS FILE MANAGER $56

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravrvjk/kigalix.com/wp-content/themes/houzez/framework/stripe-php/lib/

HOME
Current File : /home/bravrvjk/kigalix.com/wp-content/themes/houzez/framework/stripe-php/lib//BaseStripeClient.php
<?php

namespace Stripe;

class BaseStripeClient implements StripeClientInterface, StripeStreamingClientInterface
{
    /** @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, passing chunks of the streamed response
     * into a user-provided $readBodyChunkCallable callback.
     *
     * @param string $method the HTTP method
     * @param string $path the path of the request
     * @param callable $readBodyChunkCallable a function that will be called
     * @param array $params the parameters of the request
     * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request
     * with chunks of bytes from the body if the request is successful
     */
    public function requestStream($method, $path, $readBodyChunkCallable, $params, $opts)
    {
        $opts = $this->defaultOpts->merge($opts, true);
        $baseUrl = $opts->apiBase ?: $this->getApiBase();
        $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl);
        list($response, $opts->apiKey) = $requestor->requestStream($method, $path, $readBodyChunkCallable, $params, $opts->headers);
    }

    /**
     * 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;
    }

    /**
     * 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\SearchResult of ApiResources
     */
    public function requestSearchResult($method, $path, $params, $opts)
    {
        $obj = $this->request($method, $path, $params, $opts);
        if (!($obj instanceof \Stripe\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);
        }
        $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)) {
            // 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);
        }
    }
}


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
ApiOperations
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Apps
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
BillingPortal
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Checkout
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Exception
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
FinancialConnections
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
HttpClient
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Identity
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Issuing
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Radar
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Reporting
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Service
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Sigma
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Tax
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Terminal
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
TestHelpers
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Treasury
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Util
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
Account.php
15.949 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
AccountLink.php
0.811 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
ApiRequestor.php
18.614 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
ApiResource.php
3.408 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
ApiResponse.php
0.695 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
ApplePayDomain.php
0.992 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
ApplicationFee.php
4.155 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
ApplicationFeeRefund.php
2.444 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Balance.php
2.087 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
BalanceTransaction.php
5.541 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
BankAccount.php
7.694 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
BaseStripeClient.php
11.168 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
BaseStripeClientInterface.php
0.967 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Capability.php
2.932 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Card.php
8.226 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
CashBalance.php
2.417 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Charge.php
13.151 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Collection.php
8.308 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
CountrySpec.php
1.742 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Coupon.php
3.434 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
CreditNote.php
6.854 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
CreditNoteLineItem.php
2.177 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Customer.php
17.817 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
CustomerBalanceTransaction.php
5.294 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
CustomerCashBalanceTransaction.php
2.932 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Discount.php
1.533 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Dispute.php
5.075 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
EphemeralKey.php
1.516 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
ErrorObject.php
12.567 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Event.php
17.953 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
ExchangeRate.php
1.412 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
File.php
3.808 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
FileLink.php
1.451 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
FundingInstructions.php
1.38 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Invoice.php
22.681 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
InvoiceItem.php
4.544 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
InvoiceLineItem.php
3.247 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
LineItem.php
1.345 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
LoginLink.php
0.416 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Mandate.php
1.088 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
OAuth.php
3.313 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
OAuthErrorObject.php
0.841 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
PaymentIntent.php
13.623 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
PaymentLink.php
5.996 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
PaymentMethod.php
4.522 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Payout.php
7.313 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Person.php
5.867 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Plan.php
5.561 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Price.php
6.287 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Product.php
4.602 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
PromotionCode.php
2.462 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Quote.php
8.859 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
RecipientTransfer.php
0.896 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Refund.php
4.907 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
RequestTelemetry.php
0.526 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Review.php
3.35 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
SearchResult.php
6.398 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
SetupAttempt.php
3.223 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
SetupIntent.php
8.515 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
ShippingRate.php
2.406 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
SingletonApiResource.php
0.707 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Source.php
8.331 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
SourceTransaction.php
0.398 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Stripe.php
7.081 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
StripeClient.php
4.086 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
StripeClientInterface.php
0.572 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
StripeObject.php
18.834 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
StripeStreamingClientInterface.php
0.232 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Subscription.php
13.623 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
SubscriptionItem.php
4.798 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
SubscriptionSchedule.php
4.302 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
TaxCode.php
0.652 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
TaxId.php
5.442 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
TaxRate.php
3.014 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Token.php
3.554 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Topup.php
3.668 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Transfer.php
5.686 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
TransferReversal.php
3.245 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
UsageRecord.php
0.957 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
UsageRecordSummary.php
0.793 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
Webhook.php
1.479 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
WebhookEndpoint.php
2.262 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
WebhookSignature.php
4.274 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF