| Total Complexity | 1 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Rate extends Resource |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * The enpoint for rate requests |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | const ENDPOINT = '/rate'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Get an exchange rate |
||
| 16 | * |
||
| 17 | * @see https://revolut-engineering.github.io/api-docs/business-api/#exchanges-get-exchange-rates Official API documentation |
||
| 18 | * @param string $from 3-letter ISO base currency |
||
| 19 | * @param string $to 3-letter ISO target currency |
||
| 20 | * @param float $amount decimal amount, default is 1.00 |
||
| 21 | * @return array The response body |
||
| 22 | * @throws \tbclla\Revolut\Exceptions\ApiException if the client responded with a 4xx-5xx response |
||
| 23 | * @throws \tbclla\Revolut\Exceptions\AppUnauthorizedException if the app needs to be re-authorized |
||
| 24 | */ |
||
| 25 | public function get(string $from, string $to, float $amount = 1) |
||
| 32 |