forked from payuru/php-payu4
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPaymentException.php
More file actions
42 lines (36 loc) · 954 Bytes
/
PaymentException.php
File metadata and controls
42 lines (36 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types=1);
namespace Ypmn;
class PaymentException extends \Exception
{
/** @var string Подробности для логирования */
private string $logText;
/** @return string Ошибка в формате Bootstrap */
public function getHtmlMessage(): string
{
return '
<div class="alert alert-danger" role="alert">
<strong>Ошибка оплаты:</strong>
<br>
<br>
' . htmlspecialchars($this->getMessage()) . '
</div>
';
}
/**
* @return string
*/
public function getLogText(): string
{
return $this->logText;
}
/**
* @param string $logText
* @return PaymentException
*/
public function setLogText(string $logText): self
{
$this->logText = $logText;
return $this;
}
}