Passed
Pull Request — master (#33)
by
unknown
04:28
created
Controller/Notify/Index.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -531,17 +531,17 @@
 block discarded – undo
531 531
             }
532 532
 
533 533
             $this->magentoOrder->addStatusHistoryComment($metadataInfo)
534
-                               ->setIsCustomerNotified(false)
535
-                               ->setEntityName('order')
536
-                               ->save();
534
+                                ->setIsCustomerNotified(false)
535
+                                ->setEntityName('order')
536
+                                ->save();
537 537
 
538 538
             $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId(). ' ' .
539
-                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(). ' ' .
540
-                       'via: '.$this->origin;
539
+                        'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(). ' ' .
540
+                        'via: '.$this->origin;
541 541
             $this->magentoOrder->addStatusHistoryComment($comment)
542
-                               ->setIsCustomerNotified(false)
543
-                               ->setEntityName('order')
544
-                               ->save();
542
+                                ->setIsCustomerNotified(false)
543
+                                ->setEntityName('order')
544
+                                ->save();
545 545
 
546 546
             if ($this->magentoOrderId == '') {
547 547
                 throw new UnknownException('Order can not be saved');
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
             $this->checkPagantisStatus(array('AUTHORIZED'));
274 274
         } catch (\Exception $e) {
275 275
             $this->getMagentoOrderId();
276
-            if ($this->magentoOrderId!='') {
276
+            if ($this->magentoOrderId != '') {
277 277
                 throw new AlreadyProcessedException();
278 278
             } else {
279 279
                 throw new WrongStatusException($this->pagantisOrder->getStatus());
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      */
287 287
     private function checkMerchantOrderStatus()
288 288
     {
289
-        if ($this->quote->getIsActive()=='0') {
289
+        if ($this->quote->getIsActive() == '0') {
290 290
             $this->getMagentoOrderId();
291 291
             throw new AlreadyProcessedException();
292 292
         }
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
             $tableName    = $this->dbObject->getTableName(self::CONCURRENCY_TABLE);
419 419
             if ($mode == false) {
420 420
                 $dbConnection->delete($tableName, "timestamp<".(time() - 5));
421
-            } elseif ($this->quoteId!='') {
421
+            } elseif ($this->quoteId != '') {
422 422
                 $dbConnection->delete($tableName, "id=".$this->quoteId);
423 423
             }
424 424
         } catch (Exception $exception) {
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
                     sleep($expirationSec + 1);
455 455
                 }
456 456
 
457
-                $logMessage  = sprintf(
457
+                $logMessage = sprintf(
458 458
                     "User waiting %s seconds, default seconds %s, bd time to expire %s seconds",
459 459
                     $expirationSec,
460 460
                     self::CONCURRENCY_TIMEOUT,
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
500 500
             $dbConnection = $this->dbObject->getConnection();
501 501
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
502
-            $pagantisOrderId   = $this->pagantisOrderId;
502
+            $pagantisOrderId = $this->pagantisOrderId;
503 503
 
504 504
             $query        = "select mg_order_id from $tableName where id='$this->quoteId' and order_id='$pagantisOrderId'";
505 505
             $queryResult  = $dbConnection->fetchRow($query);
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
             $metadataInfo = null;
527 527
             foreach ($metadataOrder as $metadataKey => $metadataValue) {
528 528
                 if ($metadataKey == 'promotedProduct') {
529
-                    $metadataInfo.= " Producto promocionado = $metadataValue //";
529
+                    $metadataInfo .= " Producto promocionado = $metadataValue //";
530 530
                 }
531 531
             }
532 532
 
@@ -535,8 +535,8 @@  discard block
 block discarded – undo
535 535
                                ->setEntityName('order')
536 536
                                ->save();
537 537
 
538
-            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId(). ' ' .
539
-                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(). ' ' .
538
+            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '.
539
+                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '.
540 540
                        'via: '.$this->origin;
541 541
             $this->magentoOrder->addStatusHistoryComment($comment)
542 542
                                ->setIsCustomerNotified(false)
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
561 561
             $dbConnection = $this->dbObject->getConnection();
562 562
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
563
-            $pagantisOrderId   = $this->pagantisOrder->getId();
563
+            $pagantisOrderId = $this->pagantisOrder->getId();
564 564
             $dbConnection->update(
565 565
                 $tableName,
566 566
                 array('mg_order_id' => $this->magentoOrderId),
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
     {
611 611
         //$returnUrl = 'checkout/#payment';
612 612
         $returnUrl = $this->_url->getUrl('checkout', ['_fragment' => 'payment']);
613
-        if ($this->magentoOrderId!='') {
613
+        if ($this->magentoOrderId != '') {
614 614
             /** @var Order $this->magentoOrder */
615 615
             $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId);
616 616
             if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) {
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
             $orderStatus    = strtolower($this->magentoOrder->getStatus());
628 628
             $acceptedStatus = array('processing', 'completed');
629 629
             if (in_array($orderStatus, $acceptedStatus)) {
630
-                if (isset($this->extraConfig['PAGANTIS_OK_URL']) &&  $this->extraConfig['PAGANTIS_OK_URL']!= '') {
630
+                if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') {
631 631
                     $returnUrl = $this->extraConfig['PAGANTIS_OK_URL'];
632 632
                 } else {
633 633
                     $returnUrl = 'checkout/onepage/success';
Please login to merge, or discard this patch.
Controller/Notify/IndexV2.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -537,17 +537,17 @@
 block discarded – undo
537 537
             }
538 538
 
539 539
             $this->magentoOrder->addStatusHistoryComment($metadataInfo)
540
-                               ->setIsCustomerNotified(false)
541
-                               ->setEntityName('order')
542
-                               ->save();
540
+                                ->setIsCustomerNotified(false)
541
+                                ->setEntityName('order')
542
+                                ->save();
543 543
 
544 544
             $comment = 'pagantisOrderId: ' . $this->pagantisOrder->getId(). ' ' .
545
-                       'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' .
546
-                       'via: '. $this->origin;
545
+                        'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' .
546
+                        'via: '. $this->origin;
547 547
             $this->magentoOrder->addStatusHistoryComment($comment)
548
-                               ->setIsCustomerNotified(false)
549
-                               ->setEntityName('order')
550
-                               ->save();
548
+                                ->setIsCustomerNotified(false)
549
+                                ->setEntityName('order')
550
+                                ->save();
551 551
 
552 552
             if ($this->magentoOrderId == '') {
553 553
                 throw new UnknownException('Order can not be saved');
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 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->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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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';
Please login to merge, or discard this patch.