Skip to content
pCon.configurator onlineDocumentation
Esc
↑↓navigate↵open⌘Jpreview
On this page

setCurrency

Synopsis

void setCurrency(SessionId sessionId, string currency)
throws BasketServiceFault;

See also: SessionId, BasketServiceFault

The setCurrency operation changes the current session’s basket currency to the currency specified by the currency parameter, which must be a known1 ISO 4217 currency code (consisting of three upper case letters, pseudo-currency codes are not supported).

Prices returned by basket operations use the current basket currency if it is supported by the product database. If the current basket currency is not supported by the product database the behavior is undefined2.

Note that, although the default basket currency depends on the session’s default locale, invocations of the session service’s setLocale operation never change the current basket currency.

A BasketServiceFault is returned if any of the following conditions occurs:

  • The sessionId parameter is not a valid string representation of an UUID or does not represent an open session.

  • The currencies parameter contains an invalid currency code, or the specified currency is not supported by the Online Configurator.

  • The currencies parameter contains a currency code with no available or valid conversion rate in the currency conversion table of the current basket. If a new basket is created (as with the ‘openSession’ operation), this table is initialized with the currencies found in etc/currencies.cfg. If a basket is loaded using the ‘loadSession’ operation, the table is loaded from the OBK file.

  • If it is passed the code of a pseudo currency.

Footnotes

  1. The current implementation accepts all currencies known by the Java virtual machine. Future versions of the Online Configurator might further limit the set of accepted currencies. ↩

  2. The current implementation returns prices in currency more or less randomly chosen from the set of supported currencies. A future versions of the Online Configurator will use a well defined algorithm to choose one of the supported currencies and convert the prices fetched from the product database into the current basket currency. ↩