|
@@ -8,6 +8,7 @@ import com.wechat.pay.java.service.payments.jsapi.model.*;
|
|
|
import com.wechat.pay.java.service.payments.model.Transaction;
|
|
|
import lombok.SneakyThrows;
|
|
|
|
|
|
+import java.net.URL;
|
|
|
import java.net.URLDecoder;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
@@ -50,8 +51,9 @@ public class WxPayApi {
|
|
|
|
|
|
@SneakyThrows
|
|
|
public void initMerchant() {
|
|
|
- String keyPath = WxPayApi.class.getClassLoader().getResource("").getPath() + privateKeyPath + "/apiclient_key.pem";
|
|
|
- keyPath = URLDecoder.decode(keyPath, StandardCharsets.UTF_8.toString());
|
|
|
+ // String keyPath = WxPayApi.class.getClassLoader().getResource("").getPath() + privateKeyPath + "/apiclient_key.pem";
|
|
|
+ // keyPath = URLDecoder.decode(keyPath, StandardCharsets.UTF_8.toString());
|
|
|
+ String keyPath="weChatPayKey/"+privateKeyPath+"/apiclient_key.pem";
|
|
|
Config config =
|
|
|
new RSAAutoCertificateConfig.Builder()
|
|
|
.merchantId(merchantId)
|
|
@@ -103,4 +105,5 @@ public class WxPayApi {
|
|
|
return service.queryOrderByOutTradeNo(request);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|