1 | <?php namespace Arcanedev\Currencies\Services; |
||
12 | class OpenExchangeRatesService extends AbstractService |
||
13 | { |
||
14 | /* ------------------------------------------------------------------------------------------------ |
||
15 | | Properties |
||
16 | | ------------------------------------------------------------------------------------------------ |
||
17 | */ |
||
18 | /** |
||
19 | * The base URL. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $baseUrl = 'http://openexchangerates.org/api'; |
||
24 | |||
25 | /** |
||
26 | * The API ID. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $apiId; |
||
31 | |||
32 | /** |
||
33 | * The Pro Plan. |
||
34 | * |
||
35 | * @var bool |
||
36 | */ |
||
37 | protected $proPlan = false; |
||
38 | |||
39 | /* ------------------------------------------------------------------------------------------------ |
||
40 | | Getters & Setters |
||
41 | | ------------------------------------------------------------------------------------------------ |
||
42 | */ |
||
43 | /** |
||
44 | * Set the configs. |
||
45 | * |
||
46 | * @param array $configs |
||
47 | */ |
||
48 | 24 | protected function setProviderConfigs(array $configs) |
|
53 | |||
54 | /** |
||
55 | * Get the API ID. |
||
56 | * |
||
57 | * @return string |
||
58 | * |
||
59 | * @throws \Arcanedev\Currencies\Exceptions\ApiException |
||
60 | */ |
||
61 | 12 | private function getAppId() |
|
69 | |||
70 | /* ------------------------------------------------------------------------------------------------ |
||
71 | | Main Functions |
||
72 | | ------------------------------------------------------------------------------------------------ |
||
73 | */ |
||
74 | /** |
||
75 | * Make an API request. |
||
76 | * |
||
77 | * @param string $from |
||
78 | * @param array $to |
||
79 | * |
||
80 | * @return array |
||
81 | * |
||
82 | * @throws \Arcanedev\Currencies\Exceptions\ApiException |
||
83 | */ |
||
84 | 12 | protected function request($from, array $to) |
|
96 | } |
||
97 |