Money.ExchangeRates.Callback behaviour (Money v5.5.3) View Source

Default exchange rates retrieval callback module.

When exchange rates are successfully retrieved, the function latest_rates_retrieved/2 or historic_rates_retrieved/2 is called to perform any desired serialization or proocessing.

Link to this section Summary

Functions

Callback function invoked when historic exchange rates are retrieved.

Callback function invoked when the latest exchange rates are retrieved.

Callbacks

Defines the behaviour to retrieve historic exchange rates from an external data source.

Defines the behaviour to retrieve the latest exchange rates from an external data source.

Link to this section Functions

Link to this function

historic_rates_retrieved(rates, date)

View Source

Specs

historic_rates_retrieved(%{}, Date.t()) :: :ok

Callback function invoked when historic exchange rates are retrieved.

Link to this function

latest_rates_retrieved(rates, retrieved_at)

View Source

Specs

latest_rates_retrieved(%{}, DateTime.t()) :: :ok

Callback function invoked when the latest exchange rates are retrieved.

Link to this section Callbacks

Link to this callback

historic_rates_retrieved(%{}, arg2)

View Source

Specs

historic_rates_retrieved(%{}, Date.t()) :: :ok

Defines the behaviour to retrieve historic exchange rates from an external data source.

Link to this callback

latest_rates_retrieved(%{}, arg2)

View Source

Specs

latest_rates_retrieved(%{}, DateTime.t()) :: :ok

Defines the behaviour to retrieve the latest exchange rates from an external data source.