Appearance
分账接收方删除接口 ¶
接口说明 ¶
参数 | 说明 |
---|---|
请求URL | /unipay/allocation/receiver/remove |
请求方式 | POST |
请求类型 | application/json |
请求参数 ¶
字段名 | 变量名 | 必传 | 类型 | 长度 | 示例值 | 描述 |
---|---|---|---|---|---|---|
分账接收方编号 | receiverNo | 是 | String | 32 | 1753370980523384832 | |
用户IP | clientIp | 否 | String | 64 | 127.0.0.1 | 支持V4和V6,部分支付方式要求必填,如调用微信支付方式时 |
随机数值 | nonceStr | 否 | String | 32 | d112892e382a7093 | |
签名值 | sign | 否 | String | 64 | 072695d112892e382a7093b81e6a52af | |
请求时间 | reqTime | 是 | Long | 123123121 | 使用时间戳(秒级) |
响应结果 ¶
提示
业务数据包裹在公共响应参数
中的data
字段,在code
为0
时才会有返回数据。
字段名 | 变量名 | 必传 | 类型 | 示例值 | 描述 |
---|---|---|---|---|---|
签名 | sign | 是 | String | 072695d112892e382a7093b81e6a52af | |
状态码 | code | 否 | Integer | 0 | 为0表示成功,非0表示失败 |
错误信息 | msg | 否 | String | 关闭失败 | 状态非0时会有返回值 |
响应时间 | resTime | 是 | Long | 123123121 | 服务返回请求的时间,时间戳(秒级) |
HTTP请求示例 ¶
请求参数 ¶
json
{
"receiverNo": "1231",
"clientIp": "127.0.0.1",
"sign": "0db7a64b1a153648d6c19f84ce43be83da362fcb8da28cad614fca804447e854",
"reqTime": 1717494707
}
响应参数(成功) ¶
json
{
"msg": "success",
"code": 0,
"data": {
"code": 0,
"resTime": 1717498499,
"sign": "2265d9a2045205b748e6d5906b154fb9be150c52239531a18d43b6addf98e0a5"
},
"traceId": "PC8NzmtAlzAO"
}
响应参数(失败) ¶
json
{
"msg": "success",
"code": 0,
"data": {
"code": 1,
"msg": "该接收方不存在",
"resTime": 1717492033,
"sign": "ce5a3045dfe342fd6562ca509e22f521f3f26f9031d7b44073129147cd350f83"
},
"traceId": "5f0CgZBrxWj5"
}
SDK请求示例 ¶
提示
使用SDK可以简化接入支付的速度
java
package cn.daxpay.single.sdk.allocation;
import cn.daxpay.single.sdk.code.AllocReceiverTypeEnum;
import cn.daxpay.single.sdk.code.AllocRelationTypeEnum;
import cn.daxpay.single.sdk.code.PayChannelEnum;
import cn.daxpay.single.sdk.code.SignTypeEnum;
import cn.daxpay.single.sdk.model.allocation.AllocReceiverAddModel;
import cn.daxpay.single.sdk.model.allocation.AllocReceiverRemoveModel;
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.AllocReceiverAddParam;
import cn.daxpay.single.sdk.param.allocation.AllocReceiverRemoveParam;
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/5/27
*/
public class AllocationReceiverTest {
@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 remove() {
AllocReceiverRemoveParam param = new AllocReceiverRemoveParam();
param.setClientIp("127.0.0.1");
param.setReceiverNo("123456");
DaxPayResult<AllocReceiverRemoveModel> execute = DaxPayKit.execute(param);
System.out.println(JSONUtil.toJsonStr(execute));
}
}