• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/classes/general/vi_account.php
  • Класс: CVoxImplantAccount
  • Вызов: CVoxImplantAccount::SetAccountBalance
public function SetAccountBalance($balance)
{
	$isTopUp = ($balance > $this->GetAccountBalance());
	if ($this->GetAccountBalance() == $balance)
	{
		return true;
	}
	$this->account_balance = floatval($balance);

	COption::SetOptionString("voximplant", self::ACCOUNT_BALANCE, $this->account_balance);
	if ($isTopUp)
	{
		COption::SetOptionString("voximplant", self::LAST_TOP_UP_TIMESTAMP, time());
	}

	BitrixVoximplantIntegrationPull::sendBalanceUpdate($this->account_balance, $this->GetAccountCurrency(false));

	return true;
}