Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
serviceresult.php
1<?php
2
4
5use Bitrix\Main\Entity\Result;
8
13class ServiceResult extends Result
14{
15 const MONEY_COMING = 'money_coming';
16 const MONEY_LEAVING = 'money_leaving';
17
18 private $psData = array();
19 private $resultApplied = true;
20 private $operationType = null;
21 private $template = '';
22 private $paymentUrl = '';
23
24 private string $qr = '';
25
29 public function setPsData($psData)
30 {
31 $this->psData = $psData;
32 }
33
37 public function getPsData()
38 {
39 return $this->psData;
40
41 }
42
46 public function isResultApplied()
47 {
48 return $this->resultApplied;
49 }
50
54 public function setOperationType($operationType)
55 {
56 $this->operationType = $operationType;
57 }
58
62 public function getOperationType()
63 {
64 return $this->operationType;
65 }
66
70 public function setResultApplied($resultApplied)
71 {
72 $this->resultApplied = $resultApplied;
73 }
74
78 public function getTemplate()
79 {
80 return $this->template;
81 }
82
86 public function setTemplate($template)
87 {
88 $this->template = $template;
89 }
90
94 public function getPaymentUrl(): string
95 {
96 return $this->paymentUrl;
97 }
98
102 public function setPaymentUrl($paymentUrl): void
103 {
104 $this->paymentUrl = $paymentUrl;
105 }
106
107 public function getQr(): string
108 {
109 return $this->qr;
110 }
111
112 public function setQr(string $qr): void
113 {
114 $this->qr = $qr;
115 }
116
120 public function getBuyerErrors(): array
121 {
122 $errors = [];
123
125 foreach ($this->getBuyerErrorIterator() as $error)
126 {
127 $errors[] = $error;
128 }
129
130 return $errors;
131 }
132
136 public function getBuyerErrorMessages(): array
137 {
138 $messages = [];
139
141 foreach ($this->getBuyerErrorIterator() as $error)
142 {
143 $messages[] = $error->getMessage();
144 }
145
146 return $messages;
147 }
148
153 {
154 $callback = function (Main\Error $error)
155 {
156 return $error instanceof Error
157 && $error->isVisibleForBuyer();
158 };
159
160 return new Internals\CollectionFilterIterator(new \ArrayIterator($this->getErrors()), $callback);
161 }
162}