using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using BTCPayServer.Client.Models; namespace BTCPayServer.Client { public partial class BTCPayServerClient { public virtual async Task> GetStoreLightningNetworkPaymentMethods(string storeId, bool enabledOnly = false, CancellationToken token = default) { var response = await _httpClient.SendAsync( CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LightningNetwork", new Dictionary() {{nameof(enabledOnly), enabledOnly}}), token); return await HandleResponse>(response); } public virtual async Task GetStoreLightningNetworkPaymentMethod( string storeId, string cryptoCode, CancellationToken token = default) { var response = await _httpClient.SendAsync( CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}"), token); return await HandleResponse(response); } public virtual async Task RemoveStoreLightningNetworkPaymentMethod(string storeId, string cryptoCode, CancellationToken token = default) { var response = await _httpClient.SendAsync( CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}", method: HttpMethod.Delete), token); await HandleResponse(response); } public virtual async Task UpdateStoreLightningNetworkPaymentMethod( string storeId, string cryptoCode, LightningNetworkPaymentMethodData paymentMethod, CancellationToken token = default) { var response = await _httpClient.SendAsync( CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}", bodyPayload: paymentMethod, method: HttpMethod.Put), token); return await HandleResponse(response); } public virtual Task UpdateStoreLightningNetworkPaymentMethodToInternalNode(string storeId, string cryptoCode, CancellationToken token = default) => UpdateStoreLightningNetworkPaymentMethod( storeId, cryptoCode, new LightningNetworkPaymentMethodData(cryptoCode, "Internal Node", true), token); } }