mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-04 12:26:24 +08:00
fix 支付订单超时时间不得早于当前时间
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
## 单商户
|
||||
# 单商户
|
||||
## 3.0.0: 功能完善第一阶段
|
||||
- 优化:
|
||||
- [x] 增加延时队列的可视页面
|
||||
@@ -6,8 +6,13 @@
|
||||
- [x] 转账接收方类型优化
|
||||
- [x] 支付/退款/转账商户订单号查询时根据AppId做隔离
|
||||
- [x] 支付通道支持启停用功能
|
||||
- [ ] 支付订单超时时间不得早于当前时间
|
||||
- [x] 支付订单超时时间不得早于当前时间
|
||||
- [ ] 云闪付支付通道对接
|
||||
- [x] 支付
|
||||
- [x] 回调
|
||||
- [x] 退款
|
||||
- [x] 同步
|
||||
- [ ] 对账
|
||||
- [ ] 分账功能
|
||||
- [x] 分账接收方配置
|
||||
- [x] 分账组管理
|
||||
|
||||
@@ -35,6 +35,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 云闪付对账
|
||||
* TODO 目前默认账单除了 S30外都是支付成功状态, 后期需要根据账单类型进行完善
|
||||
* @author xxm
|
||||
* @since 2024/3/7
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package org.dromara.daxpay.service.service.trade.pay;
|
||||
|
||||
import cn.bootx.platform.starter.redis.delay.service.DelayJobService;
|
||||
import cn.bootx.platform.core.exception.ValidationFailedException;
|
||||
import cn.bootx.platform.core.util.BigDecimalUtil;
|
||||
import cn.bootx.platform.core.util.DateTimeUtil;
|
||||
import cn.bootx.platform.starter.redis.delay.service.DelayJobService;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.daxpay.core.enums.PayAllocStatusEnum;
|
||||
import org.dromara.daxpay.core.enums.PayRefundStatusEnum;
|
||||
import org.dromara.daxpay.core.enums.PayStatusEnum;
|
||||
@@ -19,10 +24,6 @@ import org.dromara.daxpay.service.common.local.PaymentContextLocal;
|
||||
import org.dromara.daxpay.service.dao.order.pay.PayOrderManager;
|
||||
import org.dromara.daxpay.service.entity.order.pay.PayOrder;
|
||||
import org.dromara.daxpay.service.service.order.pay.PayOrderQueryService;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -176,4 +177,14 @@ public class PayAssistService {
|
||||
// 根据商户应用配置计算出时间
|
||||
return PayUtil.getPaymentExpiredTime(mchAppLocal.getOrderTimeout());
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验订单超时时间是否正常
|
||||
*/
|
||||
public void validationExpiredTime(PayParam payParam) {
|
||||
LocalDateTime expiredTime = this.getExpiredTime(payParam);
|
||||
if (Objects.nonNull(expiredTime) && DateTimeUtil.lt(LocalDateTime.now(), expiredTime)) {
|
||||
throw new ValidationFailedException("支付超时时间设置有误, 请检查!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ public class PayService {
|
||||
public PayResult pay(PayParam payParam){
|
||||
// 校验支付限额
|
||||
payAssistService.validationLimitAmount(payParam);
|
||||
// 校验超时时间, 不可早于当前
|
||||
payAssistService.validationExpiredTime(payParam);
|
||||
// 获取商户订单号
|
||||
String bizOrderNo = payParam.getBizOrderNo();
|
||||
// 加锁
|
||||
|
||||
Reference in New Issue
Block a user