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

3.7.0刷脸支付,获取AuthInfo,对象里排序错误 com.github.binarywang.wxpay.bean.request.WxPayFaceAuthInfoRequest #1441

Closed
ln0491 opened this issue Mar 13, 2020 · 4 comments

Comments

@ln0491
Copy link

ln0491 commented Mar 13, 2020

3.7.0
错误

<xml>
  <appid>xxx</appid>
  <mch_id>xxx</mch_id>
  <nonce_str>xxx</nonce_str>
  <sign>xxx</sign>
  <store_id>1</store_id>
  <store_name>xxx</store_name>
  <device_id>xxx</device_id>
  <rawdata>xxxxx</rawdata>
  <now>1584095089</now>
  <version>1</version>
</xml>

微信返回错误

【响应数据】:<xml><return_code><![CDATA[PARAM_ERROR]]></return_code>
<return_msg><![CDATA[请按格式填写mch_id,appid以及sign_type]]></return_msg>
</xml>

获取获取微信刷脸调用凭证请求对象类
com.github.binarywang.wxpay.bean.request.WxPayFaceAuthInfoRequest

 @Override
  protected void storeMap(Map<String, String> map) {
    map.put("store_id", storeId);
    map.put("store_name", storeName);
    map.put("device_id", deviceId);
    map.put("attach", attach);
    map.put("rawdata", rawdata);
    map.put("now", now);
    map.put("version", version);
  }

以上顺序错误

正确顺序

<xml>
  <appid>xxx</appid>
  <mch_id>xxx</mch_id>
  <nonce_str>1584096192780</nonce_str>
  <sign>xxx</sign>
  <sign_type>MD5</sign_type>
  <now>1584096192</now>
  <version>1</version>
  <rawdata>xxx</rawdata>
  <store_id>1</store_id>
  <store_name>xxx</store_name>
  <device_id>1191517560252948482</device_id>
  <attach>xxx</attach>
 </xml>
  @Override
  protected void storeMap(Map<String, String> map) {
     map.put("now", now);
	map.put("version", version);
	map.put("rawdata", rawdata);
    map.put("store_id", storeId);
    map.put("store_name", storeName);
    map.put("device_id", deviceId);
	map.put("attach", attach);

  }

项目已经上线,可以正常刷脸支付

@binarywang
Copy link
Owner

可以按你的代码修正,另外建议直接提交PR,如果你已经验证通过的话,这样可以节约时间

@binarywang
Copy link
Owner

3.7.3.B 版本已修复,欢迎使用新版本

@ln0491
Copy link
Author

ln0491 commented Mar 23, 2020

已经验证可以使用-最好说明下,刷脸支付时-获取AuthInfo这个接口,<sign_type>MD5</sign_type>这个为必传
微信的提示也是有问题,不传sign_type,会报错,

【响应数据】:<xml><return_code><![CDATA[PARAM_ERROR]]></return_code> <return_msg><![CDATA[请按格式填写mch_id,appid以及sign_type]]></return_msg>

@binarywang
Copy link
Owner

binarywang commented Mar 23, 2020

我又仔细看了下代码,那个map是hashmap,put的顺序不同怎么会对最终生成的xml有影响?

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