| Total Complexity | 25 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 7 | class Response extends AbstractResponse |
||
| 8 | { |
||
| 9 | 45 | public function isSuccessful() |
|
| 10 | { |
||
| 11 | if (( |
||
|
|
|||
| 12 | 45 | (isset($this->data->receipt->Complete) && (bool) $this->data->receipt->Complete === true) || |
|
| 13 | 45 | (isset($this->data->receipt->ResSuccess) && (bool) $this->data->receipt->ResSuccess === true) |
|
| 14 | ) && |
||
| 15 | ( |
||
| 16 | 39 | isset($this->data->receipt->ResponseCode) && $this->data->receipt->ResponseCode != 'null' && |
|
| 17 | 45 | (int) $this->data->receipt->ResponseCode >= 0 && (int) $this->data->receipt->ResponseCode <= 49 |
|
| 18 | ) |
||
| 19 | ) { |
||
| 20 | 21 | return true; |
|
| 21 | } |
||
| 22 | |||
| 23 | 24 | return false; |
|
| 24 | } |
||
| 25 | |||
| 26 | 3 | public function getCardReference() |
|
| 27 | { |
||
| 28 | 3 | return isset($this->data->receipt->DataKey) ? (string) $this->data->receipt->DataKey : null; |
|
| 29 | } |
||
| 30 | |||
| 31 | 6 | public function getCode() |
|
| 32 | { |
||
| 33 | 6 | return isset($this->data->receipt->ResponseCode) ? (string) $this->data->receipt->ResponseCode : null; |
|
| 34 | } |
||
| 35 | |||
| 36 | 3 | public function getAuthCode() |
|
| 39 | } |
||
| 40 | |||
| 41 | 3 | public function getTransactionId() |
|
| 42 | { |
||
| 43 | 3 | return isset($this->data->receipt->TransID) ? (string) $this->data->receipt->TransID : null; |
|
| 44 | } |
||
| 45 | |||
| 46 | 6 | public function getTransactionReference() |
|
| 47 | { |
||
| 48 | 6 | return isset($this->data->receipt->ReferenceNum) ? (string) $this->data->receipt->ReferenceNum : null; |
|
| 49 | } |
||
| 50 | |||
| 51 | 6 | public function getMessage() |
|
| 54 | } |
||
| 55 | |||
| 56 | 3 | public function getOrderNumber() |
|
| 57 | { |
||
| 58 | 3 | return isset($this->data->receipt->ReceiptId) ? (string) $this->data->receipt->ReceiptId : null; |
|
| 59 | } |
||
| 60 | |||
| 61 | 3 | public function getData() |
|
| 72 | } |
||
| 73 | } |
||
| 74 |