@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $this->origin = ($_SERVER['REQUEST_METHOD'] == 'POST') ? 'Notification' : 'Order'; |
150 | 150 | |
151 | 151 | // Fix for Magento2.3 adding isAjax to the request params |
152 | - if(interface_exists("\Magento\Framework\App\CsrfAwareActionInterface")) { |
|
152 | + if (interface_exists("\Magento\Framework\App\CsrfAwareActionInterface")) { |
|
153 | 153 | $request = $this->getRequest(); |
154 | 154 | if ($request instanceof Http && $request->isPost()) { |
155 | 155 | $request->setParam('isAjax', true); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $this->checkPagantisStatus(array('AUTHORIZED')); |
285 | 285 | } catch (\Exception $e) { |
286 | 286 | $this->getMagentoOrderId(); |
287 | - if ($this->magentoOrderId!='') { |
|
287 | + if ($this->magentoOrderId != '') { |
|
288 | 288 | throw new AlreadyProcessedException(); |
289 | 289 | } else { |
290 | 290 | throw new WrongStatusException($this->pagantisOrder->getStatus()); |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | private function checkMerchantOrderStatus() |
299 | 299 | { |
300 | - if ($this->quote->getIsActive()=='0') { |
|
300 | + if ($this->quote->getIsActive() == '0') { |
|
301 | 301 | $this->getMagentoOrderId(); |
302 | 302 | throw new AlreadyProcessedException(); |
303 | 303 | } |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | $tableName = $this->dbObject->getTableName(self::CONCURRENCY_TABLE); |
430 | 430 | if ($mode == false) { |
431 | 431 | $dbConnection->delete($tableName, "timestamp<".(time() - 5)); |
432 | - } elseif ($this->quoteId!='') { |
|
432 | + } elseif ($this->quoteId != '') { |
|
433 | 433 | $dbConnection->delete($tableName, "id=".$this->quoteId); |
434 | 434 | } |
435 | 435 | } catch (Exception $exception) { |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | sleep($expirationSec + 1); |
466 | 466 | } |
467 | 467 | |
468 | - $logMessage = sprintf( |
|
468 | + $logMessage = sprintf( |
|
469 | 469 | "User waiting %s seconds, default seconds %s, bd time to expire %s seconds", |
470 | 470 | $expirationSec, |
471 | 471 | self::CONCURRENCY_TIMEOUT, |
@@ -510,14 +510,14 @@ discard block |
||
510 | 510 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
511 | 511 | $dbConnection = $this->dbObject->getConnection(); |
512 | 512 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
513 | - $pagantisOrderId = $this->pagantisOrderId; |
|
513 | + $pagantisOrderId = $this->pagantisOrderId; |
|
514 | 514 | $query = sprintf( |
515 | 515 | "select mg_order_id from %s where id='%s' and order_id='%s'", |
516 | 516 | $tableName, |
517 | 517 | $this->quoteId, |
518 | 518 | $pagantisOrderId |
519 | 519 | ); |
520 | - $queryResult = $dbConnection->fetchRow($query); |
|
520 | + $queryResult = $dbConnection->fetchRow($query); |
|
521 | 521 | $this->magentoOrderId = $queryResult['mg_order_id']; |
522 | 522 | } catch (\Exception $e) { |
523 | 523 | throw new UnknownException($e->getMessage()); |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | $metadataInfo = null; |
541 | 541 | foreach ($metadataOrder as $metadataKey => $metadataValue) { |
542 | 542 | if ($metadataKey == 'promotedProduct') { |
543 | - $metadataInfo.= "/Producto promocionado = $metadataValue"; |
|
543 | + $metadataInfo .= "/Producto promocionado = $metadataValue"; |
|
544 | 544 | } |
545 | 545 | } |
546 | 546 | |
@@ -549,9 +549,9 @@ discard block |
||
549 | 549 | ->setEntityName('order') |
550 | 550 | ->save(); |
551 | 551 | |
552 | - $comment = 'pagantisOrderId: ' . $this->pagantisOrder->getId(). ' ' . |
|
553 | - 'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' . |
|
554 | - 'via: '. $this->origin; |
|
552 | + $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '. |
|
553 | + 'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '. |
|
554 | + 'via: '.$this->origin; |
|
555 | 555 | $this->magentoOrder->addStatusHistoryComment($comment) |
556 | 556 | ->setIsCustomerNotified(false) |
557 | 557 | ->setEntityName('order') |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
575 | 575 | $dbConnection = $this->dbObject->getConnection(); |
576 | 576 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
577 | - $pagantisOrderId = $this->pagantisOrder->getId(); |
|
577 | + $pagantisOrderId = $this->pagantisOrder->getId(); |
|
578 | 578 | $dbConnection->update( |
579 | 579 | $tableName, |
580 | 580 | array('mg_order_id' => $this->magentoOrderId), |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | { |
608 | 608 | //$returnUrl = 'checkout/#payment'; |
609 | 609 | $returnUrl = $this->_url->getUrl('checkout', ['_fragment' => 'payment']); |
610 | - if ($this->magentoOrderId!='') { |
|
610 | + if ($this->magentoOrderId != '') { |
|
611 | 611 | /** @var Order $this->magentoOrder */ |
612 | 612 | $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId); |
613 | 613 | if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) { |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | $orderStatus = strtolower($this->magentoOrder->getStatus()); |
625 | 625 | $acceptedStatus = array('processing', 'completed'); |
626 | 626 | if (in_array($orderStatus, $acceptedStatus)) { |
627 | - if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL']!= '') { |
|
627 | + if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') { |
|
628 | 628 | $returnUrl = $this->extraConfig['PAGANTIS_OK_URL']; |
629 | 629 | } else { |
630 | 630 | $returnUrl = 'checkout/onepage/success'; |