Visma.Manager (Visma v0.1.0)
Visma API tokens lifetime is short. When using the API, after few minutes of usage, an expired token is returned. When dealing with document signature we cannot have this kind of error and we find a way to never lose our transaction. Visma.Manager was created to always maintain a correct state.
TODO: I don't know if each call to the API has a cost. If it's the case
we should think about it and create a cache somewhere to store elements like signing templates or template messages (required in other API calls).
TODO: token should be stored in an external store like ETS.
we could then update it without changing the state of the process
TODO: what could happen if we lose our document? It should probably
never happen, so, we should store them somewhere in safe place.
Link to this section Summary
Functions
Call interface to cancel a transaction.
Returns a specification to start this module under a supervisor.
Send a Visma data-structure to Visma.Manager process and wait for the response.
Call interface to get a signing status.
Call interface to get the complete list of all signing templates available.
Call interface to get the signing templates id.
Call interface to get the signing templates names (also defined as FriendlyName).
Call interface to get a token.
Initialize a new Visma.Manager process, using email
, password
and
base_url
value from :visma
application environment.
For test or development only. This process will be started without being registered.
Automatically start a new process registered as Visma.Manager. Only one can be present on the platform.
Link to this section Functions
cancel_transaction(id)
Call interface to cancel a transaction.
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
dispatch(api)
Send a Visma data-structure to Visma.Manager process and wait for the response.
get_signing_status(id)
Call interface to get a signing status.
get_signing_templates()
@spec get_signing_templates() :: {:ok, map()}
Call interface to get the complete list of all signing templates available.
get_signing_templates_by_id()
@spec get_signing_templates_by_id() :: any()
Call interface to get the signing templates id.
get_signing_templates_by_name()
@spec get_signing_templates_by_name() :: any()
Call interface to get the signing templates names (also defined as FriendlyName).
get_token()
@spec get_token() :: {:ok, String.t()}
Call interface to get a token.
init(_)
Initialize a new Visma.Manager process, using email
, password
and
base_url
value from :visma
application environment.
start(args \\ [], opts \\ [])
For test or development only. This process will be started without being registered.
start_link(args \\ [])
Automatically start a new process registered as Visma.Manager. Only one can be present on the platform.