|
@@ -171,7 +171,7 @@ public class PayController {
|
|
|
//reqData.put("subAppid", "wx24210004370ec43b"); //微信子公众号
|
|
|
//reqData.put("outFrontUrl", ""); //js 支付,前台 成功通知地址
|
|
|
//reqData.put("outFrontFailUrl", ""); //js 支付,前台 事变通知地址
|
|
|
- //reqData.put("notifyUrl", ""); //回调地址
|
|
|
+ reqData.put("notifyUrl", "http://m.huiyj.com/yijia-pay/api/getCallback"); //回调地址
|
|
|
//reqData.put("needReceipt", "00"); //电子发票功能 微信开具电子 发票使用
|
|
|
//reqData.put("ledgerAccountFlag", "00"); //是否做分账 分账交易使 用;00:做; 01:不做;不传默认为不做分账
|
|
|
//reqData.put("ledgerAccountEffectTime", "00"); //分账有效时间 单位为天;是 否做分账选择 00 时该字段必传
|
|
@@ -349,7 +349,6 @@ public class PayController {
|
|
|
public void getCallback(HttpServletRequest request,HttpServletResponse response){
|
|
|
logger.info("回调返回过来的参数"+request);
|
|
|
Gson gson =new Gson();
|
|
|
- logger.info("回调返回过来的参数json:--"+gson.toJson(request));
|
|
|
//获取回调参数信息
|
|
|
String uuid=request.getParameter("uuid");////随行付交易流水号
|
|
|
String mno=request.getParameter("mno");//发起交易的商户编号
|
|
@@ -414,6 +413,7 @@ public class PayController {
|
|
|
HashMap<String, Object> result = JSON.parseObject(gson.toJson(reqData), LinkedHashMap.class, Feature.OrderedField);
|
|
|
//验签
|
|
|
String resultStr = RSASignature.getOrderContent(result);
|
|
|
+ JSONObject req = new JSONObject();
|
|
|
System.out.println(resultStr);
|
|
|
if (RSASignature.doCheck(resultStr, sign, SXFPaySign.sxfPublic)) {
|
|
|
System.out.println("===================验签成功==============");
|
|
@@ -423,15 +423,31 @@ public class PayController {
|
|
|
logger.info("根据订单号,查询订单"+gson.toJson(list));
|
|
|
if (list != null && list.size() == 1) {
|
|
|
String status = list.get(0).getStatus();
|
|
|
+ int ordId= list.get(0).getOrderId();
|
|
|
//状态为未支付 1 修改状态为已支付
|
|
|
if (status.equals("1")) {
|
|
|
PayOrder payOrder = new PayOrder();
|
|
|
- //payOrder.setOrderNo(callBack.getOrdNo());
|
|
|
+ payOrder.setOrderId(ordId);
|
|
|
payOrder.setStatus("2");
|
|
|
//根据修改状态
|
|
|
- //payOrderService.getUpdatePayOrder(payOrder);
|
|
|
+ payOrderService.getUpdatePayOrder(payOrder);
|
|
|
+ req.put("code","success");
|
|
|
+ req.put("msg","成功");
|
|
|
}
|
|
|
}
|
|
|
+ }else {
|
|
|
+ logger.info("验签失败");
|
|
|
+ req.put("code","fail");
|
|
|
+ req.put("msg","失败");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ response.setContentType("application/json; charset=UTF-8");
|
|
|
+ response.setCharacterEncoding("UTF-8");
|
|
|
+ response.getWriter().print(req);
|
|
|
+ response.getWriter().flush();
|
|
|
+ response.getWriter().close();
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
}
|