微信支付 统一下单 签名错误
微信支付 统一下单 签名错误,使用微信官方工具验证也成功 WXConfig config=new WXConfig(); WXPay wxPay=new WXPay(config); System.out.println(config.getKey()); SortedMap<String, String> reqData =new TreeMap<String, String>(); reqData.put("appid", config.getAppID()); reqData.put("mch_id", config.getMchID()); reqData.put("nonce_str", WXPayUtil.generateNonceStr()); reqData.put("body","test"); reqData.put("out_trade_no",new Date().getTime()+""); reqData.put("total_fee","1"); reqData.put("spbill_create_ip",config.getIp()); reqData.put("notify_url",config.getNotifyUrl()); reqData.put("trade_type","APP"); String sign = WXPayUtil.generateSignature(reqData, config.getKey(), WXPayConstants.SignType.HMACSHA256); reqData.put("sign", sign); System.out.println(reqData); Map<String, String> resp = wxPay.unifiedOrder(reqData); System.out.println(resp);