mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-02 18:46:29 +00:00
feat 调式转账接口
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# CHANGELOG
|
||||
## [v2.0.8]
|
||||
## [v2.0.8] 2024-06-27
|
||||
- 新增: 撤销接口
|
||||
- 新增: 转账功能
|
||||
- 新增: DEMO增加转账演示功能
|
||||
@@ -31,7 +31,7 @@
|
||||
- fix: 退款回调消息字段不一致导致验签不通过问题
|
||||
- fix: 云闪付空指针问题
|
||||
|
||||
## [v2.0.7]
|
||||
## [v2.0.7] 2024-06-05
|
||||
- 新增: 资金流水记录功能
|
||||
- 新增: 分账功能支持分账组分账和自己传接收方进行分账
|
||||
- 新增: 分账接收的添加、删除、查询接口调用
|
||||
@@ -39,7 +39,7 @@
|
||||
- 新增: 支持自动分账和手动发起分账两种
|
||||
- 新增: 分账通知发送功能
|
||||
- 优化: 对超时订单进行处理(数据库定时同步)
|
||||
- 优化: 订单金额小于0.01元直接忽略不进行分账,增加新状态,
|
||||
- 优化: 订单金额小于0.01元直接忽略不进行分账,增加新状态,
|
||||
- 优化: 优化签名注解和上下文初始化注解切面
|
||||
- 优化: 分账重试会自动根据分账失败和
|
||||
- 优化: 优化签名注解和上下文初始化注解切面, 更方便初始化上下文
|
||||
@@ -50,7 +50,7 @@
|
||||
- fix: 支付和退款消息签名值不一致问题
|
||||
- fix: 分账发起时错误的使用订单号作为分账号
|
||||
|
||||
## [v2.0.6]
|
||||
## [v2.0.6] 2024-05-15
|
||||
- 新增: 下载原始对账单功能,转换为指定格式进行下载
|
||||
- 新增: 增加对账结果计算和显示,以及对单差异数据查看功能
|
||||
- 新增: 自动分账功能,支付完成后自动根据默认分账组将订单分账
|
||||
@@ -68,7 +68,7 @@
|
||||
- 优化: 基础脚手架从jar集成修改为源码集成
|
||||
- fix: 自动同步任务不生效
|
||||
- fix: 算收款金额时对产生退款的支付订单未进行计算
|
||||
## [v2.0.5]
|
||||
## [v2.0.5] 2024-04-18
|
||||
- 新增: 支持支付宝分账功能
|
||||
- 新增: 支持微信分账功能
|
||||
- 新增: 分账接收者和分账组管理
|
||||
@@ -77,7 +77,7 @@
|
||||
- 新增: SDK支持分账接口
|
||||
- 优化: 收银台演示支持设置是否分账
|
||||
- fix: 修复创建支付订单报错时, 订单保存数据不完整
|
||||
## [v2.0.4]
|
||||
## [v2.0.4] 2024-03-26
|
||||
- 新增: 首页驾驶舱功能: 各通道收入和支付情况
|
||||
- 新增: 云闪付支持对账功能
|
||||
- 新增: 对账文件支持手动导入
|
||||
@@ -87,20 +87,20 @@
|
||||
- 优化: 前端列表状态显示优化
|
||||
- fix: 对账订单流水号生成规则不是按天生成修改
|
||||
|
||||
## [v2.0.3]
|
||||
## [v2.0.3] 2024-03-16
|
||||
- 增加云闪付通道,支持支付、退款、同步、回调处理
|
||||
- 增加定时同步退款中的退款订单任务
|
||||
- 增加通知任务订单的状态类型,例如订单关闭、成功、失败等
|
||||
- 增加退款操作支持重试
|
||||
- 增加手动触发通知任务消息的发送功能
|
||||
|
||||
## [v2.0.2]
|
||||
## [v2.0.2] 2024-03-06
|
||||
- 增加微信支付对账功能
|
||||
- 增加支付宝支付对账功能
|
||||
- 优化: 修复策略对订单时间和状态字段的变更优化
|
||||
- fix: 前端支付订单查询条件中"支付ID"条件不生效
|
||||
|
||||
## [v2.0.1]
|
||||
## [v2.0.1] 2024-02-27
|
||||
- 增加支付、退款时客户通知功能,支持多次重发
|
||||
- 开源文档增加支付通知和退款通知文档
|
||||
- 增加客户通知任务记录功能
|
||||
@@ -121,7 +121,7 @@
|
||||
- fix: 修复简单退款选择全部退款时报错问题
|
||||
- fix: 修复退款时未检验退款金额问题,导致可以退款余额可以大于可退余额
|
||||
|
||||
## [v2.0.0]
|
||||
## [v2.0.0] 2024-02-14
|
||||
- 支持支付宝支付: 扫码支付、付款码支付、PC支付、H5支付
|
||||
- 支持微信支付: 扫码支付、WAP支付、公众号支付
|
||||
- 增加聚合支付演示功能,支持支付宝和微信支付
|
||||
|
@@ -1,16 +1,16 @@
|
||||
package cn.bootx.platform.starter.audit.log.handler;
|
||||
|
||||
import cn.bootx.platform.common.headerholder.HeaderHolder;
|
||||
import cn.bootx.platform.starter.audit.log.service.OperateLogService;
|
||||
import cn.bootx.platform.common.core.annotation.OperateLog;
|
||||
import cn.bootx.platform.common.core.annotation.OperateLogs;
|
||||
import cn.bootx.platform.common.core.code.ServletCode;
|
||||
import cn.bootx.platform.common.core.entity.UserDetail;
|
||||
import cn.bootx.platform.common.headerholder.HeaderHolder;
|
||||
import cn.bootx.platform.common.jackson.util.JacksonUtil;
|
||||
import cn.bootx.platform.common.spring.util.AopUtil;
|
||||
import cn.bootx.platform.common.spring.util.WebServletUtil;
|
||||
import cn.bootx.platform.starter.audit.log.ip2region.IpToRegionService;
|
||||
import cn.bootx.platform.starter.audit.log.param.OperateLogParam;
|
||||
import cn.bootx.platform.starter.audit.log.service.OperateLogService;
|
||||
import cn.bootx.platform.starter.auth.util.SecurityUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
|
@@ -4,7 +4,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 转账类型注解
|
||||
* 转账类型 微信使用
|
||||
* @author xxm
|
||||
* @since 2024/6/6
|
||||
*/
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.daxpay.single.sdk.model.notice;
|
||||
|
||||
import cn.daxpay.single.core.code.RefundStatusEnum;
|
||||
import cn.daxpay.single.sdk.code.PayChannelEnum;
|
||||
import cn.daxpay.single.sdk.code.RefundStatusEnum;
|
||||
import cn.daxpay.single.sdk.net.DaxPayResponseModel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
@@ -30,7 +30,7 @@ public class QueryTransferParam extends DaxPayRequest<TransferOrderModel> {
|
||||
*/
|
||||
@Override
|
||||
public String path() {
|
||||
return "/unipay/query/transfer";
|
||||
return "/unipay/query/transferOrder";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -0,0 +1,41 @@
|
||||
package cn.daxpay.single.sdk.query;
|
||||
|
||||
import cn.daxpay.single.sdk.code.SignTypeEnum;
|
||||
import cn.daxpay.single.sdk.model.transfer.TransferOrderModel;
|
||||
import cn.daxpay.single.sdk.net.DaxPayConfig;
|
||||
import cn.daxpay.single.sdk.net.DaxPayKit;
|
||||
import cn.daxpay.single.sdk.param.transfer.QueryTransferParam;
|
||||
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/30
|
||||
*/
|
||||
public class QueryTransferOrderTest {
|
||||
@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 testTransfer() {
|
||||
|
||||
QueryTransferParam param = new QueryTransferParam();
|
||||
|
||||
param.setBizTransferNo("T1719214156174");
|
||||
param.setClientIp("127.0.0.1");
|
||||
|
||||
DaxPayResult<TransferOrderModel> execute = DaxPayKit.execute(param);
|
||||
System.out.println(JSONUtil.toJsonStr(execute));
|
||||
}
|
||||
}
|
@@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@@ -63,16 +64,17 @@ public class TransferParam extends PaymentCommonParam {
|
||||
@Schema(description = "转账类型, 微信使用")
|
||||
private String transferType;
|
||||
|
||||
|
||||
/**
|
||||
* 收款人账号类型
|
||||
* @see TransferPayeeTypeEnum
|
||||
*/
|
||||
@NotBlank(message = "收款人账号类型必填")
|
||||
@Size(max = 20, message = "收款人账号类型不可超过20位")
|
||||
@Schema(description = "收款人账号类型")
|
||||
private String payeeType;
|
||||
|
||||
/** 收款人账号 */
|
||||
@NotBlank(message = "收款人账号必填")
|
||||
@Size(max = 100, message = "收款人账号不可超过100位")
|
||||
@Schema(description = "收款人账号")
|
||||
private String payeeAccount;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package cn.daxpay.single.service.core.payment.pay.service;
|
||||
|
||||
import cn.daxpay.single.core.exception.PayFailureException;
|
||||
import cn.daxpay.single.core.exception.TradeProcessingException;
|
||||
import cn.daxpay.single.core.param.payment.pay.PayParam;
|
||||
import cn.daxpay.single.core.result.pay.PayResult;
|
||||
@@ -97,7 +98,12 @@ public class PayService {
|
||||
// 支付操作
|
||||
payStrategy.doPayHandler();
|
||||
} catch (Exception e) {
|
||||
payOrder.setErrorMsg(e.getMessage());
|
||||
// 记录错误原因, 此处没有事务, 所以可以正常更新
|
||||
if (e instanceof PayFailureException){
|
||||
payOrder.setErrorCode(e.getMessage());
|
||||
} else {
|
||||
payOrder.setErrorCode("支付出现异常");
|
||||
}
|
||||
// 这个方法没有事务, 所以可以正常更新
|
||||
payOrderService.updateById(payOrder);
|
||||
throw e;
|
||||
@@ -149,7 +155,11 @@ public class PayService {
|
||||
payStrategy.doPayHandler();
|
||||
} catch (Exception e) {
|
||||
// 记录错误原因, 此处没有事务, 所以可以正常更新
|
||||
payOrder.setErrorMsg(e.getMessage());
|
||||
if (e instanceof PayFailureException){
|
||||
payOrder.setErrorCode(e.getMessage());
|
||||
} else {
|
||||
payOrder.setErrorCode("支付出现异常");
|
||||
}
|
||||
payOrderService.updateById(payOrder);
|
||||
throw e;
|
||||
}
|
||||
|
Reference in New Issue
Block a user