ソースを参照

支付回调地址动态配置

dos 4 ヶ月 前
コミット
936718f16e

+ 11 - 2
game-business/src/main/java/com/game/business/util/other/PayOrderUtils.java

@@ -1,7 +1,10 @@
 package com.game.business.util.other;
 
+import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.game.common.exception.ServiceException;
+import com.game.system.service.ISysConfigService;
 import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.http.HttpEntity;
@@ -37,8 +40,14 @@ public class PayOrderUtils {
     private static final String notifyUrl = "/business/cashrecord/otherCallback";
 
     public static Map<String, Object> getPayUrl(String orderNo, String payType, Integer amount,String extra){
-
-        String url = "https://tapifoxgame.eruid.com";
+        ISysConfigService sysConfigService = SpringUtil.getBean(ISysConfigService.class);
+        if(null == sysConfigService){
+            throw new ServiceException("系统异常");
+        }
+        String url = sysConfigService.selectConfigByKey("sys_api_url");
+        if(StringUtils.isBlank(url)){
+            throw new ServiceException("配置缺失");
+        }
         Map<String, Object> resultMap = new HashMap<>();
         resultMap.put("code", 0);
         resultMap.put("mgs", "获取支付地址失败!");