Make CanUseWebhooks more resilient

This commit is contained in:
nicolas.dorier
2021-10-06 11:25:21 +09:00
parent 6e3d6125c2
commit 08bd13b2cd
3 changed files with 6 additions and 3 deletions

View File

@@ -42,6 +42,8 @@ namespace BTCPayServer.Client
public virtual async Task<WebhookDeliveryData> GetWebhookDelivery(string storeId, string webhookId, string deliveryId, CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest($"api/v1/stores/{storeId}/webhooks/{webhookId}/deliveries/{deliveryId}"), token);
if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
return null;
return await HandleResponse<WebhookDeliveryData>(response);
}
public virtual async Task<string> RedeliverWebhook(string storeId, string webhookId, string deliveryId, CancellationToken token = default)