From b253642b6f06c35fd424fd4138aa5b2094040a2c Mon Sep 17 00:00:00 2001 From: Alexey Chelnakov Date: Wed, 20 Jun 2018 11:47:50 +0300 Subject: [PATCH] fixes --- src/AtolOnlineClient/AtolOnlineApi.php | 5 ++++- src/AtolOnlineClient/Configuration.php | 21 --------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/AtolOnlineClient/AtolOnlineApi.php b/src/AtolOnlineClient/AtolOnlineApi.php index 85893be..654d43a 100644 --- a/src/AtolOnlineClient/AtolOnlineApi.php +++ b/src/AtolOnlineClient/AtolOnlineApi.php @@ -7,8 +7,8 @@ use Doctrine\Common\Cache\Cache; use Guzzle\Http\Client; +use Guzzle\Http\Exception\BadResponseException; use Guzzle\Http\Message\Response; -use GuzzleHttp\Exception\BadResponseException; use Psr\Log\LoggerInterface; class AtolOnlineApi @@ -65,6 +65,9 @@ class AtolOnlineApi $this->login = $connectionConfig->login; $this->pass = $connectionConfig->pass; $this->groupCode = $connectionConfig->group; + if (!$connectionConfig->version) { + $connectionConfig->version = self::API_VERSION_V3; + } $this->version = $connectionConfig->version; $this->debug = $connectionConfig->isDebug(); $this->attempts = 0; diff --git a/src/AtolOnlineClient/Configuration.php b/src/AtolOnlineClient/Configuration.php index 8d6e1d9..1227a85 100644 --- a/src/AtolOnlineClient/Configuration.php +++ b/src/AtolOnlineClient/Configuration.php @@ -26,27 +26,6 @@ class Configuration implements ConfigurationInterface $metadata->addPropertyConstraint('connections', new Assert\Valid()); } -// public function loadConnections($connections) -// { -// if (!$connections) { -// return; -// } -// foreach ($connections as $connectionItem) { -// $connection = new Connection(); -// $connection->login = $connectionItem['login']; -// $connection->pass = $connectionItem['pass']; -// $connection->group = $connectionItem['group']; -//// $connection->legalEntity = $connectionItem['legalEntity']; -// $connection->sno = $connectionItem['sno']; -// $connection->enabled = (bool) $connectionItem['enabled']; -//// $connection->paymentTypes = $connectionItem['paymentTypes']; -//// $connection->paymentStatuses = $connectionItem['paymentStatuses']; -// $connection->ofd = $connectionItem['ofd']; -// $connection->version = $connectionItem['version']; -// $this->connections[] = $connection; -// } -// } - /** * @param bool $enabled */