using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://www.onecard.net");
var content = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("OneCard_MerchID", OneCard_MerchID),
new KeyValuePair<string, string>("OneCard_TransID", OneCard_TransID),
new KeyValuePair<string, string>("OneCard_HashKey", OneCard_HashKey)
});
var result = client.PostAsync("/remote/paymentIntegrationQuery.html", content).Result;
try
{
string[] resultItem = result.Content.ReadAsStringAsync().Result.Split('|');
string _code = resultItem[0].Split('=')[1].ToString();
string _message = resultItem[1].Split('=')[1].ToString();
string _hashKey = resultItem[2].Split('=')[1].ToString();
if (_code == "00" || _code == "18")
{
Lblresult.Text = "Your transaction successfully";
}
else
{
Lblresult.Text = _message;
}
}
{
client.BaseAddress = new Uri("https://www.onecard.net");
var content = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("OneCard_MerchID", OneCard_MerchID),
new KeyValuePair<string, string>("OneCard_TransID", OneCard_TransID),
new KeyValuePair<string, string>("OneCard_HashKey", OneCard_HashKey)
});
var result = client.PostAsync("/remote/paymentIntegrationQuery.html", content).Result;
try
{
string[] resultItem = result.Content.ReadAsStringAsync().Result.Split('|');
string _code = resultItem[0].Split('=')[1].ToString();
string _message = resultItem[1].Split('=')[1].ToString();
string _hashKey = resultItem[2].Split('=')[1].ToString();
if (_code == "00" || _code == "18")
{
Lblresult.Text = "Your transaction successfully";
}
else
{
Lblresult.Text = _message;
}
}