At the moment, Monedero has a service that validates the messages that are well formed. The service also enriches the messages with the customer's geographic location.
Recall that the Monedero core business is the cryptocurrencies exchange. So now, the business asks us for a service that returns the requested currency price online at a specific time.
To achieve this, we will use the exchange rate of open exchange rates:
https://openexchangerates.org/
To obtain a free API key, you have to register in a free plan; the key is needed to access the free API.
Now, let's create a file called OpenExchangeService.java in the src/main/java/monedero/extractors directory with the content of Listing 3.4:
package monedero.extractors;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException...