Skip to content

Commit

Permalink
feat(Webhook): add optional headers parameter to CreateWebhook method (
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasMontone authored Dec 17, 2024
1 parent 80c953c commit a452f86
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Pluggy.SDK/PluggyAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,16 @@ public async Task<Webhook> FetchWebhook(Guid id)
/// </summary>
/// <param name="url">Webhook url</param>
/// <param name="event">Webhook event</param>
/// <param name="headers">Optional headers for webhook notifications</param>
/// <returns></returns>
public async Task<Webhook> CreateWebhook(string url, WebhookEvent _event)
public async Task<Webhook> CreateWebhook(string url, WebhookEvent _event, Dictionary<string, string> headers = null)
{
var body = new Dictionary<string, string>
var body = new Dictionary<string, object>
{
{ "url", url },
{ "event", _event.Value }
};
{ "event", _event.Value },
{ "headers", headers }
}.RemoveNulls();
return await httpService.PostAsync<Webhook>(URL_WEBHOOKS, body);
}

Expand Down

0 comments on commit a452f86

Please sign in to comment.