查询调整

dev
caolin 2023-08-24 01:20:02 +08:00
parent 07470c037d
commit 5cf311efea
3 changed files with 6 additions and 16 deletions

View File

@ -73,13 +73,8 @@ public class AppletPayController {
/** 构建service */ /** 构建service */
private JsapiServiceExtension createService() { private JsapiServiceExtension createService() {
ClassPathResource keyClassPath = new ClassPathResource("/wechatpay/apiclient_key.pem"); String privateKeyPath = this.getClass().getClassLoader().getResource("wechatPay/apiclient_key.pem").getPath();;
String privateKeyPath = null;
try {
privateKeyPath = keyClassPath.getURL().getPath();
} catch (IOException e) {
throw new RuntimeException(e);
}
Config config = Config config =
new RSAAutoCertificateConfig.Builder() new RSAAutoCertificateConfig.Builder()
.merchantId(wechatPayConfig.getMchId()) .merchantId(wechatPayConfig.getMchId())

View File

@ -73,13 +73,8 @@ public class H5PayController {
} }
private H5Service createService() { private H5Service createService() {
ClassPathResource keyClassPath = new ClassPathResource("/wechatpay/apiclient_key.pem"); String privateKeyPath = this.getClass().getClassLoader().getResource("wechatPay/apiclient_key.pem").getPath();;
String privateKeyPath = null;
try {
privateKeyPath = keyClassPath.getURL().getPath();
} catch (IOException e) {
throw new RuntimeException(e);
}
Config config = Config config =
new RSAAutoCertificateConfig.Builder() new RSAAutoCertificateConfig.Builder()
.merchantId(wechatPayConfig.getMchId()) .merchantId(wechatPayConfig.getMchId())

View File

@ -26,8 +26,8 @@ public class WechatPayTest {
@Test @Test
void createService() throws IOException { void createService() throws IOException {
ClassPathResource keyClassPath = new ClassPathResource("/wechatpay/apiclient_key.pem");
String privateKeyPath = keyClassPath.getURL().getPath(); String privateKeyPath = this.getClass().getClassLoader().getResource("wechatPay/apiclient_key.pem").getPath();
Config config = Config config =
new RSAAutoCertificateConfig.Builder() new RSAAutoCertificateConfig.Builder()
.merchantId(wechatPayConfig.getMchId()) .merchantId(wechatPayConfig.getMchId())