mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-10-14 13:50:25 +00:00
feat SDK分账接口联调, 修改菜单关键词字段, 添加PGSQL脚本数据
This commit is contained in:
@@ -133,8 +133,8 @@ public class PayOrderTest {
|
||||
param.setChannel(PayChannelEnum.ALI.getCode());
|
||||
|
||||
DaxPayResult<PayModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
5948
_config/postgresql/dax-pay.sql
Normal file
5948
_config/postgresql/dax-pay.sql
Normal file
File diff suppressed because it is too large
Load Diff
2
_config/sql/2.0.6/2.0.6.update.table.sql
Normal file
2
_config/sql/2.0.6/2.0.6.update.table.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE `iam_perm_menu`
|
||||
CHANGE COLUMN `admin` `internal` bit(1) NOT NULL COMMENT '系统菜单' AFTER `hidden_header_content`;
|
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
public class UserDetail {
|
||||
|
@@ -15,7 +15,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class ResResult<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3041700282408360384L;
|
||||
|
@@ -16,7 +16,7 @@ import java.io.Serializable;
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "kv键值对象")
|
||||
public class KeyValue implements Serializable {
|
||||
|
@@ -6,7 +6,6 @@ import cn.bootx.platform.iam.code.PermissionCode;
|
||||
import cn.bootx.platform.iam.core.permission.convert.PermConvert;
|
||||
import cn.bootx.platform.iam.dto.permission.PermMenuDto;
|
||||
import cn.bootx.platform.iam.param.permission.PermMenuParam;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -25,7 +24,6 @@ import lombok.experimental.Accessors;
|
||||
public class PermMenu extends MpBaseEntity implements EntityBaseFunction<PermMenuDto> {
|
||||
|
||||
/** 父id */
|
||||
// @TableField(updateStrategy = NEVER)
|
||||
private Long parentId;
|
||||
|
||||
/** 关联终端code */
|
||||
@@ -86,12 +84,8 @@ public class PermMenu extends MpBaseEntity implements EntityBaseFunction<PermMen
|
||||
/** 隐藏的标题内容 */
|
||||
private boolean hiddenHeaderContent;
|
||||
|
||||
/**
|
||||
*
|
||||
* TODO 替换为非关键词, 来兼容更多类型数据库
|
||||
*/
|
||||
@TableField("`admin`")
|
||||
private boolean admin;
|
||||
/** 系统内置 */
|
||||
private boolean internal;
|
||||
|
||||
/** 描述 */
|
||||
private String remark;
|
||||
|
@@ -79,7 +79,7 @@ public class PermMenuDto extends BaseDto implements Serializable {
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "系统内置")
|
||||
private boolean admin;
|
||||
private boolean internal;
|
||||
|
||||
@Schema(description = "子节点")
|
||||
private List<PermMenuDto> children;
|
||||
|
@@ -16,21 +16,19 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public enum AllocReceiverTypeEnum {
|
||||
/** 个人 */
|
||||
WX_PERSONAL("wx_personal","PERSONAL_OPENID", "个人"),
|
||||
WX_PERSONAL("wx_personal", "个人"),
|
||||
/** 商户 */
|
||||
WX_MERCHANT("wx_merchant","MERCHANT_ID", "商户"),
|
||||
WX_MERCHANT("wx_merchant", "商户"),
|
||||
|
||||
/** userId 以2088开头的纯16位数字 */
|
||||
ALI_USER_ID("ali_user_id","userId", "用户ID"),
|
||||
ALI_USER_ID("ali_user_id", "用户ID"),
|
||||
/** openId */
|
||||
ALI_OPEN_ID("ali_open_id","openId", "openId"),
|
||||
ALI_OPEN_ID("ali_open_id", "openId"),
|
||||
/** 账号 */
|
||||
ALI_LOGIN_NAME("ali_login_name","loginName", "账号");
|
||||
ALI_LOGIN_NAME("ali_login_name", "账号");
|
||||
|
||||
/** 编码 */
|
||||
private final String code;
|
||||
/** 外部编码, 三方支付系统使用的编码 */
|
||||
private final String outCode;
|
||||
/** 名称 */
|
||||
private final String name;
|
||||
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.daxpay.single.sdk.model.allocation;
|
||||
|
||||
import cn.daxpay.single.sdk.net.DaxPayResponseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
@@ -10,8 +9,8 @@ import lombok.experimental.Accessors;
|
||||
* @author xxm
|
||||
* @since 2024/5/21
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
public class AllocReceiverAddModel extends DaxPayResponseModel {
|
||||
}
|
||||
|
@@ -3,16 +3,18 @@ package cn.daxpay.single.sdk.model.allocation;
|
||||
import cn.daxpay.single.sdk.code.AllocReceiverTypeEnum;
|
||||
import cn.daxpay.single.sdk.code.AllocRelationTypeEnum;
|
||||
import cn.daxpay.single.sdk.code.PayChannelEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 分账接收方
|
||||
* @author xxm
|
||||
* @since 2024/5/21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
public class AllocReceiverModel {
|
||||
|
||||
/** 分账接收方编号, 需要保证唯一 */
|
||||
|
@@ -1,17 +1,17 @@
|
||||
package cn.daxpay.single.sdk.model.allocation;
|
||||
|
||||
import cn.daxpay.single.sdk.net.DaxPayResponseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 分账接收方删除返回结果
|
||||
* @author xxm
|
||||
* @since 2024/5/21
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
public class AllocReceiverRemoveModel extends DaxPayResponseModel {
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package cn.daxpay.single.sdk.model.allocation;
|
||||
|
||||
import cn.daxpay.single.sdk.net.DaxPayResponseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -12,9 +12,9 @@ import java.util.List;
|
||||
* @author xxm
|
||||
* @since 2024/5/21
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
public class AllocReceiversModel extends DaxPayResponseModel {
|
||||
|
||||
/** 接收方列表 */
|
||||
|
@@ -12,11 +12,15 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class AllocationModel extends DaxPayResponseModel {
|
||||
|
||||
/** 分账订单号 */
|
||||
private String allocationNo;
|
||||
|
||||
/** 分账订单号 */
|
||||
private String bizAllocationNo;
|
||||
|
||||
/** 分账状态 */
|
||||
private String status;
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class WxAccessTokenModel extends DaxPayResponseModel {
|
||||
|
||||
/** 微信AccessToken */
|
||||
|
@@ -12,7 +12,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class WxAuthUrlModel extends DaxPayResponseModel {
|
||||
|
||||
/** 微信oauth2授权的url连接 */
|
||||
|
@@ -13,7 +13,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class AllocDetailNoticeModel {
|
||||
|
||||
/** 分账接收方编号 */
|
||||
|
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class AllocNoticeModel extends DaxPayResponseModel {
|
||||
/**
|
||||
* 分账单号
|
||||
|
@@ -15,7 +15,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class PayNoticeModel extends DaxPayResponseModel {
|
||||
|
||||
/** 订单号 */
|
||||
|
@@ -13,7 +13,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class RefundNoticeModel extends DaxPayResponseModel {
|
||||
|
||||
/** 支付订单号 */
|
||||
|
@@ -12,6 +12,6 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class PayCloseModel extends DaxPayResponseModel {
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class PayModel extends DaxPayResponseModel {
|
||||
|
||||
/** 商户订单号 */
|
||||
|
@@ -15,7 +15,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class PayOrderModel extends DaxPayResponseModel {
|
||||
|
||||
|
||||
|
@@ -12,7 +12,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class RefundModel extends DaxPayResponseModel {
|
||||
|
||||
/** 退款号 */
|
||||
|
@@ -16,7 +16,7 @@ import java.math.BigDecimal;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class RefundOrderModel extends DaxPayResponseModel {
|
||||
|
||||
|
||||
|
@@ -12,6 +12,6 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class AllocSyncModel extends DaxPayResponseModel {
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class PaySyncModel extends DaxPayResponseModel {
|
||||
|
||||
/**
|
||||
|
@@ -13,7 +13,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class RefundSyncModel extends DaxPayResponseModel {
|
||||
|
||||
/**
|
||||
|
@@ -11,7 +11,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public abstract class DaxPayResponseModel {
|
||||
|
||||
/** 状态码 */
|
||||
|
@@ -24,7 +24,7 @@ import java.time.LocalDateTime;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class PayParam extends DaxPayRequest<PayModel> {
|
||||
|
||||
/** 商户订单号 */
|
||||
|
@@ -20,7 +20,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
public class RefundParam extends DaxPayRequest<RefundModel> {
|
||||
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package cn.daxpay.single.sdk.allocation;
|
||||
|
||||
import cn.daxpay.single.sdk.code.AllocReceiverTypeEnum;
|
||||
import cn.daxpay.single.sdk.code.PayChannelEnum;
|
||||
import cn.daxpay.single.sdk.code.SignTypeEnum;
|
||||
import cn.daxpay.single.sdk.model.allocation.AllocReceiverAddModel;
|
||||
@@ -11,6 +12,7 @@ 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;
|
||||
|
||||
@@ -44,11 +46,11 @@ public class AllocationReceiverTest {
|
||||
param.setRelationType("user");
|
||||
param.setRelationName("测试");
|
||||
param.setReceiverNo("123456");
|
||||
param.setReceiverType("user");
|
||||
param.setReceiverType(AllocReceiverTypeEnum.ALI_OPEN_ID.getCode());
|
||||
param.setReceiverAccount("123456");
|
||||
DaxPayResult<AllocReceiverAddModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,10 +60,10 @@ public class AllocationReceiverTest {
|
||||
public void remove() {
|
||||
AllocReceiverRemoveParam param = new AllocReceiverRemoveParam();
|
||||
param.setClientIp("127.0.0.1");
|
||||
param.setReceiverNo("123456");
|
||||
param.setReceiverNo("123");
|
||||
DaxPayResult<AllocReceiverRemoveModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,8 +76,8 @@ public class AllocationReceiverTest {
|
||||
param.setClientIp("127.0.0.1");
|
||||
DaxPayResult<AllocReceiversModel> execute = DaxPayKit.execute(param);
|
||||
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -14,6 +14,7 @@ import cn.daxpay.single.sdk.param.allocation.AllocationParam;
|
||||
import cn.daxpay.single.sdk.param.pay.PayParam;
|
||||
import cn.daxpay.single.sdk.response.DaxPayResult;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -48,16 +49,16 @@ public class AllocationTest {
|
||||
param.setTitle("测试手动分账");
|
||||
param.setDescription("这是支付备注");
|
||||
param.setAmount(10000);
|
||||
param.setChannel(PayChannelEnum.UNION_PAY.getCode());
|
||||
param.setChannel(PayChannelEnum.ALI.getCode());
|
||||
param.setMethod(PayMethodEnum.QRCODE.getCode());
|
||||
param.setAttach("{回调参数}");
|
||||
param.setAllocation(true);
|
||||
param.setReturnUrl("https://abc.com/returnurl");
|
||||
param.setNotifyUrl("https://abc.com/callback");
|
||||
// param.setReturnUrl("https://abc.com/returnurl");
|
||||
// param.setNotifyUrl("https://abc.com/callback");
|
||||
|
||||
DaxPayResult<PayModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,12 +79,12 @@ public class AllocationTest {
|
||||
param.setAttach("{回调参数}");
|
||||
param.setAllocation(true);
|
||||
param.setAutoAllocation(true);
|
||||
param.setReturnUrl("https://abc.com/returnurl");
|
||||
param.setNotifyUrl("https://abc.com/callback");
|
||||
// param.setReturnUrl("https://abc.com/returnurl");
|
||||
// param.setNotifyUrl("https://abc.com/callback");
|
||||
|
||||
DaxPayResult<PayModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,18 +96,14 @@ public class AllocationTest {
|
||||
AllocationParam param = new AllocationParam();
|
||||
param.setBizAllocationNo("A"+ RandomUtil.randomNumbers(5));
|
||||
param.setAttach("88899");
|
||||
param.setBizOrderNo("P1717073355992");
|
||||
param.setBizOrderNo("SDK_1717233422418");
|
||||
param.setDescription("测试分账");
|
||||
param.setClientIp("127.0.0.1");
|
||||
|
||||
DaxPayResult<AllocationModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分账完结
|
||||
*/
|
||||
@@ -114,10 +111,10 @@ public class AllocationTest {
|
||||
public void allocationFinish() {
|
||||
// 分账完结参数
|
||||
AllocFinishParam param = new AllocFinishParam();
|
||||
param.setBizAllocationNo("A1213");
|
||||
param.setAllocationNo("DEVA24060117191963000003");
|
||||
|
||||
DaxPayResult<AllocationModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,10 +124,10 @@ public class AllocationTest {
|
||||
public void allocationSync() {
|
||||
// 分账同步参数
|
||||
AllocSyncParam param = new AllocSyncParam();
|
||||
param.setBizAllocationNo("A1213");
|
||||
param.setAllocationNo("DEVA24060117191963000003");
|
||||
|
||||
DaxPayResult<AllocSyncModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import cn.daxpay.single.sdk.net.DaxPayConfig;
|
||||
import cn.daxpay.single.sdk.net.DaxPayKit;
|
||||
import cn.daxpay.single.sdk.param.pay.PayCloseParam;
|
||||
import cn.daxpay.single.sdk.response.DaxPayResult;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -34,6 +35,6 @@ public class PayCloseOrderTest {
|
||||
param.setOrderNo("DEVP24051019404463000001");
|
||||
param.setClientIp("127.0.0.1");
|
||||
DaxPayResult<PayCloseModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import cn.daxpay.single.sdk.net.DaxPayConfig;
|
||||
import cn.daxpay.single.sdk.net.DaxPayKit;
|
||||
import cn.daxpay.single.sdk.param.pay.PaySyncParam;
|
||||
import cn.daxpay.single.sdk.response.DaxPayResult;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -32,8 +33,8 @@ public class PayOrderSyncTest {
|
||||
PaySyncParam param = new PaySyncParam();
|
||||
param.setBizOrderNo("SDK_1715341621498");
|
||||
DaxPayResult<PaySyncModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ import cn.daxpay.single.sdk.net.DaxPayConfig;
|
||||
import cn.daxpay.single.sdk.net.DaxPayKit;
|
||||
import cn.daxpay.single.sdk.param.pay.PayParam;
|
||||
import cn.daxpay.single.sdk.response.DaxPayResult;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -49,7 +50,7 @@ public class PayOrderTest {
|
||||
param.setNotifyUrl("https://abc.com/callback");
|
||||
|
||||
DaxPayResult<PayModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import cn.daxpay.single.sdk.net.DaxPayConfig;
|
||||
import cn.daxpay.single.sdk.net.DaxPayKit;
|
||||
import cn.daxpay.single.sdk.param.refund.RefundSyncParam;
|
||||
import cn.daxpay.single.sdk.response.DaxPayResult;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -34,8 +35,8 @@ public class RefundOrderSyncTest {
|
||||
param.setRefundNo("DEVR24051020530263000002");
|
||||
param.setClientIp("127.0.0.1");
|
||||
DaxPayResult<RefundSyncModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ import cn.daxpay.single.sdk.param.refund.RefundParam;
|
||||
import cn.daxpay.single.sdk.response.DaxPayResult;
|
||||
import cn.daxpay.single.sdk.util.PaySignUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -45,8 +46,8 @@ public class RefundOrderTest {
|
||||
param.setClientIp("127.0.0.1");
|
||||
|
||||
DaxPayResult<RefundModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
System.out.println(PaySignUtil.verifyHmacSha256Sign(execute.getData(), "123456", execute.getData().getSign()));
|
||||
}
|
||||
|
||||
|
@@ -6,6 +6,7 @@ import cn.daxpay.single.sdk.net.DaxPayConfig;
|
||||
import cn.daxpay.single.sdk.net.DaxPayKit;
|
||||
import cn.daxpay.single.sdk.param.pay.QueryPayParam;
|
||||
import cn.daxpay.single.sdk.response.DaxPayResult;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -35,7 +36,7 @@ public class QueryPayOrderTest {
|
||||
param.setClientIp("127.0.0.1");
|
||||
|
||||
DaxPayResult<PayOrderModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import cn.daxpay.single.sdk.net.DaxPayConfig;
|
||||
import cn.daxpay.single.sdk.net.DaxPayKit;
|
||||
import cn.daxpay.single.sdk.param.refund.QueryRefundParam;
|
||||
import cn.daxpay.single.sdk.response.DaxPayResult;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -35,7 +36,7 @@ public class QueryRefundOrderTest {
|
||||
param.setClientIp("127.0.0.1");
|
||||
|
||||
DaxPayResult<RefundOrderModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(execute);
|
||||
System.out.println(execute.getData());
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
System.out.println(JSONUtil.toJsonStr(execute.getData()));
|
||||
}
|
||||
}
|
||||
|
@@ -5,8 +5,10 @@ import cn.bootx.platform.common.core.rest.Res;
|
||||
import cn.bootx.platform.common.core.rest.ResResult;
|
||||
import cn.bootx.platform.common.core.rest.dto.LabelValue;
|
||||
import cn.bootx.platform.common.core.rest.param.PageParam;
|
||||
import cn.daxpay.single.code.PaymentApiCode;
|
||||
import cn.daxpay.single.param.payment.allocation.AllocReceiverAddParam;
|
||||
import cn.daxpay.single.param.payment.allocation.AllocReceiverRemoveParam;
|
||||
import cn.daxpay.single.service.annotation.InitPaymentContext;
|
||||
import cn.daxpay.single.service.core.payment.allocation.service.AllocationReceiverService;
|
||||
import cn.daxpay.single.service.dto.allocation.AllocationReceiverDto;
|
||||
import cn.daxpay.single.service.param.allocation.receiver.AllocationReceiverQuery;
|
||||
@@ -60,6 +62,7 @@ public class AllocationReceiverController {
|
||||
return Res.ok(receiverService.findReceiverTypeByChannel(channel));
|
||||
}
|
||||
|
||||
@InitPaymentContext(value = PaymentApiCode.ALLOCATION_RECEIVER_ADD)
|
||||
@Operation(summary = "添加")
|
||||
@PostMapping("add")
|
||||
public ResResult<Void> add(@RequestBody AllocReceiverAddParam param){
|
||||
@@ -67,6 +70,7 @@ public class AllocationReceiverController {
|
||||
return Res.ok();
|
||||
}
|
||||
|
||||
@InitPaymentContext(value = PaymentApiCode.ALLOCATION_RECEIVER_REMOVE)
|
||||
@Operation(summary = "删除")
|
||||
@PostMapping("delete")
|
||||
public ResResult<Void> delete(@RequestBody AllocReceiverRemoveParam param){
|
||||
|
@@ -40,7 +40,7 @@ public interface PaymentApiCode {
|
||||
String GET_WX_AUTH_URL = "getWxAuthUrl";
|
||||
/** 获取微信AccessToken */
|
||||
String GET_WX_ACCESS_TOKEN = "getWxAccessToken";
|
||||
/** 添加分账方接口 */
|
||||
/** 添加分账方 */
|
||||
String ALLOCATION_RECEIVER_ADD = "allocationReceiverAdd";
|
||||
/** 删除分账方 */
|
||||
String ALLOCATION_RECEIVER_REMOVE = "allocationReceiverRemove";
|
||||
|
@@ -1,16 +1,19 @@
|
||||
package cn.daxpay.single.param.payment.allocation;
|
||||
|
||||
import cn.daxpay.single.param.PaymentCommonParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 分账同步请求参数
|
||||
* @author xxm
|
||||
* @since 2024/4/12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Schema(title = "分账同步请求参数")
|
||||
public class AllocSyncParam {
|
||||
public class AllocSyncParam extends PaymentCommonParam {
|
||||
|
||||
@Schema(description = "分账号")
|
||||
private String allocationNo;
|
||||
|
@@ -15,7 +15,7 @@ import org.slf4j.MDC;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DaxResult<T> extends ResResult<T> {
|
||||
|
||||
|
@@ -17,9 +17,15 @@ import lombok.experimental.Accessors;
|
||||
@Schema(title = "分账请求结果")
|
||||
public class AllocationResult extends PaymentCommonResult {
|
||||
|
||||
/** 分账订单号 */
|
||||
@Schema(description = "分账订单号")
|
||||
private String allocationNo;
|
||||
|
||||
/** 商户分账订单号 */
|
||||
@Schema(description = "商户分账订单号")
|
||||
private String bizAllocationNo;
|
||||
|
||||
/** 分账状态 */
|
||||
@Schema(description = "分账状态")
|
||||
private String status;
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ public class UniAllocationController {
|
||||
|
||||
@PaymentSign
|
||||
@InitPaymentContext(PaymentApiCode.ALLOCATION_RECEIVER_ADD)
|
||||
@Operation(summary = "添加分账接收方接口")
|
||||
@Operation(summary = "分账接收方添加接口")
|
||||
@PostMapping("/receiver/add")
|
||||
public DaxResult<AllocReceiverAddResult> receiverAdd(@RequestBody AllocReceiverAddParam param){
|
||||
return DaxRes.ok(receiverService.addAndSync(param));
|
||||
@@ -65,7 +65,7 @@ public class UniAllocationController {
|
||||
|
||||
@PaymentSign
|
||||
@InitPaymentContext(PaymentApiCode.ALLOCATION_RECEIVER_REMOVE)
|
||||
@Operation(summary = "删除分账接收方接口")
|
||||
@Operation(summary = "分账接收方删除接口")
|
||||
@PostMapping("/receiver/remove")
|
||||
public DaxResult<AllocReceiverRemoveResult> receiverRemove(@RequestBody AllocReceiverRemoveParam param){
|
||||
return DaxRes.ok(receiverService.remove(param));
|
||||
|
@@ -144,7 +144,7 @@ public class AllocationReceiverService {
|
||||
AllocationReceiver receiver = allocationReceiverManager.findByReceiverNo(param.getReceiverNo())
|
||||
.orElseThrow(() -> new PayFailureException("该接收方不存在"));
|
||||
if (groupReceiverManager.isUsed(receiver.getId())){
|
||||
throw new PayFailureException("该接收方已被使用删除");
|
||||
throw new PayFailureException("该接收方已被使用,无法被删除");
|
||||
}
|
||||
// 获取策略
|
||||
PayChannelEnum channelEnum = PayChannelEnum.findByCode(receiver.getChannel());
|
||||
|
@@ -111,6 +111,7 @@ public class AllocationService {
|
||||
if (Objects.equals(order.getStatus(),AllocOrderStatusEnum.IGNORE.getCode())){
|
||||
return new AllocationResult()
|
||||
.setAllocationNo(order.getAllocationNo())
|
||||
.setBizAllocationNo(order.getBizAllocationNo())
|
||||
.setStatus(order.getStatus());
|
||||
}
|
||||
|
||||
@@ -140,6 +141,7 @@ public class AllocationService {
|
||||
allocationOrderManager.updateById(order);
|
||||
return new AllocationResult()
|
||||
.setAllocationNo(order.getAllocationNo())
|
||||
.setBizAllocationNo(order.getBizAllocationNo())
|
||||
.setStatus(order.getStatus());
|
||||
} finally {
|
||||
lockTemplate.releaseLock(lock);
|
||||
@@ -188,6 +190,7 @@ public class AllocationService {
|
||||
allocationOrderManager.updateById(order);
|
||||
return new AllocationResult()
|
||||
.setAllocationNo(order.getAllocationNo())
|
||||
.setBizAllocationNo(order.getBizAllocationNo())
|
||||
.setStatus(order.getStatus());
|
||||
} finally {
|
||||
lockTemplate.releaseLock(lock);
|
||||
@@ -241,6 +244,7 @@ public class AllocationService {
|
||||
allocationOrderManager.updateById(allocationOrder);
|
||||
return new AllocationResult()
|
||||
.setAllocationNo(allocationOrder.getAllocationNo())
|
||||
.setBizAllocationNo(allocationOrder.getBizAllocationNo())
|
||||
.setStatus(allocationOrder.getStatus());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user