6, Payment Status

API to get the status of a payment

API Endpoints

Production Base URL /api/GenToken/GetStatus

Sample Request & Response

{
    "merchantCode":"xxxxx",
    "authKey":"xxxxx",
    "ReferenceID":"(15 digit number passing during the payment creation)"

}

Response Parameters

Parameters
Datatype
Description

RefrenceId

String

15-digit unique transaction number

Amount

decimal

Amount of transaction

tranDate

Datetime

date of the transaction

result

string

show the result of the transaction (CANCELED or COMPLETED)

isRefunded

integer

1 is refunded 2 is processing 3 is rejected

Sample Code to post data

public async Task> CheckPaymentStatus(PaymentStatus 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;
  }

Last updated