Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
paymentpayaction.php
1<?php
2
3
5
8
10{
11 private function checkParams(array $fields): Sale\Result
12 {
13 $result = new Sale\Result();
14
15 if (empty($fields['ORDER_ID']) || (int)$fields['ORDER_ID'] <= 0)
16 {
17 $this->addError(new Main\Error('orderId not found', 202440400001));
18 }
19
20 if (empty($fields['ACCESS_CODE']))
21 {
22 $this->addError(new Main\Error('accessCode not found', 202440400002));
23 }
24
25 return $result;
26 }
27
28 public function run(array $fields)
29 {
30 $checkParamsResult = $this->checkParams($fields);
31 if (!$checkParamsResult->isSuccess())
32 {
33 $this->addErrors($checkParamsResult->getErrors());
34 return null;
35 }
36
37 $params = [
38 'ORDER_ID' => (int)$fields['ORDER_ID'],
39 'RETURN_URL' => $fields['RETURN_URL'],
40 'ACCESS_CODE' => $fields['ACCESS_CODE']
41 ];
42
43 return new Main\Engine\Response\Component('bitrix:salescenter.payment.pay', 'checkout_form', $params);
44 }
45}
addError(Error $error)
Definition action.php:200
addErrors(array $errors)
Definition action.php:213