1 | <?php namespace Ntholenaar\MultiSafepayClient; |
||
15 | class Client implements ClientInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var HttpMethodsClient |
||
19 | */ |
||
20 | private $methodsClient; |
||
21 | |||
22 | /** |
||
23 | * @var MessageFactory |
||
24 | */ |
||
25 | private $messageFactory; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $environment = 'production'; |
||
31 | |||
32 | /** |
||
33 | * @var HttpClient |
||
34 | */ |
||
35 | private $httpClient; |
||
36 | |||
37 | /** |
||
38 | * @var UriFactory |
||
39 | */ |
||
40 | private $uriFactory; |
||
41 | |||
42 | /** |
||
43 | * @var array |
||
44 | */ |
||
45 | private $plugins = array(); |
||
46 | |||
47 | /** |
||
48 | * @param HttpClient|null $httpClient |
||
49 | * @param MessageFactory|null $messageFactory |
||
50 | * @param UriFactory|null $uriFactory |
||
51 | */ |
||
52 | public function __construct( |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function setApiKey($apiKey) |
||
77 | |||
78 | /** |
||
79 | * Get the API endpoint. |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | protected function getApiEndpoint() |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | public function environment($environment) |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function api($name) |
||
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | */ |
||
128 | public function addPlugin(Plugin $plugin) |
||
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | public function getHttpClient() |
||
161 | |||
162 | /** |
||
163 | * Invalidate the http client. |
||
164 | * |
||
165 | * @return $this |
||
166 | */ |
||
167 | protected function invalidHttpClient() |
||
173 | } |
||
174 |