2022-02-07 09:39:48 +01:00
|
|
|
using System.Collections.Generic;
|
2021-10-07 09:53:27 +02:00
|
|
|
using BTCPayServer.Lightning;
|
|
|
|
using NBitcoin;
|
2022-02-15 11:36:04 +01:00
|
|
|
using Newtonsoft.Json.Linq;
|
2021-10-07 09:53:27 +02:00
|
|
|
|
2018-02-26 00:48:12 +09:00
|
|
|
namespace BTCPayServer.Payments.Lightning
|
|
|
|
{
|
|
|
|
public class LightningLikePaymentMethodDetails : IPaymentMethodDetails
|
|
|
|
{
|
|
|
|
public string BOLT11 { get; set; }
|
2021-10-07 09:53:27 +02:00
|
|
|
public uint256 PaymentHash { get; set; }
|
2018-02-26 00:48:12 +09:00
|
|
|
public string InvoiceId { get; set; }
|
2018-03-28 22:37:01 +09:00
|
|
|
public string NodeInfo { get; set; }
|
2018-02-26 00:48:12 +09:00
|
|
|
|
2021-10-25 08:18:02 +02:00
|
|
|
public virtual string GetPaymentDestination()
|
2018-02-26 00:48:12 +09:00
|
|
|
{
|
|
|
|
return BOLT11;
|
|
|
|
}
|
|
|
|
|
2021-10-07 09:53:27 +02:00
|
|
|
public uint256 GetPaymentHash(Network network)
|
|
|
|
{
|
|
|
|
return PaymentHash ?? BOLT11PaymentRequest.Parse(BOLT11, network).PaymentHash;
|
|
|
|
}
|
|
|
|
|
2021-10-25 08:18:02 +02:00
|
|
|
public virtual PaymentType GetPaymentType()
|
2018-02-26 00:48:12 +09:00
|
|
|
{
|
|
|
|
return PaymentTypes.LightningLike;
|
|
|
|
}
|
|
|
|
|
2019-01-07 15:35:18 +09:00
|
|
|
public decimal GetNextNetworkFee()
|
2018-02-26 00:48:12 +09:00
|
|
|
{
|
|
|
|
return 0.0m;
|
|
|
|
}
|
2019-10-07 21:06:12 -07:00
|
|
|
|
2020-06-28 17:55:27 +09:00
|
|
|
public decimal GetFeeRate()
|
|
|
|
{
|
2019-10-07 21:06:12 -07:00
|
|
|
return 0.0m;
|
|
|
|
}
|
2021-04-07 06:08:42 +02:00
|
|
|
public bool Activated { get; set; }
|
2021-10-25 08:18:02 +02:00
|
|
|
|
|
|
|
public virtual string GetAdditionalDataPartialName()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2022-02-07 09:39:48 +01:00
|
|
|
|
2022-02-15 11:36:04 +01:00
|
|
|
public virtual Dictionary<string, JObject> GetAdditionalData()
|
2022-02-07 09:39:48 +01:00
|
|
|
{
|
|
|
|
return new();
|
|
|
|
}
|
2018-02-26 00:48:12 +09:00
|
|
|
}
|
|
|
|
}
|