public override void Install() { var settings = new WeixinPaymentSetting() { AppId = "", AppSecret = "", MchId = "", MchKey = "", AdditionalFee = 0 }; _settingService.SaveSetting(settings); //locales this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.RedirectionTip", "将本次将使用微信支付!"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.AppId", "AppID"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.AppSecret", "AppSecret"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.MchKey", "商户密钥"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.MchId", "商户号"); //this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.Vmid.Hint", "请输入商户号"); //this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.Key.Hint", "请输入商户Key"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.AdditionalFee", "额外费用"); //this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.AdditionalFee.Hint", "请输入额外费用,没有则输0"); // 验证 this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.AppIdRequired", "请输入 AppID"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.AppSecretRequired", "请输入 AppSecret"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.MchIdRequired", "请输入商户号"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.MchKeyRequired", "请输入商户密钥"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Weixin.AdditionalFeeRequired", "请输入额外费用,没有则输0"); base.Install(); }
public WeixinPaymentProcessor( ILogger logger, HttpContextBase httpContext, WeixinPaymentSetting WeixinPaymentSetting, StoreInformationSettings storeInformationSettings, IWebHelper webHelper, ISettingService settingService, IOrderService orderService, IStoreContext storeContext, IWeixinPaymentService weixinPaymentService, IOrderTotalCalculationService orderTotalCalculationService) { this._logger = logger; this._httpContext = httpContext; this._WeixinPaymentSetting = WeixinPaymentSetting; this._storeInformationSetting = storeInformationSettings; this._webHelper = webHelper; this._settingService = settingService; this._orderService = orderService; this._storeContext = storeContext; this._weixinPaymentService = weixinPaymentService; this._orderTotalCalculationService = orderTotalCalculationService; }