mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-20 16:06:13 +08:00
2.14.3-b4
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>com.egzosn</groupId>
|
||||
<artifactId>{module-name}</artifactId>
|
||||
<version>2.14.3-b3</version>
|
||||
<version>2.14.3-b4</version>
|
||||
</dependency>
|
||||
|
||||
```
|
||||
|
||||
@@ -136,11 +136,10 @@ public class BaiduPayService extends BasePayService<BaiduPayConfigStorage> {
|
||||
*
|
||||
* @param publicKey 公钥原始字符串
|
||||
* @return X509标准公钥
|
||||
* @throws InvalidKeySpecException
|
||||
* @throws NoSuchAlgorithmException
|
||||
* @throws InvalidKeySpecException InvalidKeySpecException
|
||||
* @throws NoSuchAlgorithmException NoSuchAlgorithmException
|
||||
*/
|
||||
private static PublicKey getPublicKeyX509(String publicKey) throws InvalidKeySpecException,
|
||||
NoSuchAlgorithmException {
|
||||
private static PublicKey getPublicKeyX509(String publicKey) throws InvalidKeySpecException, NoSuchAlgorithmException {
|
||||
if (StringUtils.isEmpty(publicKey)) {
|
||||
return null;
|
||||
}
|
||||
@@ -154,7 +153,7 @@ public class BaiduPayService extends BasePayService<BaiduPayConfigStorage> {
|
||||
*
|
||||
* @param params 待签名参数集合
|
||||
* @return 待签名内容
|
||||
* @throws UnsupportedEncodingException
|
||||
* @throws UnsupportedEncodingException UnsupportedEncodingException
|
||||
*/
|
||||
private String signContent(Map<String, Object> params) throws UnsupportedEncodingException {
|
||||
Map<String, String> sortedParams = new TreeMap<>(new Comparator<String>() {
|
||||
@@ -198,22 +197,6 @@ public class BaiduPayService extends BasePayService<BaiduPayConfigStorage> {
|
||||
return StringUtils.isNotBlank(key) && !SIGN_KEY.equalsIgnoreCase(key);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验证签名
|
||||
*
|
||||
* @param params 参数集
|
||||
* @param sign 签名原文
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean signVerify(Map<String, Object> params, String sign) {
|
||||
String rsaSign = String.valueOf(params.get(RSA_SIGN));
|
||||
String targetRsaSign = getRsaSign(params, RSA_SIGN);
|
||||
LOG.debug("百度返回的签名: " + rsaSign + " 本地产生的签名: " + targetRsaSign);
|
||||
return StringUtils.equals(rsaSign, targetRsaSign);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回创建的订单信息
|
||||
*
|
||||
|
||||
@@ -76,8 +76,8 @@ public class AliPayController {
|
||||
//设置证书存储方式,这里为路径
|
||||
aliPayConfigStorage.setCertStoreType(CertStoreType.CLASS_PATH);
|
||||
aliPayConfigStorage.setMerchantCert("ali/appCertPublicKey_2016080400165436.crt");
|
||||
aliPayConfigStorage.setAliPayCert("ali/alipayCertPublicKey_RSA2.crt");
|
||||
aliPayConfigStorage.setAliPayRootCert("ali/alipayRootCert.crt");
|
||||
aliPayConfigStorage.setAliPayCert("ali/alipayCertPublicKey_RSA2.crt");
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
|
||||
Reference in New Issue
Block a user