inquiryPayment
The inquiryPayment API is called by the POS to query the payment status, typically when the POS does not receive a transaction response from the payment terminal.
Method signature
When calling this method, please use the following standard method signature format.
fun inquiryPayment(
queryPaymentRequest: QueryPaymentRequest,
options: RequestOptions? = null,
callBack: QueryPayResultListener? = null
)Parameters
Parameter name | Type | Required | Description |
queryPaymentRequest | Yes | Indicates the object that contains the parameters for querying the payment result. | |
options | No | Indicates the object that contains optional parameters in the API requests. | |
callback | No | The callback that is used to return the query result. See callback for details. |
callback
Parameter name | Type | Required | Description |
result | No | Indicates the result of querying the payment result. |
Return values
Parameter name | Type | Required | Description |
result | Yes | The result of the API call. | |
paymentRequestId | String | Yes | The unique ID that is defined by the POS provider to identify a payment request.
|
paymentId | String | Yes | The unique ID that is defined by the POS provider to identify a payment and consistent with the paymentId in transaction reports. |
paymentCreateTime | String | Yes | The date and time when the payment is created. The value follows the ISO 8601 standard format. For example, "2019-11-27T12:01:01+08:00". |
paymentTime | String | Yes | The date and time when the payment reaches a final state of success. The value follows the ISO 8601 standard format. For example, "2019-11-27T12:01:01+08:00". |
paymentStatus | String | Yes | Indicates the final status of payment. Valid values are:
|
paymentAmount | Yes | The payment amount that the merchant requests to receive in the order currency. | |
paymentMethod | String | Yes | The payment method that is used to collect the payment by the merchant or acquirer. For the supported payment methods, see Supported payment methods. |
Result codes
resultCode | resultStatus | resultMessage | Further action |
|
| Success. | No action is required. |
|
| A general business failure occurred. Do not retry. | Contact Antom Technical Support to troubleshoot the issue. |
|
| The data format is invalid. | Contact Antom Technical Support to troubleshoot the issue. |
|
| The public key pairing failed. | Contact Antom Technical Support to troubleshoot the issue. |
PARAM_ILLEGAL |
| Parameter names or values do not meet the specified requirements. The result message can vary according to the specific error encountered. | Check whether the request parameters, including the header parameters and body parameters, are correct and valid. |
|
| The payment terminal is not logged in. | Log in to the payment terminal. |
|
| The payment terminal is busy. | Try again later. |
|
| The payment does not exist. | Contact Antom Technical Support to troubleshoot the issue. |
|
| The USB connection failed. |
|
|
| Response timeout. | Check whether the payment terminal app is active. If not, activate it again. |
|
| The API call failed, which is caused by unknown reasons. | Call the inquryPayment API with the paymentRequestId to query the final payment status. |
|
| Failed to decrypt the data returned by the payment terminal. | Contact Antom Technical Support to troubleshoot the issue. |
|
| The message format is invalid. | Contact Antom Technical Support to troubleshoot the issue. |
Samples
The following sample code shows how to call the inquiryPayment API:
PaymentManager.inquiryPayment(
request,
null,
object : QueryPayResultListener {
override fun result(result: QueryPayResultData) {
runOnUiThread {
findViewById<TextView>(R.id.tv_response).text = result.toString()
}
}
}
)The following code shows a sample of the response:
{
"result":{
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "Success."
},
"paymentRequestId": "pay_1089760038715669_1027757450XXXXX",
"paymentId": "202502081140108001001888202003XXXXX",
"paymentCreateTime": "2025-02-08T12:01:01+08:00",
"paymentTime": "2025-02-08T12:01:01+08:00",
"paymentStatus": "Success",
"paymentAmount":{
"currency": "SGD",
"value": "50000"
},
"paymentMethod":"CARD"
}