Authored by LUOXC

refactor

... ... @@ -24,6 +24,8 @@ import org.springframework.beans.factory.annotation.Value;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.*;
... ... @@ -672,6 +674,17 @@ public abstract class AlipayServiceAbstract extends AbstractPayService {
* @return
*/
private String getSignString(Map<String, String> paramsMap) {
return getSignString(paramsMap, StandardCharsets.UTF_8);
}
/**
* 获取支付宝回调待签名字符串
* @param paramsMap
* @return
*/
private String getSignString(Map<String, String> paramsMap, Charset charset) {
if(null == paramsMap) {
return "";
}
... ... @@ -685,11 +698,7 @@ public abstract class AlipayServiceAbstract extends AbstractPayService {
if(StringUtils.isEmpty(entry.getValue())) {
continue;
}
try {
sortMap.put(entry.getKey(), new String(entry.getValue().getBytes("ISO-8859-1")));
} catch (UnsupportedEncodingException e) {
logger.error("解析支付宝回调参数出错:key={}, msg= {}",entry.getKey(), e.getMessage());
}
sortMap.put(entry.getKey(), new String(entry.getValue().getBytes(charset)));
}
return getUrlString(sortMap);
... ...