diff --git a/BTCPayServer.Tests/BTCPayServerTester.cs b/BTCPayServer.Tests/BTCPayServerTester.cs
index 7008e8984..43842f9de 100644
--- a/BTCPayServer.Tests/BTCPayServerTester.cs
+++ b/BTCPayServer.Tests/BTCPayServerTester.cs
@@ -1,7 +1,7 @@
using BTCPayServer.Configuration;
using BTCPayServer.Hosting;
-using BTCPayServer.Invoicing;
-using BTCPayServer.RateProvider;
+using BTCPayServer.Servcices.Invoices;
+using BTCPayServer.Services.Rates;
using BTCPayServer.Tests.Logging;
using BTCPayServer.Tests.Mocks;
using Microsoft.AspNetCore.Hosting;
diff --git a/BTCPayServer.Tests/TestAccount.cs b/BTCPayServer.Tests/TestAccount.cs
index 30bccba97..0bc34dcdb 100644
--- a/BTCPayServer.Tests/TestAccount.cs
+++ b/BTCPayServer.Tests/TestAccount.cs
@@ -1,7 +1,7 @@
using BTCPayServer.Controllers;
-using BTCPayServer.Invoicing;
using BTCPayServer.Models.AccountViewModels;
using BTCPayServer.Models.StoreViewModels;
+using BTCPayServer.Servcices.Invoices;
using Microsoft.AspNetCore.Mvc;
using NBitcoin;
using NBitpayClient;
diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs
index 838dbbdff..7923ff272 100644
--- a/BTCPayServer.Tests/UnitTest1.cs
+++ b/BTCPayServer.Tests/UnitTest1.cs
@@ -9,7 +9,7 @@ using System.Threading;
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;
-using BTCPayServer.Invoicing;
+using BTCPayServer.Servcices.Invoices;
namespace BTCPayServer.Tests
{
@@ -123,7 +123,7 @@ namespace BTCPayServer.Tests
FullNotifications = true
}, Facade.Merchant);
- var textSearchResult = tester.PayTester.Runtime.InvoiceRepository.GetInvoices(new Invoicing.InvoiceQuery()
+ var textSearchResult = tester.PayTester.Runtime.InvoiceRepository.GetInvoices(new InvoiceQuery()
{
StoreId = user.StoreId,
TextSearch = invoice.OrderId
@@ -131,7 +131,7 @@ namespace BTCPayServer.Tests
Assert.Equal(1, textSearchResult.Length);
- textSearchResult = tester.PayTester.Runtime.InvoiceRepository.GetInvoices(new Invoicing.InvoiceQuery()
+ textSearchResult = tester.PayTester.Runtime.InvoiceRepository.GetInvoices(new InvoiceQuery()
{
StoreId = user.StoreId,
TextSearch = invoice.Id
diff --git a/BTCPayServer/Configuration/BTCPayServerRuntime.cs b/BTCPayServer/Configuration/BTCPayServerRuntime.cs
index 9e523cf1b..903b6520f 100644
--- a/BTCPayServer/Configuration/BTCPayServerRuntime.cs
+++ b/BTCPayServer/Configuration/BTCPayServerRuntime.cs
@@ -1,8 +1,6 @@
using BTCPayServer.Authentication;
using Microsoft.Extensions.Logging;
-using BTCPayServer.Invoicing;
using BTCPayServer.Logging;
-using BTCPayServer.Wallet;
using DBreeze;
using NBitcoin;
using NBXplorer;
@@ -15,6 +13,8 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using BTCPayServer.Data;
+using BTCPayServer.Servcices.Invoices;
+using BTCPayServer.Services.Wallets;
namespace BTCPayServer.Configuration
{
diff --git a/BTCPayServer/Controllers/AccountController.cs b/BTCPayServer/Controllers/AccountController.cs
index 61b7e1b98..c22f232b2 100644
--- a/BTCPayServer/Controllers/AccountController.cs
+++ b/BTCPayServer/Controllers/AccountController.cs
@@ -13,7 +13,8 @@ using Microsoft.Extensions.Options;
using BTCPayServer.Models;
using BTCPayServer.Models.AccountViewModels;
using BTCPayServer.Services;
-using BTCPayServer.Stores;
+using BTCPayServer.Services.Mails;
+using BTCPayServer.Services.Stores;
namespace BTCPayServer.Controllers
{
diff --git a/BTCPayServer/Controllers/InvoiceController.API.cs b/BTCPayServer/Controllers/InvoiceController.API.cs
index fe3128dca..1c5c49f1b 100644
--- a/BTCPayServer/Controllers/InvoiceController.API.cs
+++ b/BTCPayServer/Controllers/InvoiceController.API.cs
@@ -1,7 +1,6 @@
using BTCPayServer.Authentication;
using Microsoft.Extensions.Logging;
using BTCPayServer.Filters;
-using BTCPayServer.Invoicing;
using BTCPayServer.Logging;
using BTCPayServer.Models;
using Microsoft.AspNetCore.Mvc;
@@ -11,6 +10,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Data;
+using BTCPayServer.Servcices.Invoices;
namespace BTCPayServer.Controllers
{
diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs
index fc6aee6de..9d80e0b63 100644
--- a/BTCPayServer/Controllers/InvoiceController.UI.cs
+++ b/BTCPayServer/Controllers/InvoiceController.UI.cs
@@ -1,7 +1,7 @@
using BTCPayServer.Data;
using BTCPayServer.Filters;
-using BTCPayServer.Invoicing;
using BTCPayServer.Models.InvoicingModels;
+using BTCPayServer.Servcices.Invoices;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
diff --git a/BTCPayServer/Controllers/InvoiceController.cs b/BTCPayServer/Controllers/InvoiceController.cs
index a5421a769..4d84ae339 100644
--- a/BTCPayServer/Controllers/InvoiceController.cs
+++ b/BTCPayServer/Controllers/InvoiceController.cs
@@ -12,12 +12,9 @@ using System.Text;
using System.Threading.Tasks;
using BTCPayServer.Models;
using Newtonsoft.Json;
-using BTCPayServer.Invoicing;
-using BTCPayServer.Wallet;
using System.Globalization;
using NBitcoin;
using NBitcoin.DataEncoders;
-using BTCPayServer.RateProvider;
using BTCPayServer.Filters;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using System.Net;
@@ -26,12 +23,15 @@ using Newtonsoft.Json.Linq;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using NBitcoin.Payment;
using BTCPayServer.Data;
-using BTCPayServer.Stores;
using BTCPayServer.Models.InvoicingModels;
using System.Security.Claims;
using BTCPayServer.Services;
using System.ComponentModel.DataAnnotations;
using System.Text.RegularExpressions;
+using BTCPayServer.Services.Stores;
+using BTCPayServer.Servcices.Invoices;
+using BTCPayServer.Services.Rates;
+using BTCPayServer.Services.Wallets;
namespace BTCPayServer.Controllers
{
diff --git a/BTCPayServer/Controllers/ManageController.cs b/BTCPayServer/Controllers/ManageController.cs
index b2457b6fe..6b0d88869 100644
--- a/BTCPayServer/Controllers/ManageController.cs
+++ b/BTCPayServer/Controllers/ManageController.cs
@@ -14,11 +14,12 @@ using BTCPayServer.Models;
using BTCPayServer.Models.ManageViewModels;
using BTCPayServer.Services;
using BTCPayServer.Authentication;
-using BTCPayServer.Wallet;
using Microsoft.AspNetCore.Hosting;
using NBitpayClient;
using NBitcoin;
-using BTCPayServer.Stores;
+using BTCPayServer.Services.Stores;
+using BTCPayServer.Services.Wallets;
+using BTCPayServer.Services.Mails;
namespace BTCPayServer.Controllers
{
diff --git a/BTCPayServer/Controllers/RateController.cs b/BTCPayServer/Controllers/RateController.cs
index 1dabe59af..c5df858d7 100644
--- a/BTCPayServer/Controllers/RateController.cs
+++ b/BTCPayServer/Controllers/RateController.cs
@@ -1,5 +1,4 @@
using BTCPayServer.Models;
-using BTCPayServer.RateProvider;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
@@ -7,6 +6,7 @@ using System.Text;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Filters;
+using BTCPayServer.Services.Rates;
namespace BTCPayServer.Controllers
{
diff --git a/BTCPayServer/Controllers/StoresController.cs b/BTCPayServer/Controllers/StoresController.cs
index f2f77c926..35d364925 100644
--- a/BTCPayServer/Controllers/StoresController.cs
+++ b/BTCPayServer/Controllers/StoresController.cs
@@ -1,8 +1,8 @@
using BTCPayServer.Authentication;
using BTCPayServer.Models;
using BTCPayServer.Models.StoreViewModels;
-using BTCPayServer.Stores;
-using BTCPayServer.Wallet;
+using BTCPayServer.Services.Stores;
+using BTCPayServer.Services.Wallets;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
diff --git a/BTCPayServer/Data/StoreData.cs b/BTCPayServer/Data/StoreData.cs
index 6b1f2ad01..f330a984c 100644
--- a/BTCPayServer/Data/StoreData.cs
+++ b/BTCPayServer/Data/StoreData.cs
@@ -1,5 +1,5 @@
-using BTCPayServer.Invoicing;
-using BTCPayServer.Models;
+using BTCPayServer.Models;
+using BTCPayServer.Servcices.Invoices;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
diff --git a/BTCPayServer/Extensions/EmailSenderExtensions.cs b/BTCPayServer/Extensions/EmailSenderExtensions.cs
index dfc0dad1c..ac07f0505 100644
--- a/BTCPayServer/Extensions/EmailSenderExtensions.cs
+++ b/BTCPayServer/Extensions/EmailSenderExtensions.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using BTCPayServer.Services;
+using BTCPayServer.Services.Mails;
namespace BTCPayServer.Services
{
diff --git a/BTCPayServer/Hosting/BTCPayServerServices.cs b/BTCPayServer/Hosting/BTCPayServerServices.cs
index b956f1b26..ed24cd0d0 100644
--- a/BTCPayServer/Hosting/BTCPayServerServices.cs
+++ b/BTCPayServer/Hosting/BTCPayServerServices.cs
@@ -6,20 +6,20 @@ using System.Text;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.AspNetCore.Http;
-using BTCPayServer.Wallet;
-using BTCPayServer.RateProvider;
using NBitpayClient;
using NBitcoin;
using BTCPayServer.Data;
using Microsoft.EntityFrameworkCore;
using System.IO;
using Microsoft.Data.Sqlite;
-using BTCPayServer.Invoicing;
using NBXplorer;
-using BTCPayServer.Stores;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
using BTCPayServer.Services;
+using BTCPayServer.Servcices.Invoices;
+using BTCPayServer.Services.Rates;
+using BTCPayServer.Services.Stores;
+using BTCPayServer.Services.Fees;
namespace BTCPayServer.Hosting
{
diff --git a/BTCPayServer/Hosting/Startup.cs b/BTCPayServer/Hosting/Startup.cs
index 3bdc7ee89..115825198 100644
--- a/BTCPayServer/Hosting/Startup.cs
+++ b/BTCPayServer/Hosting/Startup.cs
@@ -20,8 +20,9 @@ using Microsoft.Extensions.Logging;
using BTCPayServer.Logging;
using Microsoft.AspNetCore.Authorization;
using System.Threading.Tasks;
-using BTCPayServer.Stores;
using BTCPayServer.Controllers;
+using BTCPayServer.Services.Stores;
+using BTCPayServer.Services.Mails;
namespace BTCPayServer.Hosting
{
diff --git a/BTCPayServer/Migrations/20170913143004_Init.Designer.cs b/BTCPayServer/Migrations/20170913143004_Init.Designer.cs
index 0f8d1a373..9f74a3158 100644
--- a/BTCPayServer/Migrations/20170913143004_Init.Designer.cs
+++ b/BTCPayServer/Migrations/20170913143004_Init.Designer.cs
@@ -1,6 +1,5 @@
//
using BTCPayServer.Data;
-using BTCPayServer.Invoicing;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
diff --git a/BTCPayServer/Migrations/ApplicationDbContextModelSnapshot.cs b/BTCPayServer/Migrations/ApplicationDbContextModelSnapshot.cs
index eda20481a..0707416ac 100644
--- a/BTCPayServer/Migrations/ApplicationDbContextModelSnapshot.cs
+++ b/BTCPayServer/Migrations/ApplicationDbContextModelSnapshot.cs
@@ -1,6 +1,5 @@
//
using BTCPayServer.Data;
-using BTCPayServer.Invoicing;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
diff --git a/BTCPayServer/Models/ApplicationUser.cs b/BTCPayServer/Models/ApplicationUser.cs
index 19f50066c..8f3203ee7 100644
--- a/BTCPayServer/Models/ApplicationUser.cs
+++ b/BTCPayServer/Models/ApplicationUser.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
-using BTCPayServer.Invoicing;
using BTCPayServer.Data;
namespace BTCPayServer.Models
diff --git a/BTCPayServer/Models/ManageViewModels/IndexViewModel.cs b/BTCPayServer/Models/ManageViewModels/IndexViewModel.cs
index dea1bc674..05d54d013 100644
--- a/BTCPayServer/Models/ManageViewModels/IndexViewModel.cs
+++ b/BTCPayServer/Models/ManageViewModels/IndexViewModel.cs
@@ -1,5 +1,4 @@
-using BTCPayServer.Invoicing;
-using BTCPayServer.Validations;
+using BTCPayServer.Validations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
diff --git a/BTCPayServer/Models/StoreViewModels/StoreViewModel.cs b/BTCPayServer/Models/StoreViewModels/StoreViewModel.cs
index 85a1dfce3..e8d4b6a2f 100644
--- a/BTCPayServer/Models/StoreViewModels/StoreViewModel.cs
+++ b/BTCPayServer/Models/StoreViewModels/StoreViewModel.cs
@@ -1,4 +1,4 @@
-using BTCPayServer.Invoicing;
+using BTCPayServer.Servcices.Invoices;
using BTCPayServer.Validations;
using System;
using System.Collections.Generic;
diff --git a/BTCPayServer/Services/Fees/FixedFeeProvider.cs b/BTCPayServer/Services/Fees/FixedFeeProvider.cs
new file mode 100644
index 000000000..20fb597ed
--- /dev/null
+++ b/BTCPayServer/Services/Fees/FixedFeeProvider.cs
@@ -0,0 +1,26 @@
+using NBitcoin;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace BTCPayServer.Services.Fees
+{
+ public class FixedFeeProvider : IFeeProvider
+ {
+ public FixedFeeProvider(FeeRate feeRate)
+ {
+ FeeRate = feeRate;
+ }
+
+ public FeeRate FeeRate
+ {
+ get; set;
+ }
+
+ public Task GetFeeRateAsync()
+ {
+ return Task.FromResult(FeeRate);
+ }
+ }
+}
diff --git a/BTCPayServer/Services/Fees/IFeeProvider.cs b/BTCPayServer/Services/Fees/IFeeProvider.cs
new file mode 100644
index 000000000..30d7844d7
--- /dev/null
+++ b/BTCPayServer/Services/Fees/IFeeProvider.cs
@@ -0,0 +1,15 @@
+using NBitcoin;
+using NBXplorer;
+using NBXplorer.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace BTCPayServer.Services
+{
+ public interface IFeeProvider
+ {
+ Task GetFeeRateAsync();
+ }
+}
diff --git a/BTCPayServer/Services/IFeeProvider.cs b/BTCPayServer/Services/Fees/NBxplorerFeeProvider.cs
similarity index 54%
rename from BTCPayServer/Services/IFeeProvider.cs
rename to BTCPayServer/Services/Fees/NBxplorerFeeProvider.cs
index 0a5580a7c..bb0482d63 100644
--- a/BTCPayServer/Services/IFeeProvider.cs
+++ b/BTCPayServer/Services/Fees/NBxplorerFeeProvider.cs
@@ -6,13 +6,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-namespace BTCPayServer.Services
+namespace BTCPayServer.Services.Fees
{
- public interface IFeeProvider
- {
- Task GetFeeRateAsync();
- }
-
public class NBXplorerFeeProvider : IFeeProvider
{
public ExplorerClient ExplorerClient
@@ -33,28 +28,10 @@ namespace BTCPayServer.Services
{
return (await ExplorerClient.GetFeeRateAsync(BlockTarget).ConfigureAwait(false)).FeeRate;
}
- catch(NBXplorerException ex) when( ex.Error.HttpCode == 400 && ex.Error.Code == "fee-estimation-unavailable")
+ catch(NBXplorerException ex) when(ex.Error.HttpCode == 400 && ex.Error.Code == "fee-estimation-unavailable")
{
return Fallback;
}
}
}
-
- public class FixedFeeProvider : IFeeProvider
- {
- public FixedFeeProvider(FeeRate feeRate)
- {
- FeeRate = feeRate;
- }
-
- public FeeRate FeeRate
- {
- get; set;
- }
-
- public Task GetFeeRateAsync()
- {
- return Task.FromResult(FeeRate);
- }
- }
}
diff --git a/BTCPayServer/Invoicing/InvoiceEntity.cs b/BTCPayServer/Services/Invoices/InvoiceEntity.cs
similarity index 98%
rename from BTCPayServer/Invoicing/InvoiceEntity.cs
rename to BTCPayServer/Services/Invoices/InvoiceEntity.cs
index 6280b0b68..cb2ce03d0 100644
--- a/BTCPayServer/Invoicing/InvoiceEntity.cs
+++ b/BTCPayServer/Services/Invoices/InvoiceEntity.cs
@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic;
using System.Text;
-namespace BTCPayServer.Invoicing
+namespace BTCPayServer.Servcices.Invoices
{
public class BuyerInformation
{
diff --git a/BTCPayServer/Invoicing/InvoiceRepository.cs b/BTCPayServer/Services/Invoices/InvoiceRepository.cs
similarity index 99%
rename from BTCPayServer/Invoicing/InvoiceRepository.cs
rename to BTCPayServer/Services/Invoices/InvoiceRepository.cs
index e0cfc6d0e..f0251ecf2 100644
--- a/BTCPayServer/Invoicing/InvoiceRepository.cs
+++ b/BTCPayServer/Services/Invoices/InvoiceRepository.cs
@@ -17,7 +17,7 @@ using BTCPayServer.Data;
using System.Globalization;
using BTCPayServer.Models.InvoicingModels;
-namespace BTCPayServer.Invoicing
+namespace BTCPayServer.Servcices.Invoices
{
public class InvoiceRepository
{
diff --git a/BTCPayServer/Invoicing/InvoiceWatcher.cs b/BTCPayServer/Services/Invoices/InvoiceWatcher.cs
similarity index 99%
rename from BTCPayServer/Invoicing/InvoiceWatcher.cs
rename to BTCPayServer/Services/Invoices/InvoiceWatcher.cs
index ec9c9ea6d..660ff2a76 100644
--- a/BTCPayServer/Invoicing/InvoiceWatcher.cs
+++ b/BTCPayServer/Services/Invoices/InvoiceWatcher.cs
@@ -12,7 +12,7 @@ using System.Threading;
using Microsoft.Extensions.Hosting;
using System.Collections.Concurrent;
-namespace BTCPayServer.Invoicing
+namespace BTCPayServer.Servcices.Invoices
{
public class InvoiceWatcher : IHostedService
{
diff --git a/BTCPayServer/Services/EmailSender.cs b/BTCPayServer/Services/Mails/EmailSender.cs
similarity index 92%
rename from BTCPayServer/Services/EmailSender.cs
rename to BTCPayServer/Services/Mails/EmailSender.cs
index bd42a1c72..d91753491 100644
--- a/BTCPayServer/Services/EmailSender.cs
+++ b/BTCPayServer/Services/Mails/EmailSender.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-namespace BTCPayServer.Services
+namespace BTCPayServer.Services.Mails
{
// This class is used by the application to send email for account confirmation and password reset.
// For more details see https://go.microsoft.com/fwlink/?LinkID=532713
diff --git a/BTCPayServer/Services/IEmailSender.cs b/BTCPayServer/Services/Mails/IEmailSender.cs
similarity index 85%
rename from BTCPayServer/Services/IEmailSender.cs
rename to BTCPayServer/Services/Mails/IEmailSender.cs
index d42c0307a..a48025573 100644
--- a/BTCPayServer/Services/IEmailSender.cs
+++ b/BTCPayServer/Services/Mails/IEmailSender.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-namespace BTCPayServer.Services
+namespace BTCPayServer.Services.Mails
{
public interface IEmailSender
{
diff --git a/BTCPayServer/RateProvider/BitpayRateProvider.cs b/BTCPayServer/Services/Rates/BitpayRateProvider.cs
similarity index 95%
rename from BTCPayServer/RateProvider/BitpayRateProvider.cs
rename to BTCPayServer/Services/Rates/BitpayRateProvider.cs
index 7f75dd427..a33874aae 100644
--- a/BTCPayServer/RateProvider/BitpayRateProvider.cs
+++ b/BTCPayServer/Services/Rates/BitpayRateProvider.cs
@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
-namespace BTCPayServer.RateProvider
+namespace BTCPayServer.Services.Rates
{
public class BitpayRateProvider : IRateProvider
{
diff --git a/BTCPayServer/RateProvider/CurrencyNameTable.cs b/BTCPayServer/Services/Rates/CurrencyNameTable.cs
similarity index 97%
rename from BTCPayServer/RateProvider/CurrencyNameTable.cs
rename to BTCPayServer/Services/Rates/CurrencyNameTable.cs
index 33454b171..636aedbb4 100644
--- a/BTCPayServer/RateProvider/CurrencyNameTable.cs
+++ b/BTCPayServer/Services/Rates/CurrencyNameTable.cs
@@ -5,7 +5,7 @@ using System.Reflection;
using System.Linq;
using System.Text;
-namespace BTCPayServer.RateProvider
+namespace BTCPayServer.Services.Rates
{
public class CurrencyData
{
diff --git a/BTCPayServer/RateProvider/IRateProvider.cs b/BTCPayServer/Services/Rates/IRateProvider.cs
similarity index 92%
rename from BTCPayServer/RateProvider/IRateProvider.cs
rename to BTCPayServer/Services/Rates/IRateProvider.cs
index 5ba1beed3..47db655fc 100644
--- a/BTCPayServer/RateProvider/IRateProvider.cs
+++ b/BTCPayServer/Services/Rates/IRateProvider.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
-namespace BTCPayServer.RateProvider
+namespace BTCPayServer.Services.Rates
{
public class Rate
{
diff --git a/BTCPayServer/RateProvider/MockRateProvider.cs b/BTCPayServer/Services/Rates/MockRateProvider.cs
similarity index 95%
rename from BTCPayServer/RateProvider/MockRateProvider.cs
rename to BTCPayServer/Services/Rates/MockRateProvider.cs
index 8bf20604b..93528cc15 100644
--- a/BTCPayServer/RateProvider/MockRateProvider.cs
+++ b/BTCPayServer/Services/Rates/MockRateProvider.cs
@@ -4,7 +4,7 @@ using System.Text;
using System.Linq;
using System.Threading.Tasks;
-namespace BTCPayServer.RateProvider
+namespace BTCPayServer.Services.Rates
{
public class MockRateProvider : IRateProvider
{
diff --git a/BTCPayServer/RateProvider/RateUnavailableException.cs b/BTCPayServer/Services/Rates/RateUnavailableException.cs
similarity index 91%
rename from BTCPayServer/RateProvider/RateUnavailableException.cs
rename to BTCPayServer/Services/Rates/RateUnavailableException.cs
index c0614134e..5bab03409 100644
--- a/BTCPayServer/RateProvider/RateUnavailableException.cs
+++ b/BTCPayServer/Services/Rates/RateUnavailableException.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
-namespace BTCPayServer.RateProvider
+namespace BTCPayServer.Services.Rates
{
public class RateUnavailableException : Exception
{
diff --git a/BTCPayServer/Stores/StoreRepository.cs b/BTCPayServer/Services/Stores/StoreRepository.cs
similarity index 98%
rename from BTCPayServer/Stores/StoreRepository.cs
rename to BTCPayServer/Services/Stores/StoreRepository.cs
index 8f2fdae4f..479c3dc35 100644
--- a/BTCPayServer/Stores/StoreRepository.cs
+++ b/BTCPayServer/Services/Stores/StoreRepository.cs
@@ -8,7 +8,7 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
-namespace BTCPayServer.Stores
+namespace BTCPayServer.Services.Stores
{
public class StoreRepository
{
diff --git a/BTCPayServer/Wallet/BTCPayWallet.cs b/BTCPayServer/Services/Wallets/BTCPayWallet.cs
similarity index 98%
rename from BTCPayServer/Wallet/BTCPayWallet.cs
rename to BTCPayServer/Services/Wallets/BTCPayWallet.cs
index e669c0adb..ce5941101 100644
--- a/BTCPayServer/Wallet/BTCPayWallet.cs
+++ b/BTCPayServer/Services/Wallets/BTCPayWallet.cs
@@ -8,7 +8,7 @@ using System.Text;
using System.Linq;
using System.Threading.Tasks;
-namespace BTCPayServer.Wallet
+namespace BTCPayServer.Services.Wallets
{
public class BTCPayWallet
{
diff --git a/BTCPayServer/wwwroot/js/core.js b/BTCPayServer/wwwroot/js/core.js
index 80e0a47a6..60d634b1e 100644
--- a/BTCPayServer/wwwroot/js/core.js
+++ b/BTCPayServer/wwwroot/js/core.js
@@ -33,19 +33,7 @@
var display = $(".timer-row__time-left"); // Timer container
// check if the Document expired
-if (expirationTime <= 0 && !(isArchieved)) {
-
- $(".timer-row__message span").html("Invoice Expired");
- $(".timer-row__spinner").html("");
- $("#emailAddressView").removeClass("active");
- $(".modal-dialog").addClass("expired");
- $("#expired").addClass("active");
-
-} else if (isArchieved) {
- $(".modal-dialog").addClass("archived");
- $("#emailAddressView").removeClass("active");
- $("#archived").addClass("active");
-} else {
+if (expirationTime > 0) {
progressStart(maxTime); // Progress bar
startTimer(expirationTime, display); // Timer
@@ -191,6 +179,7 @@ function updateState(status) {
$(".timer-row").removeClass("expiring-soon");
$(".timer-row__message span").html("Invoice expired.");
$(".timer-row__spinner").html("");
+ $("#emailAddressView").removeClass("active");
$(".modal-dialog").addClass("expired");
$("#expired").addClass("active");
}