Plaid.Webhooks (elixir_plaid v0.1.1) View Source
Verify webhooks from plaid and construct the raw body into structs
Link to this section Summary
Functions
Verify that a webhook is actually from plaid, constructing the raw body into an event struct.
Link to this section Functions
Specs
verify_and_construct(String.t(), String.t(), Plaid.config()) :: {:ok, struct()} | {:error, any()}
Verify that a webhook is actually from plaid, constructing the raw body into an event struct.
Adheres to the guidelines outlined in this guide from plaid to verify webhooks.
Also constructs the raw_body
into an event struct.
Examples
verify_and_construct(
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
~s({"webhook_type": "ITEM", "webhook_code": "ERROR"}),
client_id: "abc",
secret: "123"
)
{:ok, %Plaid.Webhooks.ItemError{}}