Transaction Search

What is a Transaction Search?

The purpose of the Transaction search functionality is to retrieve details of previous transactions.


How Does a Transaction Search Work?

  • If a transaction UUID IS provided in the request message, the system will return the transaction details corresponding to that specific UUID.
  • If a transaction UUID IS NOT provided in the request message, the details of the most recent transaction performed on the terminal will be returned.

Request

Sample Bundle

The following is an example of a TX_SEARCH request bundle that the MPOS Application will request.

"authenticationKey": "e27b5ce6-8ba6-4746-9453-536728f7cbeb"
"merchantID": "770000000000123"
"launchType": "TX_SEARCH"

Parameters

The following table describes the parameters of the TX_SEARCH request message.

PARAMETERTYPEDESCRIPTIONEXAMPLE
REQUIRED
launchTypeSTRINGMust be “TX_SEARCH”
Used for launching the Ecentric Payment App to perform a transaction search query.
TX_SEARCH
merchantIDSTRINGThe merchant ID assigned to the merchant.945230000000001
authenticationKeySTRINGThe authentication token that was generated by the server on a successful login to the Ecentric Payment Appe27b5456-8bff6-4746-94bg-367253356eb
OPTIONAL
transactionUuid STRINGUnique ID (UUID) of transaction if searching for a specific transaction..79f451e7-edc9-4f9e-8625-18618f597a8f

Sample Code

The following code needs to be implemented by the MPOS Application in order to invoke the Ecentric Payment App to initiate a TX_SEARCH request message.

*See Sample Code TX_SEARCH Response for the intentLauncher function

private void doTxSearch() {
    Intent intent = new Intent();
    intent.setClassName("com.ecentric.ecentricpay", "com.ecentric.ecentricpay.MainActivity");
    Bundle dataBundle = new Bundle();
    dataBundle.putString("launchType", "TX_SEARCH");
    dataBundle.putString("merchantID", "910100000000001");
  	dataBundle.putString("authenticationKey", "received_authenticationKey");
  	dataBundle.putString("transactionUuid", "78a501e7-edc9-4f9e-8625-18618f597a8f"); // Returns last transaction or specific transaction if UUID is specified

    intent.putExtra("ecentricBundle", dataBundle);
    try {
        intentLauncher.launch(intent);
    } catch (Exception e) {
        Log.e(TAG, "Error launching intent: " + e);
   }
}

Response

Sample Bundle

The following is an example of a TX_SEARCH response bundle that the MPOS Application will receive.

"resultDescription": "APPROVED",
"buildInfo": "Ecentric",
"isReceiptDataAvailable": true,
"resultCode": "01",
"receiptBundle": {
    "MERCHANT_REGION_CODE": "09",
    "RC_ALT": "00",
    "SEQ_NO": "000",
    "STATUS": "APPROVED",
    "BUDGET_PERIOD": "",
    "CARD_TYPE": "Debit",
    "PAN_WITH_BIN": "445143** **** 2309",
    "MERCHANT_ID": "770000000000123",
    "TIMESTAMP": "1746605893000",
    "EXTERNAL_TRANSACTION_DATETIME": "",
    "PROCESSING_CODE": "",
    "RC_DESCRIPTION": "Approved",
    "EXTERNAL_INVOICE_GUID": "",
    "REPLACEMENT_MERCHANT_ID": "",
    "BATCH_NO": "000",
    "AUTH_PROFILE": "",
    "INTERCHANGE": "Debit",
    "ESC_BY_AUTH_CODE": "226 00 IH 172484",
    "TX_TYPE": "DEBIT",
    "ACC_TYPE_DESC": "",
    "TIP_AMOUNT": "",
    "CURRENCY_CODE": "ZAR",
    "AUTH_CODE": "172484",
    "RC": "00",
    "AID": "A0000000031010",
    "ATC": "",
    "CRY": "4FFE220CCEA29052",
    "CVM": "none",
    "IAD": "06010A03A04000",
    "PAN": "**** **** **** 2309",
    "RRN": "512718120039",
    "TSI": "",
    "TVR": "0000000000",
    "APSN": "",
    "DATE": "2025-05-07T08:18:13.000+0000",
    "STAN": "",
    "NAME_ON_CARD": "",
    "AMOUNT_CENTS": "1000",
    "ABS_AMOUNT": "10.00",
    "TOKEN": "",
    "RECEIPT_NUMBER": "",
    "EXTENDED_TRX_TYPE": "",
    "TERMINAL_ID": "77012398",
    "TX_TYPE_DESCRIPTION": "SALE",
    "EXTERNAL_TERMINAL_ID": "",
    "FORMATTED_AMOUNT": "ZAR 10.00",
    "DESCRIPTION": "",
    "BATCH_NUMBER": "0",
    "SETTLEMENT_DATE": "",
    "SURCHARGE_AMOUNT": "0.00",
    "EXTERNAL_TRANSACTION_GUID": "",
    "CARD_BIN": "445143",
    "TRANSACTION_INFO": "22600IH172484",
    "REPLACEMENT_TERMINAL_ID": "",
    "POS_ENTRY": "",
    "RC_ISO_DESCRIPTION": "Approved or completed successfully",
    "APPLICATION_LABEL": "VISA SAVINGS",
    "MERCHANT_CITY": "Cape Town",
    "MERCHANT_NAME": "Istore",
    "CUSTOMER_NAME": "",
    "APP_VERSION": "1.1.214",
    "CARD_SEQ_NO": "",
    "APP_LABEL": "VISA SAVINGS",
    "INVOICE_NUM": "",
    "MESSAGE_1": "",
    "MESSAGE_2": "",
    "CARD_TRANSACTION_TYPE": "CONTACTLESS",
    "FORMATTED_CASH_AMOUNT": "ZAR 0.00",
    "CASH_AMOUNT": "0.00",
    "RESULT_CODE": "00",
    "MERCHANT_COUNTRY_CODE": "ZA",
    "REPRINT": "",
    "PAN_HASH": "",
    "AMOUNT": "10.00",
    "TIP_LABEL": "",
    "DIGITS": "2309",
    "CVM_ABSA": ""
  },
"merchantID": "770000000000123",
"launchType": "TX_SEARCH",
"cashAmount": "0",
"transactionUuid": "08ea6867-3d85-4cab-9d0b-c5822230773d",
"appVersion": "1.9.2",
"transactionAmount": "1000"

Parameters

The following table describes the parameters of the TX_SEARCH response message.

PARAMETERTYPEDESCRIPTIONEXAMPLE
launchTypeSTRINGEcho of the launchType used to launch the Ecentric Payment App.TX_SEARCH
resultCodeSTRINGRepresents the result status of the TX Search intent call:
● 01: SUCCESSFUL
● 02: DECLINED
● 04: ERROR
01
isReceiptDataAvailableBOOLBoolean indicating whether a receiptBundle object is available. Will always be included for approved or declined transactions.true
receiptBundleSTRINGConsists of a sub-bundle of server parameters that can be used by the partner application to create a receipt.See Sample ecentricBundle SALE Response.
merchantIDSTRINGEcho of the merchantID used in the request.910100000000001
resultDescriptionSTRINGA user readable representation of the above resultCode i.e. Approved for resultCode 01.COMPLETED
transactionAmountLONGApproved total transactionAmount.1000
cashAmountLONGApproved cashAmount.500
transactionUuidSTRINGUnique ID of transactionbdf9d0af-17b3-48ca-8a0b-37dc52bf49bc
appVersionSTRINGThe software version currently running on the Ecentric Payment App.2.0.0

Sample Code

The following code needs to be implemented by the MPOS Application to recover the TX_SEARCH transaction outcome and resume the MPOS App flow accordingly.

private final ActivityResultLauncher<Intent> intentLauncher = registerForActivityResult(
       new ActivityResultContracts.StartActivityForResult(),
       result -> {
           if (result.getResultCode() == Activity.RESULT_OK) {
               Intent data = result.getData();
               if (data != null) {
                   Bundle responseBundle = new Bundle(data.getBundleExtra("ecentricApplicationResponse"));
                   String launchType = responseBundle.getString("launchType");
                   String resultCode = responseBundle.getString("resultCode");
                   Boolean success = false;
                   if (resultCode != null && (resultCode.matches("00") || resultCode.matches("01"))) {
                       success = true;
                   }

                   if (success && launchType.matches("RETAIL_AUTH")) {
                       authenticationKey = responseBundle.getString("authenticationKey");
                   }

                   if (responseBundle.get("errorBundle") != null) {
                       Bundle errorBundle = new Bundle(responseBundle.getBundle("errorBundle"));
                   }
               }
           } else {
               Log.e(TAG, "Received error resultCode: " + result.getResultCode());
           }
       }
);

Error Handling

The following table contains typical errors that might occur and how to handle these errors:

ERROR MESSAGESOLUTION
Incorrect merchantIDEnsure that you have entered the correct merchantID.
authenticationKey is invalidWhen your authenticationKey is invalid, you will receive an error message indicating that the authenticationKey is invalid, a RETAIL_AUTH request needs to be done to obtain a valid authenticationKey.

Sample Bundle

The following is an example of a TX_SEARCH ERROR response bundle that the MPOS Application will receive.

"resultDescription": "ABORTED",
"errorBundle": {
    "description": "ERROR",
    "reference": "",
    "errorType": "OTHER",
    "message": "Transaction cancelled by user"
  },
"buildInfo": "Ecentric_DEBUG_Ecentric_INT",
"resultCode": "03",
"merchantID": "910100000000001",
"serialNumber": "PC05P2CG10036",
"launchType": "CARDQUERY",
"appVersion": "1.9.8"