1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | namespace Worldline\Connect\Sdk\V1; |
7: | |
8: | use Worldline\Connect\Sdk\Domain\DataObject; |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | class IdempotenceException extends ResponseException |
16: | { |
17: | |
18: | private $idempotenceKey; |
19: | |
20: | |
21: | private $idempotenceRequestTimestamp; |
22: | |
23: | |
24: | |
25: | |
26: | |
27: | |
28: | |
29: | |
30: | public function __construct( |
31: | $httpStatusCode, |
32: | DataObject $response, |
33: | $message = null, |
34: | $idempotenceKey = '', |
35: | $idempotenceRequestTimestamp = '' |
36: | ) { |
37: | if ($message == null) { |
38: | $message = 'the Worldline Global Collect platform returned a duplicate request error response'; |
39: | } |
40: | parent::__construct($httpStatusCode, $response, $message); |
41: | $this->idempotenceKey = $idempotenceKey; |
42: | $this->idempotenceRequestTimestamp = $idempotenceRequestTimestamp; |
43: | } |
44: | |
45: | |
46: | |
47: | |
48: | public function getIdempotenceKey() |
49: | { |
50: | return $this->idempotenceKey; |
51: | } |
52: | |
53: | |
54: | |
55: | |
56: | public function getIdempotenceRequestTimestamp() |
57: | { |
58: | return $this->idempotenceRequestTimestamp; |
59: | } |
60: | } |
61: | |