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