Total Complexity | 7 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
11 | trait RelayResponseTrait |
||
12 | { |
||
13 | /** |
||
14 | * @inheritDoc |
||
15 | * @noinspection PhpMissingReturnTypeInspection |
||
16 | */ |
||
17 | public function isSuccessful() |
||
18 | { |
||
19 | return $this->getCode() == '2'; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @inheritDoc |
||
24 | * @noinspection PhpMissingReturnTypeInspection |
||
25 | */ |
||
26 | public function isPending() |
||
27 | { |
||
28 | return $this->getCode() == '13'; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @inheritDoc |
||
33 | * @noinspection PhpMissingReturnTypeInspection |
||
34 | */ |
||
35 | public function getMessage() |
||
36 | { |
||
37 | return |
||
38 | 'CODE: ' . $this->getNotification()->x_response_reason_code |
||
39 | . ' ' . $this->getNotification()->x_response_reason_text; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @inheritDoc |
||
44 | * @noinspection PhpMissingReturnTypeInspection |
||
45 | */ |
||
46 | public function getCode() |
||
47 | { |
||
48 | return (string)$this->getNotification()->x_response_code; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @inheritDoc |
||
53 | * @noinspection PhpMissingReturnTypeInspection |
||
54 | */ |
||
55 | public function getTransactionReference() |
||
56 | { |
||
57 | return (string)$this->getNotification()->x_trans_id; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @inheritDoc |
||
62 | * @noinspection PhpMissingReturnTypeInspection |
||
63 | */ |
||
64 | public function getTransactionId() |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return SimpleXMLElement |
||
71 | */ |
||
72 | protected function getNotification() |
||
75 | } |
||
76 | } |
||
77 |