/// <summary>
        /// 支付
        /// </summary>
        /// <param name="param">支付参数</param>
        /// <returns></returns>
        public virtual async Task <PayResult> PayAsync(PayParam param)
        {
            var config = await ConfigProvider.GetConfigAsync();

            Validate(config, param);
            var builder = new WechatpayParameterBuilder(config);

            Config(builder, param);
            return(await RequestResult(config, builder));
        }
        /// <summary>
        /// 请求
        /// </summary>
        /// <param name="param">请求参数</param>
        protected virtual async Task <WechatpayResult> Request(TRequest param)
        {
            var config = await ConfigProvider.GetConfigAsync();

            Validate(config, param);
            var builder = new WechatpayParameterBuilder(config);

            ConfigBuilder(builder, param);
            return(await RequstResult(config, builder));
        }
Example #3
0
        /// <summary>
        /// 初始化
        /// </summary>
        private async Task Init()
        {
            if (_isLoad)
            {
                return;
            }
            var config = await _configProvider.GetConfigAsync();

            _result = new WechatpayRefundNotifyResult(config.PrivateKey, Web.Body);
            _isLoad = true;
        }
Example #4
0
        /// <summary>
        /// 验证签名
        /// </summary>
        public async Task <bool> VerifySign()
        {
            var config = await _configProvider.GetConfigAsync(_builder);

            return(SignManagerFactory.Create(config, _builder).Verify(GetSign()));
        }