Square API Client for Elixir
iex> client = %SquareUp.Client{...}
iex> SquareUp.V2.Payments.list(client)
{:ok, %{}}
It is recommended to start a separate http connection pool for requests going to Square. Doing so requires changes in two locations:
# lib/application.ex
def start(_) do
children = [
...
:hackney_pool.child_spec(:my_pool, [max_connections: 10, timeout: 5000]),
...
]
end
# Creating your SquareUp.Client struct:
%SquareUp.Client{
...
hackney_opts: [pool: :my_pool],
...
}
If available in Hex, the package can be installed
by adding square_up
to your list of dependencies in mix.exs
:
def deps do
[
{:square_up, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/square_up.