Exemplo n.º 1
0
        /// <returns>A task that represents the asynchronous operation</returns>
        public virtual async Task <IActionResult> MarkAsPrimaryProvider(string systemName)
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageTaxSettings))
            {
                return(AccessDeniedView());
            }

            if (string.IsNullOrEmpty(systemName))
            {
                return(RedirectToAction("Providers"));
            }

            var taxProvider = await _taxPluginManager.LoadPluginBySystemNameAsync(systemName);

            if (taxProvider == null)
            {
                return(RedirectToAction("Providers"));
            }

            _taxSettings.ActiveTaxProviderSystemName = systemName;
            await _settingService.SaveSettingAsync(_taxSettings);

            return(RedirectToAction("Providers"));
        }
Exemplo n.º 2
0
        public async Task CanLoadTaxProviderBySystemKeyword()
        {
            var provider = await _taxPluginManager.LoadPluginBySystemNameAsync("FixedTaxRateTest");

            provider.Should().NotBeNull();
        }