Ejemplo n.º 1
0
 public async Task<Balance> GetSimBalance(string msisdn, OAuthToken token)
 {
     string response;
     using (var oauth = new OAuth())
     {
         var parameters = new List<QueryParameter> { new QueryParameter("msisdn", WebUtility.UrlEncode(msisdn)) };
         response = await oauth.OAuthRequest(Credentials.GetInstance(), token, BaseUrl + "sim_balance.json", parameters);
     }
     //TODO: finish this
     if (response != null && !string.IsNullOrWhiteSpace(response))
         return JsonConvert.DeserializeObject<Balance>(response);
     return new Balance();
 }
Ejemplo n.º 2
0
 public async Task<List<Msisdn>> GetMsisdnList(OAuthToken token)
 {
     string response;
     using (var oauth = new OAuth())
     {
         var parameters = new List<QueryParameter> { new QueryParameter("alias", "1") };
         response = await oauth.OAuthRequest(Credentials.GetInstance(), token, BaseUrl + "msisdn_list.json", parameters);
     }
     //TODO: finish this
     if(response != null && !string.IsNullOrWhiteSpace(response))
         return JsonConvert.DeserializeObject<List<Msisdn>>(response);
     return new List<Msisdn>();
 }
Ejemplo n.º 3
0
 public async Task TestGetSimDetails()
 {
     OAuthToken token;
     using (var xauth = new XAuth())
     {
         token = await xauth.XAuthAccessTokenRequest("test", "test", Credentials.GetInstance(), "https://mobilevikings.com:443/api/2.0/oauth/access_token/");
     }
     string response;
     using (var oauth = new OAuth())
     {
         var parameters = new List<QueryParameter> { new QueryParameter("alias", "1") };
         response = await oauth.OAuthRequest(Credentials.GetInstance(), token, "https://mobilevikings.com:443/api/2.0/oauth/msisdn_list.json", parameters);
     }
     Assert.AreNotEqual(string.Empty, response);
 }