收藏
回答

微信支付v3 Native支付成功回调问题?

支付成功回调 我用的本地做的外网穿透 可以成功回到并取到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");




回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容