mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-07 04:58:28 +00:00
build 版本更新
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>daxpay-single-sdk</artifactId>
|
||||
<version>2.0.4</version>
|
||||
<version>2.0.5</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<!-- 项目信息 -->
|
||||
|
@@ -0,0 +1,17 @@
|
||||
package cn.bootx.platform.daxpay.sdk.model.allocation;
|
||||
|
||||
import cn.bootx.platform.daxpay.sdk.net.DaxPayResponseModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 分账结果
|
||||
* @author xxm
|
||||
* @since 2024/4/18
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class AllocationModel extends DaxPayResponseModel {
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
package cn.bootx.platform.daxpay.sdk.model.divide;
|
||||
|
||||
import cn.bootx.platform.daxpay.sdk.net.DaxPayResponseModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 分账结果(目前未支持)
|
||||
* @author xxm
|
||||
* @since 2024/2/7
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class DivideOrderModel extends DaxPayResponseModel {
|
||||
|
||||
/** 分账状态 */
|
||||
private String status;
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.sdk.param.divide;
|
||||
package cn.bootx.platform.daxpay.sdk.param.allocation;
|
||||
|
||||
import cn.bootx.platform.daxpay.sdk.model.divide.DivideOrderModel;
|
||||
import cn.bootx.platform.daxpay.sdk.model.allocation.AllocationModel;
|
||||
import cn.bootx.platform.daxpay.sdk.net.DaxPayRequest;
|
||||
import cn.bootx.platform.daxpay.sdk.response.DaxPayResult;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
@@ -15,27 +15,38 @@ import lombok.Setter;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class DivideOrderParam extends DaxPayRequest<DivideOrderModel> {
|
||||
public class AllocationParam extends DaxPayRequest<AllocationModel> {
|
||||
|
||||
/** 支付ID */
|
||||
/** 支付单ID */
|
||||
private Long paymentId;
|
||||
|
||||
/** 业务号 */
|
||||
private String businessNo;
|
||||
|
||||
/** 分账单号(保证唯一) */
|
||||
private String allocationNo;
|
||||
|
||||
/** 分账描述 */
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 分账组ID, 不传输分账组使用默认分账组进行分账
|
||||
*/
|
||||
private Long allocationGroupId;
|
||||
|
||||
/**
|
||||
* 方法请求路径
|
||||
*/
|
||||
@Override
|
||||
public String path() {
|
||||
return "/unipay/divide";
|
||||
return "/unipay/allocation";
|
||||
}
|
||||
|
||||
/**
|
||||
* 将请求返回结果反序列化为实体类
|
||||
*/
|
||||
@Override
|
||||
public DaxPayResult<DivideOrderModel> toModel(String json) {
|
||||
return JSONUtil.toBean(json, new TypeReference<DaxPayResult<DivideOrderModel>>() {}, false);
|
||||
public DaxPayResult<AllocationModel> toModel(String json) {
|
||||
return JSONUtil.toBean(json, new TypeReference<DaxPayResult<AllocationModel>>() {}, false);
|
||||
}
|
||||
}
|
@@ -3,9 +3,11 @@ package cn.bootx.platform.daxpay.sdk.payment;
|
||||
import cn.bootx.platform.daxpay.sdk.code.PayChannelEnum;
|
||||
import cn.bootx.platform.daxpay.sdk.code.PayWayEnum;
|
||||
import cn.bootx.platform.daxpay.sdk.code.SignTypeEnum;
|
||||
import cn.bootx.platform.daxpay.sdk.model.allocation.AllocationModel;
|
||||
import cn.bootx.platform.daxpay.sdk.model.pay.PayOrderModel;
|
||||
import cn.bootx.platform.daxpay.sdk.net.DaxPayConfig;
|
||||
import cn.bootx.platform.daxpay.sdk.net.DaxPayKit;
|
||||
import cn.bootx.platform.daxpay.sdk.param.allocation.AllocationParam;
|
||||
import cn.bootx.platform.daxpay.sdk.param.pay.SimplePayParam;
|
||||
import cn.bootx.platform.daxpay.sdk.response.DaxPayResult;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
@@ -31,7 +33,7 @@ public class PayAllocationTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步通道测试
|
||||
* 创建用于分账的订单
|
||||
*/
|
||||
@Test
|
||||
public void simplePay() {
|
||||
@@ -51,5 +53,21 @@ public class PayAllocationTest {
|
||||
PayOrderModel data = execute.getData();
|
||||
System.out.println(data);
|
||||
}
|
||||
/**
|
||||
* 开启分账
|
||||
*/
|
||||
@Test
|
||||
public void allocation() {
|
||||
// 分账参数
|
||||
AllocationParam param = new AllocationParam();
|
||||
param.setAllocationNo("A"+ RandomUtil.randomNumbers(5));
|
||||
param.setDescription("测试分账");
|
||||
param.setAllocationGroupId(1L);
|
||||
param.setClientIp("127.0.0.1");
|
||||
param.setPaymentId(1L);
|
||||
|
||||
DaxPayResult<AllocationModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user