ソースを参照

feat : 修改阿里支付得bug

bilingfeng 2 年 前
コミット
a8e3921d01

+ 14 - 4
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/pay/AliPayService.java

@@ -44,15 +44,25 @@ public class AliPayService extends PayBaseService {
     private Pattern mobileClientParam = Pattern.compile("\\{\"queryResultUrl\".*?\"}", Pattern.CASE_INSENSITIVE);
 
     /**
-     * 异步回调地址
+     * 异步回调地址配置
      */
     @Value("${payConfig.alipay.returnUrl}")
+    private String returnUrlConfig;
+
+    /**
+     * 同步回调地址配置
+     */
+    @Value("${payConfig.alipay.notifyUrl}")
+    private String notifyUrlConfig;
+
+    /**
+     * 异步回调地址
+     */
     private String returnUrl;
 
     /**
      * 同步回调地址
      */
-    @Value("${payConfig.alipay.notifyUrl}")
     private String notifyUrl;
 
     /**
@@ -71,8 +81,8 @@ public class AliPayService extends PayBaseService {
         this.attach = product.getAttach();
         this.configInit(getPayConfig(product.getGameId(), product.getPayWay()));
         //回调地址中拼接游戏具体支付方式
-        returnUrl += "?" + "gamePayWayId=" + attach.getGamePayWayId();
-        notifyUrl += "?" + "gamePayWayId=" + attach.getGamePayWayId();
+        this.returnUrl = this.returnUrlConfig + "?" + "gamePayWayId=" + attach.getGamePayWayId();
+        this.notifyUrl = this.notifyUrlConfig + "?" + "gamePayWayId=" + attach.getGamePayWayId();
         switch (product.getPayDevice()) {
             case 1:
                 return this.pc(product);

+ 0 - 2
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/pay/PayBaseService.java

@@ -55,13 +55,11 @@ public abstract class PayBaseService {
             String gameId = String.valueOf(info.getGameId());
             //根据订单中游戏id,获取游戏的支付方式
             GamePayWay payInfo = gamePayWayService.getPayWayToOrderPay(gameId, product.getPayWay());
-
             product.setProductId(info.getProductId());
             product.setSubject(info.getProductName());
             product.setGameId(gameId);
             product.setTotalFee(String.valueOf(info.getAmount()));
             product.setOutTradeNo(info.getId());
-            product.setFrontUrl("");
             product.setConfig(payInfo.getPayConfig());
             ProductPayAttachParamBO attachBO = new ProductPayAttachParamBO();
             attachBO.setUserId(product.getUserId());