1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
firstofd.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\Cashbox;
4
5use Bitrix\Main\Localization;
6use Bitrix\Main;
7
9
14class FirstOfd extends Ofd
15{
16 const ACTIVE_URL = 'https://consumer.1-ofd.ru/v1?';
17 const TEST_URL = 'https://test-consumer.1-ofd.ru/v1?';
18
22 protected function getUrl()
23 {
24 return $this->isTestMode() ? static::TEST_URL : static::ACTIVE_URL;
25 }
26
30 protected function getLinkParamsMap()
31 {
32 return array(
39 );
40 }
41
46 public function generateCheckLink($data)
47 {
48 $queryParams = array();
49
50 $map = $this->getLinkParamsMap();
51 foreach ($map as $queryKey => $checkKey)
52 {
53 if ($data[$checkKey])
54 {
55 if ($queryKey === 't')
56 {
57 $dateTime = Main\Type\DateTime::createFromTimestamp($data[$checkKey]);
58 $queryParams[] = $queryKey.'='.$dateTime->format('Ymd\THis');
59 }
60 else if ($queryKey === 'n')
61 {
62 $calculatedSignMap = $this->getCalculatedSignMap();
63 $queryParams[] = $queryKey.'='.$calculatedSignMap[$data[$checkKey]];
64 }
65 else
66 {
67 $queryParams[] = $queryKey.'='.$data[$checkKey];
68 }
69 }
70 }
71
72 if (empty($queryParams))
73 return '';
74
75 $url = $this->getUrl();
76 return $url.implode('&', $queryParams);
77 }
78
82 private function getCalculatedSignMap()
83 {
84 return array(
87 );
88 }
89
94 public static function getName()
95 {
96 return Localization\Loc::getMessage('SALE_CASHBOX_FIRST_OFD_NAME');
97 }
98
99}
static loadMessages($file)
Определения loc.php:65
static getMessage($code, $replace=null, $language=null)
Определения loc.php:30
static createFromTimestamp($timestamp)
Определения datetime.php:246
const CALCULATED_SIGN_INCOME
Определения abstractcheck.php:34
const PARAM_CALCULATION_ATTR
Определения abstractcheck.php:31
const PARAM_FISCAL_DOC_ATTR
Определения abstractcheck.php:24
const PARAM_FISCAL_DOC_NUMBER
Определения abstractcheck.php:23
const CALCULATED_SIGN_CONSUMPTION
Определения abstractcheck.php:35
const TEST_URL
Определения firstofd.php:17
static getName()
Определения firstofd.php:94
const ACTIVE_URL
Определения firstofd.php:16
generateCheckLink($data)
Определения firstofd.php:46
getLinkParamsMap()
Определения firstofd.php:30
Определения ofd.php:15
isTestMode()
Определения ofd.php:211
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$map
Определения config.php:5
$url
Определения iframe.php:7