mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-07 21:17:42 +00:00
fix: 修复简单退款选择全部退款时报错问题
This commit is contained in:
@@ -127,9 +127,10 @@ public class RefundAssistService {
|
||||
throw new PayFailureException("当前状态["+statusEnum.getName()+"]不允许发起退款操作");
|
||||
}
|
||||
|
||||
// 过滤掉金额为0的退款参数
|
||||
// 过滤掉金额为空和0的退款参数
|
||||
List<RefundChannelParam> channelParams = param.getRefundChannels()
|
||||
.stream()
|
||||
.filter(r -> Objects.nonNull(r.getAmount()))
|
||||
.filter(r -> r.getAmount() > 0)
|
||||
.collect(Collectors.toList());
|
||||
param.setRefundChannels(channelParams);
|
||||
|
@@ -74,8 +74,10 @@ public class RefundService {
|
||||
// 构建退款参数
|
||||
RefundParam refundParam = new RefundParam();
|
||||
BeanUtil.copyProperties(param,refundParam);
|
||||
RefundChannelParam channelParam = new RefundChannelParam().setAmount(param.getAmount());
|
||||
refundParam.setRefundChannels(Collections.singletonList(channelParam));
|
||||
if (!param.isRefundAll()){
|
||||
RefundChannelParam channelParam = new RefundChannelParam().setAmount(param.getAmount());
|
||||
refundParam.setRefundChannels(Collections.singletonList(channelParam));
|
||||
}
|
||||
return this.refundAdapter(refundParam,true);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user