Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d321205ac9 | |||
| 387e6e445f | |||
| 3bd043bde7 | |||
| 7c8ee85b89 | |||
| aab68646e6 | |||
| e1fb74ac01 |
@@ -103,8 +103,6 @@
|
|||||||
|
|
||||||
## Дополнительные ресурсы
|
## Дополнительные ресурсы
|
||||||
|
|
||||||
**Discord-сервер для обсуждения этой библиотеки: [discord.gg/mFYTQmp](https://discord.gg/mFYTQmp)**
|
|
||||||
|
|
||||||
Функционал, находящийся в разработке: [ROADMAP.md](ROADMAP.md)
|
Функционал, находящийся в разработке: [ROADMAP.md](ROADMAP.md)
|
||||||
|
|
||||||
Официальные ресурсы АТОЛ Онлайн:
|
Официальные ресурсы АТОЛ Онлайн:
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": [
|
"classmap": [
|
||||||
"src/AtolOnline/Api/",
|
"src/AtolOnline/Api/",
|
||||||
"src/AtolOnline/Api/Schemas/",
|
|
||||||
"src/AtolOnline/Exceptions/",
|
"src/AtolOnline/Exceptions/",
|
||||||
"src/AtolOnline/Entities/",
|
"src/AtolOnline/Entities/",
|
||||||
"src/AtolOnline/Traits/",
|
"src/AtolOnline/Traits/",
|
||||||
|
|||||||
@@ -183,8 +183,8 @@ class Kkt extends Client
|
|||||||
{
|
{
|
||||||
if (valid_strlen($url) > Constraints::MAX_LENGTH_CALLBACK_URL) {
|
if (valid_strlen($url) > Constraints::MAX_LENGTH_CALLBACK_URL) {
|
||||||
throw new AtolCallbackUrlTooLongException($url, Constraints::MAX_LENGTH_CALLBACK_URL);
|
throw new AtolCallbackUrlTooLongException($url, Constraints::MAX_LENGTH_CALLBACK_URL);
|
||||||
} elseif (preg_match(Constraints::PATTERN_CALLBACK_URL, $url)) {
|
} elseif (!preg_match(Constraints::PATTERN_CALLBACK_URL, $url)) {
|
||||||
throw new AtolInvalidCallbackUrlException();
|
throw new AtolInvalidCallbackUrlException('Callback URL not matches with pattern');
|
||||||
}
|
}
|
||||||
$this->kkt_config[$this->isTestMode() ? 'test' : 'prod']['callback_url'] = $url;
|
$this->kkt_config[$this->isTestMode() ? 'test' : 'prod']['callback_url'] = $url;
|
||||||
return $this;
|
return $this;
|
||||||
|
|||||||
@@ -72,5 +72,5 @@ class Constraints
|
|||||||
/**
|
/**
|
||||||
* Регулярное выражание для валидации строки Callback URL
|
* Регулярное выражание для валидации строки Callback URL
|
||||||
*/
|
*/
|
||||||
const PATTERN_CALLBACK_URL = "^http(s?)\:\/\/[0-9a-zA-Zа-яА-Я]([-.\w]*[0-9a-zA-Zа-яА-Я])*(:(0-9)*)*(\/?)([a-zAZ0-9а-яА-Я\-\.\?\,\'\/\\\+&=%\$#_]*)?$";
|
const PATTERN_CALLBACK_URL = "/^http(s?)\:\/\/[0-9a-zA-Zа-яА-Я]([-.\w]*[0-9a-zA-Zа-яА-Я])*(:(0-9)*)*(\/?)([a-zAZ0-9а-яА-Я\-\.\?\,\'\/\\\+&=%\$#_]*)?$/";
|
||||||
}
|
}
|
||||||
@@ -33,9 +33,9 @@ class AtolAuthFailedException extends Exception
|
|||||||
$message = $last_response->isValid()
|
$message = $last_response->isValid()
|
||||||
? $message
|
? $message
|
||||||
: '['.$last_response->error->code.'] '.$last_response->error->text.
|
: '['.$last_response->error->code.'] '.$last_response->error->text.
|
||||||
'. ERROR_ID: '.$last_response->error->error_ID.
|
'. ERROR_ID: '.$last_response->error->error_id.
|
||||||
'. TYPE: '.$last_response->error->type;
|
'. TYPE: '.$last_response->error->type;
|
||||||
$code = $last_response->isValid() ? $code : $last_response->error->code;
|
$code = $last_response->isValid() ? $code : $last_response->error->code;
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, $code, $previous);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class AtolException extends Exception
|
|||||||
*/
|
*/
|
||||||
public function __construct($message = "", $code = 0, Throwable $previous = null)
|
public function __construct($message = "", $code = 0, Throwable $previous = null)
|
||||||
{
|
{
|
||||||
|
$message = $message ?: $this->message;
|
||||||
if ($this->getFfdTags()) {
|
if ($this->getFfdTags()) {
|
||||||
$message .= ' [FFD tags: '.implode(', ', $this->getFfdTags()).']';
|
$message .= ' [FFD tags: '.implode(', ', $this->getFfdTags()).']';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user