mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-10 14:56:06 +08:00
fix 证书工具类更新
This commit is contained in:
@@ -4,10 +4,11 @@ import cn.hutool.core.codec.Base64Encoder;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
import javax.security.cert.X509Certificate;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.PublicKey;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateFactory;
|
||||
|
||||
/**
|
||||
* 证书工具类
|
||||
@@ -23,8 +24,8 @@ public class CertUtil {
|
||||
*/
|
||||
@SneakyThrows
|
||||
public String getCertByContent(String certContent) {
|
||||
X509Certificate cert = X509Certificate
|
||||
.getInstance(new ByteArrayInputStream(certContent.getBytes(StandardCharsets.UTF_8)));
|
||||
CertificateFactory cf = CertificateFactory. getInstance("X.509");
|
||||
Certificate cert = cf.generateCertificate(new ByteArrayInputStream(certContent.getBytes(StandardCharsets.UTF_8)));
|
||||
PublicKey publicKey = cert.getPublicKey();
|
||||
return Base64Encoder.encode(publicKey.getEncoded());
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.alipay.api.AlipayApiException;
|
||||
import com.alipay.api.AlipayConstants;
|
||||
import com.alipay.api.internal.util.AlipaySignature;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -92,7 +91,6 @@ public class AliPayCallbackService {
|
||||
/**
|
||||
* 验证信息格式是否合法
|
||||
*/
|
||||
@SneakyThrows
|
||||
public boolean verifyNotify() {
|
||||
Map<String, String> params =PaymentContextLocal.get().getCallbackInfo().getCallbackParam();
|
||||
String callReq = JSONUtil.toJsonStr(params);
|
||||
|
||||
@@ -165,8 +165,6 @@ public class AliPaySyncService {
|
||||
model.setOutBizNo(transferOrder.getTransferNo());
|
||||
request.setBizModel(model);
|
||||
AlipayFundTransCommonQueryResponse response = alipayClient.execute(request);
|
||||
System.out.println(response.getBody());
|
||||
return new TransferSyncResult().setStatus(TransferStatusEnum.FAIL.getCode());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user