** //支付接口
public boolean pay() throws IllegalAccessException {
PayWayRecord payWayRecord = psyService.getPayWay(PayWayEnum.TONGTONG.getCode());
Map sendParams = new LinkedHashMap<>();
Date date = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sendParams.put("app_id", "123123");
sendParams.put("terminal_type", " web");
sendParams.put("version", "1.0");
sendParams.put("service", "fosun.sumpay.cashier.web.trade.order.apply");
sendParams.put("timestamp", simpleDateFormat.format(date.getTime()));
sendParams.put("trade_code", "T0002");
sendParams.put("user_id", "111");
sendParams.put("mer_id", "100001465");
sendParams.put("order_time", simpleDateFormat.format(date.getTime()));
sendParams.put("order_amount", "100");
sendParams.put("need_notify", "1");
sendParams.put("need_return", "1");
sendParams.put("goods_name", "1345");
sendParams.put("goods_num", "1");
sendParams.put("goods_type", "1");
sendParams.put("amount", "");
sendParams.put("mer_mo", "100001465");
String Text=sign(sendParams);
String signMsg = SignTool.signMsg1(Text,privateKeyPath,passWord,charset);
System.out.println(signMsg+"====================");
sendParams.put("sign_type", "CERT");
sendParams.put("sign", signMsg);
FormBody.Builder form = new FormBody.Builder();
for (String key : sendParams.keySet()) {
form.add(key, sendParams.get(key));
}
RequestBody body = form.build();
logger.info("[create tongtong deal] formBody is {}", body.toString());
//okhttp3.Request.Builder builder=new okhttp3.Request.Builder().url("").post(body);
Request request = new Request.Builder()
.url(TEST_URL)
.post(body)
.build();
try {
Response response = client.newCall(request).execute();
String returnMsg = response.body().string();
System.out.println("回调返回为============="+returnMsg);
if (response.isSuccessful()) {
logger.info("[TONG query] response is {}", returnMsg);
Map params = psyService.paramsToMap(returnMsg);
System.out.println("输出====="+params.get("resp_code"));
if ("000000".equals(params.get("resp_code"))) {
System.out.println("wqeqweqwe");
}
} else {
logger.error("[huifu query] failed, response is {}", returnMsg);
}
} catch (IOException e) {
e.printStackTrace();
}
代码已经贴上望大神指点