| 1 | <?php |
||
| 14 | trait BaseDataTrait |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Response code |
||
| 18 | * |
||
| 19 | * @return null|string A response code from the payment gateway |
||
| 20 | */ |
||
| 21 | 2 | public function getCode() |
|
| 22 | { |
||
| 23 | 2 | $data = $this->getData(); |
|
| 24 | |||
| 25 | 2 | return (string)$data['error_code'] ? : null; |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return SimpleXMLElement |
||
| 30 | * |
||
| 31 | * @codeCoverageIgnore |
||
| 32 | */ |
||
| 33 | abstract public function getData(); |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Response Message |
||
| 37 | * |
||
| 38 | * @return null|string A response message from the payment gateway |
||
| 39 | */ |
||
| 40 | 5 | public function getMessage() |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Status information of the response i.e. APPROVED |
||
| 49 | * |
||
| 50 | * @return null|string |
||
| 51 | */ |
||
| 52 | 1 | public function getStatus() |
|
| 58 | |||
| 59 | /** |
||
| 60 | * Gateway Reference |
||
| 61 | * |
||
| 62 | * @return null|string A reference provided by the gateway to represent this transaction |
||
| 63 | */ |
||
| 64 | 2 | public function getTransactionReference() |
|
| 70 | |||
| 71 | /** |
||
| 72 | * Is the response successful? |
||
| 73 | * |
||
| 74 | * @return bool |
||
| 75 | */ |
||
| 76 | 7 | public function isSuccessful() |
|
| 82 | } |
||
| 83 |