public function GetOneTimeKey($key) { $ViAccount = new CVoxImplantAccount(); $accountName = $ViAccount->GetAccountName(); if (!$accountName) { $this->error = new CVoxImplantError(__METHOD__, $ViAccount->GetError()->code, GetMessage('VI_GET_ACCOUNT_INFO', array('#CODE#' => $ViAccount->GetError()->code))); return false; } $ViUser = new CVoxImplantUser(); $userInfo = $ViUser->GetUserInfo($this->userId); if (!$userInfo) { $this->error = new CVoxImplantError(__METHOD__, $ViUser->GetError()->code, GetMessage('VI_GET_USER_INFO', array('#CODE#' => $ViUser->GetError()->code))); return false; } return md5($key . "|" . md5($userInfo['user_login'] . ":voximplant.com:" . $userInfo['user_password'])); }
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } $APPLICATION->SetAdditionalCSS("/bitrix/components/bitrix/voximplant.main/templates/.default/telephony.css"); use Bitrix\Voximplant as VI; $ViAccount = new CVoxImplantAccount(); $amount = $ViAccount->GetAccountBalance(true); $currency = $ViAccount->GetAccountCurrency(); $errorMessage = ''; if ($ViAccount->GetError()->error) { $amount = ''; $currency = ''; if ($ViAccount->GetError()->code == 'LICENCE_ERROR') { $errorMessage = GetMessage('VI_ERROR_LICENSE'); } else { $errorMessage = GetMessage('VI_ERROR'); } } function getBalance($amount) { $amount = round(floatval($amount), 2); $amount = $amount . ''; $str = ''; $amountCount = strlen($amount); for ($i = 0; $i < $amountCount; $i++) { if ($amount[$i] == '.') { $str .= '<span class="tel-num tel-num-point">.</span>'; } else { $str .= '<span class="tel-num tel-num-' . $amount[$i] . '">' . $amount[$i] . '</span>';