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