Check Payment

Check the status of a particular payment using the transaction ID.

Method


GET https://api.ninjapay.me/webextension/api/v1/fiat/realtime-payment-link/link/payment-check/:id

Parameters

id: String // the order_id of the payment request.

Response - 200

{
    "status": true,
    "data": {
        "trxStatus": "FAILED",
        "payload": {}
    },
    "message": "Looks like you have abandoned the payment. Please try again to complete the payment."
}

Response - 400

{
    "status": true,
    "data": {
        "trxStatus": "FAILED",
        "payload": {}
    },
    "message": "Looks like you have abandoned the payment. Please try again to complete the payment."
}

Code Example


const options = {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'API_KEY'
  },
  body: '{"tid": "21066027789"}'
};

fetch('https://prod.ninjapay.me/uapi/v1/p2p/paymentLink/checkPayment', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
  

RECOMMENEDED APPROACH If the payment status is Pending, then Check Status API should be called in the following interval: The first status check at 20-25 seconds post transaction start, then Every 3 seconds once for the next 30 seconds, Every 6 seconds once for the next 60 seconds, Every 10 seconds for the next 60 seconds, Every 30 seconds for the next 60 seconds, and then Every 1 min until timeout (10 mins).

Last updated