1. 简介

QLink支付对接标准文档

2. 环境要求及基础约定

授权:联系QLink获取appKey、appSecret(密钥,用于验证报文信息)。

接口地址:

线下:http://open-test1.800best.com/open-platform-api/pay

生产:http://open-prod.800best.com/open-platform-api/pay

请求方式:

  • Method: POST
  • Content-Type: application/json

Header参数:

字段名 类型 必填 备注
appKey String
sign String 签名

公共响应:

字段名 类型 必填 备注
success boolean 业务处理是否成功
message String 业务处理异常消息

签名方式:

1、将appKey和content组成json字符串{"appKey":"appKey","content":"具体业务参数"},content为空时{"appKey":"appKey"}。

2、将第三方分配的客户appSecret添加到json的末尾,得到待加密字串{"appKey":"appKey","content":"具体业务参数"}appSecret。

3、对待加密字串做sha1加密得到签名(org.apache.commons.codec.digest.DigestUtils.sha1Hex(待加密字串))

4、将签名赋值到公共请求的sign字段

3. 查询支付账户

uri:

  • /queryPayAccount

接口参数:

字段名 字段描述 类型 必填 备注
payAccount 支付账号 String

返回信息:

字段名 字段描述 类型 必填 备注
serviceProvider 支付服务商 String
type 类型 String PAY_TYPE:支付方式、PAY_CHANNEL:支付渠道
code 编码 String
name 名称 String

请求示例: { "payAccount": "account1" }

返回示例:

[ { "code": "ONLINE", "name": "在线支付", "type": "PAY_TYPE" }, { "code": "QR_CODE_PAYMENT", "name": "二维码扫描支付", "type": "PAY_TYPE" }, { "code": "QRIS", "name": "支付渠道", "type": "PAY_CHANNEL" } ]

4. 支付申请

uri:

  • /apply

接口参数:

字段名 字段描述 类型 必填 备注
payAccount 支付账号 String
payTypeCode 支付方式 String
payChannelCode 支付渠道 String
tradeUuid 请求uuid String appKey下需要唯一
tradeTime 请求交易时间 Date
source 支付来源 String QERP_CN、QERP_ASIA
orderCode 订单号 String
country 国家二字码 String 国家二字码枚举
currency 三个字母的货币代码 String 三个字母的货币代码
amount 金额 Bigdecimal
description 描述 String
metadata 自定义数据 String 例:{ "my_custom_id": "merchant-123", "my_custom_order_id": "order-123" }
items 描述 Array
└ skuCode 商品编码 String
└ skuName 商品名称 String
└ quantity 数量 number
└ url 商品连接 String
└ imageUrl 图片连接 String
└ category 商品类目 String
└ subcategory 商品子类目 String
└ description 描述 String
└ metadata 自定义数据 String

返回信息:

字段名 字段描述 类型 必填 备注
billCode 账单号 String
paymentRequestId 支付服务商唯一请求id String
actionValue 商家完成操作时将使用的具体值 String
errorCode 商家完成操作时将使用的具体值 String

请求示例:

{ "glinkAccount": "account1", "payTypeCode": "ONLINE", "payChannelCode": "QRIS", "tradeUuid": "uuid", "tradeTime": "2025-08-04 13:45:21", "orderCode": "O20250804001", "country": "ID", "currency": "IDR", "amount": 1.1, "description": "描述", "metadata": "", "items": [ { "skuCode": "SKU01", "skuName": "商品01", "quantity": "1", "url": "http://", "imageUrl": "http://", "category": "", "subcategory": "", "description": "", "metadata": "" } ] }

返回示例:

{ "billCode": "账单号", "paymentRequestId": "支付二维码", "actionValue": "商家完成操作时将使用的具体值", "errorCode": "" }

5. 查询支付状态

uri:

  • /getPayStatus

接口参数:

字段名 字段描述 类型 必填 备注
tradeUuidList 请求uuid Array tradeUuidList、billCodeList不可同时为空
billCodeList 账单号 Array tradeUuidList、billCodeList不可同时为空

返回信息:

字段名 字段描述 类型 必填 备注
tradeUuid 请求uuid String
billCode 帐号号 String
paymentRequestId 支付服务商唯一请求id String
orderCode 订单号 String
status 支付状态 String 支付状态枚举
payTime 支付时间 Date 已支付时必填
amount 金额 Bigdecimal
currency 三个字母的货币代码 String 三个字母的货币代码
errorCode 失败编码 String

请求示例:

{ "tradeUuidList": ["uuid1"], "billCodeList": ["billCode1"] }

返回示例: [ { "amount": null, "billCode": "billCode1", "currency": "IDR", "errorCode": "", "orderCode": "O20250804001", "payTime": "", "paymentRequestId": paymentRequestId"", "status": "PAY_WAIT", "tradeUuid": "uuid1" }, { "amount": 2.1, "billCode": "billCode2", "currency": "IDR", "errorCode": "", "orderCode": "O20250804002", "payTime": "2025-08-04 13:45:21", "paymentRequestId": "paymentRequestId", "status": "PAY_SUCCESS", "tradeUuid": "uuid2" } ]

6. 取消支付

uri:

  • /cancel

接口参数:

字段名 字段描述 类型 必填 备注
tradeUuid 请求uuid String tradeUuid、billCode不可同时为空
billCode 账单号 String tradeUuid、billCode不可同时为空

返回信息:

字段名 字段描述 类型 必填 备注
status 取消状态 String 取消状态枚举
cancelTime 取消时间 Date
errorCode 失败编码 String

请求示例:

{ "tradeUuid": "uuid1", "billCode": "billCode1" }

返回示例:

{ "status": "WAIT", "cancelTime": "", "errorCode": "" }

7. Webhook

8. 支付状态通知

uri:

  • /payNotification

接口参数:

字段名 字段描述 类型 必填 备注
tradeUuid 请求uuid String 需要唯一
billCode 支付账单号 String
orderCode 订单号 String
paymentRequestId 订单号 String
status 支付状态 String 支付状态枚举
payTime 支付时间 Date 支付成功时必传
errorCode 失败编码 String 支付失败时必传

请求示例:

{ "tradeUuid": "uuid1", "billCode": "billCode1", "orderCode": "O20250804001", "paymentRequestId": "O20250804001", "status": "WAIT", "payTime": "", "errorCode": "" }

© Copyright QianYi Team 2025 All Rights Reserved            Updated 2025-08-13 07:32:45

results matching ""

    No results matching ""