Passed
Pull Request — master (#26)
by
unknown
10:59 queued 05:54
created
Model/Ui/ConfigProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
         foreach ($items as $key => $item) {
108 108
             $promotedProduct = $this->isPromoted($item);
109 109
             if ($promotedProduct == 'true') {
110
-                $promotedAmount+=$item->getPrice()*$item->getQty();
110
+                $promotedAmount += $item->getPrice() * $item->getQty();
111 111
             }
112 112
         }
113 113
 
Please login to merge, or discard this patch.
Controller/Notify/IndexV2.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
             $this->checkPagantisStatus(array('AUTHORIZED'));
270 270
         } catch (\Exception $e) {
271 271
             $this->getMagentoOrderId();
272
-            if ($this->magentoOrderId!='') {
272
+            if ($this->magentoOrderId != '') {
273 273
                 throw new AlreadyProcessedException();
274 274
             } else {
275 275
                 throw new WrongStatusException($this->pagantisOrder->getStatus());
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
      */
283 283
     private function checkMerchantOrderStatus()
284 284
     {
285
-        if ($this->quote->getIsActive()=='0') {
285
+        if ($this->quote->getIsActive() == '0') {
286 286
             $this->getMagentoOrderId();
287 287
             throw new AlreadyProcessedException();
288 288
         }
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
             $tableName    = $this->dbObject->getTableName(self::CONCURRENCY_TABLE);
405 405
             if ($mode == false) {
406 406
                 $dbConnection->delete($tableName, "timestamp<".(time() - 5));
407
-            } elseif ($this->quoteId!='') {
407
+            } elseif ($this->quoteId != '') {
408 408
                 $dbConnection->delete($tableName, "id=".$this->quoteId);
409 409
             }
410 410
         } catch (Exception $exception) {
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
460 460
             $dbConnection = $this->dbObject->getConnection();
461 461
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
462
-            $pagantisOrderId   = $this->pagantisOrderId;
462
+            $pagantisOrderId = $this->pagantisOrderId;
463 463
             $query        = "select mg_order_id from $tableName where id='$this->quoteId' and order_id='$pagantisOrderId'";
464 464
             $queryResult  = $dbConnection->fetchRow($query);
465 465
             $this->magentoOrderId = $queryResult['mg_order_id'];
@@ -484,15 +484,15 @@  discard block
 block discarded – undo
484 484
             $metadataInfo = null;
485 485
             foreach ($metadataOrder as $metadataKey => $metadataValue) {
486 486
                 if ($metadataKey == 'promotedProduct') {
487
-                    $metadataInfo.= "/Producto promocionado = $metadataValue";
487
+                    $metadataInfo .= "/Producto promocionado = $metadataValue";
488 488
                 }
489 489
             }
490 490
 
491 491
             $this->magentoOrder->addStatusHistoryComment($metadataInfo)->setIsCustomerNotified(false)->setEntityName('order')->save();
492 492
 
493
-            $comment = 'pagantisOrderId: ' . $this->pagantisOrder->getId(). ' ' .
494
-                       'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' .
495
-                       'via: '. $this->origin;
493
+            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '.
494
+                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '.
495
+                       'via: '.$this->origin;
496 496
             $this->magentoOrder->addStatusHistoryComment($comment)->setIsCustomerNotified(false)->setEntityName('order')->save();
497 497
 
498 498
             if ($this->magentoOrderId == '') {
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
513 513
             $dbConnection = $this->dbObject->getConnection();
514 514
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
515
-            $pagantisOrderId   = $this->pagantisOrder->getId();
515
+            $pagantisOrderId = $this->pagantisOrder->getId();
516 516
             $dbConnection->update(
517 517
                 $tableName,
518 518
                 array('mg_order_id' => $this->magentoOrderId),
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
     {
546 546
         //$returnUrl = 'checkout/#payment';
547 547
         $returnUrl = $this->_url->getUrl('checkout', ['_fragment' => 'payment']);
548
-        if ($this->magentoOrderId!='') {
548
+        if ($this->magentoOrderId != '') {
549 549
             /** @var Order $this->magentoOrder */
550 550
             $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId);
551 551
             if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) {
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
             $orderStatus    = strtolower($this->magentoOrder->getStatus());
563 563
             $acceptedStatus = array('processing', 'completed');
564 564
             if (in_array($orderStatus, $acceptedStatus)) {
565
-                if (isset($this->extraConfig['PAGANTIS_OK_URL']) &&  $this->extraConfig['PAGANTIS_OK_URL']!= '') {
565
+                if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') {
566 566
                     $returnUrl = $this->extraConfig['PAGANTIS_OK_URL'];
567 567
                 } else {
568 568
                     $returnUrl = 'checkout/onepage/success';
Please login to merge, or discard this patch.
Controller/Notify/Index.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
             $this->checkPagantisStatus(array('AUTHORIZED'));
267 267
         } catch (\Exception $e) {
268 268
             $this->getMagentoOrderId();
269
-            if ($this->magentoOrderId!='') {
269
+            if ($this->magentoOrderId != '') {
270 270
                 throw new AlreadyProcessedException();
271 271
             } else {
272 272
                 throw new WrongStatusException($this->pagantisOrder->getStatus());
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      */
280 280
     private function checkMerchantOrderStatus()
281 281
     {
282
-        if ($this->quote->getIsActive()=='0') {
282
+        if ($this->quote->getIsActive() == '0') {
283 283
             $this->getMagentoOrderId();
284 284
             throw new AlreadyProcessedException();
285 285
         }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
             $tableName    = $this->dbObject->getTableName(self::CONCURRENCY_TABLE);
402 402
             if ($mode == false) {
403 403
                 $dbConnection->delete($tableName, "timestamp<".(time() - 5));
404
-            } elseif ($this->quoteId!='') {
404
+            } elseif ($this->quoteId != '') {
405 405
                 $dbConnection->delete($tableName, "id=".$this->quoteId);
406 406
             }
407 407
         } catch (Exception $exception) {
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
457 457
             $dbConnection = $this->dbObject->getConnection();
458 458
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
459
-            $pagantisOrderId   = $this->pagantisOrderId;
459
+            $pagantisOrderId = $this->pagantisOrderId;
460 460
 
461 461
             $query        = "select mg_order_id from $tableName where id='$this->quoteId' and order_id='$pagantisOrderId'";
462 462
             $queryResult  = $dbConnection->fetchRow($query);
@@ -483,13 +483,13 @@  discard block
 block discarded – undo
483 483
             $metadataInfo = null;
484 484
             foreach ($metadataOrder as $metadataKey => $metadataValue) {
485 485
                 if ($metadataKey == 'promotedProduct') {
486
-                    $metadataInfo.= " Producto promocionado = $metadataValue //";
486
+                    $metadataInfo .= " Producto promocionado = $metadataValue //";
487 487
                 }
488 488
             }
489 489
             $this->magentoOrder->addStatusHistoryComment($metadataInfo)->setIsCustomerNotified(false)->setEntityName('order')->save();
490 490
 
491
-            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId(). ' ' .
492
-                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(). ' ' .
491
+            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '.
492
+                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '.
493 493
                        'via: '.$this->origin;
494 494
             $this->magentoOrder->addStatusHistoryComment($comment)->setIsCustomerNotified(false)->setEntityName('order')->save();
495 495
 
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
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->pagantisOrder->getId();
513
+            $pagantisOrderId = $this->pagantisOrder->getId();
514 514
             $dbConnection->update(
515 515
                 $tableName,
516 516
                 array('mg_order_id' => $this->magentoOrderId),
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
     {
544 544
         //$returnUrl = 'checkout/#payment';
545 545
         $returnUrl = $this->_url->getUrl('checkout', ['_fragment' => 'payment']);
546
-        if ($this->magentoOrderId!='') {
546
+        if ($this->magentoOrderId != '') {
547 547
             /** @var Order $this->magentoOrder */
548 548
             $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId);
549 549
             if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) {
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
             $orderStatus    = strtolower($this->magentoOrder->getStatus());
561 561
             $acceptedStatus = array('processing', 'completed');
562 562
             if (in_array($orderStatus, $acceptedStatus)) {
563
-                if (isset($this->extraConfig['PAGANTIS_OK_URL']) &&  $this->extraConfig['PAGANTIS_OK_URL']!= '') {
563
+                if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') {
564 564
                     $returnUrl = $this->extraConfig['PAGANTIS_OK_URL'];
565 565
                 } else {
566 566
                     $returnUrl = 'checkout/onepage/success';
Please login to merge, or discard this patch.