public function getBalance($user_id, $type = -1){
        $url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . Endpoints::WALLET_CREDITS_BALANCE;
        $url = sprintf($url, $user_id, $type);
        $result = $this->authenticationService->getTransport()->fetch($url);

        if($result["code"] == APIResponse::RESPONSE_SUCCESS){
            return $result['results'];
        }else{
            return 0;
        }
    }
public function getBalance($user_id, $type = -1){
        $url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . Endpoints::WALLET_CREDITS_BALANCE;
        $url = sprintf($url, $user_id, $type);
        $result = $this->authenticationService->getTransport()->fetch($url);

        if($result["code"] == APIResponse::RESPONSE_SUCCESS){
            return $result['results'];
        }else{
            return 0;
        }
    }
public function getBalance ( $ user_id , $ type = - 1 ) { $ url = $ this -> authenticationService -> getServerEndPoint ( ) . Endpoints :: VERSION . Endpoints :: BASE_WALLET . Endpoints :: WALLET_CREDITS_BALANCE ; $ url = sprintf ( $ url , $ user_id , $ type ) ; $ result = $ this -> authenticationService -> getTransport ( ) -> fetch ( $ url ) ; if ( $ result [ "code" ] == APIResponse :: RESPONSE_SUCCESS ) { return $ result [ 'results' ] ; } else { return 0 ; } }
Get the wallet balance of a user
@param $user_id
@param int $type
@return float
@throws Exception
@throws \CodeMojo\Client\Http\InvalidArgumentException
Get the wallet balance of a user