Appearance
分账接收方查询接口 ¶
接口说明 ¶
参数 | 说明 |
---|---|
请求URL | /unipay/query/allocationReceiver |
请求方式 | POST |
请求类型 | application/json |
请求参数 ¶
字段名 | 变量名 | 必填 | 类型 | 长度 | 示例值 | 描述 |
---|---|---|---|---|---|---|
所属通道 | channel | 否 | String | 20 | ali_pay | 所属通道与分账接收方编号不可以同时为空 |
分账接收方编号 | receiverNo | 否 | String | 32 | A0001 | 所属通道与分账接收方编号不可以同时为空 |
用户IP | clientIp | 否 | String | 64 | 127.0.0.1 | 支持Ipv4和Ipv6,部分支付通道要求必填,如调用微信支付时 |
随机数值 | nonceStr | 否 | String | 32 | d112892e382a7093 | |
签名值 | sign | 否 | String | 64 | 072695d112892e382a7093b81e6a52af | |
请求时间 | reqTime | 是 | Long | 123123121 | 使用时间戳(秒级) |
响应结果 ¶
提示
业务数据包裹在公共响应参数
中的data
字段,在code
为0
时才会有返回数据。
返回结果 ¶
字段名 | 变量名 | 必传 | 类型 | 示例值 | 描述 |
---|---|---|---|---|---|
分账单号 | receivers | 是 | AllocReceiverModel[] | 见下方分账接收方描述 | |
签名 | sign | 是 | String | 072695d112892e382a7093b81e6a52af | |
状态码 | code | 否 | Integer | 0 | 为0表示成功,非0表示失败 |
错误信息 | msg | 否 | String | 关闭失败 | 状态非0时会有返回值 |
响应时间 | resTime | 是 | Long | 123123121 | 服务返回请求的时间,时间戳(秒级) |
分账接收方 ¶
字段名 | 变量名 | 必传 | 类型 | 示例值 | 描述 |
---|---|---|---|---|---|
分账接收方编号 | receiverNo | 是 | String | 1753370980523384832 | 系统生成的分账号 |
所属通道 | channel | 是 | String | 分 | |
分账接收方类型 | receiverType | 是 | String | ||
接收方账号 | receiverAccount | 是 | String | ||
接收方姓名 | receiverName | 否 | String | ||
分账关系类型 | relationType | 是 | String | ||
关系名称 | relationName | 否 | Integer | 0 |
HTTP请求示例 ¶
请求参数 ¶
json
{
"allocationNo": "DEVA24060200024363000001",
"clientIp": "127.0.0.1",
"sign": "cce35cf333daf3dc5914bba8a3db1bbeebc1704564febe5ad4db410763865a28",
"reqTime": 1717419815
}
响应参数(成功) ¶
json
{
"msg": "success",
"code": 0,
"data": {
"allocationNo": "DEVA24060200024363000001",
"bizAllocationNo": "A46974",
"outAllocationNo": "20240602002530020065510304965682",
"orderNo": "DEVP24060123574963000003",
"bizOrderNo": "SDK_1717257469568",
"outOrderNo": "2024060122001451650502837418",
"title": "测试手动分账",
"channel": "ali_pay",
"amount": 6000,
"description": "测试分账",
"status": "allocation_processing",
"result": "all_pending",
"details": [
{
"receiverNo": "123",
"amount": 6000,
"rate": 6000,
"receiverType": "ali_user_id",
"receiverAccount": "2088722032251651",
"result": "pending"
}
],
"code": 0,
"resTime": 1717419940,
"sign": "1690414255dc7ebbce255b9f8ae824f0f5f1c63833a8030a3dadf6f6cb10675e"
},
"traceId": "fvtm0cFqoU4a"
}
响应参数(失败) ¶
json
{
"msg": "未通过签名验证",
"code": 20000,
"traceId": "h12UXhTkPmt3"
}
SDK请求示例 ¶
提示
使用SDK可以简化接入支付的速度
java
package cn.daxpay.single.sdk.query;
import cn.daxpay.single.sdk.code.PayChannelEnum;
import cn.daxpay.single.sdk.code.SignTypeEnum;
import cn.daxpay.single.sdk.model.allocation.AllocOrderModel;
import cn.daxpay.single.sdk.model.allocation.AllocReceiversModel;
import cn.daxpay.single.sdk.net.DaxPayConfig;
import cn.daxpay.single.sdk.net.DaxPayKit;
import cn.daxpay.single.sdk.param.allocation.QueryAllocOrderParam;
import cn.daxpay.single.sdk.param.allocation.QueryAllocReceiverParam;
import cn.daxpay.single.sdk.response.DaxPayResult;
import cn.hutool.json.JSONUtil;
import org.junit.Before;
import org.junit.Test;
/**
* 查询分账订单测试类
* @author xxm
* @since 2024/6/3
*/
public class QueryAllocOrderTest {
@Before
public void init() {
// 初始化支付配置
DaxPayConfig config = DaxPayConfig.builder()
.serviceUrl("http://127.0.0.1:9000")
.signSecret("123456")
.signType(SignTypeEnum.HMAC_SHA256)
.build();
DaxPayKit.initConfig(config);
}
/**
* 分账接收方查询
*/
@Test
public void queryAllocReceiver() {
QueryAllocReceiverParam param = new QueryAllocReceiverParam();
param.setChannel(PayChannelEnum.ALI.getCode());
param.setReceiverNo("123");
param.setClientIp("127.0.0.1");
DaxPayResult<AllocReceiversModel> execute = DaxPayKit.execute(param);
System.out.println(JSONUtil.toJsonStr(execute));
}
}