Exemple #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();
 }
Exemple #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>();
 }
 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);
 }