GoCardlessClient.Resources.Webhooks (GoCardlessClient v2.0.0)

Copy Markdown View Source

GoCardless Webhooks API.

Provides access to the webhook delivery log — the record of every webhook GoCardless has attempted to deliver to your endpoint. Use this to inspect failed deliveries and retry them.

For webhook signature verification and event parsing, use the GoCardlessClient.Webhooks module instead.

Example — retry a failed delivery

{:ok, %{items: webhooks}} = GoCardlessClient.Resources.Webhooks.list(client, %{
  successful: false
})

Enum.each(webhooks, fn wh ->
  {:ok, _} = GoCardlessClient.Resources.Webhooks.retry(client, wh["id"])
end)

Summary

Functions

Eagerly collects all webhook delivery records into a list.

Retrieves a single webhook delivery record by ID.

Returns a page of webhook delivery records.

Retries delivery of a webhook to your endpoint.

Returns a lazy Stream over all pages of webhook delivery records.

Functions

collect_all(client, params \\ %{}, opts \\ [])

@spec collect_all(GoCardlessClient.Client.t(), map(), keyword()) ::
  {:ok, [map()]}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Eagerly collects all webhook delivery records into a list.

get(client, id, opts \\ [])

Retrieves a single webhook delivery record by ID.

list(client, params \\ %{}, opts \\ [])

@spec list(GoCardlessClient.Client.t(), map(), keyword()) ::
  {:ok, %{items: [map()], meta: map()}}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Returns a page of webhook delivery records.

Filter by :created_at[gte], :created_at[lte], :is_test.

retry(client, id, params \\ %{}, opts \\ [])

Retries delivery of a webhook to your endpoint.

stream(client, params \\ %{}, opts \\ [])

@spec stream(GoCardlessClient.Client.t(), map(), keyword()) :: Enumerable.t()

Returns a lazy Stream over all pages of webhook delivery records.