mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
Add payment data to crypto info in invoice api model
Depends on https://github.com/MetacoSA/NBitpayClient/pull/22
This commit is contained in:
parent
f093f85dbf
commit
37869fd049
@ -356,7 +356,6 @@ namespace BTCPayServer.Services.Invoices
|
||||
return DateTimeOffset.UtcNow > ExpirationTime;
|
||||
}
|
||||
|
||||
|
||||
public InvoiceResponse EntityToDTO(BTCPayNetworkProvider networkProvider)
|
||||
{
|
||||
ServerUrl = ServerUrl ?? "";
|
||||
@ -417,6 +416,22 @@ namespace BTCPayServer.Services.Invoices
|
||||
var scheme = info.Network.UriScheme;
|
||||
cryptoInfo.Url = ServerUrl.WithTrailingSlash() + $"i/{paymentId}/{Id}";
|
||||
|
||||
cryptoInfo.Payments = GetPayments(info.Network).Select(entity =>
|
||||
{
|
||||
var data = entity.GetCryptoPaymentData();
|
||||
return new InvoicePaymentInfo()
|
||||
{
|
||||
Id = data.GetPaymentId(),
|
||||
Fee = entity.NetworkFee,
|
||||
Value = data.GetValue(),
|
||||
Completed = data.PaymentCompleted(entity, info.Network),
|
||||
Confirmed = data.PaymentConfirmed(entity, SpeedPolicy, info.Network),
|
||||
Destination = data.GetDestination(info.Network),
|
||||
PaymentType = data.GetPaymentType().ToString(),
|
||||
ReceivedDate = entity.ReceivedTime.DateTime
|
||||
};
|
||||
});
|
||||
|
||||
if (paymentId.PaymentType == PaymentTypes.BTCLike)
|
||||
{
|
||||
var minerInfo = new MinerFeeInfo();
|
||||
|
Loading…
Reference in New Issue
Block a user