xufeng 2 éve
szülő
commit
18eca471c2

+ 0 - 1
game-module/game-sdk/src/main/java/com/zanxiang/sdk/controller/PayController.java

@@ -74,7 +74,6 @@ public class PayController {
         bo.setUserId(userId);
         bo.setPayDevice(userData.getDeviceType());
         bo.setDeviceSystem(userData.getDeviceSystem());
-        //todo : 工具类做了修改
         bo.setSpbillCreateIp(IpUtils.getRealIp(request));
         bo.setOutTradeNo(product.getOrderId());
         bo.setPayWay(product.getPayWay());

+ 2 - 2
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/pay/AlipayServiceImpl.java

@@ -41,10 +41,10 @@ import java.util.regex.Pattern;
 public class AlipayServiceImpl extends PayService implements OrderPayService {
     private static final Logger logger = LoggerFactory.getLogger(AlipayServiceImpl.class);
 
-    @Value("payConfig.alipay.returnUrl")
+    @Value("${payConfig.alipay.returnUrl}")
     private String returnUrl;
 
-    @Value("payConfig.alipay.notifyUrl")
+    @Value("${payConfig.alipay.notifyUrl}")
     private String notifyUrl;
 
     private Config config;

+ 4 - 5
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/pay/WxpayServiceImpl.java

@@ -15,6 +15,7 @@ import org.jdom.JDOMException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Service;
 import weixin.popular.api.SnsAPI;
@@ -38,10 +39,10 @@ public class WxpayServiceImpl extends PayService implements OrderPayService {
 
     private WxPayUtil wxPayUtil;
 
-    @Value("server.domain")
+    @Value("${server.domain}")
     private String serverUrl;
 
-    @Value("payConfig.wx.notifyUrl")
+    @Value("${payConfig.wx.notifyUrl}")
     private String notifyUrl;
 
     private String filePath = "/tmp/wxpay/";
@@ -70,12 +71,10 @@ public class WxpayServiceImpl extends PayService implements OrderPayService {
 
         switch (product.getPayDevice()) {
             case 1:
-//                return this.pc(product);
                 return this.mobile(product, "NATIVE");
             case 2:
             case 3:
                 return this.mobile(product, "MWEB");
-//                return this.pc(product);
             case 4:
                 return this.mp(product);
             default:
@@ -238,7 +237,7 @@ public class WxpayServiceImpl extends PayService implements OrderPayService {
             totalFee = wxPayUtil.subZeroAndDot(this.totalFee);
             packageParams.put("total_fee", totalFee);// 总金额
             packageParams.put("spbill_create_ip", product.getSpbillCreateIp());// 发起人IP地址
-            packageParams.put("notify_url", "https://localhost");// 回调地址 notifyUrl
+            packageParams.put("notify_url", notifyUrl);// 回调地址 notifyUrl
             packageParams.put("trade_type", trade_type);// 交易类型
             packageParams.put("attach", JSONObject.toJSONString(this.attach));