支付宝参数设置

This commit is contained in:
Guoqs
2024-06-07 11:33:26 +08:00
parent 94abb13a1a
commit 38a8cd884d
14 changed files with 216 additions and 71 deletions

View File

@@ -127,6 +127,11 @@ public class Constants {
public static final String ZERO_THREE = "03";
/**
* RSA2签名算法
*/
public static final String RSA2 = "RSA2";
/**
* UTF-8 字符集
*/
@@ -137,15 +142,24 @@ public class Constants {
*/
public static final String GBK = "GBK";
/**
* URL分隔符
*/
public static final String URL_DELIMITER = "://";
public static final String HTTP = "http";
public static final String HTTPS = "https";
/**
* http请求
*/
public static final String HTTP = "http://";
public static final String HTTP_PREFIX = HTTP + URL_DELIMITER;
/**
* https请求
*/
public static final String HTTPS = "https://";
public static final String HTTPS_PREFIX = HTTPS + URL_DELIMITER;
/**
* 通用成功标识

View File

@@ -224,7 +224,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
* @return 结果
*/
public static boolean isHttp(String link) {
return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS);
return StringUtils.startsWithAny(link, Constants.HTTP_PREFIX, Constants.HTTPS_PREFIX);
}
/**
@@ -234,10 +234,10 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
*/
public static String removeHttp(String link) {
String result;
if (StringUtils.startsWith(link, Constants.HTTP)) {
result = link.replace(Constants.HTTP, "");
} else if (StringUtils.startsWith(link, Constants.HTTPS)) {
result = link.replace(Constants.HTTPS, "");
if (StringUtils.startsWith(link, Constants.HTTP_PREFIX)) {
result = link.replace(Constants.HTTP_PREFIX, "");
} else if (StringUtils.startsWith(link, Constants.HTTPS_PREFIX)) {
result = link.replace(Constants.HTTPS_PREFIX, "");
} else {
result = link;
}
@@ -604,4 +604,17 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
return false;
}
/**
* This method removes '://' from the given URL string.
*
* @param url the URL string to be processed
* @return the processed URL string without '://'
*/
public static String removeDelimiter(String url) {
if (url == null) {
return null;
}
return url.replace(Constants.URL_DELIMITER, "");
}
}