1 | <?php |
||
19 | class WebhookNotification extends AbstractRequest implements NotificationInterface, ResponseInterface |
||
20 | { |
||
21 | /** |
||
22 | * The data contained in the response. |
||
23 | * |
||
24 | * @var mixed |
||
25 | */ |
||
26 | protected $data; |
||
27 | |||
28 | /** |
||
29 | * @inheritDoc |
||
30 | */ |
||
31 | public function __construct(ClientInterface $httpClient, HttpRequest $httpRequest) |
||
43 | |||
44 | /** |
||
45 | * ResponseInterface implemented so that we can return self here for any legacy support that uses send() |
||
46 | */ |
||
47 | public function sendData($data) |
||
51 | |||
52 | /** |
||
53 | * Get the authorisation code if available. |
||
54 | * |
||
55 | * @return null|string |
||
56 | */ |
||
57 | public function getTransactionReference() |
||
61 | |||
62 | /** |
||
63 | * Was the transaction successful? |
||
64 | * |
||
65 | * @return string Transaction status, one of {@link NotificationInterface::STATUS_COMPLETED}, |
||
66 | * {@link NotificationInterface::STATUS_PENDING}, or {@link NotificationInterface::STATUS_FAILED}. |
||
67 | */ |
||
68 | public function getTransactionStatus() |
||
85 | |||
86 | /** |
||
87 | * Get the merchant response message if available. |
||
88 | * |
||
89 | * Note: POST response doesn't include a <PaystationErrorMessage> node |
||
90 | * |
||
91 | * @return null|string |
||
92 | */ |
||
93 | public function getMessage() |
||
97 | |||
98 | public function getData() |
||
102 | |||
103 | /** |
||
104 | * Get the original request which generated this response |
||
105 | * |
||
106 | * @return RequestInterface |
||
107 | */ |
||
108 | public function getRequest() |
||
112 | |||
113 | /** |
||
114 | * Is the response successful? |
||
115 | * |
||
116 | * @return boolean |
||
117 | */ |
||
118 | public function isSuccessful() |
||
122 | |||
123 | /** |
||
124 | * Does the response require a redirect? |
||
125 | * |
||
126 | * @return boolean |
||
127 | */ |
||
128 | public function isRedirect() |
||
132 | |||
133 | /** |
||
134 | * Is the transaction cancelled by the user? |
||
135 | * |
||
136 | * @return boolean |
||
137 | */ |
||
138 | public function isCancelled() |
||
143 | |||
144 | /** |
||
145 | * Response code |
||
146 | * |
||
147 | * @return null|string A response code from the payment gateway |
||
148 | */ |
||
149 | public function getCode() |
||
153 | |||
154 | /** |
||
155 | * Get the card type if available. |
||
156 | * |
||
157 | * @return null|string |
||
158 | */ |
||
159 | public function getCardType() |
||
163 | } |
||
164 |