streamFactory = $streamFactory; $this->api = new Api( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->costs = new Costs( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->customFields = new CustomFields( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->customers = new Customers( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->customersCorporate = new CustomersCorporate( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->delivery = new Delivery( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->files = new Files( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->integration = new Integration( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->loyalty = new Loyalty( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->orders = new Orders( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->packs = new Packs( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->payments = new Payments( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->references = new References( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->segments = new Segments( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->settings = new Settings( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->store = new Store( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->tasks = new Tasks( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->telephony = new Telephony( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->users = new Users( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->verification = new Verification( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->statistics = new Statistics( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); $this->customMethods = new CustomMethods( $url, $httpClient, $requestTransformer, $responseTransformer, $eventDispatcher, $logger ); } /** * Returns PSR-17 stream factory. * * StreamFactory can be used to create a PSR-7 StreamInterface from various sources. * * @return \Psr\Http\Message\StreamFactoryInterface */ public function getStreamFactory(): StreamFactoryInterface { return $this->streamFactory; } /** * Parses provided URL, builds API url with version out of it. * * @param string $url * * @return string */ private static function getBaseUrl(string $url): string { return Utils::removeTrailingSlash($url) . '/api/v5'; } }