Пример #1
0
 /// <summary>
 /// 保存插件设置
 /// </summary>
 public static void SavePluginSet(PluginSetInfo pluginSetInfo)
 {
     lock (_locker)
     {
         IOHelper.SerializeToXml(pluginSetInfo, IOHelper.GetMapPath(_dbfilepath));
         _pluginsetinfo = null;
         TenpayUtil.ReSet();
     }
 }
Пример #2
0
 /// <summary>
 /// 保存插件设置
 /// </summary>
 public static void SavePluginSet(PluginSetInfo pluginSetInfo)
 {
     lock (_locker)
     {
         IOHelper.SerializeToXml(pluginSetInfo, IOHelper.GetMapPath(_dbfilepath));
         _pluginsetinfo = null;
         TenpayUtil.ReSet();
     }
 }
Пример #3
0
        /// 获得支付手续费
        /// </summary>
        /// <param name="productAmount">商品合计</param>
        /// <param name="buyTime">购买时间</param>
        /// <param name="partUserInfo">购买用户</param>
        /// <returns></returns>
        public decimal GetPayFee(decimal productAmount, DateTime buyTime, PartUserInfo partUserInfo)
        {
            PluginSetInfo pluginSetInfo = PluginUtils.GetPluginSet();

            if (productAmount >= pluginSetInfo.FreeMoney)
            {
                return(0M);
            }
            else
            {
                return(pluginSetInfo.PayFee);
            }
        }
Пример #4
0
        private static string _dbfilepath = "/plugins/BrnMall.PayPlugin.Tenpay/db.config";//数据文件路径

        /// <summary>
        ///获得插件设置
        /// </summary>
        /// <returns></returns>
        public static PluginSetInfo GetPluginSet()
        {
            if (_pluginsetinfo == null)
            {
                lock (_locker)
                {
                    if (_pluginsetinfo == null)
                    {
                        _pluginsetinfo = (PluginSetInfo)IOHelper.DeserializeFromXML(typeof(PluginSetInfo), IOHelper.GetMapPath(_dbfilepath));
                    }
                }
            }
            return _pluginsetinfo;
        }
Пример #5
0
        private static string _dbfilepath           = "/plugins/BrnMall.PayPlugin.Tenpay/db.config"; //数据文件路径

        /// <summary>
        ///获得插件设置
        /// </summary>
        /// <returns></returns>
        public static PluginSetInfo GetPluginSet()
        {
            if (_pluginsetinfo == null)
            {
                lock (_locker)
                {
                    if (_pluginsetinfo == null)
                    {
                        _pluginsetinfo = (PluginSetInfo)IOHelper.DeserializeFromXML(typeof(PluginSetInfo), IOHelper.GetMapPath(_dbfilepath));
                    }
                }
            }
            return(_pluginsetinfo);
        }
Пример #6
0
        public ActionResult Config(ConfigModel model)
        {
            if (ModelState.IsValid)
            {
                PluginSetInfo pluginSetInfo = new PluginSetInfo();
                pluginSetInfo.BargainorId = model.BargainorId.Trim();
                pluginSetInfo.TenpayKey = model.TenpayKey.Trim();
                pluginSetInfo.PayFee = model.PayFee;
                pluginSetInfo.FreeMoney = model.FreeMoney;
                PluginUtils.SavePluginSet(pluginSetInfo);

                AddMallAdminLog("修改财付通插件配置信息");
                return PromptView(Url.Action("config", "plugin", new { configController = "AdminTenpay", configAction = "Config" }), "插件配置修改成功");
            }
            return PromptView(Url.Action("config", "plugin", new { configController = "AdminTenpay", configAction = "Config" }), "信息有误,请重新填写");
        }