Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

拉取评论签名长度错误 #1148

Closed
Ziyear opened this issue Aug 7, 2019 · 4 comments
Closed

拉取评论签名长度错误 #1148

Ziyear opened this issue Aug 7, 2019 · 4 comments

Comments

@Ziyear
Copy link

Ziyear commented Aug 7, 2019

简要描述

拉取评论签名长度错误

模块版本情况

  • WxJava 模块名: 【pay】
  • WxJava 版本号: 【3.4.0】

详细描述

com.github.binarywang.wxpay.service.impl.BaseWxPayServiceImpl#queryComment(com.github.binarywang.wxpay.bean.request.WxPayQueryCommentRequest)
方法的设置签名类型应该在生成签名之前,测试使用WxPayQueryCommentRequest并设置签名类型后通过

@binarywang
Copy link
Owner

出错不是因为你的用法有问题吗?

@binarywang
Copy link
Owner

请准确详细描述下你的问题

@Ziyear
Copy link
Author

Ziyear commented Aug 8, 2019

不是用法问题,是代码中这个设置签名类型应该在签名之前,不好意思不能上传图片,这个错误我刚提交了代码

@Ziyear
Copy link
Author

Ziyear commented Aug 8, 2019

  @Override
  public String queryComment(WxPayQueryCommentRequest request) throws WxPayException {
    request.checkAndSign(this.getConfig());
    request.setSignType(SignType.HMAC_SHA256);

    String url = this.getPayBaseUrl() + "/billcommentsp/batchquerycomment";
    String responseContent = this.post(url, request.toXML(), true);
    if (responseContent.startsWith("<")) {
      throw WxPayException.from(BaseWxPayResult.fromXML(responseContent, WxPayCommonResult.class));
    }

    return responseContent;
  }

request.setSignType(SignType.HMAC_SHA256);应该在上边

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants