@@ -67,17 +67,17 @@ |
||
67 | 67 | */ |
68 | 68 | public function __toString(): string |
69 | 69 | { |
70 | - $output = '<table id="authnet-request">' . "\n"; |
|
71 | - $output .= '<caption>Authorize.Net Request</caption>' . "\n"; |
|
72 | - $output .= '<tr><th colspan="2"><b>Class Parameters</b></th></tr>' . "\n"; |
|
73 | - $output .= '<tr><td><b>Authnet Server URL</b></td><td>' . $this->url . '</td></tr>' . "\n"; |
|
74 | - $output .= '<tr><th colspan="2"><b>Request JSON</b></th></tr>' . "\n"; |
|
70 | + $output = '<table id="authnet-request">'."\n"; |
|
71 | + $output .= '<caption>Authorize.Net Request</caption>'."\n"; |
|
72 | + $output .= '<tr><th colspan="2"><b>Class Parameters</b></th></tr>'."\n"; |
|
73 | + $output .= '<tr><td><b>Authnet Server URL</b></td><td>'.$this->url.'</td></tr>'."\n"; |
|
74 | + $output .= '<tr><th colspan="2"><b>Request JSON</b></th></tr>'."\n"; |
|
75 | 75 | if (!empty($this->requestJson)) { |
76 | - $output .= '<tr><td colspan="2"><pre>' . "\n"; |
|
77 | - $output .= $this->requestJson . "\n"; |
|
78 | - $output .= '</pre></td></tr>' . "\n"; |
|
76 | + $output .= '<tr><td colspan="2"><pre>'."\n"; |
|
77 | + $output .= $this->requestJson."\n"; |
|
78 | + $output .= '</pre></td></tr>'."\n"; |
|
79 | 79 | } else { |
80 | - $output .= '<tr><td colspan="2" style="text-align: center;"><pre>N/A</pre></td></tr>' . "\n"; |
|
80 | + $output .= '<tr><td colspan="2" style="text-align: center;"><pre>N/A</pre></td></tr>'."\n"; |
|
81 | 81 | } |
82 | 82 | $output .= '</table>'; |
83 | 83 |
@@ -58,12 +58,12 @@ |
||
58 | 58 | */ |
59 | 59 | public function __toString(): string |
60 | 60 | { |
61 | - $output = '<table id="authnet-response">' . "\n"; |
|
62 | - $output .= '<caption>Authorize.Net Webhook Response</caption>' . "\n"; |
|
63 | - $output .= '<tr><th colspan="2"><b>Webhook Response JSON</b></th></tr>' . "\n"; |
|
64 | - $output .= '<tr><td colspan="2"><pre>' . "\n"; |
|
65 | - $output .= $this->responseJson . "\n"; |
|
66 | - $output .= '</pre></td></tr>' . "\n"; |
|
61 | + $output = '<table id="authnet-response">'."\n"; |
|
62 | + $output .= '<caption>Authorize.Net Webhook Response</caption>'."\n"; |
|
63 | + $output .= '<tr><th colspan="2"><b>Webhook Response JSON</b></th></tr>'."\n"; |
|
64 | + $output .= '<tr><td colspan="2"><pre>'."\n"; |
|
65 | + $output .= $this->responseJson."\n"; |
|
66 | + $output .= '</pre></td></tr>'."\n"; |
|
67 | 67 | $output .= '</table>'; |
68 | 68 | |
69 | 69 | return $output; |
@@ -126,17 +126,17 @@ |
||
126 | 126 | */ |
127 | 127 | public function __toString() |
128 | 128 | { |
129 | - $output = '<table id="authnet-request">' . "\n"; |
|
130 | - $output .= '<caption>Authorize.Net Request</caption>' . "\n"; |
|
131 | - $output .= '<tr><th colspan="2"><b>Class Parameters</b></th></tr>' . "\n"; |
|
132 | - $output .= '<tr><td><b>API Login ID</b></td><td>' . $this->login . '</td></tr>' . "\n"; |
|
133 | - $output .= '<tr><td><b>Transaction Key</b></td><td>' . $this->transactionKey . '</td></tr>' . "\n"; |
|
134 | - $output .= '<tr><td><b>Authnet Server URL</b></td><td>' . $this->url . '</td></tr>' . "\n"; |
|
135 | - $output .= '<tr><th colspan="2"><b>Request JSON</b></th></tr>' . "\n"; |
|
129 | + $output = '<table id="authnet-request">'."\n"; |
|
130 | + $output .= '<caption>Authorize.Net Request</caption>'."\n"; |
|
131 | + $output .= '<tr><th colspan="2"><b>Class Parameters</b></th></tr>'."\n"; |
|
132 | + $output .= '<tr><td><b>API Login ID</b></td><td>'.$this->login.'</td></tr>'."\n"; |
|
133 | + $output .= '<tr><td><b>Transaction Key</b></td><td>'.$this->transactionKey.'</td></tr>'."\n"; |
|
134 | + $output .= '<tr><td><b>Authnet Server URL</b></td><td>'.$this->url.'</td></tr>'."\n"; |
|
135 | + $output .= '<tr><th colspan="2"><b>Request JSON</b></th></tr>'."\n"; |
|
136 | 136 | if (!empty($this->requestJson)) { |
137 | - $output .= '<tr><td colspan="2"><pre>' . "\n"; |
|
138 | - $output .= $this->requestJson . "\n"; |
|
139 | - $output .= '</pre></td></tr>' . "\n"; |
|
137 | + $output .= '<tr><td colspan="2"><pre>'."\n"; |
|
138 | + $output .= $this->requestJson."\n"; |
|
139 | + $output .= '</pre></td></tr>'."\n"; |
|
140 | 140 | } |
141 | 141 | $output .= '</table>'; |
142 | 142 |
@@ -129,12 +129,10 @@ discard block |
||
129 | 129 | || $this->validationDirectResponseList |
130 | 130 | || isset($this->response->validationDirectResponse) |
131 | 131 | ) { |
132 | - $response = $this->directResponse ?: |
|
133 | - $this->validationDirectResponseList ?: |
|
134 | - $this->response->validationDirectResponse; |
|
132 | + $response = $this->directResponse ?: $this->validationDirectResponseList ?: $this->response->validationDirectResponse; |
|
135 | 133 | if (is_array($response)) { |
136 | 134 | $this->transactionInfoArray = array_map( |
137 | - static function ($r) { |
|
135 | + static function($r) { |
|
138 | 136 | return new TransactionResponse($r); |
139 | 137 | }, |
140 | 138 | $response |
@@ -153,12 +151,12 @@ discard block |
||
153 | 151 | */ |
154 | 152 | public function __toString() |
155 | 153 | { |
156 | - $output = '<table id="authnet-response">' . "\n"; |
|
157 | - $output .= '<caption>Authorize.Net Response</caption>' . "\n"; |
|
158 | - $output .= '<tr><th colspan="2"><b>Response JSON</b></th></tr>' . "\n"; |
|
159 | - $output .= '<tr><td colspan="2"><pre>' . "\n"; |
|
160 | - $output .= $this->responseJson . "\n"; |
|
161 | - $output .= '</pre></td></tr>' . "\n"; |
|
154 | + $output = '<table id="authnet-response">'."\n"; |
|
155 | + $output .= '<caption>Authorize.Net Response</caption>'."\n"; |
|
156 | + $output .= '<tr><th colspan="2"><b>Response JSON</b></th></tr>'."\n"; |
|
157 | + $output .= '<tr><td colspan="2"><pre>'."\n"; |
|
158 | + $output .= $this->responseJson."\n"; |
|
159 | + $output .= '</pre></td></tr>'."\n"; |
|
162 | 160 | $output .= '</table>'; |
163 | 161 | |
164 | 162 | return $output; |
@@ -234,9 +232,9 @@ discard block |
||
234 | 232 | protected function checkTransactionStatus(int $status): bool |
235 | 233 | { |
236 | 234 | if ($this->transactionInfo instanceof TransactionResponse) { |
237 | - $match = (int)$this->transactionInfo->getTransactionResponseField('ResponseCode') === $status; |
|
235 | + $match = (int) $this->transactionInfo->getTransactionResponseField('ResponseCode') === $status; |
|
238 | 236 | } else { |
239 | - $match = (int)$this->transactionResponse->responseCode === $status; |
|
237 | + $match = (int) $this->transactionResponse->responseCode === $status; |
|
240 | 238 | } |
241 | 239 | return $match; |
242 | 240 | } |
@@ -81,16 +81,16 @@ |
||
81 | 81 | */ |
82 | 82 | public function __toString() |
83 | 83 | { |
84 | - $output = '<table id="authnet-webhook">' . "\n"; |
|
85 | - $output .= '<caption>Authorize.Net Webhook</caption>' . "\n"; |
|
86 | - $output .= '<tr><th colspan="2"><b>Response HTTP Headers</b></th></tr>' . "\n"; |
|
87 | - $output .= '<tr><td colspan="2"><pre>' . "\n"; |
|
88 | - $output .= var_export($this->headers, true) . "\n"; |
|
89 | - $output .= '</pre></td></tr>' . "\n"; |
|
90 | - $output .= '<tr><th colspan="2"><b>Response JSON</b></th></tr>' . "\n"; |
|
91 | - $output .= '<tr><td colspan="2"><pre>' . "\n"; |
|
92 | - $output .= $this->webhookJson . "\n"; |
|
93 | - $output .= '</pre></td></tr>' . "\n"; |
|
84 | + $output = '<table id="authnet-webhook">'."\n"; |
|
85 | + $output .= '<caption>Authorize.Net Webhook</caption>'."\n"; |
|
86 | + $output .= '<tr><th colspan="2"><b>Response HTTP Headers</b></th></tr>'."\n"; |
|
87 | + $output .= '<tr><td colspan="2"><pre>'."\n"; |
|
88 | + $output .= var_export($this->headers, true)."\n"; |
|
89 | + $output .= '</pre></td></tr>'."\n"; |
|
90 | + $output .= '<tr><th colspan="2"><b>Response JSON</b></th></tr>'."\n"; |
|
91 | + $output .= '<tr><td colspan="2"><pre>'."\n"; |
|
92 | + $output .= $this->webhookJson."\n"; |
|
93 | + $output .= '</pre></td></tr>'."\n"; |
|
94 | 94 | $output .= '</table>'; |
95 | 95 | |
96 | 96 | return $output; |