Preauth
Unified order(Pre-Authorization)
The merchant business system initiates Pre-Authorization and collection orders through the unified order placement interface. The easylink payment gateway will route the payment channel according to the payment channel configured by the merchant to complete the Pre-Authorization order placement. The payment gateway returns the corresponding Pre-Authorization parameters according to different ways of Pre-Authorization, and the business system uses the Pre-Authorization parameters to initiate collection.
Interface description
Request URL:/api/pay/unifiedOrder
Request method:POST
Request type:application/json or application/x-www-form-urlencoded
Request parameters
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Merchant No. | mchNo | Yes | String(30) | M1621873433953 | Merchant No. |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | the order No. input by the merchant |
| Way of payment | wayCode | Yes | String(30) | WX_LITE | Way of payment ,such as WeChat mini program WX_LITE |
| Amount of payment | amount | Yes | int | 100 | Amoun of Pre-Authorization (unit: cents) |
| Currency code | currency | Yes | String(3) | HKD | Three-digit currency code: HKD |
| Client IP | clientIp | No | String(32) | 210.73.10.148 | Client IPV4 address |
| Product title | subject | Yes | String(64) | Product title test | Product title |
| Product description | body | Yes | String(256) | Product description "test" | Product description |
| Notify URL | notifyUrl | No | String(256) | https://www.gnete.com.hk/notify.htm | Asynchronous callback URL for payment result. A callback will only be initiated if this value is input |
| Return URL | returnUrl | No | String(256) | https://www.gnete.com.hk/return.htm | Synchronous jump notification URL for payment result |
| Expired time | expiredTime | No | int | 3600 | Expired time of order (unit: seconds, 2 hours by default). The order will expire after (created time + expired time) |
| Channel parameter | channelExtra | No | String(256) | {"auth_code", "13920933111042"} | Extra parameter initiated by a specific channel, in json format string. For details, see the channel parameter description |
| Flag of preauth | preauthFlag | Yes | String(5) | true | Takes values of true or false, with a default value of false |
| Extended parameter | extParam | No | String(512) | 134586944573118714 | Merchant extended parameter. It will be returned as it is during callback |
| Request time | reqTime | Yes | long | 1622016572190 | Request interface time, 13-digit timestamp |
| Interface version | version | Yes | String(3) | 1.0 | Interface version No., fixed: 1.0 |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value. For details, see the signature algorithm |
| Signature Type | signType | Yes | String(32) | MD5 | Signature type. Currently, only MD5 is supported |
Request example data
{
"amount": 8,
"extParam": "",
"mchOrderNo": "mho1624005107281",
"subject": "Product title",
"wayCode": "WX_H5",
"sign": "84F606FA25A6EC4783BECC08D4FDC681",
"reqTime": "1624005107",
"body": "Product description",
"version": "1.0",
"channelExtra": "{\"authCode\":\"280812820366966512\"}",
"appId": "60cc09bce4b0f1c0b83761c9",
"clientIp": "192.166.1.132",
"notifyUrl": "https://www.gnete.com.hk/notify.html",
"signType": "MD5",
"currency": "HKD",
"returnUrl": "",
"mchNo": "M1623984572",
"preauthFlag":true
}Return parameters
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Return status | code | Yes | int | 0 | 0- Successful processing. Others - Processing error. For details, see the error code |
| Return message | msg | No | String(128) | Signature failed | Specific cause of error, for example, signature failed or parameter format verification error |
| Signature message | sign | No | String(32) | CCD9083A6DAD9A2DA9F668C3D4517A84 | Data signature. If data is empty, it will not be returned |
| Return data | data | No | String(512) | {} | Return the order placement data, in JSON format |
Data format
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Payment order No | payOrderId | Yes | String(30) | U12021022311124442600 | Return the payment system order No. |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | Return the order No. input by the merchant |
| Order status | state | Yes | int | 2 | Payment order status 0-Order generated 1-Payment in progress 2-Payment success 3-Payment failure 4-Cancelled 5-Refunded 6-Order closure |
| Payment data type | payDataType | Yes | String | payUrl | Payment parameter typepayUrl - Way to jump linkform - Form modewxapp - WeChat payment parameters (for WeChat official accounts, mini programs, and app payments (1、SDK download URL: IOS:https://developers.weixin.qq.com/doc/oplatform/Downloads/iOS_Resource.html Android:https://developers.weixin.qq.com/doc/oplatform/Downloads/Android_Resource.html 2、SDK access guide: IOS:https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html Android:https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/Android.html)) aliapp - Alipay app payment parameters (1、SDK download URL:https://docs.alipay.hk/alipayhkdocs/hk/app_hk/download 2、SDK document URL:https://global.alipay.com/docs/ac/hkapi/securitypay_pay#WLtXX) ysfapp - YSF app payment parameterscodeUrl - QR code URLcodeImgUrl - QR code image URLnone - Empty payment parameter |
| Payment data | payData | No | String | http://www.gnete.com.hk/pay.html | Payment parameters used for initiating payment, such as for WeChat official account payment |
| Channel error code | errCode | No | String | ACQ.PAYMENT_AUTH_CODE_INVALID | Error code returned by upstream channel |
| Channel error description | errMsg | No | String | Business Failed | Error description returned by upstream channel |
Response example data
{
"code": 0,
"data": {
"errCode": "ACQ.PAYMENT_AUTH_CODE_INVALID",
"errMsg": "Business Failed【支付失败,获取顾客账户信息失败,请顾客刷新付款码后重新收款,如再次收款失败,请联系管理员处理。[SOUNDWAVE_PARSER_FAIL]】",
"mchOrderNo": "mho1624005752661",
"orderState": 3,
"payOrderId": "P202106181642329900002"
},
"msg": "SUCCESS",
"sign": "F4DA202C516D1F33A12F1E547C5004FD"
}Way of payment
| WayCode | Way of payment |
|---|---|
| ALI_JSAPI | Alipay Life Account |
| ALI_APP | Alipay APP |
| ALI_H5 | Alipay H5 |
| ALI_QR | Alipay Scan (Main) |
| WX_JSAPI | WeChat Official Account |
| WX_LITE | WeChat Mini Program |
| WX_APP | WeChat APP |
| WX_H5 | WeChat H5 |
| WX_QR | WeChat Scan (Main) |
| UP_OP | UnionPay Online Payment |
| UP_EXPRESS | UnionPay Express Payment |
| UP_APP | UnionPay APP |
| YSF_QR | YSF Scan (Main) |
| NUVEI_H5 | NUVEI H5 (Visa, Master) |
channelExtra parameter description
When wayCode=WX_JSAPI or wayCode=WX_LITE, channelExtra must be subAppid or openid. The example data of channelExtra is as follows:
{"subAppid": "o6BcIwvSiRpfS8e_UyfQNrYuk2LI", "openid": "o6BcIwvSiRpfS8e_UyfQNrYuk2LI"}When wayCode=WX_H5 or wayCode=WX_APP, channelExtra can be subAppid. The example data of channelExtra is as follows:
{"appid": "o6BcIwvSiRpfS8e_UyfQNrYuk2LI"}When wayCode=ALI_H5,channelExtra can be walletType. Set the wallet type. At this time, walletType can be: CN-Chinese Mainland wallet,HK-Hong Kong Wallet,If walletType is not input,HK is returned by default, The example data of channelExtra is as follows:
{"walletType": "CN"}When wayCode=ALI_QR or wayCode=WX_QR or wayCode=YSF_QR, channelExtra can be payDataType. Set the returned payment data type. At this time, payDataType can be: codeUrl-QR code URL,codeImgUrl-QR code image URL. If payDataType is not input, codeUrl type is returned by default. The example data of channelExtra is as follows:
{"payDataType": "codeImgUrl"}When wayCode=UP_OP or wayCode=UP_APP, channelExtra can be accNo. Lock the transaction of bank card number. The example data of channelExtra is as follows:
{"accNo": "6250******0016"}When wayCode=UP_EXPRESS, channelExtra can be customerInfo. Input the cardholder verification information. The example data of channelExtra is as follows:
{"customerInfo": "aN89IpTVcF7EoN9aBbDwjc1BN0nFrcz22trbqalSn4YJzCW3muyO70gIRX9KUblQP57bIJ+/Cg+VacE0r2l82ghRQfAGQTaO3K+Dzj3t97k7p4cl8QtdvbzQBAqIS3O905PMmDsezZmm1Ag5HEjCjfzZke1TZmieof2uRzIO0DD4yWOZu0Qx3VePGt+yrPihwlaK/raXYjKuXSA38sWrKg98B3e7Ie/cilDgYwxvXlRAjABO+ecJq844Kc7v7Dnus7FC0cwu+OLnGT4BJTsXa5ywl4IbUvrvsKBvvxAfMDwkDwgio1+hPORVyDSUpOd/9XSXC9spu+GhkBbWQgXlfA=="}customerInfo generation rules:RSA({"accNo":"6250******0016","expired":"2412","cvn2":"123"})。accNo:bank card number,expired:expired YYMM,cvn2:3 digit CVN2
Order query
Merchants query orders through this interface. The payment gateway will return the latest data of the order.
Interface description
Request URL:/api/preauth/query
Request method:POST
Request type:application/json or application/x-www-form-urlencoded
Request parameters
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Merchant No. | mchNo | Yes | String(30) | M1621873433953 | Merchant No. |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Payment order No. | payOrderId | Yes | String(30) | P20160427210604000490 | Input either the order No. generated in the payment center or mchOrderNo |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | Input either the order No. generated by the merchant or payOrderId |
| Request time | reqTime | Yes | long | 1622016572190 | Request interface time, 13-digit timestamp |
| Interface version | version | Yes | String(3) | 1.0 | Interface version No., fixed: 1.0 |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value. For details, see the signature algorithm |
| Signature Type | signType | Yes | String(32) | MD5 | Signature type. Currently, only MD5 is supported |
Request example data
{
"payOrderId": "P202106181104177050002",
"appId": "60cc09bce4b0f1c0b83761c9",
"sign": "46940C58B2F3AE426B77A297ABF4D31E",
"signType": "MD5",
"reqTime": "1624006009",
"mchNo": "M1623984572",
"version": "1.0"
}| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Return status | code | Yes | int | 0 | 0- Successful processing. Others - Processing error. For details, see the error code |
| Return message | msg | No | String(128) | Signature failed | Specific cause of error, for example, signature failed or parameter format verification error |
| Signature message | sign | No | String(32) | CCD9083A6DAD9A2DA9F668C3D4517A84 | Data signature. If data is empty, it will not be returned |
| Return data | data | No | String(512) | {} | Return the order placement data, in JSON format |
Data format
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Payment order No | payOrderId | Yes | String(30) | P12021022311124442600 | Return the Payment order No. generated by the system |
| Merchant No. | mchNo | Yes | String(30) | M1621873433953 | Merchant No. |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | Return the order No. input by the merchant |
| Pre-authorization order Id | preauthOrderId | No | String(30) | 20160427210604000490 | Return the Pre-Authorization order Id generated by the system |
| Pre-authorization order No. | preauthOrderNo | No | String(30) | 20160427210604000490 | Return the Pre-Authorization order No. Input by the merchant. |
| Amount of payment | amount | Yes | int | 100 | Amount of payment (unit: cents) |
| Currency code | currency | No | String(3) | HKD | Three-digit currency code: HKD |
| Order status | state | Yes | int | 2 | Payment order status 0-Order generated 1-Payment in progress 2-Payment success 3-Payment failure 4-Cancelled 5-Refunded 6-Order closure |
| Client IP | clientIp | No | String(32) | 210.73.10.148 | Client IPV4 address |
| Product title | subject | Yes | String(64) | Product title test | Product title |
| Product description | body | Yes | String(256) | Product description test | Product description |
| Channel order No. | channelOrderNo | No | String | 20160427210604000490 | Order No. of corresponding channel |
| Channel trace No | traceNo | No | String | 20160427210604000490 | Trace No. of corresponding channel |
| Channel error code | errCode | No | String | 1002 | Trace No. of corresponding channel |
| Channel error description | errMsg | No | String | Business exception error | Error description returned by the channel when placing an order |
| Extended parameter | extParam | No | String(512) | 134586944573118714 | Merchant extended parameter. It will be returned as it is during callback |
| Created time | createdAt | Yes | long | 1622016572190 | Order created time,13 digit timestamp |
| Success time | successTime | No | long | 1622016572190 | Order payment Success time,13 digit timestamp |
Response example data
{
"code": 0,
"data": {
"amount": 58,
"appId": "60cc09bce4b0f1c0b83761c9",
"body": "Product description",
"channelOrderNo": "2021061822001423031419593035",
"clientIp": "192.166.1.132",
"createdAt": 1623985457705,
"currency": "HKD",
"extParam": "",
"ifCode": "alipay",
"mchNo": "M1623984572",
"mchOrderNo": "mho1623985457320",
"payOrderId": "P202106181104177050002",
"state": 2,
"subject": "Product title",
"successTime": 1623985459000,
"wayCode": "WX_H5"
},
"msg": "SUCCESS",
"sign": "9548145EA12D0CD8C1628BCF44E19E0D"
}Pre-Authorization Cancellation
Merchants can cancel a pre-authorization order via this interface, and the payment gateway will process the cancellation of the pre-authorization order.
Interface description
Request URL:/api/pay/preauthCancel
Request method:POST
Request type:application/json or application/x-www-form-urlencoded
Request parameters
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Merchant No. | mchNo | Yes | String(30) | M1621873433953 | Merchant No. |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Payment order No. | payOrderId | Yes | String(30) | P20160427210604000490 | Input either the order No. generated in the payment center or mchOrderNo |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | Input either the order No. generated by the merchant or payOrderId |
| Notify URL | notifyUrl | Yes | String(100) | https://www.gnete.com.hk/notify.html | Asynchronous callback URL for payment result. A callback will only be initiated if this value is input |
| Request time | reqTime | Yes | long | 1622016572190 | Request interface time, 13-digit timestamp |
| Interface version | version | Yes | String(3) | 1.0 | Interface version No., fixed: 1.0 |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value. For details, see the signature algorithm |
| Signature Type | signType | Yes | String(32) | MD5 | Signature type. Currently, only MD5 is supported |
Request example data
{
"payOrderId": "P202106181104177050002",
"notifyUrl": "https://www.gnete.com.hk/notify.html",
"appId": "60cc09bce4b0f1c0b83761c9",
"sign": "46940C58B2F3AE426B77A297ABF4D31E",
"signType": "MD5",
"reqTime": "1624006009",
"mchNo": "M1623984572",
"version": "1.0"
}| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Return status | code | Yes | int | 0 | 0- Successful processing. Others - Processing error. For details, see the error code |
| Return message | msg | No | String(128) | Signature failed | Specific cause of error, for example, signature failed or parameter format verification error |
| Signature message | sign | No | String(32) | CCD9083A6DAD9A2DA9F668C3D4517A84 | Data signature. If data is empty, it will not be returned |
| Return data | data | No | String(512) | {} | Return the order placement data, in JSON format |
Data format
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Merchant No. | mchNo | Yes | String(30) | M1621873433953 | Merchant No. |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Payment order No. | payOrderId | Yes | String(30) | P12021022311124442600 | Return the payment system order No. |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | Return the order No. input by the merchant |
| Pre-Authorization order Id | preauthOrderId | No | String(30) | 20160427210604000490 | Return the Pre-Authorization order Id generaled by the system. |
| Pre-Authorization order No. | preauthOrderNo | No | String(30) | 20160427210604000490 | Return the Pre-Authorization order No. Input by the merchant. |
| Amount of payment | amount | Yes | int | 100 | Amount of payment (unit: cents) |
| Currency code | currency | No | String(3) | HKD | Three-digit currency code: HKD |
| Order status | state | Yes | int | 2 | Payment order status 0-Order generated 1-Payment in progress 2-Payment success 3-Payment failure 4-Cancelled 5-Refunded 6-Order closure |
| Channel order No. | channelOrderNo | No | String | 20160427210604000490 | Order No. of corresponding channel |
| Channel trace No | traceNo | No | String | 20160427210604000490 | Trace No. of corresponding channel |
| Channel error code | errCode | No | String | 1002 | Trace No. of corresponding channel |
| Channel error description | errMsg | No | String | Business exception error | Error description returned by the channel when placing an order |
Response example data
{
"code": 0,
"data": {
"amount": 58,
"appId": "60cc09bce4b0f1c0b83761c9",
"channelOrderNo": "2021061822001423031419593035",
"mchNo": "M1623984572",
"mchOrderNo": "mho1623985457320",
"payOrderId": "P202106181104177050002",
"state": 2,
"errCode": "",
"errMsg": ""
},
"msg": "SUCCESS",
"sign": "9548145EA12D0CD8C1628BCF44E19E0D"
}Pre-Authorization Completion
Merchants can complete an order via this interface, and the payment gateway will process the pre-authorization completion for the pre-authorization order.
Interface description
Request URL:/api/pay/preauthed
Request method:POST
Request type:application/json or application/x-www-form-urlencoded
Request parameters
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Merchant No. | mchNo | Yes | String(30) | M1621873433953 | Merchant No. |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Payment order No. | payOrderId | Yes | String(30) | P20160427210604000490 | Input either the order No. generated in the payment center or mchOrderNo |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | Input either the order No. generated by the merchant or payOrderId |
| Pre-Authorization Completed Amount | totalAmount | Yes | long | 58 | Pre-Authorization Completed Amount |
| Notify URL | notifyUrl | Yes | String(100) | https://www.gnete.com.hk/notify.html | Asynchronous callback URL for payment result. A callback will only be initiated if this value is input |
| Request time | reqTime | Yes | long | 1622016572190 | Request interface time, 13-digit timestamp |
| Interface version | version | Yes | String(3) | 1.0 | Interface version No., fixed: 1.0 |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value. For details, see the signature algorithm |
| Signature Type | signType | Yes | String(32) | MD5 | Signature type. Currently, only MD5 is supported |
Request example data
{
"payOrderId": "P202106181104177050002",
"amount": 58,
"notifyUrl": "https://www.gnete.com.hk/notify.html",
"appId": "60cc09bce4b0f1c0b83761c9",
"sign": "46940C58B2F3AE426B77A297ABF4D31E",
"signType": "MD5",
"reqTime": "1624006009",
"mchNo": "M1623984572",
"version": "1.0"
}| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Return status | code | Yes | int | 0 | 0- Successful processing. Others - Processing error. For details, see the error code |
| Return message | msg | No | String(128) | Signature failed | Specific cause of error, for example, signature failed or parameter format verification error |
| Signature message | sign | No | String(32) | CCD9083A6DAD9A2DA9F668C3D4517A84 | Data signature. If data is empty, it will not be returned |
| Return data | data | No | String(512) | {} | Return the order placement data, in JSON format |
Data format
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Merchant No. | mchNo | Yes | String(30) | M1621873433953 | Merchant No. |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Payment order No. | payOrderId | Yes | String(30) | P12021022311124442600 | Return the payment system order No. |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | Return the order No. input by the merchant |
| Pre-Authorization order Id | preauthOrderId | No | String(30) | 20160427210604000490 | Return Pre-Authorization order Id generated by the payment gateway |
| Pre-Authorization order No. | preauthOrderNo | No | String(30) | 20160427210604000490 | Return the Pre-Authorization order No. Input by the merchant. |
| Pre-Authorization Completed Amount | amount | No | int | 100 | Pre-Authorization Completed Amount (unit: cents) |
| Order status | state | Yes | int | 2 | Payment order status 0-Order generated 1-Payment in progress 2-Payment success 3-Payment failure 4-Cancelled 5-Refunded 6-Order closure |
| Channel order No. | channelOrderNo | No | String | 20160427210604000490 | Order No. of corresponding channel |
| Channel trace No | traceNo | No | String | 20160427210604000490 | Trace No. of corresponding channel |
| Channel error code | errCode | No | String | 1002 | Trace No. of corresponding channel |
| Channel error description | errMsg | No | String | Business exception error | Error description returned by the channel when placing an order |
Response example data |
{
"code": 0,
"data": {
"amount": 58,
"appId": "60cc09bce4b0f1c0b83761c9",
"channelOrderNo": "2021061822001423031419593035",
"mchNo": "M1623984572",
"mchOrderNo": "mho1623985457320",
"payOrderId": "P202106181104177050002",
"state": 2,
"errCode": "",
"errMsg": ""
},
"msg": "SUCCESS",
"sign": "9548145EA12D0CD8C1628BCF44E19E0D"
}Pre-Authorization Completion Cancellation
Merchants can cancel a pre-authorization completion order via this interface, and the payment gateway will process the cancellation of the pre-authorization completion order.
Interface description
Request URL:/api/pay/preauthedCancel
Request method:POST
Request type:application/json or application/x-www-form-urlencoded
Request parameters
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Merchant No. | mchNo | Yes | String(30) | M1621873433953 | Merchant No. |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Pre-Authorization Completed Order No | payOrderId | Yes | String(30) | P20160427210604000490 | Input either the order No. generated in the payment center or mchOrderNo |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | Input either the order No. generated by the merchant or payOrderId |
| Notify URL | notifyUrl | Yes | String(100) | https://www.gnete.com.hk/notify.html | Asynchronous callback URL for payment result. A callback will only be initiated if this value is input |
| Request time | reqTime | Yes | long | 1622016572190 | Request interface time, 13-digit timestamp |
| Interface version | version | Yes | String(3) | 1.0 | Interface version No., fixed: 1.0 |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value. For details, see the signature algorithm |
| Signature Type | signType | Yes | String(32) | MD5 | Signature type. Currently, only MD5 is supported |
Request example data
{
"payOrderId": "P202106181104177050002",
"notifyUrl": "https://www.gnete.com.hk/notify.html",
"appId": "60cc09bce4b0f1c0b83761c9",
"sign": "46940C58B2F3AE426B77A297ABF4D31E",
"signType": "MD5",
"reqTime": "1624006009",
"mchNo": "M1623984572",
"version": "1.0"
}| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Return status | code | Yes | int | 0 | 0- Successful processing. Others - Processing error. For details, see the error code |
| Return message | msg | No | String(128) | Signature failed | Specific cause of error, for example, signature failed or parameter format verification error |
| Signature message | sign | No | String(32) | CCD9083A6DAD9A2DA9F668C3D4517A84 | Data signature. If data is empty, it will not be returned |
| Return data | data | No | String(512) | {} | Return the order placement data, in JSON format |
Data format
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Merchant No. | mchNo | Yes | String(30) | M1621873433953 | Merchant No. |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Payment order No. | payOrderId | Yes | String(30) | P12021022311124442600 | Return the payment system order No. |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | Return the order No. input by the merchant |
| Payment order No. | preauthOrderId | No | String(30) | 20160427210604000490 | Return Payment order No. |
| Pre-Authorization order No. | preauthOrderNo | No | String(30) | 20160427210604000490 | Return the Pre-Authorization order No. Input by the merchant. |
| Amount of payment | amount | No | int | 100 | Amount of payment (unit: cents) |
| Currency code | currency | No | String(3) | HKD | Three-digit currency code: HKD |
| Order status | state | Yes | int | 2 | Payment order status 0-Order generated 1-Payment in progress 2-Payment success 3-Payment failure 4-Cancelled 5-Refunded 6-Order closure |
| Channel order No. | channelOrderNo | No | String | 20160427210604000490 | Order No. of corresponding channel |
| Channel trace No | traceNo | No | String | 20160427210604000490 | Trace No. of corresponding channel |
| Channel error code | errCode | No | String | 1002 | Trace No. of corresponding channel |
| Channel error description | errMsg | No | String | Business exception error | Error description returned by the channel when placing an order |
Response example data
{
"code": 0,
"data": {
"amount": 58,
"appId": "60cc09bce4b0f1c0b83761c9",
"channelOrderNo": "2021061822001423031419593035",
"mchNo": "M1623984572",
"mchOrderNo": "mho1623985457320",
"payOrderId": "P202106181104177050002",
"state": 2,
"errCode": "",
"errMsg": ""
},
"msg": "SUCCESS",
"sign": "9548145EA12D0CD8C1628BCF44E19E0D"
}Pre-Authorization notification
When the order is successfully paid, the payment gateway will send a callback notification to the merchant system. If the merchant system does not return correctly, the payment gateway will delay and send the notification again.
Interface description
Request URL:This link is set through the parameter notifyUrl submitted by the unified order placement interface. If the link cannot be accessed, the merchant system will not be able to receive notifications from the payment center.
Request method:POST
Request type:application/x-www-form-urlencoded
Notification parameters
| Field name | Variable name | Required | Type | Example value | Description |
|---|---|---|---|---|---|
| Payment order No | payOrderId | Yes | String(30) | P12021022311124442600 | Return the payment system order No. |
| Merchant No. | mchNo | Yes | String(30) | M1621873433953 | Merchant No. |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Merchant order No | mchOrderNo | Yes | String(30) | 20160427210604000490 | the order No. input by the merchant |
| Pre-Authorization Completed Amount | preauthedAmount | No | int | 1 | Pre-Authorization Completed Amount |
| Flag of preauth | preauthFlag | Yes | String(5) | true | Flag of preauth号 |
| Status of preauth | preauthState | No | String(5) | 1 | Status of preauth: 0-Pre-Authorization, 1-Pre-Authorization Completed, 2-Pre-Authorization Revoked |
| Payment interface | ifCode | Yes | String(30) | wxpay | Payment interface No |
| Way of payment | wayCode | Yes | String(30) | WX_LITE | Way of payment ,Such as WeChat mini program WX_LITE |
| Amount of payment | amount | No | int | 100 | The amount of payment (unit: cents) |
| Currency code | currency | Yes | String(3) | HKD | Three-digit currency code: HKD |
| Order status | state | Yes | int | 2 | Payment order status 0-Order generated 1-Payment in progress 2-Payment success 3-Payment failure 4-Cancelled 5-Refunded 6-Order closure |
| Client IP | clientIp | No | String(32) | 210.73.10.148 | Client IPV4 address |
| Product title | subject | No | String(64) | Product title test | Product title |
| Product description | body | No | String(256) | Product description test | Product description |
| Channel order No. | channelOrderNo | No | String | 20160427210604000490 | Order No. of corresponding channel |
| Channel user no | channelUser | No | String | 625094******0014 | User ID/Card Number of the Corresponding Channel |
| Channel error code | errCode | No | String | 1002 | Trace No. of corresponding channel |
| Channel error description | errMsg | No | String | 134586944573118714 | Channel error description |
| Extended parameter | extParam | No | String(512) | 134586944573118714 | Merchant extended parameter |
| Created time | createdAt | No | long | 1622016572190 | Order created time,13 digit timestamp |
| Success time | successTime | No | long | 1622016572190 | Order payment Success time,13 digit timestamp |
| Notification request time | reqTime | Yes | long | 1622016572190 | Notification request time,,13位时间戳 |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value. For details, see the signature algorithm |
Return result
After being processed by the business system, it is synchronously returned to the payment center. Returning the string "success" indicates success. Returning anything other than "success" indicates processing failure. The payment center will notify the business system again. (The notification frequency is 0/30/60/90/120/150s)
Note: The returned string is case-insensitive and there cannot be spaces or line breaks before or after the string.
Notification example data
{
"amount": 5,
"body": "Product description",
"clientIp": "192.166.1.132",
"createdAt": "1622016572190",
"currency": "HKD",
"extParam": "",
"ifCode": "wxpay",
"mchNo": "M1621873433953",
"appId": "60cc09bce4b0f1c0b83761c9",
"mchOrderNo": "mho1621934803068",
"payOrderId": "20210525172643357010",
"state": 3,
"subject": "Product title",
"wayCode": "WX_H5",
"preauthedAmount": 0,
"preauthFlag": true,
"preauthState": 2,
"channelUser": "625094******0014",
"sign": "C380BEC2BFD727A4B6845133519F3AD6"
}