MrShi
2025-08-21 d98b610bd0793dd5d29f623400a1d0a81bb55334
server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java
@@ -31,7 +31,7 @@
    public static WxMaService wxMaService;
    /********微信小程序支付**********/
    public static JsapiService wxPayService;
    public static WxPayService wxPayV2Service;
//    public static WxPayService wxPayV2Service;
    public static RefundService refundService;
    public static JsapiServiceExtension jsapiExtService;
    public static BillDownloadService billDownloadService;
@@ -48,8 +48,7 @@
    void init() {
        this.load_WxMaService();
        this.load_wxPayService();
        this.load_wxPayV2Service();
        this.load_transferToUser();
//        this.load_wxPayV2Service();
        this.load_transferToUser();
        this.wxProperties = wxPayProperties;
    }
@@ -63,8 +62,8 @@
            config.setAppid(StringUtils.trimToNull(wxPayProperties.getSubAppId()));
            config.setSecret(StringUtils.trimToNull(wxPayProperties.getSubAppSecret()));
        }else {
            config.setAppid(StringUtils.trimToNull(wxPayProperties.getAppId()));
            config.setSecret(StringUtils.trimToNull(wxPayProperties.getAppSecret()));
//            config.setAppid(StringUtils.trimToNull(wxPayProperties.getAppId()));
//            config.setSecret(StringUtils.trimToNull(wxPayProperties.getAppSecret()));
        }
        config.setMsgDataFormat("JSON");
        //config.setToken("");
@@ -100,22 +99,22 @@
    /**
     * 初始化微信小程序支付
     */
    public void load_wxPayV2Service()
    {
        WxPayConfig payConfig = new WxPayConfig();
        payConfig.setTradeType(WxPayConstants.TradeType.JSAPI);
        payConfig.setSignType(WxPayConstants.SignType.MD5);
        payConfig.setAppId(StringUtils.trimToNull(wxPayProperties.getAppId()));
        payConfig.setSubAppId(StringUtils.trimToNull(wxPayProperties.getSubAppId()));
        payConfig.setMchId(StringUtils.trimToNull(wxPayProperties.getMchId()));
        payConfig.setSubMchId(StringUtils.trimToNull(wxPayProperties.getSubMchId()));
        payConfig.setMchKey(StringUtils.trimToNull(wxPayProperties.getMchKey()));
//        payConfig.setKeyPath(StringUtils.trimToNull(wxPayProperties.getKeyPath()));
        payConfig.setNotifyUrl(StringUtils.trimToNull(wxPayProperties.getNotifyUrl()));
        WxPayService wxPayService = new WxPayServiceImpl();
        wxPayService.setConfig(payConfig);
        this.wxPayV2Service = wxPayService;
    }
//    public void load_wxPayV2Service()
//    {
//        WxPayConfig payConfig = new WxPayConfig();
//        payConfig.setTradeType(WxPayConstants.TradeType.JSAPI);
//        payConfig.setSignType(WxPayConstants.SignType.MD5);
//        payConfig.setAppId(StringUtils.trimToNull(wxPayProperties.getAppId()));
//        payConfig.setSubAppId(StringUtils.trimToNull(wxPayProperties.getSubAppId()));
//        payConfig.setMchId(StringUtils.trimToNull(wxPayProperties.getMchId()));
//        payConfig.setSubMchId(StringUtils.trimToNull(wxPayProperties.getSubMchId()));
//        payConfig.setMchKey(StringUtils.trimToNull(wxPayProperties.getMchKey()));
////        payConfig.setKeyPath(StringUtils.trimToNull(wxPayProperties.getKeyPath()));
//        payConfig.setNotifyUrl(StringUtils.trimToNull(wxPayProperties.getNotifyUrl()));
//        WxPayService wxPayService = new WxPayServiceImpl();
//        wxPayService.setConfig(payConfig);
//        this.wxPayV2Service = wxPayService;
//    }
    /**
@@ -136,6 +135,7 @@
//    }
    //转账业务
    public void load_transferToUser()
    {
        TransferToUser transferToUser = new TransferToUser(