コード例 #1
0
        public override void Install()
        {
            //settings
            var settings = new CardComPaymentSettings()
            {
                TerminalNumber = "1000",
                UserName       = "******",
                CreateToken    = false,
                CreateInvoice  = false,
                MinPayments    = 1,
                MaxPayments    = 12,
            };

            _settingService.SaveSetting(settings);

            //locales
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.RedirectionTip", "You will be redirected to CardCom site to complete the order.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.Operation", "Terminal number");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.Operation.Hint", "Terminal number");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.TerminalNumber", "Terminal number");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.TerminalNumber.Hint", "Terminal number");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.UserName", "User name");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.UserName.Hint", "Specify your Username.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.cardCom.Fields.AddReturnButtonToSecurePage", "Add return button to secure page");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.cardCom.Fields.AddReturnButtonToSecurePage.Hint", "Add return button to secure page");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.AdditionalFee", "Additional fee");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.AdditionalFeePercentage", "Additional fee. Use percentage");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.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.CardCom.Fields.CreateToken", "Create Token");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.CreateToken.Hint", "Create Token");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.CreateInvoice", "Create Invoice");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.CreateInvoice.Hint", "Create Invoice");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.MaxPayments", "Max payments");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.MaxPayments.Hint", "Max payments");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.MinPayments", "Min payments");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.MinPayments.Hint", "Min payments");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.UseIframe", "Use IFRAME");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Fields.UseIframe.Hint", "Host redirect in IFRAME");

            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.ShippingFee", "Shipping fee");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.PaymentMethodFee", "Payment method fee");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.SalesTax", "Sales tax");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Discount", "Discount");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.CardCom.Failed", "An error occurred while processing your transaction<br /> Please try again later");


            base.Install();
        }
コード例 #2
0
 public CardComPaymentProcessor(IWorkContext workContext, CardComPaymentSettings cardComPaymentSettings,
                                ISettingService settingService, ICurrencyService currencyService,
                                CurrencySettings currencySettings, IWebHelper webHelper,
                                ICheckoutAttributeParser checkoutAttributeParser, ITaxService taxService,
                                IOrderTotalCalculationService orderTotalCalculationService, HttpContextBase httpContext,
                                ICardComService cardComService, IGenericAttributeService genericAttributeService,
                                ILocalizationService localizationService, ILogger logger)
 {
     this._workContext            = workContext;
     this._cardComPaymentSettings = cardComPaymentSettings;
     this._settingService         = settingService;
     this._currencyService        = currencyService;
     this._currencySettings       = currencySettings;
     this._webHelper = webHelper;
     this._checkoutAttributeParser = checkoutAttributeParser;
     this._taxService = taxService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._httpContext             = httpContext;
     this._cardComService          = cardComService;
     this._genericAttributeService = genericAttributeService;
     this._localizationService     = localizationService;
     this._logger = logger;
 }