В тестовом режиме установка логина и пароля теперь необязательна

This commit is contained in:
Anthony Axenov 2020-04-16 21:47:36 +08:00
parent b499d998e3
commit dc20d3e08e

View File

@ -115,11 +115,13 @@ class Kkt extends Client
*/ */
public function setLogin(string $login) public function setLogin(string $login)
{ {
if (!$this->isTestMode()) {
if (empty($login)) { if (empty($login)) {
throw new AtolKktLoginEmptyException(); throw new AtolKktLoginEmptyException();
} elseif (strlen($login) > 100) { } elseif (strlen($login) > 100) {
throw new AtolKktLoginTooLongException($login, 100); throw new AtolKktLoginTooLongException($login, 100);
} }
}
$this->kkt_config['prod']['login'] = $login; $this->kkt_config['prod']['login'] = $login;
return $this; return $this;
} }
@ -143,9 +145,11 @@ class Kkt extends Client
*/ */
public function setPassword(string $password) public function setPassword(string $password)
{ {
if (!$this->isTestMode()) {
if (empty($password)) { if (empty($password)) {
throw new AtolKktPasswordEmptyException(); throw new AtolKktPasswordEmptyException();
} }
}
$this->kkt_config['prod']['pass'] = $password; $this->kkt_config['prod']['pass'] = $password;
return $this; return $this;
} }