Refactor Get Store Payment Methods

Add tests + docs + new pluggbale format for fetching payment method data + client
This commit is contained in:
Kukks
2021-07-23 10:05:15 +02:00
committed by Andrew Camilleri
parent 17e6179fec
commit 4d538c61b1
20 changed files with 316 additions and 55 deletions

View File

@@ -9,11 +9,13 @@ namespace BTCPayServer.Client
public partial class BTCPayServerClient
{
public virtual async Task<IEnumerable<OnChainPaymentMethodData>> GetStoreOnChainPaymentMethods(string storeId,
bool enabledOnly = false,
CancellationToken token = default)
{
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/Onchain"), token);
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods/Onchain",
new Dictionary<string, object>() {{nameof(enabledOnly), enabledOnly}}), token);
return await HandleResponse<IEnumerable<OnChainPaymentMethodData>>(response);
}