Skip to main content

ECR Interface Protocol

1. Encrypt the data of the protocol

1.1 Get 6 letters

When the Wonder terminal enters the pairing page, a 6-digit random uppercase string or the QR code generated by it will be displayed. The client device can obtain this string by scanning a code or manually entering it

Example:
const letters = '260880';

1.2 Generate the AES key

  const letters = "260880";

// AES-256 key
const key = crypto.createHash("sha256").update(letters).digest();
console.log("AES Key:", key.toString("hex"));

// AES Key: d866085b751bf6a9844da9a540d5ac8fba82b5aff408b8aefc6a76e6f61d5bdf

1.3 Encrypt the data of the protocol with AES256


const crypto = require("crypto");

/**
* 安全的密钥派生函数
*/
const deriveKeySecure = (pinCode, salt) => {
return crypto.pbkdf2Sync(pinCode, salt, 100000, 32, 'sha256');
};

const pkcs7Pad = (data, blockSize) => {
const padding = blockSize - (data.length % blockSize);
const padded = Buffer.alloc(data.length + padding);
data.copy(padded);
padded.fill(padding, data.length);
return padded;
};

const pkcs7Unpad = (padded) => {
const padding = padded[padded.length - 1];
if (padding < 1 || padding > padded.length) {
throw new Error('Invalid padding');
}
// 验证所有填充字节都正确
for (let i = padded.length - padding; i < padded.length; i++) {
if (padded[i] !== padding) {
throw new Error('Invalid padding');
}
}
return padded.slice(0, padded.length - padding);
};

const encrypt = (pinCode, data) => {
// 生成随机盐和IV
const salt = crypto.randomBytes(16);
const iv = crypto.randomBytes(16);

// 使用PBKDF2派生密钥
const key = deriveKeySecure(pinCode, salt);

// PKCS7填充
const paddedData = pkcs7Pad(Buffer.from(data, 'utf8'), 16);

// AES-256-CBC加密
const cipher = crypto.createCipheriv('aes-256-cbc', key, iv);
cipher.setAutoPadding(false); // 禁用自动填充
const ciphertext = Buffer.concat([cipher.update(paddedData), cipher.final()]);

// 拼接盐、IV和密文
const result = Buffer.concat([salt, iv, ciphertext]);
return result.toString('base64');
};

const decrypt = (pinCode, encryptedBase64) => {
// Base64解码
const encryptedData = Buffer.from(encryptedBase64, 'base64');

// 验证数据长度(至少包含盐+IV)
// 16盐 + 16IV
if (encryptedData.length < 32) {
throw new Error('Encrypted data too short');
}

// 提取盐、IV和密文
const salt = encryptedData.slice(0, 16);
const iv = encryptedData.slice(16, 32);
const ciphertext = encryptedData.slice(32);

// 使用PBKDF2派生密钥
const key = deriveKeySecure(pinCode, salt);

// 验证密文长度
if (ciphertext.length % 16 !== 0) {
throw new Error('Invalid ciphertext length');
}

// AES-256-CBC解密
const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv);
decipher.setAutoPadding(false); // 禁用自动填充
const decrypted = Buffer.concat([
decipher.update(ciphertext),
decipher.final(),
]);

// 去除填充
const unpadded = pkcs7Unpad(decrypted);
return unpadded.toString('utf8');
};

// 测试Key1
const key1 = '260880';

// JSON 数据
const data1 = JSON.stringify({
header: {
requestID: 'ff467f02-5b69-45f3-81aa-bffcca55fe80',
clientDeviceSN: '126498561093',
timestamp: '2025-11-12T10:11:04+00:00',
},
body: {
pairUuid: '8daf4dc0-6ad6-44b1-8556-a0f1549c0fc9',
},
});

console.log('key1:', key1);
const encryptedData1 = encrypt(key1, data1);
console.log('Encrypted Data 1:', encryptedData1);

const decryptedData1 = decrypt(key1, encryptedData1);
console.log('Decrypted Data 1:', decryptedData1);

function generateRandomStringSimple(length) {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = '';

// 生成安全的随机字节
const randomBytes = crypto.randomBytes(length);

for (let i = 0; i < length; i++) {
// 使用模62确保均匀分布到62个字符
const index = randomBytes[i] % 62;
result += chars[index];
}

return result;
}

// 测试Key2
// const key2 = generateRandomStringSimple(32);
const key2 = 'OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN';
console.log('key2:', key2);
const encryptedData2 = encrypt(key2, data1);
console.log('Encrypted Data 2:', encryptedData2);

const decryptedData2 = decrypt(key2, encryptedData2);
console.log('Decrypted Data 2:', decryptedData2);


2. Request and Response Protocol Data Format

2.1 Request data structure

Request JSON
VariableTypeRequiredDescription
versionStringYCurrent communication protocol version number
actionenumYActions: Pair, DeviceInfo, Sale, ...
dataStringYEncrypted data
Request "data" structure
VariableTypeRequiredDescription
headerObjectYProtocol header
bodyObjectNProtocol body
Request "data.header" structure
VariableTypeRequiredDescription
requestIDUUIDYRequest ID: Every time communication takes place, it is crucial to ensure that the Request ID is a unique UUID. In the event of a response, the corresponding identifier will be returned in the response header as the "responseID".
clientDeviceSNStringYClient device serial number
timestampdatetimeYThe timestamp of the current request
Example:

/*
Encrypt the original data:
{
"header": {
"requestID": "9c07d8d7-2a43-4a29-9c6d-6b8d8f7d44e5",
"clientDeviceSN": "126498561093",
"timestamp": "2025-11-12T10:11:04+00:00"
},
"body": {
"pairUuid": "3f37e6c0-bf6e-4c00-b1fa-b2bd5e1d6a3b"
}
}
*/

{
"version": "2.0",
"action": "Pair",
"data": "WJq3v/ZX/aMMR45WFqfs9BZ2J93EtSTYQh4JOD17ldQkzXi6ohsjxCdl4mpvAOqhFyWPVuEadUubmRzfACUAQpqledyJhOdtQTMlr4KnZXBJw6g3TOFTeKe1I/DqMiEEG0X9BEelUNS+0+FpaoWN1mVkuKEpt8XMGrHyA+M4XbaMwjQ3fMeoR77FULPvM9MCkw6B3QTGONMml51X8pqXsBYTrcpS5SLFVvdL5e+1CcIuVvliyrV3MDd+cwlSjHNIoaLwDEgu9wDNjGTYe1L8Ww=="
}

2.2 Response data structure

Request JSON
VariableTypeRequiredDescription
versionStringYCurrent communication protocol version number
actionenumYActions: DeviceInfo, Sale, PreAuth, Abort, Void, Refund
dataStringYEncrypted data
Response "data" structure
VariableTypeRequiredDescription
headerObjectYProtocol header
bodyObjectNProtocol body
Response "data.header" structure
VariableTypeRequiredDescription
responseIDStringYThe response ID in the response Header is derived from the request ID in the request header.
serverDeviceSNStringYThe serial number of the terminal payment device
timestampdatetimeNThe timestamp of the current request
Example:

/*
Encrypt the original data:
{
"header": {
"responseID": "9c07d8d7-2a43-4a29-9c6d-6b8d8f7d44e5",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"pairUuid": "3f37e6c0-bf6e-4c00-b1fa-b2bd5e1d6a3b",
"ackUuid": "4d366618-49cf-4f93-bd23-25388a573b0c"
}
}
*/

{
"version": 2.0,
"action": "Pair",
"data": "G6RaFsGPTiVzAYsUTu/gY1Igjv+4THb1tZ7vwXWP9f1CYRRrNKKuz4Op7ai9xCqKCdBymnO/YAQTB9egq10DIp/mxQ4pG1dGyL+Erkd91G4xYJd9S7iXNqnCwEn2wOhMIn3sP0H6vgTzoGX9ZOi59pLhuGqYTbHBPvDIkavEIweWWVQjEUdQn7HG0ymqxq4O36giOlh5NldSPwH5LjbnOamEm+Y41jIW/dRexnd7hhKkF/TrZg2lDYKOry9NflNzoMPHiB2/7YgVVmgVfBysW9dqqNRiJXxYLOD6UGoJlQqsICeiidKm6SYL4dkKHYniFEnZ0a5KGdxZs7viSahmiA=="
}


3. Interface Protocol

3.1 Pair

After the customer device acquires the 6-digit pairing code, it uses the "Pair" protocol for pairing. After the Wonder terminal receives a pairing request, it will return a UUID identifier, which will be used by the "Ack" protocol.

Action: Pair

Request "data.body" structure

VariableTypeRequiredDescription
pairUuidUUIDYPair the uuid identifier
Example:

/*
Key: AES Key 1
Encrypt the original data:
{
"header": {
"requestID": "9c07d8d7-2a43-4a29-9c6d-6b8d8f7d44e5",
"clientDeviceSN": "126498561093",
"timestamp": "2025-11-12T10:11:04+00:00"
},
"body": {
"pairUuid": "3f37e6c0-bf6e-4c00-b1fa-b2bd5e1d6a3b"
}
}
*/

{
"version": "2.0",
"action": "Pair",
"data": "KhGmDIJZQXsNHrLM1hDB/kjPjlSpmUQVNIrRLEAptCHb+GHiqdZTnfDRWJVBJDzTyLtqDXLJYRR3433sIEm7hBvpI8vZ4WeTIxcp1BUd4GwRjutbUMCQ8vc5GTlu8aWvSoChYWeHXIu5MmWXbfkWe8AMAHLtnjuvrZfV17mTlvX+09hskf5zCcFKKXVq6qA24o4d5crbIoKEmRI0K94YSPo99N9mEdnAVdh5xNxQmzsp1JlKMnxQGIy2K1HuUmabW1JLWID/In4sADJDdRk2069oYrP1PWYUqKKoahtH7GNQqJ0Syux/IykdoXVZ2dmn"
}

Response "data.body" structure

VariableTypeRequiredDescription
pairUuidUUIDYPair the uuid identifier
ackUuidUUIDYAck the uuid identifier
aesKeyStringYThe AES key 2 used for encryption
Example:

/*
Key: AES Key 1
Encrypt the original data:
{
"header": {
"responseID": "9c07d8d7-2a43-4a29-9c6d-6b8d8f7d44e5",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"pairUuid": "3f37e6c0-bf6e-4c00-b1fa-b2bd5e1d6a3b",
"ackUuid": "4d366618-49cf-4f93-bd23-25388a573b0c",
"aesKey": "OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN"
}
}
*/

{
"version": 2.0,
"action": "Pair",
"data": "eYNmWJXELRz0FETVoGgk0y/a8d56DdScry4J748Xm2oA0SF7hzsRmUNtX+xp1cMc41/lIggAI5VbA6UBwBF89y1WawoKCHyoJ6q9caOH2EwIub2xtjRXnhwxm2LJtjIFKL/BqVIPh+ZaY7CbBSSFewPnj7LXjpKL2MbHrTPNgrLucdH+hPG6XwkvWfZBYTYu0KZMMg2am+3RKQra6o0V0AXeyNSfOsgVUx8s8IZ5VJOxTOhwyd1wNp3DYW8MkkqPqrTwzO/mR2D2FBTJB9XVsTpVR7vlJwPW1IflLHDthz0xUuxLhngDeN/ziNVBeHVWhswZqasmh7QUJL4SrlVQHk783a9+vDrTp2JrU1kEvKYQufjeI7CGnf752LEaAw3YEKyP3Q7YHbUDplfoCzZ+mITyPJkPltt60SxXdfIu5gV9mfHmf+bZTKU1OOzpJjRm"
}

3.2 Ack

After the client terminal initiates the pairing, it will receive an "ackUuid" identifier. This protocol needs to carry the "ackUuid" identifier to confirm that the pairing has been successful.

Action: Ack

Request "data.body" structure

VariableTypeRequiredDescription
ackUuidUUIDYThe Wonder device will use this UUID to confirm whether the pairing was successful
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"requestID": "73a95cfe-b0f1-42b3-82d1-5a640f61e359",
"clientDeviceSN": "126498561093",
"timestamp": "2025-11-12T10:11:04+00:00"
},
"body": {
"ackUuid": "4d366618-49cf-4f93-bd23-25388a573b0c"
}
}
*/

{
"version": "2.0",
"action": "Ack",
"data": "1Rlzdz9YVYhK9cI0tqodWqay2D8t0vs3slnvVn0lW5G2EqFcfQtC/4j7oQ+X/MOvADkbVGVDREB54LxJWK5UtzNVx1+z5R/ydgYryjcUuI4p724nsggY0lIbIBE+6yCDZQE6iXYZYAVAUkdyukNB18WbmqEK0+V+uPt/NWc4H0t5drhK+nz8uu62h4PT/Fxma5/ZcnBbRqjSMe1nUJmlqY0vKmJhhZ17N9M85rgh/JUsMebNMmERR6XDbnuls4bKY4hffSVzNbWHjBWjdfX60KU2r7SBE8HiEKS41FcVDhl2dmVcNybz/+RTSxMsnEvA"
}

Response "data.body" structure

VariableTypeRequiredDescription
deviceStatusStringYPayment device transaction status: Free / Busy
Free: The current device is idle and available for new transactions;
Busy: The current device is occupied with an ongoing transaction and is not available for other transactions at the moment.
networkStatusStringYThe current network connection status of the payment device: Connected / Disconnected
softwareVersionStringYThe software version of the payment device
businessIDStringYThe response ID in the response Header is derived from the request ID in the request header.
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"responseID": "73a95cfe-b0f1-42b3-82d1-5a640f61e359",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"deviceStatus": "Free",
"networkStatus": "Connected",
"softwareVersion": "1.0.0(188)",
"businessID": "ff467f02-5b69-45f3-81aa-bffcca55fe8f"
}
}
*/

{
"version": 2.0,
"action": "Ack",
"data": "thygIk5FDezl1xaeyOFkwduPBRl8PS65YQ5+aa1bLCT6gjIVGbjGsQlvkOl+24To6ztvk3CtJ5Jgeimy93RuW3cGYflth+Eb8A2031pbUa8918aJ08lHhVmbeajnWoaN9iWmExBuqkN4EA76SB6ELELwJQR3z0xlfREuhDyhlhIeBTs5dy+UptkKzIpHzcMB6aPL37qF+TIAW6M4B7hLniTM5RfCmFwQjDRNrj78pwA8teLrvPrGSXceQnbMxlk2BXl1BhVnhTSxVh8iP/KtLi9MxO4YvSfBsrfOkwrFLNIh3SardG0V2QVgGwdfKxmCSIf4GxuDF3bJz8XM8CowAogC0dY5zea4Ms2ifblCI13dD/uMJF3qrS36Xuj+LN7lO3UYWYtNzBy0vYo45PrZ/5Zh4WOeZ5sZk43Ycotj+fk="
}

3.3 Device Info

Action: DeviceInfo

Request "data.body" structure

This request has no body

Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"requestID": "2c7f32e1-b9e4-4b34-96cc-15c51289f69b",
"clientDeviceSN": "126498561093",
"timestamp": "2025-11-12T10:11:04+00:00"
}
}
*/

{
"version": "2.0",
"action": "DeviceInfo",
"data": "fZL3Z4ZlYRz5dt5ls0orrG5Pw1vdHxK+35tOc1aDIyInrHErmJRfeohzuviFFb7FuaxMZYPKU2GEMVIq8BvS3ua2xAj1CWHnduaO0YGTHfcuYTOTZxy3CZHvMtphPux+LZ2n3QlkhRPXeMwDlcOeaq1lKLerkcQf1SDSK14MvrTVg/NuB3BArPVmZsX9zBZ1pDrc7ixr4O/yNLD6RR/9JOKt3XWYqAJyztN06hYfSSI="
}

Response "data.body" structure

VariableTypeRequiredDescription
deviceStatusStringYPayment device transaction status: Free / Busy
Free: The current device is idle and available for new transactions;
Busy: The current device is occupied with an ongoing transaction and is not available for other transactions at the moment.
networkStatusStringYThe current network connection status of the payment device: Connected / Disconnected
softwareVersionStringYThe software version of the payment device
businessIDStringYThe response ID in the response Header is derived from the request ID in the request header.
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"responseID": "2c7f32e1-b9e4-4b34-96cc-15c51289f69b",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"deviceStatus": "Free",
"networkStatus": "Connected",
"softwareVersion": "1.0.0(188)",
"businessID": "ff467f02-5b69-45f3-81aa-bffcca55fe8f"
}
}
*/

{
"version": "2.0",
"action": "DeviceInfo",
"data": "+AGm65vmYsIBpb0oOlvyCkcJ/BurpmzLL7LusZW2mlfmEE3bYAD8hbwbrOshjozgFtkL+oMSrSfvs8rxHxdr5RU9WVCBgfognPaJj+9XnNJ43vnY7cjr5LvN5OZg8HNEiRYRQipGkjlPqiqWpyYCHs1nSIFoR/KSUvIokFKDY5USySXSBs5cp+vdbO6THLjWPYrgywQ8aBfNdaUUEMZEVURRhoQYY0frhko6I2i6iatD7b4BiO2W+J8ycDClo+3QBRmRUPjZA6w5CobbWXckYZO2GxWDg1X3i8IJqx2qioVew9mzYeJ74a4/6EIiUy/ebqGOqHeVTGEuCa0jogZkVixbYBoBbb3yhdLyPa0s8aPGatYmO5XzUTpsXXoDwmXf00yJdgE5Q7vNmxwv94jSp4SAVxB8gR9yvO3iLXqG+3I="
}

3.4 Sale

Action: Sale

Request "data.body" structure

VariableTypeRequiredDescription
referenceIDStringYReference ID: Every time a transaction request is initiated, it is crucial to ensure the uniqueness of this ID. Failure to do so will render any subsequent operations on the transaction invalid.
customerOrderIDStringNThe order ID of the customer's transaction
currencyStringYExample: HKD / USD / RMB
amountStringYSale amount
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"requestID": "5debf769-49d7-4c9b-b6f4-8a9d90e1a874",
"clientDeviceSN": "126498561093",
"timestamp": "2025-11-12T10:11:04+00:00"
},
"body": {
"referenceID": "f8b13b22-16ca-4a87-95a4-df4bebf09ee1",
"customerOrderID": "e246c1cc-02f6-4ac5-b7fb-066cb2b2f5b1",
"currency": "HKD",
"amount": "10.20"
}
}
*/

{
"version": "2.0",
"action": "Sale",
"data": "OE9dcJmLIlqcsAeVyLx1JW7T60f+o32mH+miGIyZRQkLdDuutmQGw/pnYDYPyBOgvCiES4ySbj1UPrUTJWRJaxGTqtP4mI/faqS6iKjPbsfSa2gg8DGc9CnBBHZ6tM902yMJ8n1Jwn0wtfqs3v0NPL3iPb+C5tSqJHpBHwuInndHy/u/Rg/SK+AiY8946eqhYfvyd1mPzl1fMDYErs+6L1ObQkPGiFmWQIuXk0xgdsl4oe7TS4Xci7+33gHpMPLgYMMEztZj6y7A8cUPXXVNHSeqG2+A1EcutsRHJTD5J43W3rsIZH3TMaeiLkLOWY4poHU7RrFoGBUOIh+bP4LtOgpd9+c9wb//cEKAZbLY4AqxyL3NEyySYaZYBUaDhdsd9A9TO2DBrCUm2Wl03LmpuDdiLfzwwrJj9S4Ms6JsCmKrFE7w94n/8/DWD9zTDOKD"
}

Response "data.body" structure

VariableTypeRequiredDescription
statusStringYResponse status: Success / Failed / Pending
errorCodeStringY
errorMessageStringY
customerOrderIDStringNThe order ID of the customer's transaction
currencyStringNExample: HKD / USD / RMB
amountStringNSale amount
paymentMethodStringNPayment method
paymentEntryTypeStringNPayment entry type, Example: contactless
rrnStringNReceiver Reference Number
brnStringNBindo Reference Number
transactionStatusStringNTransaction Status: Success / Failed / Pending / Voided
transactionTimeDatetimeNTransaction Time
creditCardObjectN
creditCard.panPrefix6DigitsStringYFirst 6 digits of the credit card number
creditCard.panLast4DigitsStringYLast 4 digits of the credit card number
creditCard.panHashStringYSHA512
creditCard.panTokenStringY
Example 1:

When the status is Pending


/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"responseID": "5debf769-49d7-4c9b-b6f4-8a9d90e1a874",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"status": "Pending",
"errorCode": "",
"errorMessage": ""
}
}
*/

{
"version": "2.0",
"action": "Sale",
"data": "CcDYsa/fPAjhaaTi5e0SQHJ5AGeWrfhu+D70RJwU9vizGFB38D9j65iEUbBQqs7qbjOQ9AGaBkhNhBWNYUXtdDT5FT9R/2aSLodTgpTPbsWNGhkihyaaVQ+9kN/RjL/frPrvKV1VQsRDEG783RKRLY5Uz0RsSGLXbqkW0drzKxnAvAs13KlcqrfTe0rHNnZ+fKzuW7imxytn1nXKUtGciIXCE+NzXvRSmYbk0WPM+hTCM2WbC+Vul8vD3++vp4v7u4z3d+A7LRcE30W3q6TZKciZ9pnau1A4eVjxAY5EJ93uMWNnny5/yDOE2s1gKHS1"
}

Example 2:

When the status is Failed


/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"responseID": "5debf769-49d7-4c9b-b6f4-8a9d90e1a874",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"status": "Failed",
"errorCode": "5xxxx",
"errorMessage": "The equipment is being traded"
}
}
*/

{
"version": "2.0",
"action": "Sale",
"data": "aDmtvHICThbeeWzsusOZbKWWwJOI1PZC5mUHufTvsVr8vO8UyqBw99XfujjCJNq6ibse10OsBLbGc488Ty7qZW/aO8cJi/KQgqVhPU84pQ1wmfbbbZODvlV0PmD9JU6dqjU2BvChhNfFVXKYF6AGXjMh6/NFQlY4G59w0kI1vgNYyRHohoyqHBX9qm4+MUlb0f010DtTPZKMzfRL//KBilJjctok9CWz9CjRim39D969UoS4WLm7x1eXAC/DMPaw2KM/MlUp05BFzcArZlgf1bCtxhvL1TVcwhVQSLHtxYk5Mrc8rIeLMZ0I8Yw5JsbXATMgSmcz+KzaHSwlg7TtB+8rpA1VLelBf0PZmPXwOKU="
}

Example 3:

When the status is Success


/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"responseID": "5debf769-49d7-4c9b-b6f4-8a9d90e1a874",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"status": "Success",
"errorCode": "",
"errorMessage": "",
"customerOrderID": "e246c1cc-02f6-4ac5-b7fb-066cb2b2f5b1",
"currency": "HKD",
"amount": "10.20",
"paymentMethod": "visa",
"paymentEntryType": "contactless",
"rrn": "3263492852830699521",
"brn": "3263492852495159296",
"transactionStatus": "Success",
"transactionTime": "2023-06-30T09:08:52+00:00",
"creditCard": {
"panPrefix6Digits": "555555",
"panLast4Digits": "1234",
"panHash": "xxxxxxx",
"panToken": ""
}
}
}
*/

{
"version": "2.0",
"action": "Sale",
"data": "7Z12NF2oZU9zZvQkxAUsWe6fgHZux1IlYJ56DRoK6IpSRdizzq4+Fb5dosmaZZo1rere/21Dxq88IXKKS0yRc3qbaLKwMmRInInvoeSNgOLeSBhAjk8x8P5KJ6m46qzxXOB79SNSxrW+phn5nDiuJ8K/RHYN6yTi0ODRul9fxdZfj0HV/WCDq7IoSYnoDNBuAdm6o3DNcYqB2goGWIJseCpsEojEig58ZgEb5oC9WEUIajhj5FEstEJ2xeUh5DFzUyRryQ1XGO2VGh0eziofOCdYryyjLFD1VkOOP2dtqYJm5Pr1q3GMO5NG67T/E6FLLyP0SWioS+6kLG8qnUiMp2hW4FWK3+BA4xJxHRxXeoh0a/kJKZoe+r+WJow9cafcsLdi0Klv64puK35m6Lgn1Xck28vCaZ+2r/ECPcCnfCjZpTvGB60RhzCBJXY04Sspw40rsmKeS4RJVV4r7SdJBVFX5qtvgdisUTBvgJgIQOHzuTCInTh6CY2HtnzTpzg06KNoYMYN7iwnXE6rIi9c5jCj0T/AWWlX3FpH1x9L4Ie+v2fzNK9D2brlrieGF7v1PbWw1aAvw7MEtdA4k13srOx9ZwQvVc0RQU+Jrom34Gj+QaOMk2XbIZUm6618K8P2GUMrlGOouPEm+WAVFokZCQMNLzi+NXp4u1tsZOwbq3ns0XiVvSAi4hj+c0hmwxbtcJXk+p/ElfnhTW2uMGvgQ7pqyuEO+3dxAWqZ/h2dMiYRx/fYXXVrCRCiBwrdo/kKH2KWouEmIVGrPhoAhhgJMBtIAWav2p0aNnf5RSdkaNhoCMMKHVVdEXBJ5qGQb4df"
}

3.5 Abort

Action: Abort

Request "data.body" structure

This request has no body

Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"requestID": "c5bf3cbe-a146-4f8c-bb8e-209c1e7b8437",
"clientDeviceSN": "126498561093",
"timestamp": "2025-11-12T10:11:04+00:00"
}
}
*/

{
"version": 2.0,
"action": "Abort",
"data": "uKd8e4L5AULV+jo/XPg4bzMzppIkvDN8NLoB3NAhUwgB+WZ5yMJBifa9gH/nNh/PJe9Kw96L5BFg0tTjK6WqiL4U35DxDbE+99G+PLRK4AJhhfsEDHwMYZGxILtWItM+9+SGD+zoqLDx/72Jz8IcJhVb8fkPHiECllL/Lyp7Y66TRe59OjvCOov4hHxgh5Cwe8m566LK+2gxCgiUj6sdDZaWngBBx4V/4EG2IkZe2lc="
}

Response "data.body" structure

VariableTypeRequiredDescription
statusStringYResponse status: Success / Failed / Pending
errorCodeStringY
errorMessageStringY
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"responseID": "c5bf3cbe-a146-4f8c-bb8e-209c1e7b8437",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"status": "Success",
"errorCode": "",
"errorMessage": ""
}
}
*/

{
"version": 2.0,
"action": "Abort",
"data": "Agv/204TIuODU9mRa0g31lG9QKpqY/qD+PSCsN9NjYaOZOW46B9IGL/4qMRIjEo7sMtyMMqwcaMyhoXo6VlvrWwF+nmrdO2HP0QwMYjroYUaTIc8yfX8Edq3UhFG69eZTM1oaX4i8+f/x2PxdsEv+6gIKEqjwHITNG9nFn29ZtNcOcMbJUud7/8SynQXgY9Sz5Q2XgAYrVgxK4WHKWltdktflKGe+Be0I6x6f5s2Gl4YWZFm+BtT3tzIIVUotmUkyxggw7a6PT/BnLWRKzv1Igth1HxMkyLhC6DoiO7+1Tq6/Lq9p2oXJUeCueOV4Z/i"
}

3.6 Void

Action: Void

Request "data.body" structure

VariableTypeRequiredDescription
orgReferenceIDStringYThe reference ID that was carried during the transaction made at that time.
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"requestID": "8e2c77fb-ff49-4c49-82f5-ae741cb7d3d9",
"clientDeviceSN": "126498561093",
"timestamp": "2025-11-12T10:11:04+00:00"
},
"body": {
"orgReferenceID": "f8b13b22-16ca-4a87-95a4-df4bebf09ee1"
}
}
*/

{
"version": 2.0,
"action": "Void",
"data": "DOdyYB+YN2pT6M7kTImwlruw0Gdn5NHD0Cz3qAgcQaDSr66vQ1X8HtK2eDmeReQIcwjivvwR/+eHFriBT6MssLQLrVD6ZX9Kk427HGFHGuezs9AFd16RLTrl/rODHj3v0efolW8WDXDcz3uzZ3SyRkKCAWvpshL/y5ANLeSk/jAkFRQat/035jn5s80axaJlwEKPh3PNF8QHZY3OFAJqG1UaLMz/DGuteHl3kAKPWNHvUfdVClt+FgfFHvwk+e7njMez638BCMQD3MAxadv7RicdGjT3M+qVeTI+SnDJ4gJJmsPKm2kLz/ATU7xKDN+u"
}

Response "data.body" structure

VariableTypeRequiredDescription
statusStringYResponse status: Success / Failed / Pending
errorCodeStringY
errorMessageStringY
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"responseID": "8e2c77fb-ff49-4c49-82f5-ae741cb7d3d9",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"status": "Success",
"errorCode": "",
"errorMessage": ""
}
}
*/

{
"version": 2.0,
"action": "Void",
"data": "wmNcblqksB4rvya2WETsBOJf9sg1/rD1W4xx64cfqHi44SVYqXvmBUNRtaGI4+UirFD67WMmpd3z6vgXZsPgfYnYbJm4calNpBAWqgUxgntjJzDm5YRTTZqCzsW16WDu81XozqSRopHUO6tXSPR+X9pxCAA6TKEM3gf1WibryIgcN+LTUjPnz3NvI8weIQCfZIJWDZiiXbIMPCQTXMTUAklxfbQtXgVmi3Eutt7pmmH+GmUOiJOq1ldSuCNUc2PnRIkVc30DAW9g8nIBmHJo887dzuHP/CeBlUgC4FETdUKM+UDvuNJAJl05lVZSeSTC"
}

3.7 Refund

Action: Refund

Request "data.body" structure

VariableTypeRequiredDescription
referenceIDStringYReference ID: Every time a transaction request is initiated, it is crucial to ensure the uniqueness of this ID. Failure to do so will render any subsequent operations on the transaction invalid.
orgReferenceIDStringYThe reference ID that was carried during the transaction made at that time.
currencyStringYExample: HKD / USD / RMB
amountStringYpreAuth amount
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"requestID": "0f7d24de-76fc-46f8-861b-2d0d31a2dd9e",
"clientDeviceSN": "126498561093",
"timestamp": "2025-11-12T10:11:04+00:00"
},
"body": {
"referenceID": "97cc8c76-65e0-4bd2-9e16-9b9e09f65c42",
"orgReferenceID": "4b02c099-4dc9-4b30-bd2c-27bf3223df6b",
"currency": "HKD",
"amount": "10.20"
}
}
*/

{
"version": 2.0,
"action": "Refund",
"data": "9s+NYd52kApZBoNgI2PogmN02RP/CFmOM4lrFnAL0tTDiz/g8dlKhvNUby2uo8Yuui6OqRBHpPTkIR97ov9q5E93EWYsDSBqpEZuIx/FF5q05GR2BkEnWiYre1+ZhROnihycHQv8HXIHuihB+d+n4bGMtjxFyV4t9hbH43HBqtS+d6yXMBNObWA+WwIZKPwAUq+rnlvSfuIoeIUwoTy6GqhEK8R9I1El05Hc1Kg0KJBdGHlXLBYU+xkQvGPn3C1KRUG8lmRIzTXaIDbNw+4GAhq14IeyhXfzhS6JWysUza8XTOaXUiKYc3Ka4gb3jTt/ZynCTmjE0A/Za037nW4AFAZy478Bq/cqkgZP8qvVVd7qYxkqpe+dBM9eU5BhYSqkIGvpOiDiWTBy8TXqRfexRbkDAkRFm7QD/ng/P1dJO2Y="
}

Response "data.body" structure

VariableTypeRequiredDescription
statusStringYResponse status: Success / Failed / Pending
errorCodeStringY
errorMessageStringY
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"responseID": "0f7d24de-76fc-46f8-861b-2d0d31a2dd9e",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"status": "Success",
"errorCode": "",
"errorMessage": ""
}
}
*/

{
"version": 2.0,
"action": "Refund",
"data": "NfjFtfEdlWXJ/sXqaApef8FQcjoOr8mZynJlBfOw5OdOgtvUUdB7GTbGJvNt6Ye94DsavJQhz5+drVUaSwZVTB8BVmBN/CsE2tfcPz3Bu9F59jzIPU9+AKMjp1/1aQ6/btm6bEcauWSZshQE+G3oVOgM0EgI/ZFGGN5n7i5OzW6tCWvLl9SvoaIXbsolp4AT9tzO51nKl8Plr0y7jTOatls6D4sSxPnLguuQJrqA9Q/wUMMYakwX+7MaedMIP0iitImsvoLOJRULTVLRhCbv0FebFZ/X1sDeSHe23yuLlnbdlhpSXjToRsWgCUtOLALc"
}

3.8 Query Transaction Status

Action: TransactionStatus

Request "data.body" structure

VariableTypeRequiredDescription
targetReferenceIDStringYThe reference ID that was carried during the transaction made at that time.
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"action": "TransactionStatus",
"requestID": "18fd2b62-6f65-40f2-8b94-88ef32f07a3f",
"clientDeviceSN": "126498561093",
"timestamp": "2025-11-12T10:11:04+00:00"
},
"body": {
"targetReferenceID": "f8b13b22-16ca-4a87-95a4-df4bebf09ee1"
}
}
*/

{
"version": 2.0,
"action": "TransactionStatus",
"data": "3U0hWqglZgydHjzniajpGTJcl2rjH8b1jINmfnDKq+c6ogfrhxVpjtY9AybhgmP9s4mMo2BvPLKMumyzFfZ8n+nInKQTMPUYvIB+TJqV9wdxhqORsfIH8o9hLJd9ot31opwxVdIqlGdU3S3qNzEeZQ4KmqcbyneolQv6niBkiHNf3dnyZHXv7gr6yY56P5g3gORRK82a2JZBkZGwPJj9Me1aazM7QImj1AiSzaBu9Q+fqSTcYvtF7JGe0rvWp6BGXoBdlN2MEJPC+UtK0ZLdolwtaX5HV6wLeXm+dRh/6BCC9cXugE0XY1WCFSqcqxs2C9yagn5fbMwd7ZhVJ2qewI9Mc2TCkBAYQcZX+RRDllE="
}

Response "data.body" structure

VariableTypeRequiredDescription
statusStringYResponse status: Success / Failed / Pending
errorCodeStringY
errorMessageStringY
...AnyYIt is consistent with the returned information of the current query transaction type
Example:

/*
Key: AES Key 2 (OvSdpyD2FoUNR5rNyte41QqZzR1Y4DVN)
Encrypt the original data:
{
"header": {
"responseID": "18fd2b62-6f65-40f2-8b94-88ef32f07a3f",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"status": "Success",
"errorCode": "",
"errorMessage": "",
"customerOrderID": "e246c1cc-02f6-4ac5-b7fb-066cb2b2f5b1",
"currency": "HKD",
"amount": "10.20",
"paymentMethod": "visa",
"paymentEntryType": "contactless",
"rrn": "3263492852830699521",
"brn": "3263492852495159296",
"transactionStatus": "Success",
"transactionTime": "2023-06-30T09:08:52+00:00",
"creditCard": {
"panPrefix6Digits": "555555",
"panLast4Digits": "1234",
"panHash": "xxxxxxx",
"panToken": ""
}
}
}
*/

{
"version": 2.0,
"action": "gBzyZALiwFJKCafXs52mAn0yishykDmpTHSSEy7i4HYVulo3pT816TrdZjw9P6ha7eMIeKM3iror6BXNtKFI38vzSLykjLOHCKuwUnAxdsph8exTzklpsgLcplJ2Pt4dEJbnEPRvsX+e1e20tX+pJcoNkR3psyvDPAfHoMsZgwERdmgdl7HbcwQd1UPItf7EICVGUAzksBCkwvDYq8E7FRPNV7EbJc4uIGiWSCY2Q0bcs23k16/K5O9+uEEgo3j6J/eooEzuhhkZMx+rETRAud9KLFr0OXpfwACwR4T18jBWF9LU6YxGM2bqiBKLsE8Gctj/XgXbZuQK7zgunHXE+xgqZgiHQlKlRsecJlK3Uf59O094RsEyI8yyJQd5kT/X8fIoMpLCzQqs08IH91lVvQws1ZzipDy/DyxYIBpQzeVQYQ/OCkIDxy4s7ew4hWlKCTSDW32sDUTwA6aej0U+jZk71eUSWhQlVX63br9YRhZ9n+mSI8Fkix3FHerzVBdsbDSlE88fP7vj9N96YIyOILRVjCcJRIZ1ixlxtRwpTTw/In42j6YLffvkV0/aGQjQYeVEnymdGhC/HhlHhSlWmGjbfiJ3UXxsxSyeANeccAlV76+7t6kME55uPC2AU16VYIwfWsj5T7cBSsxaEqmVlQiOgiLNRbR3wp1Q4azzCe1owFD5xt6SWds5zM17cnLlxgqonOHboKUIFDq8lUx/OXFDk8aBcqYJ4wYUau/3iH1ItZi2hDzOsMf5AliRMytaW+TUS/szyGcBGIIEWVEUPeuDoTGAVDtg4QV5TYpKcTmZneiYWXA0OziglknyLXZ2"
}