LexOffice.PhoenixController behaviour (lexoffice.de API v0.1.9) View Source
Implements a PhoenixController that can be easily wired up and used.
Examples
defmodule YourAppWeb.LexOfficeController do
use LexOffice.PhoenixController
def handle_event(org_id, "payment.changed", resource_id, date) do
id
|> Documents.get_by_pandadoc_id!()
|> Documents.update_document(%{status: status})
end
def handle_event(org_id, type, resource_id, date) do
IO.puts "i do not handle LexOffice requests of type #{type} yet."
end
end
Put the following lines into your router.ex
and configure the WebHook in the lexoffice portal.
post "/callbacks/lexoffice", YourAppWeb.LexOfficeController, :webhook
Link to this section Summary
Callbacks
Triggers when a LexOffice webhook arrives.
Link to this section Callbacks
Specs
Triggers when a LexOffice webhook arrives.