Weavr.Identities (Weavr v1.0.0)

Copy Markdown View Source

Convenience delegation module for working with both Corporate and Consumer identities without specifying the type at the call site.

For the full, type-specific API with all operations (KYB/KYC, email verification, fee charging, etc.), use Weavr.Corporates and Weavr.Consumers directly.

Summary

Functions

Creates a Consumer identity. Delegates to Weavr.Consumers.create/3.

Creates a Corporate identity. Delegates to Weavr.Corporates.create/3.

Gets the logged-in Consumer. Delegates to Weavr.Consumers.get/2.

Gets the logged-in Corporate. Delegates to Weavr.Corporates.get/2.

Updates the logged-in Consumer. Delegates to Weavr.Consumers.update/3.

Updates the logged-in Corporate. Delegates to Weavr.Corporates.update/3.

Functions

create_consumer(config, attrs, opts \\ [])

@spec create_consumer(Weavr.Config.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Weavr.Error.t()}

Creates a Consumer identity. Delegates to Weavr.Consumers.create/3.

create_corporate(config, attrs, opts \\ [])

@spec create_corporate(Weavr.Config.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Weavr.Error.t()}

Creates a Corporate identity. Delegates to Weavr.Corporates.create/3.

get_consumer(config, auth_token)

@spec get_consumer(Weavr.Config.t(), String.t()) ::
  {:ok, map()} | {:error, Weavr.Error.t()}

Gets the logged-in Consumer. Delegates to Weavr.Consumers.get/2.

get_corporate(config, auth_token)

@spec get_corporate(Weavr.Config.t(), String.t()) ::
  {:ok, map()} | {:error, Weavr.Error.t()}

Gets the logged-in Corporate. Delegates to Weavr.Corporates.get/2.

update_consumer(config, auth_token, attrs)

@spec update_consumer(Weavr.Config.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Weavr.Error.t()}

Updates the logged-in Consumer. Delegates to Weavr.Consumers.update/3.

update_corporate(config, auth_token, attrs)

@spec update_corporate(Weavr.Config.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Weavr.Error.t()}

Updates the logged-in Corporate. Delegates to Weavr.Corporates.update/3.