View Source Eversign.PhoenixController behaviour (eversign.com API for digitally signing PDF documents v0.1.0)

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

examples

Examples

defmodule YourAppWeb.EversignController do
  use Eversign.PhoenixController

  def handle_document_change(document_hash, action, _time, _details) do
    Documents.get_by!(eversign_document_hash: document_hash)
    |> Documents.update_document(%{status: action})
  end

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

Put the following lines into your router.ex and configure the WebHook in the eversign Application Settings.

  post "/callbacks/eversign", YourAppWeb.EversignController, :webhook

Link to this section Summary

Callbacks

Triggers when a Eversign document changed.

Triggers when a Eversign document has been completed/signed by all signers.

Link to this section Callbacks

Link to this callback

handle_document_change(t, t, t, map)

View Source
@callback handle_document_change(String.t(), String.t(), String.t(), map()) :: any()

Triggers when a Eversign document changed.

Link to this callback

handle_document_complete(t, binary, map)

View Source
@callback handle_document_complete(String.t(), binary(), map()) :: any()

Triggers when a Eversign document has been completed/signed by all signers.