btcpayserver/BTCPayServer/Payments/Lightning/LightningLikePaymentMethodDetails.cs
Andrew Camilleri 039f88d14c
Match Lightning payment based on payment hash if BOLT11 is not the same. (#2773)
* Match Lightning payment based on payment hash if BOLT11 is not the same.

* Fixup

* Fixup

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2021-10-07 16:53:27 +09:00

39 lines
951 B
C#

using BTCPayServer.Lightning;
using NBitcoin;
namespace BTCPayServer.Payments.Lightning
{
public class LightningLikePaymentMethodDetails : IPaymentMethodDetails
{
public string BOLT11 { get; set; }
public uint256 PaymentHash { get; set; }
public string InvoiceId { get; set; }
public string NodeInfo { get; set; }
public string GetPaymentDestination()
{
return BOLT11;
}
public uint256 GetPaymentHash(Network network)
{
return PaymentHash ?? BOLT11PaymentRequest.Parse(BOLT11, network).PaymentHash;
}
public PaymentType GetPaymentType()
{
return PaymentTypes.LightningLike;
}
public decimal GetNextNetworkFee()
{
return 0.0m;
}
public decimal GetFeeRate()
{
return 0.0m;
}
public bool Activated { get; set; }
}
}