Browse Source

正式测试环境做区分

yq 3 years ago
parent
commit
6c11c2128a

+ 0 - 3
src/main/java/com/usky/dxtop/common/utils/QRCodeUtil.java

@@ -21,9 +21,6 @@ import com.google.zxing.Result;
 import com.google.zxing.common.BitMatrix;
 import com.google.zxing.common.BitMatrix;
 import com.google.zxing.common.HybridBinarizer;
 import com.google.zxing.common.HybridBinarizer;
 import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
 import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
-import com.usky.dxtop.common.utils.sign.Md5Utils;
-import com.usky.dxtop.common.utils.uuid.UUID;
-import com.usky.dxtop.service.api.TopApi;
 
 
 /**
 /**
  * 二维码生成
  * 二维码生成

+ 5 - 2
src/main/java/com/usky/dxtop/controller/web/TopNotifyController.java

@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.usky.dxtop.model.Order;
 import com.usky.dxtop.model.Order;
 import com.usky.dxtop.service.CallApiLogService;
 import com.usky.dxtop.service.CallApiLogService;
 import com.usky.dxtop.service.OrderService;
 import com.usky.dxtop.service.OrderService;
-import com.usky.dxtop.service.api.TopApi;
+import com.usky.dxtop.service.api.TopApiConfiger;
 import com.usky.dxtop.service.impl.OrderServiceImpl;
 import com.usky.dxtop.service.impl.OrderServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,6 +31,9 @@ public class TopNotifyController {
     @Autowired
     @Autowired
     private CallApiLogService callApiLogService;
     private CallApiLogService callApiLogService;
 
 
+    @Autowired
+    private TopApiConfiger topApiConfiger;
+
     @PostMapping("/notify")
     @PostMapping("/notify")
     public void test(@RequestParam(required = false) String merchantNo,
     public void test(@RequestParam(required = false) String merchantNo,
                      @RequestParam(required = false) String storeNo,
                      @RequestParam(required = false) String storeNo,
@@ -74,7 +77,7 @@ public class TopNotifyController {
             if (null == order){
             if (null == order){
                 log.error("---订单回调"+"订单编号不存在");
                 log.error("---订单回调"+"订单编号不存在");
             }else {
             }else {
-                callApiLogService.saveOrUpdate(merchantOrderNo,OrderServiceImpl.SCAN_PAY, TopApi.SCAN_TO_PAY_URL,null,JSONObject.toJSONString(tMap));
+                callApiLogService.saveOrUpdate(merchantOrderNo,OrderServiceImpl.SCAN_PAY, topApiConfiger.scanPayUrl,null,JSONObject.toJSONString(tMap));
                 orderService.paySuccess(order);
                 orderService.paySuccess(order);
             }
             }
         }catch (Exception e){
         }catch (Exception e){

+ 9 - 7
src/main/java/com/usky/dxtop/controller/web/WxController.java

@@ -7,8 +7,9 @@ import com.usky.dxtop.common.utils.DateUtils;
 import com.usky.dxtop.common.utils.http.HttpUtils;
 import com.usky.dxtop.common.utils.http.HttpUtils;
 import com.usky.dxtop.common.utils.sign.Md5Utils;
 import com.usky.dxtop.common.utils.sign.Md5Utils;
 import com.usky.dxtop.common.utils.uuid.UUID;
 import com.usky.dxtop.common.utils.uuid.UUID;
-import com.usky.dxtop.service.api.TopApi;
+import com.usky.dxtop.service.api.TopApiConfiger;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
@@ -24,15 +25,16 @@ import java.util.TreeMap;
 public class WxController {
 public class WxController {
 
 
     private static final String WX_LOGIN_URL = "https://api.weixin.qq.com/sns/jscode2session";
     private static final String WX_LOGIN_URL = "https://api.weixin.qq.com/sns/jscode2session";
-
+    @Autowired
+    private TopApiConfiger topApiConfiger;
     @GetMapping("/wxLogin")
     @GetMapping("/wxLogin")
     public String wxLogin(@RequestParam String jsCode){
     public String wxLogin(@RequestParam String jsCode){
         TreeMap<String, String> treeMap = new TreeMap<>();
         TreeMap<String, String> treeMap = new TreeMap<>();
-        treeMap.put("appid", TopApi.WX_APP_ID);
-        treeMap.put("secret", TopApi.WX_APP_SECRET);
+        treeMap.put("appid", topApiConfiger.wxAppId);
+        treeMap.put("secret", topApiConfiger.wxAppSecret);
         treeMap.put("js_code", jsCode);
         treeMap.put("js_code", jsCode);
         treeMap.put("grant_type", "authorization_code");
         treeMap.put("grant_type", "authorization_code");
-        String result = HttpUtils.sendGet(WX_LOGIN_URL, TopApi.joinParam(treeMap),null);
+        String result = HttpUtils.sendGet(WX_LOGIN_URL, topApiConfiger.joinParam(treeMap),null);
         JSONObject obj= JSON.parseObject(result);
         JSONObject obj= JSON.parseObject(result);
         log.info("获取到的相应"+obj);
         log.info("获取到的相应"+obj);
         String openId = "";
         String openId = "";
@@ -47,12 +49,12 @@ public class WxController {
     @GetMapping("/wxPayParam")
     @GetMapping("/wxPayParam")
     public String wxPayParam(@RequestParam String payInfo){
     public String wxPayParam(@RequestParam String payInfo){
         TreeMap<String, String> treeMap = new TreeMap<>();
         TreeMap<String, String> treeMap = new TreeMap<>();
-        treeMap.put("appid", TopApi.WX_APP_ID);
+        treeMap.put("appid", topApiConfiger.wxAppId);
         treeMap.put("timeStamp", DateUtils.dateTimeNow());
         treeMap.put("timeStamp", DateUtils.dateTimeNow());
         treeMap.put("nonceStr", UUID.randomUUID().toString(true));
         treeMap.put("nonceStr", UUID.randomUUID().toString(true));
         treeMap.put("package", String.format("prepay_id=%s",payInfo));
         treeMap.put("package", String.format("prepay_id=%s",payInfo));
         treeMap.put("signType", "MD5");
         treeMap.put("signType", "MD5");
-        String format = String.format("%s&key=%s", TopApi.joinParam(treeMap), TopApi.SECRET);
+        String format = String.format("%s&key=%s", topApiConfiger.joinParam(treeMap), topApiConfiger.secret);
         treeMap.put("paySign", Md5Utils.hash(format).toUpperCase());
         treeMap.put("paySign", Md5Utils.hash(format).toUpperCase());
         return JSONObject.toJSONString(treeMap);
         return JSONObject.toJSONString(treeMap);
     }
     }

+ 46 - 33
src/main/java/com/usky/dxtop/service/api/TopApi.java → src/main/java/com/usky/dxtop/service/api/TopApiConfiger.java

@@ -5,6 +5,10 @@ import com.usky.dxtop.common.utils.DateUtils;
 import com.usky.dxtop.common.utils.StringUtils;
 import com.usky.dxtop.common.utils.StringUtils;
 import com.usky.dxtop.common.utils.sign.Md5Utils;
 import com.usky.dxtop.common.utils.sign.Md5Utils;
 import com.usky.dxtop.common.utils.uuid.UUID;
 import com.usky.dxtop.common.utils.uuid.UUID;
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
 
 
 import java.util.Map;
 import java.util.Map;
 import java.util.TreeMap;
 import java.util.TreeMap;
@@ -13,65 +17,74 @@ import java.util.TreeMap;
  * @author yq
  * @author yq
  * @date 2021/8/23 14:50
  * @date 2021/8/23 14:50
  */
  */
-public class TopApi {
+@Data
+@Component
+@ConfigurationProperties(prefix = "toppay")
+public class TopApiConfiger {
 
 
     /**
     /**
      * 版本
      * 版本
      */
      */
-    public static final String VERSION = "v1.0";
-
-    public static final String URL = "https://interfacetest.allinpaygx.com";
-
+    @Value("${toppay.version}")
+    public String version;
     /**
     /**
      * 扫码支付
      * 扫码支付
      */
      */
-    public static final String SCAN_TO_PAY_URL = String.format("%s%s",URL,"/api/access/payInterface/usePaymentCode");
+    @Value("${toppay.scanPayUrl}")
+    public String scanPayUrl;
     /**
     /**
      * 交易查询
      * 交易查询
      */
      */
-    public static final String DEAL_SELECT_URL = String.format("%s%s",URL,"/api/access/payInterface/findOrderInfo");
+    @Value("${toppay.dealSelectUrl}")
+    public  String dealSelectUrl;
 
 
     /**
     /**
      * 统一支付
      * 统一支付
      */
      */
-    public static final String UNIFY_URL = String.format("%s%s",URL,"/api/access/payInterface/unifiedPay");
+    @Value("${toppay.unifyUrl}")
+    public String unifyUrl;
 
 
     /**
     /**
      * 商户编号
      * 商户编号
      */
      */
-    public static final String MERCHANT_NO = "121050000127";
+    @Value("${toppay.merchantNo}")
+    public String merchantNo;
 
 
     /**
     /**
      * 密钥
      * 密钥
      */
      */
-    public static final String SECRET = "MTEODEKT";
+    @Value("${toppay.secret}")
+    public String secret;
 
 
     /**
     /**
      * 回调url
      * 回调url
      */
      */
-    public static final String SCAN_NOTIFY_URL = "https://wx.ewoogi.com/dxapi/top/notify";
+    @Value("${toppay.notifyUrl}")
+    public String notifyUrl;
 
 
     /**
     /**
      * 微信appid
      * 微信appid
      */
      */
-    public static final String WX_APP_ID = "wx40274c2aaec24330";
+    @Value("${toppay.wxAppId}")
+    public String wxAppId;
 
 
     /**
     /**
      * 微信密钥
      * 微信密钥
      */
      */
-    public static final String WX_APP_SECRET = "4b0c04f796a8bed2c2435cc68362b22b";
+    @Value("${toppay.wxAppSecret}")
+    public String wxAppSecret;
 
 
     /**
     /**
      * 拼接扫码支付参数
      * 拼接扫码支付参数
      * @return
      * @return
      */
      */
-    public static TreeMap<String, String> generateScanPayApiParam(String merchantOrderNo, Integer amount, String note,
+    public TreeMap<String, String> generateScanPayApiParam(String merchantOrderNo, Integer amount, String note,
                                                                   String storeNo, String backUrl, String orderNumber,
                                                                   String storeNo, String backUrl, String orderNumber,
                                                                   String validTime, String remark, String goods){
                                                                   String validTime, String remark, String goods){
         TreeMap<String, String> tMap = new TreeMap<>();
         TreeMap<String, String> tMap = new TreeMap<>();
-        tMap.put("version",VERSION);
+        tMap.put("version",version);
         tMap.put("payTime",DateUtils.dateTimeNow());
         tMap.put("payTime",DateUtils.dateTimeNow());
-        tMap.put("merchantNo",MERCHANT_NO);
+        tMap.put("merchantNo",merchantNo);
         tMap.put("merchantOrderNo",merchantOrderNo);
         tMap.put("merchantOrderNo",merchantOrderNo);
         tMap.put("amount",amount.toString());
         tMap.put("amount",amount.toString());
         tMap.put("note",note);
         tMap.put("note",note);
@@ -80,7 +93,7 @@ public class TopApi {
         tMap.put("orderNumber",orderNumber);
         tMap.put("orderNumber",orderNumber);
         tMap.put("validTime",validTime);
         tMap.put("validTime",validTime);
         tMap.put("remark",remark);
         tMap.put("remark",remark);
-        tMap.put("notifyUrl",SCAN_NOTIFY_URL);
+        tMap.put("notifyUrl",notifyUrl);
         tMap.put("goods",goods);
         tMap.put("goods",goods);
         return tMap;
         return tMap;
     }
     }
@@ -93,10 +106,10 @@ public class TopApi {
      * @param groupNo
      * @param groupNo
      * @return
      * @return
      */
      */
-    public static TreeMap<String, String> generateDealSelectParam(String merchantOrderNo,String storeNo,String trxid,String groupNo){
+    public  TreeMap<String, String> generateDealSelectParam(String merchantOrderNo,String storeNo,String trxid,String groupNo){
         TreeMap<String, String> tMap = new TreeMap<>();
         TreeMap<String, String> tMap = new TreeMap<>();
-        tMap.put("version",VERSION);
-        tMap.put("merchantNo",MERCHANT_NO);
+        tMap.put("version",version);
+        tMap.put("merchantNo",merchantNo);
         tMap.put("merchantOrderNo",merchantOrderNo);
         tMap.put("merchantOrderNo",merchantOrderNo);
         tMap.put("storeNo",storeNo);
         tMap.put("storeNo",storeNo);
         tMap.put("trxid",trxid);
         tMap.put("trxid",trxid);
@@ -115,11 +128,11 @@ public class TopApi {
      * @param groupNo
      * @param groupNo
      * @return
      * @return
      */
      */
-    public static TreeMap<String, String> generateReturnDealParam(Integer amount,String orderNo,String oriMerchantOrderNo,
+    public TreeMap<String, String> generateReturnDealParam(Integer amount,String orderNo,String oriMerchantOrderNo,
                                                                   String trxid,String refundType,String remark,String groupNo){
                                                                   String trxid,String refundType,String remark,String groupNo){
         TreeMap<String, String> tMap = new TreeMap<>();
         TreeMap<String, String> tMap = new TreeMap<>();
-        tMap.put("version",VERSION);
-        tMap.put("merchantNo",MERCHANT_NO);
+        tMap.put("version",version);
+        tMap.put("merchantNo",merchantNo);
         tMap.put("amount",amount.toString());
         tMap.put("amount",amount.toString());
         tMap.put("orderNo",orderNo);
         tMap.put("orderNo",orderNo);
         tMap.put("oriMerchantOrderNo",oriMerchantOrderNo);
         tMap.put("oriMerchantOrderNo",oriMerchantOrderNo);
@@ -149,17 +162,17 @@ public class TopApi {
      * @param consumerIp
      * @param consumerIp
      * @return
      * @return
      */
      */
-    public static TreeMap<String, String> generateUnifyParam(String merchantOrderNo,Integer amount,String notifyUrl,
+    public TreeMap<String, String> generateUnifyParam(String merchantOrderNo,Integer amount,String notifyUrl,
                                                              String backUrl,String note,String orderName,String acct,
                                                              String backUrl,String note,String orderName,String acct,
                                                              String payType,String validTime,String subAppid,
                                                              String payType,String validTime,String subAppid,
                                                              String remark,String asinfo,String groupNo,
                                                              String remark,String asinfo,String groupNo,
                                                              String consumerIp){
                                                              String consumerIp){
         TreeMap<String, String> tMap = new TreeMap<>();
         TreeMap<String, String> tMap = new TreeMap<>();
-        tMap.put("version",VERSION);
-        tMap.put("merchantNo",MERCHANT_NO);
+        tMap.put("version",version);
+        tMap.put("merchantNo",merchantNo);
         tMap.put("merchantOrderNo",merchantOrderNo);
         tMap.put("merchantOrderNo",merchantOrderNo);
         tMap.put("amount",amount.toString());
         tMap.put("amount",amount.toString());
-        tMap.put("notifyUrl",SCAN_NOTIFY_URL);
+        tMap.put("notifyUrl",notifyUrl);
         tMap.put("backUrl",backUrl);
         tMap.put("backUrl",backUrl);
         tMap.put("note",note);
         tMap.put("note",note);
         tMap.put("orderName",orderName);
         tMap.put("orderName",orderName);
@@ -175,13 +188,13 @@ public class TopApi {
     }
     }
 
 
 
 
-    public static String generateParam(TreeMap<String, String> params){
+    public String generateParam(TreeMap<String, String> params){
         return String.format("%s&sign=%s",
         return String.format("%s&sign=%s",
-                TopApi.joinParam(params),
-                TopApi.signData(params));
+                this.joinParam(params),
+                this.signData(params));
     }
     }
 
 
-    public static String joinParam(TreeMap<String, String> params){
+    public String joinParam(TreeMap<String, String> params){
         StringBuilder buf = new StringBuilder();
         StringBuilder buf = new StringBuilder();
         for (Map.Entry<String, String> entry : params.entrySet()) {
         for (Map.Entry<String, String> entry : params.entrySet()) {
             if (!StringUtils.isBlank(entry.getValue()) && !"sign".equals(entry.getKey())) {
             if (!StringUtils.isBlank(entry.getValue()) && !"sign".equals(entry.getKey())) {
@@ -200,14 +213,14 @@ public class TopApi {
      * @param treeMap
      * @param treeMap
      * @return
      * @return
      */
      */
-    public static String signData(Map<String, String> treeMap) {
+    public String signData(Map<String, String> treeMap) {
         StringBuilder buf = new StringBuilder();
         StringBuilder buf = new StringBuilder();
         for (Map.Entry<String, String> entry : treeMap.entrySet()) {
         for (Map.Entry<String, String> entry : treeMap.entrySet()) {
             if (!StringUtils.isBlank(entry.getValue()) && !"sign".equals(entry.getKey())) {
             if (!StringUtils.isBlank(entry.getValue()) && !"sign".equals(entry.getKey())) {
                 buf.append(entry.getKey()).append(entry.getValue());
                 buf.append(entry.getKey()).append(entry.getValue());
             }
             }
         }
         }
-        buf.append(SECRET);
+        buf.append(secret);
         return Md5Utils.hash(buf.toString()).toUpperCase();
         return Md5Utils.hash(buf.toString()).toUpperCase();
     }
     }
 
 

+ 16 - 14
src/main/java/com/usky/dxtop/service/impl/OrderServiceImpl.java

@@ -19,7 +19,7 @@ import com.usky.dxtop.common.utils.sign.Base64;
 import com.usky.dxtop.mapper.OrderMapper;
 import com.usky.dxtop.mapper.OrderMapper;
 import com.usky.dxtop.model.*;
 import com.usky.dxtop.model.*;
 import com.usky.dxtop.service.*;
 import com.usky.dxtop.service.*;
-import com.usky.dxtop.service.api.TopApi;
+import com.usky.dxtop.service.api.TopApiConfiger;
 import com.usky.dxtop.service.config.rabbitmq.charge.ChargeConsumeConfig;
 import com.usky.dxtop.service.config.rabbitmq.charge.ChargeConsumeConfig;
 import com.usky.dxtop.service.emun.AsyncResultType;
 import com.usky.dxtop.service.emun.AsyncResultType;
 import com.usky.dxtop.service.emun.OrderPayType;
 import com.usky.dxtop.service.emun.OrderPayType;
@@ -93,6 +93,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     private ISysAsyncTaskService sysAsyncTaskService;
     private ISysAsyncTaskService sysAsyncTaskService;
     @Autowired
     @Autowired
     private SysFileService sysFileService;
     private SysFileService sysFileService;
+    @Autowired
+    private TopApiConfiger topApiConfiger;
 
 
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     @Override
     @Override
@@ -150,12 +152,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     @Override
     @Override
     public String getTopScanPayApi(Order order){
     public String getTopScanPayApi(Order order){
         verifyOrder(order);
         verifyOrder(order);
-        TreeMap<String, String> params = TopApi.generateScanPayApiParam(order.getOrderNumber(),
+        TreeMap<String, String> params = topApiConfiger.generateScanPayApiParam(order.getOrderNumber(),
                                         new Double(Arith.mul(order.getMoney().doubleValue(),100)).intValue(), null,
                                         new Double(Arith.mul(order.getMoney().doubleValue(),100)).intValue(), null,
                 null,null,null,null,null,null);
                 null,null,null,null,null,null);
         //记录调用日志
         //记录调用日志
-        callApiLogService.saveOrUpdate(order.getOrderNumber(),SCAN_PAY,TopApi.SCAN_TO_PAY_URL,JSONObject.toJSONString(params),null);
-        return String.format("%s?%s",TopApi.SCAN_TO_PAY_URL,TopApi.generateParam(params));
+        callApiLogService.saveOrUpdate(order.getOrderNumber(),SCAN_PAY, topApiConfiger.scanPayUrl,JSONObject.toJSONString(params),null);
+        return String.format("%s?%s", topApiConfiger.scanPayUrl, topApiConfiger.generateParam(params));
     }
     }
 
 
     /**
     /**
@@ -191,9 +193,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     @Override
     @Override
     public String callTopFindOrderInfoApi(String orderNumber) {
     public String callTopFindOrderInfoApi(String orderNumber) {
-        TreeMap<String, String> param = TopApi.generateDealSelectParam(orderNumber, null, null, null);
-        String format = TopApi.generateParam(param);
-        String result = HttpUtils.sendGet(TopApi.DEAL_SELECT_URL, format,null);
+        TreeMap<String, String> param = topApiConfiger.generateDealSelectParam(orderNumber, null, null, null);
+        String format = topApiConfiger.generateParam(param);
+        String result = HttpUtils.sendGet(topApiConfiger.dealSelectUrl, format,null);
         Order order = one(orderNumber);
         Order order = one(orderNumber);
         //处理订单
         //处理订单
         checkOrder(order, result,JSONObject.toJSONString(param));
         checkOrder(order, result,JSONObject.toJSONString(param));
@@ -276,7 +278,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 orderError(order);
                 orderError(order);
             }
             }
         }
         }
-        callApiLogService.saveOrUpdate(order.getOrderNumber(), FIND_ORDER_INFO, TopApi.DEAL_SELECT_URL, param, result);
+        callApiLogService.saveOrUpdate(order.getOrderNumber(), FIND_ORDER_INFO, topApiConfiger.dealSelectUrl, param, result);
     }
     }
 
 
     /**
     /**
@@ -495,17 +497,17 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         String appId = null;
         String appId = null;
         String openId = null;
         String openId = null;
         if ("W06".equals(order.getTopPayType())){
         if ("W06".equals(order.getTopPayType())){
-            appId = TopApi.WX_APP_ID;
+            appId = topApiConfiger.wxAppId;
             openId = order.getOpenId();
             openId = order.getOpenId();
         }
         }
         verifyOrder(order);
         verifyOrder(order);
         String orderNumber = order.getOrderNumber();
         String orderNumber = order.getOrderNumber();
-        TreeMap<String, String> params = TopApi.generateUnifyParam(orderNumber,new Double(Arith.mul(order.getMoney().doubleValue(),100)).intValue(),
+        TreeMap<String, String> params = topApiConfiger.generateUnifyParam(orderNumber,new Double(Arith.mul(order.getMoney().doubleValue(),100)).intValue(),
                 null, null,
                 null, null,
                 null,null,openId,order.getTopPayType(),null,appId,
                 null,null,openId,order.getTopPayType(),null,appId,
                 null,null,null,null);
                 null,null,null,null);
-        String unify = TopApi.generateParam(params);
-        String result = HttpUtils.sendGet(TopApi.UNIFY_URL, unify,null);
+        String unify = topApiConfiger.generateParam(params);
+        String result = HttpUtils.sendGet(topApiConfiger.unifyUrl, unify,null);
         JSONObject obj= JSON.parseObject(result);
         JSONObject obj= JSON.parseObject(result);
         String payInfo;
         String payInfo;
         if ("0000".equals(obj.get("status"))){
         if ("0000".equals(obj.get("status"))){
@@ -514,7 +516,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             throw new CustomException(obj.get("errorMessage").toString());
             throw new CustomException(obj.get("errorMessage").toString());
         }
         }
         //记录调用日志
         //记录调用日志
-        callApiLogService.saveOrUpdate(orderNumber,SCAN_PAY,TopApi.SCAN_TO_PAY_URL,JSONObject.toJSONString(params),null);
+        callApiLogService.saveOrUpdate(orderNumber,SCAN_PAY, topApiConfiger.scanPayUrl,JSONObject.toJSONString(params),null);
         return payInfo;
         return payInfo;
     }
     }
 
 
@@ -634,7 +636,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
      * @param order
      * @param order
      */
      */
     public void verifyOrder(Order order){
     public void verifyOrder(Order order){
-        String orderNumber = TopApi.getOrderNumber();
+        String orderNumber = TopApiConfiger.getOrderNumber();
         order.setOrderNumber(orderNumber);
         order.setOrderNumber(orderNumber);
         Assert.check(null != order.getPayType(),"请选择支付方式");
         Assert.check(null != order.getPayType(),"请选择支付方式");
         Assert.check(null != order.getMoney() && order.getMoney().compareTo(BigDecimal.ZERO)  != 0,"请输入订单金额");
         Assert.check(null != order.getMoney() && order.getMoney().compareTo(BigDecimal.ZERO)  != 0,"请输入订单金额");

+ 10 - 1
src/main/resources/application-dev.properties

@@ -105,4 +105,13 @@ spring.rabbitmq.username=admin
 spring.rabbitmq.password=admin
 spring.rabbitmq.password=admin
 # 开启confirms回调 P -> Exchange
 # 开启confirms回调 P -> Exchange
 spring.rabbitmq.publisher-confirm-type=correlated
 spring.rabbitmq.publisher-confirm-type=correlated
-
+# 通云支付配置
+toppay.version:v1.0
+toppay.merchantNo:121050000127
+toppay.secret:MTEODEKT
+toppay.wxAppId:wx40274c2aaec24330
+toppay.wxAppSecret:4b0c04f796a8bed2c2435cc68362b22b
+toppay.notifyUrl:https://wx.ewoogi.com/dxapi/top/notify
+toppay.scanPayUrl:https://wx.ewoogi.com/dxapi/top/notify
+toppay.dealSelectUrl:https://wx.ewoogi.com/dxapi/top/notify
+toppay.unifyUrl:https://wx.ewoogi.com/dxapi/top/notify

+ 12 - 0
src/main/resources/application-test.properties

@@ -98,3 +98,15 @@ spring.rabbitmq.port=5672
 spring.rabbitmq.username=admin
 spring.rabbitmq.username=admin
 spring.rabbitmq.password=123456
 spring.rabbitmq.password=123456
 spring.rabbitmq.publisher-confirm-type=correlated
 spring.rabbitmq.publisher-confirm-type=correlated
+
+# 通云支付配置
+toppay.version:v1.0
+toppay.merchantNo:121050000127
+toppay.secret:MTEODEKT
+toppay.wxAppId:wx40274c2aaec24330
+toppay.wxAppSecret:4b0c04f796a8bed2c2435cc68362b22b
+toppay.notifyUrl:https://wx.ewoogi.com/dxapi/top/notify
+toppay.scanPayUrl:https://wx.ewoogi.com/dxapi/top/notify
+toppay.dealSelectUrl:https://wx.ewoogi.com/dxapi/top/notify
+toppay.unifyUrl:https://wx.ewoogi.com/dxapi/top/notify
+