mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Receipt: Add payment proof (#4782)
* Receipt: Add payment proof Closes #4685. * shice * Add truncate-center component * Improve view * Hide button and link when printed * Describe component * Remove transaction ID from UI * Remove modification to interface --------- Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@ using BTCPayServer.Models;
|
||||
using BTCPayServer.Models.InvoicingModels;
|
||||
using BTCPayServer.Models.PaymentRequestViewModels;
|
||||
using BTCPayServer.Payments;
|
||||
using BTCPayServer.Payments.Bitcoin;
|
||||
using BTCPayServer.Rating;
|
||||
using BTCPayServer.Services;
|
||||
using BTCPayServer.Services.Apps;
|
||||
@@ -235,7 +236,9 @@ namespace BTCPayServer.Controllers
|
||||
PaymentMethod = paymentMethodId.ToPrettyString(),
|
||||
Link = link,
|
||||
Id = txId,
|
||||
Destination = paymentData.GetDestination()
|
||||
Destination = paymentData.GetDestination(),
|
||||
PaymentProof = GetPaymentProof(paymentData),
|
||||
PaymentType = paymentData.GetPaymentType()
|
||||
};
|
||||
})
|
||||
.Where(payment => payment != null)
|
||||
@@ -247,6 +250,17 @@ namespace BTCPayServer.Controllers
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
private string? GetPaymentProof(CryptoPaymentData paymentData)
|
||||
{
|
||||
return paymentData switch
|
||||
{
|
||||
BitcoinLikePaymentData b => b.Outpoint.ToString(),
|
||||
LightningPaymentData l => l.Preimage,
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
private string? GetTransactionLink(PaymentMethodId paymentMethodId, string txId)
|
||||
{
|
||||
var network = _NetworkProvider.GetNetwork(paymentMethodId.CryptoCode);
|
||||
|
||||
Reference in New Issue
Block a user