phone_verification v0.4.0 PhoneVerification.Provider behaviour

Link to this section Summary

Link to this section Callbacks

Link to this callback

check(%{})
check(%{
  phone_number: PhoneVerification.PhoneNumber.t(),
  verification_code: PhoneVerification.verification_code()
}) ::
  {:ok, %{message: String.t()}}
  | {:error, %{message: String.t(), code: String.t()}}

Link to this callback

start(%{})
start(%{
  :phone_number => PhoneVerification.PhoneNumber.t(),
  :via => :sms | :call,
  optional(:locale) => String.t(),
  optional(:code_length) => non_neg_integer(),
  optional(:custom_code) => PhoneVerification.verification_code()
}) ::
  {:ok, %{message: String.t(), seconds_to_expire: non_neg_integer()}}
  | {:error, %{message: String.t(), code: non_neg_integer()}}