/** * get ShopAppstoreLib client * @param ShopInterface $shop * @return ClientInterface * @throws \DreamCommerce\ShopAppstoreLib\Exception\ClientException */ public function getClient(ShopInterface $shop) { $tokens = $shop->getToken(); /** * @var $client Client\OAuth */ $client = Client::factory(Client::ADAPTER_OAUTH, ['entrypoint' => $shop->getShopUrl(), 'client_id' => $this->getAppId(), 'client_secret' => $this->getAppSecret(), 'skip_ssl' => $this->skipSsl, 'user_agent' => $this->getUserAgent()]); $client->setAccessToken($tokens->getAccessToken()); if ($this->logger) { $client->setLogger($this->logger); } return $client; }
/** * check if specified shop supports valid SSL * @param ShopInterface $shop * @return bool */ public function verifySsl(ShopInterface $shop) { $url = $shop->getShopUrl(); return $this->verifySslUrl($url . '/basket'); }