记得上下班打卡 | git大法好,push需谨慎

Commit 77b920c8 authored by anjiabin's avatar anjiabin

修改dragon配置

parent bf56744a
...@@ -71,6 +71,8 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy { ...@@ -71,6 +71,8 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
//构造支付请求xml //构造支付请求xml
String data = PayWepayUtils.getInstance().getRequestXml(parameters); String data = PayWepayUtils.getInstance().getRequestXml(parameters);
log.info("dragonPay:wepay:"+dragonPayBaseReqDto.getDeviceFrom()+" request jsondata: {} ",data);
HttpPost httpost = new HttpPost(this.getRequestUrl()); HttpPost httpost = new HttpPost(this.getRequestUrl());
httpost.setEntity(new StringEntity(data, "UTF-8")); httpost.setEntity(new StringEntity(data, "UTF-8"));
CloseableHttpResponse response = PayWepayUtils.getInstance().getHttpClient().execute(httpost); CloseableHttpResponse response = PayWepayUtils.getInstance().getHttpClient().execute(httpost);
...@@ -78,8 +80,15 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy { ...@@ -78,8 +80,15 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
//接受到返回信息 //接受到返回信息
String xmlStr = EntityUtils.toString(response.getEntity(), "UTF-8"); String xmlStr = EntityUtils.toString(response.getEntity(), "UTF-8");
EntityUtils.consume(entity); EntityUtils.consume(entity);
log.info("dragonPay:wepay:"+dragonPayBaseReqDto.getDeviceFrom()+" response xmlStr: {} ",xmlStr); log.info("dragonPay:wepay:"+dragonPayBaseReqDto.getDeviceFrom()+" response jsonStr: {} ",xmlStr);
WepayPayRespDto respWepayDto= XmlUtil.toBean(xmlStr, WepayPayRespDto.class);
WepayPayRespDto respWepayDto= null;
try {
respWepayDto = XmlUtil.toBean(xmlStr, WepayPayRespDto.class);
} catch (Exception e) {
log.error("dragonPay:wepay:"+dragonPayBaseReqDto.getDeviceFrom()+" response format error: {} ",e);
throw new LiquidnetServiceException(DragonErrorCodeEnum.TRADE_PARAM_ERROR.getCode(),DragonErrorCodeEnum.TRADE_PARAM_ERROR.getMessage());
}
if(WepayConstant.WeixinTradeStateEnum.SUCCESS.getCode().equalsIgnoreCase(respWepayDto.getReturnCode())){ if(WepayConstant.WeixinTradeStateEnum.SUCCESS.getCode().equalsIgnoreCase(respWepayDto.getReturnCode())){
if(WepayConstant.WeixinTradeStateEnum.SUCCESS.getCode().equalsIgnoreCase(respWepayDto.getResultCode())){ if(WepayConstant.WeixinTradeStateEnum.SUCCESS.getCode().equalsIgnoreCase(respWepayDto.getResultCode())){
//构造公共返回参数 //构造公共返回参数
......
...@@ -31,7 +31,6 @@ public class WepayStrategyAppletImpl extends AbstractWepayStrategy{ ...@@ -31,7 +31,6 @@ public class WepayStrategyAppletImpl extends AbstractWepayStrategy{
@Override @Override
SortedMap<String, Object> appendRequestParam(SortedMap<String, Object> requestMap) { SortedMap<String, Object> appendRequestParam(SortedMap<String, Object> requestMap) {
requestMap.put("trade_type", "JSAPI"); requestMap.put("trade_type", "JSAPI");
requestMap.put("openid", requestMap.get("openId"));
requestMap.put("appid", PayWepayUtils.getInstance().getAPPLET_APP_ID()); requestMap.put("appid", PayWepayUtils.getInstance().getAPPLET_APP_ID());
return requestMap; return requestMap;
} }
......
...@@ -31,7 +31,6 @@ public class WepayStrategyJsImpl extends AbstractWepayStrategy{ ...@@ -31,7 +31,6 @@ public class WepayStrategyJsImpl extends AbstractWepayStrategy{
@Override @Override
SortedMap<String, Object> appendRequestParam(SortedMap<String, Object> requestMap) { SortedMap<String, Object> appendRequestParam(SortedMap<String, Object> requestMap) {
requestMap.put("trade_type", "JSAPI"); requestMap.put("trade_type", "JSAPI");
requestMap.put("openid", requestMap.get("openId"));
requestMap.put("appid", PayWepayUtils.getInstance().getJS_APP_ID()); requestMap.put("appid", PayWepayUtils.getInstance().getJS_APP_ID());
return requestMap; return requestMap;
} }
......
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