Business components : Business components : Branch application components : Foreign Exchange : Reference
  
Reference
See also
Connection Pool API
Foreign Exchange Database structure
Foreign Exchange
Exchange APIs
convert method
Converts an amount in the source currency to another currency.
Parameters
 
Name
Type
Description
fromCurreny
String
The String character code of the source currency.
toCurrency
String
The String character code of the destination currency.
fromMonetaryItem
String
The type of monetary item of the source currency.
toMonetaryItem
String
The type of monetary item of the destination currency.
fromAmount
BigDecimal
The amount of money in the source currency.
Return
 
Type
Description
BigDecimal
The amount of money in the destination currency
convertReverse method
Converts the source currency to the specified amount in the destination currency. For example, use this method to convert an unknown amount of CAD to GBP 20.00. This method returns the amount of CAD required for the conversion. If you know the amount you want to be converted, use the convert method.
Parameters
 
Name
Type
Description
fromCurreny
String
The String character code of the source currency.
toCurrency
String
The String character code of the destination currency.
fromMonetaryItem
String
The type of monetary item of the source currency.
toMonetaryItem
String
The type of monetary item of the destination currency.
toAmount
BigDecimal
The amount of money in the destination currency.
Return
 
Type
Description
BigDecimal
The amount of money in the source currency.
getBuyRate method
Returns the rate at which the financial institution buys the specified currency against the home currency.
Parameters
 
Name
Type
Description
toCurrency
String
The String character code of the destination currency.
fromMonetaryItem
String
The type of monetary item of the source currency.
toMonetaryItem
String
The type of monetary item of the destination currency.
Return
 
Type
Description
BigDecimal
The rate at which the financial institution buys the specified currency against the home currency.
getBuyRate method
Returns the rate at which the financial institution buys the specified currency against the given source currency.
Parameters
 
Name
Type
Description
fromCurrency
String
The String character code of the given source currency.
toCurrency
String
The String character code of the destination currency.
fromMonetaryItem
String
The type of monetary item of the source currency.
toMonetaryItem
String
The type of monetary item of the destination currency.
Return
 
Type
Description
BigDecimal
The rate at which the financial institution buys the specified currency against the home currency.
Method getSellRate: returns the rate at which the financial institution sells the specified currency against the home currency.
Parameters
 
Name
Type
Description
fromCurrency
String
The String character code of the given source currency.
toCurrency
String
The String character code of the destination currency.
fromMonetaryItem
String
The type of monetary item of the source currency.
toMonetaryItem
String
The type of monetary item of the destination currency.
Return
 
Type
Description
BigDecimal
The rate at which the financial institution sells the specified currency against the home currency.
getAllSupportedCurrencies method
Returns all the currency names in an array.
Return
 
Type
Description
String[]
The names of the currencies
ForeignExchangeException
ForeignExchangeException is thrown when:
The value of fromAmount is illegal, null or less than 0.0.
Trying to pass an illegal currency, null or currency that unsupported by branch.
Trying to pass an illegal monetary item, null or undefined items.
Rates cache refresh interval is not specified.
See also
Reference
Foreign Exchange Database structure
The following table shows the FXRates table schema:
FXRates table schema
 
Column
Description
SQL Type
Size
Java Type
FROMCURRENCY (PK)
Identifies the source currency.
CHAR
3
String
TOCURRENCY (PK)
Identifies the destination currency.
CHAR
3
String
FROMMONETARYITEM (PK)
Identifies how the financial institution receives the source currency.
CHAR
2
String
TOMONETARYITEM (PK)
Identifies how the financial institution received the destination currency.
CHAR
2
String
BUYRATE
Contains the rate at which the financial institution buys the destination currency. Its format is fixed to six significant digits.
CHAR
8
String
SELLRATE
Contains the rate at which the financial institution sells the destination currency. Its format is fixed to six significant digits.
CHAR
8
String
The table stores the buy and sell rates based on a single unit of the from currency to x units of the to currency. For example, a single USD to 173.000 ESP.
Note PK = primary key.
Example of the FXRates table
 
FROM CURRENCY
TO CURRENCY
FROM MONETARY ITEM
TO MONETARY ITEM
BUY RATE
SELL RATE
USD
ESP
CA
CA
"173.145"
"173.155"
EUR
DEM
CA
CA
"1.95583"
"1.95583"
See also
Reference