From bd6229ebd9cb543a22944ecb1142fad92b675dce Mon Sep 17 00:00:00 2001 From: rk <94314517@qq.com> Date: 星期一, 13 十月 2025 14:26:25 +0800 Subject: [PATCH] bug 修复 --- server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java b/server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java index 322a247..e9edac5 100644 --- a/server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java +++ b/server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java @@ -12,6 +12,9 @@ import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl; import com.wechat.pay.java.core.Config; import com.wechat.pay.java.core.RSAAutoCertificateConfig; +import com.wechat.pay.java.core.RSAPublicKeyConfig; +import com.wechat.pay.java.core.http.HostName; +import com.wechat.pay.java.core.notification.RSAPublicKeyNotificationConfig; import com.wechat.pay.java.service.billdownload.BillDownloadService; import com.wechat.pay.java.service.partnerpayments.jsapi.JsapiService; import com.wechat.pay.java.service.partnerpayments.jsapi.JsapiServiceExtension; @@ -79,13 +82,26 @@ public void load_wxPayService() { try { Config config = - new RSAAutoCertificateConfig.Builder() + new RSAPublicKeyConfig.Builder() .merchantId(wxPayProperties.getMchId()) .privateKeyFromPath(wxPayProperties.getPrivateKeyPath()) + .publicKeyFromPath(wxPayProperties.getPubKeyPath()) + .publicKeyId(wxPayProperties.getPayPublicKeyId()) .merchantSerialNumber(wxPayProperties.getSerialNumer()) .apiV3Key(wxPayProperties.getApiV3Key()) .build(); - this.wxPayService = new JsapiService.Builder().config(config).build(); + + +// Config config = +// new RSAAutoCertificateConfig.Builder() +// .merchantId(wxPayProperties.getMchId()) +// .privateKeyFromPath(wxPayProperties.getPrivateKeyPath()) +//// .publicKeyFromPath(wxPayProperties.getPubKeyPath()) +//// .publicKeyId("PUB_KEY_ID_0117000719222024112700219100000508") +// .merchantSerialNumber(wxPayProperties.getSerialNumer()) +// .apiV3Key(wxPayProperties.getApiV3Key()) +// .build(); +// this.wxPayService = new JsapiService.Builder().config(config).build(); this.jsapiExtService = new JsapiServiceExtension.Builder().config(config).build(); this.refundService = new RefundService.Builder().config(config).build(); -- Gitblit v1.9.3