Beispiel #1
0
        public override void Install()
        {
            //settings
            var settings = new MonerisStandardPaymentSettings()
            {
                UseSandbox            = true,
                StoreId               = "*****@*****.**",
                PdtToken              = "Your PDT token here...",
                PdtValidateOrderTotal = true,
                //EnableIpn = true,
            };

            _settingService.SaveSetting(settings);

            //locales
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.RedirectionTip", "You will be redirected to Moneris site to complete the order.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.UseSandbox", "Use Sandbox");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.UseSandbox.Hint", "Check to enable Sandbox (testing environment).");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.StoreId", "Store Id");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.StoreId.Hint", "Specify your Moneris Store ID.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.PDTToken", "PDT Identity Token");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.PDTToken.Hint", "Specify PDT identity token");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.PDTValidateOrderTotal", "PDT. Validate order total");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.PDTValidateOrderTotal.Hint", "Check if PDT handler should validate order totals.");

            /*this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.AdditionalFee", "Additional fee");
             * this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers.");
             * this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.AdditionalFeePercentage", "Additional fee. Use percentage");
             * this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.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.MonerisStandard.Fields.PassProductNamesAndTotals", "Pass product names and order totals to Moneris");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.PassProductNamesAndTotals.Hint", "Check if product names and order totals should be passed to Moneris.");
            //TODO

            /*this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.EnableIpn", "Enable IPN (Instant Payment Notification)");
             * this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.EnableIpn.Hint", "Check if IPN is enabled.");
             * this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.EnableIpn.Hint2", "Leave blank to use the default IPN handler URL.");
             * this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.IpnUrl", "IPN Handler");
             * this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.IpnUrl.Hint", "Specify IPN Handler.");*/
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.ReturnFromMonerisWithoutPaymentRedirectsToOrderDetailsPage", "Return to order details page");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MonerisStandard.Fields.ReturnFromMonerisWithoutPaymentRedirectsToOrderDetailsPage.Hint", "Enable if a customer should be redirected to the order details page when he clicks \"return to store\" link on Moneris site WITHOUT completing a payment");

            base.Install();
        }
Beispiel #2
0
 public MonerisStandardPaymentProcessor(MonerisStandardPaymentSettings monerisStandardPaymentSettings,
                                        ISettingService settingService, ICurrencyService currencyService, IShoppingCartService shoppingCartService,
                                        CurrencySettings currencySettings, IWebHelper webHelper, IWorkContext workContext, IStoreContext storeContext,
                                        ICheckoutAttributeParser checkoutAttributeParser, ITaxService taxService, IGenericAttributeService genericAttributeService,
                                        IOrderTotalCalculationService orderTotalCalculationService, HttpContextBase httpContext)
 {
     this._monerisStandardPaymentSettings = monerisStandardPaymentSettings;
     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._shoppingCartService          = shoppingCartService;
     _workContext             = workContext;
     _storeContext            = storeContext;
     _genericAttributeService = genericAttributeService;
 }