From 0544913da2cca58f690f5f12966c214ff08eda7e Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期一, 15 九月 2025 13:57:45 +0800
Subject: [PATCH] 111
---
server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 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..1c2656f 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
@@ -1,6 +1,7 @@
package com.doumee.api.business;
import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
import com.doumee.config.wx.TransferDetailEntityNew;
import com.doumee.config.wx.WxMiniConfig;
import com.doumee.core.constants.Constants;
@@ -59,6 +60,7 @@
*/
@PostMapping("/web/wxPayNotify")
public ApiResponse wxPay_notify(HttpServletRequest request) {
+ log.error("寰俊鏀粯鍥炶皟缁撴灉寮�濮�===========" );
try {
ServletInputStream inputStream = request.getInputStream();
StringBuffer stringBuffer = new StringBuffer();
@@ -83,9 +85,11 @@
.body(body)
.build();
- NotificationConfig config = new RSAAutoCertificateConfig.Builder()
+ NotificationConfig config = 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();
@@ -95,6 +99,7 @@
Transaction result = parser.parse(requestParam, Transaction.class);
+ log.error("鏀粯鍥炶皟淇℃伅锛歿}"+ JSONObject.toJSONString(result));
//鑷畾涔夎鍗曞彿
String outTradeNo = result.getOutTradeNo();
//寰俊璁㈠崟鍙�
@@ -111,11 +116,12 @@
} else {
// 鏀粯澶辫触
switch (result.getAttach()) {
- case "createGoodsOrder": {
+ case "createOrder": {
break;
}
}
}
+ log.error("寰俊鏀粯鍥炶皟缁撴灉缁撴潫===========" );
return ApiResponse.success("澶勭悊鎴愬姛!");
} catch (Exception e) {
e.printStackTrace();
@@ -152,13 +158,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 +207,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);
--
Gitblit v1.9.3