喜扑ios

master
xuexinpeng 2021-12-06 14:29:48 +08:00
parent bcec0fd334
commit 74318395da
1 changed files with 8 additions and 20 deletions

View File

@ -2,20 +2,16 @@ package com.jmfy.controller;
import com.google.gson.Gson;
import com.jmfy.dto.CUserDao;
import com.jmfy.paramBean.MHTGnWebRechargeRequestBean;
import com.jmfy.paramBean.PaySdkEnum;
import com.jmfy.paramBean.XPParamBean2;
import com.jmfy.util.JsonUtil;
import com.jmfy.util.MD5Util;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Field;
import java.util.*;
/**
@ -33,53 +29,45 @@ public class XPiosRechargeController {
@RequestMapping(value = "/Web/XPCallback2")
public String MHTGnCallback(HttpServletRequest request) throws Exception {
public String XPCallback2(HttpServletRequest request) throws Exception {
return process(request,"c6b1b36a27195504134161f264969dec");
}
/* @RequestMapping(value = "/Web/XPCallback2")
public String XPCallback2Ios(HttpServletRequest request) throws Exception {
return process(request,"c6b1b36a27195504134161f264969dec");
}
@RequestMapping(value = "/Web/XPCallback2")
public String MHTGnIosCallback(HttpServletRequest request) throws Exception {
public String XPCallbackTest2(HttpServletRequest request) throws Exception {
return process(request,"c6b1b36a27195504134161f264969dec");
}
@RequestMapping(value = "/Web/XPCallback2")
public String MHTGnTestCallback(HttpServletRequest request) throws Exception {
return process(request,"c6b1b36a27195504134161f264969dec");
}
}*/
protected String process(HttpServletRequest request,String appsecret) throws Exception{
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap2(request);
if (parameterMap.isEmpty()) {
LOGGER.info("data is null");
return "FAIL";
}
XPParamBean2 data = getData(parameterMap);
if (data == null) {
LOGGER.info("data is null");
return "FAIL";
}
String response = "SUCCESS";
try {
//String consumerid = data.getConsumerid();
String sign = data.getNewsign();
String sig = getMySign(data, appsecret);
if (!sig.equals(sign)) {
LOGGER.info("callback==>roleUid={},sin derify fail,mine sign={},other sign={} ", data.getRoleId(), sig,sign);
return "sign fail";
}
response = insertOrder(data);
} catch (Exception e) {
e.printStackTrace();
LOGGER.info("callback==>err " + e.toString());
response = "FAIL";
}
return response;
}