登录你的商户平台,获取证书的下方有秘钥,将你的秘钥重置一下就好了,这个问题具体处在那里,我也不知道,参数都对过验签也验证过都没问题。
统一下单接口返回 return_msg=签名错误, return_code=FAILtry { WXPay wxpay; WXPayConfigImpl wxPayConfig = new WXPayConfigImpl(); wxpay = new WXPay(wxPayConfig); Map<String, String> data = new HashMap<String,String>(); data.put("body", "tiaoshishenghuo"); data.put("appid", wxPayConfig.getAppID()); data.put("mch_id",wxPayConfig.getMchID()); data.put("out_trade_no", orderGid); data.put("total_fee","1"); data.put("notify_url",notifyurl); data.put("spbill_create_ip", "123.12.12.123"); data.put("openid", param.getOpenId()); data.put("trade_type", "JSAPI"); data.put("nonce_str",nonceStr); String unisign = WXPayUtil.generateSignature(data, wxPayConfig.getKey()); data.put("sign",unisign); logger.info(data.toString()); Map<String, String> mapresp = wxpay.unifiedOrder(data); logger.info(mapresp.toString()); } 最后生成的数据为 {nonce_str=aGHsZMQOROWpFDKSGHDlrxhdnkar3uNW, out_trade_no=3dab120b8c444bd1bc18e91577da129d, openid=oKFQQwDhRIlRg71G6WfASmTUqd5w, appid=wxb171091d37ab3122, total_fee=1, sign=74D1BF93D3ECE551750707C8F6F7BC38, trade_type=JSAPI, body=tiaoshishenghuo, mch_id=1574429891, notify_url=https://tiaoshi.tiaoshishenghuo.com/, spbill_create_ip=123.12.12.123} 通过微信官网验证签名 sign ,完全正确 但是提交 Map<String, String> mapresp = wxpay.unifiedOrder(data); 一直返回 {return_msg=签名错误, return_code=FAIL} JAVA SDK 用的是官网下载的 java_sdk_v3.0.9 请教是什么问题呢?
2020-12-16