Currencies
Translations
Currencies for the widget are configured using the currencies config option.
Tamaro supports the following currencies out of the box, which means it has predefined translations for their names:
chf
- Swiss Francseur
- Eurousd
- US Dollarinr
- Indian Rupeehuf
- Hungarian forintron
- Romanian leugbp
- British poundcad
- Canadian dollarcny
- Chinese yuanaud
- Australian dollarsgd
- Singapore Dollarkrw
- South Korean won
If you want to use some other currencies, which are not listed above, the translations for such currencies names are not provided out of the box, so you would need to provide them yourself.
Tamaro technically supports any standard currencies, defined by ISO 4217, if they are supported by the payment provider, which may differ depending on the selected payment method.
If not explicitly specified, the default currencies list is the following:
['chf', 'eur', 'usd']
Please use the currencies codes with lowercase!
This is an example how you can configure the widget with different currencies, providing translations for them:
Subunits
Most of the currencies have 2 decimal places, meaning each major currency unit is divided into 100 subunits, but there are some currencies, which have different number of decimal places:
bhd
- Bahraini Dinar (3)bif
- Burundian Franc (0)clf
- Unidad de Fomento (4)clp
- Chilean Peso (0)gnf
- Guinean Franc (0)jpy
- Japanese Yen (0)- etc.
Amounts are always sent in subunits to the backend API endpoints. In order to correctly handle currencies with different number of subunits, you should specify the number of subunits using the amountSubunits config option.
For currency without subunits set amountSubunits
to 1
for this particular currency.
If amountSubunits
is not explicitly specified for the particular currency,
it falls back to 100
.
Conditionals
You can set different amounts for different currencies. More info here.