Beispiel #1
0
 public PaymentZonaVirtualController(IWorkContext workContext,
                                     IStoreService storeService,
                                     ISettingService settingService,
                                     IPaymentService paymentService,
                                     IOrderService orderService,
                                     IOrderProcessingService orderProcessingService,
                                     IStoreContext storeContext,
                                     ILogger logger,
                                     IWebHelper webHelper,
                                     PaymentSettings paymentSettings,
                                     ZonaVirtualPaymentSettings ZonaVirtualPaymentSettings)
 {
     this._workContext            = workContext;
     this._storeService           = storeService;
     this._settingService         = settingService;
     this._paymentService         = paymentService;
     this._orderService           = orderService;
     this._orderProcessingService = orderProcessingService;
     this._storeContext           = storeContext;
     this._logger                     = logger;
     this._webHelper                  = webHelper;
     this._paymentSettings            = paymentSettings;
     this._ZonaVirtualPaymentSettings = ZonaVirtualPaymentSettings;
 }
 public PaymentPayPalStandardController(IWorkContext workContext,
                                        IStoreService storeService,
                                        ISettingService settingService,
                                        IPaymentService paymentService,
                                        IOrderService orderService,
                                        IOrderProcessingService orderProcessingService,
                                        ILocalizationService localizationService,
                                        IStoreContext storeContext,
                                        ILogger logger,
                                        IWebHelper webHelper,
                                        PaymentSettings paymentSettings)
 {
     _workContext            = workContext;
     _storeService           = storeService;
     _settingService         = settingService;
     _paymentService         = paymentService;
     _orderService           = orderService;
     _orderProcessingService = orderProcessingService;
     _localizationService    = localizationService;
     _storeContext           = storeContext;
     _logger          = logger;
     _webHelper       = webHelper;
     _paymentSettings = paymentSettings;
 }
Beispiel #3
0
 public PluginController(IPluginFinder pluginFinder,
                         IPermissionService permissionService,
                         ILanguageService languageService,
                         PaymentSettings paymentSettings,
                         ShippingSettings shippingSettings,
                         TaxSettings taxSettings,
                         ExternalAuthenticationSettings externalAuthenticationSettings,
                         WidgetSettings widgetSettings,
                         IProviderManager providerManager,
                         PluginMediator pluginMediator,
                         ICommonServices services)
 {
     this._pluginFinder      = pluginFinder;
     this._permissionService = permissionService;
     this._languageService   = languageService;
     this._paymentSettings   = paymentSettings;
     this._shippingSettings  = shippingSettings;
     this._taxSettings       = taxSettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._widgetSettings  = widgetSettings;
     this._providerManager = providerManager;
     this._pluginMediator  = pluginMediator;
     this._services        = services;
 }
Beispiel #4
0
 public PaymentMellatBankController(IWorkContext workContext,
                                    IStoreService storeService,
                                    ISettingService settingService,
                                    IPaymentService paymentService,
                                    IOrderService orderService,
                                    IOrderProcessingService orderProcessingService,
                                    ILogger logger,
                                    IPluginFinder pluginFinder,
                                    IWebHelper webHelper,
                                    PaymentSettings paymentSettings,
                                    ILocalizationService localizationService)
 {
     this._workContext            = workContext;
     this._storeService           = storeService;
     this._settingService         = settingService;
     this._paymentService         = paymentService;
     this._orderService           = orderService;
     this._orderProcessingService = orderProcessingService;
     this._logger              = logger;
     this._paymentSettings     = paymentSettings;
     this._localizationService = localizationService;
     this._webHelper           = webHelper;
     this._pluginFinder        = pluginFinder;
 }
 public PaymentController(ICountryService countryService,
                          IEventPublisher eventPublisher,
                          ILocalizationService localizationService,
                          INotificationService notificationService,
                          IPaymentModelFactory paymentModelFactory,
                          IPaymentPluginManager paymentPluginManager,
                          IPermissionService permissionService,
                          ISettingService settingService,
                          IGenericAttributeService genericAttributeService,
                          IWorkContext workContext,
                          PaymentSettings paymentSettings)
 {
     _countryService          = countryService;
     _eventPublisher          = eventPublisher;
     _localizationService     = localizationService;
     _notificationService     = notificationService;
     _paymentModelFactory     = paymentModelFactory;
     _paymentPluginManager    = paymentPluginManager;
     _permissionService       = permissionService;
     _settingService          = settingService;
     _genericAttributeService = genericAttributeService;
     _workContext             = workContext;
     _paymentSettings         = paymentSettings;
 }
Beispiel #6
0
 public OverriddenPaymentController(ICountryService countryService,
                                    ILocalizationService localizationService,
                                    IPaymentService paymentService,
                                    IPermissionService permissionService,
                                    IPluginFinder pluginFinder,
                                    ISettingService settingService,
                                    IWebHelper webHelper,
                                    PaymentSettings paymentSettings,
                                    WidgetSettings widgetSettings) : base(paymentService,
                                                                          paymentSettings,
                                                                          settingService,
                                                                          permissionService,
                                                                          countryService,
                                                                          pluginFinder,
                                                                          webHelper,
                                                                          localizationService)
 {
     this._paymentService    = paymentService;
     this._permissionService = permissionService;
     this._pluginFinder      = pluginFinder;
     this._settingService    = settingService;
     this._paymentSettings   = paymentSettings;
     this._widgetSettings    = widgetSettings;
 }
 public PayPalRedirectionService(ILogger logger,
                                 IWebHelper webHelper,
                                 IWorkContext workContext,
                                 ICustomerService customerService,
                                 IHttpContextAccessor httpContextAccessor,
                                 PaymentSettings paymentSettings,
                                 PayPalCheckoutDetailsService payPalCheckoutDetailsService,
                                 PayPalInterfaceService payPalInterfaceService,
                                 PayPalSecurityService payPalSecurityService,
                                 PayPalRequestService payPalRequestService,
                                 PayPalUrlService payPalUrlService)
 {
     _logger          = logger;
     _webHelper       = webHelper;
     _workContext     = workContext;
     _customerService = customerService;
     _session         = httpContextAccessor.HttpContext.Session;
     _paymentSettings = paymentSettings;
     _payPalCheckoutDetailsService = payPalCheckoutDetailsService;
     _payPalInterfaceService       = payPalInterfaceService;
     _payPalSecurityService        = payPalSecurityService;
     _payPalRequestService         = payPalRequestService;
     _payPalUrlService             = payPalUrlService;
 }
Beispiel #8
0
        public void IsPaymentMethodActive_NullSettings_ThrowException()
        {
            PaymentSettings settings = null;

            Assert.ThrowsException <ArgumentNullException>(() => _providerMock.Object.IsPaymentMethodActive(settings));
        }
Beispiel #9
0
        /// <summary>
        /// Is payment method active?
        /// </summary>
        /// <param name="paymentMethod">Payment method</param>
        /// <param name="paymentSettings">Payment settings</param>
        /// <returns>Result</returns>
        public static bool IsPaymentMethodActive(this Provider <IPaymentMethod> paymentMethod, PaymentSettings paymentSettings)
        {
            if (paymentMethod == null)
            {
                throw new ArgumentNullException("paymentMethod");
            }

            if (paymentSettings == null)
            {
                throw new ArgumentNullException("paymentSettings");
            }

            if (paymentSettings.ActivePaymentMethodSystemNames == null)
            {
                return(false);
            }

            return(paymentSettings.ActivePaymentMethodSystemNames.Contains(paymentMethod.Metadata.SystemName, StringComparer.OrdinalIgnoreCase));
        }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="orderService">Order service</param>
 /// <param name="webHelper">Web helper</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="languageService">Language service</param>
 /// <param name="productService">Product service</param>
 /// <param name="paymentService">Payment service</param>
 /// <param name="logger">Logger</param>
 /// <param name="orderTotalCalculationService">Order total calculationservice</param>
 /// <param name="priceCalculationService">Price calculation service</param>
 /// <param name="priceFormatter">Price formatter</param>
 /// <param name="productAttributeParser">Product attribute parser</param>
 /// <param name="productAttributeFormatter">Product attribute formatter</param>
 /// <param name="giftCardService">Gift card service</param>
 /// <param name="shoppingCartService">Shopping cart service</param>
 /// <param name="checkoutAttributeFormatter">Checkout attribute service</param>
 /// <param name="shippingService">Shipping service</param>
 /// <param name="shipmentService">Shipment service</param>
 /// <param name="taxService">Tax service</param>
 /// <param name="customerService">Customer service</param>
 /// <param name="discountService">Discount service</param>
 /// <param name="encryptionService">Encryption service</param>
 /// <param name="workContext">Work context</param>
 /// <param name="workflowMessageService">Workflow message service</param>
 /// <param name="vendorService">Vendor service</param>
 /// <param name="customerActivityService">Customer activity service</param>
 /// <param name="currencyService">Currency service</param>
 /// <param name="affiliateService">Affiliate service</param>
 /// <param name="eventPublisher">Event published</param>
 /// <param name="pdfService">PDF service</param>
 /// <param name="paymentSettings">Payment settings</param>
 /// <param name="shippingSettings">Shipping settings</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="orderSettings">Order settings</param>
 /// <param name="taxSettings">Tax settings</param>
 /// <param name="localizationSettings">Localization settings</param>
 /// <param name="currencySettings">Currency settings</param>
 public OrderProcessingService(IOrderService orderService,
     IWebHelper webHelper,
     ILocalizationService localizationService,
     ILanguageService languageService,
     IProductService productService,
     IPaymentService paymentService,
     ILogger logger,
     IOrderTotalCalculationService orderTotalCalculationService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IProductAttributeParser productAttributeParser,
     IProductAttributeFormatter productAttributeFormatter,
     IGiftCardService giftCardService,
     IShoppingCartService shoppingCartService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ITaxService taxService,
     ICustomerService customerService,
     IDiscountService discountService,
     IEncryptionService encryptionService,
     IWorkContext workContext,
     IWorkflowMessageService workflowMessageService,
     IVendorService vendorService,
     ICustomerActivityService customerActivityService,
     ICurrencyService currencyService,
     IAffiliateService affiliateService,
     IEventPublisher eventPublisher,
     IPdfService pdfService,
     ShippingSettings shippingSettings,
     PaymentSettings paymentSettings,
     RewardPointsSettings rewardPointsSettings,
     OrderSettings orderSettings,
     TaxSettings taxSettings,
     LocalizationSettings localizationSettings,
     CurrencySettings currencySettings,
     IGenericAttributeService genericAttributeService,
     PromoSettings promoSettings,
     IPromoUtilities promoUtilities,
     IPromoOrderService promoOrderService,
     IPromoService promoService,
     IStoreContext storeContext)
     : base(orderService, webHelper, localizationService, languageService, productService, paymentService,
                                                 logger, orderTotalCalculationService, priceCalculationService, priceFormatter, productAttributeParser,
                                                 productAttributeFormatter, giftCardService, shoppingCartService, checkoutAttributeFormatter, shippingService,
                                                 shipmentService, taxService, customerService, discountService, encryptionService, workContext, workflowMessageService,
                                                 vendorService, customerActivityService, currencyService, affiliateService, eventPublisher, pdfService,
                                                 shippingSettings, paymentSettings, rewardPointsSettings, orderSettings, taxSettings,
                                                 localizationSettings, currencySettings)
 {
     this._orderService = orderService;
     this._webHelper = webHelper;
     this._localizationService = localizationService;
     this._languageService = languageService;
     this._productService = productService;
     this._paymentService = paymentService;
     this._logger = logger;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter = priceFormatter;
     this._productAttributeParser = productAttributeParser;
     this._productAttributeFormatter = productAttributeFormatter;
     this._giftCardService = giftCardService;
     this._shoppingCartService = shoppingCartService;
     this._checkoutAttributeFormatter = checkoutAttributeFormatter;
     this._workContext = workContext;
     this._workflowMessageService = workflowMessageService;
     this._vendorService = vendorService;
     this._shippingService = shippingService;
     this._shipmentService = shipmentService;
     this._taxService = taxService;
     this._customerService = customerService;
     this._discountService = discountService;
     this._encryptionService = encryptionService;
     this._customerActivityService = customerActivityService;
     this._currencyService = currencyService;
     this._affiliateService = affiliateService;
     this._eventPublisher = eventPublisher;
     this._pdfService = pdfService;
     this._paymentSettings = paymentSettings;
     this._shippingSettings = shippingSettings;
     this._rewardPointsSettings = rewardPointsSettings;
     this._orderSettings = orderSettings;
     this._taxSettings = taxSettings;
     this._localizationSettings = localizationSettings;
     this._currencySettings = currencySettings;
     this._genericAttributeService = genericAttributeService;
     this._promoSettings = promoSettings;
     this._promoUtilities = promoUtilities;
     this._promoOrderService = promoOrderService;
     this._promoService = promoService;
     this._storeContext = storeContext;
 }
Beispiel #11
0
 public PaymentDibsController(IWebHelper webHelper, IPaymentService paymentService, PaymentSettings paymentSettings
                              , IOrderService orderService, IOrderProcessingService orderProcessingService, ISettingService settingService,
                              IStoreService storeService, IWorkContext workContext, ILocalizationService localizationService)
 {
     _paymentService         = paymentService;
     _paymentSettings        = paymentSettings;
     _orderService           = orderService;
     _orderProcessingService = orderProcessingService;
     _settingService         = settingService;
     _storeService           = storeService;
     _workContext            = workContext;
     _localizationService    = localizationService;
 }
 public GetIsPaymentWorkflowRequiredHandler(IOrderTotalCalculationService orderTotalCalculationService, PaymentSettings paymentSettings)
 {
     _orderTotalCalculationService = orderTotalCalculationService;
     _paymentSettings = paymentSettings;
 }
        public virtual object GetService(Type serviceType)
        {
            if (serviceType == typeof(IHttpContextAccessor))
            {
                return(new Mock <IHttpContextAccessor>().Object);
            }

            if (serviceType == typeof(ILocalizationService))
            {
                return(LocalizationService.Object);
            }

            if (serviceType == typeof(IWorkContext))
            {
                return(WorkContext.Object);
            }

            if (serviceType == typeof(CurrencySettings))
            {
                return new CurrencySettings {
                           PrimaryStoreCurrencyId = 1
                }
            }
            ;

            if (serviceType == typeof(CatalogSettings))
            {
                return(new CatalogSettings());
            }

            if (serviceType == typeof(ICurrencyService))
            {
                return(CurrencyService.Object);
            }

            if (serviceType == typeof(IUrlRecordService))
            {
                return(new Mock <IUrlRecordService>().Object);
            }

            if (serviceType == typeof(IGenericAttributeService))
            {
                return(GenericAttributeService.Object);
            }

            if (serviceType == typeof(IPriceCalculationService))
            {
                return(PriceCalculationService);
            }

            if (serviceType == typeof(IStaticCacheManager))
            {
                return(new TestCacheManager());
            }

            if (serviceType == typeof(IRepository <DiscountCategoryMapping>))
            {
                return(DiscountCategoryMappingRepository.Object);
            }

            if (serviceType == typeof(IRepository <DiscountManufacturerMapping>))
            {
                return(DiscountManufacturerMappingRepository.Object);
            }

            if (serviceType == typeof(IRepository <DiscountProductMapping>))
            {
                return(DiscountProductMappingRepository.Object);
            }

            if (serviceType == typeof(ICacheKeyService))
            {
                return(new FakeCacheKeyService());
            }

            if (serviceType == typeof(ICustomerService))
            {
                return(new Mock <ICustomerService>().Object);
            }

            if (serviceType == typeof(IPluginService))
            {
                return(new FakePluginService());
            }

            if (serviceType == typeof(PaymentSettings))
            {
                var paymentSettings = new PaymentSettings
                {
                    ActivePaymentMethodSystemNames = new List <string>()
                };
                paymentSettings.ActivePaymentMethodSystemNames.Add("Payments.TestMethod");

                return(paymentSettings);
            }

            if (serviceType == typeof(TaxSettings))
            {
                return(new TaxSettings());
            }

            if (serviceType == typeof(ShippingSettings))
            {
                var shippingSettings = new ShippingSettings
                {
                    ActiveShippingRateComputationMethodSystemNames =
                        new List <string> {
                        "FixedRateTestShippingRateComputationMethod"
                    }
                };

                return(shippingSettings);
            }

            return(null);
        }
    }
Beispiel #14
0
 public ActionResult Save([IoCModelBinder(typeof(PaymentSettingsModelBinder))] PaymentSettings settings)
 {
     _configurationProvider.SaveSettings(settings);
     return(RedirectToAction("Index"));
 }
 public static string GetUrlBase(this PaymentSettings paymentSettings, ETipoPagamento tipoPagamento)
 {
     return(paymentSettings.PaymentsSettings.Where(FiltraTipoPagamento(tipoPagamento)).FirstOrDefault().UrlBase);
 }
 public CashOnDeliveryPaymentMethod(PaymentSettings paymentSettings)
 {
     _paymentSettings = paymentSettings;
 }
Beispiel #17
0
 public PaymentSettingsController(IConfigurationProvider configurationProvider, PaymentSettings paymentSettings)
 {
     _configurationProvider = configurationProvider;
     _paymentSettings       = paymentSettings;
 }
 /// <summary>
 /// Checks if the device is capable of setting up Apple Pay
 /// </summary>
 /// <param name="paymentSettings">The Shop's payment settings</param>
 /// <returns>True if the device is capable of setting up Apple Pay </returns>
 public bool CanShowPaymentSetup(PaymentSettings paymentSettings)
 {
     return(_CanShowApplePaySetup(SerializedPaymentNetworksFromCardBrands(paymentSettings.acceptedCardBrands())));
 }
 public PaymentProcessingService(IPluginFinderService pluginFinder,
                                 PaymentSettings paymentSettings)
 {
     _pluginFinder    = pluginFinder;
     _paymentSettings = paymentSettings;
 }
        /// <summary>
        /// Checks whether payment method is active.
        /// </summary>
        /// <param name="paymentMethod">Payment method.</param>
        /// <param name="paymentSettings">Payment settings.</param>
        /// <returns><c>True</c> if payment method is active, otherwise <c>false</c>.</returns>
        public static bool IsPaymentMethodActive(this Provider <IPaymentMethod> paymentMethod, PaymentSettings paymentSettings)
        {
            Guard.NotNull(paymentMethod, nameof(paymentMethod));
            Guard.NotNull(paymentSettings, nameof(paymentSettings));

            if (paymentSettings.ActivePaymentMethodSystemNames == null || !paymentMethod.Value.IsActive)
            {
                return(false);
            }

            return(paymentSettings.ActivePaymentMethodSystemNames.Contains(paymentMethod.Metadata.SystemName, StringComparer.OrdinalIgnoreCase));
        }
        public new void SetUp()
        {
            _workContext = null;

            var pluginFinder = new PluginFinder(new AppDomainTypeFinder());
            var cacheManager = new NopNullCache();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();

            //price calculation service
            _discountService        = MockRepository.GenerateMock <IDiscountService>();
            _categoryService        = MockRepository.GenerateMock <ICategoryService>();
            _productAttributeParser = MockRepository.GenerateMock <IProductAttributeParser>();
            _priceCalcService       = new PriceCalculationService(_workContext, _discountService,
                                                                  _categoryService, _productAttributeParser, _shoppingCartSettings, _catalogSettings);

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List <string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = MockRepository.GenerateMock <IRepository <ShippingMethod> >();
            _logger          = new NullLogger();
            _shippingService = new ShippingService(cacheManager,
                                                   _shippingMethodRepository,
                                                   _logger,
                                                   _productAttributeParser,
                                                   _checkoutAttributeParser,
                                                   _shippingSettings, pluginFinder, _eventPublisher);


            _paymentService          = MockRepository.GenerateMock <IPaymentService>();
            _checkoutAttributeParser = MockRepository.GenerateMock <ICheckoutAttributeParser>();
            _giftCardService         = MockRepository.GenerateMock <IGiftCardService>();

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            //tax
            _taxSettings = new TaxSettings();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.DefaultTaxAddressId = 10;
            _addressService = MockRepository.GenerateMock <IAddressService>();
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address()
            {
                Id = _taxSettings.DefaultTaxAddressId
            });
            _taxService = new TaxService(_addressService, _workContext, _taxSettings, pluginFinder, _eventPublisher);

            _rewardPointsSettings = new RewardPointsSettings();

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext,
                                                                      _priceCalcService, _taxService, _shippingService, _paymentService,
                                                                      _checkoutAttributeParser, _discountService, _giftCardService,
                                                                      _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);

            _orderService               = MockRepository.GenerateMock <IOrderService>();
            _webHelper                  = MockRepository.GenerateMock <IWebHelper>();
            _localizationService        = MockRepository.GenerateMock <ILocalizationService>();
            _languageService            = MockRepository.GenerateMock <ILanguageService>();
            _productService             = MockRepository.GenerateMock <IProductService>();
            _priceFormatter             = MockRepository.GenerateMock <IPriceFormatter>();
            _productAttributeFormatter  = MockRepository.GenerateMock <IProductAttributeFormatter>();
            _shoppingCartService        = MockRepository.GenerateMock <IShoppingCartService>();
            _checkoutAttributeFormatter = MockRepository.GenerateMock <ICheckoutAttributeFormatter>();
            _customerService            = MockRepository.GenerateMock <ICustomerService>();
            _encryptionService          = MockRepository.GenerateMock <IEncryptionService>();
            _workflowMessageService     = MockRepository.GenerateMock <IWorkflowMessageService>();
            _smsService                 = MockRepository.GenerateMock <ISmsService>();
            _customerActivityService    = MockRepository.GenerateMock <ICustomerActivityService>();
            _currencyService            = MockRepository.GenerateMock <ICurrencyService>();

            _paymentSettings = new PaymentSettings()
            {
                ActivePaymentMethodSystemNames = new List <string>()
                {
                    "Payments.TestMethod"
                }
            };
            _orderSettings = new OrderSettings();

            _localizationSettings = new LocalizationSettings();

            _orderProcessingService = new OrderProcessingService(_orderService, _webHelper,
                                                                 _localizationService, _languageService,
                                                                 _productService, _paymentService, _logger,
                                                                 _orderTotalCalcService, _priceCalcService, _priceFormatter,
                                                                 _productAttributeParser, _productAttributeFormatter,
                                                                 _giftCardService, _shoppingCartService, _checkoutAttributeFormatter,
                                                                 _shippingService, _taxService,
                                                                 _customerService, _discountService,
                                                                 _encryptionService, _workContext, _workflowMessageService,
                                                                 _smsService, _customerActivityService, _currencyService,
                                                                 _paymentSettings, _rewardPointsSettings,
                                                                 _orderSettings, _taxSettings, _localizationSettings);
        }
Beispiel #22
0
 public PaymentService_Brasseler(IUnitOfWorkFactory unitOfWorkFactory, IPaymentGatewayFactory paymentGatewayFactory, ICustomerService customerService, IUserProfileUtilities userProfileUtilities, PaymentSettings paymentSettings, ICartOrderProviderFactory cartOrderProviderFactory, CustomSettings customSettings) : base(unitOfWorkFactory)
 {
     this.paymentGatewayFactory    = paymentGatewayFactory;
     this.customerService          = customerService;
     this.userProfileUtilities     = userProfileUtilities;
     this.paymentSettings          = paymentSettings;
     this.cartOrderProviderFactory = cartOrderProviderFactory;
     this.customSettings           = customSettings;
 }
        public new void SetUp()
        {
            _workContext = null;

            _store = new Store()
            {
                Id = 1
            };
            _storeContext = MockRepository.GenerateMock <IStoreContext>();
            _storeContext.Expect(x => x.CurrentStore).Return(_store);

            var pluginFinder = new PluginFinder();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();

            //price calculation service
            _discountService         = MockRepository.GenerateMock <IDiscountService>();
            _categoryService         = MockRepository.GenerateMock <ICategoryService>();
            _productAttributeParser  = MockRepository.GenerateMock <IProductAttributeParser>();
            _productAttributeService = MockRepository.GenerateMock <IProductAttributeService>();
            _genericAttributeService = MockRepository.GenerateMock <IGenericAttributeService>();
            _eventPublisher          = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _localizationService = MockRepository.GenerateMock <ILocalizationService>();
            _settingService      = MockRepository.GenerateMock <ISettingService>();
            _typeFinder          = MockRepository.GenerateMock <ITypeFinder>();

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List <string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = MockRepository.GenerateMock <IRepository <ShippingMethod> >();
            _logger = new NullLogger();

            _shippingService = new ShippingService(
                _shippingMethodRepository,
                _logger,
                _productAttributeParser,
                _productService,
                _checkoutAttributeParser,
                _genericAttributeService,
                _shippingSettings,
                _eventPublisher,
                _shoppingCartSettings,
                _settingService,
                this.ProviderManager,
                _typeFinder);

            _shipmentService = MockRepository.GenerateMock <IShipmentService>();

            _paymentService          = MockRepository.GenerateMock <IPaymentService>();
            _providerManager         = MockRepository.GenerateMock <IProviderManager>();
            _checkoutAttributeParser = MockRepository.GenerateMock <ICheckoutAttributeParser>();
            _giftCardService         = MockRepository.GenerateMock <IGiftCardService>();

            //tax
            _taxSettings = new TaxSettings();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.DefaultTaxAddressId = 10;

            _addressService = MockRepository.GenerateMock <IAddressService>();
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address()
            {
                Id = _taxSettings.DefaultTaxAddressId
            });
            _downloadService  = MockRepository.GenerateMock <IDownloadService>();
            _services         = MockRepository.GenerateMock <ICommonServices>();
            _httpRequestBase  = MockRepository.GenerateMock <HttpRequestBase>();
            _geoCountryLookup = MockRepository.GenerateMock <IGeoCountryLookup>();

            _taxService = new TaxService(_addressService, _workContext, _taxSettings, _shoppingCartSettings, pluginFinder, _geoCountryLookup, this.ProviderManager);

            _rewardPointsSettings = new RewardPointsSettings();

            _priceCalcService = new PriceCalculationService(_discountService, _categoryService, _productAttributeParser, _productService, _shoppingCartSettings, _catalogSettings,
                                                            _productAttributeService, _downloadService, _services, _httpRequestBase, _taxService);

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
                                                                      _priceCalcService, _taxService, _shippingService, _providerManager,
                                                                      _checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService, _productAttributeParser,
                                                                      _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);

            _orderService                  = MockRepository.GenerateMock <IOrderService>();
            _webHelper                     = MockRepository.GenerateMock <IWebHelper>();
            _languageService               = MockRepository.GenerateMock <ILanguageService>();
            _productService                = MockRepository.GenerateMock <IProductService>();
            _priceFormatter                = MockRepository.GenerateMock <IPriceFormatter>();
            _productAttributeFormatter     = MockRepository.GenerateMock <IProductAttributeFormatter>();
            _shoppingCartService           = MockRepository.GenerateMock <IShoppingCartService>();
            _checkoutAttributeFormatter    = MockRepository.GenerateMock <ICheckoutAttributeFormatter>();
            _customerService               = MockRepository.GenerateMock <ICustomerService>();
            _encryptionService             = MockRepository.GenerateMock <IEncryptionService>();
            _workflowMessageService        = MockRepository.GenerateMock <IWorkflowMessageService>();
            _customerActivityService       = MockRepository.GenerateMock <ICustomerActivityService>();
            _currencyService               = MockRepository.GenerateMock <ICurrencyService>();
            _affiliateService              = MockRepository.GenerateMock <IAffiliateService>();
            _newsLetterSubscriptionService = MockRepository.GenerateMock <INewsLetterSubscriptionService>();

            _paymentSettings = new PaymentSettings()
            {
                ActivePaymentMethodSystemNames = new List <string>()
                {
                    "Payments.TestMethod"
                }
            };
            _orderSettings = new OrderSettings();

            _localizationSettings = new LocalizationSettings();

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _currencySettings = new CurrencySettings();

            _orderProcessingService = new OrderProcessingService(_orderService, _webHelper,
                                                                 _localizationService, _languageService,
                                                                 _productService, _paymentService, _logger,
                                                                 _orderTotalCalcService, _priceCalcService, _priceFormatter,
                                                                 _productAttributeParser, _productAttributeFormatter,
                                                                 _giftCardService, _shoppingCartService, _checkoutAttributeFormatter,
                                                                 _shippingService, _shipmentService, _taxService,
                                                                 _customerService, _discountService,
                                                                 _encryptionService, _workContext, _storeContext, _workflowMessageService,
                                                                 _customerActivityService, _currencyService, _affiliateService,
                                                                 _eventPublisher, _genericAttributeService,
                                                                 _newsLetterSubscriptionService,
                                                                 _paymentSettings, _rewardPointsSettings,
                                                                 _orderSettings, _taxSettings, _localizationSettings,
                                                                 _currencySettings, _shoppingCartSettings);
        }
 public PaymentServiceHook(PaymentSettings paymentSettings, IPluginFinder pluginFinder, ShoppingCartSettings shoppingCartSettings) :
     base(paymentSettings, pluginFinder, shoppingCartSettings)
 {
 }
Beispiel #25
0
        //Constructor functions that takes context
        //and sets them to the private variables above

        public DonateController(ApplicationDbContext ctx, IOptions <PaymentSettings> paymentSettings)
        {
            context          = ctx;
            _paymentSettings = paymentSettings.Value;
        }
 public OrderStatusChangedToStockConfirmedIntegrationEventHandler(IEventBus eventBus,
                                                                  IOptionsSnapshot <PaymentSettings> settings)
 {
     _eventBus = eventBus;
     _settings = settings.Value;
 }
Beispiel #27
0
 public CashOnDeliveryPaymentMethod(PaymentSettings paymentSettings)
 {
     _paymentSettings = paymentSettings;
 }
 public MmsOrderProcessingOverride(
     CurrencySettings currencySettings,
     IAddressService addressService,
     IAffiliateService affiliateService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter,
     ICountryService countryService,
     ICurrencyService currencyService,
     ICustomerActivityService customerActivityService,
     ICustomerService customerService,
     ICustomNumberFormatter customNumberFormatter,
     IDiscountService discountService,
     IEncryptionService encryptionService,
     IEventPublisher eventPublisher,
     IGenericAttributeService genericAttributeService,
     IGiftCardService giftCardService,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILogger logger,
     IOrderService orderService,
     IOrderTotalCalculationService orderTotalCalculationService,
     IPaymentPluginManager paymentPluginManager,
     IPaymentService paymentService,
     IPdfService pdfService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IProductService productService,
     IRewardPointService rewardPointService,
     IShipmentService shipmentService,
     IShippingService shippingService,
     IShoppingCartService shoppingCartService,
     IStateProvinceService stateProvinceService,
     ITaxService taxService,
     IVendorService vendorService,
     IWebHelper webHelper,
     IWorkContext workContext,
     IWorkflowMessageService workflowMessageService,
     LocalizationSettings localizationSettings,
     OrderSettings orderSettings,
     PaymentSettings paymentSettings,
     RewardPointsSettings rewardPointsSettings,
     ShippingSettings shippingSettings,
     TaxSettings taxSettings,
     MmsAdminService mmsadminService) : base(
         currencySettings,
         addressService,
         affiliateService,
         checkoutAttributeFormatter,
         countryService,
         currencyService,
         customerActivityService,
         customerService,
         customNumberFormatter,
         discountService,
         encryptionService,
         eventPublisher,
         genericAttributeService,
         giftCardService,
         languageService,
         localizationService,
         logger,
         orderService,
         orderTotalCalculationService,
         paymentPluginManager,
         paymentService,
         pdfService,
         priceCalculationService,
         priceFormatter,
         productAttributeFormatter,
         productAttributeParser,
         productService,
         rewardPointService,
         shipmentService,
         shippingService,
         shoppingCartService,
         stateProvinceService,
         taxService,
         vendorService,
         webHelper,
         workContext,
         workflowMessageService,
         localizationSettings,
         orderSettings,
         paymentSettings,
         rewardPointsSettings,
         shippingSettings,
         taxSettings)
 {
     _currencySettings           = currencySettings;
     _addressService             = addressService;
     _affiliateService           = affiliateService;
     _checkoutAttributeFormatter = checkoutAttributeFormatter;
     _countryService             = countryService;
     _currencyService            = currencyService;
     _customerActivityService    = customerActivityService;
     _customerService            = customerService;
     _customNumberFormatter      = customNumberFormatter;
     _discountService            = discountService;
     _encryptionService          = encryptionService;
     _eventPublisher             = eventPublisher;
     _genericAttributeService    = genericAttributeService;
     _giftCardService            = giftCardService;
     _languageService            = languageService;
     _localizationService        = localizationService;
     _logger       = logger;
     _orderService = orderService;
     _orderTotalCalculationService = orderTotalCalculationService;
     _paymentPluginManager         = paymentPluginManager;
     _paymentService            = paymentService;
     _pdfService                = pdfService;
     _priceCalculationService   = priceCalculationService;
     _priceFormatter            = priceFormatter;
     _productAttributeFormatter = productAttributeFormatter;
     _productAttributeParser    = productAttributeParser;
     _productService            = productService;
     _rewardPointService        = rewardPointService;
     _shipmentService           = shipmentService;
     _shippingService           = shippingService;
     _shoppingCartService       = shoppingCartService;
     _stateProvinceService      = stateProvinceService;
     _taxService                = taxService;
     _vendorService             = vendorService;
     _webHelper              = webHelper;
     _workContext            = workContext;
     _workflowMessageService = workflowMessageService;
     _localizationSettings   = localizationSettings;
     _orderSettings          = orderSettings;
     _paymentSettings        = paymentSettings;
     _rewardPointsSettings   = rewardPointsSettings;
     _shippingSettings       = shippingSettings;
     _taxSettings            = taxSettings;
     _mmsadminService        = mmsadminService;
 }
Beispiel #29
0
 public CreditService(IDataRepository <Credit> dataRepository, PaymentSettings paymentSettings) : base(dataRepository)
 {
     _paymentSettings = paymentSettings;
 }
 public StripePaymentProcessor(IOptions <PaymentSettings> paymentSettings)
 {
     this._paymentSettings = paymentSettings.Value;
 }
        public new void SetUp()
        {
            _productService           = new Mock <IProductService>();
            _storeContext             = new Mock <IStoreContext>();
            _discountService          = new Mock <IDiscountService>();
            _categoryService          = new Mock <ICategoryService>();
            _manufacturerService      = new Mock <IManufacturerService>();
            _productAttributeParser   = new Mock <IProductAttributeParser>();
            _eventPublisher           = new Mock <IEventPublisher>();
            _localizationService      = new Mock <ILocalizationService>();
            _shippingMethodRepository = new Mock <IRepository <ShippingMethod> >();
            _warehouseRepository      = new Mock <IRepository <Warehouse> >();
            _shipmentService          = new Mock <IShipmentService>();
            _paymentService           = new Mock <IPaymentService>();
            _checkoutAttributeParser  = new Mock <ICheckoutAttributeParser>();
            _giftCardService          = new Mock <IGiftCardService>();
            _genericAttributeService  = new Mock <IGenericAttributeService>();
            _geoLookupService         = new Mock <IGeoLookupService>();
            _countryService           = new Mock <ICountryService>();
            _stateProvinceService     = new Mock <IStateProvinceService>();
            _eventPublisher           = new Mock <IEventPublisher>();
            _addressService           = new Mock <IAddressService>();
            _rewardPointService       = new Mock <IRewardPointService>();
            _orderService             = new Mock <IOrderService>();
            _webHelper                  = new Mock <IWebHelper>();
            _languageService            = new Mock <ILanguageService>();
            _priceFormatter             = new Mock <IPriceFormatter>();
            _productAttributeFormatter  = new Mock <IProductAttributeFormatter>();
            _shoppingCartService        = new Mock <IShoppingCartService>();
            _checkoutAttributeFormatter = new Mock <ICheckoutAttributeFormatter>();
            _customerService            = new Mock <ICustomerService>();
            _encryptionService          = new Mock <IEncryptionService>();
            _workflowMessageService     = new Mock <IWorkflowMessageService>();
            _customerActivityService    = new Mock <ICustomerActivityService>();
            _currencyService            = new Mock <ICurrencyService>();
            _affiliateService           = new Mock <IAffiliateService>();
            _vendorService              = new Mock <IVendorService>();
            _pdfService                 = new Mock <IPdfService>();
            _customNumberFormatter      = new Mock <ICustomNumberFormatter>();
            _rewardPointService         = new Mock <IRewardPointService>();

            _workContext = null;

            _store = new Store {
                Id = 1
            };

            _storeContext.Setup(x => x.CurrentStore).Returns(_store);

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();

            var cacheManager = new NopNullCache();

            //price calculation service
            _priceCalcService = new PriceCalculationService(_workContext, _storeContext.Object,
                                                            _discountService.Object, _categoryService.Object, _manufacturerService.Object,
                                                            _productAttributeParser.Object, _productService.Object,
                                                            cacheManager, _shoppingCartSettings, _catalogSettings);

            _eventPublisher.Setup(x => x.Publish(It.IsAny <object>()));

            var pluginFinder = new PluginFinder(_eventPublisher.Object);

            //shipping
            _shippingSettings = new ShippingSettings
            {
                ActiveShippingRateComputationMethodSystemNames = new List <string>()
            };
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");

            _logger           = new NullLogger();
            _customerSettings = new CustomerSettings();
            _addressSettings  = new AddressSettings();

            _shippingService = new ShippingService(_shippingMethodRepository.Object,
                                                   _warehouseRepository.Object,
                                                   _logger,
                                                   _productService.Object,
                                                   _productAttributeParser.Object,
                                                   _checkoutAttributeParser.Object,
                                                   _genericAttributeService.Object,
                                                   _localizationService.Object,
                                                   _addressService.Object,
                                                   _shippingSettings,
                                                   pluginFinder,
                                                   _storeContext.Object,
                                                   _eventPublisher.Object,
                                                   _shoppingCartSettings,
                                                   cacheManager);

            //tax
            _taxSettings = new TaxSettings
            {
                ShippingIsTaxable = true,
                PaymentMethodAdditionalFeeIsTaxable = true,
                DefaultTaxAddressId = 10
            };

            _addressService.Setup(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Returns(new Address {
                Id = _taxSettings.DefaultTaxAddressId
            });
            _taxService = new TaxService(_addressService.Object, _workContext, _storeContext.Object, _taxSettings,
                                         pluginFinder, _geoLookupService.Object, _countryService.Object, _stateProvinceService.Object, _logger, _webHelper.Object,
                                         _customerSettings, _shippingSettings, _addressSettings);


            _rewardPointsSettings = new RewardPointsSettings();

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext.Object,
                                                                      _priceCalcService, _productService.Object, _productAttributeParser.Object, _taxService, _shippingService, _paymentService.Object,
                                                                      _checkoutAttributeParser.Object, _discountService.Object, _giftCardService.Object,
                                                                      _genericAttributeService.Object, _rewardPointService.Object,
                                                                      _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);

            _paymentSettings = new PaymentSettings
            {
                ActivePaymentMethodSystemNames = new List <string>
                {
                    "Payments.TestMethod"
                }
            };
            _orderSettings = new OrderSettings();

            _localizationSettings = new LocalizationSettings();

            _eventPublisher.Setup(x => x.Publish(It.IsAny <object>()));

            _currencySettings = new CurrencySettings();

            _orderProcessingService = new OrderProcessingService(_orderService.Object, _webHelper.Object,
                                                                 _localizationService.Object, _languageService.Object,
                                                                 _productService.Object, _paymentService.Object, _logger,
                                                                 _orderTotalCalcService, _priceCalcService, _priceFormatter.Object,
                                                                 _productAttributeParser.Object, _productAttributeFormatter.Object,
                                                                 _giftCardService.Object, _shoppingCartService.Object, _checkoutAttributeFormatter.Object,
                                                                 _shippingService, _shipmentService.Object, _taxService,
                                                                 _customerService.Object, _discountService.Object,
                                                                 _encryptionService.Object, _workContext,
                                                                 _workflowMessageService.Object, _vendorService.Object,
                                                                 _customerActivityService.Object, _currencyService.Object, _affiliateService.Object,
                                                                 _eventPublisher.Object, _pdfService.Object, _rewardPointService.Object,
                                                                 _genericAttributeService.Object,
                                                                 _countryService.Object, _stateProvinceService.Object,
                                                                 _shippingSettings, _paymentSettings, _rewardPointsSettings,
                                                                 _orderSettings, _taxSettings, _localizationSettings,
                                                                 _currencySettings, _customNumberFormatter.Object);
        }
 public PaymentService(IOptions <PaymentSettings> paymentSettings, StripeChargeService stripeChargeService)
 {
     _paymentSettings     = paymentSettings.Value;
     _stripeChargeService = stripeChargeService;
 }