|
@@ -130,16 +130,23 @@ public class WxPayServiceImpl implements IWxPayService {
|
|
|
Map<String, String> notifyMap = WXPayUtil.xmlToMap(notifyData); // 转换成map
|
|
Map<String, String> notifyMap = WXPayUtil.xmlToMap(notifyData); // 转换成map
|
|
|
|
|
|
|
|
if (wxpay.isPayResultNotifySignatureValid(notifyMap)) {
|
|
if (wxpay.isPayResultNotifySignatureValid(notifyMap)) {
|
|
|
- String out_trade_no = notifyMap.get("out_trade_no");
|
|
|
|
|
- String transaction_id = notifyMap.get("transaction_id");
|
|
|
|
|
- Order order = iOrderService.queryByOrderSn(out_trade_no);
|
|
|
|
|
- if(order.getOrderStatus()==0){
|
|
|
|
|
- order.setOrderStatus(1);
|
|
|
|
|
- order.setPayTime(DateUtils.getNowTime());
|
|
|
|
|
- order.setTransid(transaction_id);
|
|
|
|
|
- order.setOrderGeneral(out_trade_no);
|
|
|
|
|
- if(iOrderService.updateById(order)){
|
|
|
|
|
-
|
|
|
|
|
|
|
+ String result_code = notifyMap.get("result_code");
|
|
|
|
|
+ if("SUCCESS".equals(result_code)){
|
|
|
|
|
+ String out_trade_no = notifyMap.get("out_trade_no");
|
|
|
|
|
+ String transaction_id = notifyMap.get("transaction_id");
|
|
|
|
|
+ Order order = iOrderService.queryByOrderSn(out_trade_no);
|
|
|
|
|
+ if(order.getOrderStatus()==0){
|
|
|
|
|
+ order.setOrderStatus(1);
|
|
|
|
|
+ order.setPayTime(DateUtils.getNowTime());
|
|
|
|
|
+ order.setTransid(transaction_id);
|
|
|
|
|
+ order.setOrderGeneral(out_trade_no);
|
|
|
|
|
+ if(iOrderService.updateById(order)){
|
|
|
|
|
+ Map<String,String> result = new HashMap<>();
|
|
|
|
|
+ result.put("return_code","<![CDATA[SUCCESS]]>");
|
|
|
|
|
+ result.put("return_msg","<![CDATA[OK]]>");
|
|
|
|
|
+ String resultXml = WXPayUtil.mapToXml(result);
|
|
|
|
|
+ return resultXml;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|