From d08120f9b2c14241653ab724ea010204f9a7eb8c Mon Sep 17 00:00:00 2001 From: Nikita Date: Tue, 24 Nov 2020 17:12:29 +0300 Subject: [PATCH] small oauth updates --- src/AmoCRM/OAuth/AmoCRMOAuth.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/AmoCRM/OAuth/AmoCRMOAuth.php b/src/AmoCRM/OAuth/AmoCRMOAuth.php index c330dc13..cf29d7f4 100755 --- a/src/AmoCRM/OAuth/AmoCRMOAuth.php +++ b/src/AmoCRM/OAuth/AmoCRMOAuth.php @@ -180,6 +180,19 @@ public function setBaseDomain(string $domain): self return $this; } + /** + * Установка протокола + * @param string $protocol + * + * @return $this + */ + public function setProtocol(string $protocol): self + { + $this->oauthProvider->setProtocol($protocol); + + return $this; + } + /** * Получение авторизационных заголовков для переданного Access токена * @param AccessTokenInterface $accessToken @@ -346,7 +359,7 @@ public function getAccountDomain(AccessTokenInterface $accessToken): AccountDoma AmoCRMApiRequest::GET_REQUEST, sprintf( '%s%s%s', - $this->oauthProvider->protocol, + $this->oauthProvider->getProtocol(), $this->oauthProvider->getBaseDomain(), '/oauth2/account/subdomain' ),