MrShi
4 天以前 4fabfe4dbd2eb28d07a4350597d314958cc1c281
server/services/src/main/java/com/doumee/core/wx/WxMiniConfig.java
@@ -78,20 +78,24 @@
    /**
     * 初始化微信小程序支付
     */
    public void load_wxPayService()
    {
        Config config =
                new RSAAutoCertificateConfig.Builder()
                        .merchantId(wxPayProperties.getMchId())
                        .privateKeyFromPath(wxPayProperties.getPrivateKeyPath())
                        .merchantSerialNumber(wxPayProperties.getSerialNumer())
                        .apiV3Key(wxPayProperties.getApiV3Key())
                        .build();
        this.wxPayService =  new JsapiService.Builder().config(config).build();
    public void load_wxPayService()   {
        try {
            Config config =
                    new RSAAutoCertificateConfig.Builder()
                            .merchantId(wxPayProperties.getMchId())
                            .privateKeyFromPath(wxPayProperties.getPrivateKeyPath())
                            .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();;
            this.jsapiExtService =  new JsapiServiceExtension.Builder().config(config).build();
            this.refundService = new RefundService.Builder().config(config).build();
            this.billDownloadService = new BillDownloadService.Builder().config(config).build();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    /**
     * 初始化微信小程序支付
@@ -101,9 +105,11 @@
        WxPayConfig payConfig = new WxPayConfig();
        payConfig.setTradeType(WxPayConstants.TradeType.JSAPI);
        payConfig.setSignType(WxPayConstants.SignType.MD5);
        payConfig.setAppId(StringUtils.trimToNull(wxPayProperties.getSubAppId()));
        payConfig.setMchId(StringUtils.trimToNull(wxPayProperties.getSubMchId()));
        payConfig.setMchKey(StringUtils.trimToNull(wxPayProperties.getSubMchKey()));
        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();