增加注释

This commit is contained in:
egzosn
2017-10-17 10:47:32 +08:00
parent 90a72e316e
commit eb3a94efc8
6 changed files with 89 additions and 64 deletions

View File

@@ -33,11 +33,11 @@ import java.util.*;
* @see com.egzosn.pay.ali.api.AliPayService
*/
public class AliPayService extends BasePayService {
protected final Log log = LogFactory.getLog(AliPayService.class);
protected final Log LOG = LogFactory.getLog(AliPayService.class);
private String httpsReqUrl = "https://mapi.alipay.com/gateway.do";
private String queryReqUrl = "https://openapi.alipay.com/gateway.do";
private String HTTPS_REQ_URL = "https://mapi.alipay.com/gateway.do";
private String QUERY_REQ_URL = "https://openapi.alipay.com/gateway.do";
public AliPayService(PayConfigStorage payConfigStorage) {
super(payConfigStorage);
@@ -49,7 +49,7 @@ public class AliPayService extends BasePayService {
public String getHttpsVerifyUrl() {
return httpsReqUrl + "?service=notify_verify";
return HTTPS_REQ_URL + "?service=notify_verify";
}
/**
@@ -62,14 +62,14 @@ public class AliPayService extends BasePayService {
public boolean verify(Map<String, Object> params) {
if (params.get("sign") == null || params.get("notify_id") == null) {
log.debug("支付宝支付异常params" + params);
LOG.debug("支付宝支付异常params" + params);
return false;
}
try {
return signVerify(params, (String) params.get("sign")) && verifySource((String) params.get("notify_id"));
} catch (PayErrorException e) {
e.printStackTrace();
LOG.error(e);
}
return false;
@@ -299,7 +299,7 @@ public class AliPayService extends BasePayService {
StringBuffer formHtml = new StringBuffer();
formHtml.append("<form id=\"_alipaysubmit_\" name=\"alipaysubmit\" action=\"" )
.append( httpsReqUrl)
.append( HTTPS_REQ_URL)
.append( "?_input_charset=" )
.append( payConfigStorage.getInputCharset())
.append( "\" method=\"")
@@ -447,7 +447,7 @@ public class AliPayService extends BasePayService {
parameters.put("biz_content", JSON.toJSONString(bizContent));
//设置签名
setSign(parameters);
return callback.perform(requestTemplate.getForObject(queryReqUrl + "?" + UriVariables.getMapToParameters(parameters), JSONObject.class));
return callback.perform(requestTemplate.getForObject(QUERY_REQ_URL + "?" + UriVariables.getMapToParameters(parameters), JSONObject.class));
}
/**
@@ -521,7 +521,7 @@ public class AliPayService extends BasePayService {
parameters.put("biz_content", JSON.toJSONString(bizContent));
//设置签名
setSign(parameters);
return callback.perform(requestTemplate.getForObject(queryReqUrl + "?" + UriVariables.getMapToParameters(parameters), JSONObject.class));
return callback.perform(requestTemplate.getForObject(QUERY_REQ_URL + "?" + UriVariables.getMapToParameters(parameters), JSONObject.class));
}
/**
@@ -553,7 +553,7 @@ public class AliPayService extends BasePayService {
parameters.put("biz_content", getContentToJson(tradeNoOrBillDate.toString(), outTradeNoBillType));
//设置签名
setSign(parameters);
return callback.perform(requestTemplate.getForObject(queryReqUrl + "?" + UriVariables.getMapToParameters(parameters), JSONObject.class));
return callback.perform(requestTemplate.getForObject(QUERY_REQ_URL + "?" + UriVariables.getMapToParameters(parameters), JSONObject.class));
}