网站优化公司_深圳网络推广方案_做做网站_手机商城系统

北京网络推广

广州网站推广、网页设计要多少钱、永久使用、不限域名、台州网页设计

西安网站制作哪家好?

网站优化公司_深圳网络推广方案_做做网站_手机商城系统

public class WechatPayRequest {@Resourceprivate CloseableHttpClient wxPayClient;public String wechatHttpGet(String url) {try {// 拼接请求参数HttpGet httpGet = new HttpGet(url);httpGet.setHeader("Accept", "application/json");//完成签名并执行请求CloseableHttpResponse response = wxPayClient.execute(httpGet);return getResponseBody(response);}catch (Exception e){throw new RuntimeException(e.getMessage());}}public String wechatHttpPost(String url,String paramsStr) {try {HttpPost httpPost = new HttpPost(url);StringEntity entity = new StringEntity(paramsStr, "utf-8");entity.setContentType("application/json");httpPost.setEntity(entity);httpPost.setHeader("Accept", "application/json");CloseableHttpResponse response = wxPayClient.execute(httpPost);return getResponseBody(response);}catch (Exception e){throw new RuntimeException(e.getMessage());}}private String getResponseBody(CloseableHttpResponse response) throws IOException {//响应体HttpEntity entity = response.getEntity();String body = entity==null?"":EntityUtils.toString(entity);//响应状态码int statusCode = response.getStatusLine().getStatusCode();//处理成功,204是,关闭订单时微信返回的正常状态码if (statusCode == HttpStatus.SC_OK || statusCode == HttpStatus.SC_NO_CONTENT) {log.info("成功, 返回结果 = " + body);} else {String msg = "微信支付请求失败,响应码 = " + statusCode + ",返回结果 = " + body;log.error(msg);throw new RuntimeException(msg);}return body;} 吴江seo天津网站优化长沙域名注册青岛建网站公司南宁网站优化如何建购物网站东莞网络营销公司重庆seo公司创建企业网站哪里网页建设便宜seo网站系统廊坊百度优化福州网站优化自贡网络推广东莞网站seo公司中企动力网站东莞seo优化推广深圳网站优化哪家好泰州seo重庆seo俱乐部上海网站优化排名网站建设价格狂人站群系统凡科建站官网模板建站北京网站优化关键词昆明seo东门网网站推广公司上海seo公司哪家好

猜你喜欢