mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 02:28:31 +01:00
49ae62b02e
* Use library for Payjoin Sender * update payjoin sender to use new package and reduce code * fix using statements
24 lines
786 B
C#
24 lines
786 B
C#
using System;
|
|
using System.Net.Http;
|
|
using BTCPayServer.BIP78.Sender;
|
|
|
|
namespace BTCPayServer.Payments.PayJoin.Sender
|
|
{
|
|
public class PayjoinServerCommunicator : HttpClientPayjoinServerCommunicator
|
|
{
|
|
private readonly IHttpClientFactory _httpClientFactory;
|
|
public const string PayjoinOnionNamedClient = "payjoin.onion";
|
|
public const string PayjoinClearnetNamedClient = "payjoin.clearnet";
|
|
|
|
public PayjoinServerCommunicator(IHttpClientFactory httpClientFactory)
|
|
{
|
|
_httpClientFactory = httpClientFactory;
|
|
}
|
|
|
|
protected override HttpClient CreateHttpClient(Uri uri)
|
|
{
|
|
return _httpClientFactory.CreateClient(uri.IsOnion() ? PayjoinOnionNamedClient : PayjoinClearnetNamedClient);
|
|
}
|
|
}
|
|
}
|