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

Link to this callback

handle_event(arg1, arg2, arg3, map, arg5)

View Source

Specs

handle_event(String.t(), String.t(), String.t(), map(), DateTime.t()) :: any()

Triggers when a LexOffice webhook arrives.