The exchange rate service plugin interface

The Exchange Rate Service plugin interface (IFXRatePlugin) is the interface for obtaining the exchange rate. In the base configuration, the FXRateServicePlugin implements this interface. You can use the FXRateServicePlugin implementation as a starting point for your own implementation of the IFXRatePlugin interface.

The IFXRatePlugin interface has the following methods:

Method

Return value

Description

canConvert

Boolean

For two currencies, this method returns true if you can convert from the first currency to the second currency.

getFXRate

FXRate

This method returns the rate for converting from one currency to another. You can optionally specify:

  • A date on which the rate was in effect
  • The rate market from which to obtain the rate

The Built-in Implementation of the Exchange Rate Service Plugin Interface

The built-in implementation of the Exchange Rate Service Plugin (IFXRatePlugin) interface is the FXRateServicePlugin plugin. This simple implementation gets exchange rates from a static table defined in the plugin. This class is provided only as an example; it is not for production use. Although you can use this plugin as a starting point, you must create your own implementation of the IFXRatePlugin interface.