1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Digikraaft\Abokifx; |
4
|
|
|
|
5
|
|
|
use Digikraaft\Abokifx\Util\Util; |
6
|
|
|
|
7
|
|
|
class Rate extends ApiResource |
8
|
|
|
{ |
9
|
|
|
const OBJECT_NAME = 'rates'; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* @return array|object |
13
|
|
|
* @throws Exceptions\InvalidArgumentException |
14
|
|
|
* @throws Exceptions\IsNullException |
15
|
|
|
* @link https://www.abokifx.com/api_references |
16
|
|
|
*/ |
17
|
|
|
public static function current() |
18
|
|
|
{ |
19
|
|
|
$url = self::endPointUrl("movement"); |
20
|
|
|
|
21
|
|
|
return static::staticRequest('GET', $url); |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @return array|object |
26
|
|
|
* @throws Exceptions\InvalidArgumentException |
27
|
|
|
* @throws Exceptions\IsNullException |
28
|
|
|
* @link https://www.abokifx.com/api_references |
29
|
|
|
*/ |
30
|
|
|
public static function previous() |
31
|
|
|
{ |
32
|
|
|
$url = self::endPointUrl("lagos_previous"); |
33
|
|
|
|
34
|
|
|
return static::staticRequest('GET', $url); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @return array|object |
39
|
|
|
* @throws Exceptions\InvalidArgumentException |
40
|
|
|
* @throws Exceptions\IsNullException |
41
|
|
|
* @link https://www.abokifx.com/api_references |
42
|
|
|
*/ |
43
|
|
|
public static function otherParallel() |
44
|
|
|
{ |
45
|
|
|
$url = self::endPointUrl("otherparallel"); |
46
|
|
|
|
47
|
|
|
return static::staticRequest('GET', $url); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @param array|null $params |
52
|
|
|
* @return array|object |
53
|
|
|
* @throws Exceptions\InvalidArgumentException |
54
|
|
|
* @throws Exceptions\IsNullException |
55
|
|
|
* @link https://www.abokifx.com/api_references |
56
|
|
|
*/ |
57
|
|
|
public static function withDate(array $params) |
58
|
|
|
{ |
59
|
|
|
//24-04-2020 |
60
|
|
|
self::validateParams($params); |
61
|
|
|
$url = self::endPointUrl("date"); |
62
|
|
|
if (! empty($params)) { |
63
|
|
|
$url .= '?'.http_build_query($params); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
return static::staticRequest('GET', $url); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
} |
70
|
|
|
|