使用的是官方sdk
public static void main(String[] args) throws Exception {
WXPay wxPay= new WXPay(new WXPayConfig() {
@Override
String getAppID() {
return "wxaa71xxxxxxxxxx";
}
@Override
String getMchID() {
return "154xxxxx";
}
@Override
String getKey() {
return "y8JSXFo3Dxkgxxxxxxxxxxxxxxxxxx";
}
@Override
InputStream getCertStream() {
return null;
}
@Override
IWXPayDomain getWXPayDomain() {
return new IWXPayDomain() {
public void report(String domain, long elapsedTimeMillis, Exception ex) {
}
public DomainInfo getDomain(WXPayConfig config) {
return new DomainInfo("api.mch.weixin.qq.com",false);
}
};
}
},false);
HashMap<String,String> reqData = new HashMap<String, String>();
reqData.put("out_order_no","2021012309053671549668839");
Map<String,String> res = wxPay.orderQuery(reqData);
System.out.println(res);
}
返回结果
{return_msg=0参数格式错误, return_code=FAIL}
我也是这个问题 楼主找到错误了吗,求解决方法