public async Task> GenrateKeys(GenrateKeysRequest obj)
{
Output dto = new Output();
var url = {Provided End Point};
var client = new HttpClient();
client.BaseAddress = new Uri(url);
try
{
var resultser = JsonConvert.SerializeObject(obj);
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
var response = client.PostAsJsonAsync(url, obj).Result;
if (response.IsSuccessStatusCode)
{
var ss = response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject>(ss.Result);
dto = result;
}
else
{
var ss = response.Content.ReadAsStringAsync();
var resps = ss.Result.ToString();
}
}
catch (HttpRequestException ex)
{
}
return dto;
}
Class SurroundingClass
Public Task As async
Private Sub New(ByVal obj As ValidatePaymentRequest)
Dim dto As Output = New Output()
Dim url = {Provided End Point};
Dim client = New HttpClient()
client.BaseAddress = New Uri(url)
Try
obj.hash = ComputeHash(obj)
Dim resultser = JsonConvert.SerializeObject(obj)
client.DefaultRequestHeaders.Accept.Add(New System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"))
client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8")
Dim response = client.PostAsJsonAsync(url, obj).Result
If response.IsSuccessStatusCode Then
Dim ss = response.Content.ReadAsStringAsync()
Dim result = JsonConvert.DeserializeObject > (ss.Result)
dto = result
Else
Dim ss = response.Content.ReadAsStringAsync()
Dim resps = ss.Result
Dim resultse = JsonConvert.SerializeObject(resps.ToString())
End If
Catch ex As HttpRequestException
End Try
Return dto
End Sub
End Class
pagecode:` public async Task> GenrateKeys(GenrateKeysRequest obj)
{
Output dto = new Output();
var url = {Provided End Point};
var client = new HttpClient();
client.BaseAddress = new Uri(url);
try
{
var resultser = JsonConvert.SerializeObject(obj);
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
var response = client.PostAsJsonAsync(url, obj).Result;
if (response.IsSuccessStatusCode)
{
var ss = response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject>(ss.Result);
dto = result;
}
else
{
var ss = response.Content.ReadAsStringAsync();
var resps = ss.Result;
var resultse = JsonConvert.SerializeObject(resps.ToString());
}
}
catch (HttpRequestException ex)
{
}
return dto;
}`;
Note: Merchant keys are valid for 24 hours. Users are expected to generate a new merchant key every 24 hours. If the merchant utilizes an invalid RSA public key, the following error will show up in subsequent calls. { "ErrorMessage" : "Unable to decrypt card data" }