mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-11 01:54:21 +01:00
Allowing PaymentHash in lightning payment method to be read from LightningInvoice
This commit is contained in:
@@ -128,9 +128,13 @@ namespace BTCPayServer.Payments.Lightning
|
||||
}
|
||||
|
||||
paymentPrompt.Destination = lightningInvoice.BOLT11;
|
||||
var paymentHash = lightningInvoice.PaymentHash != null ?
|
||||
uint256.Parse(lightningInvoice.PaymentHash) :
|
||||
BOLT11PaymentRequest.Parse(lightningInvoice.BOLT11, _Network.NBitcoinNetwork).PaymentHash;
|
||||
|
||||
var details = new LigthningPaymentPromptDetails
|
||||
{
|
||||
PaymentHash = BOLT11PaymentRequest.Parse(lightningInvoice.BOLT11, _Network.NBitcoinNetwork).PaymentHash,
|
||||
PaymentHash = paymentHash,
|
||||
Preimage = string.IsNullOrEmpty(lightningInvoice.Preimage) ? null : uint256.Parse(lightningInvoice.Preimage),
|
||||
InvoiceId = lightningInvoice.Id,
|
||||
NodeInfo = (await nodeInfo).FirstOrDefault()?.ToString()
|
||||
|
||||
Reference in New Issue
Block a user