From 9570d5a642c669f3b430c77812720892830128eb Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期五, 22 八月 2025 10:29:59 +0800
Subject: [PATCH] 111
---
server/services/src/main/java/com/doumee/config/wx/WxMiniUtilService.java | 6 +-
server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java | 32 +++++++++-------
server/services/src/main/resources/application-test.yml | 7 ++-
server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java | 3 +
server/services/src/main/resources/application-dev.yml | 3 +
server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java | 23 +++++++++--
server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java | 2 +
server/web/src/main/resources/application.yml | 2
8 files changed, 52 insertions(+), 26 deletions(-)
diff --git a/server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java b/server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java
index b2ecae3..8539e1c 100644
--- a/server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java
+++ b/server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java
@@ -83,9 +83,17 @@
.body(body)
.build();
- NotificationConfig config = new RSAAutoCertificateConfig.Builder()
+ NotificationConfig config = /*new RSAAutoCertificateConfig.Builder()
.merchantId(WxMiniConfig.wxProperties.getMchId())
.privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath())
+ .merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer())
+ .apiV3Key(WxMiniConfig.wxProperties.getApiV3Key())
+ .build(); */
+ new RSAPublicKeyConfig.Builder()
+ .merchantId(WxMiniConfig.wxProperties.getMchId())
+ .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath())
+ .publicKeyFromPath(WxMiniConfig.wxProperties.getPubKeyPath())
+ .publicKeyId(WxMiniConfig.wxProperties.getPayPublicKeyId())
.merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer())
.apiV3Key(WxMiniConfig.wxProperties.getApiV3Key())
.build();
@@ -152,13 +160,20 @@
.body(body)
.build();
- NotificationConfig config = new RSAAutoCertificateConfig.Builder()
+ NotificationConfig config = /*new RSAAutoCertificateConfig.Builder()
.merchantId(WxMiniConfig.wxProperties.getMchId())
.privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath())
.merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer())
.apiV3Key(WxMiniConfig.wxProperties.getApiV3Key())
+ .build();*/
+ new RSAPublicKeyConfig.Builder()
+ .merchantId(WxMiniConfig.wxProperties.getMchId())
+ .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath())
+ .publicKeyFromPath(WxMiniConfig.wxProperties.getPubKeyPath())
+ .publicKeyId(WxMiniConfig.wxProperties.getPayPublicKeyId())
+ .merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer())
+ .apiV3Key(WxMiniConfig.wxProperties.getApiV3Key())
.build();
-
NotificationParser parser = new NotificationParser(config);
RefundNotification result = parser.parse(requestParam, RefundNotification.class);
@@ -194,7 +209,7 @@
.publicKeyFromPath(WxMiniConfig.wxProperties.getWechatPubKeyPath()) //寰俊鏀粯鍏挜鐨勫瓨鏀捐矾寰�
.publicKeyId(WxMiniConfig.wxProperties.getWechatPayPublicKeyId()) //寰俊鏀粯鍏挜ID
.merchantSerialNumber(WxMiniConfig.wxProperties.getWechatSerialNumer()) //鍟嗘埛API璇佷功搴忓垪鍙�
- .apiV3Key("7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB") //APIv3瀵嗛挜
+ .apiV3Key(WxMiniConfig.wxProperties.getWechatApiV3Key()) //APIv3瀵嗛挜
.build();
TransferDetailEntityNew entity = wxSuccessCallback(request,config);
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 a420a14..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;
@@ -78,27 +81,28 @@
*/
public void load_wxPayService() {
try {
-// Config config =
-// new RSAPublicKeyConfig.Builder()
-// .merchantId(wxPayProperties.getMchId())
-// .privateKeyFromPath(wxPayProperties.getPrivateKeyPath())
-// .publicKeyFromPath(wxPayProperties.getPubKeyPath())
-// .publicKeyId("PUB_KEY_ID_0117000719222024112700219100000508")
-// .merchantSerialNumber(wxPayProperties.getSerialNumer())
-// .apiV3Key(wxPayProperties.getApiV3Key())
-// .build();
-
-
Config config =
- new RSAAutoCertificateConfig.Builder()
+ new RSAPublicKeyConfig.Builder()
.merchantId(wxPayProperties.getMchId())
.privateKeyFromPath(wxPayProperties.getPrivateKeyPath())
-// .publicKeyFromPath(wxPayProperties.getPubKeyPath())
-// .publicKeyId("PUB_KEY_ID_0117000719222024112700219100000508")
+ .publicKeyFromPath(wxPayProperties.getPubKeyPath())
+ .publicKeyId(wxPayProperties.getPayPublicKeyId())
.merchantSerialNumber(wxPayProperties.getSerialNumer())
.apiV3Key(wxPayProperties.getApiV3Key())
.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();
this.billDownloadService = new BillDownloadService.Builder().config(config).build();
diff --git a/server/services/src/main/java/com/doumee/config/wx/WxMiniUtilService.java b/server/services/src/main/java/com/doumee/config/wx/WxMiniUtilService.java
index 4647c17..7be564e 100644
--- a/server/services/src/main/java/com/doumee/config/wx/WxMiniUtilService.java
+++ b/server/services/src/main/java/com/doumee/config/wx/WxMiniUtilService.java
@@ -53,13 +53,13 @@
withdrawalOrders.setCreateTime(new Date());
withdrawalOrdersMapper.insert(withdrawalOrders);
CreateRequest request = new CreateRequest();
- request.setOutTradeNo(orders.getCode());
+ request.setOutTradeNo(orders.getOutTradeNo());
request.setOutRefundNo(withdrawalOrders.getId().toString());
request.setSubMchid(WxMiniConfig.wxProperties.getSubMchId());
request.setNotifyUrl(WxMiniConfig.wxProperties.getRefundNotifyUrl());
AmountReq amountReq = new AmountReq();
- amountReq.setTotal(withdrawalOrders.getAmount());
- amountReq.setRefund(withdrawalOrders.getAmount());
+ amountReq.setTotal(1L);//withdrawalOrders.getAmount());
+ amountReq.setRefund(1L);//withdrawalOrders.getAmount());
amountReq.setCurrency("CNY");
request.setAmount(amountReq);
try {
diff --git a/server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java b/server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java
index 1605a27..3bf1ecf 100644
--- a/server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java
+++ b/server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java
@@ -63,6 +63,7 @@
private String privateKeyPath ;
private String privateCertPath;// gybike
private String pubKeyPath;//
+ private String payPublicKeyId;//
private String wechatSerialNumer;
@@ -70,7 +71,7 @@
private String wechatPubKeyPath; //寰俊鏀粯鍏挜鏂囦欢璺緞
private String wechatPrivateKeyPath;
private String wechatNotifyUrl;
-// private String wechatApiV3Key;
+ private String wechatApiV3Key;
// private String wechatPlatformPubKeyPath;
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java
index 1b5f608..985805d 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java
@@ -178,6 +178,7 @@
request.setSpAppid(WxMiniConfig.wxProperties.getAppId());
request.setSubMchid(WxMiniConfig.wxProperties.getSubMchId());
request.setSubAppid(WxMiniConfig.wxProperties.getSubAppId());
+
Payer payer = new Payer();
payer.setSubOpenid(openid);
request.setPayer(payer);
@@ -895,6 +896,7 @@
//閫�娆句笟鍔�
WithdrawalOrders withdrawalOrders = new WithdrawalOrders();
withdrawalOrders.setCreateTime(new Date());
+ withdrawalOrders.setDeleted(Constants.ZERO);
withdrawalOrders.setMemberId(orders.getReleaseMemberId());
withdrawalOrders.setAmount(orders.getPayAccount());
withdrawalOrders.setStatus(Constants.ZERO);
diff --git a/server/services/src/main/resources/application-dev.yml b/server/services/src/main/resources/application-dev.yml
index b3946b7..4e2caa4 100644
--- a/server/services/src/main/resources/application-dev.yml
+++ b/server/services/src/main/resources/application-dev.yml
@@ -88,6 +88,7 @@
appId: wx6cc1087ca79db7f6 #鏈嶅姟鍟嗗湪寰俊寮�鏀惧钩鍙帮紙绉诲姩搴旂敤锛夋垨鍏紬骞冲彴锛堝叕浼楀彿/灏忕▼搴忥級涓婄敵璇风殑涓�涓敮涓�鏍囪瘑
apiV3Key: 0a056faa107c2b2944b9d6a9aa6d4142 #7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB
serialNumer: 6696086F6EFB8D6A4F821BD47DDBAF75C3BC1209 #38495CE0137D90E4DC4F64F7ECDE035A35470BE3 #鏈嶅姟鍟嗚瘉涔﹀簭鍒楀彿
+ payPublicKeyId: PUB_KEY_ID_0117000719222024112700219100000508 #鍟嗘埛/骞冲彴鏀粯鍏挜id
#mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S
notifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxPayNotify
refundNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxRefundNotify
@@ -104,7 +105,7 @@
wechatPubKeyPath: d://jinkuai/shanghu/pub_key.pem #鍟嗘埛鏀粯鍏挜
wechatPrivateKeyPath: d://jinkuai/shanghu/apiclient_key.pem #鍟嗘埛绉侀挜
wechatNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wechat/transferNotify #鍟嗘埛杞处鍥炶皟鍦板潃
-
+ wechatApiV3Key: 7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB
existsSub: 1
appSecret:
diff --git a/server/services/src/main/resources/application-test.yml b/server/services/src/main/resources/application-test.yml
index 585b167..8628d7d 100644
--- a/server/services/src/main/resources/application-test.yml
+++ b/server/services/src/main/resources/application-test.yml
@@ -76,15 +76,17 @@
pay:
#鏈嶅姟鍟�---------start------- 鍙傛暟璇﹁В鍦板潃 https://pay.weixin.qq.com/doc/v3/partner/4013080340
mchId: 1700071922 #鏈嶅姟鍟嗗湪寰俊鏀粯渚х殑鍞竴韬唤鏍囪瘑
- appId: wx332441ae5b12be7d #鏈嶅姟鍟嗗湪寰俊寮�鏀惧钩鍙帮紙绉诲姩搴旂敤锛夋垨鍏紬骞冲彴锛堝叕浼楀彿/灏忕▼搴忥級涓婄敵璇风殑涓�涓敮涓�鏍囪瘑
+ appId: wx6cc1087ca79db7f6 #鏈嶅姟鍟嗗湪寰俊寮�鏀惧钩鍙帮紙绉诲姩搴旂敤锛夋垨鍏紬骞冲彴锛堝叕浼楀彿/灏忕▼搴忥級涓婄敵璇风殑涓�涓敮涓�鏍囪瘑
apiV3Key: 0a056faa107c2b2944b9d6a9aa6d4142 #7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB
- serialNumer: 7DCD480EB6DF3791721867A6EB57105DECEF38BE #38495CE0137D90E4DC4F64F7ECDE035A35470BE3 #鏈嶅姟鍟嗚瘉涔﹀簭鍒楀彿
+ serialNumer: 6696086F6EFB8D6A4F821BD47DDBAF75C3BC1209 #38495CE0137D90E4DC4F64F7ECDE035A35470BE3 #鏈嶅姟鍟嗚瘉涔﹀簭鍒楀彿
+ payPublicKeyId: PUB_KEY_ID_0117000719222024112700219100000508 #鍟嗘埛/骞冲彴鏀粯鍏挜id
#mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S
notifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxPayNotify
refundNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxRefundNotify
keyPath: /usr/local/jars/payFile/apiclient_cert.p12
privateCertPath: /usr/local/jars/payFile/apiclient_cert.pem
privateKeyPath: /usr/local/jars/payFile/apiclient_key.pem
+ pubKeyPath: /usr/local/jars/payFile/pub_key.pem #鍟嗘埛鏀粯鍏挜
#鏈嶅姟鍟�-------------end---
@@ -94,6 +96,7 @@
wechatPubKeyPath: /usr/local/jars/payFile/shanghu/pub_key.pem #鍟嗘埛鏀粯鍏挜
wechatPrivateKeyPath: /usr/local/jars/payFile/shanghu/apiclient_key.pem #鍟嗘埛绉侀挜
wechatNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wechat/transferNotify #鍟嗘埛杞处鍥炶皟鍦板潃
+ wechatApiV3Key: 7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB
existsSub: 1
diff --git a/server/web/src/main/resources/application.yml b/server/web/src/main/resources/application.yml
index 17dde0d..e21de66 100644
--- a/server/web/src/main/resources/application.yml
+++ b/server/web/src/main/resources/application.yml
@@ -12,7 +12,7 @@
spring:
profiles:
- active: dev
+ active: test
# JSON杩斿洖閰嶇疆
jackson:
# 榛樿鏃跺尯
--
Gitblit v1.9.3