|
@@ -122,7 +122,6 @@ public class WxService {
|
|
|
data.put("openid", openId); // 微信公众号统一标示openid
|
|
data.put("openid", openId); // 微信公众号统一标示openid
|
|
|
data.put("notify_url", notifyUrl); // 订单结果通知, 微信主动回调此接口
|
|
data.put("notify_url", notifyUrl); // 订单结果通知, 微信主动回调此接口
|
|
|
data.put("trade_type", "JSAPI"); // 固定填写
|
|
data.put("trade_type", "JSAPI"); // 固定填写
|
|
|
- LoggerUtils.debug(getClass(), "发起微信支付下单接口, request=%s",data);
|
|
|
|
|
Map<String, String> response = wxpay.unifiedOrder(data); // 微信sdk集成方法, 统一下单接口unifiedOrder, 此处请求 MD5加密 加密方式
|
|
Map<String, String> response = wxpay.unifiedOrder(data); // 微信sdk集成方法, 统一下单接口unifiedOrder, 此处请求 MD5加密 加密方式
|
|
|
LoggerUtils.debug(getClass(),"微信支付下单成功, 返回值 response=%s", response);
|
|
LoggerUtils.debug(getClass(),"微信支付下单成功, 返回值 response=%s", response);
|
|
|
String prepayId = response.get("prepay_id");
|
|
String prepayId = response.get("prepay_id");
|
|
@@ -246,7 +245,6 @@ public class WxService {
|
|
|
while((line = reader.readLine()) != null) {
|
|
while((line = reader.readLine()) != null) {
|
|
|
sb.append(line);
|
|
sb.append(line);
|
|
|
}
|
|
}
|
|
|
- LoggerUtils.debug(getClass(),"accept wechat pay return message , {}" , sb.toString());
|
|
|
|
|
// 2、xml字符串 转换为 map对象
|
|
// 2、xml字符串 转换为 map对象
|
|
|
Map<String, String> map = WXPayUtil.xmlToMap(sb.toString());
|
|
Map<String, String> map = WXPayUtil.xmlToMap(sb.toString());
|
|
|
LoggerUtils.debug(getClass(), "获取参数%s",map.toString());
|
|
LoggerUtils.debug(getClass(), "获取参数%s",map.toString());
|
|
@@ -397,7 +395,6 @@ public class WxService {
|
|
|
"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId,
|
|
"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId,
|
|
|
appSecret);
|
|
appSecret);
|
|
|
JSONObject js = this.httpGet(url);
|
|
JSONObject js = this.httpGet(url);
|
|
|
- LoggerUtils.debug(getClass(), String.format("返回参数={%s}", js.toJSONString()));
|
|
|
|
|
String errcode =js.getString("errcode");
|
|
String errcode =js.getString("errcode");
|
|
|
if (errcode!=null) {
|
|
if (errcode!=null) {
|
|
|
throw new BusinessException("获取AccessToekn失败!");
|
|
throw new BusinessException("获取AccessToekn失败!");
|
|
@@ -446,7 +443,6 @@ public class WxService {
|
|
|
}
|
|
}
|
|
|
String resultString = EntityUtils.toString(response.getEntity());
|
|
String resultString = EntityUtils.toString(response.getEntity());
|
|
|
JSONObject jsonObj = JSONObject.parseObject(resultString);
|
|
JSONObject jsonObj = JSONObject.parseObject(resultString);
|
|
|
- LoggerUtils.debug(getClass(), jsonObj.toJSONString());
|
|
|
|
|
return jsonObj;
|
|
return jsonObj;
|
|
|
} catch (ClientProtocolException e) {
|
|
} catch (ClientProtocolException e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|