1 | <?php namespace Ntholenaar\MultiSafepayClient\Api; |
||
6 | abstract class AbstractApi implements ApiInterface |
||
7 | { |
||
8 | /** |
||
9 | * HultiSafepay API Client. |
||
10 | * |
||
11 | * @var Client |
||
12 | */ |
||
13 | protected $client; |
||
14 | |||
15 | /** |
||
16 | * @param Client $client |
||
17 | */ |
||
18 | public function __construct(Client $client) |
||
22 | |||
23 | /** |
||
24 | * Execute an Http GET request. |
||
25 | * |
||
26 | * @param $path |
||
27 | * @param array $parameters |
||
28 | * @return mixed |
||
29 | */ |
||
30 | protected function get($path, array $parameters = array()) |
||
40 | |||
41 | /** |
||
42 | * Execute an http POST request. |
||
43 | * |
||
44 | * @param $path |
||
45 | * @param array $parameters |
||
46 | * @param array $body |
||
47 | * @return mixed |
||
48 | */ |
||
49 | protected function post($path, array $parameters = array(), $body = array()) |
||
61 | |||
62 | /** |
||
63 | * Parse the response. |
||
64 | * |
||
65 | * @param ResponseInterface $response |
||
66 | * @return mixed |
||
67 | * @throws \Exception |
||
68 | */ |
||
69 | protected function parseResponse(ResponseInterface $response) |
||
79 | } |
||
80 |