Configuration validation using NimbleOptions.
Validates the Airtel Money SDK configuration.
Summary
Functions
Returns the balance endpoint.
Returns the API base URL based on the environment.
Returns the collections endpoint.
Returns the disbursements endpoint.
Returns the current configuration from the application environment.
Returns the OAuth token endpoint.
Returns the transaction status endpoint.
Validates the configuration.
Functions
Returns the balance endpoint.
For DRC market (CD), uses /standard/v2/users/balance For other markets, uses /merchant/v1/balance
Returns the API base URL based on the environment.
For DRC market (CD), uses openapi.airtel.cd For other markets, uses openapi.airtel.africa
Returns the collections endpoint.
For DRC market (CD), uses /merchant/v2/payments/ For other markets, uses /merchant/v1/payments
Returns the disbursements endpoint.
For DRC market (CD), uses /standard/v2/disbursements/ For other markets, uses /openapi/moneytransfer/v2/credit
@spec get!() :: map()
Returns the current configuration from the application environment.
Raises if configuration is invalid.
Returns the OAuth token endpoint.
Returns the transaction status endpoint.
For DRC market (CD), uses /standard/v1/payments/{id} For other markets, uses /merchant/v1/payments/{id}
Validates the configuration.
Examples
iex> AirtelMoney.Config.validate(client_id: "test", client_secret: "secret", country: "CD", currency: "CDF")
{:ok, %{client_id: "test", client_secret: "secret", country: "CD", currency: "CDF", environment: :sandbox, timeout: 15000}}
iex> AirtelMoney.Config.validate([])
{:error, "required :client_id option not found, received options: []"}