From c3fb56bd3cc141875b3ff2a6b893e9cbca0d11a9 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Wed, 01 Nov 2023 17:15:38 +0800
Subject: [PATCH] 用户收益列表

---
 src/main/java/cc/mrbird/febs/pay/controller/PayCallBackController.java |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/pay/controller/PayCallBackController.java b/src/main/java/cc/mrbird/febs/pay/controller/PayCallBackController.java
index 4b09e49..a3e1bc2 100644
--- a/src/main/java/cc/mrbird/febs/pay/controller/PayCallBackController.java
+++ b/src/main/java/cc/mrbird/febs/pay/controller/PayCallBackController.java
@@ -2,11 +2,18 @@
 
 import cc.mrbird.febs.pay.properties.AliPayProperties;
 import cc.mrbird.febs.pay.service.AliIPayService;
+import cc.mrbird.febs.pay.service.IPayService;
 import com.alipay.api.AlipayApiException;
 import com.alipay.api.internal.util.AlipaySignature;
+import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
+import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
+import com.github.binarywang.wxpay.exception.WxPayException;
+import com.github.binarywang.wxpay.service.WxPayService;
 import com.ijpay.alipay.AliPayApi;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -28,6 +35,13 @@
 
     @Resource
     private AliPayProperties aliPayProperties;
+
+    @Autowired
+    private WxPayService wxPayService;
+//    private WxPayService wxPayService = new com.github.binarywang.wxpay.service.impl.WxPayServiceImpl();
+
+    @Autowired
+    private IPayService wechatPayService;
 
     @RequestMapping("/aliCallBack")
     public String aliPayCallBack(HttpServletRequest request){
@@ -55,4 +69,13 @@
             return "failure";
         }
     }
+
+    @PostMapping(value = "/wxPayCallBack")
+    public String wxPayCallBack(@RequestBody String xmlData) throws WxPayException {
+        log.info("=======微信回调:{}========", xmlData);
+        WxPayOrderNotifyResult notifyResult = this.wxPayService.parseOrderNotifyResult(xmlData);
+
+        wechatPayService.payCallback(notifyResult.toMap());
+        return WxPayNotifyResponse.success("成功");
+    }
 }

--
Gitblit v1.9.1