public override void Install() { //settings var settings = new BrainTreePaymentSettings { UseSandBox = true, MerchantId = "", PrivateKey = "", PublicKey = "" }; _settingService.SaveSetting(settings); //locales this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.UseSandbox", "Use Sandbox"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.UseSandbox.Hint", "Check to enable Sandbox (testing environment)."); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.MerchantId", "Merchant ID"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.MerchantId.Hint", "Enter Merchant ID"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.PublicKey", "Public Key"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.PublicKey.Hint", "Enter Public key"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.PrivateKey", "Private Key"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.PrivateKey.Hint", "Enter Private key"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.AdditionalFee", "Additional fee"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers."); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.AdditionalFeePercentage", "Additional fee. Use percentage"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.AdditionalFeePercentage.Hint", "Determines whether to apply a percentage additional fee to the order total. If not enabled, a fixed value is used."); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.PaymentMethodDescription", "Pay by credit / debit card"); base.Install(); }
public BrainTreePaymentProcessor(ICustomerService customerService, ISettingService settingService, IOrderTotalCalculationService orderTotalCalculationService, BrainTreePaymentSettings brainTreePaymentSettings) { this._customerService = customerService; this._settingService = settingService; this._orderTotalCalculationService = orderTotalCalculationService; this._brainTreePaymentSettings = brainTreePaymentSettings; }
public BrainTreePaymentProcessor(BrainTreeObjectContext objectContext, BrainTreePaymentSettings brainTreePaymentSettings, IBrainTreeService brainTreeService, ICurrencyService currencyService, ICustomerService customerService, ILocalizationService localizationService, IPaymentService paymentService, ISettingService settingService, IWebHelper webHelper, IWorkContext workContext) { _objectContext = objectContext; _brainTreePaymentSettings = brainTreePaymentSettings; _brainTreeService = brainTreeService; _currencyService = currencyService; _customerService = customerService; _localizationService = localizationService; _paymentService = paymentService; _settingService = settingService; _webHelper = webHelper; _workContext = workContext; }
public override void Install() { //settings var settings = new BrainTreePaymentSettings { UseSandBox = true, MerchantId = string.Empty, PrivateKey = string.Empty, PublicKey = string.Empty }; _settingService.SaveSetting(settings); //database objects _objectContext.Install(); //locales _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Currency.Fields.CurrencyCode", "Currency code"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Currency.Fields.MerchantAccountId", "Merchant account"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers."); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.AdditionalFee", "Additional fee"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.AdditionalFeePercentage.Hint", "Determines whether to apply a percentage additional fee to the order total. If not enabled, a fixed value is used."); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.AdditionalFeePercentage", "Additional fee. Use percentage"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.MerchantId.Hint", "Enter Merchant ID"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.MerchantId", "Merchant ID"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.PrivateKey.Hint", "Enter Private key"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.PrivateKey", "Private Key"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.PublicKey.Hint", "Enter Public key"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.PublicKey", "Public Key"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.Use3DS", "Use the 3D secure"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.Use3DS.Hint", "Check to enable the 3D secure integration"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.UseMultiCurrency.Hint", "Check to enable multi currency support (MerchantAccount)"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.UseMultiCurrency", "Use multi currency"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.UseSandbox.Hint", "Check to enable Sandbox (testing environment)."); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.Fields.UseSandbox", "Use Sandbox"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.BrainTree.PaymentMethodDescription", "Pay by credit / debit card"); base.Install(); }