瀏覽代碼

微信app支付返回值调整

huangct 8 年之前
父節點
當前提交
2d8857e4ac
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      donate-service/src/main/java/com/uas/service/donate/controller/WxpayController.java

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

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