public BrainTreePaymentProcessor(ICustomerService customerService,
                                  ISettingService settingService,
                                  IOrderTotalCalculationService orderTotalCalculationService,
                                  IPaymentService paymentService,
                                  BrainTreePaymentSettings brainTreePaymentSettings,
                                  ILocalizationService localizationService,
                                  IWebHelper webHelper,
                                  IServiceProvider serviceProvider)
 {
     this._customerService = customerService;
     this._settingService  = settingService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._paymentService           = paymentService;
     this._brainTreePaymentSettings = brainTreePaymentSettings;
     this._localizationService      = localizationService;
     this._webHelper       = webHelper;
     this._serviceProvider = serviceProvider;
 }
示例#2
0
 public BrainTreePaymentProcessor(ICustomerService customerService,
                                  ISettingService settingService,
                                  IOrderTotalCalculationService orderTotalCalculationService,
                                  IPaymentService paymentService,
                                  BrainTreePaymentSettings brainTreePaymentSettings,
                                  ILocalizationService localizationService,
                                  IWebHelper webHelper,
                                  ILanguageService languageService)
 {
     _customerService = customerService;
     _settingService  = settingService;
     _orderTotalCalculationService = orderTotalCalculationService;
     _paymentService           = paymentService;
     _brainTreePaymentSettings = brainTreePaymentSettings;
     _localizationService      = localizationService;
     _webHelper       = webHelper;
     _languageService = languageService;
 }
        public override async Task Install()
        {
            //settings
            var settings = new BrainTreePaymentSettings {
                UseSandBox = true,
                MerchantId = "",
                PrivateKey = "",
                PublicKey  = ""
            };
            await _settingService.SaveSetting(settings);

            //locales
            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.Use3DS", "Use the 3D secure");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.Use3DS.Hint", "Check to enable the 3D secure integration");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.UseSandbox", "Use Sandbox");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.UseSandbox.Hint", "Check to enable Sandbox (testing environment).");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.MerchantId", "Merchant ID");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.MerchantId.Hint", "Enter Merchant ID");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.PublicKey", "Public Key");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.PublicKey.Hint", "Enter Public key");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.PrivateKey", "Private Key");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.PrivateKey.Hint", "Enter Private key");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.AdditionalFee", "Additional fee");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers.");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.Fields.AdditionalFeePercentage", "Additional fee. Use percentage");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "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.");

            await this.AddOrUpdatePluginLocaleResource(_serviceProvider, "Plugins.Payments.BrainTree.PaymentMethodDescription", "Pay by credit / debit card");

            await base.Install();
        }