退款功能BUG修复(商户提现后余额不足时进行退款,微信支付返回异常后订单处于退款中的状态,未重置到未退款的状态)
parent
cb28d6ba4e
commit
f3087008d4
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.pay.config.WxPayOneAutoConfiguration;
|
||||||
import cn.iocoder.yudao.framework.pay.properties.WxPayProperties;
|
import cn.iocoder.yudao.framework.pay.properties.WxPayProperties;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||||
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
||||||
|
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderMapper;
|
||||||
import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse;
|
import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse;
|
||||||
import cn.iocoder.yudao.module.shop.utils.OrderUtil;
|
import cn.iocoder.yudao.module.shop.utils.OrderUtil;
|
||||||
import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
|
import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
|
||||||
|
@ -42,6 +43,9 @@ public class WxPayStrategy implements IPayStrategy{
|
||||||
@Autowired
|
@Autowired
|
||||||
private TenantApi tenantApi;
|
private TenantApi tenantApi;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RechargeOrderMapper rechargeOrderMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InitOrderResponse pay(RechargeOrderDO orderDO, HttpServletRequest servletRequest,String openid) {
|
public InitOrderResponse pay(RechargeOrderDO orderDO, HttpServletRequest servletRequest,String openid) {
|
||||||
Long requiredTenantId = TenantContextHolder.getRequiredTenantId();
|
Long requiredTenantId = TenantContextHolder.getRequiredTenantId();
|
||||||
|
@ -90,6 +94,10 @@ public class WxPayStrategy implements IPayStrategy{
|
||||||
log.info("退款回调[{}]", JSONUtil.toJsonPrettyStr(wxPayRefundV3Request));
|
log.info("退款回调[{}]", JSONUtil.toJsonPrettyStr(wxPayRefundV3Request));
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error(e.getMessage(),e);
|
log.error(e.getMessage(),e);
|
||||||
|
|
||||||
|
// 退款异常后将充值订单状态重置为未退款(维护阶段,暂不考虑优化代码)
|
||||||
|
orderDO.setRefundStatus(0);
|
||||||
|
rechargeOrderMapper.updateById(orderDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue