Money v0.0.15 Money.ExchangeRates.OpenExchangeRates

Summary

Functions

Retrieves the latest exchange rates from Open Exchange Rates site

Functions

get_latest_rates(app_id \\ "f3bdf46d4a164a98be19a48d7c012a31")
get_latest_rates(String.t) :: {:ok, Map.t} | {:error, String.t}

Retrieves the latest exchange rates from Open Exchange Rates site.

  • app_id is a valid Open Exchange Rates app_id. Defaults to the configured app_id in config.exs

Returns:

  • {:ok, rates} if the rates can be retrieved

  • {:error, reason} if rates cannot be retrieved

Typically this function is called by the exchange rates retrieval service althouhg it can be called outside that context as required.