package com.dgtis.dorm.manager.admin.config;

import cn.binarywang.wx.miniapp.config.WxMaConfig;
import cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig;
import com.github.binarywang.wxpay.config.WxPayConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class WeixinConfig {
    //DGT
    public static final String WX_AppId = "wxf762c9db16aa1b7b";
    public static final String WX_Secret = "a56216b48cc06114a2d67022e423efa3";

    //tsinghua
//  public static final String WX_AppId = "wxccab0416de0c7d90";
//  public static final String WX_Secret = "398b9e7fe7aa0c24e2d541967240e5d2";

    //通誉家园
//    public static final String WX_AppId = "wxfc36145c8032a28e";
//    public static final String WX_Secret = "d8f63fba1de0b6323cc109daaa3b6d51";

    public static final String WX_Token = "";
    public static final String WX_AesKey = "";
    public static final String WX_MsgDataFormat = "JSON";


    public static final String WX_MchId = "1408172302";
    public static final String WX_MchKey = "r4re3redsw3e5tg9oi87hy65tbvgt5ws";
    public static final String WX_KeyPath = "";

    @Bean
    public WxMaConfig wxMaConfig() {
        WxMaInMemoryConfig config = new WxMaInMemoryConfig();
        config.setAppid(WX_AppId);
        config.setSecret(WX_Secret);
        config.setToken(WX_Token);
        config.setAesKey(WX_AesKey);
        config.setMsgDataFormat(WX_MsgDataFormat);

        return config;
    }


    @Bean
    public WxPayConfig wxPayConfig() {
        WxPayConfig payConfig = new WxPayConfig();
        payConfig.setAppId(WX_AppId);
        payConfig.setMchId(WX_MchId);
        payConfig.setMchKey(WX_MchKey);
        payConfig.setSubAppId(null);
        payConfig.setSubMchId(null);
        payConfig.setKeyPath(WX_KeyPath);

        return payConfig;
    }
}