String signature=getSignature(method,canonicalUrl,jsonData,nonceStr,timestamp);
String authorization="mchid=\"" + wxMchServerConfig.getMchId() + "\","
+ "nonce_str=\"" + nonceStr + "\","
+ "timestamp=\"" + timestamp + "\","
+ "serial_no=\"" + wxMchServerConfig.getSerialNo() + "\","
+ "signature=\"" + signature + "\"";
Map<String,String> headers=new HashMap<>();
headers.put("Authorization","WECHATPAY2-SHA256-RSA2048"+" "+authorization);
headers.put("Content-Type" ,"application/json");
headers.put("User-Agent","WechatPay-TEST-HttpClient");
if(isWxpaySerial){
//需要实时获取证书
Certificates certificates=this.getCertificates();
if(certificates==null)
throw new WxException("证书获取失败");
String WechatpaySerial=certificates.getData().get(0).getSerial_no();
headers.put("Wechatpay-Serial",WechatpaySerial);
}
请注意:
1、header里面的 wechatpay-serial 需要实时获取
2、authorization里的serial_no 我用的是平台里获取的
参考:https://developers.weixin.qq.com/community/develop/article/doc/000a2a98030b0008d5ea3e03c5f413
只有服务商才有特约商户进件
你好, 问下特约商户进件必须去微信服务商里申请? 还是特约商户进件接口