mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 13:43:46 +01:00
26 lines
765 B
C#
26 lines
765 B
C#
#nullable enable
|
|
using NBitcoin;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
|
|
namespace BTCPayServer.Services;
|
|
|
|
public class DefaultTransactionLinkProvider : TransactionLinkProvider
|
|
{
|
|
public DefaultTransactionLinkProvider(string? blockExplorerLinkDefault)
|
|
{
|
|
BlockExplorerLinkDefault = blockExplorerLinkDefault;
|
|
}
|
|
|
|
public override string? OverrideBlockExplorerLink { get; set; }
|
|
public override string? BlockExplorerLinkDefault { get; }
|
|
|
|
public override string? GetTransactionLink(string paymentId)
|
|
{
|
|
if (string.IsNullOrEmpty(BlockExplorerLink))
|
|
return null;
|
|
paymentId = paymentId.Split('-').First();
|
|
return string.Format(CultureInfo.InvariantCulture, BlockExplorerLink, paymentId);
|
|
}
|
|
}
|