From f097ecdc80dfd341d06ffcc13b6eb1910971188c Mon Sep 17 00:00:00 2001 From: hannes Date: Mon, 24 Feb 2020 20:21:03 +0800 Subject: [PATCH] fix: remove ipn via email #1241 (#1337) * fix: remove ipn via email #1241 * fix: remove ipn via email #1241 --- BTCPayServer/Controllers/AppsController.Crowdfund.cs | 2 -- BTCPayServer/Controllers/AppsController.PointOfSale.cs | 4 ---- BTCPayServer/Controllers/AppsPublicController.cs | 2 -- BTCPayServer/Controllers/InvoiceController.UI.cs | 2 -- .../HostedServices/InvoiceNotificationManager.cs | 1 + .../Models/AppViewModels/UpdateCrowdfundViewModel.cs | 5 ----- .../Models/AppViewModels/UpdatePointOfSaleViewModel.cs | 4 ---- .../Models/InvoicingModels/CreateInvoiceModel.cs | 7 ------- BTCPayServer/Services/Apps/CrowdfundSettings.cs | 2 -- BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml | 10 ---------- BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml | 10 ---------- BTCPayServer/Views/Invoice/CreateInvoice.cshtml | 5 ----- BTCPayServer/Views/Invoice/Invoice.cshtml | 4 ---- 13 files changed, 1 insertion(+), 57 deletions(-) diff --git a/BTCPayServer/Controllers/AppsController.Crowdfund.cs b/BTCPayServer/Controllers/AppsController.Crowdfund.cs index 98d40b0a6..16c8288fe 100644 --- a/BTCPayServer/Controllers/AppsController.Crowdfund.cs +++ b/BTCPayServer/Controllers/AppsController.Crowdfund.cs @@ -34,7 +34,6 @@ namespace BTCPayServer.Controllers var settings = app.GetSettings(); var vm = new UpdateCrowdfundViewModel() { - NotificationEmailWarning = !await IsEmailConfigured(app.StoreDataId), Title = settings.Title, StoreId = app.StoreDataId, Enabled = settings.Enabled, @@ -139,7 +138,6 @@ namespace BTCPayServer.Controllers MainImageUrl = vm.MainImageUrl, EmbeddedCSS = vm.EmbeddedCSS, NotificationUrl = vm.NotificationUrl, - NotificationEmail = vm.NotificationEmail, Tagline = vm.Tagline, PerksTemplate = vm.PerksTemplate, DisqusEnabled = vm.DisqusEnabled, diff --git a/BTCPayServer/Controllers/AppsController.PointOfSale.cs b/BTCPayServer/Controllers/AppsController.PointOfSale.cs index 53c6eadff..792920111 100644 --- a/BTCPayServer/Controllers/AppsController.PointOfSale.cs +++ b/BTCPayServer/Controllers/AppsController.PointOfSale.cs @@ -83,7 +83,6 @@ namespace BTCPayServer.Controllers public string EmbeddedCSS { get; set; } public string Description { get; set; } - public string NotificationEmail { get; set; } public string NotificationUrl { get; set; } public bool? RedirectAutomatically { get; set; } } @@ -99,7 +98,6 @@ namespace BTCPayServer.Controllers var vm = new UpdatePointOfSaleViewModel() { - NotificationEmailWarning = !await IsEmailConfigured(app.StoreDataId), Id = appId, StoreId = app.StoreDataId, Title = settings.Title, @@ -116,7 +114,6 @@ namespace BTCPayServer.Controllers CustomCSSLink = settings.CustomCSSLink, EmbeddedCSS = settings.EmbeddedCSS, Description = settings.Description, - NotificationEmail = settings.NotificationEmail, NotificationUrl = settings.NotificationUrl, SearchTerm = $"storeid:{app.StoreDataId}", RedirectAutomatically = settings.RedirectAutomatically.HasValue ? settings.RedirectAutomatically.Value ? "true" : "false" : "" @@ -194,7 +191,6 @@ namespace BTCPayServer.Controllers CustomTipPercentages = ListSplit(vm.CustomTipPercentages), CustomCSSLink = vm.CustomCSSLink, NotificationUrl = vm.NotificationUrl, - NotificationEmail = vm.NotificationEmail, Description = vm.Description, EmbeddedCSS = vm.EmbeddedCSS, RedirectAutomatically = string.IsNullOrEmpty(vm.RedirectAutomatically) ? (bool?)null : bool.Parse(vm.RedirectAutomatically) diff --git a/BTCPayServer/Controllers/AppsPublicController.cs b/BTCPayServer/Controllers/AppsPublicController.cs index f4f5d46b1..98c07d9fc 100644 --- a/BTCPayServer/Controllers/AppsPublicController.cs +++ b/BTCPayServer/Controllers/AppsPublicController.cs @@ -177,7 +177,6 @@ namespace BTCPayServer.Controllers OrderId = orderId, NotificationURL = string.IsNullOrEmpty(notificationUrl) ? settings.NotificationUrl : notificationUrl, - NotificationEmail = settings.NotificationEmail, RedirectURL = redirectUrl ?? Request.GetDisplayUrl(), FullNotifications = true, ExtendedNotifications = true, @@ -306,7 +305,6 @@ namespace BTCPayServer.Controllers BuyerEmail = request.Email, Price = price, NotificationURL = settings.NotificationUrl, - NotificationEmail = settings.NotificationEmail, FullNotifications = true, ExtendedNotifications = true, RedirectURL = request.RedirectUrl ?? diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index d5f1b90a7..c1fea7bdc 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -65,7 +65,6 @@ namespace BTCPayServer.Controllers BuyerInformation = invoice.BuyerInformation, Fiat = _CurrencyNameTable.DisplayFormatCurrency(prodInfo.Price, prodInfo.Currency), TaxIncluded = _CurrencyNameTable.DisplayFormatCurrency(prodInfo.TaxIncluded, prodInfo.Currency), - NotificationEmail = invoice.NotificationEmail, NotificationUrl = invoice.NotificationURL?.AbsoluteUri, RedirectUrl = invoice.RedirectURL?.AbsoluteUri, ProductInformation = invoice.ProductInformation, @@ -538,7 +537,6 @@ namespace BTCPayServer.Controllers PosData = model.PosData, OrderId = model.OrderId, //RedirectURL = redirect + "redirect", - NotificationEmail = model.NotificationEmail, NotificationURL = model.NotificationUrl, ItemDesc = model.ItemDesc, FullNotifications = true, diff --git a/BTCPayServer/HostedServices/InvoiceNotificationManager.cs b/BTCPayServer/HostedServices/InvoiceNotificationManager.cs index 075a6532d..3c9452b91 100644 --- a/BTCPayServer/HostedServices/InvoiceNotificationManager.cs +++ b/BTCPayServer/HostedServices/InvoiceNotificationManager.cs @@ -128,6 +128,7 @@ namespace BTCPayServer.HostedServices emailBody); } + if (invoice.NotificationURL != null) { var invoiceStr = NBitcoin.JsonConverters.Serializer.ToString(new ScheduledJob() { TryCount = 0, Notification = notification }); diff --git a/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs b/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs index 7cf676689..83ce70ff5 100644 --- a/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs @@ -26,9 +26,6 @@ namespace BTCPayServer.Models.AppViewModels [Display(Name = "Callback Notification Url")] [Uri] public string NotificationUrl { get; set; } - [Display(Name = "Invoice IPN Notification")] - [EmailAddress] - public string NotificationEmail { get; set; } [Required] [Display(Name = "Allow crowdfund to be publicly visible (still visible to you)")] @@ -99,8 +96,6 @@ namespace BTCPayServer.Models.AppViewModels [Display(Name = "Colors to rotate between with animation when a payment is made. First color is the default background. One color per line. Can be any valid css color value.")] public string AnimationColors { get; set; } - public bool NotificationEmailWarning { get; set; } - // NOTE: Improve validation if needed public bool ModelWithMinimumData diff --git a/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs b/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs index 32d4e4b78..e71910d45 100644 --- a/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs @@ -32,9 +32,6 @@ namespace BTCPayServer.Models.AppViewModels [Display(Name = "Callback Notification Url")] [Uri] public string NotificationUrl { get; set; } - [Display(Name = "Invoice IPN Notification")] - [EmailAddress] - public string NotificationEmail { get; set; } [Required] [MaxLength(30)] @@ -84,7 +81,6 @@ namespace BTCPayServer.Models.AppViewModels } }, nameof(SelectListItem.Value), nameof(SelectListItem.Text), RedirectAutomatically); - public bool NotificationEmailWarning { get; set; } public string EmbeddedCSS { get; set; } public string Description { get; set; } } diff --git a/BTCPayServer/Models/InvoicingModels/CreateInvoiceModel.cs b/BTCPayServer/Models/InvoicingModels/CreateInvoiceModel.cs index 0b8e3c893..92507201c 100644 --- a/BTCPayServer/Models/InvoicingModels/CreateInvoiceModel.cs +++ b/BTCPayServer/Models/InvoicingModels/CreateInvoiceModel.cs @@ -60,13 +60,6 @@ namespace BTCPayServer.Models.InvoicingModels get; set; } - [EmailAddress] - [DisplayName("Notification Email")] - public string NotificationEmail - { - get; set; - } - [Uri] [DisplayName("Notification Url")] public string NotificationUrl diff --git a/BTCPayServer/Services/Apps/CrowdfundSettings.cs b/BTCPayServer/Services/Apps/CrowdfundSettings.cs index d6091a6b9..afb5783df 100644 --- a/BTCPayServer/Services/Apps/CrowdfundSettings.cs +++ b/BTCPayServer/Services/Apps/CrowdfundSettings.cs @@ -82,8 +82,6 @@ namespace BTCPayServer.Services.Apps "//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/unstoppable.wav", "//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/whickedsick.wav" }; - - public string NotificationEmail { get; set; } } public enum CrowdfundResetEvery { diff --git a/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml b/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml index 12a5091af..ef371ca8b 100644 --- a/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml +++ b/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml @@ -143,15 +143,6 @@ -
- - @if (Model.NotificationEmailWarning) - { - - } - - -
@@ -213,7 +204,6 @@
-
diff --git a/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml b/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml index 6d3a0c54b..a92662e85 100644 --- a/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml +++ b/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml @@ -119,15 +119,6 @@
-
- - @if (Model.NotificationEmailWarning) - { - - } - - -
* @@ -143,7 +134,6 @@
-
diff --git a/BTCPayServer/Views/Invoice/CreateInvoice.cshtml b/BTCPayServer/Views/Invoice/CreateInvoice.cshtml index 5ba652967..858a19b7a 100644 --- a/BTCPayServer/Views/Invoice/CreateInvoice.cshtml +++ b/BTCPayServer/Views/Invoice/CreateInvoice.cshtml @@ -52,11 +52,6 @@
-
- - - -
diff --git a/BTCPayServer/Views/Invoice/Invoice.cshtml b/BTCPayServer/Views/Invoice/Invoice.cshtml index f49544c58..d2e5d39c5 100644 --- a/BTCPayServer/Views/Invoice/Invoice.cshtml +++ b/BTCPayServer/Views/Invoice/Invoice.cshtml @@ -77,10 +77,6 @@ Total fiat due @Model.Fiat - - Notification Email - @Model.NotificationEmail - Notification Url @Model.NotificationUrl