Currency Implementation
When implementing currency processing with Universal API, it is likely that you will come across two major two scenarios:
- Decimal places in RefPub are not synchronized with IATA standard, and
java.util.Currency
uses ISO standard. This results in currency decimal places mismatch. - Currency code is not available in java.util. Currency (like 'ZMW') results in transaction failures.
Current Issues
To fix these two issues, Universal API updated the decimal places of currencies in RefPub to follow IATA standards.
When saving currency values and returning them in the response, Universal API derives decimal places values of currencies from RefPub to follow IATA standard. For most services, Universal API returns the decimal information (as a separate field or as part of the amount field). However, Universal API, instead of saving and displaying this information, overwrites the response using reference data with IATA standards. Previously, Java util was (and previous iterations of RefPub) were used, both of which used ISO standard.
This issue as highlighted arise for currencies which have different standards for IATA and ISO. The problem happens mostly for non-air content in general, because the vendors often follow ISO standard. For air, vendors mostly follow IATA standards. Because Universal API overwrites with IATA standard, the problem is not apparent.
Provider Standards
Provider | Standard | Notes |
---|---|---|
Galileo (1G), Apollo (1V), Worldspan (1P) - AIR |
IATA |
|
Galileo (1G), Apollo (1V), Worldspan (1P) - CAR and HOTEL |
ISO |
|
MCH |
IATA |
|
ACH |
No Standard |
Depends on carrier. Use carrier-specific exception handling. |
RCS |
ISO |
|
Problem Resolution
To resolve this issue, Universal API follows a configuration file driven approach. A configuration file contains mapping of provider-product and currency standards, and processes that file before saving it in the database and returning the response.
For example, the config file contains data such as:
<Provider Code=”1G”>
<Currency Standard=”IATA”>
<Product Type=”Air”/>
</Currency>
<Currency Standard=”ISO”>
<Product Type=”Car”/>
<Product Type=”Hotel”/>
</Currency>
</Provider>