1 | <?php |
||
17 | class WebhookNotification extends AbstractRequest implements NotificationInterface, ResponseInterface |
||
18 | { |
||
19 | /** |
||
20 | * The data contained in the response. |
||
21 | * |
||
22 | * @var mixed |
||
23 | */ |
||
24 | protected $data; |
||
25 | |||
26 | /** |
||
27 | * @inheritDoc |
||
28 | */ |
||
29 | public function __construct(ClientInterface $httpClient, HttpRequest $httpRequest) |
||
35 | |||
36 | /** |
||
37 | * ResponseInterface implemented so that we can return self here for any legacy support that uses send() |
||
38 | */ |
||
39 | public function sendData($data) |
||
43 | |||
44 | /** |
||
45 | * Get the authorisation code if available. |
||
46 | * |
||
47 | * @return null|string |
||
48 | */ |
||
49 | public function getTransactionReference() |
||
53 | |||
54 | /** |
||
55 | * Was the transaction successful? |
||
56 | * |
||
57 | * @return string Transaction status, one of {@link NotificationInterface::STATUS_COMPLETED}, |
||
58 | * {@link NotificationInterface::STATUS_PENDING}, or {@link NotificationInterface::STATUS_FAILED}. |
||
59 | */ |
||
60 | public function getTransactionStatus() |
||
75 | |||
76 | /** |
||
77 | * Get the merchant response message if available. |
||
78 | * |
||
79 | * @return null|string |
||
80 | */ |
||
81 | public function getMessage() |
||
85 | |||
86 | public function getData() |
||
90 | |||
91 | /** |
||
92 | * Get the original request which generated this response |
||
93 | * |
||
94 | * @return RequestInterface |
||
95 | */ |
||
96 | public function getRequest() |
||
100 | |||
101 | /** |
||
102 | * Is the response successful? |
||
103 | * |
||
104 | * @return boolean |
||
105 | */ |
||
106 | public function isSuccessful() |
||
110 | |||
111 | /** |
||
112 | * Does the response require a redirect? |
||
113 | * |
||
114 | * @return boolean |
||
115 | */ |
||
116 | public function isRedirect() |
||
120 | |||
121 | /** |
||
122 | * Is the transaction cancelled by the user? |
||
123 | * |
||
124 | * @return boolean |
||
125 | */ |
||
126 | public function isCancelled() |
||
130 | |||
131 | /** |
||
132 | * Response code |
||
133 | * |
||
134 | * @return null|string A response code from the payment gateway |
||
135 | */ |
||
136 | public function getCode() |
||
140 | |||
141 | /** |
||
142 | * Get the card type if available. |
||
143 | * |
||
144 | * @return null|string |
||
145 | */ |
||
146 | public function getCardType() |
||
150 | } |
||
151 |