GetRates
Purpose
Use this function to get exchange rates.
Mandatory
Yes
Input Parameters
An associative array that contains the plugin configuration data.
Parameter name | Description | Type |
---|---|---|
config
|
An associative array that contains configuration parameter data | array[ ParameterData ]
|
ParameterData
Parameter name | Available values | Description | Type |
---|---|---|---|
<name> |
<value>
|
Parameter value. |
|
Response
An associative array that contains the following objects:
Parameter name | Description | Type |
---|---|---|
<currency_rate> |
An exchange rates for the currency. | CurrencyExchangeRates
|
CurrencyExchangeRates
Parameter name | Available values | Description | Type |
---|---|---|---|
code
|
USD, GBP, and so on. | An 3-letter (ISO) code of a currency that is supported in Billing. This is a base currency code. | string
|
rates
|
|
An array of exchange rates. | array[ExchangeRate] |
ExchangeRate
Parameter name | Available values | Description | Type |
---|---|---|---|
code
|
USD, GBP, etc. | An ISO 3-letter code of currency that is supported in billing. This is a quote currency code. | string
|
rate
|
|
An exchange rate value. | number
|
Example
Input data (request)
Copy
{
"config": {
"username": "example_user",
"password": "example_password" }
}
function Example_GetRates($params)
{
return array(
'code' => 'USD',
'rates' => array(
array(
'code' => 'CAD',
'rate' => 1.255525),
array(
'code' => 'EUR',
'rate' => 0.908932)
)
);
}