public RedPacketService(string merchantId, string payKey, IWeChatClient client)
        {
            if (merchantId == null)
                throw new ArgumentNullException("merchantId");
            if (payKey == null)
                throw new ArgumentNullException("payKey");
            if (client == null)
                throw new ArgumentNullException("client");

            m_PayKey = payKey;
            m_WeChatClient = client;
        }
Example #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="weChatClient"></param>
        /// <param name="config"></param>
        /// <param name="cache"></param>
        public TokenAccessHostedService(
            ILogger <TokenAccessHostedService> logger,
            IWeChatClient weChatClient,
            WeChatOptions config,
            IWeChatCache cache)
        {
            _logger       = logger;
            _weChatClient = weChatClient;
            _config       = config;
            _cacheManager = cache;

            // 过期策略 1/4过期生效,1/5刷新间隔 刷新必定命中过期片段
            _expireTime             = _config.RefreshTimeSpan * 60 * 5;
            _allowRefreshTimeOffset = _config.RefreshTimeSpan * 60 * 5 / 4;
        }
Example #3
0
        public RedPacketService(string merchantId, string payKey, IWeChatClient client)
        {
            if (merchantId == null)
            {
                throw new ArgumentNullException("merchantId");
            }
            if (payKey == null)
            {
                throw new ArgumentNullException("payKey");
            }
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            m_PayKey       = payKey;
            m_WeChatClient = client;
        }
Example #4
0
 public ImgSecApp(IWeChatClient weChatClient)
 {
     _weChatClient = weChatClient;
 }
Example #5
0
 public UserAccountApp(IWeChatClient weChatClient)
 {
     _weChatClient = weChatClient;
 }