Converting price values from one currency to another can be done by implementing the ICurrencyConverter. The method implemented by this interface is the GetRate() method. The GetRate() method takes the currency from and currency to parameters and returns the decimal value for that conversion.
Currency conversion is executed using a post processor currency refresh. The Currency converter is configured in the application setting called CurrencyConverter which uses the dependency name as the value.
There are two currency converters that are packaged with Optimizely Configured Commerce:
The geocode plug-in evaluates a location or address and resolves it to a location object containing Latitude, Longitude, City, StateAbbreviation, CountryAbbreviation, and PostalCode. The method implemented by the IGeocoderProvider is the Geocode() method.
There are two geolocation services packaged with Configured Commerce:
Orders submitted from Configured Commerce will be processed by a payment gateway. The IPaymentGateway interface that is implemented by payment gateways in the Configured Commerce platform contain the following methods:
There are four payment gateway providers packaged with Configured Commerce:
The application setting called PaymentGateway is set to the dependency name of the provider class. When the PaymentGateway is set to Dummy the test credit card numbers can be used when testing submitting orders.
Configured Commerce product search can use Solr or Lucene. Both search providers derive from the ProductSearchProviderBase class. To set the search provider the application setting ProductSearchProvider is set to the name of the dependency value on the class of the provider.
There are two currency converters that are packaged with Configured Commerce:
- Azure Lucene
Search is a much broader topic of conversation and additional information can be found in the Understanding Elasticsearch Ranking article.
Processing shipping is an important aspect to any commerce site and Configured Commerce is packaged with two rating services. The IRatingService interface is implemented by these rating service providers. The method implemented by this interface is the RateShipment() method and uses the parameters ship from address, customer order, packages, and carrier. The object returned by RateShipment is a list of shipping cost objects.
The ship rating service are used in the GetCartHandler and CartHelper class files. There are two rating services that are packaged with Configured Commerce:
Calculating the tax on orders is handled by the services in the platform that implement the ITaxCalculator interface. The ITaxCalculator interface implements the CalculateTax and PostTax methods.
The tax calculator is configured in the management console using the dependency name as the value of the TaxCalculator application settings. The default value is Standard.
- TaxCalculator_PostTaxes (Boolean)
- TaxCalculator_StorePickupShipCode (String)
- TaxCalculator_StorePickupStateAbberviation (String)
- TaxCalculator_StorePickupZipCode (String)
- TaxCalculator_TaxCode1ForPercent (String)
There are unique application settings for each tax calculator however the following are shared application settings:
Tax calculation is executed on the checkout page.
The following are tax calculation services integrated with Configured Commerce:
If a custom tax calculator (implements ITaxCalculator) is being used, after tax is calculated the customerOrder.TaxCalculated property must be set to true. If this property is set to false, then the storefront will display the tax as "TBD" on the Cart page and Review and Checkout page. The tax calculated will still be applied to the order, but the display on the storefront will be incorrect.
Multilanguage is a capability in Configured Commerce with some basic integration configuration. Custom translation services can be built using the ITranslationService interface. The ITranslationService interface uses on overloaded method that translates text.