diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index aa266603e..d29269307 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -174,7 +174,8 @@ namespace BTCPayServer.Controllers [AcceptMediaTypeConstraint("application/bitcoin-paymentrequest", false)] [XFrameOptionsAttribute(null)] [ReferrerPolicyAttribute("origin")] - public async Task Checkout(string invoiceId, string id = null, string paymentMethodId = null) + public async Task Checkout(string invoiceId, string id = null, string paymentMethodId = null, + [FromQuery]string view = null) { //Keep compatibility with Bitpay invoiceId = invoiceId ?? id; @@ -185,6 +186,8 @@ namespace BTCPayServer.Controllers if (model == null) return NotFound(); + if (view == "modal") + model.IsModal = true; _CSP.Add(new ConsentSecurityPolicy("script-src", "'unsafe-eval'")); // Needed by Vue if (!string.IsNullOrEmpty(model.CustomCSSLink) && diff --git a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs index 8f1dffeaa..34fa52f3e 100644 --- a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs +++ b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs @@ -21,6 +21,7 @@ namespace BTCPayServer.Models.InvoicingModels public string CustomLogoLink { get; set; } public string DefaultLang { get; set; } public List AvailableCryptos { get; set; } = new List(); + public bool IsModal { get; set; } public bool IsLightning { get; set; } public string CryptoCode { get; set; } public string ServerUrl { get; set; } diff --git a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml index 7f7502ffb..40bf5ab4b 100644 --- a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml @@ -12,6 +12,9 @@ } +
+ ✖ +
@@ -326,9 +329,12 @@
{{$t("This invoice has been paid")}}
- + {{$t("Return to StoreName", srvModel)}} +
@@ -351,7 +357,7 @@
-
+
{{$t("What happened?")}}
{{$t("InvoiceExpired_Body_1", {storeName: srvModel.storeName, maxTimeMinutes: @Model.MaxTimeMinutes})}} @@ -370,10 +376,12 @@ {{srvModel.orderId}}
- + {{$t("Return to StoreName", srvModel)}} +
diff --git a/BTCPayServer/Views/Invoice/Checkout.cshtml b/BTCPayServer/Views/Invoice/Checkout.cshtml index bc6a73fa0..b5425e871 100644 --- a/BTCPayServer/Views/Invoice/Checkout.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout.cshtml @@ -27,10 +27,20 @@ } - + @if (Model.IsModal) + { + + } - +