public class walletcustinfo
{
public int ID { get; set; }
public string ATTRIBUTECODE { get; set; }
public string ATTRIBUTENAME { get; set; }
public string ATTRIBUTEVALUE { get; set; }
public int ISMANDATORY { get; set; }
public int ISUNIQUE { get; set; }
public int ACCOUNTHOLDERID { get; set; }
}
public class Rootwalletinfo
{
public string code { get; set; }
public string description { get; set; }
public List<walletcustinfo> data { get; set; }
}
public Rootwalletinfo GetWalletCustomerInfo(string cnic, string IP)
{
Rootwalletinfo _response = new Rootwalletinfo()
{
code = "99",
description = "Transaction Failed"
};
try
{
string url = "http://99.99.99.99:7777/Wallet-ggg-iurytrr/services/wallet/CustomerInfo/";
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(url);
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
Log.WriteOnboardWalletLogEntry("\n\nInfo", IP, "Getting Response: ");
HttpResponseMessage response = client.GetAsync(cnic).Result;
var resp = response.Content.ReadAsStringAsync().Result;
_response = JsonConvert.DeserializeObject<Rootwalletinfo>(resp);
return _response;
}
catch (Exception e)
{
return _response;
}
}
Json Response: { "code": "00", "description": "SUCCESS", "data": [ { "ID": 6547362, "ATTRIBUTECODE": "Company Name", "ATTRIBUTENAME": "Company Name", "ATTRIBUTEVALUE": "Jerry", "ISMANDATORY": 0, "ISUNIQUE": 0, "ACCOUNTHOLDERID": 6454647 }, { "ID": 10540617, "ATTRIBUTECODE": "Product Name", "ATTRIBUTENAME": "Product Name", "ATTRIBUTEVALUE": "Pay Level 0", "ISMANDATORY": 0, "ISUNIQUE": 0, "ACCOUNTHOLDERID": 4353647 } ] }