Completed
Push — master ( cc5910...a6f872 )
by
unknown
14s queued 11s
created
test/configure/ConfigurePPPTest.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
  * @package Test\Configure
11 11
  *
12 12
  * @group oscommerce-configure-ppp
13
-
14 13
  */
15 14
 class ConfigurePPPTest extends AbstractConfigure
16 15
 {
Please login to merge, or discard this patch.
test/Buy/AbstractBuy.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         sleep(3);
121 121
         $productLinkElement->click();
122 122
         $this->assertSame(
123
-            self::PRODUCT_NAME . ', ' . self::TITLE,
123
+            self::PRODUCT_NAME.', '.self::TITLE,
124 124
             $this->webDriver->getTitle()
125 125
         );
126 126
     }
@@ -232,9 +232,9 @@  discard block
 block discarded – undo
232 232
         $paymentFormElement = WebDriverBy::className('FieldsPreview-desc');
233 233
         $condition = WebDriverExpectedCondition::visibilityOfElementLocated($paymentFormElement);
234 234
         $this->webDriver->wait()->until($condition);
235
-        $this->assertTrue((bool) $condition);
235
+        $this->assertTrue((bool)$condition);
236 236
         $this->assertSame(
237
-            $this->configuration['firstname'] . ' ' . $this->configuration['lastname'],
237
+            $this->configuration['firstname'].' '.$this->configuration['lastname'],
238 238
             $this->findByClass('FieldsPreview-desc')->getText()
239 239
         );
240 240
     }
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      */
295 295
     protected function checkPagantisOrderId()
296 296
     {
297
-        $orderId=0;
297
+        $orderId = 0;
298 298
         $notifyUrl = self::OSCURL.self::NOTIFICATION_FOLDER.'?order='.$orderId;
299 299
         $this->assertNotEmpty($notifyUrl, $notifyUrl);
300 300
         $response = Request::post($notifyUrl)->expects('json')->send();
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
         $this->assertEquals(
305 305
             $response->body->merchant_order_id,
306 306
             $orderId,
307
-            $response->body->merchant_order_id.'!='. $orderId
307
+            $response->body->merchant_order_id.'!='.$orderId
308 308
         );
309 309
         $this->assertContains(
310 310
             NoIdentificationException::ERROR_MESSAGE,
Please login to merge, or discard this patch.
catalog/admin/allowedCountries.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@  discard block
 block discarded – undo
5 5
 define('TABLE_LAUGUAGES', 'languages');
6 6
 
7 7
 //Check if module is installed
8
-$result = tep_db_query("select * from " . TABLE_CONFIGURATION . " where configuration_key='MODULE_PAYMENT_PAGANTIS_STATUS'");
8
+$result = tep_db_query("select * from ".TABLE_CONFIGURATION." where configuration_key='MODULE_PAYMENT_PAGANTIS_STATUS'");
9 9
 $resultSelect = tep_db_fetch_array($result);
10
-if (tep_db_num_rows($result) == 0 || $resultSelect['configuration_value'] !=='True') {
10
+if (tep_db_num_rows($result) == 0 || $resultSelect['configuration_value'] !== 'True') {
11 11
     tep_redirect('/admin/index.php');
12 12
 }
13 13
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     $resultSelect = tep_db_fetch_array($result);
29 29
     if ($resultSelect['value'] == '') {
30 30
         $allowedCountries = array();
31
-    } else {
31
+    }else {
32 32
         $allowedCountries = array_values((array)unserialize($resultSelect['value']));
33 33
     }
34 34
 }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                                     </tr>
84 84
     <?php foreach ($availableLanguages as $countryId => $country) {
85 85
         $checked = (in_array($country['code'], $allowedCountries)) ? 'checked' : '';
86
-        echo "<tr class='dataTableRow'><td class='dataTableContent'>". $country['name']."</td><td class='dataTableContent' align='center'><input name='checkboxCountries[".$country['code']."]' type='checkbox' $checked </td></tr>";
86
+        echo "<tr class='dataTableRow'><td class='dataTableContent'>".$country['name']."</td><td class='dataTableContent' align='center'><input name='checkboxCountries[".$country['code']."]' type='checkbox' $checked </td></tr>";
87 87
     }
88 88
                                     ?>
89 89
                                     <tr>
Please login to merge, or discard this patch.
test/basic/BasicTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $this->webDriver->get(self::OSCURL);
31 31
         $condition = WebDriverExpectedCondition::titleContains(self::TITLE);
32 32
         $this->webDriver->wait()->until($condition);
33
-        $this->assertTrue((bool) $condition);
33
+        $this->assertTrue((bool)$condition);
34 34
         $this->quit();
35 35
     }
36 36
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         $this->webDriver->get(self::OSCURL_BACKOFFICE);
43 43
         $condition = WebDriverExpectedCondition::titleContains(self::ADMIN_TITLE);
44 44
         $this->webDriver->wait()->until($condition);
45
-        $this->assertTrue((bool) $condition);
45
+        $this->assertTrue((bool)$condition);
46 46
         $this->quit();
47 47
     }
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
catalog/includes/modules/header_tags/ht_pagantis.php 1 patch
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         ) {
36 36
             $this->enabled = ((MODULE_HEADER_TAGS_PAGANTIS_STATUS == 'True') &&
37 37
                 (MODULE_PAYMENT_PAGANTIS_STATUS == 'True') &&
38
-                (MODULE_PAYMENT_PAGANTIS_SIMULATOR == 'True')) ;
38
+                (MODULE_PAYMENT_PAGANTIS_SIMULATOR == 'True'));
39 39
         }
40 40
 
41 41
         $this->extraConfig = $this->getExtraConfig();
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      */
72 72
     private function getConfig($config = '')
73 73
     {
74
-        $query       = "select * from ".TABLE_CONFIGURATION . " where configuration_key ='" . $config . "'";
74
+        $query       = "select * from ".TABLE_CONFIGURATION." where configuration_key ='".$config."'";
75 75
         $result      = tep_db_query($query);
76 76
         $resultArray = tep_db_fetch_array($result);
77 77
         return $resultArray['configuration_value'];
@@ -88,30 +88,30 @@  discard block
 block discarded – undo
88 88
         $checkoutPage = strpos($_SERVER[REQUEST_URI], "checkout_payment.php") > 0;
89 89
 
90 90
         //Show promoted html
91
-        if ($this->isPromoted($productId) && $checkoutPage!='1') {
91
+        if ($this->isPromoted($productId) && $checkoutPage != '1') {
92 92
             echo "<style> #promotedText{margin-left: 10%;} .pmt-no-interest{color: #00c1d5 }</style>";
93 93
             echo "<div id='promotedText' style='display:none'><br/>".$this->extraConfig['PAGANTIS_PROMOTED_PRODUCT_CODE']."</div>";
94
-            echo '<script>'. PHP_EOL;
95
-            echo '        function loadPromoted()'. PHP_EOL;
96
-            echo '        {'. PHP_EOL;
97
-            echo 'var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL;
98
-            echo 'if (positionSelector === \'default\') {'. PHP_EOL;
99
-            echo 'positionSelector = \'.buttonSet\''. PHP_EOL;
100
-            echo '}'. PHP_EOL;
94
+            echo '<script>'.PHP_EOL;
95
+            echo '        function loadPromoted()'.PHP_EOL;
96
+            echo '        {'.PHP_EOL;
97
+            echo 'var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL;
98
+            echo 'if (positionSelector === \'default\') {'.PHP_EOL;
99
+            echo 'positionSelector = \'.buttonSet\''.PHP_EOL;
100
+            echo '}'.PHP_EOL;
101 101
             echo 'var docFather = document.querySelector(positionSelector);'.PHP_EOL;
102
-            echo 'if (typeof docFather != \'undefined\') {'. PHP_EOL;
102
+            echo 'if (typeof docFather != \'undefined\') {'.PHP_EOL;
103 103
             echo 'var promotedNode = document.getElementById("promotedText");'.PHP_EOL;
104 104
             echo 'docFather.appendChild(promotedNode);'.PHP_EOL;
105
-            echo 'promotedNode.style.display=""' . PHP_EOL;
106
-            echo '               clearInterval(window.OSPromotedId);'. PHP_EOL;
107
-            echo '               return true;'. PHP_EOL;
108
-            echo '       }'. PHP_EOL;
109
-            echo '               return false;'. PHP_EOL;
110
-            echo '       }'. PHP_EOL;
111
-            echo '       window.OSPromotedId = setInterval(function () {'. PHP_EOL;
112
-            echo '          loadPromoted();'. PHP_EOL;
113
-            echo '       }, 2000);'. PHP_EOL;
114
-            echo '</script>'. PHP_EOL;
105
+            echo 'promotedNode.style.display=""'.PHP_EOL;
106
+            echo '               clearInterval(window.OSPromotedId);'.PHP_EOL;
107
+            echo '               return true;'.PHP_EOL;
108
+            echo '       }'.PHP_EOL;
109
+            echo '               return false;'.PHP_EOL;
110
+            echo '       }'.PHP_EOL;
111
+            echo '       window.OSPromotedId = setInterval(function () {'.PHP_EOL;
112
+            echo '          loadPromoted();'.PHP_EOL;
113
+            echo '       }, 2000);'.PHP_EOL;
114
+            echo '</script>'.PHP_EOL;
115 115
         }
116 116
 
117 117
         if (isset($productId) || $checkoutPage) {
@@ -130,108 +130,108 @@  discard block
 block discarded – undo
130 130
                 $productId = array_shift($productId);
131 131
                 $promotedProduct = $this->isPromoted($productId);
132 132
                 if ($promotedProduct) {
133
-                    $promotedAmount+=number_format(($item['price'] * $item['qty']), 2);
133
+                    $promotedAmount += number_format(($item['price'] * $item['qty']), 2);
134 134
                 }
135 135
             }
136 136
 
137
-            echo "<script src='".$this->sdkFile."'></script>". PHP_EOL;
138
-            echo '<script>'. PHP_EOL;
139
-            echo '        function loadSimulator()'. PHP_EOL;
140
-            echo '        {'. PHP_EOL;
141
-            echo '           if (typeof '.$simulatorCode.' != \'undefined\') {'. PHP_EOL;
142
-            echo '               var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL;
143
-            echo '               var priceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL;
144
-            echo '               var checkoutPriceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL;
145
-            echo '               var quantitySelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR']. '\';'. PHP_EOL;
146
-            echo '               var checkoutPage =     \'' . $checkoutPage.'\';'. PHP_EOL;
147
-            echo '               var promotedAmount =     \'' . $promotedAmount.'\';'. PHP_EOL;
148
-            echo '               var langCode =     \'' . $this->langCode.'\';'. PHP_EOL;
149
-            echo '               var sdk = '.$simulatorCode.';'. PHP_EOL;
150
-
151
-            echo '               if (positionSelector === \'default\') {'. PHP_EOL;
152
-            echo '                   positionSelector = \'.buttonSet\''. PHP_EOL;
153
-            echo '               }'. PHP_EOL;
154
-
155
-            echo '               if (priceSelector === \'default\') {'. PHP_EOL;
156
-            echo '                   priceSelector = \'#bodyContent>form>div>h1\''. PHP_EOL;
157
-            echo '               }'. PHP_EOL;
158
-
159
-            echo '               if (checkoutPriceSelector == \'default\' && checkoutPage == \'1\')  {'. PHP_EOL;
160
-            echo '                   priceSelector = \'#columnRight > .infoBoxContainer > .infoBoxContents > tbody > tr:last-child > td\';'. PHP_EOL;
161
-            echo '               }'. PHP_EOL;
162
-
163
-            echo '               product_simulator = {};'. PHP_EOL;
164
-            echo '               product_simulator.locale = \'' . strtolower($this->langCode) . '\';'. PHP_EOL;
165
-            echo '               product_simulator.country = \'' . strtolower($this->langCode) . '\';'. PHP_EOL;
166
-            echo '               product_simulator.publicKey = \'' . $this->pk . '\';'. PHP_EOL;
167
-            echo '               product_simulator.selector = positionSelector;'. PHP_EOL;
168
-            echo '               product_simulator.numInstalments = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'] . '\';'. PHP_EOL;
169
-            echo '               product_simulator.type = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'] . ';'. PHP_EOL;
170
-            echo '               product_simulator.skin = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'] . ';'. PHP_EOL;
171
-            echo '               product_simulator.position = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'] . ';'. PHP_EOL;
172
-            echo '               product_simulator.amountParserConfig = {};'. PHP_EOL;
173
-            echo '               product_simulator.amountParserConfig.thousandSeparator = "' . $this->extraConfig['PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR'] . '";'. PHP_EOL;
174
-            echo '               product_simulator.amountParserConfig.decimalSeparator = "' . $this->extraConfig['PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR'] .  '";'. PHP_EOL;
137
+            echo "<script src='".$this->sdkFile."'></script>".PHP_EOL;
138
+            echo '<script>'.PHP_EOL;
139
+            echo '        function loadSimulator()'.PHP_EOL;
140
+            echo '        {'.PHP_EOL;
141
+            echo '           if (typeof '.$simulatorCode.' != \'undefined\') {'.PHP_EOL;
142
+            echo '               var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL;
143
+            echo '               var priceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL;
144
+            echo '               var checkoutPriceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL;
145
+            echo '               var quantitySelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'].'\';'.PHP_EOL;
146
+            echo '               var checkoutPage =     \''.$checkoutPage.'\';'.PHP_EOL;
147
+            echo '               var promotedAmount =     \''.$promotedAmount.'\';'.PHP_EOL;
148
+            echo '               var langCode =     \''.$this->langCode.'\';'.PHP_EOL;
149
+            echo '               var sdk = '.$simulatorCode.';'.PHP_EOL;
150
+
151
+            echo '               if (positionSelector === \'default\') {'.PHP_EOL;
152
+            echo '                   positionSelector = \'.buttonSet\''.PHP_EOL;
153
+            echo '               }'.PHP_EOL;
154
+
155
+            echo '               if (priceSelector === \'default\') {'.PHP_EOL;
156
+            echo '                   priceSelector = \'#bodyContent>form>div>h1\''.PHP_EOL;
157
+            echo '               }'.PHP_EOL;
158
+
159
+            echo '               if (checkoutPriceSelector == \'default\' && checkoutPage == \'1\')  {'.PHP_EOL;
160
+            echo '                   priceSelector = \'#columnRight > .infoBoxContainer > .infoBoxContents > tbody > tr:last-child > td\';'.PHP_EOL;
161
+            echo '               }'.PHP_EOL;
162
+
163
+            echo '               product_simulator = {};'.PHP_EOL;
164
+            echo '               product_simulator.locale = \''.strtolower($this->langCode).'\';'.PHP_EOL;
165
+            echo '               product_simulator.country = \''.strtolower($this->langCode).'\';'.PHP_EOL;
166
+            echo '               product_simulator.publicKey = \''.$this->pk.'\';'.PHP_EOL;
167
+            echo '               product_simulator.selector = positionSelector;'.PHP_EOL;
168
+            echo '               product_simulator.numInstalments = \''.$this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'].'\';'.PHP_EOL;
169
+            echo '               product_simulator.type = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'].';'.PHP_EOL;
170
+            echo '               product_simulator.skin = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'].';'.PHP_EOL;
171
+            echo '               product_simulator.position = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'].';'.PHP_EOL;
172
+            echo '               product_simulator.amountParserConfig = {};'.PHP_EOL;
173
+            echo '               product_simulator.amountParserConfig.thousandSeparator = "'.$this->extraConfig['PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR'].'";'.PHP_EOL;
174
+            echo '               product_simulator.amountParserConfig.decimalSeparator = "'.$this->extraConfig['PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR'].'";'.PHP_EOL;
175 175
 
176 176
             //Amount in product page
177
-            echo '               var promotedProduct = \'' . $this->isPromoted($productId) .'\';'. PHP_EOL;
177
+            echo '               var promotedProduct = \''.$this->isPromoted($productId).'\';'.PHP_EOL;
178 178
             echo '               if(checkoutPage != \'1\' ) {';
179
-            echo '               product_simulator.itemAmountSelector = priceSelector;'. PHP_EOL;
180
-            echo '                   if(promotedProduct == \'1\') { ' . PHP_EOL;
181
-            echo '                    product_simulator.itemPromotedAmountSelector = priceSelector;'. PHP_EOL;
182
-            echo '                   }' . PHP_EOL;
179
+            echo '               product_simulator.itemAmountSelector = priceSelector;'.PHP_EOL;
180
+            echo '                   if(promotedProduct == \'1\') { '.PHP_EOL;
181
+            echo '                    product_simulator.itemPromotedAmountSelector = priceSelector;'.PHP_EOL;
182
+            echo '                   }'.PHP_EOL;
183 183
             echo '               }';
184 184
 
185 185
             //Amount in checkout page
186
-            echo '               if(checkoutPage == \'1\' ) { ' . PHP_EOL;
187
-            echo '               product_simulator.totalAmountSelector = priceSelector;'. PHP_EOL;
188
-            echo '                  if(promotedAmount != \'0\' && checkoutPage == \'1\' ) { ' . PHP_EOL;
189
-            echo '                      product_simulator.totalPromotedAmount = promotedAmount;'. PHP_EOL;
190
-            echo '                  }' . PHP_EOL;
191
-            echo '               }' . PHP_EOL;
192
-            echo '               sdk.simulator.init(product_simulator);'. PHP_EOL;
193
-            echo '               clearInterval(window.OSSimulatorId);'. PHP_EOL;
194
-            echo '               return true;'. PHP_EOL;
195
-            echo '           }'. PHP_EOL;
196
-            echo '           return false;'. PHP_EOL;
197
-            echo '       }'. PHP_EOL;
186
+            echo '               if(checkoutPage == \'1\' ) { '.PHP_EOL;
187
+            echo '               product_simulator.totalAmountSelector = priceSelector;'.PHP_EOL;
188
+            echo '                  if(promotedAmount != \'0\' && checkoutPage == \'1\' ) { '.PHP_EOL;
189
+            echo '                      product_simulator.totalPromotedAmount = promotedAmount;'.PHP_EOL;
190
+            echo '                  }'.PHP_EOL;
191
+            echo '               }'.PHP_EOL;
192
+            echo '               sdk.simulator.init(product_simulator);'.PHP_EOL;
193
+            echo '               clearInterval(window.OSSimulatorId);'.PHP_EOL;
194
+            echo '               return true;'.PHP_EOL;
195
+            echo '           }'.PHP_EOL;
196
+            echo '           return false;'.PHP_EOL;
197
+            echo '       }'.PHP_EOL;
198 198
 
199 199
             //Invoke to main method
200
-            echo '       window.OSSimulatorId = setInterval(function () {'. PHP_EOL;
201
-            echo '          loadSimulator();'. PHP_EOL;
202
-            echo '       }, 2000);'. PHP_EOL;
203
-            echo '</script>'. PHP_EOL;
200
+            echo '       window.OSSimulatorId = setInterval(function () {'.PHP_EOL;
201
+            echo '          loadSimulator();'.PHP_EOL;
202
+            echo '       }, 2000);'.PHP_EOL;
203
+            echo '</script>'.PHP_EOL;
204 204
 
205 205
             //Checkout simulator
206 206
             if ($checkoutPage) {
207
-                echo '<script>' . PHP_EOL;
208
-
209
-                echo 'function checkSelected(value)'. PHP_EOL;
210
-                echo '{ '. PHP_EOL;
211
-                echo 'var simulator = document.getElementsByClassName("buttonSet");'  . PHP_EOL;
212
-                echo ' if(simulator == "undefined") { return false;  } '. PHP_EOL;
213
-                echo 'var pagantisCheckbox = document.querySelector("input[value=\'pagantis\']"); ' . PHP_EOL;
214
-                echo 'var grandparentNode = pagantisCheckbox.parentNode.parentNode;' . PHP_EOL;
215
-                echo 'if(grandparentNode == value) { var status="" } ' . PHP_EOL;
216
-                echo 'else { var status="none";} '. PHP_EOL;
217
-                echo 'simulator[0].style.display=status; ' . PHP_EOL;
218
-                echo '}'. PHP_EOL;
219
-
220
-                echo 'function showSimulator()'. PHP_EOL;
221
-                echo '{'. PHP_EOL;
222
-                echo 'var elements = document.querySelectorAll("tr[class^=\'moduleRow\']");' . PHP_EOL;
223
-                echo 'if(elements == null) { return false };' . PHP_EOL;
207
+                echo '<script>'.PHP_EOL;
208
+
209
+                echo 'function checkSelected(value)'.PHP_EOL;
210
+                echo '{ '.PHP_EOL;
211
+                echo 'var simulator = document.getElementsByClassName("buttonSet");'.PHP_EOL;
212
+                echo ' if(simulator == "undefined") { return false;  } '.PHP_EOL;
213
+                echo 'var pagantisCheckbox = document.querySelector("input[value=\'pagantis\']"); '.PHP_EOL;
214
+                echo 'var grandparentNode = pagantisCheckbox.parentNode.parentNode;'.PHP_EOL;
215
+                echo 'if(grandparentNode == value) { var status="" } '.PHP_EOL;
216
+                echo 'else { var status="none";} '.PHP_EOL;
217
+                echo 'simulator[0].style.display=status; '.PHP_EOL;
218
+                echo '}'.PHP_EOL;
219
+
220
+                echo 'function showSimulator()'.PHP_EOL;
221
+                echo '{'.PHP_EOL;
222
+                echo 'var elements = document.querySelectorAll("tr[class^=\'moduleRow\']");'.PHP_EOL;
223
+                echo 'if(elements == null) { return false };'.PHP_EOL;
224 224
                 echo 'for(var i = 0, max = elements.length; i < max; i++) { elements[i].onclick = function() {
225 225
                         checkSelected(this);
226 226
                     } }' . PHP_EOL;
227 227
                 echo 'clearInterval(window.OSdisplayId);';
228
-                echo 'return true;'. PHP_EOL;
229
-                echo '};'. PHP_EOL;
228
+                echo 'return true;'.PHP_EOL;
229
+                echo '};'.PHP_EOL;
230 230
 
231
-                echo '       window.OSdisplayId = setInterval(function () {'. PHP_EOL;
232
-                echo '          showSimulator();'. PHP_EOL;
233
-                echo '       }, 2000);'. PHP_EOL;
234
-                echo '</script>'. PHP_EOL;
231
+                echo '       window.OSdisplayId = setInterval(function () {'.PHP_EOL;
232
+                echo '          showSimulator();'.PHP_EOL;
233
+                echo '       }, 2000);'.PHP_EOL;
234
+                echo '</script>'.PHP_EOL;
235 235
             }
236 236
         }
237 237
     }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      * install
255 255
      */
256 256
     function install() {
257
-        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())");
257
+        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())");
258 258
 
259 259
     }
260 260
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      * remove
263 263
      */
264 264
     function remove() {
265
-        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
265
+        tep_db_query("delete from ".TABLE_CONFIGURATION." where configuration_key in ('".implode("', '", $this->keys())."')");
266 266
     }
267 267
 
268 268
     /**
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 
286 286
         if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') {
287 287
             $promotedProducts = array();
288
-        } else {
288
+        }else {
289 289
             $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION']));
290 290
         }
291 291
 
Please login to merge, or discard this patch.
catalog/ext/modules/payment/pagantis/notifyController.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -86,22 +86,22 @@  discard block
 block discarded – undo
86 86
             $jsonResponse->setException($exception);
87 87
             $this->insertLog($exception);
88 88
 
89
-            if ($this->extraConfig['PAGANTIS_URL_KO'] =! '') {
89
+            if ($this->extraConfig['PAGANTIS_URL_KO'] = !'') {
90 90
                 $koUrl = $this->extraConfig['PAGANTIS_URL_KO'];
91
-            } else {
91
+            }else {
92 92
                 $koUrl = trim(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false));
93 93
             }
94 94
 
95 95
             if ($this->origin == 'notify') {
96 96
                 $jsonResponse->printResponse();
97
-            } else {
97
+            }else {
98 98
                 if ($exception->getMessage() == AlreadyProcessedException::ERROR_MESSAGE) {
99
-                    if ($this->extraConfig['PAGANTIS_URL_OK']!='') {
99
+                    if ($this->extraConfig['PAGANTIS_URL_OK'] != '') {
100 100
                         $confirmationUrl = $this->extraConfig['PAGANTIS_URL_OK'];
101
-                        $confirmationUrl.="?order_id=$this->merchantOrderId";
102
-                    } else {
101
+                        $confirmationUrl .= "?order_id=$this->merchantOrderId";
102
+                    }else {
103 103
                         $confirmationUrl = trim(tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, '', 'SSL', false));
104
-                        $confirmationUrl.="?order_id=$this->merchantOrderId";
104
+                        $confirmationUrl .= "?order_id=$this->merchantOrderId";
105 105
                     }
106 106
 
107 107
                     header("Location: $confirmationUrl");
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
         if ($this->origin == 'notify') {
138 138
             $jsonResponse->printResponse();
139
-        } else {
139
+        }else {
140 140
             return $jsonResponse;
141 141
         }
142 142
     }
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
         try {
214 214
             $this->checkPagantisStatus(array('AUTHORIZED'));
215 215
         } catch (\Exception $e) {
216
-            if ($this->findOscommerceOrderId()!='') {
216
+            if ($this->findOscommerceOrderId() != '') {
217 217
                 throw new AlreadyProcessedException();
218
-            } else {
218
+            }else {
219 219
                 if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
220 220
                     $status = $this->pagantisOrder->getStatus();
221
-                } else {
221
+                }else {
222 222
                     $status = '-';
223 223
                 }
224 224
                 throw new WrongStatusException($status);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     {
234 234
         global $order;
235 235
 
236
-        if ($order->info['order_status']!=='1') {
236
+        if ($order->info['order_status'] !== '1') {
237 237
             throw new AlreadyProcessedException();
238 238
         }
239 239
     }
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
             $this->pagantisOrder = $this->orderClient->getOrder($this->pagantisOrderId);
265 265
             if ($this->pagantisOrder->getStatus() !== Order::STATUS_CONFIRMED) {
266 266
                 throw new UnknownException($e->getMessage());
267
-            } else {
267
+            }else {
268 268
                 $logMessage = 'Concurrency issue: Order_id '.$this->pagantisOrderId.' was confirmed by other process';
269 269
                 $this->insertLog(null, $logMessage);
270 270
             }
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
                     self::CONCURRENCY_TIMEOUT
323 323
                 );
324 324
                 tep_db_query($query);
325
-            } elseif ($orderId!='') {
325
+            } elseif ($orderId != '') {
326 326
                 $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where id='$orderId'";
327 327
                 tep_db_query($query);
328 328
             }
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
             if (isset($orderRow['timestamp'])) {
344 344
                 if ($this->origin == 'notify') {
345 345
                     throw new ConcurrencyException();
346
-                } else {
346
+                }else {
347 347
                     $query = sprintf(
348 348
                         "SELECT TIMESTAMPDIFF(SECOND,NOW()-INTERVAL %s SECOND, timestamp) as rest FROM %s %s",
349 349
                         self::CONCURRENCY_TIMEOUT,
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
                     $resultsSelect = tep_db_query($query);
354 354
                     $resultsArray = tep_db_fetch_array($resultsSelect);
355 355
                     $restSeconds = isset($resultsArray['rest']) ? ($resultsArray['rest']) : 0;
356
-                    $expirationSec = ($restSeconds>self::CONCURRENCY_TIMEOUT)? self::CONCURRENCY_TIMEOUT : $restSeconds;
356
+                    $expirationSec = ($restSeconds > self::CONCURRENCY_TIMEOUT) ? self::CONCURRENCY_TIMEOUT : $restSeconds;
357 357
                     if ($expirationSec > 0) {
358 358
                         sleep($expirationSec + 1);
359 359
                     }
@@ -368,8 +368,8 @@  discard block
 block discarded – undo
368 368
                     $os_order_id = tep_db_fetch_array($resultsSelect);
369 369
                     if (isset($os_order_id['os_order_id'])) {
370 370
                         $redirectUrl = trim(tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, '', 'SSL', false));
371
-                        $redirectUrl.="?order_id=$this->oscommerceOrderId";
372
-                    } else {
371
+                        $redirectUrl .= "?order_id=$this->oscommerceOrderId";
372
+                    }else {
373 373
                         $redirectUrl = trim(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false));
374 374
                     }
375 375
 
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
                     header("Location: $redirectUrl");
386 386
                     exit;
387 387
                 }
388
-            } else {
388
+            }else {
389 389
                 $query = "INSERT INTO ".TABLE_PAGANTIS_CONCURRENCY." (id) VALUES ('$this->oscommerceOrderId');";
390 390
                 tep_db_query($query);
391 391
             }
@@ -415,12 +415,12 @@  discard block
 block discarded – undo
415 415
             if (!$payed) {
416 416
                 if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
417 417
                     $status = $this->pagantisOrder->getStatus();
418
-                } else {
418
+                }else {
419 419
                     $status = '-';
420 420
                 }
421 421
                 throw new WrongStatusException($status);
422 422
             }
423
-        } else {
423
+        }else {
424 424
             throw new OrderNotFoundException();
425 425
         }
426 426
     }
@@ -466,12 +466,12 @@  discard block
 block discarded – undo
466 466
         $metadataInfo = '';
467 467
         foreach ($metadataOrder as $metadataKey => $metadataValue) {
468 468
             if ($metadataKey == 'promotedProduct') {
469
-                $metadataInfo.= "/Producto promocionado = $metadataValue";
469
+                $metadataInfo .= "/Producto promocionado = $metadataValue";
470 470
             }
471 471
         }
472 472
 
473 473
         $comment = "Pagantis id=$this->pagantisOrderId/Via=".ucfirst($this->origin)."/".$metadataInfo;
474
-        $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY ."(comments, orders_id, orders_status_id, customer_notified,
474
+        $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY."(comments, orders_id, orders_status_id, customer_notified,
475 475
         date_added) values ('$comment', ".$insert_id.", '2', -1, now() )";
476 476
         tep_db_query($query);
477 477
 
@@ -501,10 +501,10 @@  discard block
 block discarded – undo
501 501
      */
502 502
     private function insertLog($exception = null, $message = null)
503 503
     {
504
-        $logEntry= new LogEntry();
504
+        $logEntry = new LogEntry();
505 505
         if ($exception instanceof \Exception) {
506 506
             $logEntryJson = $logEntry->error($exception)->toJson();
507
-        } else {
507
+        }else {
508 508
             $logEntryJson = $logEntry->info($message)->toJson();
509 509
         }
510 510
             $query = "insert into ".TABLE_PAGANTIS_LOG."(log) values ('$logEntryJson')";
Please login to merge, or discard this patch.