From f3087008d498ed98c6b633f180a606b09498928e Mon Sep 17 00:00:00 2001 From: TanGH <409473884@qq.com> Date: Mon, 3 Jul 2023 17:41:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=AC=BE=E5=8A=9F=E8=83=BDBUG?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=88=E5=95=86=E6=88=B7=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E5=90=8E=E4=BD=99=E9=A2=9D=E4=B8=8D=E8=B6=B3=E6=97=B6=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E9=80=80=E6=AC=BE=EF=BC=8C=E5=BE=AE=E4=BF=A1=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E8=BF=94=E5=9B=9E=E5=BC=82=E5=B8=B8=E5=90=8E=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=A4=84=E4=BA=8E=E9=80=80=E6=AC=BE=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E7=8A=B6=E6=80=81=EF=BC=8C=E6=9C=AA=E9=87=8D=E7=BD=AE=E5=88=B0?= =?UTF-8?q?=E6=9C=AA=E9=80=80=E6=AC=BE=E7=9A=84=E7=8A=B6=E6=80=81=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/shop/support/pay/WxPayStrategy.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java index a5f91de06..fc123faab 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java @@ -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.tenant.core.context.TenantContextHolder; 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.utils.OrderUtil; import cn.iocoder.yudao.module.system.api.tenant.TenantApi; @@ -42,6 +43,9 @@ public class WxPayStrategy implements IPayStrategy{ @Autowired private TenantApi tenantApi; + @Autowired + private RechargeOrderMapper rechargeOrderMapper; + @Override public InitOrderResponse pay(RechargeOrderDO orderDO, HttpServletRequest servletRequest,String openid) { Long requiredTenantId = TenantContextHolder.getRequiredTenantId(); @@ -90,6 +94,10 @@ public class WxPayStrategy implements IPayStrategy{ log.info("退款回调[{}]", JSONUtil.toJsonPrettyStr(wxPayRefundV3Request)); }catch (Exception e){ log.error(e.getMessage(),e); + + // 退款异常后将充值订单状态重置为未退款(维护阶段,暂不考虑优化代码) + orderDO.setRefundStatus(0); + rechargeOrderMapper.updateById(orderDO); } }