| Total Complexity | 9 | 
| Total Lines | 58 | 
| Duplicated Lines | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 10 | class FetchTransactionResponse extends AbstractResponse | ||
| 11 | { | ||
| 12 | /** | ||
| 13 | * Is the response pending success or failure? | ||
| 14 | * | ||
| 15 | * @return boolean | ||
| 16 | */ | ||
| 17 | public function isPending() | ||
| 18 |     { | ||
| 19 |         if (empty($this->data) || isset($this->data->errorId)) { | ||
| 20 | return false; | ||
| 21 | } | ||
| 22 | |||
| 23 | return $this->data->statusOutput->statusCategory == 'PENDING_CONNECT_OR_3RD_PARTY'; | ||
| 24 | } | ||
| 25 | |||
| 26 | /** | ||
| 27 | * Is the response successful? | ||
| 28 | * | ||
| 29 | * @return boolean | ||
| 30 | */ | ||
| 31 | public function isSuccessful() | ||
| 38 | } | ||
| 39 | |||
| 40 | /** | ||
| 41 | * Numeric status code (also in back office / report files) | ||
| 42 | * | ||
| 43 | * @return null|string | ||
| 44 | */ | ||
| 45 | public function getCode() | ||
| 48 | } | ||
| 49 | |||
| 50 | /** | ||
| 51 | * Get the authorisation code if available. | ||
| 52 | * | ||
| 53 | * @return null|string | ||
| 54 | */ | ||
| 55 | public function getTransactionReference() | ||
| 56 |     { | ||
| 57 | return $this->data->id ?? null; | ||
| 58 | } | ||
| 59 | |||
| 60 | /** | ||
| 61 | * Get the merchant response message if available. | ||
| 62 | * | ||
| 63 | * @return null|string | ||
| 64 | */ | ||
| 65 | public function getMessage() | ||
| 68 | } | ||
| 69 | } | ||
| 70 |