From 519701e999a6c86a77cb052c540bf01455e1674e Mon Sep 17 00:00:00 2001 From: hupeng Date: Mon, 10 Aug 2020 10:26:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=80=80=E6=AC=BE=E6=88=96?= =?UTF-8?q?=E8=80=85=E5=9B=9E=E8=B0=83payserice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/wechat/rest/controller/WechatController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yshop-app/src/main/java/co/yixiang/modules/wechat/rest/controller/WechatController.java b/yshop-app/src/main/java/co/yixiang/modules/wechat/rest/controller/WechatController.java index 6515fe9c..06563373 100644 --- a/yshop-app/src/main/java/co/yixiang/modules/wechat/rest/controller/WechatController.java +++ b/yshop-app/src/main/java/co/yixiang/modules/wechat/rest/controller/WechatController.java @@ -121,6 +121,8 @@ public class WechatController { public String renotify(@RequestBody String xmlData) { try { WxPayService wxPayService = WxPayConfiguration.getPayService(PayMethodEnum.WECHAT); + if(wxPayService == null) wxPayService = WxPayConfiguration.getPayService(PayMethodEnum.WXAPP); + if(wxPayService == null) wxPayService = WxPayConfiguration.getPayService(PayMethodEnum.APP); WxPayOrderNotifyResult notifyResult = wxPayService.parseOrderNotifyResult(xmlData); String orderId = notifyResult.getOutTradeNo(); String attach = notifyResult.getAttach(); @@ -158,6 +160,8 @@ public class WechatController { public String parseRefundNotifyResult(@RequestBody String xmlData) { try { WxPayService wxPayService = WxPayConfiguration.getPayService(PayMethodEnum.WECHAT); + if(wxPayService == null) wxPayService = WxPayConfiguration.getPayService(PayMethodEnum.WXAPP); + if(wxPayService == null) wxPayService = WxPayConfiguration.getPayService(PayMethodEnum.APP); WxPayRefundNotifyResult result = wxPayService.parseRefundNotifyResult(xmlData); String orderId = result.getReqInfo().getOutTradeNo(); BigDecimal refundFee = BigNum.div(result.getReqInfo().getRefundFee(), 100);