// 获取sandbox_signkey
Map<String, String> param1 = new HashMap<String, String>();
param1.put(WXPayConstants.MCH_ID, wXPayConfig.getMchID());// 商户号
param1.put(WXPayConstants.NONCE_STR, WXPayUtil.generateNonceStr());// 随机字符串
param1.put("sign", WXPayUtil.generateSignature(param1, "商户正式环境的key",WXPayConstants.SignType.MD5));// 沙盒测试貌似只支持MD5加密
String xml="";
try {
xml = WXPayUtil.mapToXml(param1);
} catch (Exception e) {
e.printStackTrace();
}
Map<String, String> result1 = wXPayRequest.requestTryManyTimes(
"/sandboxnew/pay/getsignkey", "12134", xml, 1000, 2000, 3, wXPayConfig);
System.out.println("sandbox_signkey:"+result1.get("sandbox_signkey"));