Browse Source

微信支付回调

igl 6 months ago
parent
commit
dd6e68755f

+ 2 - 4
src/main/java/com/chelvc/cloud/maintain/controller/OmsOrderController.java

@@ -41,7 +41,7 @@ public class OmsOrderController {
     private final OmsOrderClient omsOrderClient;
     private final OmsOrderClient omsOrderClient;
     private final OmsOrderReturnApplyClient omsOrderReturnApplyClient;
     private final OmsOrderReturnApplyClient omsOrderReturnApplyClient;
 
 
-    private final ApplicationContext applicationContext;
+    private final WechatPaymentHandler wechatPaymentHandler;
 
 
 
 
     /**
     /**
@@ -117,10 +117,8 @@ public class OmsOrderController {
     @PostMapping("/order/{name}/callback")
     @PostMapping("/order/{name}/callback")
     public void paySuccess(@PathVariable("name") String name,
     public void paySuccess(@PathVariable("name") String name,
                            @RequestBody String body, HttpServletResponse response) throws IOException {
                            @RequestBody String body, HttpServletResponse response) throws IOException {
-
-        WechatPaymentHandler wechatPaymentHandler = applicationContext.getBean(WechatPaymentHandler.class);
         //获取支付回调信息
         //获取支付回调信息
-        WechatPaymentCallback callback = wechatPaymentHandler.callback(name, body);
+        WechatPaymentCallback callback = this.wechatPaymentHandler.callback(name, body);
         if(callback == null){
         if(callback == null){
             return;
             return;
         }
         }