2021-07-23 10:05:15 +02:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using BTCPayServer.Client.Models;
|
|
|
|
|
|
|
|
namespace BTCPayServer.Client
|
|
|
|
{
|
|
|
|
public partial class BTCPayServerClient
|
|
|
|
{
|
|
|
|
public virtual async Task<Dictionary<string, GenericPaymentMethodData>> GetStorePaymentMethods(string storeId,
|
2021-07-26 11:12:44 +02:00
|
|
|
bool? enabled = null,
|
2021-07-23 10:05:15 +02:00
|
|
|
CancellationToken token = default)
|
|
|
|
{
|
2021-07-26 11:12:44 +02:00
|
|
|
var query = new Dictionary<string, object>();
|
|
|
|
if (enabled != null)
|
|
|
|
{
|
|
|
|
query.Add(nameof(enabled), enabled);
|
|
|
|
}
|
|
|
|
|
2021-07-23 10:05:15 +02:00
|
|
|
var response =
|
|
|
|
await _httpClient.SendAsync(
|
|
|
|
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods",
|
2021-07-26 11:12:44 +02:00
|
|
|
query), token);
|
2021-07-23 10:05:15 +02:00
|
|
|
return await HandleResponse<Dictionary<string, GenericPaymentMethodData>>(response);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|