灵动sdk接入

master
zhangshanxue 2020-07-26 20:54:42 +08:00
parent 51a8fc36ca
commit ab746d58b6
1 changed files with 15 additions and 13 deletions

View File

@ -72,15 +72,15 @@ public class MHTRechargeController {
String orderNo =parameterMap.get("orderNo");
String time =parameterMap.get("time");
String sign = parameterMap.get("sign");
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("consumerid").append("=").append(consumerid).append("&");
stringBuilder.append("consumerName").append("=").append(consumerName).append("&");
stringBuilder.append("gameCurrency").append("=").append(gameCurrency).append("&");
stringBuilder.append("mhtOrderAmt").append("=").append(mhtOrderAmt).append("&");
stringBuilder.append("orderDetail").append("=").append(orderDetail).append("&");
stringBuilder.append("orderNo").append("=").append(orderNo).append("&");
stringBuilder.append("time").append("=").append(time);
String plain = stringBuilder.toString() + MD5Util.encrypByMd5(MHTSDKConstans.secretKey);
String stringBuilder = "consumerid" + "=" + consumerid + "&" +
"consumerName" + "=" + consumerName + "&" +
"gameCurrency" + "=" + gameCurrency + "&" +
"mhtOrderAmt" + "=" + mhtOrderAmt + "&" +
"orderDetail" + "=" + orderDetail + "&" +
"orderNo" + "=" + orderNo + "&" +
"time" + "=" + time;
LOGGER.info("stringBuilder"+stringBuilder);
String plain = stringBuilder + MD5Util.encrypByMd5(MHTSDKConstans.secretKey);
String sig = MD5Util.encrypByMd5(plain);
String goodID;
@ -88,15 +88,16 @@ public class MHTRechargeController {
LOGGER.info("callback==>roleUid={},sin derify fail,mine sign={} ",consumerid,sig);
return "FAIL";
}
if (!sig.equals(sign)){
LOGGER.info("callback==>roleUid={},sin derify fail,mine sign={} ",consumerid,sig);
return "FAIL";
}
String[] split1 = consumerName.split("#");
goodID = split1[0];
if(null==goodID||goodID.isEmpty()){
LOGGER.info("callback==>roleUid={},sin derify fail,mine sign={} ,consumerName={}",consumerid,sig,consumerName);
}
if (!sig.equals(sign)){
LOGGER.info("callback==>roleUid={},sin derify fail,mine sign={} ",consumerid,sig);
return "FAIL";
}
CUserInfo cUserInfo = cuserDao.findUserInfo(Integer.valueOf(consumerid));
if(cUserInfo == null){
@ -152,6 +153,7 @@ public class MHTRechargeController {
}
}
}catch (Exception e){
e.printStackTrace();
LOGGER.info("callback==>err "+e.toString());
response = "FAIL";
}