Commit e720aaf5 by zhenzijun

juhezhong接口补充

parent f70fb081
......@@ -41,6 +41,7 @@ public class JuHeZhongPayService {
public JSONObject orderQuery(JuhezhongDto dto) throws Exception {
Map<String, Object> params = JuhezhongUtils.juhezhongBaseDtoToMap(dto);
String respStr = HttpUtil.post(ComCode.JUHEZHONG_URL + ComCode.ORDER_QUERY, params);
System.out.println("字符串:"+respStr);
return JSONObject.parseObject(respStr);
}
......@@ -174,30 +175,39 @@ public class JuHeZhongPayService {
}
public static void main (String[] args) throws Exception {
// ApiQuickPayDto request = new ApiQuickPayDto();
// request.setAmount(10L);
// request.setBody("23");
// request.setFrontUrl("");
// request.setNotifyUrl("");
// request.setType(0);
// request.setName("");
// request.setUrl("");
//
// JuHeZhongPayService juHeZhongPayService = new JuHeZhongPayService();
// System.out.println(juHeZhongPayService.quickPay(request).toString());
ApiQuickPayDto dto = new ApiQuickPayDto();
dto.setOrderId("Dy58WqJG3MmNpSpQMq3wKZV55OiO48asPzRp4YUBBZUsVEiow7q6CZTQqwrBTl4k");
dto.setMerchantId(ComCode.MERCHANT_ID);
dto.setMerchantKey(ComCode.MERCHANT_KEY);
dto.setTimestamp(System.currentTimeMillis());
Map<String, Object> params = Bean2Map.Entity2Map(dto);
String signBefore = SignUtils.signBefore(params);
String sign = SignUtils.sign(signBefore, ComCode.MERCHANT_SECRET);
params.put("sign", sign);
String respStr = HttpUtil.post(ComCode.HOST + ComCode.ORDER_QUERY_URL, params);
System.out.println(respStr);
JuhezhongDto a = new JuhezhongDto();
a.setOrderId("Dy58WqJG3MmNpSpQMq3wKZV55OiO48asPzRp4YUBBZUsVEiow7q6CZTQqwrBTl4k");
a.setMerchantId(ComCode.MERCHANT_ID);
a.setMerchantKey(ComCode.MERCHANT_KEY);
a.setTimestamp(System.currentTimeMillis());
System.out.println("Json格式:"+new JuHeZhongPayService().orderQuery(a));
}
// public static void main (String[] args) throws Exception {
//// ApiQuickPayDto request = new ApiQuickPayDto();
//// request.setAmount(10L);
//// request.setBody("23");
//// request.setFrontUrl("");
//// request.setNotifyUrl("");
//// request.setType(0);
//// request.setName("");
//// request.setUrl("");
////
//// JuHeZhongPayService juHeZhongPayService = new JuHeZhongPayService();
//// System.out.println(juHeZhongPayService.quickPay(request).toString());
// ApiQuickPayDto dto = new ApiQuickPayDto();
// dto.setOrderId("Dy58WqJG3MmNpSpQMq3wKZV55OiO48asPzRp4YUBBZUsVEiow7q6CZTQqwrBTl4k");
// dto.setMerchantId(ComCode.MERCHANT_ID);
// dto.setMerchantKey(ComCode.MERCHANT_KEY);
// dto.setTimestamp(System.currentTimeMillis());
//
// Map<String, Object> params = Bean2Map.Entity2Map(dto);
// String signBefore = SignUtils.signBefore(params);
// String sign = SignUtils.sign(signBefore, ComCode.MERCHANT_SECRET);
// params.put("sign", sign);
// String respStr = HttpUtil.post(ComCode.HOST + ComCode.ORDER_QUERY_URL, params);
//
// System.out.println(respStr);
//
// }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment