MerchantCurrencyConverter.<instId>.properties.YYYY-MM-DD
For example, for installation id 4598
and 10th June 1999:
MerchantCurrencyConverter.4598.properties.1999-06-10
The rates in a given file are valid for the day specified by the date suffix in
GMT (i.e. from midnight GMT). The files are placed in the directory specified
for "currencyconfig" in select.properties.
Currency Java Classes
These classes enable you to manipulate currency and price information. To create
a purchase token you need to use Currency and CurrencyAmount. You only need the
MerchantCurrencyConverter if you wish to provide a choice of currencies for displaying
prices on your own site.
Currency
This abstract class encapsulates information about the currencies supported by
the system. Information stored includes the currency ISO code (for example "GBP")
and currency symbol (for example, "£"). This objects of this class occur as parameters
to methods in all the other classes mentioned here. A list
of ISO currency codes can be found as an appendix to the Select Integration
Guide.
CurrencyList
An extension of the standard List object allowing lists of currencies to be created
and manipulated. CurrencyLists are returned by methods in the MerchantCurrencyConverter
class, chiefly: getAcquisitionCurrencies() and getSettlementCurrencies() but can,
of course, be created directly as required.
SelectCurrency
This class represents the currencies available to the whole Select system, above
individual merchant/installation level. The class has methods to return lists
of available currencies, such as all the currencies supported by the system or
settlement currencies only.
CurrencyAmount
This class encapsulates an amount with a currency defining it as a currency amount.
It has methods to create the object using a numeric amount and a Currency object.
It also has methods to perform basic addition and subtraction of one CurrencyAmount
object from another. The currency types must be identical in all cases. The subtraction
method subtracts the given currency amount from the object. The addition method
can either add to the current object or return the sum of two CurrencyAmount parameters.
The class also includes methods to display the currency amount in a variety of
useful formats including numeric and string values. CurrencyAmount objects are
required as parameters to methods used in the MerchantCurrencyConverter class.
MerchantCurrencyConverter
An implementation of the CurrencyConverter class described above that is specific
for the merchant side of Select. Constructors require the Select installation
ID number and the class includes methods to return lists of currencies related
to the setup of the given installation. see: getAcquisitionCurrencies() and getSettlementCurrencies().
An Example of a Currency selection/conversion Servlet
The CurrTest servlet provided in the examples directory demonstrates how to use
the currency classes to build a simple application. This servlet allows the user
to purchase a single item of fixed price, but also allows that price to be converted
into any of the acquisition currencies available. The displayed price will change
to match the currency selected and will be used when submitting the purchase form.
The submission is actually to the example servlet 'BuyThis' which is also in the
examples directory and which demonstrates a typical purchase submission to WM.