Completed
Push — master ( 7f1e15...6e170c )
by Raúl
14s queued 12s
created
config/configure_admin.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,21 +17,21 @@
 block discarded – undo
17 17
 define('DIR_WS_HTTPS_CATALOG', '/');
18 18
 define('DIR_FS_CATALOG', '/var/www/html/');
19 19
 define('DIR_WS_IMAGES', 'images/');
20
-define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
21
-define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
20
+define('DIR_WS_ICONS', DIR_WS_IMAGES.'icons/');
21
+define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG.'images/');
22 22
 define('DIR_WS_INCLUDES', 'includes/');
23
-define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
24
-define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
25
-define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
26
-define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
27
-define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
28
-define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
29
-define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
30
-define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
31
-define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
32
-define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
33
-define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
34
-define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
23
+define('DIR_WS_BOXES', DIR_WS_INCLUDES.'boxes/');
24
+define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES.'functions/');
25
+define('DIR_WS_CLASSES', DIR_WS_INCLUDES.'classes/');
26
+define('DIR_WS_MODULES', DIR_WS_INCLUDES.'modules/');
27
+define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES.'languages/');
28
+define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG.'includes/languages/');
29
+define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG.'includes/languages/');
30
+define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG.'images/');
31
+define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG.'includes/modules/');
32
+define('DIR_FS_BACKUP', DIR_FS_ADMIN.'backups/');
33
+define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG.'download/');
34
+define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG.'pub/');
35 35
 
36 36
 define('DB_SERVER', getenv('OSCOMMERCE_DB_HOST'));
37 37
 define('DB_SERVER_USERNAME', getenv('OSCOMMERCE_DB_USER'));
Please login to merge, or discard this patch.
config/configure.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,17 +9,17 @@
 block discarded – undo
9 9
 define('DIR_WS_HTTP_CATALOG', '/');
10 10
 define('DIR_WS_HTTPS_CATALOG', '/');
11 11
 define('DIR_WS_IMAGES', 'images/');
12
-define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
12
+define('DIR_WS_ICONS', DIR_WS_IMAGES.'icons/');
13 13
 define('DIR_WS_INCLUDES', 'includes/');
14
-define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
15
-define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
16
-define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
17
-define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
14
+define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES.'functions/');
15
+define('DIR_WS_CLASSES', DIR_WS_INCLUDES.'classes/');
16
+define('DIR_WS_MODULES', DIR_WS_INCLUDES.'modules/');
17
+define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES.'languages/');
18 18
 
19 19
 define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
20 20
 define('DIR_FS_CATALOG', '/var/www/html');
21
-define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
22
-define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
21
+define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG.'download/');
22
+define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG.'pub/');
23 23
 
24 24
 define('DB_SERVER', getenv('OSCOMMERCE_DB_HOST'));
25 25
 define('DB_SERVER_USERNAME', getenv('OSCOMMERCE_DB_USER'));
Please login to merge, or discard this patch.
catalog/ext/modules/payment/pagantis/bypass.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
     $destUrl = $_POST['formUrl'];
5 5
 } elseif ($_POST['cancelUrl']) {
6 6
     $destUrl = $_POST['cancelUrl'];
7
-} else {
7
+}else {
8 8
     $destUrl = $_SERVER['HTTP_REFERER'];
9 9
 }
10 10
 
Please login to merge, or discard this patch.
catalog/ext/modules/payment/pagantis/configController.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -9,20 +9,20 @@
 block discarded – undo
9 9
  * @var array $defaultConfigs
10 10
  */
11 11
 $defaultConfigs = array('PMT_TITLE'=>'Instant Financing',
12
-                               'PMT_SIMULATOR_DISPLAY_TYPE'=>'pmtSDK.simulator.types.SIMPLE',
13
-                               'PMT_SIMULATOR_DISPLAY_SKIN'=>'pmtSDK.simulator.skins.BLUE',
14
-                               'PMT_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons',
15
-                               'PMT_SIMULATOR_START_INSTALLMENTS'=>3,
16
-                               'PMT_SIMULATOR_MAX_INSTALLMENTS'=>12,
17
-                               'PMT_SIMULATOR_CSS_POSITION_SELECTOR'=>'default',
18
-                               'PMT_SIMULATOR_DISPLAY_CSS_POSITION'=>'pmtSDK.simulator.positions.INNER',
19
-                               'PMT_SIMULATOR_CSS_PRICE_SELECTOR'=>'default',
20
-                               'PMT_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default',
21
-                               'PMT_FORM_DISPLAY_TYPE'=>0,
22
-                               'PMT_DISPLAY_MIN_AMOUNT'=>1,
23
-                               'PMT_URL_OK'=>'',
24
-                               'PMT_URL_KO'=>'',
25
-                               'PMT_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente 
12
+                                'PMT_SIMULATOR_DISPLAY_TYPE'=>'pmtSDK.simulator.types.SIMPLE',
13
+                                'PMT_SIMULATOR_DISPLAY_SKIN'=>'pmtSDK.simulator.skins.BLUE',
14
+                                'PMT_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons',
15
+                                'PMT_SIMULATOR_START_INSTALLMENTS'=>3,
16
+                                'PMT_SIMULATOR_MAX_INSTALLMENTS'=>12,
17
+                                'PMT_SIMULATOR_CSS_POSITION_SELECTOR'=>'default',
18
+                                'PMT_SIMULATOR_DISPLAY_CSS_POSITION'=>'pmtSDK.simulator.positions.INNER',
19
+                                'PMT_SIMULATOR_CSS_PRICE_SELECTOR'=>'default',
20
+                                'PMT_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default',
21
+                                'PMT_FORM_DISPLAY_TYPE'=>0,
22
+                                'PMT_DISPLAY_MIN_AMOUNT'=>1,
23
+                                'PMT_URL_OK'=>'',
24
+                                'PMT_URL_KO'=>'',
25
+                                'PMT_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente 
26 26
                             online y sin papeleos,¡y la respuesta es inmediata!'
27 27
 );
28 28
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,22 +41,22 @@
 block discarded – undo
41 41
 } elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {
42 42
     if (count($_POST)) {
43 43
         foreach ($_POST as $config => $value) {
44
-            if (isset($defaultConfigs[$config]) && $response['status']==null) {
44
+            if (isset($defaultConfigs[$config]) && $response['status'] == null) {
45 45
                 $updateQuery = "update ".TABLE_PAGANTIS_CONFIG." set value='$value' where config='$config'";
46 46
                 $resultsSelect = tep_db_query($updateQuery);
47
-            } else {
47
+            }else {
48 48
                 $response['status'] = 400;
49 49
                 $response['result'] = 'Bad request';
50 50
             }
51 51
         }
52
-    } else {
52
+    }else {
53 53
         $response['status'] = 422;
54 54
         $response['result'] = 'Empty data';
55 55
     }
56 56
 }
57 57
 
58 58
 $formattedResult = array();
59
-if ($response['status']==null) {
59
+if ($response['status'] == null) {
60 60
     $query = "select * from ".TABLE_PAGANTIS_CONFIG;
61 61
     $resultsSelect = tep_db_query($query);
62 62
     while ($orderRow = tep_db_fetch_array($resultsSelect)) {
Please login to merge, or discard this patch.
catalog/ext/modules/payment/pagantis/logController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 $orderRow = tep_db_fetch_array($resultsSelect);
12 12
 $privateKey = $orderRow['configuration_value'];
13 13
 
14
-if ($secretKey!='' && $privateKey!='') {
15
-    $query ="select log, createdAt from ".TABLE_PAGANTIS_LOG;
14
+if ($secretKey != '' && $privateKey != '') {
15
+    $query = "select log, createdAt from ".TABLE_PAGANTIS_LOG;
16 16
 
17 17
     $where = array();
18 18
     if (isset($_GET['from'])) {
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
     }
25 25
 
26 26
 
27
-    if (count($where)>0) {
28
-        $query.=" where ";
27
+    if (count($where) > 0) {
28
+        $query .= " where ";
29 29
         foreach ((array)$where as $clause) {
30
-            $query.=" $clause AND";
30
+            $query .= " $clause AND";
31 31
         }
32 32
         $query = substr($query, 0, -3);
33 33
     }
34 34
 
35 35
     $limit = ($_GET['limit']) ? $_GET['limit'] : 50;
36
-    $query.=" order by createdAt desc limit $limit";
36
+    $query .= " order by createdAt desc limit $limit";
37 37
 
38 38
     $response = array();
39 39
     $resultsSelect = tep_db_query($query);
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             $response[$i]['log']       = $orderRow['log'];
45 45
             $i++;
46 46
         }
47
-    } else {
47
+    }else {
48 48
         $response['result'] = 'Error';
49 49
     }
50 50
 
Please login to merge, or discard this patch.
catalog/ext/modules/payment/pagantis/callback.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
         tep_session_register($var);
17 17
     }
18 18
     $destUrl = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true, false);
19
-    $destUrl.="?order_id=$_GET[order_id]&from=notify";
20
-} else {
19
+    $destUrl .= "?order_id=$_GET[order_id]&from=notify";
20
+}else {
21 21
     $destUrl = tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', true, false);
22 22
 }
23 23
 
Please login to merge, or discard this patch.
test/PagantisOscommerceTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
         $faker = Factory::create();
65 65
         $this->configuration['dni'] = $this->getDNI();
66 66
         $this->configuration['firstname'] = $faker->firstName;
67
-        $this->configuration['lastname'] = $faker->lastName . ' ' . $faker->lastName;
67
+        $this->configuration['lastname'] = $faker->lastName.' '.$faker->lastName;
68 68
         $this->configuration['company'] = $faker->company;
69 69
         $this->configuration['zip'] = '28'.$faker->randomNumber(3, true);
70 70
         $this->configuration['address'] = $faker->streetAddress;
71
-        $this->configuration['phone'] = '6' . $faker->randomNumber(8);
72
-        $this->configuration['email'] = date('ymd') . '@pagantis.com';
71
+        $this->configuration['phone'] = '6'.$faker->randomNumber(8);
72
+        $this->configuration['email'] = date('ymd').'@pagantis.com';
73 73
         parent::__construct($name, $data, $dataName);
74 74
     }
75 75
     /**
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
      */
78 78
     protected function getDNI()
79 79
     {
80
-        $dni = '0000' . rand(pow(10, 4-1), pow(10, 4)-1);
81
-        $value = (int) ($dni / 23);
80
+        $dni = '0000'.rand(pow(10, 4 - 1), pow(10, 4) - 1);
81
+        $value = (int)($dni / 23);
82 82
         $value *= 23;
83
-        $value= $dni - $value;
84
-        $letter= "TRWAGMYFPDXBNJZSQVHLCKEO";
85
-        $dniLetter= substr($letter, $value, 1);
83
+        $value = $dni - $value;
84
+        $letter = "TRWAGMYFPDXBNJZSQVHLCKEO";
85
+        $dniLetter = substr($letter, $value, 1);
86 86
         return $dni.$dniLetter;
87 87
     }
88 88
 
Please login to merge, or discard this patch.
catalog/includes/modules/payment/pagantis.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
         try {
157 157
             include_once('./ext/modules/payment/pagantis/vendor/autoload.php');
158 158
             global $order, $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping,
159
-                   $payment, $comments, $customer_default_address_id, $cartID;
159
+                    $payment, $comments, $customer_default_address_id, $cartID;
160 160
             $global_vars = array();
161 161
             $global_vars['customer_id'] = serialize($customer_id);
162 162
             $global_vars['sendTo'] = serialize($sendto);
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 
76 76
         if (strpos($_SERVER[REQUEST_URI], "checkout_payment.php") <= 0) {
77 77
             $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_ADMIN_TITLE; // Payment module title in Admin
78
-        } else {
79
-            $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_CHECKOUT .'<br/><br/><div class="buttonSet" style="display:none"></div><br/>'; // Payment module title in Catalog
78
+        }else {
79
+            $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_CHECKOUT.'<br/><br/><div class="buttonSet" style="display:none"></div><br/>'; // Payment module title in Catalog
80 80
         }
81 81
 
82 82
         if (defined('MODULE_PAYMENT_PAGANTIS_LANG_CODE')) {
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
                 "%s://%s%s%s",
93 93
                 isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
94 94
                 $_SERVER['SERVER_NAME'],
95
-                isset($_SERVER['SERVER_PORT']) ? ":" . $_SERVER['SERVER_PORT'] : '',
95
+                isset($_SERVER['SERVER_PORT']) ? ":".$_SERVER['SERVER_PORT'] : '',
96 96
                 $_SERVER['REQUEST_URI']
97 97
             )
98 98
         );
99 99
 
100
-        $this->form_action_url = $this->base_url . '/ext/modules/payment/pagantis/bypass.php';
100
+        $this->form_action_url = $this->base_url.'/ext/modules/payment/pagantis/bypass.php';
101 101
 
102 102
         if (defined('MODULE_PAYMENT_PAGANTIS_ERROR_MESSAGE')) {
103 103
             $this->errorMessage = strtoupper(MODULE_PAYMENT_PAGANTIS_ERROR_MESSAGE);
@@ -211,12 +211,12 @@  discard block
 block discarded – undo
211 211
             $national_id = $this->getNationalId();
212 212
             $tax_id = $this->getTaxId();
213 213
 
214
-            $fullName = $order->billing['firstname'] . ' ' . $order->billing['lastname'];
214
+            $fullName = $order->billing['firstname'].' '.$order->billing['lastname'];
215 215
             if ($fullName == ' ') {
216
-                $fullName = $order->customer['firstname'] . ' ' . $order->customer['lastname'];
216
+                $fullName = $order->customer['firstname'].' '.$order->customer['lastname'];
217 217
             }
218 218
             if ($fullName == ' ') {
219
-                $fullName = $order->delivery['firstname'] . ' ' . $order->delivery['lastname'];
219
+                $fullName = $order->delivery['firstname'].' '.$order->delivery['lastname'];
220 220
             }
221 221
             $userAddress = new Address();
222 222
             $userAddress
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
                     ->setQuantity(intval($item['qty']))
287 287
                     ->setDescription($item['name']);
288 288
                 if ($promotedProduct) {
289
-                    $promotedAmount+=$product->getAmount();
289
+                    $promotedAmount += $product->getAmount();
290 290
                     $promotedMessage = $product->getDescription()."-Price:".$item['final_price']."-Qty:".$product->getQuantity();
291 291
                     $metadataOrder->addMetadata('promotedProduct', $promotedMessage);
292 292
                 }
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
             );
307 307
 
308 308
             $cancelUrl = trim(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false));
309
-            if ($this->extraConfig['PAGANTIS_URL_KO']!='') {
309
+            if ($this->extraConfig['PAGANTIS_URL_KO'] != '') {
310 310
                 $koUrl = $this->extraConfig['PAGANTIS_URL_KO'];
311
-            } else {
311
+            }else {
312 312
                 $koUrl = $cancelUrl;
313 313
             }
314 314
 
@@ -346,25 +346,25 @@  discard block
 block discarded – undo
346 346
             if ($pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
347 347
                 $url = $pagantisOrder->getActionUrls()->getForm();
348 348
                 $this->insertRow($this->os_order_reference, $pagantisOrder->getId(), serialize($global_vars));
349
-            } else {
349
+            }else {
350 350
                 throw new OrderNotFoundException();
351 351
             }
352 352
 
353 353
             if ($url == "") {
354 354
                 throw new UnknownException(_("No ha sido posible obtener una respuesta de Pagantis"));
355
-            } else {
355
+            }else {
356 356
                 $output = "\n";
357
-                $output .= tep_draw_hidden_field("formUrl", $url) . "\n";
358
-                $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl) . "\n";
357
+                $output .= tep_draw_hidden_field("formUrl", $url)."\n";
358
+                $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl)."\n";
359 359
                 return $output;
360 360
 
361 361
             } //TODO IFRAME
362 362
         } catch (\Exception $exception) {
363 363
             $this->insertLog($exception);
364 364
             $output = "\n";
365
-            $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl) . "\n";
366
-            $output .= tep_draw_hidden_field("errorMessage", $exception->getMessage()) . "\n";
367
-            $output .= tep_draw_hidden_field("errorCode", $exception->getCode()) . "\n";
365
+            $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl)."\n";
366
+            $output .= tep_draw_hidden_field("errorMessage", $exception->getMessage())."\n";
367
+            $output .= tep_draw_hidden_field("errorCode", $exception->getCode())."\n";
368 368
             $output .= "<p>".$this->errorMessage.", <a href='$cancelUrl' style='text-decoration:underline'><b>";
369 369
             $output .= $this->errorLinkMessage." </b></a></p>";
370 370
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
             return 'failed';
429 429
         }
430 430
 
431
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
431
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
432 432
         (
433 433
             configuration_title,
434 434
             configuration_key,
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
             ',
452 452
             now()
453 453
         )");
454
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
454
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
455 455
         (
456 456
             configuration_title,
457 457
             configuration_key,
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
             '0',
472 472
             now()
473 473
         )");
474
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
474
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
475 475
         (
476 476
             configuration_title,
477 477
             configuration_key,
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
             '0',
492 492
             now()
493 493
         )");
494
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
494
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
495 495
         (
496 496
             configuration_title,
497 497
             configuration_key,
@@ -523,14 +523,14 @@  discard block
 block discarded – undo
523 523
      */
524 524
     private function installPagantisTables()
525 525
     {
526
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_LOG . " ( 
526
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_LOG." ( 
527 527
                           id int NOT NULL AUTO_INCREMENT, 
528 528
                           log text NOT NULL, 
529 529
                           createdAt timestamp DEFAULT CURRENT_TIMESTAMP, 
530 530
                           UNIQUE KEY id (id))";
531 531
         tep_db_query($sql);
532 532
 
533
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONFIG . " (
533
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONFIG." (
534 534
                             id int NOT NULL AUTO_INCREMENT, 
535 535
                             config varchar(60) NOT NULL, 
536 536
                             value varchar(200) NOT NULL, 
@@ -538,10 +538,10 @@  discard block
 block discarded – undo
538 538
         tep_db_query($sql);
539 539
 
540 540
         // check if table has records
541
-        $check_query = tep_db_query("select value from " . TABLE_PAGANTIS_CONFIG);
541
+        $check_query = tep_db_query("select value from ".TABLE_PAGANTIS_CONFIG);
542 542
         if (tep_db_num_rows($check_query) === 0) {
543 543
             foreach ((array)$this->defaultConfigs as $configKey => $configValue) {
544
-                $query = "INSERT INTO " . TABLE_PAGANTIS_CONFIG . "
544
+                $query = "INSERT INTO ".TABLE_PAGANTIS_CONFIG."
545 545
                 (
546 546
                     config,
547 547
                     value
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
             }
556 556
         }
557 557
 
558
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_ORDERS . " (
558
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_ORDERS." (
559 559
                             id int NOT NULL AUTO_INCREMENT, 
560 560
                             os_order_id varchar(50), 
561 561
                             os_order_reference varchar(50) NOT NULL,
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
                             UNIQUE KEY id(id))";
565 565
         tep_db_query($sql);
566 566
 
567
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONCURRENCY . " (
567
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONCURRENCY." (
568 568
                             id varchar(50) NOT NULL,
569 569
                             `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
570 570
                             UNIQUE KEY id(id))";
@@ -576,29 +576,29 @@  discard block
 block discarded – undo
576 576
      */
577 577
     public function remove()
578 578
     {
579
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_LOG . "'");
579
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_LOG."'");
580 580
         if (tep_db_num_rows($checkTable) > 0) {
581
-            tep_db_query("drop table " . TABLE_PAGANTIS_LOG);
581
+            tep_db_query("drop table ".TABLE_PAGANTIS_LOG);
582 582
         }
583 583
 
584
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONFIG . "'");
584
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONFIG."'");
585 585
         if (tep_db_num_rows($checkTable) > 0) {
586
-            tep_db_query("drop table " . TABLE_PAGANTIS_CONFIG);
586
+            tep_db_query("drop table ".TABLE_PAGANTIS_CONFIG);
587 587
         }
588 588
 
589
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_ORDERS . "'");
589
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_ORDERS."'");
590 590
         if (tep_db_num_rows($checkTable) > 0) {
591
-            tep_db_query("drop table " . TABLE_PAGANTIS_ORDERS);
591
+            tep_db_query("drop table ".TABLE_PAGANTIS_ORDERS);
592 592
         }
593 593
 
594
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONCURRENCY . "'");
594
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONCURRENCY."'");
595 595
         if (tep_db_num_rows($checkTable) > 0) {
596
-            tep_db_query("drop table " . TABLE_PAGANTIS_CONCURRENCY);
596
+            tep_db_query("drop table ".TABLE_PAGANTIS_CONCURRENCY);
597 597
         }
598 598
 
599
-        tep_db_query("DELETE FROM ". TABLE_CONFIGURATION ." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')");
599
+        tep_db_query("DELETE FROM ".TABLE_CONFIGURATION." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')");
600 600
 
601
-        $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key like '%_PAGANTIS_%'";
601
+        $query = "delete from ".TABLE_CONFIGURATION." where configuration_key like '%_PAGANTIS_%'";
602 602
         tep_db_query($query);
603 603
 
604 604
         $this->uninstallSimulator();
@@ -653,13 +653,13 @@  discard block
 block discarded – undo
653 653
      */
654 654
     private function insertRow($orderId, $pagantisOrderId, $globalVars)
655 655
     {
656
-        $query = "select * from " . TABLE_PAGANTIS_ORDERS . " where os_order_reference='$orderId'";
656
+        $query = "select * from ".TABLE_PAGANTIS_ORDERS." where os_order_reference='$orderId'";
657 657
         $resultsSelect = tep_db_query($query);
658 658
         $countResults = tep_db_num_rows($resultsSelect);
659 659
         if ($countResults == 0) {
660
-            $query = "INSERT INTO " . TABLE_PAGANTIS_ORDERS . " 
660
+            $query = "INSERT INTO ".TABLE_PAGANTIS_ORDERS." 
661 661
                 (os_order_reference, pagantis_order_id, globals) values ('$orderId', '$pagantisOrderId','$globalVars')";
662
-        } else {
662
+        }else {
663 663
             $query = "UPDATE ".TABLE_PAGANTIS_ORDERS." set pagantis_order_id='$pagantisOrderId' 
664 664
                         where os_order_reference='$orderId'";
665 665
         }
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 
698 698
         if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') {
699 699
             $promotedProducts = array();
700
-        } else {
700
+        }else {
701 701
             $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION']));
702 702
         }
703 703
 
@@ -710,17 +710,17 @@  discard block
 block discarded – undo
710 710
     private function getDescription()
711 711
     {
712 712
         $descriptionCode = "<img src=\"images/icon_info.gif\" border=\"0\" alt=\"Info\" title=\"Info\">&nbsp;<strong>Module version:</strong> $this->version<br/><br/>";
713
-        $descriptionCode.= "<img src=\"images/icon_info.gif\" border=\"0\">&nbsp;<a href='https://developer.pagantis.com/' target=\"_blank\" style=\"text-decoration: underline; font-weight: bold;\">View Online Documentation</a><br/><br/>";
714
-        $descriptionCode.= "<img src='images/icon_popup.gif'  border='0'>        <a href='http://pagantis.com' target='_blank' style='text-decoration: underline; font-weight: bold;'>Visit Pagantis Website</a><br/><br/><br/>";
713
+        $descriptionCode .= "<img src=\"images/icon_info.gif\" border=\"0\">&nbsp;<a href='https://developer.pagantis.com/' target=\"_blank\" style=\"text-decoration: underline; font-weight: bold;\">View Online Documentation</a><br/><br/>";
714
+        $descriptionCode .= "<img src='images/icon_popup.gif'  border='0'>        <a href='http://pagantis.com' target='_blank' style='text-decoration: underline; font-weight: bold;'>Visit Pagantis Website</a><br/><br/><br/>";
715 715
 
716 716
         if (MODULE_PAYMENT_PAGANTIS_STATUS == 'True') {
717 717
             $pagantisPromotionUrl = $this->base_url.'/admin/promotion.php';
718 718
             $linkDescription = "Si deseas ofrecer financiación sin intereses para alguno de tus productos ";
719
-            $descriptionCode.= "<img src='images/icon_info.gif' border='0'/> $linkDescription<a href='$pagantisPromotionUrl' style='text-decoration: underline; font-weight: bold;'>haz click aquí</a>";
719
+            $descriptionCode .= "<img src='images/icon_info.gif' border='0'/> $linkDescription<a href='$pagantisPromotionUrl' style='text-decoration: underline; font-weight: bold;'>haz click aquí</a>";
720 720
 
721 721
             $pagantisAllowedCountriesUrl = $this->base_url.'/admin/allowedCountries.php';
722 722
             $linkDescription = "Para gestionar paises en los que operar con Pagantis ";
723
-            $descriptionCode.= "<br/><br/><img src='images/icon_info.gif' border='0'/> $linkDescription<a href='$pagantisAllowedCountriesUrl' style='text-decoration: underline; font-weight: bold;'>haz click aquí</a>";
723
+            $descriptionCode .= "<br/><br/><img src='images/icon_info.gif' border='0'/> $linkDescription<a href='$pagantisAllowedCountriesUrl' style='text-decoration: underline; font-weight: bold;'>haz click aquí</a>";
724 724
         }
725 725
 
726 726
         return $descriptionCode;
@@ -731,18 +731,18 @@  discard block
 block discarded – undo
731 731
      */
732 732
     private function installSimulator()
733 733
     {
734
-        $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." 
734
+        $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." 
735 735
                                     where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'
736 736
                                     and configuration_value like '%ht_pagantis.php%';");
737 737
         if (tep_db_num_rows($checkSimulator) > 0) {
738 738
             return true;
739 739
         }
740 740
 
741
-        $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = concat(configuration_value, ';ht_pagantis.php')
741
+        $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = concat(configuration_value, ';ht_pagantis.php')
742 742
                         where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'";
743 743
         tep_db_query($query);
744 744
 
745
-        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Pagantis Module', 'MODULE_HEADER_TAGS_PAGANTIS_STATUS', 'True', '', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
745
+        tep_db_query("insert into ".TABLE_CONFIGURATION." (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Pagantis Module', 'MODULE_HEADER_TAGS_PAGANTIS_STATUS', 'True', '', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
746 746
     }
747 747
 
748 748
     /**
@@ -750,18 +750,18 @@  discard block
 block discarded – undo
750 750
      */
751 751
     private function uninstallSimulator()
752 752
     {
753
-        $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." 
753
+        $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." 
754 754
                                     where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'
755 755
                                     and configuration_value like '%ht_pagantis.php%';");
756 756
         if (tep_db_num_rows($checkSimulator) == 0) {
757 757
             return true;
758 758
         }
759 759
 
760
-        $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '')
760
+        $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '')
761 761
                         where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'";
762 762
         tep_db_query($query);
763 763
 
764
-        $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'";
764
+        $query = "delete from ".TABLE_CONFIGURATION." where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'";
765 765
         tep_db_query($query);
766 766
     }
767 767
 
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
     private function insertLog($exception)
772 772
     {
773 773
         if ($exception instanceof \Exception) {
774
-            $logEntry= new LogEntry();
774
+            $logEntry = new LogEntry();
775 775
             $logEntryJson = $logEntry->error($exception)->toJson();
776 776
             $logEntryJson = addslashes($logEntryJson);
777 777
 
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
             return $order->customer['national_id'];
791 791
         } elseif (isset($order->billing['piva'])) {
792 792
             return $order->billing['piva'];
793
-        } else {
793
+        }else {
794 794
             return null;
795 795
         }
796 796
     }
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
             return $order->customer['tax_id'];
806 806
         } elseif (isset($order->billing['cf'])) {
807 807
             return $order->billing['cf'];
808
-        } else {
808
+        }else {
809 809
             return null;
810 810
         }
811 811
     }
Please login to merge, or discard this patch.
catalog/admin/promotion.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
 require('includes/application_top.php');
4 4
 
5 5
 define('TABLE_PAGANTIS_CONFIG', 'pagantis_config');
6
-define('TABLE_PRODUCTS_DESCRIPTIONS','products_description');
6
+define('TABLE_PRODUCTS_DESCRIPTIONS', 'products_description');
7 7
 
8 8
 //Check if module is installed
9
-$result = tep_db_query("select * from " . TABLE_CONFIGURATION . " where configuration_key='MODULE_PAYMENT_PAGANTIS_STATUS'");
9
+$result = tep_db_query("select * from ".TABLE_CONFIGURATION." where configuration_key='MODULE_PAYMENT_PAGANTIS_STATUS'");
10 10
 $resultSelect = tep_db_fetch_array($result);
11
-if (tep_db_num_rows($result) == 0 || $resultSelect['configuration_value'] !=='True') {
11
+if (tep_db_num_rows($result) == 0 || $resultSelect['configuration_value'] !== 'True') {
12 12
     tep_redirect('/admin/index.php');
13 13
 }
14 14
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     $resultSelect = tep_db_fetch_array($result);
32 32
     if ($resultSelect['value'] == '') {
33 33
         $promotedProducts = array();
34
-    } else {
34
+    }else {
35 35
         $promotedProducts = array_values((array)unserialize($resultSelect['value']));
36 36
     }
37 37
 }
Please login to merge, or discard this patch.