Пример #1
0
 private void PaymentToInfo(IPayment payment,PaymentInfo info)
 {
     info.ClassName = payment.Key;
     info.Config = payment.Config;
     info.Description = payment.Description;
     info.FeeAmount = payment.FeeAmount;
     info.FeeType = payment.FeeType;
     info.IsEffect = payment.IsEffect;
     info.Logo = payment.Logo;
     info.Name = payment.Name;
     info.OnlinePay = payment.OnlinePaly;
     info.Sort = payment.Sort;
 }
Пример #2
0
        /// <summary>
        /// 安装支付接口
        /// </summary>
        /// <param name="payment"></param>
        public void Install(IPayment payment)
        {
            Check.Argument.IsNotNull(payment, "payment");

            if(DbProvider.D<PaymentInfo>().Count(x=>x.ClassName==payment.Key)>0) throw new ApplicationException("{0} 已经安装.".FormatWith(payment.Name));

            var paymentInfo = new PaymentInfo();

            PaymentToInfo(payment, paymentInfo);

            DbProvider.Add(paymentInfo);
            DbProvider.SaveChanges();
        }