1 | <?php |
||
5 | class Response |
||
6 | { |
||
7 | /** |
||
8 | * @var bool |
||
9 | */ |
||
10 | private $success; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $message; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $transactionId; |
||
21 | |||
22 | /** |
||
23 | * @var string|int |
||
24 | */ |
||
25 | private $errorCode; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $responseCode; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | private $payload; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | private $rawRequest; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | private $rawResponse; |
||
46 | |||
47 | /** |
||
48 | * @param bool $success |
||
49 | * @param string $message |
||
50 | * @param string $transactionId |
||
51 | * @param string $errorCode |
||
52 | * @param string $responseCode |
||
53 | * @param array $payload |
||
54 | * @param string $rawRequest |
||
55 | * @param string $rawResponse |
||
56 | */ |
||
57 | 1 | public function __construct( |
|
76 | |||
77 | /** |
||
78 | * Returns whether response is success or not. |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | public function isSuccess() |
||
86 | |||
87 | /** |
||
88 | * Returns the unique transaction id from gateway. |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getTransactionId() |
||
96 | |||
97 | /** |
||
98 | * Returns the error code from gateway, if exists. |
||
99 | * |
||
100 | * @return string|int |
||
101 | */ |
||
102 | public function getErrorCode() |
||
106 | |||
107 | /** |
||
108 | * Returns a human readable message for current transaction response, |
||
109 | * either on success or failed transactions. |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | public function getMessage() |
||
117 | |||
118 | /** |
||
119 | * Returns the credit card response code from gateway, if exits. |
||
120 | * |
||
121 | * This must be the {@link [https://en.wikipedia.org/wiki/ISO_8583#Response_code][ISO 8583]} ISO 8583 response code. |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | public function getResponseCode() |
||
129 | |||
130 | /** |
||
131 | * Returns any gateway response element as an associative array. |
||
132 | * Array may contain nested elements. |
||
133 | * |
||
134 | * @return array |
||
135 | */ |
||
136 | public function getPayload() |
||
140 | |||
141 | public function getRawRequest() |
||
145 | |||
146 | public function getRawResponse() |
||
150 | } |
||
151 |