1: <?php
2: namespace Worldline\Acquiring\Sdk\Communication;
3:
4: use Worldline\Acquiring\Sdk\Logging\CommunicatorLogger;
5:
6: /**
7: * Class Connection
8: *
9: * @package Worldline\Acquiring\Sdk\Communication
10: */
11: interface Connection
12: {
13: /**
14: * @param string $requestUri
15: * @param string[] $requestHeaders
16: * @param callable $responseHandler Callable accepting the response status code, a response body chunk and the response headers
17: */
18: public function get(string $requestUri, array $requestHeaders, callable $responseHandler): void;
19:
20: /**
21: * @param string $requestUri
22: * @param string[] $requestHeaders
23: * @param callable $responseHandler Callable accepting the response status code, a response body chunk and the response headers
24: */
25: public function delete(string $requestUri, array $requestHeaders, callable $responseHandler): void;
26:
27: /**
28: * @param string $requestUri
29: * @param string[] $requestHeaders
30: * @param string|MultipartFormDataObject $body
31: * @param callable $responseHandler Callable accepting the response status code, a response body chunk and the response headers
32: */
33: public function post(string $requestUri, array $requestHeaders, $body, callable $responseHandler): void;
34:
35: /**
36: * @param string $requestUri
37: * @param string[] $requestHeaders
38: * @param string|MultipartFormDataObject $body
39: * @param callable $responseHandler Callable accepting the response status code, a response body chunk and the response headers
40: */
41: public function put(string $requestUri, array $requestHeaders, $body, callable $responseHandler): void;
42:
43: /**
44: * @param CommunicatorLogger $communicatorLogger
45: */
46: public function enableLogging(CommunicatorLogger $communicatorLogger): void;
47:
48: /**
49: *
50: */
51: public function disableLogging(): void;
52: }
53: