AfricasTalking (ExUssd v0.1.1) View Source

Link to this section Summary

Functions

End session by ID

Africa's talking

Link to this section Functions

End session by ID

Example

iex> AfricasTalking.end_session(session_id: "session_01")
{:error, :not_found}

Africa's talking

Configuration

Add below config to dev.exs / prod.exs files

config.exs

    config :ex_ussd :provider, AfricasTalking

Example

iex> AfricasTalking.goto(
...>  internal_routing: %{text: "", session_id: "session_01", service_code: "*544#"},
...>  menu: ExUssd.Menu.render(
...>    name: "Home",
...>    handler: fn menu, _api_parameters, _should_handle ->
...>      menu |> Map.put(:title, "Home Page: Welcome")
...>    end
...>  ),
...>  api_parameters: %{
...>      "sessionId" => "session_01",
...>      "phoneNumber" => "254722000000",
...>      "networkCode" => "Safaricom",
...>      "serviceCode" => "*544#",
...>      "text" => ""
...>    }
...>  )
{:ok, "CON Home Page: Welcome"}