ex_bank_id v0.1.0 ExBankID

Simple abstraction over the swedish BankID API.

Link to this section Summary

Link to this section Functions

Link to this function

auth(ip_address, opts \\ [])

Specs

auth(String.t(), url: String.t(), cert_file: String.t()) ::
  {:error, %ExBankID.Error.Api{details: term(), errorCode: term()} | binary()}
  | {:ok,
     %ExBankID.Auth.Response{
       autoStartToken: term(),
       orderRef: term(),
       qrStartSecret: term(),
       qrStartToken: term()
     }}

See ExBankID.Auth.auth/2.

Link to this function

cancel(order_ref, opts \\ [])

Specs

cancel(
  String.t()
  | %ExBankID.Sign.Response{
      autoStartToken: term(),
      orderRef: term(),
      qrStartSecret: term(),
      qrStartToken: term()
    }
  | %ExBankID.Auth.Response{
      autoStartToken: term(),
      orderRef: term(),
      qrStartSecret: term(),
      qrStartToken: term()
    },
  url: String.t(),
  cert_file: String.t()
) ::
  {:error, %ExBankID.Error.Api{details: term(), errorCode: term()} | binary()}
  | {:ok, %{}}

See ExBankID.Cancel.cancel/2.

Link to this function

collect(order_ref, opts \\ [])

Specs

collect(
  String.t()
  | %ExBankID.Sign.Response{
      autoStartToken: term(),
      orderRef: term(),
      qrStartSecret: term(),
      qrStartToken: term()
    }
  | %ExBankID.Auth.Response{
      autoStartToken: term(),
      orderRef: term(),
      qrStartSecret: term(),
      qrStartToken: term()
    },
  url: String.t(),
  cert_file: String.t()
) ::
  {:error, %ExBankID.Error.Api{details: term(), errorCode: term()} | binary()}
  | {:ok,
     %ExBankID.Collect.Response{
       completionData: term(),
       hintCode: term(),
       orderRef: term(),
       status: term()
     }}

See ExBankID.Collect.collect/2.

Link to this function

sign(ip_address, user_visible_data, opts \\ [])

Specs

sign(String.t(), String.t(),
  url: String.t(),
  cert_file: String.t(),
  personal_number: String.t(),
  user_non_visible_data: String.t()
) ::
  {:error, %ExBankID.Error.Api{details: term(), errorCode: term()} | binary()}
  | {:ok,
     %ExBankID.Sign.Response{
       autoStartToken: term(),
       orderRef: term(),
       qrStartSecret: term(),
       qrStartToken: term()
     }}

See ExBankID.Sign.sign/3.