mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-27 07:57:33 +01:00
29 lines
944 B
C#
29 lines
944 B
C#
#if ALTCOINS
|
|
#nullable enable
|
|
using System.Globalization;
|
|
using BTCPayServer.Payments;
|
|
using BTCPayServer.Plugins.Altcoins;
|
|
using BTCPayServer.Services.Invoices;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace BTCPayServer.Services.Altcoins.Zcash.Payments
|
|
{
|
|
public class ZcashPaymentLinkExtension : IPaymentLinkExtension
|
|
{
|
|
private readonly ZcashLikeSpecificBtcPayNetwork _network;
|
|
|
|
public ZcashPaymentLinkExtension(PaymentMethodId paymentMethodId, ZcashLikeSpecificBtcPayNetwork network)
|
|
{
|
|
PaymentMethodId = paymentMethodId;
|
|
_network = network;
|
|
}
|
|
public PaymentMethodId PaymentMethodId { get; }
|
|
|
|
public string? GetPaymentLink(PaymentPrompt prompt, IUrlHelper? urlHelper)
|
|
{
|
|
var due = prompt.Calculate().Due;
|
|
return $"{_network.UriScheme}:{prompt.Destination}?amount={due.ToString(CultureInfo.InvariantCulture)}";
|
|
}
|
|
}
|
|
}
|
|
#endif
|