HitPay.API (hit_pay v0.1.1)

Utilities for interacting with the HitPay API. API Doc: https://hit-pay.com/docs.html

Link to this section Summary

Functions

In config.exs, use a string, a function or a tuple

If there's no environment config, detect based on environment. sandbox is used for non-production environment. In config.exs, use a string, a function or a tuple. Possible environments are "sandbox", "staging", "production"

In config.exs your implicit or expicit configuration is

In config.exs, use a string, a function or a tuple

Link to this section Types

Specs

body() :: iodata() | {:multipart, list()}

Specs

headers() :: %{required(String.t()) => String.t()} | %{}

Specs

method() :: :get | :post | :put | :delete | :patch

Link to this section Functions

In config.exs, use a string, a function or a tuple:

config :hit_pay, api_key: System.get_env("HIT_PAY_API_KEY")

or:

config :hit_pay, api_key: {:system, "HIT_PAY_API_KEY"}

or:

config :hit_pay, api_key: {MyApp.Config, :hit_pay_api_key, []}

If there's no environment config, detect based on environment. sandbox is used for non-production environment. In config.exs, use a string, a function or a tuple. Possible environments are "sandbox", "staging", "production"

config :hit_pay, environment: "sandbox"

or:

config :hit_pay, environment: System.get_env("HIT_PAY_ENVIRONMENT")

or:

config :hit_pay, environment: {:system, "HIT_PAY_ENVIRONMENT"}

or:

config :hit_pay, environment: {MyApp.Config, :HIT_PAY_ENVIRONMENT, []}

Specs

json_library() :: module()

In config.exs your implicit or expicit configuration is:

config ex_:crowdin, json_library: Poison # defaults to Jason but can be configured to Poison
Link to this function

request(path, method, body \\ %{}, headers \\ %{}, opts \\ [])

Specs

request(String.t(), method(), body(), headers(), list()) ::
  {:ok, map()} | {:error, Error.t()}

In config.exs, use a string, a function or a tuple:

config :hit_pay, salt: System.get_env("HIT_PAY_SALT")

or:

config :hit_pay, salt: {:system, "HIT_PAY_SALT"}

or:

config :hit_pay, salt: {MyApp.Config, :HIT_PAY_SALT, []}