diff --git a/BTCPayServer/Controllers/AppsController.PointOfSale.cs b/BTCPayServer/Controllers/AppsController.PointOfSale.cs index 0bd81b043..7d76c780c 100644 --- a/BTCPayServer/Controllers/AppsController.PointOfSale.cs +++ b/BTCPayServer/Controllers/AppsController.PointOfSale.cs @@ -82,6 +82,7 @@ namespace BTCPayServer.Controllers public string Description { get; set; } public string NotificationUrl { get; set; } + public string RedirectUrl { get; set; } public bool? RedirectAutomatically { get; set; } } @@ -115,6 +116,7 @@ namespace BTCPayServer.Controllers EmbeddedCSS = settings.EmbeddedCSS, Description = settings.Description, NotificationUrl = settings.NotificationUrl, + RedirectUrl = settings.RedirectUrl, SearchTerm = $"storeid:{app.StoreDataId}", RedirectAutomatically = settings.RedirectAutomatically.HasValue ? settings.RedirectAutomatically.Value ? "true" : "false" : "" }; @@ -191,6 +193,7 @@ namespace BTCPayServer.Controllers CustomTipPercentages = ListSplit(vm.CustomTipPercentages), CustomCSSLink = vm.CustomCSSLink, NotificationUrl = vm.NotificationUrl, + RedirectUrl = vm.RedirectUrl, 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 cfd8b2f47..1a19b7939 100644 --- a/BTCPayServer/Controllers/AppsPublicController.cs +++ b/BTCPayServer/Controllers/AppsPublicController.cs @@ -203,7 +203,9 @@ namespace BTCPayServer.Controllers OrderId = orderId, NotificationURL = string.IsNullOrEmpty(notificationUrl) ? settings.NotificationUrl : notificationUrl, - RedirectURL = redirectUrl ?? Request.GetDisplayUrl(), + RedirectURL = !string.IsNullOrEmpty(redirectUrl) ? redirectUrl + : !string.IsNullOrEmpty(settings.RedirectUrl) ? settings.RedirectUrl + : Request.GetDisplayUrl(), FullNotifications = true, ExtendedNotifications = true, PosData = string.IsNullOrEmpty(posData) ? null : posData, diff --git a/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs b/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs index 614bb8a3b..84aaa6b06 100644 --- a/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs @@ -33,6 +33,9 @@ namespace BTCPayServer.Models.AppViewModels [Display(Name = "Callback Notification Url")] [Uri] public string NotificationUrl { get; set; } + [Display(Name = "Redirect Url")] + [Uri] + public string RedirectUrl { get; set; } [Required] [MaxLength(30)] diff --git a/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml b/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml index 11cd876c9..6bfd8431e 100644 --- a/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml +++ b/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml @@ -94,6 +94,11 @@ +