• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/classes/general/vi_account.php
  • Класс: CVoxImplantAccount
  • Вызов: CVoxImplantAccount::UpdateAccountInfo
public function UpdateAccountInfo($accountInfo = null)
{
	if(is_null($accountInfo))
	{
		$ViHttp = new CVoxImplantHttp();
		$accountInfo = $ViHttp->GetAccountInfo();

		if ($ViHttp->GetError()->error)
		{
			$this->error = new CVoxImplantError(__METHOD__, $ViHttp->GetError()->code, $ViHttp->GetError()->msg);
			return false;
		}
	}

	$this->SetAccountName($accountInfo->account_name);
	$this->SetAccountBalance($accountInfo->account_balance);
	$this->SetAccountCurrency($accountInfo->account_currency);
	$this->SetAccountBetaAccess($accountInfo->account_beta_access);
	$this->SetAccountLang($accountInfo->account_lang);

	if($accountInfo->account_payed !== self::GetPayedFlag())
		$this->SetPayedFlag($accountInfo->account_payed);

	$sipPaid = $accountInfo->sip_paid === 'Y';
	if($sipPaid !== CVoxImplantConfig::GetModeStatus(CVoxImplantConfig::MODE_SIP))
		CVoxImplantConfig::SetModeStatus(CVoxImplantConfig::MODE_SIP, $sipPaid);

	return true;
}