Passed
Pull Request — master (#57)
by pablo
04:23
created
Controller/Notify/IndexV2.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -607,19 +607,19 @@
 block discarded – undo
607 607
             }
608 608
 
609 609
             $this->magentoOrder->addStatusHistoryComment($metadataInfo)
610
-                               ->setIsCustomerNotified(false)
611
-                               ->setEntityName('order')
612
-                               ->save();
610
+                                ->setIsCustomerNotified(false)
611
+                                ->setEntityName('order')
612
+                                ->save();
613 613
 
614 614
             $comment = 'pagantisOrderId: ' . $this->pagantisOrder->getId(). ' ' .
615
-                       'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' .
616
-                       'via: '.$this->origin. ' ' .
617
-                       'product: '.$this->getProduct();
615
+                        'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' .
616
+                        'via: '.$this->origin. ' ' .
617
+                        'product: '.$this->getProduct();
618 618
 
619 619
             $this->magentoOrder->addStatusHistoryComment($comment)
620
-                               ->setIsCustomerNotified(false)
621
-                               ->setEntityName('order')
622
-                               ->save();
620
+                                ->setIsCustomerNotified(false)
621
+                                ->setEntityName('order')
622
+                                ->save();
623 623
 
624 624
             if ($this->magentoOrderId == '') {
625 625
                 throw new UnknownException('Order can not be saved');
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         $this->checkoutSession = $checkoutSession;
155 155
         $this->_request = $request;
156 156
         $this->origin = (
157
-            $this->_request->isPost() || $this->_request->getParam('origin')=='notification'
157
+            $this->_request->isPost() || $this->_request->getParam('origin') == 'notification'
158 158
                         ) ? 'Notification' : 'Order';
159 159
         $this->product = $this->_request->getParam('product');
160 160
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
     private function getPagantisOrder()
310 310
     {
311 311
         try {
312
-            if ($this->getProduct()===ConfigProvider::CODE4X) {
312
+            if ($this->getProduct() === ConfigProvider::CODE4X) {
313 313
                 $this->orderClient = new Client(
314 314
                     $this->config['pagantis_public_key_4x'],
315 315
                     $this->config['pagantis_private_key_4x']
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
             $this->checkPagantisStatus(array('AUTHORIZED'));
337 337
         } catch (\Exception $e) {
338 338
             $this->getMagentoOrderId();
339
-            if ($this->magentoOrderId!='') {
339
+            if ($this->magentoOrderId != '') {
340 340
                 throw new AlreadyProcessedException();
341 341
             } else {
342 342
                 throw new WrongStatusException($this->pagantisOrder->getStatus());
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
      */
350 350
     private function checkMerchantOrderStatus()
351 351
     {
352
-        if ($this->quote->getIsActive()=='0') {
352
+        if ($this->quote->getIsActive() == '0') {
353 353
             $this->getMagentoOrderId();
354 354
             throw new AlreadyProcessedException();
355 355
         }
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             $tableName    = $this->dbObject->getTableName(self::CONCURRENCY_TABLE);
482 482
             if ($mode == false) {
483 483
                 $dbConnection->delete($tableName, "timestamp<".(time() - 5));
484
-            } elseif ($this->quoteId!='') {
484
+            } elseif ($this->quoteId != '') {
485 485
                 $dbConnection->delete($tableName, "id=".$this->quoteId);
486 486
             }
487 487
         } catch (Exception $exception) {
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
                 $this->getPagantisOrderId();
521 521
                 $this->getMagentoOrderId();
522 522
 
523
-                $logMessage  = sprintf(
523
+                $logMessage = sprintf(
524 524
                     "User waiting %s seconds, default seconds %s, bd time to expire %s seconds[quoteId=%s][origin=%s]",
525 525
                     $expirationSec,
526 526
                     self::CONCURRENCY_TIMEOUT,
@@ -572,14 +572,14 @@  discard block
 block discarded – undo
572 572
                 $this->getPagantisOrderId();
573 573
             }
574 574
 
575
-            $pagantisOrderId   = $this->pagantisOrderId;
576
-            $query        = sprintf(
575
+            $pagantisOrderId = $this->pagantisOrderId;
576
+            $query = sprintf(
577 577
                 "select mg_order_id from %s where id='%s' and order_id='%s'",
578 578
                 $tableName,
579 579
                 $this->quoteId,
580 580
                 $pagantisOrderId
581 581
             );
582
-            $queryResult  = $dbConnection->fetchRow($query);
582
+            $queryResult = $dbConnection->fetchRow($query);
583 583
             $this->magentoOrderId = $queryResult['mg_order_id'];
584 584
         } catch (\Exception $e) {
585 585
             throw new UnknownException($e->getMessage());
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
             $metadataInfo = null;
603 603
             foreach ($metadataOrder as $metadataKey => $metadataValue) {
604 604
                 if ($metadataKey == 'promotedProduct') {
605
-                    $metadataInfo.= "/Producto promocionado = $metadataValue";
605
+                    $metadataInfo .= "/Producto promocionado = $metadataValue";
606 606
                 }
607 607
             }
608 608
 
@@ -611,9 +611,9 @@  discard block
 block discarded – undo
611 611
                                ->setEntityName('order')
612 612
                                ->save();
613 613
 
614
-            $comment = 'pagantisOrderId: ' . $this->pagantisOrder->getId(). ' ' .
615
-                       'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' .
616
-                       'via: '.$this->origin. ' ' .
614
+            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '.
615
+                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '.
616
+                       'via: '.$this->origin.' '.
617 617
                        'product: '.$this->getProduct();
618 618
 
619 619
             $this->magentoOrder->addStatusHistoryComment($comment)
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
639 639
             $dbConnection = $this->dbObject->getConnection();
640 640
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
641
-            $pagantisOrderId   = $this->pagantisOrder->getId();
641
+            $pagantisOrderId = $this->pagantisOrder->getId();
642 642
             $dbConnection->update(
643 643
                 $tableName,
644 644
                 array('mg_order_id' => $this->magentoOrderId),
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
             $this->getMagentoOrderId();
714 714
         }
715 715
 
716
-        if ($this->magentoOrderId!='') {
716
+        if ($this->magentoOrderId != '') {
717 717
             /** @var Order $this->magentoOrder */
718 718
             $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId);
719 719
             if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) {
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
             $orderStatus    = strtolower($this->magentoOrder->getStatus());
739 739
             $acceptedStatus = array('processing', 'completed');
740 740
             if (in_array($orderStatus, $acceptedStatus)) {
741
-                if (isset($this->extraConfig['PAGANTIS_OK_URL']) &&  $this->extraConfig['PAGANTIS_OK_URL']!= '') {
741
+                if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') {
742 742
                     $returnUrl = $this->extraConfig['PAGANTIS_OK_URL'];
743 743
                 } else {
744 744
                     $returnUrl = 'checkout/onepage/success';
Please login to merge, or discard this patch.
Controller/Notify/Index.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -589,20 +589,20 @@
 block discarded – undo
589 589
             }
590 590
 
591 591
             $this->magentoOrder->addStatusHistoryComment($metadataInfo)
592
-                               ->setIsCustomerNotified(false)
593
-                               ->setEntityName('order')
594
-                               ->setTitle($this->getProduct())
595
-                               ->setPayment($this->getProduct())
596
-                               ->save();
592
+                                ->setIsCustomerNotified(false)
593
+                                ->setEntityName('order')
594
+                                ->setTitle($this->getProduct())
595
+                                ->setPayment($this->getProduct())
596
+                                ->save();
597 597
 
598 598
             $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId(). ' ' .
599
-                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(). ' ' .
600
-                       'via: '.$this->origin. ' ' .
601
-                       'product: '.$this->getProduct();
599
+                        'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(). ' ' .
600
+                        'via: '.$this->origin. ' ' .
601
+                        'product: '.$this->getProduct();
602 602
             $this->magentoOrder->addStatusHistoryComment($comment)
603
-                               ->setIsCustomerNotified(false)
604
-                               ->setEntityName('order')
605
-                               ->save();
603
+                                ->setIsCustomerNotified(false)
604
+                                ->setEntityName('order')
605
+                                ->save();
606 606
 
607 607
             if ($this->magentoOrderId == '') {
608 608
                 throw new UnknownException('Order can not be saved');
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $this->checkoutSession = $checkoutSession;
153 153
         $this->_request = $request;
154 154
         $this->origin = (
155
-            $this->_request->isPost() || $this->_request->getParam('origin')=='notification'
155
+            $this->_request->isPost() || $this->_request->getParam('origin') == 'notification'
156 156
         ) ? 'Notification' : 'Order';
157 157
         $this->product = $this->_request->getParam('product');
158 158
     }
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
             $this->checkPagantisStatus(array('AUTHORIZED'));
318 318
         } catch (\Exception $e) {
319 319
             $this->getMagentoOrderId();
320
-            if ($this->magentoOrderId!='') {
320
+            if ($this->magentoOrderId != '') {
321 321
                 throw new AlreadyProcessedException();
322 322
             } else {
323 323
                 throw new WrongStatusException($this->pagantisOrder->getStatus());
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
      */
331 331
     private function checkMerchantOrderStatus()
332 332
     {
333
-        if ($this->quote->getIsActive()=='0') {
333
+        if ($this->quote->getIsActive() == '0') {
334 334
             $this->getMagentoOrderId();
335 335
             throw new AlreadyProcessedException();
336 336
         }
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
             $tableName    = $this->dbObject->getTableName(self::CONCURRENCY_TABLE);
463 463
             if ($mode == false) {
464 464
                 $dbConnection->delete($tableName, "timestamp<".(time() - 5));
465
-            } elseif ($this->quoteId!='') {
465
+            } elseif ($this->quoteId != '') {
466 466
                 $dbConnection->delete($tableName, "id=".$this->quoteId);
467 467
             }
468 468
         } catch (Exception $exception) {
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
                 $this->getPagantisOrderId();
502 502
                 $this->getMagentoOrderId();
503 503
 
504
-                $logMessage  = sprintf(
504
+                $logMessage = sprintf(
505 505
                     "User waiting %s seconds, default seconds %s, bd time to expire %s seconds[quoteId=%s][origin=%s]",
506 506
                     $expirationSec,
507 507
                     self::CONCURRENCY_TIMEOUT,
@@ -552,15 +552,15 @@  discard block
 block discarded – undo
552 552
             if ($this->pagantisOrderId == '') {
553 553
                 $this->getPagantisOrderId();
554 554
             }
555
-            $pagantisOrderId   = $this->pagantisOrderId;
555
+            $pagantisOrderId = $this->pagantisOrderId;
556 556
 
557
-            $query        = sprintf(
557
+            $query = sprintf(
558 558
                 "select mg_order_id from %s where id='%s' and order_id='%s'",
559 559
                 $tableName,
560 560
                 $this->quoteId,
561 561
                 $pagantisOrderId
562 562
             );
563
-            $queryResult  = $dbConnection->fetchRow($query);
563
+            $queryResult = $dbConnection->fetchRow($query);
564 564
             $this->magentoOrderId = $queryResult['mg_order_id'];
565 565
         } catch (\Exception $e) {
566 566
             throw new UnknownException($e->getMessage());
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
             $metadataInfo = null;
585 585
             foreach ($metadataOrder as $metadataKey => $metadataValue) {
586 586
                 if ($metadataKey == 'promotedProduct') {
587
-                    $metadataInfo.= " Producto promocionado = $metadataValue //";
587
+                    $metadataInfo .= " Producto promocionado = $metadataValue //";
588 588
                 }
589 589
             }
590 590
 
@@ -595,9 +595,9 @@  discard block
 block discarded – undo
595 595
                                ->setPayment($this->getProduct())
596 596
                                ->save();
597 597
 
598
-            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId(). ' ' .
599
-                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(). ' ' .
600
-                       'via: '.$this->origin. ' ' .
598
+            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '.
599
+                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '.
600
+                       'via: '.$this->origin.' '.
601 601
                        'product: '.$this->getProduct();
602 602
             $this->magentoOrder->addStatusHistoryComment($comment)
603 603
                                ->setIsCustomerNotified(false)
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
622 622
             $dbConnection = $this->dbObject->getConnection();
623 623
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
624
-            $pagantisOrderId   = $this->pagantisOrder->getId();
624
+            $pagantisOrderId = $this->pagantisOrder->getId();
625 625
             $dbConnection->update(
626 626
                 $tableName,
627 627
                 array('mg_order_id' => $this->magentoOrderId),
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
             $this->getMagentoOrderId();
698 698
         }
699 699
 
700
-        if ($this->magentoOrderId!='') {
700
+        if ($this->magentoOrderId != '') {
701 701
             /** @var Order $this->magentoOrder */
702 702
             $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId);
703 703
             if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) {
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
             $orderStatus    = strtolower($this->magentoOrder->getStatus());
724 724
             $acceptedStatus = array('processing', 'completed');
725 725
             if (in_array($orderStatus, $acceptedStatus)) {
726
-                if (isset($this->extraConfig['PAGANTIS_OK_URL']) &&  $this->extraConfig['PAGANTIS_OK_URL']!= '') {
726
+                if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') {
727 727
                     $returnUrl = $this->extraConfig['PAGANTIS_OK_URL'];
728 728
                 } else {
729 729
                     $returnUrl = 'checkout/onepage/success';
Please login to merge, or discard this patch.
Block/Product/Simulator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      */
306 306
     public function getFinalPrice4x()
307 307
     {
308
-        return number_format($this->getProduct()->getFinalPrice()/4, 2);
308
+        return number_format($this->getProduct()->getFinalPrice() / 4, 2);
309 309
     }
310 310
 
311 311
     /**
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
         $minAmount = $this->getMinAmount();
543 543
         $totalPrice = (string) floor($this->getFinalPrice());
544 544
 
545
-        return ($totalPrice>=$minAmount && ($totalPrice<=$maxAmount||$maxAmount=='0'));
545
+        return ($totalPrice >= $minAmount && ($totalPrice <= $maxAmount || $maxAmount == '0'));
546 546
     }
547 547
 
548 548
     /**
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
         $minAmount = $this->getMinAmount4x();
555 555
         $totalPrice = (string) floor($this->getFinalPrice());
556 556
 
557
-        return ($totalPrice>=$minAmount && ($totalPrice<=$maxAmount||$maxAmount=='0'));
557
+        return ($totalPrice >= $minAmount && ($totalPrice <= $maxAmount || $maxAmount == '0'));
558 558
     }
559 559
 
560 560
     /**
Please login to merge, or discard this patch.
Setup/UpgradeData.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                 );
62 62
                 foreach ($newConfigs as $config => $value) {
63 63
                     $setup->getConnection()
64
-                          ->insert($prefixedTableName, array('config' => $config, 'value' => $value));
64
+                            ->insert($prefixedTableName, array('config' => $config, 'value' => $value));
65 65
                 }
66 66
             }
67 67
 
@@ -72,14 +72,14 @@  discard block
 block discarded – undo
72 72
                 );
73 73
                 foreach ($newConfigs as $config => $value) {
74 74
                     $setup->getConnection()
75
-                          ->insert($prefixedTableName, array('config' => $config, 'value' => $value));
75
+                            ->insert($prefixedTableName, array('config' => $config, 'value' => $value));
76 76
                 }
77 77
                 $setup->getConnection()
78
-                      ->update(
79
-                          $prefixedTableName,
80
-                          array('value' => 'sdk.simulator.types.PRODUCT_PAGE'),
81
-                          "config='PAGANTIS_SIMULATOR_DISPLAY_TYPE'"
82
-                      );
78
+                        ->update(
79
+                            $prefixedTableName,
80
+                            array('value' => 'sdk.simulator.types.PRODUCT_PAGE'),
81
+                            "config='PAGANTIS_SIMULATOR_DISPLAY_TYPE'"
82
+                        );
83 83
 
84 84
             }
85 85
 
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
                 );
94 94
                 foreach ($newConfigs as $config => $value) {
95 95
                     $setup->getConnection()
96
-                          ->insert($prefixedTableName, array('config' => $config, 'value' => $value));
96
+                            ->insert($prefixedTableName, array('config' => $config, 'value' => $value));
97 97
                 }
98 98
                 $setup->getConnection()
99
-                      ->update(
100
-                          $prefixedTableName,
101
-                          array('value' => 'Instant financing'),
102
-                          "config='PAGANTIS_TITLE'"
103
-                      );
99
+                        ->update(
100
+                            $prefixedTableName,
101
+                            array('value' => 'Instant financing'),
102
+                            "config='PAGANTIS_TITLE'"
103
+                        );
104 104
             }
105 105
         }
106 106
         $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
Please login to merge, or discard this patch.
Setup/InstallData.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -16,28 +16,28 @@  discard block
 block discarded – undo
16 16
      * @var array $defaultConfigs
17 17
      */
18 18
     public $defaultConfigs = array(
19
-       'PAGANTIS_TITLE'=>'Instant financing',
20
-       'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'sdk.simulator.types.PRODUCT_PAGE',
21
-       'PAGANTIS_SIMULATOR_DISPLAY_TYPE_CHECKOUT'=>'sdk.simulator.types.CHECKOUT_PAGE',
22
-       'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'sdk.simulator.skins.BLUE',
23
-       'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons',
24
-       'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3,
25
-       'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12,
26
-       'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default',
27
-       'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'sdk.simulator.positions.INNER',
28
-       'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default',
29
-       'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default',
30
-       'PAGANTIS_FORM_DISPLAY_TYPE'=>0,
31
-       'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1,
32
-       'PAGANTIS_DISPLAY_MAX_AMOUNT'=>0,
33
-       'PAGANTIS_URL_OK'=>'',
34
-       'PAGANTIS_URL_KO'=>'',
35
-       'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!',
36
-       'PAGANTIS_ALLOWED_COUNTRIES' => 'a:3:{i:0;s:2:"es";i:1;s:2:"it";i:2;s:2:"fr";}',
37
-       'PAGANTIS_PROMOTION_EXTRA' => '<p class="promoted">Finance this product <span class="pg-no-interest">without interest!</span></p>',
38
-       'PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR' => '.',
39
-       'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ',',
40
-       'PAGANTIS_SIMULATOR_DISPLAY_SITUATION' => '',
19
+        'PAGANTIS_TITLE'=>'Instant financing',
20
+        'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'sdk.simulator.types.PRODUCT_PAGE',
21
+        'PAGANTIS_SIMULATOR_DISPLAY_TYPE_CHECKOUT'=>'sdk.simulator.types.CHECKOUT_PAGE',
22
+        'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'sdk.simulator.skins.BLUE',
23
+        'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons',
24
+        'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3,
25
+        'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12,
26
+        'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default',
27
+        'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'sdk.simulator.positions.INNER',
28
+        'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default',
29
+        'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default',
30
+        'PAGANTIS_FORM_DISPLAY_TYPE'=>0,
31
+        'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1,
32
+        'PAGANTIS_DISPLAY_MAX_AMOUNT'=>0,
33
+        'PAGANTIS_URL_OK'=>'',
34
+        'PAGANTIS_URL_KO'=>'',
35
+        'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!',
36
+        'PAGANTIS_ALLOWED_COUNTRIES' => 'a:3:{i:0;s:2:"es";i:1;s:2:"it";i:2;s:2:"fr";}',
37
+        'PAGANTIS_PROMOTION_EXTRA' => '<p class="promoted">Finance this product <span class="pg-no-interest">without interest!</span></p>',
38
+        'PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR' => '.',
39
+        'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ',',
40
+        'PAGANTIS_SIMULATOR_DISPLAY_SITUATION' => '',
41 41
         //4x
42 42
         'PAGANTIS_DISPLAY_MIN_AMOUNT_4x'=>0,
43 43
         'PAGANTIS_DISPLAY_MAX_AMOUNT_4x'=>800,
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         if ($setup->tableExists($prefixedTableName)) {
55 55
             foreach ($this->defaultConfigs as $config => $value) {
56 56
                 $setup->getConnection()
57
-                      ->insert(self::CONFIG_TABLE, array('config' => $config, 'value' => $value));
57
+                        ->insert(self::CONFIG_TABLE, array('config' => $config, 'value' => $value));
58 58
             }
59 59
         }
60 60
     }
Please login to merge, or discard this patch.
Observer/PaymentMethodAvailable.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     public function execute(\Magento\Framework\Event\Observer $observer)
18 18
     {
19 19
         try {
20
-            if ($observer->getEvent()->getMethodInstance()->getCode()==ConfigProvider::CODE) {
20
+            if ($observer->getEvent()->getMethodInstance()->getCode() == ConfigProvider::CODE) {
21 21
                 $checkResult = $observer->getEvent()->getResult();
22 22
                 $totalPrice  = (string) floor($observer->getEvent()->getQuote()->getGrandTotal());
23 23
                 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
                 $availableCountry = (in_array(strtolower($locale), $allowedCountries));
30 30
                 $maxAmount = $extraConfig['PAGANTIS_DISPLAY_MAX_AMOUNT'];
31 31
                 $minAmount = $extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT'];
32
-                $validAmount = ($totalPrice>=$minAmount && ($totalPrice<=$maxAmount||$maxAmount=='0'));
32
+                $validAmount = ($totalPrice >= $minAmount && ($totalPrice <= $maxAmount || $maxAmount == '0'));
33 33
                 $disabledPg = (!isset($config['pagantis_public_key']) || $config['pagantis_public_key'] == '' ||
34 34
                                !isset($config['pagantis_private_key']) || $config['pagantis_private_key'] == '' ||
35
-                               !$availableCountry || !$validAmount || $config['active_12x']!=='1'
36
-                               || $config['active']!=='1' );
35
+                               !$availableCountry || !$validAmount || $config['active_12x'] !== '1'
36
+                               || $config['active'] !== '1');
37 37
                 if ($disabledPg) {
38 38
                     $checkResult->setData('is_available', false);
39 39
                 } else {
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
                 }
42 42
             }
43 43
 
44
-            if ($observer->getEvent()->getMethodInstance()->getCode()==ConfigProvider::CODE4X) {
44
+            if ($observer->getEvent()->getMethodInstance()->getCode() == ConfigProvider::CODE4X) {
45 45
                 $checkResult = $observer->getEvent()->getResult();
46 46
                 $totalPrice  = (string) floor($observer->getEvent()->getQuote()->getGrandTotal());
47 47
                 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
                 $availableCountry = (in_array(strtolower($locale), $allowedCountries));
54 54
                 $maxAmount = $extraConfig['PAGANTIS_DISPLAY_MAX_AMOUNT_4x'];
55 55
                 $minAmount = $extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT_4x'];
56
-                $validAmount = ($totalPrice>=$minAmount && ($totalPrice<=$maxAmount||$maxAmount=='0'));
57
-                $disabledPg4x = (!isset($config['pagantis_public_key_4x']) || $config['pagantis_public_key_4x']=='' ||
58
-                                 !isset($config['pagantis_private_key_4x']) || $config['pagantis_private_key_4x']=='' ||
59
-                                 !$availableCountry || !$validAmount || $config['active_4x']!=='1'
60
-                                 || $config['active']!=='1' );
56
+                $validAmount = ($totalPrice >= $minAmount && ($totalPrice <= $maxAmount || $maxAmount == '0'));
57
+                $disabledPg4x = (!isset($config['pagantis_public_key_4x']) || $config['pagantis_public_key_4x'] == '' ||
58
+                                 !isset($config['pagantis_private_key_4x']) || $config['pagantis_private_key_4x'] == '' ||
59
+                                 !$availableCountry || !$validAmount || $config['active_4x'] !== '1'
60
+                                 || $config['active'] !== '1');
61 61
                 if ($disabledPg4x) {
62 62
                     $checkResult->setData('is_available', false);
63 63
                 } else {
Please login to merge, or discard this patch.