doum
2025-09-15 82735e4d46ac7b9969facef2acc8f8e793b68f71
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,13 +85,7 @@
                    .body(body)
                    .build();
            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()
            NotificationConfig config = new RSAPublicKeyConfig.Builder()
                    .merchantId(WxMiniConfig.wxProperties.getMchId())
                    .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath())
                    .publicKeyFromPath(WxMiniConfig.wxProperties.getPubKeyPath())
@@ -103,6 +99,7 @@
            Transaction result = parser.parse(requestParam, Transaction.class);
            log.error("支付回调信息:{}"+ JSONObject.toJSONString(result));
            //自定义订单号
            String outTradeNo = result.getOutTradeNo();
            //微信订单号
@@ -119,11 +116,12 @@
            } else {
                // 支付失败
                switch (result.getAttach()) {
                    case "createGoodsOrder": {
                    case "createOrder": {
                        break;
                    }
                }
            }
            log.error("微信支付回调结果结束===========" );
            return ApiResponse.success("处理成功!");
        } catch (Exception e) {
            e.printStackTrace();