예제 #1
0
        public override void Install()
        {
            //settings
            var settings = new WeiXinPaymentSettings
            {
                AppId         = "",
                MchId         = "",
                AppSecret     = "",
                AdditionalFee = 0,
            };

            _settingService.SaveSetting(settings);

            //locales
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.QRCode", "二维码");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.RedirectionTip", "请用微信扫描");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.PleaseUseWechatScan", "请使用微信扫一扫");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.ScanQrcodeToPay", "扫描二维码支付");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.QrcodeOnlyValidTwoHours", "二维码有效期两小时");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.YouAreUsingWechatPay", "您正在使用微信支付");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.AppId", "AppId");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.AppId.Hint", "请输入 AppId.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.MchId", "商户ID");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.MchId.Hint", "请输入 MchId.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.AppSecret", "App密钥");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.AppSecret.Hint", "请输入 App密钥.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.AdditionalFee", "Additional fee");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.WeiXin.AdditionalFee.Hint", "Enter additional fee to charge your customers.");

            base.Install();
        }
예제 #2
0
        public WeiXinPaymentProcessor(WeiXinPaymentSettings weiXinPaymentSettings,
                                      ISettingService settingService, IWebHelper webHelper,
                                      IStoreContext storeContext, IWorkContext workContext, HttpContextBase httpContext, ILogger log)
        {
            this._weiXinPaymentSettings = weiXinPaymentSettings;
            this._settingService        = settingService;
            this._webHelper             = webHelper;
            this._storeContext          = storeContext;
            _workContext = workContext;
            _httpContext = httpContext;
            _log         = log;

            _notifyUrl = Path.Combine(_webHelper.GetStoreLocation(), "Plugins/PaymentWeiXin/Notify");
        }