View Source AtEx.Gateway.Base (AtEx v0.20.23)

Base HTTP Gateway for AtEx.Gateway.Base

Summary

Functions

Macro to import necessary code into HTTP Gateways, This Macro accepts a list as configuration at the moment it's used configure the HTTP Base Url.

Functions

Link to this macro

__using__(opts)

View Source (macro)

Macro to import necessary code into HTTP Gateways, This Macro accepts a list as configuration at the moment it's used configure the HTTP Base Url.

Parameters

  • list: list of parameters for HTTP client configuration

Examples

defmodule AtEx.Gateway.Voice do
  use AtEx.Gateway.Base, url: "http://test.com"
  @username "some_username"

  def collect_minutes(attrs) do
    params =
    attrs
    |> Map.put(:username, @username)

    {:ok, resp} = get("/minutes", params)
    process_result(resp.body)
  end
end