Browse Source

//add dy

release_toaliyun_real
xhxu 4 years ago
parent
commit
2115077e72
2 changed files with 18 additions and 15 deletions
  1. +16
    -15
      mallinkService/src/main/java/com/iformall/douyin/pay/DouYinPayHelper.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/utils/HttpUtil.java

+ 16
- 15
mallinkService/src/main/java/com/iformall/douyin/pay/DouYinPayHelper.java View File

@@ -67,6 +67,7 @@ public class DouYinPayHelper {
signStr.append(sep).append(s); signStr.append(sep).append(s);
sep = "&"; sep = "&";
} }
log.error("加密字符串"+signStr);
return md5FromStr(signStr.toString()); return md5FromStr(signStr.toString());
} }


@@ -353,22 +354,22 @@ public class DouYinPayHelper {


public static void main(String[] args) { public static void main(String[] args) {
//测试 //测试
// String mcuid = "69638509385870236530";//商户号
// String appid = "tt9da4eb19029c2bb301";
// String salt = "41dcZnKe0RovCfuVEL7IlXFfy206HPVtWJ5q7KJr";//支付密钥
// String mcuid = "70777649963225930610";//商户号
String appid = "ttef6599d8705b49b101";
String salt = "G8DdHfRcEPXB8kHQsnpVWvhLfMC7MZQ72aweTei8";//支付密钥


//生产 //生产
String mcuid = "69739487619282066230";
String appid = "tt8183f73e1ebb053701";
String salt = "rtQwyvhZHMuMYrY6GBm8DnhvEu0fuJUVHYS2KP6P";
// String mcuid = "69739487619282066230";
// String appid = "tt8183f73e1ebb053701";
// String salt = "rtQwyvhZHMuMYrY6GBm8DnhvEu0fuJUVHYS2KP6P";


// AppAddSubMerchant appAddSubMerchant = new AppAddSubMerchant();
// appAddSubMerchant.setAppId("tt9da4eb19029c2bb301");
// appAddSubMerchant.setSalt("41dcZnKe0RovCfuVEL7IlXFfy206HPVtWJ5q7KJr");
// appAddSubMerchant.setSubMerchantId("113");
// appAddSubMerchant.setUrlType(2);
// AppAddSubMerchantResult appAddSubMerchantResult = appAddSubMerchant(appAddSubMerchant);
// System.out.println(appAddSubMerchantResult.toString());
AppAddSubMerchant appAddSubMerchant = new AppAddSubMerchant();
appAddSubMerchant.setAppId("ttef6599d8705b49b101");
appAddSubMerchant.setSalt("G8DdHfRcEPXB8kHQsnpVWvhLfMC7MZQ72aweTei8");
appAddSubMerchant.setSubMerchantId("666438479039619072");
appAddSubMerchant.setUrlType(2);
AppAddSubMerchantResult appAddSubMerchantResult = appAddSubMerchant(appAddSubMerchant);
System.out.println(appAddSubMerchantResult.toString());


// Settle settle = new Settle(); // Settle settle = new Settle();
// settle.setAppId(appid); // settle.setAppId(appid);
@@ -400,7 +401,7 @@ public class DouYinPayHelper {
// OrderQueryResult orderQueryResult = orderQuery(appid, salt, "613879951804915712", null); // OrderQueryResult orderQueryResult = orderQuery(appid, salt, "613879951804915712", null);
// System.out.println(orderQueryResult.toString()); // System.out.println(orderQueryResult.toString());


QueryMerchantResult queryMerchantResult = queryMerchantStatus(appid, salt, "69845881593843571583", "5041", null);
System.out.println(queryMerchantResult.toString());
// QueryMerchantResult queryMerchantResult = queryMerchantStatus(appid, salt, "69845881593843571583", "5041", null);
// System.out.println(queryMerchantResult.toString());
} }
} }

+ 2
- 0
mallinkService/src/main/java/com/iformall/utils/HttpUtil.java View File

@@ -504,6 +504,8 @@ public class HttpUtil {
private static String exec(okhttp3.Request request) { private static String exec(okhttp3.Request request) {
try { try {
okhttp3.Response response = OkHttpClient.newCall(request).execute(); okhttp3.Response response = OkHttpClient.newCall(request).execute();
String header = response.header("X-Tt-Logid");
logger.info("X-Tt-Logid="+header);
if (!response.isSuccessful()) if (!response.isSuccessful())
throw new RuntimeException("Unexpected code " + response); throw new RuntimeException("Unexpected code " + response);
return response.body().string(); return response.body().string();


Loading…
Cancel
Save