From c6ce676ad30f7dc43299ac8d18357516cd6a7a02 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Mon, 11 Mar 2019 16:06:27 +0900 Subject: [PATCH] Fix exception on Payment Request (#672) --- BTCPayServer/BTCPayServer.csproj | 2 +- BTCPayServer/Controllers/PaymentRequestController.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 0dba4820f..fd95777be 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -2,7 +2,7 @@ Exe netcoreapp2.1 - 1.0.3.82 + 1.0.3.83 NU1701,CA1816,CA1308,CA1810,CA2208 diff --git a/BTCPayServer/Controllers/PaymentRequestController.cs b/BTCPayServer/Controllers/PaymentRequestController.cs index d47765123..a17f1421b 100644 --- a/BTCPayServer/Controllers/PaymentRequestController.cs +++ b/BTCPayServer/Controllers/PaymentRequestController.cs @@ -229,12 +229,12 @@ namespace BTCPayServer.Controllers public async Task PayPaymentRequest(string id, bool redirectToInvoice = true, decimal? amount = null, CancellationToken cancellationToken = default) { - var result = ((await ViewPaymentRequest(id)) as ViewResult)?.Model as ViewPaymentRequestViewModel; + var result = await _PaymentRequestService.GetPaymentRequest(id, GetUserId()); if (result == null) { return NotFound(); } - + result.HubPath = PaymentRequestHub.GetHubPath(this.Request); if (result.AmountDue <= 0) { if (redirectToInvoice)