Pārlūkot izejas kodu

微信app支付返回值调整

huangct 8 gadi atpakaļ
vecāks
revīzija
2d8857e4ac

+ 3 - 3
donate-service/src/main/java/com/uas/service/donate/controller/WxpayController.java

@@ -257,7 +257,7 @@ public class WxpayController {
      */
     @ResponseBody
     @RequestMapping(value = "/appPay", method = RequestMethod.POST)
-    public String appPay(@RequestParam("jsonStr") String jsonStr, HttpServletRequest request, HttpServletResponse response) throws Exception {
+    public JSONObject appPay(@RequestParam("jsonStr") String jsonStr, HttpServletRequest request, HttpServletResponse response) throws Exception {
         JSONObject jsonObject = new JSONObject();
         ProjectRecode projectRecode= null;
         try {
@@ -265,7 +265,7 @@ public class WxpayController {
         } catch (Exception e) {
             logger.error("生成商户订单错误,原因:{}", e.getMessage());
             jsonObject.put("error", "参数错误");
-            return jsonObject.toJSONString();
+            return jsonObject;
         }
 
         WxPayConfig wxPayConfig = wxPayApi.getConfig();
@@ -309,7 +309,7 @@ public class WxpayController {
 
             jsonObject.put("sign", packageSign);
         }
-        return jsonObject.toJSONString();
+        return jsonObject;
     }