JFIF    $         d d  7    * Z qn )ZP 0   !1 A "#a$2Qr   D8 a Ri [f  \m I ykI w0 c u F c Rı?lO7 к _f˓ [C $殷WF< _W ԣ s Kc ëI zyQy /_LK ℂ ;C",p F A : /] =H  ~ , l s / 9  ć: [=/#f ; ) x { ٛE Q )~     = 𘙲r*2~  a _V = '  ku m F  D } KYYC )( { * g& f `툪 r y ` = ^ c J. I ]( * `wq  1dđ #̩ ͑ 0  ; H ] u 搂 @:~ ו K L  N s h } O I R* 8 :2 ! lD JV o (  3 = M ( z Ȱ+i *N A  r6K n S l ) ! J J Ӂ* %  ݉?|D } d5: eP0 R; {$X' x F @ .ÊB {,WJ uQ ɲRI ;9 Q E琯 6 2fT .DU J ;*c  P A\IL Nj! J ۱+ O\ ͔ ] ޒ S߼ J ȧ c%A N ol  ՎprU L Zԛe r E2= X D Xg VQeӓ k y P7 U* o m Q I s ,K `) 6\G3t?pgjr m ۛجw luGt f  h 9uyP 0D;Uڽ"OXl i f $ ) &|ML 0 Z rm1 [ H XP l P R0  'G=i 2N +0 e 2 ]] 9 VT P  O׮ 7 h(F * 癈 ' = Q VZD F,d ߬ ~ T X G[ `le 69C R(!S2! P  < 0 x <     !1AQ "Raq 02Br #S CTb  ? Ζ "]mH5WR 7 k.ۛ ! } Q~ + yԏ z |@ T20 S~ K e k *zF f^2X *( @ 8 r ? C I uI|֓>^Ex LgNU Y+{.R Ѫ τV׸ YT D I 6 2 '8Y2  7'\T P.6 d &˦ @V q i  |8 -O Ε  ] ʔ U=   T L 8= ;6c |  !qfF3 a ů& ~$ l} 'NW U s$U k^S V : U# 6w +  +s &r+n ڐ   { @ 29 gL u " T Ù  M=6  (^ "7 r}=6Yݾ lC u hquymp Ǧ G jhs ǜNl ɻ} o 7 #S6 a w 4 !  OS  r D  5 7 % | ?x> L |  / nD 6?/8 w # [ ) L 7 +6〼T A T g   !  %5  Mm Z /c  -{1_Je "| ^$ 'O  & ޱմ < H vNqϡQ$ < 6 &Nݛ ֨tǻN (9 n ru~'όN sMG& ,uH Kw *Ī 5@  u6  BԒ  i YN * f 0 _ GhKW u  lT <nj- 0{  M L~ | /a v\ E = ?1 \ɟuq Ђ Y O a K ޡP q  $ H8o Q˼EV ~ k 0 h' L  Pp M -M"  m^ !6l nմ 쮝C U T . ! :vMǨb h ډ Vc r @񄞅~p   #   !1QAa q  ? AL0L  x LU 4 d ; x   " 16ad0 7.\ߋ 0  = P l v/ " c A Ay A|2pO8"d MV #1] = \ " ˡ ] k v I9 d ۓ & q ) ǐq E ꞅ v "P )q X  &Q  З non]я u ג./ ; gZ$ M QР 2M ]h ni 0  P $ێ 3CɏGjώy : m c # S_ l@ '_ \m|C 2`K _  1 cIvGc $? PCQ S+D ? K aײ k Fr b 8 ύ NEدg ĝ U 3  6 #Ik+ v  {ƒ v i ( ވ  ? a e)  X xy/*@Q Ǽ Ծ ) $ IWO l c G;  !i  k{ gOŀ L ('x  T rb $ w) R $ & N1E td U3Uȉ1p M"N* (DNy d96.(jQ)  X 5 c QɎMy W ?  Q *!R > 6=7)Xj 5`J ] e  8%t ! + ' ! 1Q 5   !1 AQaq ё #2 "0BRb ? G t^ ## .l lQ T $  v , ,m   㵜5u bV  =sY+ @d { N ! dn O < .- B;  _w J t 6;Q  Jd. Q c%p{ 1 ,sND dF H I0 Гo X ш  e黅X ۢ F :)[ F G X ƹ / w _c MeD   ,ʡc c .  W D  tA $ j@ : ) - # u c1< @ۗ9F ) KJ- hpP] _ x [ q B lb p ʖ w q " LFGd ƶ * s +ډ_Zc " ? % t[I P  6 J ]# =ɺ V v v CGs Gh1 > )6 |e y ? L ӣ m,4 G W Ui ` ] uJVo VDG< SB 6ϏQ @ TiU l y O U 0 kfV ~ ~}S Z @ *WU Ui ## ; s /[ = ! 7}" W N ] ' (L !  ~ y5 g9T̅J kbM' +s :S +B) v @ M  j e C f j E 0  Y\Qn z G 1 д~ W o{T 9?`  Rm yhsy3 !HAD ] m  c1 ~ 2 L  S u7x T ;j$ `} 4-> L#  vzŏ I L S  ֭  T { r  jGK C ; b  pU= - ` Bs K. S F w4  M q] Z dH S 0 ) tLg Tiny File Manager | SquareClient.php
  • File: SquareClient.php
  • Full Path: /home/mata8712/public_html/on-me-trouve/wp-content/plugins/wpforms-lite/vendor_prefixed/square/square/src/SquareClient.php
  • File size: 21.38 KB
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

declare (strict_types=1);
namespace WPForms\Vendor\Square;

use WPForms\Vendor\Core\ClientBuilder;
use WPForms\Vendor\Core\Request\Parameters\AdditionalHeaderParams;
use WPForms\Vendor\Core\Request\Parameters\HeaderParam;
use WPForms\Vendor\Core\Request\Parameters\TemplateParam;
use WPForms\Vendor\Core\Utils\CoreHelper;
use WPForms\Vendor\Square\Apis\ApplePayApi;
use WPForms\Vendor\Square\Apis\BankAccountsApi;
use WPForms\Vendor\Square\Apis\BookingCustomAttributesApi;
use WPForms\Vendor\Square\Apis\BookingsApi;
use WPForms\Vendor\Square\Apis\CardsApi;
use WPForms\Vendor\Square\Apis\CashDrawersApi;
use WPForms\Vendor\Square\Apis\CatalogApi;
use WPForms\Vendor\Square\Apis\CheckoutApi;
use WPForms\Vendor\Square\Apis\CustomerCustomAttributesApi;
use WPForms\Vendor\Square\Apis\CustomerGroupsApi;
use WPForms\Vendor\Square\Apis\CustomersApi;
use WPForms\Vendor\Square\Apis\CustomerSegmentsApi;
use WPForms\Vendor\Square\Apis\DevicesApi;
use WPForms\Vendor\Square\Apis\DisputesApi;
use WPForms\Vendor\Square\Apis\EmployeesApi;
use WPForms\Vendor\Square\Apis\EventsApi;
use WPForms\Vendor\Square\Apis\GiftCardActivitiesApi;
use WPForms\Vendor\Square\Apis\GiftCardsApi;
use WPForms\Vendor\Square\Apis\InventoryApi;
use WPForms\Vendor\Square\Apis\InvoicesApi;
use WPForms\Vendor\Square\Apis\LaborApi;
use WPForms\Vendor\Square\Apis\LocationCustomAttributesApi;
use WPForms\Vendor\Square\Apis\LocationsApi;
use WPForms\Vendor\Square\Apis\LoyaltyApi;
use WPForms\Vendor\Square\Apis\MerchantCustomAttributesApi;
use WPForms\Vendor\Square\Apis\MerchantsApi;
use WPForms\Vendor\Square\Apis\MobileAuthorizationApi;
use WPForms\Vendor\Square\Apis\OAuthApi;
use WPForms\Vendor\Square\Apis\OrderCustomAttributesApi;
use WPForms\Vendor\Square\Apis\OrdersApi;
use WPForms\Vendor\Square\Apis\PaymentsApi;
use WPForms\Vendor\Square\Apis\PayoutsApi;
use WPForms\Vendor\Square\Apis\RefundsApi;
use WPForms\Vendor\Square\Apis\SitesApi;
use WPForms\Vendor\Square\Apis\SnippetsApi;
use WPForms\Vendor\Square\Apis\SubscriptionsApi;
use WPForms\Vendor\Square\Apis\TeamApi;
use WPForms\Vendor\Square\Apis\TerminalApi;
use WPForms\Vendor\Square\Apis\TransactionsApi;
use WPForms\Vendor\Square\Apis\V1TransactionsApi;
use WPForms\Vendor\Square\Apis\VendorsApi;
use WPForms\Vendor\Square\Apis\WebhookSubscriptionsApi;
use WPForms\Vendor\Square\Authentication\BearerAuthCredentialsBuilder;
use WPForms\Vendor\Square\Authentication\BearerAuthManager;
use WPForms\Vendor\Square\Utils\CompatibilityConverter;
use WPForms\Vendor\Unirest\Configuration;
use WPForms\Vendor\Unirest\HttpClient;
class SquareClient implements ConfigurationInterface
{
    private $mobileAuthorization;
    private $oAuth;
    private $v1Transactions;
    private $applePay;
    private $bankAccounts;
    private $bookings;
    private $bookingCustomAttributes;
    private $cards;
    private $cashDrawers;
    private $catalog;
    private $customers;
    private $customerCustomAttributes;
    private $customerGroups;
    private $customerSegments;
    private $devices;
    private $disputes;
    private $employees;
    private $events;
    private $giftCards;
    private $giftCardActivities;
    private $inventory;
    private $invoices;
    private $labor;
    private $locations;
    private $locationCustomAttributes;
    private $checkout;
    private $transactions;
    private $loyalty;
    private $merchants;
    private $merchantCustomAttributes;
    private $orders;
    private $orderCustomAttributes;
    private $payments;
    private $payouts;
    private $refunds;
    private $sites;
    private $snippets;
    private $subscriptions;
    private $team;
    private $terminal;
    private $vendors;
    private $webhookSubscriptions;
    private $bearerAuthManager;
    private $config;
    private $client;
    /**
     * @see SquareClientBuilder::init()
     * @see SquareClientBuilder::build()
     *
     * @param array $config
     */
    public function __construct(array $config = [])
    {
        $this->config = \array_merge(ConfigurationDefaults::_ALL, CoreHelper::clone($config));
        $this->bearerAuthManager = new BearerAuthManager($this->config);
        $this->validateConfig();
        $this->client = ClientBuilder::init(new HttpClient(Configuration::init($this)))->converter(new CompatibilityConverter())->jsonHelper(ApiHelper::getJsonHelper())->apiCallback($this->config['httpCallback'] ?? null)->userAgent('Square-PHP-SDK/40.0.0.20250123 ({api-version}) {engine}/{engine-version} ({os-' . 'info}) {detail}')->userAgentConfig(['{api-version}' => $this->getSquareVersion(), '{detail}' => \rawurlencode($this->getUserAgentDetail())])->globalConfig($this->getGlobalConfiguration())->globalRuntimeParam(AdditionalHeaderParams::init($this->getAdditionalHeaders()))->serverUrls(self::ENVIRONMENT_MAP[$this->getEnvironment()], Server::DEFAULT_)->authManagers(['global' => $this->bearerAuthManager])->build();
    }
    /**
     * Create a builder with the current client's configurations.
     *
     * @return SquareClientBuilder SquareClientBuilder instance
     */
    public function toBuilder() : SquareClientBuilder
    {
        $builder = SquareClientBuilder::init()->timeout($this->getTimeout())->enableRetries($this->shouldEnableRetries())->numberOfRetries($this->getNumberOfRetries())->retryInterval($this->getRetryInterval())->backOffFactor($this->getBackOffFactor())->maximumRetryWaitTime($this->getMaximumRetryWaitTime())->retryOnTimeout($this->shouldRetryOnTimeout())->httpStatusCodesToRetry($this->getHttpStatusCodesToRetry())->httpMethodsToRetry($this->getHttpMethodsToRetry())->squareVersion($this->getSquareVersion())->additionalHeaders($this->getAdditionalHeaders())->userAgentDetail($this->getUserAgentDetail())->environment($this->getEnvironment())->customUrl($this->getCustomUrl())->httpCallback($this->config['httpCallback'] ?? null);
        $bearerAuth = $this->getBearerAuthCredentialsBuilder();
        if ($bearerAuth != null) {
            $builder->bearerAuthCredentials($bearerAuth);
        }
        return $builder;
    }
    public function getTimeout() : int
    {
        return $this->config['timeout'] ?? ConfigurationDefaults::TIMEOUT;
    }
    public function shouldEnableRetries() : bool
    {
        return $this->config['enableRetries'] ?? ConfigurationDefaults::ENABLE_RETRIES;
    }
    public function getNumberOfRetries() : int
    {
        return $this->config['numberOfRetries'] ?? ConfigurationDefaults::NUMBER_OF_RETRIES;
    }
    public function getRetryInterval() : float
    {
        return $this->config['retryInterval'] ?? ConfigurationDefaults::RETRY_INTERVAL;
    }
    public function getBackOffFactor() : float
    {
        return $this->config['backOffFactor'] ?? ConfigurationDefaults::BACK_OFF_FACTOR;
    }
    public function getMaximumRetryWaitTime() : int
    {
        return $this->config['maximumRetryWaitTime'] ?? ConfigurationDefaults::MAXIMUM_RETRY_WAIT_TIME;
    }
    public function shouldRetryOnTimeout() : bool
    {
        return $this->config['retryOnTimeout'] ?? ConfigurationDefaults::RETRY_ON_TIMEOUT;
    }
    public function getHttpStatusCodesToRetry() : array
    {
        return $this->config['httpStatusCodesToRetry'] ?? ConfigurationDefaults::HTTP_STATUS_CODES_TO_RETRY;
    }
    public function getHttpMethodsToRetry() : array
    {
        return $this->config['httpMethodsToRetry'] ?? ConfigurationDefaults::HTTP_METHODS_TO_RETRY;
    }
    public function getSquareVersion() : string
    {
        return $this->config['squareVersion'] ?? ConfigurationDefaults::SQUARE_VERSION;
    }
    public function getAdditionalHeaders() : array
    {
        return $this->config['additionalHeaders'] ?? ConfigurationDefaults::ADDITIONAL_HEADERS;
    }
    public function getUserAgentDetail() : string
    {
        return $this->config['userAgentDetail'] ?? ConfigurationDefaults::USER_AGENT_DETAIL;
    }
    public function getEnvironment() : string
    {
        return $this->config['environment'] ?? ConfigurationDefaults::ENVIRONMENT;
    }
    public function getCustomUrl() : string
    {
        return $this->config['customUrl'] ?? ConfigurationDefaults::CUSTOM_URL;
    }
    public function getBearerAuthCredentials() : BearerAuthCredentials
    {
        return $this->bearerAuthManager;
    }
    public function getBearerAuthCredentialsBuilder() : ?BearerAuthCredentialsBuilder
    {
        if (empty($this->bearerAuthManager->getAccessToken())) {
            return null;
        }
        return BearerAuthCredentialsBuilder::init($this->bearerAuthManager->getAccessToken());
    }
    /**
     * Get the client configuration as an associative array
     *
     * @see SquareClientBuilder::getConfiguration()
     */
    public function getConfiguration() : array
    {
        return $this->toBuilder()->getConfiguration();
    }
    /**
     * Clone this client and override given configuration options
     *
     * @see SquareClientBuilder::build()
     */
    public function withConfiguration(array $config) : self
    {
        return new self(\array_merge($this->config, $config));
    }
    /**
     * Get current SDK version
     */
    public function getSdkVersion() : string
    {
        return '40.0.0.20250123';
    }
    /**
     * Validate required configuration variables
     */
    private function validateConfig() : void
    {
        SquareClientBuilder::init()->additionalHeaders($this->getAdditionalHeaders())->userAgentDetail($this->getUserAgentDetail());
    }
    /**
     * Get the base uri for a given server in the current environment.
     *
     * @param string $server Server name
     *
     * @return string Base URI
     */
    public function getBaseUri(string $server = Server::DEFAULT_) : string
    {
        return $this->client->getGlobalRequest($server)->getQueryUrl();
    }
    /**
     * Returns Mobile Authorization Api
     */
    public function getMobileAuthorizationApi() : MobileAuthorizationApi
    {
        if ($this->mobileAuthorization == null) {
            $this->mobileAuthorization = new MobileAuthorizationApi($this->client);
        }
        return $this->mobileAuthorization;
    }
    /**
     * Returns O Auth Api
     */
    public function getOAuthApi() : OAuthApi
    {
        if ($this->oAuth == null) {
            $this->oAuth = new OAuthApi($this->client);
        }
        return $this->oAuth;
    }
    /**
     * Returns V1 Transactions Api
     */
    public function getV1TransactionsApi() : V1TransactionsApi
    {
        if ($this->v1Transactions == null) {
            $this->v1Transactions = new V1TransactionsApi($this->client);
        }
        return $this->v1Transactions;
    }
    /**
     * Returns Apple Pay Api
     */
    public function getApplePayApi() : ApplePayApi
    {
        if ($this->applePay == null) {
            $this->applePay = new ApplePayApi($this->client);
        }
        return $this->applePay;
    }
    /**
     * Returns Bank Accounts Api
     */
    public function getBankAccountsApi() : BankAccountsApi
    {
        if ($this->bankAccounts == null) {
            $this->bankAccounts = new BankAccountsApi($this->client);
        }
        return $this->bankAccounts;
    }
    /**
     * Returns Bookings Api
     */
    public function getBookingsApi() : BookingsApi
    {
        if ($this->bookings == null) {
            $this->bookings = new BookingsApi($this->client);
        }
        return $this->bookings;
    }
    /**
     * Returns Booking Custom Attributes Api
     */
    public function getBookingCustomAttributesApi() : BookingCustomAttributesApi
    {
        if ($this->bookingCustomAttributes == null) {
            $this->bookingCustomAttributes = new BookingCustomAttributesApi($this->client);
        }
        return $this->bookingCustomAttributes;
    }
    /**
     * Returns Cards Api
     */
    public function getCardsApi() : CardsApi
    {
        if ($this->cards == null) {
            $this->cards = new CardsApi($this->client);
        }
        return $this->cards;
    }
    /**
     * Returns Cash Drawers Api
     */
    public function getCashDrawersApi() : CashDrawersApi
    {
        if ($this->cashDrawers == null) {
            $this->cashDrawers = new CashDrawersApi($this->client);
        }
        return $this->cashDrawers;
    }
    /**
     * Returns Catalog Api
     */
    public function getCatalogApi() : CatalogApi
    {
        if ($this->catalog == null) {
            $this->catalog = new CatalogApi($this->client);
        }
        return $this->catalog;
    }
    /**
     * Returns Customers Api
     */
    public function getCustomersApi() : CustomersApi
    {
        if ($this->customers == null) {
            $this->customers = new CustomersApi($this->client);
        }
        return $this->customers;
    }
    /**
     * Returns Customer Custom Attributes Api
     */
    public function getCustomerCustomAttributesApi() : CustomerCustomAttributesApi
    {
        if ($this->customerCustomAttributes == null) {
            $this->customerCustomAttributes = new CustomerCustomAttributesApi($this->client);
        }
        return $this->customerCustomAttributes;
    }
    /**
     * Returns Customer Groups Api
     */
    public function getCustomerGroupsApi() : CustomerGroupsApi
    {
        if ($this->customerGroups == null) {
            $this->customerGroups = new CustomerGroupsApi($this->client);
        }
        return $this->customerGroups;
    }
    /**
     * Returns Customer Segments Api
     */
    public function getCustomerSegmentsApi() : CustomerSegmentsApi
    {
        if ($this->customerSegments == null) {
            $this->customerSegments = new CustomerSegmentsApi($this->client);
        }
        return $this->customerSegments;
    }
    /**
     * Returns Devices Api
     */
    public function getDevicesApi() : DevicesApi
    {
        if ($this->devices == null) {
            $this->devices = new DevicesApi($this->client);
        }
        return $this->devices;
    }
    /**
     * Returns Disputes Api
     */
    public function getDisputesApi() : DisputesApi
    {
        if ($this->disputes == null) {
            $this->disputes = new DisputesApi($this->client);
        }
        return $this->disputes;
    }
    /**
     * Returns Employees Api
     */
    public function getEmployeesApi() : EmployeesApi
    {
        if ($this->employees == null) {
            $this->employees = new EmployeesApi($this->client);
        }
        return $this->employees;
    }
    /**
     * Returns Events Api
     */
    public function getEventsApi() : EventsApi
    {
        if ($this->events == null) {
            $this->events = new EventsApi($this->client);
        }
        return $this->events;
    }
    /**
     * Returns Gift Cards Api
     */
    public function getGiftCardsApi() : GiftCardsApi
    {
        if ($this->giftCards == null) {
            $this->giftCards = new GiftCardsApi($this->client);
        }
        return $this->giftCards;
    }
    /**
     * Returns Gift Card Activities Api
     */
    public function getGiftCardActivitiesApi() : GiftCardActivitiesApi
    {
        if ($this->giftCardActivities == null) {
            $this->giftCardActivities = new GiftCardActivitiesApi($this->client);
        }
        return $this->giftCardActivities;
    }
    /**
     * Returns Inventory Api
     */
    public function getInventoryApi() : InventoryApi
    {
        if ($this->inventory == null) {
            $this->inventory = new InventoryApi($this->client);
        }
        return $this->inventory;
    }
    /**
     * Returns Invoices Api
     */
    public function getInvoicesApi() : InvoicesApi
    {
        if ($this->invoices == null) {
            $this->invoices = new InvoicesApi($this->client);
        }
        return $this->invoices;
    }
    /**
     * Returns Labor Api
     */
    public function getLaborApi() : LaborApi
    {
        if ($this->labor == null) {
            $this->labor = new LaborApi($this->client);
        }
        return $this->labor;
    }
    /**
     * Returns Locations Api
     */
    public function getLocationsApi() : LocationsApi
    {
        if ($this->locations == null) {
            $this->locations = new LocationsApi($this->client);
        }
        return $this->locations;
    }
    /**
     * Returns Location Custom Attributes Api
     */
    public function getLocationCustomAttributesApi() : LocationCustomAttributesApi
    {
        if ($this->locationCustomAttributes == null) {
            $this->locationCustomAttributes = new LocationCustomAttributesApi($this->client);
        }
        return $this->locationCustomAttributes;
    }
    /**
     * Returns Checkout Api
     */
    public function getCheckoutApi() : CheckoutApi
    {
        if ($this->checkout == null) {
            $this->checkout = new CheckoutApi($this->client);
        }
        return $this->checkout;
    }
    /**
     * Returns Transactions Api
     */
    public function getTransactionsApi() : TransactionsApi
    {
        if ($this->transactions == null) {
            $this->transactions = new TransactionsApi($this->client);
        }
        return $this->transactions;
    }
    /**
     * Returns Loyalty Api
     */
    public function getLoyaltyApi() : LoyaltyApi
    {
        if ($this->loyalty == null) {
            $this->loyalty = new LoyaltyApi($this->client);
        }
        return $this->loyalty;
    }
    /**
     * Returns Merchants Api
     */
    public function getMerchantsApi() : MerchantsApi
    {
        if ($this->merchants == null) {
            $this->merchants = new MerchantsApi($this->client);
        }
        return $this->merchants;
    }
    /**
     * Returns Merchant Custom Attributes Api
     */
    public function getMerchantCustomAttributesApi() : MerchantCustomAttributesApi
    {
        if ($this->merchantCustomAttributes == null) {
            $this->merchantCustomAttributes = new MerchantCustomAttributesApi($this->client);
        }
        return $this->merchantCustomAttributes;
    }
    /**
     * Returns Orders Api
     */
    public function getOrdersApi() : OrdersApi
    {
        if ($this->orders == null) {
            $this->orders = new OrdersApi($this->client);
        }
        return $this->orders;
    }
    /**
     * Returns Order Custom Attributes Api
     */
    public function getOrderCustomAttributesApi() : OrderCustomAttributesApi
    {
        if ($this->orderCustomAttributes == null) {
            $this->orderCustomAttributes = new OrderCustomAttributesApi($this->client);
        }
        return $this->orderCustomAttributes;
    }
    /**
     * Returns Payments Api
     */
    public function getPaymentsApi() : PaymentsApi
    {
        if ($this->payments == null) {
            $this->payments = new PaymentsApi($this->client);
        }
        return $this->payments;
    }
    /**
     * Returns Payouts Api
     */
    public function getPayoutsApi() : PayoutsApi
    {
        if ($this->payouts == null) {
            $this->payouts = new PayoutsApi($this->client);
        }
        return $this->payouts;
    }
    /**
     * Returns Refunds Api
     */
    public function getRefundsApi() : RefundsApi
    {
        if ($this->refunds == null) {
            $this->refunds = new RefundsApi($this->client);
        }
        return $this->refunds;
    }
    /**
     * Returns Sites Api
     */
    public function getSitesApi() : SitesApi
    {
        if ($this->sites == null) {
            $this->sites = new SitesApi($this->client);
        }
        return $this->sites;
    }
    /**
     * Returns Snippets Api
     */
    public function getSnippetsApi() : SnippetsApi
    {
        if ($this->snippets == null) {
            $this->snippets = new SnippetsApi($this->client);
        }
        return $this->snippets;
    }
    /**
     * Returns Subscriptions Api
     */
    public function getSubscriptionsApi() : SubscriptionsApi
    {
        if ($this->subscriptions == null) {
            $this->subscriptions = new SubscriptionsApi($this->client);
        }
        return $this->subscriptions;
    }
    /**
     * Returns Team Api
     */
    public function getTeamApi() : TeamApi
    {
        if ($this->team == null) {
            $this->team = new TeamApi($this->client);
        }
        return $this->team;
    }
    /**
     * Returns Terminal Api
     */
    public function getTerminalApi() : TerminalApi
    {
        if ($this->terminal == null) {
            $this->terminal = new TerminalApi($this->client);
        }
        return $this->terminal;
    }
    /**
     * Returns Vendors Api
     */
    public function getVendorsApi() : VendorsApi
    {
        if ($this->vendors == null) {
            $this->vendors = new VendorsApi($this->client);
        }
        return $this->vendors;
    }
    /**
     * Returns Webhook Subscriptions Api
     */
    public function getWebhookSubscriptionsApi() : WebhookSubscriptionsApi
    {
        if ($this->webhookSubscriptions == null) {
            $this->webhookSubscriptions = new WebhookSubscriptionsApi($this->client);
        }
        return $this->webhookSubscriptions;
    }
    /**
     * Get the defined global configurations
     */
    private function getGlobalConfiguration() : array
    {
        return [TemplateParam::init('custom_url', $this->getCustomUrl())->dontEncode(), HeaderParam::init('Square-Version', $this->getSquareVersion())];
    }
    /**
     * A map of all base urls used in different environments and servers
     *
     * @var array
     */
    private const ENVIRONMENT_MAP = [Environment::PRODUCTION => [Server::DEFAULT_ => 'https://connect.squareup.com'], Environment::SANDBOX => [Server::DEFAULT_ => 'https://connect.squareupsandbox.com'], Environment::CUSTOM => [Server::DEFAULT_ => '{custom_url}']];
}