From 4c3f5e1e1a41d0af1c1b05ce588b9c06bcc1abe7 Mon Sep 17 00:00:00 2001 From: Kukks Date: Fri, 10 Feb 2023 08:59:18 +0100 Subject: [PATCH] fix #4618 --- BTCPayServer/Plugins/NFC/NFCController.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/BTCPayServer/Plugins/NFC/NFCController.cs b/BTCPayServer/Plugins/NFC/NFCController.cs index 7bfd98f7a..57f51e062 100644 --- a/BTCPayServer/Plugins/NFC/NFCController.cs +++ b/BTCPayServer/Plugins/NFC/NFCController.cs @@ -3,6 +3,7 @@ using System.Net.Http; using System.Threading.Tasks; using BTCPayServer.Client.Models; using BTCPayServer.Data.Payouts.LightningLike; +using BTCPayServer.Lightning; using BTCPayServer.Payments; using BTCPayServer.Payments.Lightning; using BTCPayServer.Services; @@ -110,17 +111,17 @@ namespace BTCPayServer.Plugins.NFC } lnPMD = lnPaymentMethod.GetPaymentMethodDetails() as LightningLikePaymentMethodDetails; - Money due; + LightMoney due; if (invoice.Type == InvoiceType.TopUp && request.Amount is not null) { - due = new Money(request.Amount.Value, MoneyUnit.Satoshi); + due = new LightMoney(request.Amount.Value, LightMoneyUnit.Satoshi); }else if (invoice.Type == InvoiceType.TopUp) { return BadRequest("This is a topup invoice and you need to provide the amount in sats to pay."); } else { - due = lnPaymentMethod.Calculate().Due; + due = new LightMoney(lnPaymentMethod.Calculate().Due); } if (info.MinWithdrawable > due || due > info.MaxWithdrawable) {