Passed
Pull Request — master (#11)
by Raúl
02:26
created
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/includes/modules/header_tags/ht_pagantis.php 1 patch
Spacing   +102 added lines, -102 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,29 +88,29 @@  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 "<div id='promotedText' style='display:none'><br/>".$this->extraConfig['PAGANTIS_PROMOTED_PRODUCT_CODE']."</div>";
93
-            echo '<script>'. PHP_EOL;
94
-            echo '        function loadPromoted()'. PHP_EOL;
95
-            echo '        {'. PHP_EOL;
96
-            echo 'var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL;
97
-            echo 'if (positionSelector === \'default\') {'. PHP_EOL;
98
-            echo 'positionSelector = \'.buttonSet\''. PHP_EOL;
99
-            echo '}'. PHP_EOL;
93
+            echo '<script>'.PHP_EOL;
94
+            echo '        function loadPromoted()'.PHP_EOL;
95
+            echo '        {'.PHP_EOL;
96
+            echo 'var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL;
97
+            echo 'if (positionSelector === \'default\') {'.PHP_EOL;
98
+            echo 'positionSelector = \'.buttonSet\''.PHP_EOL;
99
+            echo '}'.PHP_EOL;
100 100
             echo 'var docFather = document.querySelector(positionSelector);'.PHP_EOL;
101
-            echo 'if (typeof docFather != \'undefined\') {'. PHP_EOL;
101
+            echo 'if (typeof docFather != \'undefined\') {'.PHP_EOL;
102 102
             echo 'var promotedNode = document.getElementById("promotedText");'.PHP_EOL;
103 103
             echo 'docFather.appendChild(promotedNode);'.PHP_EOL;
104
-            echo 'promotedNode.style.display=""' . PHP_EOL;
105
-            echo '               clearInterval(window.OSPromotedId);'. PHP_EOL;
106
-            echo '               return true;'. PHP_EOL;
107
-            echo '       }'. PHP_EOL;
108
-            echo '               return false;'. PHP_EOL;
109
-            echo '       }'. PHP_EOL;
110
-            echo '       window.OSPromotedId = setInterval(function () {'. PHP_EOL;
111
-            echo '          loadPromoted();'. PHP_EOL;
112
-            echo '       }, 2000);'. PHP_EOL;
113
-            echo '</script>'. PHP_EOL;
104
+            echo 'promotedNode.style.display=""'.PHP_EOL;
105
+            echo '               clearInterval(window.OSPromotedId);'.PHP_EOL;
106
+            echo '               return true;'.PHP_EOL;
107
+            echo '       }'.PHP_EOL;
108
+            echo '               return false;'.PHP_EOL;
109
+            echo '       }'.PHP_EOL;
110
+            echo '       window.OSPromotedId = setInterval(function () {'.PHP_EOL;
111
+            echo '          loadPromoted();'.PHP_EOL;
112
+            echo '       }, 2000);'.PHP_EOL;
113
+            echo '</script>'.PHP_EOL;
114 114
         }
115 115
 
116 116
         if (isset($productId) || $checkoutPage) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                 $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'] = 'pmtSDK.simulator.types.SIMPLE';
121 121
                 $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'] = 'pmtSDK.simulator.skins.BLUE';
122 122
                 $simulatorCode = 'pmtSDK';
123
-            } else {
123
+            }else {
124 124
                 return true;
125 125
             }
126 126
 
@@ -131,102 +131,102 @@  discard block
 block discarded – undo
131 131
                 $productId = array_shift($productId);
132 132
                 $promotedProduct = $this->isPromoted($productId);
133 133
                 if ($promotedProduct) {
134
-                    $promotedAmount+=number_format(($item['price'] * $item['qty']), 2);
134
+                    $promotedAmount += number_format(($item['price'] * $item['qty']), 2);
135 135
                 }
136 136
             }
137 137
 
138
-            echo "<script src='".$this->sdkFile."'></script>". PHP_EOL;
139
-            echo '<script>'. PHP_EOL;
140
-            echo '        function loadSimulator()'. PHP_EOL;
141
-            echo '        {'. PHP_EOL;
142
-            echo '           if (typeof '.$simulatorCode.' != \'undefined\') {'. PHP_EOL;
143
-            echo '               var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL;
144
-            echo '               var priceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL;
145
-            echo '               var checkoutPriceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL;
146
-            echo '               var quantitySelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR']. '\';'. PHP_EOL;
147
-            echo '               var checkoutPage =     \'' . $checkoutPage.'\';'. PHP_EOL;
148
-            echo '               var promotedAmount =     \'' . $promotedAmount.'\';'. PHP_EOL;
149
-            echo '               var langCode =     \'' . $this->langCode.'\';'. 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
-            echo '               '.$simulatorCode.'.product_simulator = {};'. PHP_EOL;
163
-            echo '               '.$simulatorCode.'.product_simulator.id = \'product-simulator\';'. PHP_EOL;
164
-            echo '               '.$simulatorCode.'.product_simulator.publicKey = \'' . $this->pk . '\';'. PHP_EOL;
165
-            echo '               '.$simulatorCode.'.product_simulator.selector = positionSelector;'. PHP_EOL;
166
-            echo '               '.$simulatorCode.'.product_simulator.numInstalments = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'] . '\';'. PHP_EOL;
167
-            echo '               '.$simulatorCode.'.product_simulator.type = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'] . ';'. PHP_EOL;
168
-            echo '               '.$simulatorCode.'.product_simulator.skin = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'] . ';'. PHP_EOL;
169
-            echo '               '.$simulatorCode.'.product_simulator.position = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'] . ';'. PHP_EOL;
138
+            echo "<script src='".$this->sdkFile."'></script>".PHP_EOL;
139
+            echo '<script>'.PHP_EOL;
140
+            echo '        function loadSimulator()'.PHP_EOL;
141
+            echo '        {'.PHP_EOL;
142
+            echo '           if (typeof '.$simulatorCode.' != \'undefined\') {'.PHP_EOL;
143
+            echo '               var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL;
144
+            echo '               var priceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL;
145
+            echo '               var checkoutPriceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL;
146
+            echo '               var quantitySelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'].'\';'.PHP_EOL;
147
+            echo '               var checkoutPage =     \''.$checkoutPage.'\';'.PHP_EOL;
148
+            echo '               var promotedAmount =     \''.$promotedAmount.'\';'.PHP_EOL;
149
+            echo '               var langCode =     \''.$this->langCode.'\';'.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
+            echo '               '.$simulatorCode.'.product_simulator = {};'.PHP_EOL;
163
+            echo '               '.$simulatorCode.'.product_simulator.id = \'product-simulator\';'.PHP_EOL;
164
+            echo '               '.$simulatorCode.'.product_simulator.publicKey = \''.$this->pk.'\';'.PHP_EOL;
165
+            echo '               '.$simulatorCode.'.product_simulator.selector = positionSelector;'.PHP_EOL;
166
+            echo '               '.$simulatorCode.'.product_simulator.numInstalments = \''.$this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'].'\';'.PHP_EOL;
167
+            echo '               '.$simulatorCode.'.product_simulator.type = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'].';'.PHP_EOL;
168
+            echo '               '.$simulatorCode.'.product_simulator.skin = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'].';'.PHP_EOL;
169
+            echo '               '.$simulatorCode.'.product_simulator.position = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'].';'.PHP_EOL;
170 170
 
171 171
             //Amount in product page
172
-            echo '               var promotedProduct = \'' . $this->isPromoted($productId) .'\';'. PHP_EOL;
172
+            echo '               var promotedProduct = \''.$this->isPromoted($productId).'\';'.PHP_EOL;
173 173
             echo '               if(checkoutPage != \'1\' ) {';
174
-            echo '               '.$simulatorCode.'.product_simulator.itemAmountSelector = priceSelector;'. PHP_EOL;
175
-            echo '                   if(promotedProduct == \'1\') { ' . PHP_EOL;
176
-            echo '                    '.$simulatorCode.'.product_simulator.itemPromotedAmountSelector = priceSelector;'. PHP_EOL;
177
-            echo '                   }' . PHP_EOL;
174
+            echo '               '.$simulatorCode.'.product_simulator.itemAmountSelector = priceSelector;'.PHP_EOL;
175
+            echo '                   if(promotedProduct == \'1\') { '.PHP_EOL;
176
+            echo '                    '.$simulatorCode.'.product_simulator.itemPromotedAmountSelector = priceSelector;'.PHP_EOL;
177
+            echo '                   }'.PHP_EOL;
178 178
             echo '               }';
179 179
 
180 180
             //Amount in checkout page
181
-            echo '               if(checkoutPage == \'1\' ) { ' . PHP_EOL;
182
-            echo '               '.$simulatorCode.'.product_simulator.totalAmountSelector = priceSelector;'. PHP_EOL;
183
-            echo '                  if(promotedAmount != \'0\' && checkoutPage == \'1\' ) { ' . PHP_EOL;
184
-            echo '                  '   .$simulatorCode.'.product_simulator.totalPromotedAmount = promotedAmount;'. PHP_EOL;
185
-            echo '                  }' . PHP_EOL;
186
-            echo '               }' . PHP_EOL;
187
-            echo '               '.$simulatorCode.'.simulator.init('.$simulatorCode.'.product_simulator);'. PHP_EOL;
188
-            echo '               clearInterval(window.OSSimulatorId);'. PHP_EOL;
189
-            echo '               return true;'. PHP_EOL;
190
-            echo '           }'. PHP_EOL;
191
-            echo '           return false;'. PHP_EOL;
192
-            echo '       }'. PHP_EOL;
181
+            echo '               if(checkoutPage == \'1\' ) { '.PHP_EOL;
182
+            echo '               '.$simulatorCode.'.product_simulator.totalAmountSelector = priceSelector;'.PHP_EOL;
183
+            echo '                  if(promotedAmount != \'0\' && checkoutPage == \'1\' ) { '.PHP_EOL;
184
+            echo '                  '.$simulatorCode.'.product_simulator.totalPromotedAmount = promotedAmount;'.PHP_EOL;
185
+            echo '                  }'.PHP_EOL;
186
+            echo '               }'.PHP_EOL;
187
+            echo '               '.$simulatorCode.'.simulator.init('.$simulatorCode.'.product_simulator);'.PHP_EOL;
188
+            echo '               clearInterval(window.OSSimulatorId);'.PHP_EOL;
189
+            echo '               return true;'.PHP_EOL;
190
+            echo '           }'.PHP_EOL;
191
+            echo '           return false;'.PHP_EOL;
192
+            echo '       }'.PHP_EOL;
193 193
 
194 194
             //Invoke to main method
195
-            echo '       window.OSSimulatorId = setInterval(function () {'. PHP_EOL;
196
-            echo '          loadSimulator();'. PHP_EOL;
197
-            echo '       }, 2000);'. PHP_EOL;
198
-            echo '</script>'. PHP_EOL;
195
+            echo '       window.OSSimulatorId = setInterval(function () {'.PHP_EOL;
196
+            echo '          loadSimulator();'.PHP_EOL;
197
+            echo '       }, 2000);'.PHP_EOL;
198
+            echo '</script>'.PHP_EOL;
199 199
 
200 200
             //Checkout simulator
201 201
             if ($checkoutPage) {
202
-                echo '<script>' . PHP_EOL;
203
-
204
-                echo 'function checkSelected(value)'. PHP_EOL;
205
-                echo '{ '. PHP_EOL;
206
-                echo 'var simulator = document.getElementsByClassName("buttonSet");'  . PHP_EOL;
207
-                echo ' if(simulator == "undefined") { return false;  } '. PHP_EOL;
208
-                echo 'var pagantisCheckbox = document.querySelector("input[value=\'pagantis\']"); ' . PHP_EOL;
209
-                echo 'var grandparentNode = pagantisCheckbox.parentNode.parentNode;' . PHP_EOL;
210
-                echo 'if(grandparentNode == value) { var status="" } ' . PHP_EOL;
211
-                echo 'else { var status="none";} '. PHP_EOL;
212
-                echo 'simulator[0].style.display=status; ' . PHP_EOL;
213
-                echo '}'. PHP_EOL;
214
-
215
-                echo 'function showSimulator()'. PHP_EOL;
216
-                echo '{'. PHP_EOL;
217
-                echo 'var elements = document.querySelectorAll("tr[class^=\'moduleRow\']");' . PHP_EOL;
218
-                echo 'if(elements == null) { return false };' . PHP_EOL;
202
+                echo '<script>'.PHP_EOL;
203
+
204
+                echo 'function checkSelected(value)'.PHP_EOL;
205
+                echo '{ '.PHP_EOL;
206
+                echo 'var simulator = document.getElementsByClassName("buttonSet");'.PHP_EOL;
207
+                echo ' if(simulator == "undefined") { return false;  } '.PHP_EOL;
208
+                echo 'var pagantisCheckbox = document.querySelector("input[value=\'pagantis\']"); '.PHP_EOL;
209
+                echo 'var grandparentNode = pagantisCheckbox.parentNode.parentNode;'.PHP_EOL;
210
+                echo 'if(grandparentNode == value) { var status="" } '.PHP_EOL;
211
+                echo 'else { var status="none";} '.PHP_EOL;
212
+                echo 'simulator[0].style.display=status; '.PHP_EOL;
213
+                echo '}'.PHP_EOL;
214
+
215
+                echo 'function showSimulator()'.PHP_EOL;
216
+                echo '{'.PHP_EOL;
217
+                echo 'var elements = document.querySelectorAll("tr[class^=\'moduleRow\']");'.PHP_EOL;
218
+                echo 'if(elements == null) { return false };'.PHP_EOL;
219 219
                 echo 'for(var i = 0, max = elements.length; i < max; i++) { elements[i].onclick = function() {
220 220
                         checkSelected(this);
221 221
                     } }' . PHP_EOL;
222 222
                 echo 'clearInterval(window.OSdisplayId);';
223
-                echo 'return true;'. PHP_EOL;
224
-                echo '};'. PHP_EOL;
223
+                echo 'return true;'.PHP_EOL;
224
+                echo '};'.PHP_EOL;
225 225
 
226
-                echo '       window.OSdisplayId = setInterval(function () {'. PHP_EOL;
227
-                echo '          showSimulator();'. PHP_EOL;
228
-                echo '       }, 2000);'. PHP_EOL;
229
-                echo '</script>'. PHP_EOL;
226
+                echo '       window.OSdisplayId = setInterval(function () {'.PHP_EOL;
227
+                echo '          showSimulator();'.PHP_EOL;
228
+                echo '       }, 2000);'.PHP_EOL;
229
+                echo '</script>'.PHP_EOL;
230 230
             }
231 231
         }
232 232
     }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      * install
250 250
      */
251 251
     function install() {
252
-        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())");
252
+        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())");
253 253
 
254 254
     }
255 255
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      * remove
258 258
      */
259 259
     function remove() {
260
-        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
260
+        tep_db_query("delete from ".TABLE_CONFIGURATION." where configuration_key in ('".implode("', '", $this->keys())."')");
261 261
     }
262 262
 
263 263
     /**
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 
281 281
         if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') {
282 282
             $promotedProducts = array();
283
-        } else {
283
+        }else {
284 284
             $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION']));
285 285
         }
286 286
 
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.
catalog/includes/modules/payment/pagantis.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 
76 76
         if (strpos($_SERVER[REQUEST_URI], "checkout_payment.php") <= 0) {
77 77
             $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_ADMIN_TITLE; // Payment module title in Admin
78
-        } else {
79
-            $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_CHECKOUT .'<br/><br/><div class="buttonSet" style="display:none"></div><br/>'; // Payment module title in Catalog
78
+        }else {
79
+            $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_CHECKOUT.'<br/><br/><div class="buttonSet" style="display:none"></div><br/>'; // Payment module title in Catalog
80 80
         }
81 81
 
82 82
         if (defined('MODULE_PAYMENT_PAGANTIS_LANG_CODE')) {
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
                 "%s://%s%s%s",
93 93
                 isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
94 94
                 $_SERVER['SERVER_NAME'],
95
-                isset($_SERVER['SERVER_PORT']) ? ":" . $_SERVER['SERVER_PORT'] : '',
95
+                isset($_SERVER['SERVER_PORT']) ? ":".$_SERVER['SERVER_PORT'] : '',
96 96
                 $_SERVER['REQUEST_URI']
97 97
             )
98 98
         );
99 99
 
100
-        $this->form_action_url = $this->base_url . '/ext/modules/payment/pagantis/bypass.php';
100
+        $this->form_action_url = $this->base_url.'/ext/modules/payment/pagantis/bypass.php';
101 101
 
102 102
         if (defined('MODULE_PAYMENT_PAGANTIS_ERROR_MESSAGE')) {
103 103
             $this->errorMessage = strtoupper(MODULE_PAYMENT_PAGANTIS_ERROR_MESSAGE);
@@ -211,12 +211,12 @@  discard block
 block discarded – undo
211 211
             $national_id = $this->getNationalId();
212 212
             $tax_id = $this->getTaxId();
213 213
 
214
-            $fullName = $order->billing['firstname'] . ' ' . $order->billing['lastname'];
214
+            $fullName = $order->billing['firstname'].' '.$order->billing['lastname'];
215 215
             if ($fullName == ' ') {
216
-                $fullName = $order->customer['firstname'] . ' ' . $order->customer['lastname'];
216
+                $fullName = $order->customer['firstname'].' '.$order->customer['lastname'];
217 217
             }
218 218
             if ($fullName == ' ') {
219
-                $fullName = $order->delivery['firstname'] . ' ' . $order->delivery['lastname'];
219
+                $fullName = $order->delivery['firstname'].' '.$order->delivery['lastname'];
220 220
             }
221 221
             $userAddress = new Address();
222 222
             $userAddress
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
                     ->setQuantity(intval($item['qty']))
287 287
                     ->setDescription($item['name']);
288 288
                 if ($promotedProduct) {
289
-                    $promotedAmount+=$product->getAmount();
289
+                    $promotedAmount += $product->getAmount();
290 290
                     $promotedMessage = $product->getDescription()."-Price:".$item['final_price']."-Qty:".$product->getQuantity();
291 291
                     $metadataOrder->addMetadata('promotedProduct', $promotedMessage);
292 292
                 }
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
             );
307 307
 
308 308
             $cancelUrl = trim(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false));
309
-            if ($this->extraConfig['PAGANTIS_URL_KO']!='') {
309
+            if ($this->extraConfig['PAGANTIS_URL_KO'] != '') {
310 310
                 $koUrl = $this->extraConfig['PAGANTIS_URL_KO'];
311
-            } else {
311
+            }else {
312 312
                 $koUrl = $cancelUrl;
313 313
             }
314 314
 
@@ -346,25 +346,25 @@  discard block
 block discarded – undo
346 346
             if ($pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
347 347
                 $url = $pagantisOrder->getActionUrls()->getForm();
348 348
                 $this->insertRow($this->os_order_reference, $pagantisOrder->getId(), serialize($global_vars));
349
-            } else {
349
+            }else {
350 350
                 throw new OrderNotFoundException();
351 351
             }
352 352
 
353 353
             if ($url == "") {
354 354
                 throw new UnknownException(_("No ha sido posible obtener una respuesta de Pagantis"));
355
-            } else {
355
+            }else {
356 356
                 $output = "\n";
357
-                $output .= tep_draw_hidden_field("formUrl", $url) . "\n";
358
-                $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl) . "\n";
357
+                $output .= tep_draw_hidden_field("formUrl", $url)."\n";
358
+                $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl)."\n";
359 359
                 return $output;
360 360
 
361 361
             } //TODO IFRAME
362 362
         } catch (\Exception $exception) {
363 363
             $this->insertLog($exception);
364 364
             $output = "\n";
365
-            $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl) . "\n";
366
-            $output .= tep_draw_hidden_field("errorMessage", $exception->getMessage()) . "\n";
367
-            $output .= tep_draw_hidden_field("errorCode", $exception->getCode()) . "\n";
365
+            $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl)."\n";
366
+            $output .= tep_draw_hidden_field("errorMessage", $exception->getMessage())."\n";
367
+            $output .= tep_draw_hidden_field("errorCode", $exception->getCode())."\n";
368 368
             $output .= "<p>".$this->errorMessage.", <a href='$cancelUrl' style='text-decoration:underline'><b>";
369 369
             $output .= $this->errorLinkMessage." </b></a></p>";
370 370
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
             return 'failed';
429 429
         }
430 430
 
431
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
431
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
432 432
         (
433 433
             configuration_title,
434 434
             configuration_key,
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
             ',
452 452
             now()
453 453
         )");
454
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
454
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
455 455
         (
456 456
             configuration_title,
457 457
             configuration_key,
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
             '0',
472 472
             now()
473 473
         )");
474
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
474
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
475 475
         (
476 476
             configuration_title,
477 477
             configuration_key,
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
             '0',
492 492
             now()
493 493
         )");
494
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
494
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
495 495
         (
496 496
             configuration_title,
497 497
             configuration_key,
@@ -523,14 +523,14 @@  discard block
 block discarded – undo
523 523
      */
524 524
     private function installPagantisTables()
525 525
     {
526
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_LOG . " ( 
526
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_LOG." ( 
527 527
                           id int NOT NULL AUTO_INCREMENT, 
528 528
                           log text NOT NULL, 
529 529
                           createdAt timestamp DEFAULT CURRENT_TIMESTAMP, 
530 530
                           UNIQUE KEY id (id))";
531 531
         tep_db_query($sql);
532 532
 
533
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONFIG . " (
533
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONFIG." (
534 534
                             id int NOT NULL AUTO_INCREMENT, 
535 535
                             config varchar(60) NOT NULL, 
536 536
                             value varchar(200) NOT NULL, 
@@ -538,10 +538,10 @@  discard block
 block discarded – undo
538 538
         tep_db_query($sql);
539 539
 
540 540
         // check if table has records
541
-        $check_query = tep_db_query("select value from " . TABLE_PAGANTIS_CONFIG);
541
+        $check_query = tep_db_query("select value from ".TABLE_PAGANTIS_CONFIG);
542 542
         if (tep_db_num_rows($check_query) === 0) {
543 543
             foreach ((array)$this->defaultConfigs as $configKey => $configValue) {
544
-                $query = "INSERT INTO " . TABLE_PAGANTIS_CONFIG . "
544
+                $query = "INSERT INTO ".TABLE_PAGANTIS_CONFIG."
545 545
                 (
546 546
                     config,
547 547
                     value
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
             }
556 556
         }
557 557
 
558
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_ORDERS . " (
558
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_ORDERS." (
559 559
                             id int NOT NULL AUTO_INCREMENT, 
560 560
                             os_order_id varchar(50), 
561 561
                             os_order_reference varchar(50) NOT NULL,
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
                             UNIQUE KEY id(id))";
565 565
         tep_db_query($sql);
566 566
 
567
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONCURRENCY . " (
567
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONCURRENCY." (
568 568
                             id varchar(50) NOT NULL,
569 569
                             `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
570 570
                             UNIQUE KEY id(id))";
@@ -576,29 +576,29 @@  discard block
 block discarded – undo
576 576
      */
577 577
     public function remove()
578 578
     {
579
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_LOG . "'");
579
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_LOG."'");
580 580
         if (tep_db_num_rows($checkTable) > 0) {
581
-            tep_db_query("drop table " . TABLE_PAGANTIS_LOG);
581
+            tep_db_query("drop table ".TABLE_PAGANTIS_LOG);
582 582
         }
583 583
 
584
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONFIG . "'");
584
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONFIG."'");
585 585
         if (tep_db_num_rows($checkTable) > 0) {
586
-            tep_db_query("drop table " . TABLE_PAGANTIS_CONFIG);
586
+            tep_db_query("drop table ".TABLE_PAGANTIS_CONFIG);
587 587
         }
588 588
 
589
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_ORDERS . "'");
589
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_ORDERS."'");
590 590
         if (tep_db_num_rows($checkTable) > 0) {
591
-            tep_db_query("drop table " . TABLE_PAGANTIS_ORDERS);
591
+            tep_db_query("drop table ".TABLE_PAGANTIS_ORDERS);
592 592
         }
593 593
 
594
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONCURRENCY . "'");
594
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONCURRENCY."'");
595 595
         if (tep_db_num_rows($checkTable) > 0) {
596
-            tep_db_query("drop table " . TABLE_PAGANTIS_CONCURRENCY);
596
+            tep_db_query("drop table ".TABLE_PAGANTIS_CONCURRENCY);
597 597
         }
598 598
 
599
-        tep_db_query("DELETE FROM ". TABLE_CONFIGURATION ." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')");
599
+        tep_db_query("DELETE FROM ".TABLE_CONFIGURATION." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')");
600 600
 
601
-        $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key like '%_PAGANTIS_%'";
601
+        $query = "delete from ".TABLE_CONFIGURATION." where configuration_key like '%_PAGANTIS_%'";
602 602
         tep_db_query($query);
603 603
 
604 604
         $this->uninstallSimulator();
@@ -653,13 +653,13 @@  discard block
 block discarded – undo
653 653
      */
654 654
     private function insertRow($orderId, $pagantisOrderId, $globalVars)
655 655
     {
656
-        $query = "select * from " . TABLE_PAGANTIS_ORDERS . " where os_order_reference='$orderId'";
656
+        $query = "select * from ".TABLE_PAGANTIS_ORDERS." where os_order_reference='$orderId'";
657 657
         $resultsSelect = tep_db_query($query);
658 658
         $countResults = tep_db_num_rows($resultsSelect);
659 659
         if ($countResults == 0) {
660
-            $query = "INSERT INTO " . TABLE_PAGANTIS_ORDERS . " 
660
+            $query = "INSERT INTO ".TABLE_PAGANTIS_ORDERS." 
661 661
                 (os_order_reference, pagantis_order_id, globals) values ('$orderId', '$pagantisOrderId','$globalVars')";
662
-        } else {
662
+        }else {
663 663
             $query = "UPDATE ".TABLE_PAGANTIS_ORDERS." set pagantis_order_id='$pagantisOrderId' 
664 664
                         where os_order_reference='$orderId'";
665 665
         }
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 
698 698
         if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') {
699 699
             $promotedProducts = array();
700
-        } else {
700
+        }else {
701 701
             $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION']));
702 702
         }
703 703
 
@@ -710,17 +710,17 @@  discard block
 block discarded – undo
710 710
     private function getDescription()
711 711
     {
712 712
         $descriptionCode = "<img src=\"images/icon_info.gif\" border=\"0\" alt=\"Info\" title=\"Info\">&nbsp;<strong>Module version:</strong> $this->version<br/><br/>";
713
-        $descriptionCode.= "<img src=\"images/icon_info.gif\" border=\"0\">&nbsp;<a href='https://developer.pagantis.com/' target=\"_blank\" style=\"text-decoration: underline; font-weight: bold;\">View Online Documentation</a><br/><br/>";
714
-        $descriptionCode.= "<img src='images/icon_popup.gif'  border='0'>        <a href='http://pagantis.com' target='_blank' style='text-decoration: underline; font-weight: bold;'>Visit Pagantis Website</a><br/><br/><br/>";
713
+        $descriptionCode .= "<img src=\"images/icon_info.gif\" border=\"0\">&nbsp;<a href='https://developer.pagantis.com/' target=\"_blank\" style=\"text-decoration: underline; font-weight: bold;\">View Online Documentation</a><br/><br/>";
714
+        $descriptionCode .= "<img src='images/icon_popup.gif'  border='0'>        <a href='http://pagantis.com' target='_blank' style='text-decoration: underline; font-weight: bold;'>Visit Pagantis Website</a><br/><br/><br/>";
715 715
 
716 716
         if (MODULE_PAYMENT_PAGANTIS_STATUS == 'True') {
717 717
             $pagantisPromotionUrl = $this->base_url.'/admin/promotion.php';
718 718
             $linkDescription = "Si deseas ofrecer financiación sin intereses para alguno de tus productos ";
719
-            $descriptionCode.= "<img src='images/icon_info.gif' border='0'/> $linkDescription<a href='$pagantisPromotionUrl' style='text-decoration: underline; font-weight: bold;'>haz click aquí</a>";
719
+            $descriptionCode .= "<img src='images/icon_info.gif' border='0'/> $linkDescription<a href='$pagantisPromotionUrl' style='text-decoration: underline; font-weight: bold;'>haz click aquí</a>";
720 720
 
721 721
             $pagantisAllowedCountriesUrl = $this->base_url.'/admin/allowedCountries.php';
722 722
             $linkDescription = "Para gestionar paises en los que operar con Pagantis ";
723
-            $descriptionCode.= "<br/><br/><img src='images/icon_info.gif' border='0'/> $linkDescription<a href='$pagantisAllowedCountriesUrl' style='text-decoration: underline; font-weight: bold;'>haz click aquí</a>";
723
+            $descriptionCode .= "<br/><br/><img src='images/icon_info.gif' border='0'/> $linkDescription<a href='$pagantisAllowedCountriesUrl' style='text-decoration: underline; font-weight: bold;'>haz click aquí</a>";
724 724
         }
725 725
 
726 726
         return $descriptionCode;
@@ -731,18 +731,18 @@  discard block
 block discarded – undo
731 731
      */
732 732
     private function installSimulator()
733 733
     {
734
-        $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." 
734
+        $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." 
735 735
                                     where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'
736 736
                                     and configuration_value like '%ht_pagantis.php%';");
737 737
         if (tep_db_num_rows($checkSimulator) > 0) {
738 738
             return true;
739 739
         }
740 740
 
741
-        $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = concat(configuration_value, ';ht_pagantis.php')
741
+        $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = concat(configuration_value, ';ht_pagantis.php')
742 742
                         where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'";
743 743
         tep_db_query($query);
744 744
 
745
-        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Pagantis Module', 'MODULE_HEADER_TAGS_PAGANTIS_STATUS', 'True', '', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
745
+        tep_db_query("insert into ".TABLE_CONFIGURATION." (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Pagantis Module', 'MODULE_HEADER_TAGS_PAGANTIS_STATUS', 'True', '', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
746 746
     }
747 747
 
748 748
     /**
@@ -750,18 +750,18 @@  discard block
 block discarded – undo
750 750
      */
751 751
     private function uninstallSimulator()
752 752
     {
753
-        $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." 
753
+        $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." 
754 754
                                     where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'
755 755
                                     and configuration_value like '%ht_pagantis.php%';");
756 756
         if (tep_db_num_rows($checkSimulator) == 0) {
757 757
             return true;
758 758
         }
759 759
 
760
-        $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '')
760
+        $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '')
761 761
                         where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'";
762 762
         tep_db_query($query);
763 763
 
764
-        $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'";
764
+        $query = "delete from ".TABLE_CONFIGURATION." where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'";
765 765
         tep_db_query($query);
766 766
     }
767 767
 
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
     private function insertLog($exception)
772 772
     {
773 773
         if ($exception instanceof \Exception) {
774
-            $logEntry= new LogEntry();
774
+            $logEntry = new LogEntry();
775 775
             $logEntryJson = $logEntry->error($exception)->toJson();
776 776
             $logEntryJson = addslashes($logEntryJson);
777 777
 
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
             return $order->customer['national_id'];
791 791
         } elseif (isset($order->billing['piva'])) {
792 792
             return $order->billing['piva'];
793
-        } else {
793
+        }else {
794 794
             return null;
795 795
         }
796 796
     }
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
             return $order->customer['tax_id'];
806 806
         } elseif (isset($order->billing['cf'])) {
807 807
             return $order->billing['cf'];
808
-        } else {
808
+        }else {
809 809
             return null;
810 810
         }
811 811
     }
Please login to merge, or discard this patch.
catalog/ext/modules/payment/pagantis/notifyController.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -83,22 +83,22 @@  discard block
 block discarded – undo
83 83
             $jsonResponse->setException($exception);
84 84
             $this->insertLog($exception);
85 85
 
86
-            if ($this->extraConfig['PAGANTIS_URL_KO'] =! '') {
86
+            if ($this->extraConfig['PAGANTIS_URL_KO'] = !'') {
87 87
                 $koUrl = $this->extraConfig['PAGANTIS_URL_KO'];
88
-            } else {
88
+            }else {
89 89
                 $koUrl = trim(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false));
90 90
             }
91 91
 
92 92
             if ($this->origin == 'notify') {
93 93
                 $jsonResponse->printResponse();
94
-            } else {
94
+            }else {
95 95
                 if ($exception->getMessage() == AlreadyProcessedException::ERROR_MESSAGE) {
96
-                    if ($this->extraConfig['PAGANTIS_URL_OK']!='') {
96
+                    if ($this->extraConfig['PAGANTIS_URL_OK'] != '') {
97 97
                         $confirmationUrl = $this->extraConfig['PAGANTIS_URL_OK'];
98
-                        $confirmationUrl.="?order_id=$this->merchantOrderId";
99
-                    } else {
98
+                        $confirmationUrl .= "?order_id=$this->merchantOrderId";
99
+                    }else {
100 100
                         $confirmationUrl = trim(tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, '', 'SSL', false));
101
-                        $confirmationUrl.="?order_id=$this->merchantOrderId";
101
+                        $confirmationUrl .= "?order_id=$this->merchantOrderId";
102 102
                     }
103 103
 
104 104
                     header("Location: $confirmationUrl");
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
         if ($this->origin == 'notify') {
135 135
             $jsonResponse->printResponse();
136
-        } else {
136
+        }else {
137 137
             return $jsonResponse;
138 138
         }
139 139
     }
@@ -210,12 +210,12 @@  discard block
 block discarded – undo
210 210
         try {
211 211
             $this->checkPagantisStatus(array('AUTHORIZED'));
212 212
         } catch (\Exception $e) {
213
-            if ($this->findOscommerceOrderId()!='') {
213
+            if ($this->findOscommerceOrderId() != '') {
214 214
                 throw new AlreadyProcessedException();
215
-            } else {
215
+            }else {
216 216
                 if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
217 217
                     $status = $this->pagantisOrder->getStatus();
218
-                } else {
218
+                }else {
219 219
                     $status = '-';
220 220
                 }
221 221
                 throw new WrongStatusException($status);
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     {
231 231
         global $order;
232 232
 
233
-        if ($order->info['order_status']!=='1') {
233
+        if ($order->info['order_status'] !== '1') {
234 234
             throw new AlreadyProcessedException();
235 235
         }
236 236
     }
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
             $this->pagantisOrder = $this->orderClient->getOrder($this->pagantisOrderId);
262 262
             if ($this->pagantisOrder->getStatus() !== Order::STATUS_CONFIRMED) {
263 263
                 throw new UnknownException($e->getMessage());
264
-            } else {
264
+            }else {
265 265
                 $logMessage = 'Concurrency issue: Order_id '.$this->pagantisOrderId.' was confirmed by other process';
266 266
                 $this->insertLog(null, $logMessage);
267 267
             }
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
             if ($orderId == null) {
316 316
                 $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where  timestamp<".(time() - 5);
317 317
                 tep_db_query($query);
318
-            } elseif ($orderId!='') {
318
+            } elseif ($orderId != '') {
319 319
                 $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where id='$orderId'";
320 320
                 tep_db_query($query);
321 321
             }
@@ -367,12 +367,12 @@  discard block
 block discarded – undo
367 367
             if (!$payed) {
368 368
                 if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
369 369
                     $status = $this->pagantisOrder->getStatus();
370
-                } else {
370
+                }else {
371 371
                     $status = '-';
372 372
                 }
373 373
                 throw new WrongStatusException($status);
374 374
             }
375
-        } else {
375
+        }else {
376 376
             throw new OrderNotFoundException();
377 377
         }
378 378
     }
@@ -418,12 +418,12 @@  discard block
 block discarded – undo
418 418
         $metadataInfo = '';
419 419
         foreach ($metadataOrder as $metadataKey => $metadataValue) {
420 420
             if ($metadataKey == 'promotedProduct') {
421
-                $metadataInfo.= "/Producto promocionado = $metadataValue";
421
+                $metadataInfo .= "/Producto promocionado = $metadataValue";
422 422
             }
423 423
         }
424 424
 
425 425
         $comment = "Pagantis id=$this->pagantisOrderId/Via=".ucfirst($this->origin)."/".$metadataInfo;
426
-        $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY ."(comments, orders_id, orders_status_id, customer_notified,
426
+        $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY."(comments, orders_id, orders_status_id, customer_notified,
427 427
         date_added) values ('$comment', ".$insert_id.", '2', -1, now() )";
428 428
         tep_db_query($query);
429 429
 
@@ -453,10 +453,10 @@  discard block
 block discarded – undo
453 453
      */
454 454
     private function insertLog($exception = null, $message = null)
455 455
     {
456
-        $logEntry= new LogEntry();
456
+        $logEntry = new LogEntry();
457 457
         if ($exception instanceof \Exception) {
458 458
             $logEntryJson = $logEntry->error($exception)->toJson();
459
-        } else {
459
+        }else {
460 460
             $logEntryJson = $logEntry->info($message)->toJson();
461 461
         }
462 462
             $query = "insert into ".TABLE_PAGANTIS_LOG."(log) values ('$logEntryJson')";
Please login to merge, or discard this patch.