@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | $response = $request->send(); |
107 | 107 | |
108 | 108 | if ($response->hasError()) { |
109 | - $this->logger->debug('Token response status code was ' . $response->getError()->getCode()); |
|
110 | - $this->logger->debug("Token request ended in failure: " . var_export($response, true)); |
|
109 | + $this->logger->debug('Token response status code was '.$response->getError()->getCode()); |
|
110 | + $this->logger->debug("Token request ended in failure: ".var_export($response, true)); |
|
111 | 111 | $this->logger->error("Gateway authorization failed. Check credentials."); |
112 | 112 | |
113 | 113 | return null; |
114 | 114 | } |
115 | 115 | |
116 | - $this->logger->debug("Token request was a success: " . $response->getContent()); |
|
116 | + $this->logger->debug("Token request was a success: ".$response->getContent()); |
|
117 | 117 | $token = json_decode($response->getContent()); |
118 | 118 | |
119 | 119 | return $token->access_token; |
@@ -132,18 +132,18 @@ discard block |
||
132 | 132 | $sale_request = $sale->serialize($merchant_id, $terminal_id); |
133 | 133 | $body = json_encode($sale_request); |
134 | 134 | |
135 | - $this->logger->info("Starting transaction for $" . $sale->getTotal()); |
|
135 | + $this->logger->info("Starting transaction for $".$sale->getTotal()); |
|
136 | 136 | |
137 | - $request = new Request($this->gateway_url . 'api/v1/transactions/sale'); |
|
137 | + $request = new Request($this->gateway_url.'api/v1/transactions/sale'); |
|
138 | 138 | $request->getOptions() |
139 | 139 | ->set(CURLOPT_RETURNTRANSFER, true) |
140 | 140 | ->set(CURLOPT_POST, true) |
141 | 141 | ->set(CURLOPT_POSTFIELDS, $body) |
142 | 142 | ->set(CURLOPT_HTTPHEADER, array( |
143 | 143 | 'Content-Type: application/json', |
144 | - 'Content-Length: ' . strlen($body), |
|
144 | + 'Content-Length: '.strlen($body), |
|
145 | 145 | 'Accept: application/json', |
146 | - 'Authorization: Bearer ' . $access_token |
|
146 | + 'Authorization: Bearer '.$access_token |
|
147 | 147 | )); |
148 | 148 | $response = $request->send(); |
149 | 149 | |
@@ -154,14 +154,14 @@ discard block |
||
154 | 154 | if ($sale_response->success) { |
155 | 155 | $transaction_id = $sale_response->result->transaction_id; |
156 | 156 | |
157 | - $this->logger->info('Payment completed. Transaction ID: ' . $transaction_id); |
|
157 | + $this->logger->info('Payment completed. Transaction ID: '.$transaction_id); |
|
158 | 158 | |
159 | 159 | return new TransactionResult(true, $transaction_id); |
160 | 160 | } else { |
161 | 161 | $error_message = $sale_response->error->message; |
162 | 162 | $code = $sale_response->error->code; |
163 | 163 | |
164 | - $this->logger->debug("Sale response: " . var_export($sale_response, true)); |
|
164 | + $this->logger->debug("Sale response: ".var_export($sale_response, true)); |
|
165 | 165 | $this->logger->error("Payment failed."); |
166 | 166 | |
167 | 167 | return new TransactionResult(false, null, $error_message, $code); |
@@ -207,18 +207,18 @@ discard block |
||
207 | 207 | |
208 | 208 | $body = json_encode($void_request); |
209 | 209 | |
210 | - $this->logger->info("Starting void transaction for transaction# " . $transaction_id); |
|
210 | + $this->logger->info("Starting void transaction for transaction# ".$transaction_id); |
|
211 | 211 | |
212 | - $request = new Request($this->gateway_url . 'api/v1/transactions/void'); |
|
212 | + $request = new Request($this->gateway_url.'api/v1/transactions/void'); |
|
213 | 213 | $request->getOptions() |
214 | 214 | ->set(CURLOPT_RETURNTRANSFER, true) |
215 | 215 | ->set(CURLOPT_POST, true) |
216 | 216 | ->set(CURLOPT_POSTFIELDS, $body) |
217 | 217 | ->set(CURLOPT_HTTPHEADER, array( |
218 | 218 | 'Content-Type: application/json', |
219 | - 'Content-Length: ' . strlen($body), |
|
219 | + 'Content-Length: '.strlen($body), |
|
220 | 220 | 'Accept: application/json', |
221 | - 'Authorization: Bearer ' . $access_token |
|
221 | + 'Authorization: Bearer '.$access_token |
|
222 | 222 | )); |
223 | 223 | $response = $request->send(); |
224 | 224 | |
@@ -229,14 +229,14 @@ discard block |
||
229 | 229 | if ($void_response->success) { |
230 | 230 | $transaction_id = $void_response->result->transaction_id; |
231 | 231 | |
232 | - $this->logger->info('Void completed. Transaction ID: ' . $transaction_id); |
|
232 | + $this->logger->info('Void completed. Transaction ID: '.$transaction_id); |
|
233 | 233 | |
234 | 234 | return new TransactionResult(true, $transaction_id); |
235 | 235 | } else { |
236 | 236 | $error_message = $void_response->error->message; |
237 | 237 | $code = $void_response->error->code; |
238 | 238 | |
239 | - $this->logger->debug("Void response: " . var_export($void_response, true)); |
|
239 | + $this->logger->debug("Void response: ".var_export($void_response, true)); |
|
240 | 240 | $this->logger->error("Void failed."); |
241 | 241 | |
242 | 242 | return new TransactionResult(false, null, $error_message, $code); |
@@ -285,16 +285,16 @@ discard block |
||
285 | 285 | |
286 | 286 | $this->logger->info("Starting request for tokenization"); |
287 | 287 | |
288 | - $request = new Request($this->gateway_url . 'api/v1/transactions/tokenize'); |
|
288 | + $request = new Request($this->gateway_url.'api/v1/transactions/tokenize'); |
|
289 | 289 | $request->getOptions() |
290 | 290 | ->set(CURLOPT_RETURNTRANSFER, true) |
291 | 291 | ->set(CURLOPT_POST, true) |
292 | 292 | ->set(CURLOPT_POSTFIELDS, $body) |
293 | 293 | ->set(CURLOPT_HTTPHEADER, array( |
294 | 294 | 'Content-Type: application/json', |
295 | - 'Content-Length: ' . strlen($body), |
|
295 | + 'Content-Length: '.strlen($body), |
|
296 | 296 | 'Accept: application/json', |
297 | - 'Authorization: Bearer ' . $access_token |
|
297 | + 'Authorization: Bearer '.$access_token |
|
298 | 298 | )); |
299 | 299 | $response = $request->send(); |
300 | 300 | |
@@ -305,11 +305,11 @@ discard block |
||
305 | 305 | if ($token_response->success) { |
306 | 306 | $transaction_id = $token_response->result->transaction_id; |
307 | 307 | |
308 | - $this->logger->info('Tokenization completed. Transaction ID: ' . $transaction_id); |
|
308 | + $this->logger->info('Tokenization completed. Transaction ID: '.$transaction_id); |
|
309 | 309 | |
310 | 310 | return $token_response->result->token; |
311 | 311 | } else { |
312 | - $this->logger->debug("Tokenization response: " . var_export($token_response, true)); |
|
312 | + $this->logger->debug("Tokenization response: ".var_export($token_response, true)); |
|
313 | 313 | $this->logger->error("Tokenization failed."); |
314 | 314 | |
315 | 315 | return ''; |