@@ -131,7 +131,7 @@ |
||
| 131 | 131 | { |
| 132 | 132 | $output = ''; |
| 133 | 133 | $output .= '<table summary="Authorize.Net Response" id="authnet-response">'."\n"; |
| 134 | - $output .= '<tr>'."\n\t\t" . '<th colspan="2"><b>Response JSON</b></th>'."\n".'</tr>'."\n"; |
|
| 134 | + $output .= '<tr>'."\n\t\t".'<th colspan="2"><b>Response JSON</b></th>'."\n".'</tr>'."\n"; |
|
| 135 | 135 | $output .= '<tr><td colspan="2"><pre>'."\n"; |
| 136 | 136 | $output .= $this->responseJson."\n"; |
| 137 | 137 | $output .= '</pre></td></tr>'."\n"; |
@@ -179,11 +179,9 @@ |
||
| 179 | 179 | { |
| 180 | 180 | if ($server === static::USE_PRODUCTION_SERVER) { |
| 181 | 181 | $url = 'https://api.authorize.net/rest/v1/'; |
| 182 | - } |
|
| 183 | - else if ($server === static::USE_DEVELOPMENT_SERVER) { |
|
| 182 | + } else if ($server === static::USE_DEVELOPMENT_SERVER) { |
|
| 184 | 183 | $url = 'https://apitest.authorize.net/rest/v1/'; |
| 185 | - } |
|
| 186 | - else { |
|
| 184 | + } else { |
|
| 187 | 185 | throw new AuthnetInvalidServerException('You did not provide a valid server.'); |
| 188 | 186 | } |
| 189 | 187 | return $url; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $output .= '<tr>'."\n\t\t".'<th colspan="2"><b>Class Parameters</b></th>'."\n".'</tr>'."\n"; |
| 110 | 110 | $output .= '<tr>'."\n\t\t".'<td><b>API Login ID</b></td><td>'.$this->login.'</td>'."\n".'</tr>'."\n"; |
| 111 | 111 | $output .= '<tr>'."\n\t\t".'<td><b>Transaction Key</b></td><td>'.$this->transactionKey.'</td>'."\n".'</tr>'."\n"; |
| 112 | - $output .= '<tr>'."\n\t\t".'<td><b>Authnet Server URL</b></td><td>'.$this->url . '</td>'."\n".'</tr>'."\n"; |
|
| 112 | + $output .= '<tr>'."\n\t\t".'<td><b>Authnet Server URL</b></td><td>'.$this->url.'</td>'."\n".'</tr>'."\n"; |
|
| 113 | 113 | $output .= '<tr>'."\n\t\t".'<th colspan="2"><b>Request JSON</b></th>'."\n".'</tr>'."\n"; |
| 114 | 114 | if (!empty($this->requestJson)) { |
| 115 | 115 | $output .= '<tr><td colspan="2"><pre>'."\n"; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | { |
| 172 | 172 | $this->processor->post($this->url, $this->requestJson); |
| 173 | 173 | |
| 174 | - if(!$this->processor->error) { |
|
| 174 | + if (!$this->processor->error) { |
|
| 175 | 175 | return $this->processor->response; |
| 176 | 176 | } |
| 177 | 177 | $error_message = null; |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | { |
| 57 | 57 | $output = ''; |
| 58 | 58 | $output .= '<table summary="Authorize.Net Webhooks Response" id="authnet-response">'."\n"; |
| 59 | - $output .= '<tr>' . "\n\t\t" . '<th colspan="2"><b>Response JSON</b></th>'."\n".'</tr>'."\n"; |
|
| 59 | + $output .= '<tr>'."\n\t\t".'<th colspan="2"><b>Response JSON</b></th>'."\n".'</tr>'."\n"; |
|
| 60 | 60 | $output .= '<tr><td colspan="2"><pre>'."\n"; |
| 61 | 61 | $output .= $this->responseJson."\n"; |
| 62 | 62 | $output .= '</pre></td></tr>'."\n"; |
@@ -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; |
@@ -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>'; |