34 public function __construct(
string $apiKey,
string $secretKey)
36 $this->apiKey = $apiKey;
37 $this->secretKey = $secretKey;
38 $this->
http = new \Bitrix\Main\Web\HttpClient;
39 $this->
http->setTimeout(5);
48 private function setHeaders(
string $endPoint, ?
string $payLoad =
null): void
55 $signature = hash_hmac(
'sha256', $this->apiKey . $endPoint . $payLoad, $this->secretKey);
56 $this->
http->setHeader(
'X-OMNI-APIKEY', $this->apiKey);
57 $this->
http->setHeader(
'X-OMNI-SIGNATURE', $signature);
58 $this->
http->setHeader(
'content-type',
'application/json');
67 private function sendPostCommand(
string $endPoint,
string $payLoad): string
69 $endPoint = $this::BASE_ENDPOINT . $endPoint;
70 $this->setHeaders($endPoint, $payLoad);
71 $this->
http->post($endPoint, $payLoad);
72 return $this->
http->getResult();
80 private function sendGetCommand(
string $endPoint): string
82 $endPoint = $this::BASE_ENDPOINT . $endPoint;
83 $this->setHeaders($endPoint);
84 $this->
http->get($endPoint);
85 return $this->
http->getResult();
98 $domain = mb_strtolower($domain);
102 $payLoad = json_encode([
107 $res = $omnilance->sendPostCommand(
'domains/checkAvailability', $payLoad);
110 if (isset(
$res[
'error']))
116 if (isset(
$res[
'results']) && is_array(
$res[
'results']))
118 foreach (
$res[
'results'] as $item)
120 if ($item[
'domainName'] == $domain)
122 if ($item[
'status'] ==
'registered')
161 $domain = mb_strtolower($domain);
163 $payLoad = json_encode([
165 'domainName' => $domain,
166 'privacyEnabled' =>
true
172 $res = $omnilance->sendPostCommand(
'domains/createDomain', $payLoad);
175 if (isset(
$res[
'error']))
194 $domain = mb_strtolower($domain);
196 $payLoad = json_encode([
198 'domainName' => $domain
204 $res = $omnilance->sendPostCommand(
'domains/renewDomain/'.$domain, $payLoad);
207 if (isset(
$res[
'error']))
228 $domain = mb_strtolower($domain);
234 'type' => (isset($dns[
'type']) && is_string($dns[
'type'])) ? strtoupper($dns[
'type']) :
null,
235 'name' => (isset($dns[
'name']) && is_string($dns[
'name'])) ? $dns[
'name'] :
'',
236 'value' => isset($dns[
'value']) ? [$dns[
'value']] : [],
239 $payLoad = json_encode($payLoad);
245 $res = $omnilance->sendPostCommand(
'domains/createZoneRecord/'.$domain, $payLoad);
249 $res = $omnilance->sendPostCommand(
'domains/createDnsRecord/'.$domain, $payLoad);
254 if (isset(
$res[
'error']))
282 if (isset(
$res[
'error']))
288 if (!isset(
$res[
'domains']) || !isset(
$res[
'lastPage']))
294 foreach (
$res[
'domains'] as $domain)
296 $list[$domain[
'domainName']] = [
297 'domain_name' => $domain[
'domainName'],
298 'creation_date' => $domain[
'createDate'],
299 'expiration_date' => $domain[
'expireDate'],
if(isset( $_REQUEST["mode"]) &&$_REQUEST["mode"]=="ajax") if(isset($_REQUEST["mode"]) && $_REQUEST["mode"]=="save_lru" &&check_bitrix_sessid()) $first
static renewDomain(string $user, string $password, string $domain, ?string &$error)
static updateDns(string $user, string $password, string $domain, array $params, ?string &$error)
static suggestDomain(string $user, string $password, string $word1, string $word2, array $tlds, ?string &$error)
static checkDomain(string $user, string $password, string $domain, ?string &$error)
static createDomain(string $user, string $password, string $domain, array $params, ?string &$error)
static getDomainsList(string $user, string $password, ?string &$error)
__construct(string $apiKey, string $secretKey)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
<? if( $useEditor3):?>< tr class="heading">< td colspan="2"><? echo GetMessage("FILEMAN_OPTION_SPELL_SET");?></td ></tr ><? if(function_exists( 'pspell_config_create')):$use_pspell_checked=(COption::GetOptionString( $module_id, "use_pspell", "Y")=="Y") ? "checked" :"";?>< tr >< td valign="top">< label for="use_pspell"><?echo GetMessage("FILEMAN_OPTION_USE_PSPELL");?></label >< br >< a title="<?echo GetMessage("FILEMAN_OPTION_ADDISH_DICS_TITLE");?> http
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']