diff --git a/BTCPayServer/Services/Invoices/Export/InvoiceExport.cs b/BTCPayServer/Services/Invoices/Export/InvoiceExport.cs index f5afc686f..10f46b99d 100644 --- a/BTCPayServer/Services/Invoices/Export/InvoiceExport.cs +++ b/BTCPayServer/Services/Invoices/Export/InvoiceExport.cs @@ -65,8 +65,8 @@ namespace BTCPayServer.Services.Invoices.Export var pdata = payment.GetCryptoPaymentData(); var pmethod = invoice.GetPaymentMethod(payment.GetPaymentMethodId(), Networks); - - var paidAfterNetworkFees = pdata.GetValue() - pmethod.TxFee.ToDecimal(NBitcoin.MoneyUnit.BTC); + var paymentFee = pmethod.GetPaymentMethodDetails().GetTxFee(); + var paidAfterNetworkFees = pdata.GetValue() - paymentFee; invoiceDue -= paidAfterNetworkFees * pmethod.Rate; var target = new ExportInvoiceHolder @@ -82,7 +82,7 @@ namespace BTCPayServer.Services.Invoices.Export // so if fee is 10000 satoshis, customer can essentially send infinite number of tx // and merchant effectivelly would receive 0 BTC, invoice won't be paid // while looking just at export you could sum Paid and assume merchant "received payments" - NetworkFee = pmethod.TxFee.ToDecimal(NBitcoin.MoneyUnit.BTC).ToString(CultureInfo.InvariantCulture), + NetworkFee = paymentFee.ToString(CultureInfo.InvariantCulture), InvoiceDue = invoiceDue, OrderId = invoice.OrderId, StoreId = invoice.StoreId,