mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-10-14 13:50:25 +00:00
fix: 微信V2退款回调时间格式处理错误
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package org.dromara.daxpay.channel.wechat.service.callback;
|
package org.dromara.daxpay.channel.wechat.service.callback;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import org.dromara.daxpay.channel.wechat.code.WechatPayCode;
|
import org.dromara.daxpay.channel.wechat.code.WechatPayCode;
|
||||||
import org.dromara.daxpay.channel.wechat.entity.config.WechatPayConfig;
|
import org.dromara.daxpay.channel.wechat.entity.config.WechatPayConfig;
|
||||||
import org.dromara.daxpay.channel.wechat.service.config.WechatPayConfigService;
|
import org.dromara.daxpay.channel.wechat.service.config.WechatPayConfigService;
|
||||||
@@ -28,6 +30,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@@ -143,7 +146,8 @@ public class WechatRefundCallbackService {
|
|||||||
callbackInfo.setAmount(PayUtil.conversionAmount(result.getRefundFee()));
|
callbackInfo.setAmount(PayUtil.conversionAmount(result.getRefundFee()));
|
||||||
String timeEnd = result.getSuccessTime();
|
String timeEnd = result.getSuccessTime();
|
||||||
if (StrUtil.isNotBlank(timeEnd)){
|
if (StrUtil.isNotBlank(timeEnd)){
|
||||||
callbackInfo.setFinishTime(WechatPayUtil.parseV2(timeEnd));
|
LocalDateTime finishTime = LocalDateTimeUtil.parse(timeEnd, DatePattern.NORM_DATETIME_PATTERN);
|
||||||
|
callbackInfo.setFinishTime(finishTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,21 +1,23 @@
|
|||||||
package org.dromara.daxpay.channel.wechat.service.sync.refund;
|
package org.dromara.daxpay.channel.wechat.service.sync.refund;
|
||||||
|
|
||||||
import org.dromara.daxpay.channel.wechat.entity.config.WechatPayConfig;
|
|
||||||
import org.dromara.daxpay.channel.wechat.service.config.WechatPayConfigService;
|
|
||||||
import org.dromara.daxpay.channel.wechat.util.WechatPayUtil;
|
|
||||||
import org.dromara.daxpay.core.enums.RefundStatusEnum;
|
|
||||||
import org.dromara.daxpay.core.util.PayUtil;
|
|
||||||
import org.dromara.daxpay.service.bo.sync.RefundSyncResultBo;
|
|
||||||
import org.dromara.daxpay.service.entity.order.refund.RefundOrder;
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import com.github.binarywang.wxpay.bean.request.WxPayRefundQueryRequest;
|
import com.github.binarywang.wxpay.bean.request.WxPayRefundQueryRequest;
|
||||||
import com.github.binarywang.wxpay.constant.WxPayConstants.RefundStatus;
|
import com.github.binarywang.wxpay.constant.WxPayConstants.RefundStatus;
|
||||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||||
import com.github.binarywang.wxpay.service.WxPayService;
|
import com.github.binarywang.wxpay.service.WxPayService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.daxpay.channel.wechat.entity.config.WechatPayConfig;
|
||||||
|
import org.dromara.daxpay.channel.wechat.service.config.WechatPayConfigService;
|
||||||
|
import org.dromara.daxpay.core.enums.RefundStatusEnum;
|
||||||
|
import org.dromara.daxpay.core.util.PayUtil;
|
||||||
|
import org.dromara.daxpay.service.bo.sync.RefundSyncResultBo;
|
||||||
|
import org.dromara.daxpay.service.entity.order.refund.RefundOrder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,8 +53,9 @@ public class WechatRefundSyncV2Service {
|
|||||||
var record = result.getRefundRecords().getFirst();
|
var record = result.getRefundRecords().getFirst();
|
||||||
// 退款状态 - 成功
|
// 退款状态 - 成功
|
||||||
if (Objects.equals(RefundStatus.SUCCESS, record.getRefundStatus())){
|
if (Objects.equals(RefundStatus.SUCCESS, record.getRefundStatus())){
|
||||||
|
LocalDateTime finishTime = LocalDateTimeUtil.parse(record.getRefundSuccessTime(), DatePattern.NORM_DATETIME_PATTERN);
|
||||||
syncResult.setRefundStatus(RefundStatusEnum.SUCCESS)
|
syncResult.setRefundStatus(RefundStatusEnum.SUCCESS)
|
||||||
.setFinishTime(WechatPayUtil.parseV2(record.getRefundSuccessTime()));
|
.setFinishTime(finishTime);
|
||||||
}
|
}
|
||||||
// 退款状态 - 退款关闭
|
// 退款状态 - 退款关闭
|
||||||
if (Objects.equals(RefundStatus.REFUND_CLOSE, record.getRefundStatus())){
|
if (Objects.equals(RefundStatus.REFUND_CLOSE, record.getRefundStatus())){
|
||||||
|
Reference in New Issue
Block a user