支付成功回调 我用的本地做的外网穿透 可以成功回到并取到header头里面的签名信息 可是body信息就是取不到 尝试了多种方法
public String PayNotify(HttpServletRequest request) throws Exception{
Map<String, String> returnMap = new HashMap<>();
returnMap.put("code", "FAIL");
returnMap.put("message", "失败");
Map<String, String> params = new HashMap<String, String>();
Map requestParams = request.getParameterMap();
String body1 = request.getReader().lines().collect(Collectors.joining());
BufferedReader reader = request.getReader();
StringBuilder requestBody = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
requestBody.append(line);
}
上面这几种方法都取不到 下面的header头里面的信息都可以取到
String Wechatpay_Serial = request.getHeader("Wechatpay-Serial");
String Wechatpay_Nonce = request.getHeader("Wechatpay-Nonce");
String Wechatpay_Signature = request.getHeader("Wechatpay-Signature");
String Wechatpay_Timestamp = request.getHeader("Wechatpay-Timestamp");
Native下单 - Native支付 | 微信支付商户文档中心 https://pay.weixin.qq.com/docs/merchant/apis/native-payment/direct-jsons/native-prepay.html 还请参照官方示例进行确认