/// <summary> /// 注入支付服务 /// </summary> /// <param name="cissyConfigBuilder"></param> /// <param name="action"></param> /// <returns></returns> public static CissyConfigBuilder AddPaymentConfig(this CissyConfigBuilder cissyConfigBuilder) { ICissyConfig cissyConfig = cissyConfigBuilder.CissyConfig; if (cissyConfig.IsNotNull()) { PaymentConfig payConfig = cissyConfig.GetConfig <PaymentConfig>(); if (payConfig.IsNotNull()) { var factory = new DefaultPayAppFactory(payConfig); cissyConfigBuilder.ServiceCollection.AddSingleton(typeof(IPayAppFactory), factory); } } cissyConfigBuilder.RegisterMapper(register => { register.CreateMap <PaymentRequest, PaymentArg>().ForMember(b => b.AppName, n => n.Ignore()); }); return(cissyConfigBuilder); }
public DefaultPayApp(PaymentConfig config) { _config = config; }
public DefaultPayAppFactory(PaymentConfig config) { _config = config; }