6. Payment Status

API to get the status of a payment

API Endpoint

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

referenceID

String

15 digit unique transaction number

amount

decimal

Amount of transaction

tranDate

datetime

Date of the transaction

result

string

Shows 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