18 const ACTIVE_URL =
'https://api.ofd-ya.ru/ofdapi/v1/getChequeLink';
19 const TEST_URL =
'https://testapi.ofd-ya.ru/ofdapi/v1/getChequeLink';
28 return static::TEST_URL;
31 return static::ACTIVE_URL;
50 return Localization\Loc::getMessage(
'SALE_CASHBOX_YARUS_OFD_NAME');
60 $queryString = $this->getQueryString($data);
61 $result = $this->sendQuery($queryString);
63 if (isset($result[0][
'link']))
65 return $result[0][
'link'];
76 private function getQueryString($data)
80 foreach ($paramsMap as $param => $key)
82 $queryData[$param] = $data[$key];
85 return Main\Web\Json::encode($queryData);
92 private function sendQuery($queryString)
100 $client =
new Main\Web\HttpClient();
101 $client->setHeader(static::HEADER_TOKEN_NAME, $authKey);
103 $client->query(
'POST', $this->
getUrl(), $queryString);
104 $result = $client->getResult();
107 $result = Main\Web\Json::decode($result);
109 catch (Main\ArgumentException $exception)
122 $settings = parent::getSettings();
124 $settings[
'AUTH'] = array(
125 'LABEL' => Localization\
Loc::getMessage(
'SALE_CASHBOX_YARUS_SETTINGS_AUTH'),
129 'LABEL' => Localization\
Loc::getMessage(
'SALE_CASHBOX_YARUS_AUTH_KEY'),
static getMessage($code, $replace=null, $language=null)