mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 22:46:49 +01:00
22 lines
788 B
C#
22 lines
788 B
C#
#nullable enable
|
|
using System;
|
|
using BTCPayServer.Services.Invoices;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace BTCPayServer.Payments.Lightning
|
|
{
|
|
public class LightningPaymentLinkExtension : IPaymentLinkExtension
|
|
{
|
|
public LightningPaymentLinkExtension(PaymentMethodId paymentMethodId, BTCPayNetwork network)
|
|
{
|
|
PaymentMethodId = paymentMethodId;
|
|
}
|
|
public PaymentMethodId PaymentMethodId { get; }
|
|
public string? GetPaymentLink(PaymentPrompt prompt, IUrlHelper? urlHelper)
|
|
{
|
|
var lnInvoiceTrimmedOfScheme = prompt.Destination.ToLowerInvariant()
|
|
.Replace("lightning:", "", StringComparison.InvariantCultureIgnoreCase);
|
|
return $"lightning:{lnInvoiceTrimmedOfScheme}";
|
|
}
|
|
}
|
|
}
|