//logger属性本来应该考虑空模式
        //Options和Logger 本身不必要提供的,库的调用方完全可以自己做依赖注入。但是由于中间件中已经拿到这些对象的引用,直接传递过来 比去依赖注入再拿一次 更快吧

        public WeChatPaymentNoticeContext(HttpContext httpContext, WeChatPaymentOptions options, WeChatPaymentNoticeResult paymentNoticeResult, ILogger logger)
        {
            HttpContext         = httpContext;
            Options             = options;
            PaymentNoticeResult = paymentNoticeResult;
            Logger = logger;
        }
예제 #2
0
 public WeChatPaymentUnifyOrderInputFactory(
     IOptionsMonitor <WeChatPaymentOptions> paymentOptions,
     IOptionsMonitor <MiniProgramAuthenticationOptions> authOptions,
     WeChatPaymentSecuret securet)
 {
     this.paymentOptions = paymentOptions.CurrentValue;
     this.authOptions    = authOptions.CurrentValue;
     this.securet        = securet;
 }
예제 #3
0
 public WeChatPaymentService(
     IOptionsMonitor <WeChatPaymentOptions> paymentOptions,
     IOptionsMonitor <MiniProgramAuthenticationOptions> authOptions,
     WeChatPaymentUnifyOrderResultFactory weChatPaymentUnifyOrderResultFactory,
     IHttpClientFactory clientFactory,
     WeChatPaymentSecuret securet)
 {
     this.paymentOptions = paymentOptions.CurrentValue;
     this.authOptions    = authOptions.CurrentValue;
     this.weChatPaymentUnifyOrderResultFactory = weChatPaymentUnifyOrderResultFactory;
     this.clientFactory = clientFactory;
     this.securet       = securet;
 }
 public WeChatPaymentSecuret(IOptionsMonitor <WeChatPaymentOptions> o)
 {
     this.opt = o.CurrentValue;
 }