generated from root/miduo_server
疯体ios支付
parent
bdc8db7b39
commit
6201c2a6ce
|
@ -1,6 +1,7 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.jmfy.paramBean.PaySdkEnum;
|
||||
import com.jmfy.util.FengTiDesUtil;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import com.jmfy.util.MD5Util;
|
||||
import com.jmfy.util.XmlUtil;
|
||||
|
@ -24,6 +25,8 @@ public class FengtiIOSRechargeController {
|
|||
|
||||
private static final String Md5_Key = "69059243697666791013328131742528";
|
||||
|
||||
public static final String Callback_Key = "65128019344497803431230471351187";
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(FengtiIOSRechargeController.class);
|
||||
|
||||
@RequestMapping(value = "/Web/fengtiIOSCallback")
|
||||
|
@ -42,7 +45,8 @@ public class FengtiIOSRechargeController {
|
|||
}
|
||||
|
||||
String ntData = requestMap.get("nt_data");
|
||||
HashMap<String, String> data = (HashMap<String, String>) XmlUtil.readStringXmlOut(ntData);
|
||||
String decode = FengTiDesUtil.decode(ntData, Callback_Key);
|
||||
HashMap<String, String> data = (HashMap<String, String>) XmlUtil.readStringXmlOut(decode);
|
||||
|
||||
String orderno = data.get("out_order_no"); // 支付订单号
|
||||
double amount = Double.parseDouble(data.get("amount")) * 100; //充值金额(单位:元)(需要换算成分)
|
||||
|
@ -58,11 +62,13 @@ public class FengtiIOSRechargeController {
|
|||
*/
|
||||
private boolean verifySign(Map<String, String> map) {
|
||||
String ntData = map.get("nt_data");
|
||||
String decodeNtData = FengTiDesUtil.decode(ntData, Callback_Key);
|
||||
String sign = map.get("sign");
|
||||
String decodeSign = FengTiDesUtil.decode(sign, Callback_Key);
|
||||
String md5Sign = map.get("md5Sign");
|
||||
|
||||
StringBuilder localSign = new StringBuilder();
|
||||
localSign.append(ntData).append(sign).append(Md5_Key);
|
||||
localSign.append(decodeNtData).append(decodeSign).append(Md5_Key);
|
||||
String mySign = MD5Util.encrypByMd5(localSign.toString());
|
||||
if (mySign.equals(md5Sign)) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue