Last transaction query

This API retrieves the last transaction details from the backend. It is primarily used when there is an issue obtaining the transaction result. In certain cases, such as an app crash or timeout, this API can help verify the transaction status if it is unknown.

The 'OrderID' parameter is kind of a client reference ID which should be created and passed to the payment app while initiating the transaction. Once the last transaction is queried then this 'orderID' will also be returned and the merchant app can check if it is the same or not to get to know transaction status.

Call example

App2AppRequest app2AppRequest = new App2AppRequest(); 

//Optional to add register/config parameters

app2AppService.getLastTxn(app2AppRequest, eventListener);

Example request

   "lastTxn": {
    "registerParameters": {
      "terminalId": "00192118",
      "merchantId": "000000009041042",
      "activationCode": "testCode"
     }
    }

Example response

Success

 "appLastTxn": {
  "transaction_id": "302684069304",
  "transaction_date": "230126",
  "amount": "700",
  "approvalCode": "00",
  "card_number": "0516",
  "orderId": "167471801514",
  "authorizationId": "00",
  "approvedStatus": "1",
  "transactionType": "200",
  "stan": "00",
  "txnMti": "00",
  "transaction_time": "102726",
  "batchNumber": "00"
 }

Error

"response":
{
  "a2aCode":"1008",
  "a2aMessage":"No transaction found",
}