Passed
Pull Request — master (#94)
by Raúl
02:36
created
controllers/front/AbstractController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $parsedUrl = parse_url($url);
36 36
         $separator = ($parsedUrl['query'] == null) ? '?' : '&';
37
-        $redirectUrl = $url. $separator . http_build_query($parameters);
37
+        $redirectUrl = $url.$separator.http_build_query($parameters);
38 38
         Tools::redirect($redirectUrl);
39 39
     }
40 40
 
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
                     $response = $exception->getMessage();
77 77
                 } else {
78 78
                     $response = 'Unable to serialize log.'.
79
-                        'data: '. json_encode($data).
80
-                        'exception: '. json_encode($exception);
79
+                        'data: '.json_encode($data).
80
+                        'exception: '.json_encode($exception);
81 81
                 }
82 82
             }
83 83
 
Please login to merge, or discard this patch.
pagantis.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -473,7 +473,7 @@
 block discarded – undo
473 473
      * Get the form for editing the BackOffice options of the module
474 474
      *
475 475
      * @return array
476
-            */
476
+     */
477 477
     private function getConfigForm()
478 478
     {
479 479
         $products = explode(',', Pagantis::getExtraConfig('PRODUCTS', null));
Please login to merge, or discard this patch.
Spacing   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     exit;
12 12
 }
13 13
 
14
-define('_PS_PAGANTIS_DIR', _PS_MODULE_DIR_. '/pagantis');
14
+define('_PS_PAGANTIS_DIR', _PS_MODULE_DIR_.'/pagantis');
15 15
 define('PROMOTIONS_CATEGORY', 'pagantis-promotion-product');
16 16
 define('PROMOTIONS_CATEGORY_NAME', 'Pagantis Promoted Product');
17 17
 
@@ -162,14 +162,14 @@  discard block
 block discarded – undo
162 162
         foreach ($products as $product) {
163 163
             $code = Tools::strtolower(Pagantis::getExtraConfig('CODE', $product));
164 164
             if ($code === 'p4x') {
165
-                Configuration::updateValue($code . '_simulator_is_enabled', 1);
165
+                Configuration::updateValue($code.'_simulator_is_enabled', 1);
166 166
             }
167
-            Configuration::updateValue($code . '_is_enabled', 0);
168
-            Configuration::updateValue($code . '_public_key', '');
169
-            Configuration::updateValue($code . '_private_key', '');
167
+            Configuration::updateValue($code.'_is_enabled', 0);
168
+            Configuration::updateValue($code.'_public_key', '');
169
+            Configuration::updateValue($code.'_private_key', '');
170 170
         }
171 171
 
172
-        $return =  (parent::install()
172
+        $return = (parent::install()
173 173
             && $this->registerHook('displayShoppingCart')
174 174
             && $this->registerHook('paymentOptions')
175 175
             && $this->registerHook('displayProductButtons')
@@ -215,34 +215,34 @@  discard block
 block discarded – undo
215 215
     public function checkHooks()
216 216
     {
217 217
         try {
218
-            $sql_content = 'select * from ' . _DB_PREFIX_. 'hook_module where 
219
-            id_module = \'' . Module::getModuleIdByName($this->name) . '\' and 
220
-            id_shop = \'' . Shop::getContextShopID() . '\' and 
221
-            id_hook = \'' . Hook::getIdByName('header') . '\'';
218
+            $sql_content = 'select * from '._DB_PREFIX_.'hook_module where 
219
+            id_module = \'' . Module::getModuleIdByName($this->name).'\' and 
220
+            id_shop = \'' . Shop::getContextShopID().'\' and 
221
+            id_hook = \'' . Hook::getIdByName('header').'\'';
222 222
             $hook_exists = Db::getInstance()->ExecuteS($sql_content);
223 223
             if (empty($hook_exists)) {
224
-                $sql_insert = 'insert into ' . _DB_PREFIX_.  'hook_module 
224
+                $sql_insert = 'insert into '._DB_PREFIX_.'hook_module 
225 225
             (id_module, id_shop, id_hook, position)
226 226
             values
227
-            (\''. Module::getModuleIdByName($this->name) . '\',
228
-            \''. Shop::getContextShopID() . '\',
229
-            \''. Hook::getIdByName('header') . '\',
227
+            (\''. Module::getModuleIdByName($this->name).'\',
228
+            \''. Shop::getContextShopID().'\',
229
+            \''. Hook::getIdByName('header').'\',
230 230
             150)';
231 231
                 Db::getInstance()->execute($sql_insert);
232 232
             }
233 233
 
234
-            $sql_content = 'select * from ' . _DB_PREFIX_. 'hook_module where 
235
-            id_module = \'' . Module::getModuleIdByName($this->name) . '\' and 
236
-            id_shop = \'' . Shop::getContextShopID() . '\' and 
237
-            id_hook = \'' . Hook::getIdByName('displayProductPriceBlock') . '\'';
234
+            $sql_content = 'select * from '._DB_PREFIX_.'hook_module where 
235
+            id_module = \'' . Module::getModuleIdByName($this->name).'\' and 
236
+            id_shop = \'' . Shop::getContextShopID().'\' and 
237
+            id_hook = \'' . Hook::getIdByName('displayProductPriceBlock').'\'';
238 238
             $hook_exists = Db::getInstance()->ExecuteS($sql_content);
239 239
             if (empty($hook_exists)) {
240
-                $sql_insert = 'insert into ' . _DB_PREFIX_.  'hook_module 
240
+                $sql_insert = 'insert into '._DB_PREFIX_.'hook_module 
241 241
             (id_module, id_shop, id_hook, position)
242 242
             values
243
-            (\''. Module::getModuleIdByName($this->name) . '\',
244
-            \''. Shop::getContextShopID() . '\',
245
-            \''. Hook::getIdByName('displayProductPriceBlock') . '\',
243
+            (\''. Module::getModuleIdByName($this->name).'\',
244
+            \''. Shop::getContextShopID().'\',
245
+            \''. Hook::getIdByName('displayProductPriceBlock').'\',
246 246
             160)';
247 247
                 Db::getInstance()->execute($sql_insert);
248 248
             }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      */
257 257
     public function checkEnvVariables()
258 258
     {
259
-        $sql_content = 'select * from ' . _DB_PREFIX_. 'pagantis_config';
259
+        $sql_content = 'select * from '._DB_PREFIX_.'pagantis_config';
260 260
         $dbConfigs = Db::getInstance()->executeS($sql_content);
261 261
 
262 262
         // Convert a multimple dimension array for SQL insert statements into a simple key/value
@@ -285,10 +285,10 @@  discard block
 block discarded – undo
285 285
     {
286 286
         try {
287 287
             $tableName = _DB_PREFIX_.'pagantis_order';
288
-            $sql = "show tables like '"   . $tableName . "'";
288
+            $sql = "show tables like '".$tableName."'";
289 289
             $data = Db::getInstance()->ExecuteS($sql);
290 290
             if (count($data) > 0) {
291
-                $sql = "desc "   . $tableName;
291
+                $sql = "desc ".$tableName;
292 292
                 $data = Db::getInstance()->ExecuteS($sql);
293 293
                 if (count($data) == 2) {
294 294
                     $sql = "ALTER TABLE $tableName ADD COLUMN ps_order_id VARCHAR(60) AFTER order_id";
@@ -296,10 +296,10 @@  discard block
 block discarded – undo
296 296
                 }
297 297
             }
298 298
             $tableName = _DB_PREFIX_.'pagantis_config';
299
-            $sql = "show tables like '"   . $tableName . "'";
299
+            $sql = "show tables like '".$tableName."'";
300 300
             $data = Db::getInstance()->ExecuteS($sql);
301 301
             if (count($data) > 0) {
302
-                $sql = "desc "   . $tableName;
302
+                $sql = "desc ".$tableName;
303 303
                 $data = Db::getInstance()->ExecuteS($sql);
304 304
                 if (count($data) === 3 && $data[2]['Type'] !== 'varchar(5000)') {
305 305
                     $sql = "ALTER TABLE $tableName MODIFY `value` VARCHAR(5000)";
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
         $availableCurrencies       = array('EUR');
343 343
         $pagantisDisplayMinAmount  = $configs['DISPLAY_MIN_AMOUNT'];
344 344
         $pagantisDisplayMaxAmount  = $configs['DISPLAY_MAX_AMOUNT'];
345
-        $pagantisPublicKey         = Configuration::get(Tools::strtolower($configs['CODE']) . '_public_key');
346
-        $pagantisPrivateKey        = Configuration::get(Tools::strtolower($configs['CODE']) . '_private_key');
345
+        $pagantisPublicKey         = Configuration::get(Tools::strtolower($configs['CODE']).'_public_key');
346
+        $pagantisPrivateKey        = Configuration::get(Tools::strtolower($configs['CODE']).'_private_key');
347 347
         $this->allowedCountries    = unserialize(Pagantis::getExtraConfig('ALLOWED_COUNTRIES', null));
348 348
         $this->getUserLanguage();
349 349
         return (
@@ -422,42 +422,42 @@  discard block
 block discarded – undo
422 422
             if ($this->isPaymentMethodAvailable($product)) {
423 423
                 $productConfigs = Pagantis::getExtraConfig($product, null);
424 424
                 $productConfigs = json_decode($productConfigs, true);
425
-                $publicKey = Configuration::get(Tools::strtolower($productConfigs['CODE']) . '_public_key');
426
-                $simulatorIsEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']) . '_simulator_is_enabled');
427
-                $isEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']) . '_is_enabled');
425
+                $publicKey = Configuration::get(Tools::strtolower($productConfigs['CODE']).'_public_key');
426
+                $simulatorIsEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']).'_simulator_is_enabled');
427
+                $isEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']).'_is_enabled');
428 428
 
429
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_TITLE'] = $this->l($productConfigs['TITLE']);
429
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_TITLE'] = $this->l($productConfigs['TITLE']);
430 430
                 unset($productConfigs['TITLE']);
431
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_AMOUNT'] = $orderTotal;
432
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_PROMOTED_AMOUNT'] = $promotedAmount;
433
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_LOCALE'] = $this->language;
434
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_COUNTRY'] = $this->language;
435
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_PUBLIC_KEY'] = $publicKey;
436
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_SIMULATOR_IS_ENABLED'] = $simulatorIsEnabled;
437
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_IS_ENABLED'] = $isEnabled;
438
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_LOGO'] = 'https://cdn.digitalorigin.com/assets/master/logos/pg-favicon.png';
439
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_PAYMENT_URL'] = $link->getModuleLink('pagantis', 'payment') . '&product=' . $productConfigs['CODE'];
440
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_PS_VERSION'] = str_replace('.', '-', Tools::substr(_PS_VERSION_, 0, 3));
431
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_AMOUNT'] = $orderTotal;
432
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_PROMOTED_AMOUNT'] = $promotedAmount;
433
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_LOCALE'] = $this->language;
434
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_COUNTRY'] = $this->language;
435
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_PUBLIC_KEY'] = $publicKey;
436
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_SIMULATOR_IS_ENABLED'] = $simulatorIsEnabled;
437
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_IS_ENABLED'] = $isEnabled;
438
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_LOGO'] = 'https://cdn.digitalorigin.com/assets/master/logos/pg-favicon.png';
439
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_PAYMENT_URL'] = $link->getModuleLink('pagantis', 'payment').'&product='.$productConfigs['CODE'];
440
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_PS_VERSION'] = str_replace('.', '-', Tools::substr(_PS_VERSION_, 0, 3));
441 441
 
442 442
                 foreach ($productConfigs as $productConfigKey => $productConfigValue) {
443
-                    $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . "_" . $productConfigKey] = $productConfigValue;
443
+                    $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE']))."_".$productConfigKey] = $productConfigValue;
444 444
                 }
445 445
                 $this->context->smarty->assign($templateConfigs);
446 446
 
447 447
                 $paymentOption = new PrestaShop\PrestaShop\Core\Payment\PaymentOption();
448 448
                 $uri = $link->getModuleLink('pagantis', 'payment');
449 449
                 if (strpos($uri, '?') !== false) {
450
-                    $uri .= '&product=' . $productConfigs['CODE'];
450
+                    $uri .= '&product='.$productConfigs['CODE'];
451 451
                 } else {
452
-                    $uri .= '?product=' . $productConfigs['CODE'];
452
+                    $uri .= '?product='.$productConfigs['CODE'];
453 453
                 }
454 454
                 $paymentOption
455
-                    ->setCallToActionText($templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_TITLE'])
455
+                    ->setCallToActionText($templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_TITLE'])
456 456
                     ->setAction($uri)
457
-                    ->setLogo($templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_LOGO'])
457
+                    ->setLogo($templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_LOGO'])
458 458
                     ->setModuleName(__CLASS__)
459 459
                     ->setAdditionalInformation(
460
-                        $this->fetch('module:pagantis/views/templates/hook/checkout-' . Tools::strtolower($productConfigs['CODE']) . '.tpl')
460
+                        $this->fetch('module:pagantis/views/templates/hook/checkout-'.Tools::strtolower($productConfigs['CODE']).'.tpl')
461 461
                     )
462 462
                 ;
463 463
                 $return[] = $paymentOption;
@@ -481,61 +481,61 @@  discard block
 block discarded – undo
481 481
         foreach ($products as $product) {
482 482
             $code = Tools::strtolower(Pagantis::getExtraConfig('CODE', $product));
483 483
             $inputs[] = array(
484
-                'name' => $code .'_is_enabled',
485
-                'type' =>  (version_compare(_PS_VERSION_, '1.6')<0) ?'radio' :'switch',
486
-                'label' => $this->l('Module is enabled ' . $code),
484
+                'name' => $code.'_is_enabled',
485
+                'type' =>  (version_compare(_PS_VERSION_, '1.6') < 0) ? 'radio' : 'switch',
486
+                'label' => $this->l('Module is enabled '.$code),
487 487
                 'prefix' => '<i class="icon icon-key"></i>',
488 488
                 'class' => 't',
489 489
                 'required' => true,
490 490
                 'values'=> array(
491 491
                     array(
492
-                        'id' => $code .'_is_enabled_true',
492
+                        'id' => $code.'_is_enabled_true',
493 493
                         'value' => 1,
494 494
                         'label' => $this->l('Yes', get_class($this), null, false),
495 495
                     ),
496 496
                     array(
497
-                        'id' => $code . '_is_enabled_false',
497
+                        'id' => $code.'_is_enabled_false',
498 498
                         'value' => 0,
499 499
                         'label' => $this->l('No', get_class($this), null, false),
500 500
                     ),
501 501
                 )
502 502
             );
503 503
             $inputs[] = array(
504
-                'name' => $code . '_public_key',
504
+                'name' => $code.'_public_key',
505 505
                 'suffix' => $this->l('ex: pk_fd53cd467ba49022e4gf215e'),
506 506
                 'type' => 'text',
507 507
                 'size' => 60,
508
-                'label' => $this->l('Public Key ' . $code),
508
+                'label' => $this->l('Public Key '.$code),
509 509
                 'prefix' => '<i class="icon icon-key"></i>',
510 510
                 'col' => 6,
511 511
                 'required' => true,
512 512
             );
513 513
             $inputs[] = array(
514
-                'name' => $code . '_private_key',
514
+                'name' => $code.'_private_key',
515 515
                 'suffix' => $this->l('ex: 21e5723a97459f6a'),
516 516
                 'type' => 'text',
517 517
                 'size' => 60,
518
-                'label' => $this->l('Private Key ' . $code),
518
+                'label' => $this->l('Private Key '.$code),
519 519
                 'prefix' => '<i class="icon icon-key"></i>',
520 520
                 'col' => 6,
521 521
                 'required' => true,
522 522
             );
523 523
             if ($code !== "p4x") {
524 524
                 $inputs[] = array(
525
-                    'name' => $code . '_simulator_is_enabled',
526
-                    'type' => (version_compare(_PS_VERSION_, '1.6')<0) ?'radio' :'switch',
527
-                    'label' => $this->l('Simulator is enabled ' . $code),
525
+                    'name' => $code.'_simulator_is_enabled',
526
+                    'type' => (version_compare(_PS_VERSION_, '1.6') < 0) ? 'radio' : 'switch',
527
+                    'label' => $this->l('Simulator is enabled '.$code),
528 528
                     'prefix' => '<i class="icon icon-key"></i>',
529 529
                     'class' => 't',
530 530
                     'required' => true,
531 531
                     'values'=> array(
532 532
                         array(
533
-                            'id' => $code . '_simulator_is_enabled_on',
533
+                            'id' => $code.'_simulator_is_enabled_on',
534 534
                             'value' => 1,
535 535
                             'label' => $this->l('Yes'),
536 536
                         ),
537 537
                         array(
538
-                            'id' => $code . '_simulator_is_enabled_off',
538
+                            'id' => $code.'_simulator_is_enabled_off',
539 539
                             'value' => 0,
540 540
                             'label' => $this->l('No'),
541 541
                         ),
@@ -603,17 +603,17 @@  discard block
 block discarded – undo
603 603
         $products = explode(',', Pagantis::getExtraConfig('PRODUCTS', null));
604 604
         foreach ($products as $product) {
605 605
             $code = Tools::strtolower(Pagantis::getExtraConfig('CODE', $product));
606
-            $settings[$code . '_public_key'] = Configuration::get($code . '_public_key');
607
-            $settings[$code . '_private_key'] = Configuration::get($code . '_private_key');
608
-            $settings[$code . '_is_enabled'] = Configuration::get($code . '_is_enabled');
606
+            $settings[$code.'_public_key'] = Configuration::get($code.'_public_key');
607
+            $settings[$code.'_private_key'] = Configuration::get($code.'_private_key');
608
+            $settings[$code.'_is_enabled'] = Configuration::get($code.'_is_enabled');
609 609
             if ($code !== 'p4x') {
610
-                $settings[$code . '_simulator_is_enabled'] = Configuration::get($code . '_simulator_is_enabled');
610
+                $settings[$code.'_simulator_is_enabled'] = Configuration::get($code.'_simulator_is_enabled');
611 611
             }
612
-            $settingsKeys[] = $code . '_is_enabled';
613
-            $settingsKeys[] = $code . '_public_key';
614
-            $settingsKeys[] = $code . '_private_key';
612
+            $settingsKeys[] = $code.'_is_enabled';
613
+            $settingsKeys[] = $code.'_public_key';
614
+            $settingsKeys[] = $code.'_private_key';
615 615
             if ($code !== 'p4x') {
616
-                $settingsKeys[] = $code . '_simulator_is_enabled';
616
+                $settingsKeys[] = $code.'_simulator_is_enabled';
617 617
             }
618 618
         }
619 619
 
@@ -684,43 +684,43 @@  discard block
 block discarded – undo
684 684
             if ($this->isPaymentMethodAvailable($product)) {
685 685
                 $productConfigs = Pagantis::getExtraConfig($product, null);
686 686
                 $productConfigs = json_decode($productConfigs, true);
687
-                $publicKey = Configuration::get(Tools::strtolower($productConfigs['CODE']) . '_public_key');
688
-                $simulatorIsEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']) . '_simulator_is_enabled');
689
-                $isEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']) . '_is_enabled');
687
+                $publicKey = Configuration::get(Tools::strtolower($productConfigs['CODE']).'_public_key');
688
+                $simulatorIsEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']).'_simulator_is_enabled');
689
+                $isEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']).'_is_enabled');
690 690
 
691
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_TITLE'] = $this->l($productConfigs['TITLE']);
691
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_TITLE'] = $this->l($productConfigs['TITLE']);
692 692
                 unset($productConfigs['TITLE']);
693
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_AMOUNT'] = $orderTotal;
694
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_PROMOTED_AMOUNT'] = $promotedAmount;
695
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_LOCALE'] = $this->language;
696
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_COUNTRY'] = $this->language;
697
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_PUBLIC_KEY'] = $publicKey;
698
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_SIMULATOR_IS_ENABLED'] = $simulatorIsEnabled;
699
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_IS_ENABLED'] = $isEnabled;
700
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_LOGO'] = 'https://cdn.digitalorigin.com/assets/master/logos/pg-favicon.png';
693
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_AMOUNT'] = $orderTotal;
694
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_PROMOTED_AMOUNT'] = $promotedAmount;
695
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_LOCALE'] = $this->language;
696
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_COUNTRY'] = $this->language;
697
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_PUBLIC_KEY'] = $publicKey;
698
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_SIMULATOR_IS_ENABLED'] = $simulatorIsEnabled;
699
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_IS_ENABLED'] = $isEnabled;
700
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_LOGO'] = 'https://cdn.digitalorigin.com/assets/master/logos/pg-favicon.png';
701 701
                 $uri = $link->getModuleLink('pagantis', 'payment');
702 702
                 if (strpos($uri, '?') !== false) {
703
-                    $uri .= '&product=' . $productConfigs['CODE'];
703
+                    $uri .= '&product='.$productConfigs['CODE'];
704 704
                 } else {
705
-                    $uri .= '?product=' . $productConfigs['CODE'];
705
+                    $uri .= '?product='.$productConfigs['CODE'];
706 706
                 }
707
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_PAYMENT_URL'] = $uri;
708
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_PS_VERSION'] = str_replace('.', '-', Tools::substr(_PS_VERSION_, 0, 3));
707
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_PAYMENT_URL'] = $uri;
708
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_PS_VERSION'] = str_replace('.', '-', Tools::substr(_PS_VERSION_, 0, 3));
709 709
 
710 710
                 foreach ($productConfigs as $productConfigKey => $productConfigValue) {
711
-                    $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . "_" . $productConfigKey] = $productConfigValue;
711
+                    $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE']))."_".$productConfigKey] = $productConfigValue;
712 712
                 }
713 713
                 $this->context->smarty->assign($templateConfigs);
714 714
                 if ($supercheckout_enabled || $onepagecheckout_enabled || $onepagecheckoutps_enabled) {
715 715
                     $this->checkLogoExists();
716 716
                     $return .= $this->display(
717 717
                         __FILE__,
718
-                        'views/templates/hook/onepagecheckout-' . Tools::strtolower($productConfigs['CODE']) . '.tpl'
718
+                        'views/templates/hook/onepagecheckout-'.Tools::strtolower($productConfigs['CODE']).'.tpl'
719 719
                     );
720 720
                 } elseif (_PS_VERSION_ < 1.7) {
721 721
                     $return .= $this->display(
722 722
                         __FILE__,
723
-                        'views/templates/hook/checkout-' . Tools::strtolower($productConfigs['CODE']) . '.tpl'
723
+                        'views/templates/hook/checkout-'.Tools::strtolower($productConfigs['CODE']).'.tpl'
724 724
                     );
725 725
                 }
726 726
             }
@@ -753,12 +753,12 @@  discard block
 block discarded – undo
753 753
             $productConfigs = Pagantis::getExtraConfig($product, null);
754 754
             $productConfigs = json_decode($productConfigs, true);
755 755
 
756
-            $publicKey = Configuration::get(Tools::strtolower($productConfigs['CODE']) . '_public_key');
757
-            $simulatorIsEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']) . '_simulator_is_enabled');
756
+            $publicKey = Configuration::get(Tools::strtolower($productConfigs['CODE']).'_public_key');
757
+            $simulatorIsEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']).'_simulator_is_enabled');
758 758
             if (Tools::strtolower($productConfigs['CODE']) === 'p4x') {
759 759
                 $simulatorIsEnabled = true;
760 760
             }
761
-            $isEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']) . '_is_enabled');
761
+            $isEnabled = Configuration::get(Tools::strtolower($productConfigs['CODE']).'_is_enabled');
762 762
             $availableSimulators = array(
763 763
                 'hookDisplayProductButtons' => array(
764 764
                     'sdk.simulator.types.SIMPLE',
@@ -781,30 +781,30 @@  discard block
 block discarded – undo
781 781
                 in_array(Tools::strtolower($this->language), $allowedCountries) &&
782 782
                 (in_array($productConfigs['SIMULATOR_DISPLAY_TYPE'], $availableSimulators[$hookName]) || _PS_VERSION_ < 1.6)
783 783
             ) {
784
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_TITLE'] = $this->l($productConfigs['TITLE']);
785
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_SIMULATOR_TITLE'] = $this->l($productConfigs['SIMULATOR_TITLE']);
786
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_SIMULATOR_SUBTITLE'] = $this->l($productConfigs['SIMULATOR_SUBTITLE']);
784
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_TITLE'] = $this->l($productConfigs['TITLE']);
785
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_SIMULATOR_TITLE'] = $this->l($productConfigs['SIMULATOR_TITLE']);
786
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_SIMULATOR_SUBTITLE'] = $this->l($productConfigs['SIMULATOR_SUBTITLE']);
787 787
                 unset($productConfigs['TITLE']);
788 788
                 unset($productConfigs['SIMULATOR_TITLE']);
789 789
                 unset($productConfigs['SIMULATOR_SUBTITLE']);
790
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_AMOUNT'] = $amount;
791
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_AMOUNT4X'] = number_format(($amount / 4), 2, '.', '');
792
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_IS_PROMOTED_PRODUCT'] = $isPromotedProduct;
793
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_LOCALE'] = $this->language;
794
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_COUNTRY'] = $this->language;
795
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_PUBLIC_KEY'] = $publicKey;
796
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_SIMULATOR_IS_ENABLED'] = $simulatorIsEnabled;
797
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_IS_ENABLED'] = $isEnabled;
798
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_LOGO'] = 'https://cdn.digitalorigin.com/assets/master/logos/pg-favicon.png';
799
-                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . '_PS_VERSION'] = str_replace('.', '-', Tools::substr(_PS_VERSION_, 0, 3));
790
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_AMOUNT'] = $amount;
791
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_AMOUNT4X'] = number_format(($amount / 4), 2, '.', '');
792
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_IS_PROMOTED_PRODUCT'] = $isPromotedProduct;
793
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_LOCALE'] = $this->language;
794
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_COUNTRY'] = $this->language;
795
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_PUBLIC_KEY'] = $publicKey;
796
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_SIMULATOR_IS_ENABLED'] = $simulatorIsEnabled;
797
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_IS_ENABLED'] = $isEnabled;
798
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_LOGO'] = 'https://cdn.digitalorigin.com/assets/master/logos/pg-favicon.png';
799
+                $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])).'_PS_VERSION'] = str_replace('.', '-', Tools::substr(_PS_VERSION_, 0, 3));
800 800
                 foreach ($productConfigs as $productConfigKey => $productConfigValue) {
801
-                    $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE'])) . "_" . $productConfigKey] = $productConfigValue;
801
+                    $templateConfigs[Tools::strtoupper(Tools::strtolower($productConfigs['CODE']))."_".$productConfigKey] = $productConfigValue;
802 802
                 }
803 803
 
804 804
                 $this->context->smarty->assign($templateConfigs);
805 805
                 $return .= $this->display(
806 806
                     __FILE__,
807
-                    'views/templates/hook/product-simulator-' . Tools::strtolower($productConfigs['CODE']) . '.tpl'
807
+                    'views/templates/hook/product-simulator-'.Tools::strtolower($productConfigs['CODE']).'.tpl'
808 808
                 );
809 809
             }
810 810
         }
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
         // $params['type'] = weight | price | after_price
834 834
         if (isset($params['type']) && $params['type'] === 'price' &&
835 835
             isset($params['smarty']) && isset($params['smarty']->template_resource) &&
836
-            (strpos($params['smarty']->template_resource, 'product.tpl') !== false  ||
836
+            (strpos($params['smarty']->template_resource, 'product.tpl') !== false ||
837 837
             strpos($params['smarty']->template_resource, 'product-prices.tpl') !== false)
838 838
         ) {
839 839
             return $this->productPageSimulatorDisplay("hookDisplayProductPriceBlock");
@@ -866,16 +866,16 @@  discard block
 block discarded – undo
866 866
         if (!in_array(PROMOTIONS_CATEGORY_NAME, $categories)) {
867 867
             /** @var CategoryCore $category */
868 868
             $category = new Category();
869
-            $categoryArray = array((int)Configuration::get('PS_LANG_DEFAULT')=> PROMOTIONS_CATEGORY );
869
+            $categoryArray = array((int) Configuration::get('PS_LANG_DEFAULT')=> PROMOTIONS_CATEGORY);
870 870
             $category->is_root_category = false;
871 871
             $category->link_rewrite = $categoryArray;
872 872
             $category->meta_description = $categoryArray;
873 873
             $category->meta_keywords = $categoryArray;
874 874
             $category->meta_title = $categoryArray;
875
-            $category->name = array((int)Configuration::get('PS_LANG_DEFAULT')=> PROMOTIONS_CATEGORY_NAME);
875
+            $category->name = array((int) Configuration::get('PS_LANG_DEFAULT')=> PROMOTIONS_CATEGORY_NAME);
876 876
             $category->id_parent = Configuration::get('PS_HOME_CATEGORY');
877
-            $category->active=0;
878
-            $description = 'Pagantis: Products with this category have free financing assumed by the merchant. ' .
877
+            $category->active = 0;
878
+            $description = 'Pagantis: Products with this category have free financing assumed by the merchant. '.
879 879
                 'Use it to promote your products or brands.';
880 880
             $category->description = $this->l($description);
881 881
             $category->save();
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
         }
896 896
 
897 897
         if (is_null($product)) {
898
-            $sql = 'SELECT value FROM '._DB_PREFIX_.'pagantis_config where config = \'' . pSQL($config) . '\' limit 1';
898
+            $sql = 'SELECT value FROM '._DB_PREFIX_.'pagantis_config where config = \''.pSQL($config).'\' limit 1';
899 899
             if ($results = Db::getInstance()->ExecuteS($sql)) {
900 900
                 if (is_array($results) && count($results) === 1 && isset($results[0]['value'])) {
901 901
                     return $results[0]['value'];
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
             }
904 904
         }
905 905
 
906
-        $sql = 'SELECT value FROM '._DB_PREFIX_.'pagantis_config where config = \'' . pSQL($product) . '\' limit 1';
906
+        $sql = 'SELECT value FROM '._DB_PREFIX_.'pagantis_config where config = \''.pSQL($product).'\' limit 1';
907 907
         if ($results = Db::getInstance()->ExecuteS($sql)) {
908 908
             if (is_array($results) && count($results) === 1 && isset($results[0]['value'])) {
909 909
                 $configs = json_decode($results[0]['value'], true);
@@ -923,10 +923,10 @@  discard block
 block discarded – undo
923 923
      */
924 924
     public function checkLogoExists()
925 925
     {
926
-        $logoPg = _PS_MODULE_DIR_ . '/onepagecheckoutps/views/img/payments/pagantis.png';
927
-        if (!file_exists($logoPg) && is_dir(_PS_MODULE_DIR_ . '/onepagecheckoutps/views/img/payments')) {
926
+        $logoPg = _PS_MODULE_DIR_.'/onepagecheckoutps/views/img/payments/pagantis.png';
927
+        if (!file_exists($logoPg) && is_dir(_PS_MODULE_DIR_.'/onepagecheckoutps/views/img/payments')) {
928 928
             copy(
929
-                _PS_PAGANTIS_DIR . '/logo.png',
929
+                _PS_PAGANTIS_DIR.'/logo.png',
930 930
                 $logoPg
931 931
             );
932 932
         }
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
         if (count($langArray) != 2 && isset($lang['locale'])) {
943 943
             $langArray = explode("-", $lang['locale']);
944 944
         }
945
-        $this->language = Tools::strtoupper($langArray[count($langArray)-1]);
945
+        $this->language = Tools::strtoupper($langArray[count($langArray) - 1]);
946 946
         // Prevent null language detection
947 947
         if (in_array(Tools::strtolower($this->language), $this->allowedCountries)) {
948 948
             return;
Please login to merge, or discard this patch.
controllers/front/api.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
         header('HTTP/1.1 200 Ok', true, 200);
72 72
         header('Content-Type: application/json', true);
73
-        header('Content-Length: ' . Tools::strlen($result));
73
+        header('Content-Length: '.Tools::strlen($result));
74 74
 
75 75
         echo $result;
76 76
         exit();
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     {
84 84
         $productCode = Tools::getValue('product', false);
85 85
         $products = explode(',', Pagantis::getExtraConfig('PRODUCTS', null));
86
-        $privateKey = Configuration::get(Tools::strtolower($productCode) . '_private_key');
86
+        $privateKey = Configuration::get(Tools::strtolower($productCode).'_private_key');
87 87
         $privateKeyGet = Tools::getValue('secret', false);
88 88
         if (!empty($privateKeyGet) && $privateKeyGet === $privateKey && in_array(Tools::strtoupper($productCode), $products)) {
89 89
             return true;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         header('HTTP/1.1 403 Forbidden', true, 403);
98 98
         header('Content-Type: application/json', true);
99
-        header('Content-Length: ' . Tools::strlen($result));
99
+        header('Content-Length: '.Tools::strlen($result));
100 100
 
101 101
         echo $result;
102 102
         exit();
Please login to merge, or discard this patch.
controllers/front/log.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
             $limit = Tools::getValue('limit');
37 37
         }
38 38
         if (Tools::getValue('from', false)) {
39
-            $where = 'WHERE createdAt >= \'' . Tools::getValue('from') . '\'';
39
+            $where = 'WHERE createdAt >= \''.Tools::getValue('from').'\'';
40 40
         }
41
-        $sql = 'SELECT * FROM ' . _DB_PREFIX_ . 'pagantis_log ' . $where . ' ORDER BY id desc LIMIT ' . $limit;
41
+        $sql = 'SELECT * FROM '._DB_PREFIX_.'pagantis_log '.$where.' ORDER BY id desc LIMIT '.$limit;
42 42
         if ($results = Db::getInstance()->ExecuteS($sql)) {
43 43
             foreach ($results as $row) {
44 44
                 $data = (is_null(json_decode($row['log']))) ? $row['log'] : json_decode($row['log']);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
         header('HTTP/1.1 200 Ok', true, 200);
67 67
         header('Content-Type: application/json', true);
68
-        header('Content-Length: ' . Tools::strlen($result));
68
+        header('Content-Length: '.Tools::strlen($result));
69 69
 
70 70
         echo $result;
71 71
         exit();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $productCode = Tools::getValue('product', false);
80 80
         $products = explode(',', Pagantis::getExtraConfig('PRODUCTS', null));
81
-        $privateKey = Configuration::get(Tools::strtolower($productCode) . '_private_key');
81
+        $privateKey = Configuration::get(Tools::strtolower($productCode).'_private_key');
82 82
         $privateKeyGet = Tools::getValue('secret', false);
83 83
         if (!empty($privateKeyGet) && $privateKeyGet === $privateKey && in_array(Tools::strtoupper($productCode), $products)) {
84 84
             return true;
Please login to merge, or discard this patch.
controllers/front/payment.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
     {
29 29
         if (_PS_VERSION_ < 1.6) {
30 30
             Logger::addLog(
31
-                'Pagantis Exception For user ' .
32
-                $customer->email .
33
-                ' : ' .
31
+                'Pagantis Exception For user '.
32
+                $customer->email.
33
+                ' : '.
34 34
                 $exception->getMessage(),
35 35
                 3,
36 36
                 $exception->getCode(),
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
             );
41 41
         } else {
42 42
             PrestaShopLogger::addLog(
43
-                'Pagantis Exception For user ' .
44
-                $customer->email .
45
-                ' : ' .
43
+                'Pagantis Exception For user '.
44
+                $customer->email.
45
+                ' : '.
46 46
                 $exception->getMessage(),
47 47
                 3,
48 48
                 $exception->getCode(),
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
         $configs = json_decode(Pagantis::getExtraConfig($product, null), true);
87 87
         $iframe = Pagantis::getExtraConfig('FORM_DISPLAY_TYPE', $product);
88 88
 
89
-        $pagantisPublicKey = Configuration::get(Tools::strtolower($configs['CODE']) . '_public_key');
90
-        $pagantisPrivateKey = Configuration::get(Tools::strtolower($configs['CODE']) . '_private_key');
89
+        $pagantisPublicKey = Configuration::get(Tools::strtolower($configs['CODE']).'_public_key');
90
+        $pagantisPrivateKey = Configuration::get(Tools::strtolower($configs['CODE']).'_private_key');
91 91
 
92 92
         $okUrl = _PS_BASE_URL_SSL_.__PS_BASE_URI__
93
-            .'index.php?canonical=true&fc=module&module=pagantis&controller=notify&origin=redirect&product=' . Tools::strtolower($configs['CODE']) . '&'
93
+            .'index.php?canonical=true&fc=module&module=pagantis&controller=notify&origin=redirect&product='.Tools::strtolower($configs['CODE']).'&'
94 94
             .http_build_query($query)
95 95
         ;
96 96
         $notificationOkUrl = _PS_BASE_URL_SSL_.__PS_BASE_URI__
97
-            .'index.php?canonical=true&fc=module&module=pagantis&controller=notify&origin=notification&product=' . Tools::strtolower($configs['CODE']) . '&'
97
+            .'index.php?canonical=true&fc=module&module=pagantis&controller=notify&origin=notification&product='.Tools::strtolower($configs['CODE']).'&'
98 98
             .http_build_query($query)
99 99
         ;
100 100
 
@@ -109,27 +109,27 @@  discard block
 block discarded – undo
109 109
 
110 110
         try {
111 111
             $shippingCountry = Country::getIsoById($shippingAddress->id_country);
112
-            $userAddress =  new \Pagantis\OrdersApiClient\Model\Order\User\Address();
112
+            $userAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address();
113 113
             $userAddress
114 114
                 ->setZipCode($shippingAddress->postcode)
115
-                ->setFullName($shippingAddress->firstname . ' ' . $shippingAddress->lastname)
115
+                ->setFullName($shippingAddress->firstname.' '.$shippingAddress->lastname)
116 116
                 ->setCountryCode($shippingCountry)
117 117
                 ->setCity($shippingAddress->city)
118
-                ->setAddress($shippingAddress->address1 . ' ' . $shippingAddress->address2)
118
+                ->setAddress($shippingAddress->address1.' '.$shippingAddress->address2)
119 119
                 ->setTaxId($this->getTaxId($customer, $shippingAddress, $billingAddress))
120 120
                 ->setNationalId($this->getNationalId($customer, $shippingAddress, $billingAddress))
121 121
                 ->setDni($this->getNationalId($customer, $shippingAddress, $billingAddress))
122 122
             ;
123 123
 
124
-            $orderShippingAddress =  new \Pagantis\OrdersApiClient\Model\Order\User\Address();
124
+            $orderShippingAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address();
125 125
             $shippingPhone = (empty($shippingAddress->phone_mobile)) ?
126 126
                 $shippingAddress->phone : $shippingAddress->phone_mobile;
127 127
             $orderShippingAddress
128 128
                 ->setZipCode($shippingAddress->postcode)
129
-                ->setFullName($shippingAddress->firstname . ' ' . $shippingAddress->lastname)
129
+                ->setFullName($shippingAddress->firstname.' '.$shippingAddress->lastname)
130 130
                 ->setCountryCode($shippingCountry)
131 131
                 ->setCity($shippingAddress->city)
132
-                ->setAddress($shippingAddress->address1 . ' ' . $shippingAddress->address2)
132
+                ->setAddress($shippingAddress->address1.' '.$shippingAddress->address2)
133 133
                 ->setTaxId($this->getTaxId($customer, $shippingAddress, $billingAddress))
134 134
                 ->setNationalId($this->getNationalId($customer, $shippingAddress, $billingAddress))
135 135
                 ->setDni($this->getNationalId($customer, $shippingAddress, $billingAddress))
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
                 $billingAddress->phone : $billingAddress->phone_mobile;
144 144
             $orderBillingAddress
145 145
                 ->setZipCode($billingAddress->postcode)
146
-                ->setFullName($billingAddress->firstname . ' ' . $billingAddress->lastname)
146
+                ->setFullName($billingAddress->firstname.' '.$billingAddress->lastname)
147 147
                 ->setCountryCode($billingCountry)
148 148
                 ->setCity($billingAddress->city)
149
-                ->setAddress($billingAddress->address1 . ' ' . $billingAddress->address2)
149
+                ->setAddress($billingAddress->address1.' '.$billingAddress->address2)
150 150
                 ->setTaxId($this->getTaxId($customer, $billingAddress, $shippingAddress))
151 151
                 ->setNationalId($this->getNationalId($customer, $billingAddress, $shippingAddress))
152 152
                 ->setDni($this->getNationalId($customer, $shippingAddress, $billingAddress))
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
                 ->setDni($this->getNationalId($customer, $shippingAddress, $billingAddress))
170 170
             ;
171 171
 
172
-            if ($customer->birthday!='0000-00-00') {
172
+            if ($customer->birthday != '0000-00-00') {
173 173
                 $orderUser->setDateOfBirth($customer->birthday);
174 174
             }
175 175
 
@@ -203,13 +203,13 @@  discard block
 block discarded – undo
203 203
                     ->setQuantity($item['quantity'])
204 204
                     ->setDescription($item['name']);
205 205
                 if ($promotedProduct) {
206
-                    $promotedAmount+=$product->getAmount();
206
+                    $promotedAmount += $product->getAmount();
207 207
                     $productId = $item['id_product'];
208 208
                     $finalPrice = Product::getPriceStatic($productId);
209
-                    $promotedMessage = 'Promoted Item: ' . $product->getDescription() .
210
-                        ' Price: ' . $finalPrice .
211
-                        ' Qty: ' . $product->getQuantity() .
212
-                        ' Item ID: ' . $item['id_product'];
209
+                    $promotedMessage = 'Promoted Item: '.$product->getDescription().
210
+                        ' Price: '.$finalPrice.
211
+                        ' Qty: '.$product->getQuantity().
212
+                        ' Item ID: '.$item['id_product'];
213 213
                     $metadataOrder->addMetadata('promotedProduct', $promotedMessage);
214 214
                 }
215 215
                 $details->addProduct($product);
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             Tools::redirect($cancelUrl);
261 261
         }
262 262
 
263
-        $url ='';
263
+        $url = '';
264 264
         try {
265 265
             $orderClient = new \Pagantis\OrdersApiClient\Client(
266 266
                 trim($pagantisPublicKey),
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
                 $url = $order->getActionUrls()->getForm();
273 273
                 /** @var string $orderId MD5 value */
274 274
                 $orderId = $order->getId();
275
-                $sql = "INSERT INTO `" . _DB_PREFIX_ . "pagantis_order` (`id`, `order_id`)
275
+                $sql = "INSERT INTO `"._DB_PREFIX_."pagantis_order` (`id`, `order_id`)
276 276
                      VALUES ('$cart->id','$orderId') 
277 277
                      ON DUPLICATE KEY UPDATE `order_id` = '$orderId'";
278 278
                 $result = Db::getInstance()->execute($sql);
279 279
                 if (!$result) {
280
-                    throw new UnknownException('Unable to save pagantis-order-id in database: '. $sql);
280
+                    throw new UnknownException('Unable to save pagantis-order-id in database: '.$sql);
281 281
                 }
282 282
             } else {
283 283
                 throw new OrderNotFoundException();
@@ -409,13 +409,13 @@  discard block
 block discarded – undo
409 409
      */
410 410
     private function getUserLanguage($shippingAddress = null, $billingAddress = null)
411 411
     {
412
-        $allowedCountries    = unserialize(Pagantis::getExtraConfig('ALLOWED_COUNTRIES', null));
412
+        $allowedCountries = unserialize(Pagantis::getExtraConfig('ALLOWED_COUNTRIES', null));
413 413
         $lang = Language::getLanguage($this->context->language->id);
414 414
         $langArray = explode("-", $lang['language_code']);
415 415
         if (count($langArray) != 2 && isset($lang['locale'])) {
416 416
             $langArray = explode("-", $lang['locale']);
417 417
         }
418
-        $language = Tools::strtoupper($langArray[count($langArray)-1]);
418
+        $language = Tools::strtoupper($langArray[count($langArray) - 1]);
419 419
         // Prevent null language detection
420 420
         if (in_array(Tools::strtolower($language), $allowedCountries)) {
421 421
             return $language;
Please login to merge, or discard this patch.
controllers/front/notify.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         } catch (\Exception $exception) {
139 139
             $thrownException = true;
140 140
             $this->getMerchantOrderId();
141
-            $theId = ($this->merchantOrderId)? $this->merchantOrderId : $this->merchantCartId;
141
+            $theId = ($this->merchantOrderId) ? $this->merchantOrderId : $this->merchantCartId;
142 142
             if ($this->isPost()) {
143 143
                 $this->jsonResponse = new JsonExceptionResponse();
144 144
                 $this->jsonResponse->setMerchantOrderId($theId);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             if (!$thrownException) {
153 153
                 $this->jsonResponse = new JsonSuccessResponse();
154 154
                 $this->getMerchantOrderId();
155
-                $theId = ($this->merchantOrderId)? $this->merchantOrderId : $this->merchantCartId;
155
+                $theId = ($this->merchantOrderId) ? $this->merchantOrderId : $this->merchantCartId;
156 156
                 $this->jsonResponse->setMerchantOrderId($theId);
157 157
                 $this->jsonResponse->setPagantisOrderId($this->pagantisOrderId);
158 158
                 $this->confirmPagantisOrder();
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
             $this->rollbackMerchantOrder();
162 162
             if ($this->isNotification()) {
163 163
                 $this->getMerchantOrderId();
164
-                $theId = ($this->merchantOrderId)? $this->merchantOrderId : $this->merchantCartId;
164
+                $theId = ($this->merchantOrderId) ? $this->merchantOrderId : $this->merchantCartId;
165 165
                 $this->jsonResponse = new JsonExceptionResponse();
166 166
                 $this->jsonResponse->setMerchantOrderId($theId);
167 167
                 $this->jsonResponse->setPagantisOrderId($this->pagantisOrderId);
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
         $products = explode(',', Pagantis::getExtraConfig('PRODUCTS', null));
229 229
         if (!in_array(Tools::strtoupper($productCode), $products)) {
230 230
             throw new UnknownException(
231
-                'No valid Pagantis product provided in the url: ' . Tools::getValue('product')
231
+                'No valid Pagantis product provided in the url: '.Tools::getValue('product')
232 232
             );
233 233
         }
234
-        $this->productName = "Pagantis " . Tools::strtolower($productCode);
234
+        $this->productName = "Pagantis ".Tools::strtolower($productCode);
235 235
 
236
-        $this->config['publicKey'] = trim(Configuration::get(Tools::strtolower($productCode) . '_public_key'));
237
-        $this->config['privateKey'] = trim(Configuration::get(Tools::strtolower($productCode) . '_private_key'));
236
+        $this->config['publicKey'] = trim(Configuration::get(Tools::strtolower($productCode).'_public_key'));
237
+        $this->config['privateKey'] = trim(Configuration::get(Tools::strtolower($productCode).'_private_key'));
238 238
 
239 239
         $this->merchantCartId = Tools::getValue('id_cart');
240 240
 
@@ -254,8 +254,8 @@  discard block
 block discarded – undo
254 254
     public function getMerchantOrderId()
255 255
     {
256 256
         try {
257
-            $table = _DB_PREFIX_ .self::ORDERS_TABLE;
258
-            $sql = 'select ps_order_id from ' . $table .' where id = ' .(int)$this->merchantCartId;
257
+            $table = _DB_PREFIX_.self::ORDERS_TABLE;
258
+            $sql = 'select ps_order_id from '.$table.' where id = '.(int) $this->merchantCartId;
259 259
             $this->merchantOrderId = Db::getInstance()->getValue($sql);
260 260
         } catch (\Exception $exception) {
261 261
             $exceptionMessage = sprintf(
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
     private function getPagantisOrderId()
300 300
     {
301 301
         try {
302
-            $this->pagantisOrderId= Db::getInstance()->getValue(
303
-                'select order_id from '._DB_PREFIX_.self::ORDERS_TABLE.' where id = '.(int)$this->merchantCartId
302
+            $this->pagantisOrderId = Db::getInstance()->getValue(
303
+                'select order_id from '._DB_PREFIX_.self::ORDERS_TABLE.' where id = '.(int) $this->merchantCartId
304 304
             );
305 305
 
306 306
             if (is_null($this->pagantisOrderId)) {
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
     {
335 335
         if ($this->pagantisOrder->getStatus() === PagantisModelOrder::STATUS_CONFIRMED) {
336 336
             $this->getMerchantOrderId();
337
-            $theId = ($this->merchantOrderId)? $this->merchantOrderId : $this->merchantCartId;
337
+            $theId = ($this->merchantOrderId) ? $this->merchantOrderId : $this->merchantCartId;
338 338
             $this->jsonResponse = new JsonSuccessResponse();
339 339
             $this->jsonResponse->setMerchantOrderId($theId);
340 340
             $this->jsonResponse->setPagantisOrderId($this->pagantisOrderId);
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 $psTotalAmount = substr_replace(
367 367
                     $merchantAmount,
368 368
                     '.',
369
-                    (Tools::strlen($merchantAmount) -2),
369
+                    (Tools::strlen($merchantAmount) - 2),
370 370
                     0
371 371
                 );
372 372
 
@@ -374,14 +374,14 @@  discard block
 block discarded – undo
374 374
                 $pgTotalAmount = substr_replace(
375 375
                     $pgTotalAmountInCents,
376 376
                     '.',
377
-                    (Tools::strlen($pgTotalAmountInCents) -2),
377
+                    (Tools::strlen($pgTotalAmountInCents) - 2),
378 378
                     0
379 379
                 );
380 380
 
381
-                $this->amountMismatchError = '. Amount mismatch in PrestaShop Cart #'. $this->merchantCartId .
382
-                    ' compared with Pagantis Order: ' . $this->pagantisOrderId .
383
-                    '. The Cart in PrestaShop has an amount of ' . $psTotalAmount . ' and in Pagantis ' .
384
-                    $pgTotalAmount . ' PLEASE REVIEW THE ORDER';
381
+                $this->amountMismatchError = '. Amount mismatch in PrestaShop Cart #'.$this->merchantCartId.
382
+                    ' compared with Pagantis Order: '.$this->pagantisOrderId.
383
+                    '. The Cart in PrestaShop has an amount of '.$psTotalAmount.' and in Pagantis '.
384
+                    $pgTotalAmount.' PLEASE REVIEW THE ORDER';
385 385
 
386 386
                 $this->saveLog(array(
387 387
                     'requestId' => $this->requestId,
@@ -421,11 +421,11 @@  discard block
 block discarded – undo
421 421
             }
422 422
 
423 423
             // Double check
424
-            $tableName = _DB_PREFIX_ . self::ORDERS_TABLE;
424
+            $tableName = _DB_PREFIX_.self::ORDERS_TABLE;
425 425
             $fieldName = 'ps_order_id';
426
-            $sql = ('select ' . $fieldName . ' from `' . $tableName . '` where `id` = ' . (int)$this->merchantCartId
427
-                . ' and `order_id` = \'' . $this->pagantisOrderId . '\''
428
-                . ' and `' . $fieldName . '` is not null');
426
+            $sql = ('select '.$fieldName.' from `'.$tableName.'` where `id` = '.(int) $this->merchantCartId
427
+                . ' and `order_id` = \''.$this->pagantisOrderId.'\''
428
+                . ' and `'.$fieldName.'` is not null');
429 429
             $results = Db::getInstance()->ExecuteS($sql);
430 430
             if (is_array($results) && count($results) === 1) {
431 431
                 $this->getMerchantOrderId();
@@ -465,9 +465,9 @@  discard block
 block discarded – undo
465 465
                 Configuration::get('PS_OS_PAYMENT'),
466 466
                 $this->merchantCart->getOrderTotal(true),
467 467
                 $this->productName,
468
-                'pagantisOrderId: ' . $this->pagantisOrder->getId() . ' ' .
469
-                'pagantisOrderStatus: '. $this->pagantisOrder->getStatus() .
470
-                $this->amountMismatchError .
468
+                'pagantisOrderId: '.$this->pagantisOrder->getId().' '.
469
+                'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().
470
+                $this->amountMismatchError.
471 471
                 $metadataInfo,
472 472
                 array('transaction_id' => $this->pagantisOrderId),
473 473
                 null,
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             Db::getInstance()->update(
482 482
                 self::ORDERS_TABLE,
483 483
                 array('ps_order_id' => $this->module->currentOrder),
484
-                'id = '. (int)$this->merchantCartId . ' and order_id = \'' . $this->pagantisOrderId . '\''
484
+                'id = '.(int) $this->merchantCartId.' and order_id = \''.$this->pagantisOrderId.'\''
485 485
             );
486 486
 
487 487
         } catch (\Exception $exception) {
@@ -508,9 +508,9 @@  discard block
 block discarded – undo
508 508
             $this->orderClient->confirmOrder($this->pagantisOrderId);
509 509
             try {
510 510
                 $mode = ($this->isPost()) ? 'NOTIFICATION' : 'REDIRECTION';
511
-                $message = 'Order CONFIRMED. The order was confirmed by a ' . $mode .
512
-                    '. Pagantis OrderId=' . $this->pagantisOrderId .
513
-                    '. Prestashop OrderId=' . $this->module->currentOrder;
511
+                $message = 'Order CONFIRMED. The order was confirmed by a '.$mode.
512
+                    '. Pagantis OrderId='.$this->pagantisOrderId.
513
+                    '. Prestashop OrderId='.$this->module->currentOrder;
514 514
                 $this->saveLog(array('requestId' => $this->requestId, 'message' => $message));
515 515
             } catch (\Exception $exception) {
516 516
                 $exceptionMessage = sprintf(
@@ -537,16 +537,16 @@  discard block
 block discarded – undo
537 537
     {
538 538
         try {
539 539
             $this->getMerchantOrderId();
540
-            $message = 'Roolback method: ' .
541
-                '. Pagantis OrderId=' . $this->pagantisOrderId .
542
-                '. Prestashop CartId=' . $this->merchantCartId .
543
-                '. Prestashop OrderId=' . $this->merchantOrderId;
540
+            $message = 'Roolback method: '.
541
+                '. Pagantis OrderId='.$this->pagantisOrderId.
542
+                '. Prestashop CartId='.$this->merchantCartId.
543
+                '. Prestashop OrderId='.$this->merchantOrderId;
544 544
             if ($this->module->currentOrder) {
545 545
                 $objOrder = new Order($this->module->currentOrder);
546 546
                 $history = new OrderHistory();
547
-                $history->id_order = (int)$objOrder->id;
548
-                $history->changeIdOrderState(8, (int)($objOrder->id));
549
-                $message .= ' Prestashop OrderId=' . $this->merchantCartId;
547
+                $history->id_order = (int) $objOrder->id;
548
+                $history->changeIdOrderState(8, (int) ($objOrder->id));
549
+                $message .= ' Prestashop OrderId='.$this->merchantCartId;
550 550
             }
551 551
             $this->saveLog(array(
552 552
                 'requestId' => $this->requestId,
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
     {
572 572
         try {
573 573
             $table = self::CART_TABLE;
574
-            $insertBlock = Db::getInstance()->insert($table, array('id' =>(int)$orderId, 'timestamp' =>(time())));
574
+            $insertBlock = Db::getInstance()->insert($table, array('id' =>(int) $orderId, 'timestamp' =>(time())));
575 575
             if ($insertBlock === false) {
576 576
                 if ($this->isNotification()) {
577 577
                     throw new ConcurrencyException();
@@ -581,11 +581,11 @@  discard block
 block discarded – undo
581 581
                               as rest FROM %s WHERE %s",
582 582
                         self::CONCURRENCY_TIMEOUT,
583 583
                         _DB_PREFIX_.$table,
584
-                        'id='.(int)$orderId
584
+                        'id='.(int) $orderId
585 585
                     );
586 586
                     $resultSeconds = Db::getInstance()->getValue($query);
587 587
                     $restSeconds = isset($resultSeconds) ? ($resultSeconds) : 0;
588
-                    $secondsToExpire = ($restSeconds>self::CONCURRENCY_TIMEOUT) ?
588
+                    $secondsToExpire = ($restSeconds > self::CONCURRENCY_TIMEOUT) ?
589 589
                         self::CONCURRENCY_TIMEOUT : $restSeconds;
590 590
                     if ($secondsToExpire > 0) {
591 591
                         sleep($secondsToExpire + 1);
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
                     $this->getMerchantOrderId();
595 595
                     $this->getPagantisOrderId();
596 596
 
597
-                    $logMessage  = sprintf(
597
+                    $logMessage = sprintf(
598 598
                         "User has waited %s seconds, default %s, bd time to expire %s [cartId=%s][origin=%s]",
599 599
                         $secondsToExpire,
600 600
                         self::CONCURRENCY_TIMEOUT,
@@ -623,10 +623,10 @@  discard block
 block discarded – undo
623 623
     {
624 624
         try {
625 625
             if (is_null($orderId)) {
626
-                Db::getInstance()->delete(self::CART_TABLE, 'timestamp < ' . (time() - self::CONCURRENCY_TIMEOUT));
626
+                Db::getInstance()->delete(self::CART_TABLE, 'timestamp < '.(time() - self::CONCURRENCY_TIMEOUT));
627 627
                 return;
628 628
             }
629
-            Db::getInstance()->delete(self::CART_TABLE, 'id = ' . (int)$orderId);
629
+            Db::getInstance()->delete(self::CART_TABLE, 'id = '.(int) $orderId);
630 630
         } catch (\Exception $exception) {
631 631
             throw new ConcurrencyException();
632 632
         }
@@ -651,8 +651,8 @@  discard block
 block discarded – undo
651 651
             'merchantCartId' => $this->merchantCartId,
652 652
             'merchantOrderId' => $this->merchantOrderId,
653 653
             'pagantisOrderId' => $this->pagantisOrderId,
654
-            'message' => ($exception)? $exception->getMessage() : 'Unable to get Exception message',
655
-            'statusCode' => ($exception)? $exception->getCode() : 'Unable to get Exception statusCode',
654
+            'message' => ($exception) ? $exception->getMessage() : 'Unable to get Exception message',
655
+            'statusCode' => ($exception) ? $exception->getCode() : 'Unable to get Exception statusCode',
656 656
             'method' => $method,
657 657
             'file' => __FILE__,
658 658
             'line' => $line,
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
                 'id_module' => $this->module->id,
689 689
                 'id_order' => ($this->pagantisOrder) ? $this->pagantisOrder->getId() : null,
690 690
             );
691
-            $url = ($error)? $this->config['urlKO'] : $this->config['urlOK'];
691
+            $url = ($error) ? $this->config['urlKO'] : $this->config['urlOK'];
692 692
             $returnMessage = sprintf(
693 693
                 "[origin=%s][cartId=%s][prestashopOrderId=%s][pagantisOrderId=%s][returnUrl=%s]",
694 694
                 $this->getOrigin(),
Please login to merge, or discard this patch.
controllers/front/config.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@  discard block
 block discarded – undo
18 18
     public function initContent()
19 19
     {
20 20
         $this->authorize();
21
-        $method = Tools::strtolower($_SERVER['REQUEST_METHOD']) . "Method";
21
+        $method = Tools::strtolower($_SERVER['REQUEST_METHOD'])."Method";
22 22
         $params = (_PS_VERSION_ < 1.6) ? $_POST + $_GET : Tools::getAllValues();
23 23
         if (method_exists($this, $method)) {
24 24
             header('HTTP/1.1 200 Ok', true, 200);
25 25
             header('Content-Type: application/json', true);
26 26
             $result = json_encode($this->{$method}($params['product']));
27
-            header('Content-Length: ' . Tools::strlen($result));
27
+            header('Content-Length: '.Tools::strlen($result));
28 28
             echo $result;
29 29
             exit();
30 30
         }
@@ -40,17 +40,17 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function getExtraConfigs($product = null)
42 42
     {
43
-        $availableProductsSQL = 'select * from ' . _DB_PREFIX_. 'pagantis_config where config = \'PRODUCTS\'';
43
+        $availableProductsSQL = 'select * from '._DB_PREFIX_.'pagantis_config where config = \'PRODUCTS\'';
44 44
         $dbProducts = Db::getInstance()->executeS($availableProductsSQL);
45 45
         $availableProductsArray = explode(',', $dbProducts[0]['value']);
46 46
         $unrequestedProducts = array_diff($availableProductsArray, array($product));
47 47
         $unrequestedProductSQL = '';
48 48
         foreach ($unrequestedProducts as $unrequestedProduct) {
49
-            $unrequestedProductSQL .= "'". $unrequestedProduct . "',";
49
+            $unrequestedProductSQL .= "'".$unrequestedProduct."',";
50 50
         }
51 51
         $unrequestedProductSQL = rtrim($unrequestedProductSQL, ",");
52
-        $sql_content = 'select * from ' . _DB_PREFIX_.
53
-            'pagantis_config where config not in (' . $unrequestedProductSQL . ') 
52
+        $sql_content = 'select * from '._DB_PREFIX_.
53
+            'pagantis_config where config not in ('.$unrequestedProductSQL.') 
54 54
              and config not like (\'PAGANTIS_%\')  and config not like (\'PMT_%\') ';
55 55
 
56 56
         $dbConfigs = Db::getInstance()->executeS($sql_content);
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
         unset($params['secret']);
82 82
         $product = $params['product'];
83 83
         unset($params['product']);
84
-        $productConfigsSQL = 'select * from ' . _DB_PREFIX_.
85
-            'pagantis_config where config = \''. pSQL($product) . '\'';
84
+        $productConfigsSQL = 'select * from '._DB_PREFIX_.
85
+            'pagantis_config where config = \''.pSQL($product).'\'';
86 86
         $productConfigs = Db::getInstance()->executeS($productConfigsSQL);
87 87
         $availableProductsArray = json_decode($productConfigs[0]['value'], true);
88 88
         if (count($params) > 0) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                             Db::getInstance()->update(
97 97
                                 'pagantis_config',
98 98
                                 array('value' => pSQL($value)),
99
-                                'config = \''. pSQL($config) .'\''
99
+                                'config = \''.pSQL($config).'\''
100 100
                             );
101 101
                         }
102 102
                     } else {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                 Db::getInstance()->update(
107 107
                     'pagantis_config',
108 108
                     array('value' => json_encode($availableProductsArray)),
109
-                    'config = \''. pSQL($product) .'\''
109
+                    'config = \''.pSQL($product).'\''
110 110
                 );
111 111
             }
112 112
         } else {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $productCode = Tools::getValue('product', false);
140 140
         $products = explode(',', Pagantis::getExtraConfig('PRODUCTS', null));
141
-        $privateKey = Configuration::get(Tools::strtolower($productCode) . '_private_key');
141
+        $privateKey = Configuration::get(Tools::strtolower($productCode).'_private_key');
142 142
         $privateKeyGet = Tools::getValue('secret', false);
143 143
         if (!empty($privateKeyGet) && $privateKeyGet === $privateKey && in_array(Tools::strtoupper($productCode), $products)) {
144 144
             return true;
Please login to merge, or discard this patch.