# `MishkaPay.Ash.Inbox.Listener`
[🔗](https://github.com/mishka-group/mishka_pay/blob/v0.0.1/lib/mishka_pay/ash/__inbox/listener.ex#L6)

Makes a module the `mishka_pay:webhook:received` listener that stores each checked event in an
inbox resource (the `:inbox` kind of `MishkaPay.Ash.Resource`):

    defmodule MyApp.Pay.Inbox do
      use MishkaPay.Ash.Inbox.Listener, resource: MyApp.Pay.WebhookEvent
    end

`MishkaPay.Ash.Resource` makes one for each resource that listens (`listen? true`), as
`<Resource>.MishkaPayListener`; write one by hand with `listen? false`, such as to give it
another `:priority`. Supervise it like any plugin. It answers the webhook as soon as the
event is stored, so the provider gets its 200 at once; an event it cannot store is answered
as failed, so the provider sends it again. `:priority` places it among the other listeners
(50 by default).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
