diff --git a/BTCPayServer/Controllers/AppsController.PointOfSale.cs b/BTCPayServer/Controllers/AppsController.PointOfSale.cs index ae2eeefeb..d348bddd8 100644 --- a/BTCPayServer/Controllers/AppsController.PointOfSale.cs +++ b/BTCPayServer/Controllers/AppsController.PointOfSale.cs @@ -55,12 +55,16 @@ namespace BTCPayServer.Controllers " custom: true"; EnableShoppingCart = false; ShowCustomAmount = true; + ShowDiscount = true; + EnableTips = true; } public string Title { get; set; } public string Currency { get; set; } public string Template { get; set; } public bool EnableShoppingCart { get; set; } public bool ShowCustomAmount { get; set; } + public bool ShowDiscount { get; set; } + public bool EnableTips { get; set; } public const string BUTTON_TEXT_DEF = "Buy for {0}"; public string ButtonText { get; set; } = BUTTON_TEXT_DEF; @@ -89,6 +93,8 @@ namespace BTCPayServer.Controllers Title = settings.Title, EnableShoppingCart = settings.EnableShoppingCart, ShowCustomAmount = settings.ShowCustomAmount, + ShowDiscount = settings.ShowDiscount, + EnableTips = settings.EnableTips, Currency = settings.Currency, Template = settings.Template, ButtonText = settings.ButtonText ?? PointOfSaleSettings.BUTTON_TEXT_DEF, @@ -160,6 +166,8 @@ namespace BTCPayServer.Controllers Title = vm.Title, EnableShoppingCart = vm.EnableShoppingCart, ShowCustomAmount = vm.ShowCustomAmount, + ShowDiscount = vm.ShowDiscount, + EnableTips = vm.EnableTips, Currency = vm.Currency.ToUpperInvariant(), Template = vm.Template, ButtonText = vm.ButtonText, diff --git a/BTCPayServer/Controllers/AppsPublicController.cs b/BTCPayServer/Controllers/AppsPublicController.cs index 9cf5f3bba..2f7049d5f 100644 --- a/BTCPayServer/Controllers/AppsPublicController.cs +++ b/BTCPayServer/Controllers/AppsPublicController.cs @@ -62,6 +62,8 @@ namespace BTCPayServer.Controllers Step = step.ToString(CultureInfo.InvariantCulture), EnableShoppingCart = settings.EnableShoppingCart, ShowCustomAmount = settings.ShowCustomAmount, + ShowDiscount = settings.ShowDiscount, + EnableTips = settings.EnableTips, CurrencyCode = settings.Currency, CurrencySymbol = numberFormatInfo.CurrencySymbol, CurrencyInfo = new ViewPointOfSaleViewModel.CurrencyInfoData() diff --git a/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs b/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs index 8f1c9a937..70366c251 100644 --- a/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs @@ -17,6 +17,10 @@ namespace BTCPayServer.Models.AppViewModels public bool EnableShoppingCart { get; set; } [Display(Name = "User can input custom amount")] public bool ShowCustomAmount { get; set; } + [Display(Name = "User can input discount in %")] + public bool ShowDiscount { get; set; } + [Display(Name = "Enable tips")] + public bool EnableTips { get; set; } public string Example1 { get; internal set; } public string Example2 { get; internal set; } public string ExampleCallback { get; internal set; } diff --git a/BTCPayServer/Models/AppViewModels/ViewPointOfSaleViewModel.cs b/BTCPayServer/Models/AppViewModels/ViewPointOfSaleViewModel.cs index 802d74a9c..9d87769e2 100644 --- a/BTCPayServer/Models/AppViewModels/ViewPointOfSaleViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/ViewPointOfSaleViewModel.cs @@ -36,6 +36,8 @@ namespace BTCPayServer.Models.AppViewModels public bool EnableShoppingCart { get; set; } public bool ShowCustomAmount { get; set; } + public bool ShowDiscount { get; set; } + public bool EnableTips { get; set; } public string Step { get; set; } public string Title { get; set; } public Item[] Items { get; set; } diff --git a/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml b/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml index f7897f382..4ef85cad5 100644 --- a/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml +++ b/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml @@ -57,6 +57,14 @@ +