diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java index 1991772e..94f1950b 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java @@ -89,12 +89,14 @@ public class OrderController { } JSONObject jsonObject = JSONObject.parseObject(reqBodyStr); Long orderId = jsonObject.getLong("orderId"); - String openId = jsonObject.getString("openId"); // openId - if ( orderId == null || StringUtils.isBlank(openId)) { + String orderType = jsonObject.getString("orderScene"); // 订单类型 + String openId = jsonObject.getString("openId"); // openId + if ( orderId == null || StringUtils.isBlank(orderType) || StringUtils.isBlank(openId)) { log.error("orderToPay error!", "参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } + HighOrder order = highOrderService.getOrderById(orderId); if(order == null) { log.error("OrderController --> orderToPay() ERROR", "未找到订单信息"); @@ -142,7 +144,7 @@ public class OrderController { weChatPayReqInfo.setSpbill_create_ip("139.159.177.244"); //终端ip weChatPayReqInfo.setNotify_url(SysConst.getSysConfig().getNotifyUrl()); //通知url weChatPayReqInfo.setTrade_type("JSAPI"); //交易类型 - // weChatPayReqInfo.setAttach(map.get("orderScene").toString()); //附加数据,区分订单类型 + weChatPayReqInfo.setAttach(map.get("orderScene").toString()); //附加数据,区分订单类型 Map payMap = new HashMap<>(); payMap.put("app_id",SysConst.getSysConfig().getWxSubAppId()); diff --git a/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java b/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java index b1a6dd6f..11eea92d 100644 --- a/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java +++ b/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java @@ -3,7 +3,6 @@ package com.hai.common.pay.entity; public enum OrderType { // 建议将支付频率高的模块放在前面 GOODS_ORDER("GOODS_ORDER", "goodsOrderService", "购买商品"), - GOLD("GOLD", "", "金币充值"), TEST("TEST", "testPayService", "支付测试") ;