微信支付,我程序生成的xml,放入签名检查工具中就是成功,然后http发出去就是签名错误?
发布于 6 年前 作者 eshao 11703 次浏览 来自 问答

这个XML是我debug复制出来的,复制出来放入签名工具就是成功,然后debug走下去就是签名错误??

什么鬼微信??

public String requestWithoutCert(String strUrl, Map<String, String> reqData, int timeoutMs) throws Exception {
    //发送给微信的XML
    String reqBody = this.makeRequestBody(reqData);
    // 发送XML
    HttpRequest request = HttpRequest.post(strUrl)
            .connectTimeout(timeoutMs)
            .readTimeout(timeoutMs)
            .header("Content-Type","application/xml")
            .send(reqBody);
    if (request.code() != 200) {
        throw new Exception("HTTP response code is not 200");
    }
    //响应结果
    return request.body();
}
2 回复

微信的sdk应该没问题的吧,直接拿来用就可以了,注意签名方式统一就可以了

你放效验工具,只是验证你签名方法没有问题

看看这个,找找https://developers.weixin.qq.com/community/develop/article/doc/000242e804c6186fb679e6c7652813

--↓↓👍点赞是回答的动力哦

回到顶部