| @@ -195,7 +195,7 @@ discard block | ||
| 195 | 195 | private function getPagantisOrderId() | 
| 196 | 196 |      { | 
| 197 | 197 |          try { | 
| 198 | - $this->pagantisOrderId= Db::getInstance()->getValue( | |
| 198 | + $this->pagantisOrderId = Db::getInstance()->getValue( | |
| 199 | 199 | 'select order_id from '._DB_PREFIX_.'pagantis_order where id = '.$this->merchantOrderId | 
| 200 | 200 | ); | 
| 201 | 201 | |
| @@ -277,14 +277,14 @@ discard block | ||
| 277 | 277 |          $merchantAmount = explode('.', explode(',', $merchantAmount)[0])[0]; | 
| 278 | 278 |          if ($totalAmount != $merchantAmount) { | 
| 279 | 279 |              try { | 
| 280 | - $psTotalAmount = substr_replace($merchantAmount, '.', (strlen($merchantAmount) -2), 0); | |
| 280 | + $psTotalAmount = substr_replace($merchantAmount, '.', (strlen($merchantAmount) - 2), 0); | |
| 281 | 281 | |
| 282 | 282 | $pgTotalAmountInCents = (string) $this->pagantisOrder->getShoppingCart()->getTotalAmount(); | 
| 283 | - $pgTotalAmount = substr_replace($pgTotalAmountInCents, '.', (strlen($pgTotalAmountInCents) -2), 0); | |
| 283 | + $pgTotalAmount = substr_replace($pgTotalAmountInCents, '.', (strlen($pgTotalAmountInCents) - 2), 0); | |
| 284 | 284 | |
| 285 | - $this->amountMismatchError = '. Amount mismatch in PrestaShop Order #'. $this->merchantOrderId . | |
| 286 | - ' compared with Pagantis Order: ' . $this->pagantisOrderId . '. The order in PrestaShop has an amount'. | |
| 287 | - ' of ' . $psTotalAmount . ' and in Pagantis ' . $pgTotalAmount . ' PLEASE REVIEW THE ORDER'; | |
| 285 | + $this->amountMismatchError = '. Amount mismatch in PrestaShop Order #'.$this->merchantOrderId. | |
| 286 | + ' compared with Pagantis Order: '.$this->pagantisOrderId.'. The order in PrestaShop has an amount'. | |
| 287 | + ' of '.$psTotalAmount.' and in Pagantis '.$pgTotalAmount.' PLEASE REVIEW THE ORDER'; | |
| 288 | 288 | $this->saveLog(array( | 
| 289 | 289 | 'message' => $this->amountMismatchError | 
| 290 | 290 | )); | 
| @@ -307,8 +307,8 @@ discard block | ||
| 307 | 307 |                  Configuration::get('PS_OS_PAYMENT'), | 
| 308 | 308 | $this->merchantOrder->getOrderTotal(true), | 
| 309 | 309 | $this->module->displayName, | 
| 310 | - 'pagantisOrderId: ' . $this->pagantisOrder->getId() . ' ' . | |
| 311 | - 'pagantisOrderStatus: '. $this->pagantisOrder->getStatus() . | |
| 310 | + 'pagantisOrderId: '.$this->pagantisOrder->getId().' '. | |
| 311 | + 'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(). | |
| 312 | 312 | $this->amountMismatchError, | 
| 313 | 313 |                  array('transaction_id' => $this->pagantisOrderId), | 
| 314 | 314 | null, | 
| @@ -331,9 +331,9 @@ discard block | ||
| 331 | 331 | $this->orderClient->confirmOrder($this->pagantisOrderId); | 
| 332 | 332 |              try { | 
| 333 | 333 | $mode = ($_SERVER['REQUEST_METHOD'] == 'POST') ? 'NOTIFICATION' : 'REDIRECTION'; | 
| 334 | - $message = 'Order CONFIRMED. The order was confirmed by a ' . $mode . | |
| 335 | - '. Pagantis OrderId=' . $this->pagantisOrderId . | |
| 336 | - '. Prestashop OrderId=' . $this->merchantOrderId; | |
| 334 | + $message = 'Order CONFIRMED. The order was confirmed by a '.$mode. | |
| 335 | + '. Pagantis OrderId='.$this->pagantisOrderId. | |
| 336 | + '. Prestashop OrderId='.$this->merchantOrderId; | |
| 337 | 337 | $this->saveLog(array( | 
| 338 | 338 | 'message' => $message | 
| 339 | 339 | )); | 
| @@ -374,7 +374,7 @@ discard block | ||
| 374 | 374 | $this->jsonResponse->setPagantisOrderId($this->pagantisOrderId); | 
| 375 | 375 | return $this->finishProcess(false); | 
| 376 | 376 | } | 
| 377 | - throw new ConcurrencyException();: | |
| 377 | + throw new ConcurrencyException(); : | |
| 378 | 378 | }; | 
| 379 | 379 |          } catch (\Exception $exception) { | 
| 380 | 380 | throw new ConcurrencyException(); | 
| @@ -389,7 +389,7 @@ discard block | ||
| 389 | 389 | protected function unblockConcurrency() | 
| 390 | 390 |      { | 
| 391 | 391 |          try { | 
| 392 | -            Db::getInstance()->delete('pagantis_cart_process', 'timestamp < ' . (time() - 6)); | |
| 392 | +            Db::getInstance()->delete('pagantis_cart_process', 'timestamp < '.(time() - 6)); | |
| 393 | 393 |          } catch (\Exception $exception) { | 
| 394 | 394 | throw new ConcurrencyException(); | 
| 395 | 395 | } | 
| @@ -433,9 +433,9 @@ discard block | ||
| 433 | 433 | 'id_cart' => $this->merchantOrderId, | 
| 434 | 434 | 'key' => $this->config['secureKey'], | 
| 435 | 435 | 'id_module' => $this->module->id, | 
| 436 | - 'id_order' => ($this->pagantisOrder)?$this->pagantisOrder->getId(): null, | |
| 436 | + 'id_order' => ($this->pagantisOrder) ? $this->pagantisOrder->getId() : null, | |
| 437 | 437 | ); | 
| 438 | - $url = ($error)? $this->config['urlKO'] : $this->config['urlOK']; | |
| 438 | + $url = ($error) ? $this->config['urlKO'] : $this->config['urlOK']; | |
| 439 | 439 | return $this->redirect($url, $parameters); | 
| 440 | 440 | } | 
| 441 | 441 | } |