Allowing PaymentHash in lightning payment method to be read from LightningInvoice

This commit is contained in:
rockstardev
2025-04-27 22:36:37 -05:00
parent dae4cc67b2
commit 052ab71100

View File

@@ -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()