Integration guide
Electronic Data Capture (EDC) devices are widely used in various retail and service industries, especially in restaurants, supermarkets, and convenience stores. This document outlines how to integrate the Antom SDK with EDC devices. This solution enables quick and secure processing of customer card payments, enhancing transaction efficiency and user experience.
Integration steps
- Obtain the device
- Install the EasyCard App
- Integrate SDK package
- Instantiate the SDK
- Send commands to the device
- Handle callback intent data
Step 1: Obtain the device
To obtain the device, please contact Antom business support for detailed information.
Step 2: Install the EasyCard App
Please contact Antom business support for the installation instructions of the EasyCard App. After acquiring the equipment and completing the configuration, you can follow the following steps to complete the SDK integration.
Step 3: Integrate SDK package
Version requirements:
- Android 4.4 (API level 19) or later.
- Java 1.8 or later.
Please follow the steps below to integrate the SDK package with Maven.
- Add the Maven repository:
Add the Maven repository to your root build.gradle file using the code snippet below.
// Add maven repository
maven {
credentials {
username "antomsdk@aliyun.com"
password "Admin1234"
}
url "https://globaltech.alipay.com/api/v1/file/repository/antom/"
}
- Add dependencies:
Add the dependencies in the build.gradle file using the code snippet below.
// in app build.gradle
// if there are some conflicts with existing sdk, please exclude them
dependencies {
implementation 'com.alipay.antom.sdk:instore-core:${antom_version}'
implementation 'com.alipay.antom.sdk:instore-edc-cmd:1.0.0'
implementation 'com.alipay.antom.sdk:foundation-jsengine:1.0.0'
}
Externalize the dependency version in the build.gradle file to easily manage upgrades with the "Externalize dependency version" code snippet. Replace the value of ANTOM_VERSION
with the latest version 1.20.1.
ext {
antom_version = 'ANTOM_VERSION'
}
Step 4: Instantiate the SDK
It is recommended to call the init API for global initialization at application startup to ensure that the device can respond quickly.
Create an SDK instance using AMSEDCGlobalConfiguration
and specify basic configurations. Creating a configuration object includes the following methods:
Parameter name | Type | Required | Description |
options | Map | ✅ | Reserved for extension parameter information. It includes the following parameters:
|
initCallback | InitCallback | ✅ | Initialization callback function. It includes the following parameters:
|
Call the InitCallback
to receive the onInitResult
callback event. The following example code shows how to handle the onInitResult
callback event:
void onInitResult(String code, String result)
The following example code shows how to instantiate the SDK:
AMSEDCGlobalConfiguration globalConfiguration = new AMSEDCGlobalConfiguration()
globalConfiguration.setOption("provider","KICC");
globalConfiguration.setOption("merchantId","xxxxxxx");
globalConfiguration.setInitCallback(new AMSEDCInitCallback() {
@Override
public void onInitResult(String code, String message) {
if("INIT_SUCCESS".equals(code)){
}
}
});
AMSEDCPayment.init(this.getApplicationContext(), globalConfiguration);
Step 5: Send commands to the device
Call the sendCommand API to send commands and data to the specified EDC device, such as commandName=xxxx
. For specific command implementations, please refer to the device command instructions.
After sending the DeviceCommandRequest
to the device, you will receive a DeviceCommandCallback
response. Sending the DeviceCommandRequest
involves the following parameters:
Parameter name | Type | Required | Description |
provider | String | ✅ | Device provider, designated as KICC. |
commandName | String | ✅ | Specifies the command name. |
requestId | String | ✅ | Request ID. |
commandRequestParams | JSONObject | Command request parameters. | |
options | Map<String,String> | Reserved for extension parameters. |
The following code shows an example of a DeviceCommandCallback
response. It contains the following parameters:
- CommandResult: The command result. It contains the following parameter:
- responseData: The returned result, of type JSONObject.
- onCommandFailed: The device command execution failed.
- onBusinessFailed: The business processing failed.
void onSuccess(CommandResult result);
/**
* Command execution failed
*/
void onCommandFailed(CommandFailInfo commandFailInfo);
/**
* Command executed successfully, but business response error
*/
void onBusinessFailed(CommandResult result);
The following code shows an example of responseData:
{
"paymentRequestId": "123456XXXX",
"paymentId": "99105557_2407241055573",
"paymentAmount": {
"value": "$TOTAL_AMOUNT",
"currency": "KRW"
},
"taxAmount": {
"value": "$TAX",
"currency": "KRW"
},
"tipAmount": {
"value": "$TIP",
"currency": "KRW"
},
"creditPayPlan": {
"installmentNum": "0"
},
"result": {
"resultCode": "SUCCESS",
"resultMessage": "XXX"
},
"acquirerInfo": {
"acquirerResultCode": "$RESULT_CODE",
"acquirerResultMessage": "$RESULT_MSG",
"acquirerTransactionId": "$TRAN_SERIALNO",
"acquirerTerminalId": "$SHOP_TID",
"acquirerRegistrationNo": "$SHOP_BIZ_NUM",
"acquirerMerchantId": "$SHOP_TIDMERCHANT_NUM",
"acquirerName": "KICC",
"acquirerMetaData":"ImNyZWRpdFBheVBsYW4iOiB7CiAgICAiaW5zdGFsbG1lbnROdW0iOiAiMCIKICB9LAogICJyZXN1bHQiOiB7CiAgICAicmVzdWx0Q29kZSI6ICJTVUNDRVNTIiwKICAgICJyZXN1bHRNZXNzYWdlIjogIiIKICB9Cg=="
},
"paymentResultInfo": {
"cardBin": "52364979",
"paymentMethodId": "",
"issuerName": "$CARD_NAME",
"funding": "DEBIT/CREDIT/PREPAID",
"paymentMethodRegion": "KR",
"paymentMethodType": "CARD/CONNECT_WALLET/SAMSUNGPAY"
}
}
The following code shows an example of onBusinessFailed:
{
"requestId": "c9d707ee-639d-4bf2-9a43-cc36c0a3beac",
"result": {
"resultCode": "PROCESS_FAIL",
"resultMessage": "Please check network"
},
"acquirerInfo": {}
}
Timeout
The timeout settings for each command are as follows. Ensure your timeout settings are not lower than the values specified:
Command scenario | Sub-scenario | Overall timeout (seconds) |
Purchase | Default | 95 |
If the amount exceeds 50,000 KRW, a signature is required | 115 | |
PurchaseCancel | Default | 85 |
CashReceipt | Default | 65 |
CashReceiptCancel | Default | 65 |
GetLastTransaction | Default | 5 |
Sample code for calling the sendCommand API
DeviceCommandRequest deviceCommandRequest = new KICCCommandRequest();
deviceCommandRequest.setCommandName("Purchase");
deviceCommandRequest.setCommandRequestParams(new JSONObject("{\n" +
" \"requestId\": \"123456XXXX\",\n" +
" \"paymentAmount\": {\n" +
" \"value\": \"104\",\n" +
" \"currency\": \"KRW\"\n" +
" },\n" +
" \"taxAmount\": {\n" +
" \"value\": \"9\",\n" +
" \"currency\": \"KRW\"\n" +
" },\n" +
" \"tipAmount\": {\n" +
" \"value\": \"0\",\n" +
" \"currency\": \"KRW\"\n" +
" },\n" +
" \"creditPayPlan\": {\n" +
" \"installmentNum\": \"0\"\n" +
" },\n" +
" \"paymentExpiryTime\": \"30\",\n" +
" \"acquirerInfo\": {\n" +
" \"acquirerTerminalId\": \"0788888\",\n" +
" \"acquirerRegistrationNo\": \"0216001234\"\n" +
" }\n" +
"}"));
DeviceCommandCallback callback = new DeviceCommandCallback() {
@Override
public void onSuccess(CommandResult result) {
JSONObject responseData = result.getResponseData();
Log.d(TAG, "onSuccess responseData: " + responseData);
}
@Override
public void onCommandFailed(CommandFailInfo commandFailInfo) {
Log.e(TAG, "error:" + commandFailInfo.errorCode + ":" + commandFailInfo.errorMessage);
}
@Override
public void onBusinessFailed(BusinessFailInfo businessFailInfo) {
Log.e(TAG, "error" + businessFailInfo.getErrorCode() + ":" + businessFailInfo.getErrorMessage());
}
};
mAMSEDCPayment.sendCommand(activity, deviceCommandRequest, callback);
Step 6: Handle callback intent data
Call the handleIntent API to receive the parameters returned from the device through the merchant's Activity.
Note: For KICC devices, if this API is not called, it will result in a timeout error when calling the sendCommand API on a non-responsive end.
The following is an example of processing the returned result in the merchant's Activity class:
//In the merchant's Activity class
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(AMSEDCPayment.handleIntent(requestCode,resultCode,data)){
return;
}
}
Device commands
The following are the commands supported by KICC devices, which are invoked by calling the sendCommand API. For detailed information, please refer to Send commands to the device.
Purchase
Call the purchase API to initiate a payment with the following parameters:
Request parameters
Parameter name | Required | Description | Sample |
requestId | ✅ | Merchant transaction number. | |
paymentAmount.value | ✅ | Total payment amount. | |
paymentAmount.currency | ✅ | Currency of the payment. |
|
tipAmount.value | ✅ | Service fee amount. | |
tipAmount.currency | ✅ | Currency of the service fee. |
|
creditPayPlan.installmentNum | ✅ | The number of installments. | |
paymentExpiryTime | Payment wait timeout, which defaults to 30s. | ||
acquirerInfo.acquirerTerminalId | ✅ | ID of the terminal device (in common scenarios, cards and wallets use different ID). | |
acquirerInfo.acquirerRegistrationNo | ✅ | Merchant business license number. |
The following code shows a sample of the request message:
{
"requestId": "123456XXXX",
"paymentAmount": {
"value": "104",
"currency": "KRW"
},
"tipAmount": {
"value": "0",
"currency": "KRW"
},
"creditPayPlan": {
"installmentNum": "0"
},
"paymentExpiryTime": "30",
"acquirerInfo": {
"acquirerTerminalId": "0788888",
"acquirerRegistrationNo": "0216001234"
}
}
Returned parameters
Parameter name | Required | Description | Sample |
requestId | ✅ | Merchant transaction number. | |
paymentAmount.value | ✅ | Total payment amount. | |
paymentAmount.currency | ✅ | Currency of the payment. |
|
taxAmount.value | ✅ | Value-added tax amount. | |
taxAmount.currency | ✅ | Currency of the value-added tax. |
|
tipAmount.value | ✅ | Service fee amount. | |
tipAmount.currency | ✅ | Currency of the service fee. |
|
creditPayPlan.installmentNum | ✅ | The number of installments. | |
result.resultCode | ✅ | Payment result code. | |
result.resultMessage | ✅ | Payment result message. | |
acquirerInfo.acquirerResultCode | Result code returned from the acquirer. | ||
acquirerInfo.acquirerResultMessage | Message description returned from the acquirer. | ||
acquirerInfo.acquirerTerminalId | ✅ | ID of the terminal device (in common scenarios, cards and wallets use different ID). | |
acquirerInfo.acquirerRegistrationNo | ✅ | Merchant business license number. | |
acquirerInfo.signData | Signature data (Only transmitted in signed transactions.) | ||
acquirerInfo.notice | ✅ | Transaction description. |
|
acquirerInfo.acquirerTransactionId | ✅ | Transaction serial number of the acquirer. | |
acquirerInfo.acquirerMerchantId | ✅ | Merchant's ID in the acquirer. | |
acquirerInfo.acquirerName | ✅ | Acquirer name. |
|
acquirerInfo.acquirerMetaData | ✅ | Original data returned by the acquirer, which must be provided during the refund process. | |
acquirerInfo.acquirerApprovalNum | ✅ | Transaction approval number of KICC. | |
paymentResultInfo.cardBin | Payment card BIN (first eight digits of the card). The card BIN information is required during card payment. | ||
paymentResultInfo.paymentMethodId | Identification number. Bar code is required in the wallet payment scenario. | ||
paymentResultInfo.issuerCode | ✅ | Issuer code. See the attachment 📎전체 카드사 신용카드_발급사 매입사 정보(2023.07.25 기준) .xlsx for a full list. | |
paymentResultInfo.funding | ✅ | The card funding types include: Debit, Credit, and Prepaid.
| |
paymentResultInfo.paymentMethodRegion | ✅ | The region code that represents the country or region of the payment method. The value of this parameter is a 2-letter ISO country code or | |
paymentResultInfo.paymentMethodType | ✅ | Payment method. | |
extendInfo.AD1 | Additional note 1 from the acquirer. | ||
extendInfo.AD2 | Additional note 2 from the acquirer. |
The following code shows a sample of the response message:
{
"requestId": "123456XXXX",
"paymentAmount": {
"value": "$TOTAL_AMOUNT",
"currency": "KRW"
},
"taxAmount": {
"value": "$TAX",
"currency": "KRW"
},
"tipAmount": {
"value": "$TIP",
"currency": "KRW"
},
"creditPayPlan": {
"installmentNum": "0"
},
"result": {
"resultCode": "SUCCESS",
"resultMessage": "XXX"
},
"acquirerInfo": {
"acquirerResultCode": "$RESULT_CODE",
"acquirerResultMessage": "$RESULT_MSG",
"acquirerTransactionId": "$TRAN_SERIALNO",
"acquirerTerminalId": "$SHOP_TID",
"acquirerRegistrationNo": "$SHOP_BIZ_NUM",
"acquirerMerchantId": "$SHOP_TIDMERCHANT_NUM",
"acquirerName": "KICC",
"notice": " 매입사제출테스트 거래임",
"acquirerMetaData":"ImNyZWRpdFBheVBsYW4iOiB7CiAgICAiaW5zdGFsbG1lbnROdW0iOiAiMCIKICB9LAogICJyZXN1bHQiOiB7CiAgICAicmVzdWx0Q29kZSI6ICJTVUNDRVNTIiwKICAgICJyZXN1bHRNZXNzYWdlIjogIiIKICB9Cg=="
},
"paymentResultInfo": {
"cardBin": "52364979",
"paymentMethodId": "",
"issuerCode": "$CARD_NAME",
"funding": "DEBIT/CREDIT/PREPAID",
"paymentMethodRegion": "KR",
"paymentMethodType": "CARD/CONNECT_WALLET/SAMSUNGPAY"
}
}
PurchaseCancel
Call the purchaseCancel API to cancel a payment with the following parameters:
Request parameters
Parameter name | Required | Description | Sample |
requestId | ✅ | Cancel ID on the merchant side. The requestId is unique for each request. | |
paymentAmount.value | ✅ | Total payment amount. | |
paymentAmount.currency | ✅ | Currency of the payment. |
|
tipAmount.value | ✅ | Service fee amount. | |
tipAmount.currency | ✅ | Currency of the service fee. |
|
acquirerInfo.acquirerMetaData | ✅ | Original data returned by the acquirer. Pass the value of acquirerInfo.acquirerMetaData returned in the purchase API to this parameter. | |
acquirerInfo.acquirerTerminalId | ID of the terminal device (in common scenarios, cards and wallets use different ID). | ||
acquirerInfo.acquirerRegistrationNo | Merchant business license number. |
The following code shows a sample of the request message:
{
"requestId":"123456XXXX",
"paymentAmount": {
"value": "104",
"currency": "KRW"
},
"tipAmount": {
"value": "0",
"currency": "KRW"
},
"creditPayPlan": {
"installmentNum":"0"
},
"paymentExpiryTime":"30",
"acquirerInfo": {
"acquirerTerminalId": "$SHOP_TID",
"acquirerRegistrationNo": "$SHOP_BIZ_NUM",
"acquirerMetaData":"ImNyZWRpdFBheVBsYW4iOiB7CiAgICAiaW5zdGFsbG1lbnROdW0iOiAiMCIKICB9LAogICJyZXN1bHQiOiB7CiAgICAicmVzdWx0Q29kZSI6ICJTVUNDRVNTIiwKICAgICJyZXN1bHRNZXNzYWdlIjogIiIKICB9Cg=="
}
}
Returned parameters
Parameter name | Required | Description | Sample |
requestId | ✅ | Cancel ID on the merchant side. The requestId is unique for each request. | |
result.resultCode | ✅ | Cancel result. | |
result.resultMessage | ✅ | Cancel result message. | |
paymentAmount.value | ✅ | Total payment amount. | |
paymentAmount.currency | ✅ | Currency of the payment. |
|
taxAmount.value | ✅ | Value-added tax amount. | |
taxAmount.currency | ✅ | Currency of the value-added tax. |
|
tipAmount.value | ✅ | Service fee amount. | |
tipAmount.currency | ✅ | Currency of the service fee. |
|
acquirerInfo.notice | ✅ | Transaction description. |
|
acquirerInfo.acquirerResultCode | ✅ | Result code returned from the acquirer. | |
acquirerInfo.acquirerResultMessage | Message description returned from the acquirer. | ||
acquirerInfo.acquirerTerminalId | ID of the terminal device (in common scenarios, cards and wallets use different ID). | ||
acquirerInfo.acquirerRegistrationNo | Merchant business license number. | ||
acquirerInfo.acquirerApprovalNum | ✅ | Transaction approval number of KICC. | |
acquirerInfo.acquirerTransactionId | ✅ | Transaction serial number of the acquirer. | |
acquirerInfo.acquirerMetaData | ✅ | Original data returned by the acquirer. | |
acquirerInfo.acquirerName | ✅ | Acquirer name. |
|
extendInfo.AD1 | Additional note 1 from the acquirer. | ||
extendInfo.AD2 | Additional note 2 from the acquirer. |
The following code shows a sample of the response message:
{
"requestId":"123456XXXX",
"paymentAmount": {
"value": "104",
"currency": "KRW"
},
"taxAmount": {
"value": "9",
"currency": "KRW"
},
"tipAmount": {
"value": "0",
"currency": "KRW"
},
"creditPayPlan": {
"installmentNum":"0"
},
"result":{
"resultCode":"SUCCESS",
"resultMessage":""
},
"acquirerInfo": {
"acquirerTerminalId": "$SHOP_TID",
"acquirerRegistrationNo": "$SHOP_BIZ_NUM",
"acquirerResultCode": "$RESULT_CODE",
"acquirerResultMessage": "$RESULT_MSG",
"acquirerTransactionId": "$TRAN_SERIALNO",
"acquirerMetaData":"ImNyZWRpdFBheVBsYW4iOiB7CiAgICAiaW5zdGFsbG1lbnROdW0iOiAiMCIKICB9LAogICJyZXN1bHQiOiB7CiAgICAicmVzdWx0Q29kZSI6ICJTVUNDRVNTIiwKICAgICJyZXN1bHRNZXNzYWdlIjogIiIKICB9Cg=="
}
}
CashReceipt
Call the cashReceipt API to perform cash tax reporting with the following parameters:
Request parameters
Parameter name | Required | Description | Sample |
requestId | ✅ | Tax reporting ID on the merchant side.The requestId is unique for each request. | |
paymentAmount.value | ✅ | Total payment amount. | |
paymentAmount.currency | ✅ | Currency of the payment. |
|
tipAmount.value | ✅ | Service fee amount. | |
tipAmount.currency | ✅ | Currency of the service fee. |
|
buyerType | ✅ | Type of the transaction entity for cash receipt. Valid values are:
| |
reportType | ✅ | Tax reporting method. Valid values are:
| |
acquirerInfo.acquirerTerminalId | ID of the terminal device (in common scenarios, cards and wallets use different ID). | ||
acquirerInfo.acquirerRegistrationNo | Merchant business license number. |
The following code shows a sample of the request message:
{
"requestId":"123456XXXX",
"paymentAmount": {
"value": "104",
"currency": "KRW"
},
"tipAmount": {
"value": "0",
"currency": "KRW"
},
"buyerType": "Individual/Business",
"reportType": "auto/manual",
"acquirerInfo": {
"acquirerTerminalId": "0788888",
"acquirerRegistrationNo": "0216001234"
}
}
Returned parameters
Parameter name | Required | Description | Sample |
requestId | ✅ | Tax reporting ID on the merchant side. The requestId is unique for each request. | |
paymentAmount.value | ✅ | Total payment amount. | |
paymentAmount.currency | ✅ | Currency of the payment. |
|
taxAmount.value | ✅ | Value-added tax amount. | |
taxAmount.currency | ✅ | Currency of the value-added tax. |
|
tipAmount.value | ✅ | Service fee amount. | |
tipAmount.currency | ✅ | Currency of the service fee. |
|
acquirerInfo.notice | ✅ | Transaction description. |
|
result.resultCode | ✅ | Processing result. | |
result.resultMessage | ✅ | Processing result message. | |
cashIdentificationNo | ✅ | Cash receipt identification number, which is usually a phone number. |
|
institutionCode | ✅ | Tax bureau code. | |
acquirerInfo.acquirerResultCode | ✅ | Result code returned from the acquirer. | |
acquirerInfo.acquirerResultMessage | Message description returned from the acquirer. | ||
acquirerInfo.acquirerTransactionId | ✅ | Transaction serial number of the acquirer. | |
acquirerInfo.acquirerMetaData | ✅ | Original data returned by the acquirer, which must be provided when cancelling the cash tax reporting. | |
acquirerInfo.acquirerTerminalId | ID of the terminal device (in common scenarios, cards and wallets use different ID). | ||
acquirerInfo.acquirerRegistrationNo | Merchant business license number. | ||
acquirerInfo.acquirerApprovalNum | ✅ | Transaction approval number of KICC. | |
acquirerInfo.acquirerName | ✅ | Acquirer name. |
|
The following code shows a sample of the response message:
{
"requestId": "123456XXXX",
"paymentAmount": {
"value": "104",
"currency": "KRW"
},
"taxAmount": {
"value": "9",
"currency": "KRW"
},
"tipAmount": {
"value": "0",
"currency": "KRW"
},
"result": {
"resultCode": "SUCCESS",
"resultMessage": ""
},
"cashIdentificationNo": "$CARD_NO",
"institutionCode":"$ISSUER_CODE",
"acquirerInfo": {
"acquirerTerminalId": "$SHOP_TID",
"acquirerRegistrationNo": "$SHOP_BIZ_NUM",
"acquirerResultCode": "$RESULT_CODE",
"acquirerResultMessage": "$RESULT_MSG",
"acquirerTransactionId": "$TRAN_SERIALNO",
"acquirerMetaData":"ImNyZWRpdFBheVBsYW4iOiB7CiAgICAiaW5zdGFsbG1lbnROdW0iOiAiMCIKICB9LAogICJyZXN1bHQiOiB7CiAgICAicmVzdWx0Q29kZSI6ICJTVUNDRVNTIiwKICAgICJyZXN1bHRNZXNzYWdlIjogIiIKICB9Cg=="
}
}
CashReceiptCancel
Call the cashReceiptCancel API to cancel cash tax reporting with the following parameters:
Request parameters
Parameter name | Required | Description | Sample |
requestId | ✅ | ID of the merchant side to cancel the tax reporting. The requestId is unique for each request. | |
paymentAmount.value | ✅ | Total payment amount. | |
paymentAmount.currency | ✅ | Currency of the payment. |
|
tipAmount.value | ✅ | Service fee amount. | |
tipAmount.currency | ✅ | Currency of the service fee. |
|
buyerType | ✅ | Type of the transaction entity for cash receipt. Valid values are:
| |
reportType | ✅ | Tax reporting method. Valid values are:
| |
acquirerInfo.acquirerMetaData | ✅ | Original data returned by the acquirer. Pass the value of acquirerInfo.acquirerMetaData returned in the CashReceipt API to this parameter. | |
acquirerInfo.acquirerTerminalId | ID of the terminal device (in common scenarios, cards and wallets use different ID). | ||
acquirerInfo.acquirerRegistrationNo | Merchant business license number. |
The following code shows a sample of the request message:
{
"requestId":"123456XXXX",
"paymentAmount": {
"value": "104",
"currency": "KRW"
},
"tipAmount": {
"value": "0",
"currency": "KRW"
},
"reportType": "auto/manual",
"paymentExpiryTime":"30",
"acquirerInfo": {
"acquirerTerminalId": "$SHOP_TID",
"acquirerRegistrationNo": "$SHOP_BIZ_NUM",
"acquirerMetaData":"ImNyZWRpdFBheVBsYW4iOiB7CiAgICAiaW5zdGFsbG1lbnROdW0iOiAiMCIKICB9LAogICJyZXN1bHQiOiB7CiAgICAicmVzdWx0Q29kZSI6ICJTVUNDRVNTIiwKICAgICJyZXN1bHRNZXNzYWdlIjogIiIKICB9Cg=="
}
}
Returned parameters
Parameter name | Required | Description | Sample |
requestId | ✅ | ID of the merchant side to cancel the tax reporting. The requestId is unique for each request. | |
paymentAmount.value | ✅ | Total payment amount. | |
paymentAmount.currency | ✅ | Currency of the payment. |
|
taxAmount.value | ✅ | Value-added tax amount. | |
taxAmount.currency | ✅ | Currency of the value-added tax. |
|
tipAmount.value | ✅ | Service fee amount. | |
tipAmount.currency | ✅ | Currency of the service fee. |
|
acquirerInfo.notice | ✅ | Transaction description. |
|
result.resultCode | ✅ | Processing result. | |
result.resultMessage | ✅ | Processing result message. | |
cashIdentificationNo | ✅ | Cash receipt identification number, which is usually a phone number. |
|
institutionCode | ✅ | Tax bureau code. | |
acquirerInfo.acquirerMetaData | ✅ | Original data returned by the acquirer. | |
acquirerInfo.acquirerTransactionId | ✅ | Transaction serial number of the acquirer. | |
acquirerInfo.acquirerResultCode | ✅ | Result code returned from the acquirer. | |
acquirerInfo.acquirerResultMessage | Message description returned from the acquirer. | ||
acquirerInfo.acquirerTerminalId | ID of the terminal device (in common scenarios, cards and wallets use different ID). | ||
acquirerInfo.acquirerRegistrationNo | Merchant business license number. | ||
acquirerInfo.acquirerApprovalNum | ✅ | Transaction approval number of KICC. | |
acquirerInfo.acquirerName | ✅ | Acquirer name. |
|
The following code shows a sample of the response message:
{
"requestId": "123456XXXX",
"paymentAmount": {
"value": "104",
"currency": "KRW"
},
"taxAmount": {
"value": "9",
"currency": "KRW"
},
"tipAmount": {
"value": "0",
"currency": "KRW"
},
"result": {
"resultCode": "SUCCESS",
"resultMessage": ""
},
"institutionCode":"$ISSUER_CODE",
"cashIdentificationNo": "$CARD_NO",
"acquirerInfo": {
"acquirerTerminalId": "$SHOP_TID",
"acquirerRegistrationNo": "$SHOP_BIZ_NUM",
"acquirerResultCode": "$RESULT_CODE",
"acquirerResultMessage": "$RESULT_MSG",
"acquirerTransactionId": "$TRAN_SERIALNO",
"acquirerMetaData":"ImNyZWRpdFBheVBsYW4iOiB7CiAgICAiaW5zdGFsbG1lbnROdW0iOiAiMCIKICB9LAogICJyZXN1bHQiOiB7CiAgICAicmVzdWx0Q29kZSI6ICJTVUNDRVNTIiwKICAgICJyZXN1bHRNZXNzYWdlIjogIiIKICB9Cg=="
}
}
GetLastTransaction
Use the getLastTransaction API to query the most recent transaction. The format of the returned parameters is variable and depends on the responseCommand
field type. The types include:
- Purchase
- PurchaseCancel
- CashReceipt
- CashReceiptCancel
The following sample code shows of a response format for Purchase:
{
"responseCommand":"Purchase"
"paymentAmount": {
"value": "104",
"currency": "KRW"
},
"taxAmount": {
"value": "9",
"currency": "KRW"
},
"tipAmount": {
"value": "0",
"currency": "KRW"
},
"creditPayPlan": {
"installmentNum": "0"
},
"result": {
"resultCode": "SUCCESS",
"resultMessage": ""
},
"acquirerInfo": {
"acquirerTerminalId": "$SHOP_TID",
"acquirerRegistrationNo": "$SHOP_BIZ_NUM",
"acquirerResultCode": "$RESULT_CODE",
"acquirerResultMessage": "$RESULT_MSG",
"acquirerTransactionId": "$TRAN_SERIALNO",
"acquirerMetaData":"ImNyZWRpdFBheVBsYW4iOiB7CiAgICAiaW5zdGFsbG1lbnROdW0iOiAiMCIKICB9LAogICJyZXN1bHQiOiB7CiAgICAicmVzdWx0Q29kZSI6ICJTVUNDRVNTIiwKICAgICJyZXN1bHRNZXNzYWdlIjogIiIKICB9Cg=="
}
}
Event codes
You may encounter the following types of event codes:
- Initialization type: Returned by
onInitResult
during the global initialization phase. - Command execution type: Returned by
onCommandFailed
when the device command execution fails. - Business processing type: Returned by
onBusinessFailed
when the business processing fails.
Type | Code | Description | Further action |
Initialization type | INIT_SUCCESS | Initialization succeeded. | No further action required. |
INIT_FAILED | Initialization failed. | Please try again. | |
INIT_PARAM_ERROR | Initialization parameter error. | Please refer to the integration guide provided above. | |
Command execution type | CommandInvalidResponse | Returned result of the command is incorrect. | Please try again. |
CommandResponseTimeout | The command was executed, but no response was returned. See Timeout for more information. | Please try again. | |
CommandNotSupport | The command is not supported. | Please refer to the integration guide provided above. | |
CommandDeviceBusy | The device is executing the command. | Wait for the previous command to response and try again. | |
CommandParamError | Abnormal parameter. | Please refer to the integration guide provided above. | |
Business processing type | REPEAT_REQ_REJECT | There is an existing order with the same requestId. | Please retry with a new requestId. |
INVALID_CONTRACT | Contract is invalid. | Please check the input merchantId information. | |
ACCESS_DENIED | Access is denied. | Contact KICC for detailed reasons and support. | |
PROCESS_FAIL | A general business failure occurred. | Do not retry. Human intervention is usually needed. It is recommended that you contact Antom Technical Support to troubleshoot the issue. | |
PARAM_ILLEGAL | The required parameters are not passed, or illegal parameters exist. For example, a non-numeric input, or the length and type of the parameter are wrong. | Check and verify whether the required request fields (including the header fields and body fields) of the current API are correctly passed and valid. | |
ORDER_STATUS_INVALID | The order status is invalid. | Check the order status. | |
ORDER_IS_CANCELED | The transaction is canceled. | You cannot refund the transaction because it is canceled. | |
USER_AMOUNT_EXCEED_LIMIT | The payment amount exceeds the user payment limit. | Create a new payment by using an amount less than or equal to the account's available balance, or contact Antom Technical Support. | |
USER_BALANCE_NOT_ENOUGH | The payment cannot be completed because the user balance in the corresponding acquirer is not enough. | Please top up the account or choose other acquirers. | |
INVALID_CARD_NUMBER | The number of the card used for the transaction is invalid. | Check and verify whether the required request fields of the current API are correctly passed and valid. | |
IDENTITY_VERIFY_FAILED | Identity verification timed out or the result couldn't be retrieved. | Please confirm your identification details and try again. | |
UNKNOWN | Unknown scenarios. | Contact KICC for detailed reasons and support. |