1 | <?php |
||
19 | class WebhookNotification extends AbstractRequest implements NotificationInterface, ResponseInterface |
||
20 | { |
||
21 | use HasCardFields; |
||
22 | |||
23 | /** |
||
24 | * The data contained in the response. |
||
25 | * |
||
26 | * @var mixed |
||
27 | */ |
||
28 | protected $data; |
||
29 | |||
30 | /** |
||
31 | * @inheritDoc |
||
32 | */ |
||
33 | public function __construct(ClientInterface $httpClient, HttpRequest $httpRequest) |
||
45 | |||
46 | /** |
||
47 | * ResponseInterface implemented so that we can return self here for any legacy support that uses send() |
||
48 | */ |
||
49 | public function sendData($data) |
||
53 | |||
54 | /** |
||
55 | * Get the authorisation code if available. |
||
56 | * |
||
57 | * @return null|string |
||
58 | */ |
||
59 | public function getTransactionReference() |
||
63 | |||
64 | /** |
||
65 | * Was the transaction successful? |
||
66 | * |
||
67 | * @return string Transaction status, one of {@link NotificationInterface::STATUS_COMPLETED}, |
||
68 | * {@link NotificationInterface::STATUS_PENDING}, or {@link NotificationInterface::STATUS_FAILED}. |
||
69 | */ |
||
70 | public function getTransactionStatus() |
||
87 | |||
88 | /** |
||
89 | * Get the merchant response message if available. |
||
90 | * |
||
91 | * Note: POST response doesn't include a <PaystationErrorMessage> node |
||
92 | * |
||
93 | * @return null|string |
||
94 | */ |
||
95 | public function getMessage() |
||
99 | |||
100 | public function getData() |
||
104 | |||
105 | /** |
||
106 | * Get the original request which generated this response |
||
107 | * |
||
108 | * @return RequestInterface |
||
109 | */ |
||
110 | public function getRequest() |
||
114 | |||
115 | /** |
||
116 | * Is the response successful? |
||
117 | * |
||
118 | * @return boolean |
||
119 | */ |
||
120 | public function isSuccessful() |
||
124 | |||
125 | /** |
||
126 | * Does the response require a redirect? |
||
127 | * |
||
128 | * @return boolean |
||
129 | */ |
||
130 | public function isRedirect() |
||
134 | |||
135 | /** |
||
136 | * Is the transaction cancelled by the user? |
||
137 | * |
||
138 | * @return boolean |
||
139 | */ |
||
140 | public function isCancelled() |
||
145 | |||
146 | /** |
||
147 | * Response code |
||
148 | * |
||
149 | * @return null|string A response code from the payment gateway |
||
150 | */ |
||
151 | public function getCode() |
||
155 | } |
||
156 |