Browse Source

optimize pay

java110 3 years ago
parent
commit
f17fc02d50

+ 8 - 8
service-acct/src/main/java/com/java110/acct/payment/adapt/chinaUms/ChinaUmsPaymentFactoryAdapt.java

@@ -241,15 +241,15 @@ public class ChinaUmsPaymentFactoryAdapt implements IPaymentFactoryAdapt {
     }
 
     public int confirmPayFee(JSONObject map, PaymentOrderDto paymentOrderDto,NotifyPaymentOrderDto notifyPaymentOrderDto) {
-        String appId = notifyPaymentOrderDto.getAppId();
+        String appId = null;
         //兼容 港币交易时 或者微信有时不会掉参数的问题
-//        if (map.containsKey("wId")) {
-//            String wId = map.get("wId").toString();
-//            wId = wId.replace(" ", "+");
-//            appId = WechatFactory.getAppId(wId);
-//        } else {
-//            appId = map.get("appid").toString();
-//        }
+        if (map.containsKey("wId")) {
+            String wId = map.get("wId").toString();
+            wId = wId.replace(" ", "+");
+            appId = WechatFactory.getAppId(wId);
+        } else {
+            appId = map.get("appid").toString();
+        }
         JSONObject paramIn = new JSONObject();
         paramIn.put("appId", appId);
         paramIn.put("communityId",notifyPaymentOrderDto.getCommunityId());

+ 8 - 8
service-acct/src/main/java/com/java110/acct/payment/adapt/fuiou/FuiouPaymentFactoryAdapt.java

@@ -249,15 +249,15 @@ public class FuiouPaymentFactoryAdapt implements IPaymentFactoryAdapt {
     }
 
     public int confirmPayFee(JSONObject map, PaymentOrderDto paymentOrderDto,NotifyPaymentOrderDto notifyPaymentOrderDto) {
-        String appId = notifyPaymentOrderDto.getAppId();
+        String appId = null;
         //兼容 港币交易时 或者微信有时不会掉参数的问题
-//        if (map.containsKey("wId")) {
-//            String wId = map.get("wId").toString();
-//            wId = wId.replace(" ", "+");
-//            appId = WechatFactory.getAppId(wId);
-//        } else {
-//            appId = map.get("appid").toString();
-//        }
+        if (map.containsKey("wId")) {
+            String wId = map.get("wId").toString();
+            wId = wId.replace(" ", "+");
+            appId = WechatFactory.getAppId(wId);
+        } else {
+            appId = map.get("appid").toString();
+        }
         SortedMap<String, String> paramMap = new TreeMap<String, String>();
         ResponseEntity<String> responseEntity = null;
         for (String key : map.keySet()) {

+ 8 - 8
service-acct/src/main/java/com/java110/acct/payment/adapt/pingan/PinganPaymentFactoryAdapt.java

@@ -231,15 +231,15 @@ public class PinganPaymentFactoryAdapt implements IPaymentFactoryAdapt {
     }
 
     public int confirmPayFee(JSONObject map, PaymentOrderDto paymentOrderDto,NotifyPaymentOrderDto notifyPaymentOrderDto) {
-        String appId = notifyPaymentOrderDto.getAppId();
+        String appId = null;
         //兼容 港币交易时 或者微信有时不会掉参数的问题
-//        if (map.containsKey("wId")) {
-//            String wId = map.get("wId").toString();
-//            wId = wId.replace(" ", "+");
-//            appId = WechatFactory.getAppId(wId);
-//        } else {
-//            appId = map.get("appid").toString();
-//        }
+        if (map.containsKey("wId")) {
+            String wId = map.get("wId").toString();
+            wId = wId.replace(" ", "+");
+            appId = WechatFactory.getAppId(wId);
+        } else {
+            appId = map.get("appid").toString();
+        }
         SortedMap<String, String> paramMap = new TreeMap<String, String>();
         ResponseEntity<String> responseEntity = null;
         for (String key : map.keySet()) {

+ 8 - 8
service-acct/src/main/java/com/java110/acct/payment/adapt/plutus/PlutusPaymentFactoryAdapt.java

@@ -232,14 +232,14 @@ public class PlutusPaymentFactoryAdapt implements IPaymentFactoryAdapt {
 
         String signature = json.getString("signature");
         String content = json.getString("content");
-        String appId = notifyPaymentOrderDto.getAppId();
-//        if (json.containsKey("wId")) {
-//            String wId = json.get("wId").toString();
-//            wId = wId.replace(" ", "+");
-//            appId = WechatFactory.getAppId(wId);
-//        } else {
-//            appId = json.get("appid").toString();
-//        }
+        String appId = null;
+        if (json.containsKey("wId")) {
+            String wId = json.get("wId").toString();
+            wId = wId.replace(" ", "+");
+            appId = WechatFactory.getAppId(wId);
+        } else {
+            appId = json.get("appid").toString();
+        }
 
         JSONObject paramIn = new JSONObject();
         paramIn.put("appId", appId);

+ 8 - 8
service-acct/src/main/java/com/java110/acct/payment/adapt/wechat/WechatPaymentFactoryAdapt.java

@@ -258,15 +258,15 @@ public class WechatPaymentFactoryAdapt implements IPaymentFactoryAdapt {
     }
 
     public int confirmPayFee(Map<String, Object> map, PaymentOrderDto paymentOrderDto, NotifyPaymentOrderDto notifyPaymentOrderDto) {
-        String appId = notifyPaymentOrderDto.getAppId();
+        String appId = "";
         //兼容 港币交易时 或者微信有时不会掉参数的问题
-//        if (map.containsKey("wId")) {
-//            String wId = map.get("wId").toString();
-//            wId = wId.replace(" ", "+");
-//            appId = WechatFactory.getAppId(wId);
-//        } else {
-//            appId = map.get("appid").toString();
-//        }
+        if (map.containsKey("wId")) {
+            String wId = map.get("wId").toString();
+            wId = wId.replace(" ", "+");
+            appId = WechatFactory.getAppId(wId);
+        } else {
+            appId = map.get("appid").toString();
+        }
         SortedMap<String, String> paramMap = new TreeMap<String, String>();
         ResponseEntity<String> responseEntity = null;
         for (String key : map.keySet()) {

+ 1 - 1
service-api/src/main/java/com/java110/api/aop/PageProcessAspect.java

@@ -217,7 +217,7 @@ public class PageProcessAspect {
      */
     private void writeCookieInfo(IPageData pd, ServletRequestAttributes attributes) throws IOException {
         // 这里目前只写到组件级别,如果需要 写成方法级别
-        if (!StringUtil.isNullOrNone(pd.getToken()) && "login".equals(pd.getComponentCode())) {
+        if (!StringUtil.isNullOrNone(pd.getToken()) ) {
             HttpServletResponse response = attributes.getResponse();
             Cookie cookie = new Cookie(CommonConstant.COOKIE_AUTH_TOKEN, pd.getToken());
             cookie.setHttpOnly(true);

+ 3 - 0
springboot/src/main/java/com/java110/boot/aop/PageProcessAspect.java

@@ -222,7 +222,10 @@ public class PageProcessAspect {
             Cookie cookie = new Cookie(CommonConstant.COOKIE_AUTH_TOKEN, pd.getToken());
             cookie.setHttpOnly(true);
             cookie.setPath("/");
+
             response.addCookie(cookie);
+            //response.addHeader("Set-Cookie","SameSite=None");
+
             response.flushBuffer();
         }