@@ 7-56 (lines=50) @@ | ||
4 | ||
5 | use Link0\Bunq\Environment; |
|
6 | ||
7 | final class Production implements Environment |
|
8 | { |
|
9 | const SERVICE_URL = 'https://api.bunq.com'; |
|
10 | const VERSION = 'v1'; |
|
11 | ||
12 | /** |
|
13 | * @var bool $inDebugMode |
|
14 | */ |
|
15 | private $inDebugMode; |
|
16 | ||
17 | /** |
|
18 | * @param bool $inDebugMode |
|
19 | */ |
|
20 | public function __construct(bool $inDebugMode = false) |
|
21 | { |
|
22 | $this->inDebugMode = $inDebugMode; |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * @return string |
|
27 | */ |
|
28 | public function serviceUrl(): string |
|
29 | { |
|
30 | return self::SERVICE_URL; |
|
31 | } |
|
32 | ||
33 | /** |
|
34 | * @return string |
|
35 | */ |
|
36 | public function version(): string |
|
37 | { |
|
38 | return self::VERSION; |
|
39 | } |
|
40 | ||
41 | /** |
|
42 | * @return string |
|
43 | */ |
|
44 | public function endpoint(): string |
|
45 | { |
|
46 | return $this->serviceUrl() . '/' . $this->version() . '/'; |
|
47 | } |
|
48 | ||
49 | /** |
|
50 | * @return bool |
|
51 | */ |
|
52 | public function inDebugMode(): bool |
|
53 | { |
|
54 | return $this->inDebugMode; |
|
55 | } |
|
56 | } |
|
57 |
@@ 7-56 (lines=50) @@ | ||
4 | ||
5 | use Link0\Bunq\Environment; |
|
6 | ||
7 | final class Sandbox implements Environment |
|
8 | { |
|
9 | const SERVICE_URL = 'https://sandbox.public.api.bunq.com'; |
|
10 | const VERSION = 'v1'; |
|
11 | ||
12 | /** |
|
13 | * @var bool $inDebugMode |
|
14 | */ |
|
15 | private $inDebugMode; |
|
16 | ||
17 | /** |
|
18 | * @param bool $inDebugMode |
|
19 | */ |
|
20 | public function __construct(bool $inDebugMode = false) |
|
21 | { |
|
22 | $this->inDebugMode = $inDebugMode; |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * @return string |
|
27 | */ |
|
28 | public function serviceUrl(): string |
|
29 | { |
|
30 | return self::SERVICE_URL; |
|
31 | } |
|
32 | ||
33 | /** |
|
34 | * @return string |
|
35 | */ |
|
36 | public function version(): string |
|
37 | { |
|
38 | return self::VERSION; |
|
39 | } |
|
40 | ||
41 | /** |
|
42 | * @return string |
|
43 | */ |
|
44 | public function endpoint(): string |
|
45 | { |
|
46 | return $this->serviceUrl() . '/' . $this->version() . '/'; |
|
47 | } |
|
48 | ||
49 | /** |
|
50 | * @return bool |
|
51 | */ |
|
52 | public function inDebugMode(): bool |
|
53 | { |
|
54 | return $this->inDebugMode; |
|
55 | } |
|
56 | } |
|
57 |