function changeBalance($funds, $transactionId = NULL)
    {
        if (!$this->getCustomerId() > 0) {
            throw new BalanceException("Customer is invalid");
        }

        if (!(is_numeric($funds))) {
            throw new BalanceException("Funds value is invalid");
        }

        $this->_funds = $funds;
        $this->_transactionId = ($transactionId ? $transactionId : $this->generateTransactionId());


        if (!is_string($this->_transactionId) || strlen($this->_transactionId) != 32) {
            throw new BalanceException(" TransactionId value is invalid");
        }

        $response = $this->call('updateprepaidbalance', array(
            "customer_id" => $this->getCustomerId(),
            "prepaid_funds" => $this->_funds,
            "operation_type" => ($this->_funds > 0) ? self::OP_ADD : self::OP_REMOVE,
            "uniq_hash" => $this->_transactionId
        ));
        //set prepaid balance value

        $this->setPrepaidBalance($response['prepaid_balance']);
        return $this;
    }
function changeBalance($funds, $transactionId = NULL)
    {
        if (!$this->getCustomerId() > 0) {
            throw new BalanceException("Customer is invalid");
        }

        if (!(is_numeric($funds))) {
            throw new BalanceException("Funds value is invalid");
        }

        $this->_funds = $funds;
        $this->_transactionId = ($transactionId ? $transactionId : $this->generateTransactionId());


        if (!is_string($this->_transactionId) || strlen($this->_transactionId) != 32) {
            throw new BalanceException(" TransactionId value is invalid");
        }

        $response = $this->call('updateprepaidbalance', array(
            "customer_id" => $this->getCustomerId(),
            "prepaid_funds" => $this->_funds,
            "operation_type" => ($this->_funds > 0) ? self::OP_ADD : self::OP_REMOVE,
            "uniq_hash" => $this->_transactionId
        ));
        //set prepaid balance value

        $this->setPrepaidBalance($response['prepaid_balance']);
        return $this;
    }
function changeBalance ( $ funds , $ transactionId = NULL ) { if ( ! $ this -> getCustomerId ( ) > 0 ) { throw new BalanceException ( "Customer is invalid" ) ; } if ( ! ( is_numeric ( $ funds ) ) ) { throw new BalanceException ( "Funds value is invalid" ) ; } $ this -> _funds = $ funds ; $ this -> _transactionId = ( $ transactionId ? $ transactionId : $ this -> generateTransactionId ( ) ) ; if ( ! is_string ( $ this -> _transactionId ) || strlen ( $ this -> _transactionId ) != 32 ) { throw new BalanceException ( " TransactionId value is invalid" ) ; } $ response = $ this -> call ( 'updateprepaidbalance' , array ( "customer_id" => $ this -> getCustomerId ( ) , "prepaid_funds" => $ this -> _funds , "operation_type" => ( $ this -> _funds > 0 ) ? self :: OP_ADD : self :: OP_REMOVE , "uniq_hash" => $ this -> _transactionId ) ) ; //set prepaid balance value $ this -> setPrepaidBalance ( $ response [ 'prepaid_balance' ] ) ; return $ this ; }
method to change customer balance with funds value
@link http://open.didww.com/index.php/10._Update_Prepaid_Balance
@param float $funds
@param string $transactionId d5 hash of transaction to avoid duplications
@return Balance
@throws BalanceException
method to change customer balance with funds value