| | |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * 查询转账情况 |
| | | * |
| | | * @param requestUrl 请求路径 |
| | | * @param requestJson 组合参数 |
| | | * @param wechatPayserialNo 商户证书序列号 |
| | | * @param privatekeypath 商户私钥证书路径 |
| | | */ |
| | | public static String queryTransBatRequest( |
| | | String requestUrl, |
| | | |
| | | String wechatPayserialNo, |
| | | String mchId, |
| | | String privatekeypath, String url) { |
| | | CloseableHttpResponse response; |
| | | HttpEntity entity; |
| | | CloseableHttpClient httpClient = null; |
| | | try { |
| | | HttpGet httpGet = createHttpGet(requestUrl, wechatPayserialNo, mchId, privatekeypath, url); |
| | | httpClient = HttpClients.createDefault(); |
| | | //发起转账请求 |
| | | response = httpClient.execute(httpGet); |
| | | log.info("response:{}", response); |
| | | //获取返回的数据 |
| | | entity = response.getEntity(); |
| | | log.info("-----getHeaders.Request-ID:" + response.getHeaders("Request-ID")); |
| | | return EntityUtils.toString(entity); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | // 关闭流 |
| | | try { |
| | | if (httpClient != null) { |
| | | httpClient.close(); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |