@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | /** |
83 | 83 | * Outputs the endpoint URL and request JSON in a human readable format |
84 | 84 | * |
85 | - * @return array list of event types |
|
85 | + * @return AuthnetWebhooksResponse list of event types |
|
86 | 86 | */ |
87 | 87 | public function getEventTypes() |
88 | 88 | { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * |
102 | 102 | * @throws \JohnConde\Authnet\AuthnetInvalidParameterException |
103 | 103 | * |
104 | - * @return array list of event types |
|
104 | + * @return AuthnetWebhooksResponse list of event types |
|
105 | 105 | */ |
106 | 106 | public function createWebhooks(Array $webhooks, $webhookUrl, $status = 'active') |
107 | 107 | { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | /** |
136 | 136 | * List all of your webhooks |
137 | 137 | * |
138 | - * @return array list of event types |
|
138 | + * @return AuthnetWebhooksResponse list of event types |
|
139 | 139 | */ |
140 | 140 | public function getWebhooks() |
141 | 141 | { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @param string $webhookId Webhook ID to be retrieved |
152 | 152 | * |
153 | - * @return array list of event types |
|
153 | + * @return AuthnetWebhooksResponse list of event types |
|
154 | 154 | */ |
155 | 155 | public function getWebhook($webhookId) |
156 | 156 | { |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * |
171 | 171 | * @throws \JohnConde\Authnet\AuthnetInvalidParameterException |
172 | 172 | * |
173 | - * @return array list of event types |
|
173 | + * @return AuthnetWebhooksResponse list of event types |
|
174 | 174 | */ |
175 | 175 | public function updateWebhook($webhookId, $webhookUrl, Array $eventTypes, $status = 'active') |
176 | 176 | { |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * @param integer $limit Default: 1000 |
207 | 207 | * @param integer $offset Default: 0 |
208 | 208 | * |
209 | - * @return array list of event types |
|
209 | + * @return AuthnetWebhooksResponse list of event types |
|
210 | 210 | */ |
211 | 211 | public function getNotificationHistory($limit = 1000, $offset = 0) |
212 | 212 | { |
@@ -245,11 +245,12 @@ discard block |
||
245 | 245 | /** |
246 | 246 | * Make GET request via Curl |
247 | 247 | * |
248 | - * @param object $url |
|
248 | + * @param string $url |
|
249 | 249 | * |
250 | 250 | * @throws \JohnConde\Authnet\AuthnetCurlException |
251 | 251 | * |
252 | 252 | * @codeCoverageIgnore |
253 | + * @return string |
|
253 | 254 | */ |
254 | 255 | private function get($url) { |
255 | 256 | $this->processor->get($url); |
@@ -259,12 +260,13 @@ discard block |
||
259 | 260 | /** |
260 | 261 | * Make POST request via Curl |
261 | 262 | * |
262 | - * @param object $url API endpoint |
|
263 | - * @param object $request JSON request payload |
|
263 | + * @param string $url API endpoint |
|
264 | + * @param string $request JSON request payload |
|
264 | 265 | * |
265 | 266 | * @throws \JohnConde\Authnet\AuthnetCurlException |
266 | 267 | * |
267 | 268 | * @codeCoverageIgnore |
269 | + * @return string |
|
268 | 270 | */ |
269 | 271 | private function post($url, $request) { |
270 | 272 | $this->processor->post($url, $request); |
@@ -274,12 +276,13 @@ discard block |
||
274 | 276 | /** |
275 | 277 | * Make PUT request via Curl |
276 | 278 | * |
277 | - * @param object $url API endpoint |
|
278 | - * @param object $request JSON request payload |
|
279 | + * @param string $url API endpoint |
|
280 | + * @param string $request JSON request payload |
|
279 | 281 | * |
280 | 282 | * @throws \JohnConde\Authnet\AuthnetCurlException |
281 | 283 | * |
282 | 284 | * @codeCoverageIgnore |
285 | + * @return string |
|
283 | 286 | */ |
284 | 287 | private function put($url, $request) { |
285 | 288 | $this->processor->put($url, $request, true); |
@@ -289,7 +292,7 @@ discard block |
||
289 | 292 | /** |
290 | 293 | * Make DELETE request via Curl |
291 | 294 | * |
292 | - * @param object $url API endpoint |
|
295 | + * @param string $url API endpoint |
|
293 | 296 | * |
294 | 297 | * @throws \JohnConde\Authnet\AuthnetCurlException |
295 | 298 | * |
@@ -303,7 +306,7 @@ discard block |
||
303 | 306 | /** |
304 | 307 | * Sets the handler to be used to handle our API call. Mainly used for unit testing as Curl is used by default. |
305 | 308 | * |
306 | - * @param object $processor |
|
309 | + * @param \Curl\Curl $processor |
|
307 | 310 | */ |
308 | 311 | public function setProcessHandler($processor) |
309 | 312 | { |
@@ -62,17 +62,17 @@ discard block |
||
62 | 62 | public function __toString() |
63 | 63 | { |
64 | 64 | $output = ''; |
65 | - $output .= '<table summary="Authorize.Net Request" id="authnet-request">' . "\n"; |
|
66 | - $output .= '<tr>' . "\n\t\t" . '<th colspan="2"><b>Class Parameters</b></th>' . "\n" . '</tr>' . "\n"; |
|
67 | - $output .= '<tr>' . "\n\t\t" . '<td><b>Authnet Server URL</b></td><td>' . $this->url . '</td>' . "\n" . '</tr>' . "\n"; |
|
68 | - $output .= '<tr>' . "\n\t\t" . '<th colspan="2"><b>Request JSON</b></th>' . "\n" . '</tr>' . "\n"; |
|
65 | + $output .= '<table summary="Authorize.Net Request" id="authnet-request">'."\n"; |
|
66 | + $output .= '<tr>'."\n\t\t".'<th colspan="2"><b>Class Parameters</b></th>'."\n".'</tr>'."\n"; |
|
67 | + $output .= '<tr>'."\n\t\t".'<td><b>Authnet Server URL</b></td><td>'.$this->url.'</td>'."\n".'</tr>'."\n"; |
|
68 | + $output .= '<tr>'."\n\t\t".'<th colspan="2"><b>Request JSON</b></th>'."\n".'</tr>'."\n"; |
|
69 | 69 | if (!empty($this->requestJson)) { |
70 | - $output .= '<tr><td colspan="2"><pre>' . "\n"; |
|
71 | - $output .= $this->requestJson . "\n"; |
|
72 | - $output .= '</pre></td></tr>' . "\n"; |
|
70 | + $output .= '<tr><td colspan="2"><pre>'."\n"; |
|
71 | + $output .= $this->requestJson."\n"; |
|
72 | + $output .= '</pre></td></tr>'."\n"; |
|
73 | 73 | } |
74 | 74 | else { |
75 | - $output .= '<tr><td colspan="2" style="text-align: center;"><pre>N/A</pre></td></tr>' . "\n"; |
|
75 | + $output .= '<tr><td colspan="2" style="text-align: center;"><pre>N/A</pre></td></tr>'."\n"; |
|
76 | 76 | } |
77 | 77 | $output .= '</table>'; |
78 | 78 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | private function handleResponse() |
228 | 228 | { |
229 | - if(!$this->processor->error) { |
|
229 | + if (!$this->processor->error) { |
|
230 | 230 | return $this->processor->response; |
231 | 231 | } |
232 | 232 | $error_message = null; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $error_message = sprintf('(%u) %s: %s', $response->status, $response->reason, $response->message); |
240 | 240 | } |
241 | 241 | } |
242 | - throw new AuthnetCurlException('Connection error: ' . $error_message . ' (' . $error_code . ')'); |
|
242 | + throw new AuthnetCurlException('Connection error: '.$error_message.' ('.$error_code.')'); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | /** |
@@ -70,8 +70,7 @@ |
||
70 | 70 | $output .= '<tr><td colspan="2"><pre>' . "\n"; |
71 | 71 | $output .= $this->requestJson . "\n"; |
72 | 72 | $output .= '</pre></td></tr>' . "\n"; |
73 | - } |
|
74 | - else { |
|
73 | + } else { |
|
75 | 74 | $output .= '<tr><td colspan="2" style="text-align: center;"><pre>N/A</pre></td></tr>' . "\n"; |
76 | 75 | } |
77 | 76 | $output .= '</table>'; |
@@ -69,15 +69,15 @@ |
||
69 | 69 | public function __toString() |
70 | 70 | { |
71 | 71 | $output = ''; |
72 | - $output .= '<table summary="Authorize.Net Webhook" id="authnet-webhook">' . "\n"; |
|
73 | - $output .= '<tr>' . "\n\t\t" . '<th colspan="2"><b>Response HTTP Headers</b></th>' . "\n" . '</tr>' . "\n"; |
|
74 | - $output .= '<tr><td colspan="2"><pre>' . "\n"; |
|
75 | - $output .= var_export($this->headers) . "\n"; |
|
76 | - $output .= '</pre></td></tr>' . "\n"; |
|
77 | - $output .= '<tr>' . "\n\t\t" . '<th colspan="2"><b>Response JSON</b></th>' . "\n" . '</tr>' . "\n"; |
|
78 | - $output .= '<tr><td colspan="2"><pre>' . "\n"; |
|
79 | - $output .= $this->webhookJson . "\n"; |
|
80 | - $output .= '</pre></td></tr>' . "\n"; |
|
72 | + $output .= '<table summary="Authorize.Net Webhook" id="authnet-webhook">'."\n"; |
|
73 | + $output .= '<tr>'."\n\t\t".'<th colspan="2"><b>Response HTTP Headers</b></th>'."\n".'</tr>'."\n"; |
|
74 | + $output .= '<tr><td colspan="2"><pre>'."\n"; |
|
75 | + $output .= var_export($this->headers)."\n"; |
|
76 | + $output .= '</pre></td></tr>'."\n"; |
|
77 | + $output .= '<tr>'."\n\t\t".'<th colspan="2"><b>Response JSON</b></th>'."\n".'</tr>'."\n"; |
|
78 | + $output .= '<tr><td colspan="2"><pre>'."\n"; |
|
79 | + $output .= $this->webhookJson."\n"; |
|
80 | + $output .= '</pre></td></tr>'."\n"; |
|
81 | 81 | $output .= '</table>'; |
82 | 82 | |
83 | 83 | return $output; |