mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Lightning Network support implementation
This commit is contained in:
@@ -17,13 +17,27 @@ namespace BTCPayServer.Payments
|
||||
return BTCPayServer.DerivationStrategy.Parse(((JValue)value).Value<string>(), network);
|
||||
}
|
||||
//////////
|
||||
else // if(paymentMethodId.PaymentType == PaymentTypes.Lightning)
|
||||
else if (paymentMethodId.PaymentType == PaymentTypes.LightningLike)
|
||||
{
|
||||
// return JsonConvert.Deserialize<T>();
|
||||
return JsonConvert.DeserializeObject<Payments.Lightning.LightningSupportedPaymentMethod>(value.ToString());
|
||||
}
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public static IPaymentMethodDetails DeserializePaymentMethodDetails(PaymentMethodId paymentMethodId, JObject jobj)
|
||||
{
|
||||
if(paymentMethodId.PaymentType == PaymentTypes.BTCLike)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<Payments.Bitcoin.BitcoinLikeOnChainPaymentMethod>(jobj.ToString());
|
||||
}
|
||||
if (paymentMethodId.PaymentType == PaymentTypes.LightningLike)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<Payments.Lightning.LightningLikePaymentMethodDetails>(jobj.ToString());
|
||||
}
|
||||
throw new NotSupportedException(paymentMethodId.PaymentType.ToString());
|
||||
}
|
||||
|
||||
|
||||
public static JToken Serialize(ISupportedPaymentMethod factory)
|
||||
{
|
||||
// Legacy
|
||||
@@ -39,5 +53,6 @@ namespace BTCPayServer.Payments
|
||||
}
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user