Install the custom exchange rate provider
Before installing your provider, build your project and make sure there are no errors. It is important to build first, because your new provider class must be successfully compiled into the project. If your provider is in a separate assembly, first add a reference to that assembly in your Sitefinity CMS application project.
To install the provider you must perform the following:
- Log into Sitefinity CMS backend.
- In the main menu in the upper part of the screen, click Administration » Settings.
- Go to the Advanced settings by clicking the Advanced link.
- In the treeview on the left, click Ecommerce » MultiCurrency » ExchangeRatesServiceProviders.
- To add a new provider, click Create New.
- In the Id field enter a GUID. You can get one by using the GUID generator in Visual Studio. You can find under Tools » Create GUID.
- In the Name field enter the programmatic name of the exchange rate provider.
- In the Title field enter the title of the exchange rate provider.
- In the Description field (optional) enter a description of the exchange rate provider.
- In the IsActive field, specify whether or not the exchange rate provider is active or not. If the provider is not active then you cannot use it.
- In the EnableLogging field, specify whether more detailed error/response messages will be logged in the trace file in Sitefinity CMS. You can locate this file at App_Data/Sitefinity/Logs/Trace.Log.
- In the SettingsType field enter the CLR name of the settings class for the exchange rate provider. If the type does not exist, the validation of the field will fail.
- In the ProviderType field enter the CLR name of your RateProviderBase implementation. If the type does not exist, the validation of the field will fail.
- Click Save changes.
Your exchange rates provider is now registered in the Ecommerce provider.
Entering connection settings
Once you have saved your changes, your new provider will show up in the MultiCurrency list. You will notice that there is an additional menu option for your provider called ConnectionSettings. The fields present in the connection settings represent the properties of the exchange rate settings class. The data you enter in these fields will be available in the ExchangeRateRequest object passed to the GetExchangeRates method in the provider class. You can use these settings to call an external web service URL and use the username and password values for authentication.