Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3bd043bde7 | |||
| 7c8ee85b89 | |||
| aab68646e6 | |||
| e1fb74ac01 |
@@ -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,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