Javen205 / IJPay

IJPay 让支付触手可及,封装了微信支付、QQ支付、支付宝支付、京东支付、银联支付、PayPal 支付等常用的支付方式以及各种常用的接口。不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。右上角点下小星星✨
http://javen205.gitee.io/ijpay
Apache License 2.0
5.51k stars 1.35k forks source link

v3接口在Spring Boot Jar包模式下无法读取证书 #49

Closed Relax9 closed 2 years ago

Relax9 commented 3 years ago

版本信息

IJPayHttpResponse response = WxPayApi.v3(
                    RequestMethod.POST,
                    WxDomain.CHINA.toString(),
                    WxApiType.JS_API_PAY.toString(),
                    wechatPaymentPlatform.getMchId(),
                    getSerialNumber(wechatPaymentPlatform),
                    null,
                    wechatPaymentPlatform.getApiClientKeyPath(),
                    JSONUtil.toJsonStr(unifiedOrderModel)

cn.hutool.core.io.IORuntimeException: File not exist: /home/web/payment/target/payment-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/config/v3-dev/apiclient_key.pem
    at cn.hutool.core.io.file.FileReader.checkFile(FileReader.java:300)
    at cn.hutool.core.io.file.FileReader.<init>(FileReader.java:57)
    at cn.hutool.core.io.file.FileReader.create(FileReader.java:37)
    at cn.hutool.core.io.FileUtil.readString(FileUtil.java:1872)
    at cn.hutool.core.io.FileUtil.readString(FileUtil.java:1896)
    at cn.hutool.core.io.FileUtil.readUtf8String(FileUtil.java:1848)
    at com.ijpay.core.kit.PayKit.getPrivateKey(PayKit.java:413)
    at com.ijpay.core.kit.PayKit.createSign(PayKit.java:352)
    at com.ijpay.core.kit.WxPayKit.buildAuthorization(WxPayKit.java:444)
    at com.ijpay.wxpay.WxPayApi.v3(WxPayApi.java:253)
    at com.ijpay.wxpay.WxPayApi.v3(WxPayApi.java:337)

问题描述(包括回显步骤、截图 )

Spring Boot Jar包部署在Linux时无法正常读取证书,IDEA开发情况下是正常的。

预期效果描述

Linux也应该可以读取到证书。

交流群

Javen205 commented 2 years ago

参考 https://github.com/Javen205/IJPay/issues/37