1: | <?php |
2: | namespace Worldline\Acquiring\Sdk\Communication; |
3: | |
4: | use RuntimeException; |
5: | |
6: | |
7: | |
8: | |
9: | |
10: | |
11: | class InvalidResponseException extends RuntimeException |
12: | { |
13: | |
14: | |
15: | |
16: | private $response; |
17: | |
18: | |
19: | |
20: | |
21: | |
22: | public function __construct(ConnectionResponse $response, $message = null) |
23: | { |
24: | if (is_null($message)) { |
25: | $message = 'The server returned an invalid response.'; |
26: | } |
27: | parent::__construct($message); |
28: | $this->response = $response; |
29: | } |
30: | |
31: | |
32: | |
33: | |
34: | public function getResponse() |
35: | { |
36: | return $this->response; |
37: | } |
38: | } |
39: | |