PandaDoc.PhoenixController behaviour (pandadoc.com API v0.1.2) View Source

Implements a PhoenixController that can be easily wired up and used.

Examples

defmodule YourAppWeb.PandaDocController do
  use PandaDoc.PhoenixController

  def handle_document_change(id, status, _details) do
    id
    |> Documents.get_by_pandadoc_id!()
    |> Documents.update_document(%{status: status})
  end

  def handle_document_complete(id, pdf, status, _details) do
    id
    |> Documents.get_by_pandadoc_id!()
    |> Documents.update_document(%{data: pdf, status: status})
  end
end

Put the following lines into your router.ex and configure the WebHook in the pandadoc portal.

  post "/callbacks/pandadoc", YourAppWeb.PandaDocController, :webhook

Link to this section Summary

Callbacks

Triggers when a PandaDoc document changed.

Triggers when a PandaDoc document has been completed/signed.

Link to this section Callbacks

Link to this callback

handle_document_change(arg1, arg2, map)

View Source

Specs

handle_document_change(String.t(), String.t(), map()) :: any()

Triggers when a PandaDoc document changed.

Link to this callback

handle_document_complete(arg1, binary, arg3, map)

View Source

Specs

handle_document_complete(String.t(), binary(), String.t(), map()) :: any()

Triggers when a PandaDoc document has been completed/signed.