/// <returns>A task that represents the asynchronous operation</returns> public async Task <IActionResult> ImportTaxCodes() { //ensure that Avalara tax provider is active if (!await _taxPluginManager.IsPluginActiveAsync(AvalaraTaxDefaults.SystemName)) { return(await Categories()); } if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageTaxSettings)) { return(AccessDeniedView()); } //import tax caodes var importedTaxCodesNumber = await _avalaraTaxManager.ImportTaxCodesAsync(); if (importedTaxCodesNumber.HasValue) { //successfully imported var successMessage = await _localizationService.GetResourceAsync("Plugins.Tax.Avalara.TaxCodes.Import.Success"); _notificationService.SuccessNotification(string.Format(successMessage, importedTaxCodesNumber)); } else { _notificationService.ErrorNotification(await _localizationService.GetResourceAsync("Plugins.Tax.Avalara.TaxCodes.Import.Error")); } return(await Categories()); }