@@ -10,7 +10,6 @@ |
||
10 | 10 | * @package Test\Configure |
11 | 11 | * |
12 | 12 | * @group oscommerce-configure |
13 | - |
|
14 | 13 | */ |
15 | 14 | class ConfigureTest extends AbstractConfigure |
16 | 15 | { |
@@ -10,7 +10,6 @@ |
||
10 | 10 | * @package Test\Configure |
11 | 11 | * |
12 | 12 | * @group oscommerce-configure-ppp |
13 | - |
|
14 | 13 | */ |
15 | 14 | class ConfigurePPPTest extends AbstractConfigure |
16 | 15 | { |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function loginToBackOffice() |
19 | 19 | { |
20 | - $this->webDriver->get(self::OSCURL . self::BACKOFFICE_FOLDER); |
|
20 | + $this->webDriver->get(self::OSCURL.self::BACKOFFICE_FOLDER); |
|
21 | 21 | sleep(2); |
22 | 22 | |
23 | 23 | $usernameElementSearch = WebDriverBy::name('username'); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | ) { |
35 | 35 | $this->enabled = ((MODULE_HEADER_TAGS_PAGANTIS_STATUS == 'True') && |
36 | 36 | (MODULE_PAYMENT_PAGANTIS_STATUS == 'True') && |
37 | - (MODULE_PAYMENT_PAGANTIS_SIMULATOR == 'True')) ; |
|
37 | + (MODULE_PAYMENT_PAGANTIS_SIMULATOR == 'True')); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $this->extraConfig = $this->getExtraConfig(); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | private function getConfig($config = '') |
68 | 68 | { |
69 | - $query = "select * from ".TABLE_CONFIGURATION . " where configuration_key ='" . $config . "'"; |
|
69 | + $query = "select * from ".TABLE_CONFIGURATION." where configuration_key ='".$config."'"; |
|
70 | 70 | $result = tep_db_query($query); |
71 | 71 | $resultArray = tep_db_fetch_array($result); |
72 | 72 | return $resultArray['configuration_value']; |
@@ -83,29 +83,29 @@ discard block |
||
83 | 83 | $checkoutPage = strpos($_SERVER[REQUEST_URI], "checkout_payment.php") > 0; |
84 | 84 | |
85 | 85 | //Show promoted html |
86 | - if ($this->isPromoted($productId) && $checkoutPage!='1') { |
|
86 | + if ($this->isPromoted($productId) && $checkoutPage != '1') { |
|
87 | 87 | echo "<div id='promotedText' style='display:none'><br/>".$this->extraConfig['PAGANTIS_PROMOTED_PRODUCT_CODE']."</div>"; |
88 | - echo '<script>'. PHP_EOL; |
|
89 | - echo ' function loadPromoted()'. PHP_EOL; |
|
90 | - echo ' {'. PHP_EOL; |
|
91 | - echo 'var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL; |
|
92 | - echo 'if (positionSelector === \'default\') {'. PHP_EOL; |
|
93 | - echo 'positionSelector = \'.buttonSet\''. PHP_EOL; |
|
94 | - echo '}'. PHP_EOL; |
|
88 | + echo '<script>'.PHP_EOL; |
|
89 | + echo ' function loadPromoted()'.PHP_EOL; |
|
90 | + echo ' {'.PHP_EOL; |
|
91 | + echo 'var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL; |
|
92 | + echo 'if (positionSelector === \'default\') {'.PHP_EOL; |
|
93 | + echo 'positionSelector = \'.buttonSet\''.PHP_EOL; |
|
94 | + echo '}'.PHP_EOL; |
|
95 | 95 | echo 'var docFather = document.querySelector(positionSelector);'.PHP_EOL; |
96 | - echo 'if (typeof docFather != \'undefined\') {'. PHP_EOL; |
|
96 | + echo 'if (typeof docFather != \'undefined\') {'.PHP_EOL; |
|
97 | 97 | echo 'var promotedNode = document.getElementById("promotedText");'.PHP_EOL; |
98 | 98 | echo 'docFather.appendChild(promotedNode);'.PHP_EOL; |
99 | - echo 'promotedNode.style.display=""' . PHP_EOL; |
|
100 | - echo ' clearInterval(window.OSPromotedId);'. PHP_EOL; |
|
101 | - echo ' return true;'. PHP_EOL; |
|
102 | - echo ' }'. PHP_EOL; |
|
103 | - echo ' return false;'. PHP_EOL; |
|
104 | - echo ' }'. PHP_EOL; |
|
105 | - echo ' window.OSPromotedId = setInterval(function () {'. PHP_EOL; |
|
106 | - echo ' loadPromoted();'. PHP_EOL; |
|
107 | - echo ' }, 2000);'. PHP_EOL; |
|
108 | - echo '</script>'. PHP_EOL; |
|
99 | + echo 'promotedNode.style.display=""'.PHP_EOL; |
|
100 | + echo ' clearInterval(window.OSPromotedId);'.PHP_EOL; |
|
101 | + echo ' return true;'.PHP_EOL; |
|
102 | + echo ' }'.PHP_EOL; |
|
103 | + echo ' return false;'.PHP_EOL; |
|
104 | + echo ' }'.PHP_EOL; |
|
105 | + echo ' window.OSPromotedId = setInterval(function () {'.PHP_EOL; |
|
106 | + echo ' loadPromoted();'.PHP_EOL; |
|
107 | + echo ' }, 2000);'.PHP_EOL; |
|
108 | + echo '</script>'.PHP_EOL; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | if (isset($productId) || $checkoutPage) { |
@@ -124,101 +124,101 @@ discard block |
||
124 | 124 | $productId = array_shift($productId); |
125 | 125 | $promotedProduct = $this->isPromoted($productId); |
126 | 126 | if ($promotedProduct) { |
127 | - $promotedAmount+=number_format(($item['price'] * $item['qty']), 2); |
|
127 | + $promotedAmount += number_format(($item['price'] * $item['qty']), 2); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | - echo "<script src='".$this->sdkFile."'></script>". PHP_EOL; |
|
132 | - echo '<script>'. PHP_EOL; |
|
133 | - echo ' function loadSimulator()'. PHP_EOL; |
|
134 | - echo ' {'. PHP_EOL; |
|
135 | - echo ' if (typeof '.$simulatorCode.' != \'undefined\') {'. PHP_EOL; |
|
136 | - echo ' var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL; |
|
137 | - echo ' var priceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL; |
|
138 | - echo ' var checkoutPriceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL; |
|
139 | - echo ' var quantitySelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR']. '\';'. PHP_EOL; |
|
140 | - echo ' var checkoutPage = \'' . $checkoutPage.'\';'. PHP_EOL; |
|
141 | - echo ' var promotedAmount = \'' . $promotedAmount.'\';'. PHP_EOL; |
|
142 | - |
|
143 | - echo ' if (positionSelector === \'default\') {'. PHP_EOL; |
|
144 | - echo ' positionSelector = \'.buttonSet\''. PHP_EOL; |
|
145 | - echo ' }'. PHP_EOL; |
|
146 | - |
|
147 | - echo ' if (priceSelector === \'default\') {'. PHP_EOL; |
|
148 | - echo ' priceSelector = \'#bodyContent>form>div>h1\''. PHP_EOL; |
|
149 | - echo ' }'. PHP_EOL; |
|
150 | - |
|
151 | - echo ' if (checkoutPriceSelector == \'default\' && checkoutPage == \'1\') {'. PHP_EOL; |
|
152 | - echo ' priceSelector = \'#columnRight > .infoBoxContainer > .infoBoxContents > tbody > tr:last-child > td\';'. PHP_EOL; |
|
153 | - echo ' }'. PHP_EOL; |
|
154 | - echo ' '.$simulatorCode.'.product_simulator = {};'. PHP_EOL; |
|
155 | - echo ' '.$simulatorCode.'.product_simulator.id = \'product-simulator\';'. PHP_EOL; |
|
156 | - echo ' '.$simulatorCode.'.product_simulator.publicKey = \'' . $this->pk . '\';'. PHP_EOL; |
|
157 | - echo ' '.$simulatorCode.'.product_simulator.selector = positionSelector;'. PHP_EOL; |
|
158 | - echo ' '.$simulatorCode.'.product_simulator.numInstalments = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'] . '\';'. PHP_EOL; |
|
159 | - echo ' '.$simulatorCode.'.product_simulator.type = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'] . ';'. PHP_EOL; |
|
160 | - echo ' '.$simulatorCode.'.product_simulator.skin = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'] . ';'. PHP_EOL; |
|
161 | - echo ' '.$simulatorCode.'.product_simulator.position = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'] . ';'. PHP_EOL; |
|
131 | + echo "<script src='".$this->sdkFile."'></script>".PHP_EOL; |
|
132 | + echo '<script>'.PHP_EOL; |
|
133 | + echo ' function loadSimulator()'.PHP_EOL; |
|
134 | + echo ' {'.PHP_EOL; |
|
135 | + echo ' if (typeof '.$simulatorCode.' != \'undefined\') {'.PHP_EOL; |
|
136 | + echo ' var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL; |
|
137 | + echo ' var priceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL; |
|
138 | + echo ' var checkoutPriceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL; |
|
139 | + echo ' var quantitySelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'].'\';'.PHP_EOL; |
|
140 | + echo ' var checkoutPage = \''.$checkoutPage.'\';'.PHP_EOL; |
|
141 | + echo ' var promotedAmount = \''.$promotedAmount.'\';'.PHP_EOL; |
|
142 | + |
|
143 | + echo ' if (positionSelector === \'default\') {'.PHP_EOL; |
|
144 | + echo ' positionSelector = \'.buttonSet\''.PHP_EOL; |
|
145 | + echo ' }'.PHP_EOL; |
|
146 | + |
|
147 | + echo ' if (priceSelector === \'default\') {'.PHP_EOL; |
|
148 | + echo ' priceSelector = \'#bodyContent>form>div>h1\''.PHP_EOL; |
|
149 | + echo ' }'.PHP_EOL; |
|
150 | + |
|
151 | + echo ' if (checkoutPriceSelector == \'default\' && checkoutPage == \'1\') {'.PHP_EOL; |
|
152 | + echo ' priceSelector = \'#columnRight > .infoBoxContainer > .infoBoxContents > tbody > tr:last-child > td\';'.PHP_EOL; |
|
153 | + echo ' }'.PHP_EOL; |
|
154 | + echo ' '.$simulatorCode.'.product_simulator = {};'.PHP_EOL; |
|
155 | + echo ' '.$simulatorCode.'.product_simulator.id = \'product-simulator\';'.PHP_EOL; |
|
156 | + echo ' '.$simulatorCode.'.product_simulator.publicKey = \''.$this->pk.'\';'.PHP_EOL; |
|
157 | + echo ' '.$simulatorCode.'.product_simulator.selector = positionSelector;'.PHP_EOL; |
|
158 | + echo ' '.$simulatorCode.'.product_simulator.numInstalments = \''.$this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'].'\';'.PHP_EOL; |
|
159 | + echo ' '.$simulatorCode.'.product_simulator.type = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'].';'.PHP_EOL; |
|
160 | + echo ' '.$simulatorCode.'.product_simulator.skin = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'].';'.PHP_EOL; |
|
161 | + echo ' '.$simulatorCode.'.product_simulator.position = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'].';'.PHP_EOL; |
|
162 | 162 | |
163 | 163 | //Amount in product page |
164 | - echo ' var promotedProduct = \'' . $this->isPromoted($productId) .'\';'. PHP_EOL; |
|
164 | + echo ' var promotedProduct = \''.$this->isPromoted($productId).'\';'.PHP_EOL; |
|
165 | 165 | echo ' if(checkoutPage != \'1\' ) {'; |
166 | - echo ' '.$simulatorCode.'.product_simulator.itemAmountSelector = priceSelector;'. PHP_EOL; |
|
167 | - echo ' if(promotedProduct == \'1\') { ' . PHP_EOL; |
|
168 | - echo ' '.$simulatorCode.'.product_simulator.itemPromotedAmountSelector = priceSelector;'. PHP_EOL; |
|
169 | - echo ' }' . PHP_EOL; |
|
166 | + echo ' '.$simulatorCode.'.product_simulator.itemAmountSelector = priceSelector;'.PHP_EOL; |
|
167 | + echo ' if(promotedProduct == \'1\') { '.PHP_EOL; |
|
168 | + echo ' '.$simulatorCode.'.product_simulator.itemPromotedAmountSelector = priceSelector;'.PHP_EOL; |
|
169 | + echo ' }'.PHP_EOL; |
|
170 | 170 | echo ' }'; |
171 | 171 | |
172 | 172 | //Amount in checkout page |
173 | - echo ' if(checkoutPage == \'1\' ) { ' . PHP_EOL; |
|
174 | - echo ' '.$simulatorCode.'.product_simulator.totalAmountSelector = priceSelector;'. PHP_EOL; |
|
175 | - echo ' if(promotedAmount != \'0\' && checkoutPage == \'1\' ) { ' . PHP_EOL; |
|
176 | - echo ' ' .$simulatorCode.'.product_simulator.totalPromotedAmount = promotedAmount;'. PHP_EOL; |
|
177 | - echo ' }' . PHP_EOL; |
|
178 | - echo ' }' . PHP_EOL; |
|
179 | - echo ' '.$simulatorCode.'.simulator.init('.$simulatorCode.'.product_simulator);'. PHP_EOL; |
|
180 | - echo ' clearInterval(window.OSSimulatorId);'. PHP_EOL; |
|
181 | - echo ' return true;'. PHP_EOL; |
|
182 | - echo ' }'. PHP_EOL; |
|
183 | - echo ' return false;'. PHP_EOL; |
|
184 | - echo ' }'. PHP_EOL; |
|
185 | - echo ' window.OSSimulatorId = setInterval(function () {'. PHP_EOL; |
|
186 | - echo ' loadSimulator();'. PHP_EOL; |
|
187 | - echo ' }, 2000);'. PHP_EOL; |
|
188 | - echo '</script>'. PHP_EOL; |
|
173 | + echo ' if(checkoutPage == \'1\' ) { '.PHP_EOL; |
|
174 | + echo ' '.$simulatorCode.'.product_simulator.totalAmountSelector = priceSelector;'.PHP_EOL; |
|
175 | + echo ' if(promotedAmount != \'0\' && checkoutPage == \'1\' ) { '.PHP_EOL; |
|
176 | + echo ' '.$simulatorCode.'.product_simulator.totalPromotedAmount = promotedAmount;'.PHP_EOL; |
|
177 | + echo ' }'.PHP_EOL; |
|
178 | + echo ' }'.PHP_EOL; |
|
179 | + echo ' '.$simulatorCode.'.simulator.init('.$simulatorCode.'.product_simulator);'.PHP_EOL; |
|
180 | + echo ' clearInterval(window.OSSimulatorId);'.PHP_EOL; |
|
181 | + echo ' return true;'.PHP_EOL; |
|
182 | + echo ' }'.PHP_EOL; |
|
183 | + echo ' return false;'.PHP_EOL; |
|
184 | + echo ' }'.PHP_EOL; |
|
185 | + echo ' window.OSSimulatorId = setInterval(function () {'.PHP_EOL; |
|
186 | + echo ' loadSimulator();'.PHP_EOL; |
|
187 | + echo ' }, 2000);'.PHP_EOL; |
|
188 | + echo '</script>'.PHP_EOL; |
|
189 | 189 | |
190 | 190 | //Checkout simulator |
191 | 191 | if ($checkoutPage) { |
192 | - echo '<script>' . PHP_EOL; |
|
193 | - echo 'function checkSelected(value)'. PHP_EOL; |
|
194 | - echo '{ '. PHP_EOL; |
|
195 | - echo 'var simulator = document.getElementsByClassName("buttonSet");' . PHP_EOL; |
|
196 | - echo ' if(simulator == "undefined") { return false; } '. PHP_EOL; |
|
197 | - echo 'var pagantisCheckbox = document.querySelector("input[value=\'pagantis\']"); ' . PHP_EOL; |
|
198 | - echo 'var grandparentNode = pagantisCheckbox.parentNode.parentNode;' . PHP_EOL; |
|
199 | - echo 'if(grandparentNode == value) { var status="" } ' . PHP_EOL; |
|
200 | - echo 'else { var status="none";} '. PHP_EOL; |
|
201 | - echo 'simulator[0].style.display=status; ' . PHP_EOL; |
|
202 | - echo '}'. PHP_EOL; |
|
203 | - |
|
204 | - echo 'function showSimulator()'. PHP_EOL; |
|
205 | - echo '{'. PHP_EOL; |
|
206 | - echo 'var elements = document.querySelectorAll("tr[class^=\'moduleRow\']");' . PHP_EOL; |
|
207 | - echo 'if(elements == null) { return false };' . PHP_EOL; |
|
192 | + echo '<script>'.PHP_EOL; |
|
193 | + echo 'function checkSelected(value)'.PHP_EOL; |
|
194 | + echo '{ '.PHP_EOL; |
|
195 | + echo 'var simulator = document.getElementsByClassName("buttonSet");'.PHP_EOL; |
|
196 | + echo ' if(simulator == "undefined") { return false; } '.PHP_EOL; |
|
197 | + echo 'var pagantisCheckbox = document.querySelector("input[value=\'pagantis\']"); '.PHP_EOL; |
|
198 | + echo 'var grandparentNode = pagantisCheckbox.parentNode.parentNode;'.PHP_EOL; |
|
199 | + echo 'if(grandparentNode == value) { var status="" } '.PHP_EOL; |
|
200 | + echo 'else { var status="none";} '.PHP_EOL; |
|
201 | + echo 'simulator[0].style.display=status; '.PHP_EOL; |
|
202 | + echo '}'.PHP_EOL; |
|
203 | + |
|
204 | + echo 'function showSimulator()'.PHP_EOL; |
|
205 | + echo '{'.PHP_EOL; |
|
206 | + echo 'var elements = document.querySelectorAll("tr[class^=\'moduleRow\']");'.PHP_EOL; |
|
207 | + echo 'if(elements == null) { return false };'.PHP_EOL; |
|
208 | 208 | |
209 | 209 | echo 'for(var i = 0, max = elements.length; i < max; i++) { elements[i].onclick = function() { |
210 | 210 | checkSelected(this); |
211 | 211 | } }' . PHP_EOL; |
212 | 212 | echo 'clearInterval(window.OSdisplayId);'; |
213 | - echo 'return true;'. PHP_EOL; |
|
214 | - echo '};'. PHP_EOL; |
|
213 | + echo 'return true;'.PHP_EOL; |
|
214 | + echo '};'.PHP_EOL; |
|
215 | 215 | |
216 | - echo ' window.OSdisplayId = setInterval(function () {'. PHP_EOL; |
|
217 | - echo ' showSimulator();'. PHP_EOL; |
|
218 | - echo ' }, 2000);'. PHP_EOL; |
|
216 | + echo ' window.OSdisplayId = setInterval(function () {'.PHP_EOL; |
|
217 | + echo ' showSimulator();'.PHP_EOL; |
|
218 | + echo ' }, 2000);'.PHP_EOL; |
|
219 | 219 | |
220 | 220 | |
221 | - echo '</script>'. PHP_EOL; |
|
221 | + echo '</script>'.PHP_EOL; |
|
222 | 222 | } |
223 | 223 | } |
224 | 224 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * install |
242 | 242 | */ |
243 | 243 | function install() { |
244 | - 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())"); |
|
244 | + 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())"); |
|
245 | 245 | |
246 | 246 | } |
247 | 247 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * remove |
250 | 250 | */ |
251 | 251 | function remove() { |
252 | - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); |
|
252 | + tep_db_query("delete from ".TABLE_CONFIGURATION." where configuration_key in ('".implode("', '", $this->keys())."')"); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | |
276 | 276 | if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') { |
277 | 277 | $promotedProducts = array(); |
278 | - } else { |
|
278 | + }else { |
|
279 | 279 | $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION'])); |
280 | 280 | } |
281 | 281 |
@@ -35,23 +35,23 @@ discard block |
||
35 | 35 | public $langCode = null; |
36 | 36 | |
37 | 37 | public $defaultConfigs = array('PAGANTIS_TITLE'=>'Instant Financing', |
38 | - 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
39 | - 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
40 | - 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
41 | - 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
42 | - 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
43 | - 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
44 | - 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
45 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
46 | - 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
47 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR_CHECKOUT'=>'default', |
|
48 | - 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
49 | - 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
50 | - 'PAGANTIS_URL_OK'=>'', |
|
51 | - 'PAGANTIS_URL_KO'=>'', |
|
52 | - 'PAGANTIS_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente online y sin papeleos,¡y la respuesta es inmediata!', |
|
53 | - 'PAGANTIS_PROMOTION' => '', |
|
54 | - 'PAGANTIS_PROMOTED_PRODUCT_CODE' => '<p>¡Financia este producto sin intereses! - 0% TAE</p>' |
|
38 | + 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
39 | + 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
40 | + 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
41 | + 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
42 | + 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
43 | + 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
44 | + 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
45 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
46 | + 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
47 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR_CHECKOUT'=>'default', |
|
48 | + 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
49 | + 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
50 | + 'PAGANTIS_URL_OK'=>'', |
|
51 | + 'PAGANTIS_URL_KO'=>'', |
|
52 | + 'PAGANTIS_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente online y sin papeleos,¡y la respuesta es inmediata!', |
|
53 | + 'PAGANTIS_PROMOTION' => '', |
|
54 | + 'PAGANTIS_PROMOTED_PRODUCT_CODE' => '<p>¡Financia este producto sin intereses! - 0% TAE</p>' |
|
55 | 55 | ); |
56 | 56 | |
57 | 57 | /** |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | try { |
167 | 167 | include_once('./ext/modules/payment/pagantis/vendor/autoload.php'); |
168 | 168 | global $order, $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, |
169 | - $payment, $comments, $customer_default_address_id, $cartID; |
|
169 | + $payment, $comments, $customer_default_address_id, $cartID; |
|
170 | 170 | $global_vars = array(); |
171 | 171 | $global_vars['customer_id'] = serialize($customer_id); |
172 | 172 | $global_vars['sendTo'] = serialize($sendto); |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | |
69 | 69 | if (strpos($_SERVER[REQUEST_URI], "checkout_payment.php") <= 0) { |
70 | 70 | $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_ADMIN_TITLE; // Payment module title in Admin |
71 | - } else { |
|
72 | - $this->title = $this->extraConfig['PAGANTIS_TITLE'] .'<br/><br/><div class="buttonSet" style="display:none"></div><br/>'; // Payment module title in Catalog |
|
71 | + }else { |
|
72 | + $this->title = $this->extraConfig['PAGANTIS_TITLE'].'<br/><br/><div class="buttonSet" style="display:none"></div><br/>'; // Payment module title in Catalog |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | $this->enabled = ((MODULE_PAYMENT_PAGANTIS_STATUS == 'True') ? true : false); |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | "%s://%s%s%s", |
80 | 80 | isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', |
81 | 81 | $_SERVER['SERVER_NAME'], |
82 | - isset($_SERVER['SERVER_PORT']) ? ":" . $_SERVER['SERVER_PORT'] : '', |
|
82 | + isset($_SERVER['SERVER_PORT']) ? ":".$_SERVER['SERVER_PORT'] : '', |
|
83 | 83 | $_SERVER['REQUEST_URI'] |
84 | 84 | ) |
85 | 85 | ); |
86 | 86 | |
87 | - $this->form_action_url = $this->base_url . '/ext/modules/payment/pagantis/bypass.php'; |
|
87 | + $this->form_action_url = $this->base_url.'/ext/modules/payment/pagantis/bypass.php'; |
|
88 | 88 | |
89 | 89 | if (defined('MODULE_PAYMENT_PAGANTIS_LANG_CODE')) { |
90 | 90 | $this->langCode = MODULE_PAYMENT_PAGANTIS_LANG_CODE; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $userAddress = new Address(); |
195 | 195 | $userAddress |
196 | 196 | ->setZipCode($order->billing['postcode']) |
197 | - ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname']) |
|
197 | + ->setFullName($order->billing['firstname'].' '.$order->billing['lastname']) |
|
198 | 198 | ->setCountryCode('ES') |
199 | 199 | ->setCity($order->billing['city']) |
200 | 200 | ->setAddress($order->billing['street_address']) |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $orderShippingAddress = new Address(); |
207 | 207 | $orderShippingAddress |
208 | 208 | ->setZipCode($order->delivery['postcode']) |
209 | - ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname']) |
|
209 | + ->setFullName($order->billing['firstname'].' '.$order->billing['lastname']) |
|
210 | 210 | ->setCountryCode('ES') |
211 | 211 | ->setCity($order->delivery['city']) |
212 | 212 | ->setAddress($order->delivery['street_address']) |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $orderUser = new \Pagantis\OrdersApiClient\Model\Order\User(); |
217 | 217 | $orderUser |
218 | 218 | ->setAddress($userAddress) |
219 | - ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname']) |
|
219 | + ->setFullName($order->billing['firstname'].' '.$order->billing['lastname']) |
|
220 | 220 | ->setBillingAddress($orderBillingAddress) |
221 | 221 | ->setEmail($order->customer['email_address']) |
222 | 222 | ->setFixPhone($order->customer['telephone']) |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | ->setQuantity(intval($item['qty'])) |
256 | 256 | ->setDescription($item['name']); |
257 | 257 | if ($promotedProduct) { |
258 | - $promotedAmount+=$product->getAmount(); |
|
258 | + $promotedAmount += $product->getAmount(); |
|
259 | 259 | $promotedMessage = $product->getDescription()."-Price:".$item['final_price']."-Qty:".$product->getQuantity(); |
260 | 260 | $metadataOrder->addMetadata('promotedProduct', $promotedMessage); |
261 | 261 | } |
@@ -275,9 +275,9 @@ discard block |
||
275 | 275 | ); |
276 | 276 | |
277 | 277 | $cancelUrl = trim(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false)); |
278 | - if ($this->extraConfig['PAGANTIS_URL_KO']!='') { |
|
278 | + if ($this->extraConfig['PAGANTIS_URL_KO'] != '') { |
|
279 | 279 | $koUrl = $this->extraConfig['PAGANTIS_URL_KO']; |
280 | - } else { |
|
280 | + }else { |
|
281 | 281 | $koUrl = $cancelUrl; |
282 | 282 | } |
283 | 283 | |
@@ -313,16 +313,16 @@ discard block |
||
313 | 313 | if ($pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) { |
314 | 314 | $url = $pagantisOrder->getActionUrls()->getForm(); |
315 | 315 | $this->insertRow($this->os_order_reference, $pagantisOrder->getId(), serialize($global_vars)); |
316 | - } else { |
|
316 | + }else { |
|
317 | 317 | throw new OrderNotFoundException(); |
318 | 318 | } |
319 | 319 | |
320 | 320 | if ($url == "") { |
321 | 321 | throw new UnknownException(_("No ha sido posible obtener una respuesta de Pagantis")); |
322 | - } else { |
|
322 | + }else { |
|
323 | 323 | $output = "\n"; |
324 | - $output .= tep_draw_hidden_field("formUrl", $url) . "\n"; |
|
325 | - $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl) . "\n"; |
|
324 | + $output .= tep_draw_hidden_field("formUrl", $url)."\n"; |
|
325 | + $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl)."\n"; |
|
326 | 326 | return $output; |
327 | 327 | |
328 | 328 | } //TODO IFRAME |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | return 'failed'; |
390 | 390 | } |
391 | 391 | |
392 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
392 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
393 | 393 | ( |
394 | 394 | configuration_title, |
395 | 395 | configuration_key, |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | ', |
413 | 413 | now() |
414 | 414 | )"); |
415 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
415 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
416 | 416 | ( |
417 | 417 | configuration_title, |
418 | 418 | configuration_key, |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | '0', |
433 | 433 | now() |
434 | 434 | )"); |
435 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
435 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
436 | 436 | ( |
437 | 437 | configuration_title, |
438 | 438 | configuration_key, |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | '0', |
453 | 453 | now() |
454 | 454 | )"); |
455 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
455 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
456 | 456 | ( |
457 | 457 | configuration_title, |
458 | 458 | configuration_key, |
@@ -484,14 +484,14 @@ discard block |
||
484 | 484 | */ |
485 | 485 | private function installPagantisTables() |
486 | 486 | { |
487 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_LOG . " ( |
|
487 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_LOG." ( |
|
488 | 488 | id int NOT NULL AUTO_INCREMENT, |
489 | 489 | log text NOT NULL, |
490 | 490 | createdAt timestamp DEFAULT CURRENT_TIMESTAMP, |
491 | 491 | UNIQUE KEY id (id))"; |
492 | 492 | tep_db_query($sql); |
493 | 493 | |
494 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONFIG . " ( |
|
494 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONFIG." ( |
|
495 | 495 | id int NOT NULL AUTO_INCREMENT, |
496 | 496 | config varchar(60) NOT NULL, |
497 | 497 | value varchar(200) NOT NULL, |
@@ -499,10 +499,10 @@ discard block |
||
499 | 499 | tep_db_query($sql); |
500 | 500 | |
501 | 501 | // check if table has records |
502 | - $check_query = tep_db_query("select value from " . TABLE_PAGANTIS_CONFIG); |
|
502 | + $check_query = tep_db_query("select value from ".TABLE_PAGANTIS_CONFIG); |
|
503 | 503 | if (tep_db_num_rows($check_query) === 0) { |
504 | 504 | foreach ((array)$this->defaultConfigs as $configKey => $configValue) { |
505 | - $query = "INSERT INTO " . TABLE_PAGANTIS_CONFIG . " |
|
505 | + $query = "INSERT INTO ".TABLE_PAGANTIS_CONFIG." |
|
506 | 506 | ( |
507 | 507 | config, |
508 | 508 | value |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | } |
517 | 517 | } |
518 | 518 | |
519 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_ORDERS . " ( |
|
519 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_ORDERS." ( |
|
520 | 520 | id int NOT NULL AUTO_INCREMENT, |
521 | 521 | os_order_id varchar(50), |
522 | 522 | os_order_reference varchar(50) NOT NULL, |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | UNIQUE KEY id(id))"; |
526 | 526 | tep_db_query($sql); |
527 | 527 | |
528 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONCURRENCY . " ( |
|
528 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONCURRENCY." ( |
|
529 | 529 | id varchar(50) NOT NULL, |
530 | 530 | `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, |
531 | 531 | UNIQUE KEY id(id))"; |
@@ -537,29 +537,29 @@ discard block |
||
537 | 537 | */ |
538 | 538 | public function remove() |
539 | 539 | { |
540 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_LOG . "'"); |
|
540 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_LOG."'"); |
|
541 | 541 | if (tep_db_num_rows($checkTable) > 0) { |
542 | - tep_db_query("drop table " . TABLE_PAGANTIS_LOG); |
|
542 | + tep_db_query("drop table ".TABLE_PAGANTIS_LOG); |
|
543 | 543 | } |
544 | 544 | |
545 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONFIG . "'"); |
|
545 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONFIG."'"); |
|
546 | 546 | if (tep_db_num_rows($checkTable) > 0) { |
547 | - tep_db_query("drop table " . TABLE_PAGANTIS_CONFIG); |
|
547 | + tep_db_query("drop table ".TABLE_PAGANTIS_CONFIG); |
|
548 | 548 | } |
549 | 549 | |
550 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_ORDERS . "'"); |
|
550 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_ORDERS."'"); |
|
551 | 551 | if (tep_db_num_rows($checkTable) > 0) { |
552 | - tep_db_query("drop table " . TABLE_PAGANTIS_ORDERS); |
|
552 | + tep_db_query("drop table ".TABLE_PAGANTIS_ORDERS); |
|
553 | 553 | } |
554 | 554 | |
555 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONCURRENCY . "'"); |
|
555 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONCURRENCY."'"); |
|
556 | 556 | if (tep_db_num_rows($checkTable) > 0) { |
557 | - tep_db_query("drop table " . TABLE_PAGANTIS_CONCURRENCY); |
|
557 | + tep_db_query("drop table ".TABLE_PAGANTIS_CONCURRENCY); |
|
558 | 558 | } |
559 | 559 | |
560 | - tep_db_query("DELETE FROM ". TABLE_CONFIGURATION ." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')"); |
|
560 | + tep_db_query("DELETE FROM ".TABLE_CONFIGURATION." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')"); |
|
561 | 561 | |
562 | - $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key like '%_PAGANTIS_%'"; |
|
562 | + $query = "delete from ".TABLE_CONFIGURATION." where configuration_key like '%_PAGANTIS_%'"; |
|
563 | 563 | tep_db_query($query); |
564 | 564 | |
565 | 565 | $this->uninstallSimulator(); |
@@ -614,13 +614,13 @@ discard block |
||
614 | 614 | */ |
615 | 615 | private function insertRow($orderId, $pagantisOrderId, $globalVars) |
616 | 616 | { |
617 | - $query = "select * from " . TABLE_PAGANTIS_ORDERS . " where os_order_reference='$orderId'"; |
|
617 | + $query = "select * from ".TABLE_PAGANTIS_ORDERS." where os_order_reference='$orderId'"; |
|
618 | 618 | $resultsSelect = tep_db_query($query); |
619 | 619 | $countResults = tep_db_num_rows($resultsSelect); |
620 | 620 | if ($countResults == 0) { |
621 | - $query = "INSERT INTO " . TABLE_PAGANTIS_ORDERS . " |
|
621 | + $query = "INSERT INTO ".TABLE_PAGANTIS_ORDERS." |
|
622 | 622 | (os_order_reference, pagantis_order_id, globals) values ('$orderId', '$pagantisOrderId','$globalVars')"; |
623 | - } else { |
|
623 | + }else { |
|
624 | 624 | $query = "UPDATE ".TABLE_PAGANTIS_ORDERS." set pagantis_order_id='$pagantisOrderId' |
625 | 625 | where os_order_reference='$orderId'"; |
626 | 626 | } |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | |
659 | 659 | if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') { |
660 | 660 | $promotedProducts = array(); |
661 | - } else { |
|
661 | + }else { |
|
662 | 662 | $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION'])); |
663 | 663 | } |
664 | 664 | |
@@ -671,13 +671,13 @@ discard block |
||
671 | 671 | private function getDescription() |
672 | 672 | { |
673 | 673 | $descriptionCode = "<img src=\"images/icon_info.gif\" border=\"0\" alt=\"Info\" title=\"Info\"> <strong>Module version:</strong> $this->version<br/><br/>"; |
674 | - $descriptionCode.= "<img src=\"images/icon_info.gif\" border=\"0\"> <a href='https://developer.pagantis.com/' target=\"_blank\" style=\"text-decoration: underline; font-weight: bold;\">View Online Documentation</a><br/><br/>"; |
|
675 | - $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/>"; |
|
674 | + $descriptionCode .= "<img src=\"images/icon_info.gif\" border=\"0\"> <a href='https://developer.pagantis.com/' target=\"_blank\" style=\"text-decoration: underline; font-weight: bold;\">View Online Documentation</a><br/><br/>"; |
|
675 | + $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/>"; |
|
676 | 676 | |
677 | 677 | if (MODULE_PAYMENT_PAGANTIS_STATUS == 'True') { |
678 | 678 | $pagantisPromotionUrl = $this->base_url.'/admin/promotion.php'; |
679 | 679 | $linkDescription = "Si deseas ofrecer financiación sin intereses para alguno de tus productos "; |
680 | - $descriptionCode.= "<img src='images/icon_info.gif' border='0'/> $linkDescription<a href='$pagantisPromotionUrl' style='text-decoration: underline; font-weight: bold;'>haz click aquí</a>"; |
|
680 | + $descriptionCode .= "<img src='images/icon_info.gif' border='0'/> $linkDescription<a href='$pagantisPromotionUrl' style='text-decoration: underline; font-weight: bold;'>haz click aquí</a>"; |
|
681 | 681 | } |
682 | 682 | |
683 | 683 | return $descriptionCode; |
@@ -688,18 +688,18 @@ discard block |
||
688 | 688 | */ |
689 | 689 | private function installSimulator() |
690 | 690 | { |
691 | - $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." |
|
691 | + $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." |
|
692 | 692 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED' |
693 | 693 | and configuration_value like '%ht_pagantis.php%';"); |
694 | 694 | if (tep_db_num_rows($checkSimulator) > 0) { |
695 | 695 | return true; |
696 | 696 | } |
697 | 697 | |
698 | - $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = concat(configuration_value, ';ht_pagantis.php') |
|
698 | + $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = concat(configuration_value, ';ht_pagantis.php') |
|
699 | 699 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'"; |
700 | 700 | tep_db_query($query); |
701 | 701 | |
702 | - 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())"); |
|
702 | + 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())"); |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | /** |
@@ -707,18 +707,18 @@ discard block |
||
707 | 707 | */ |
708 | 708 | private function uninstallSimulator() |
709 | 709 | { |
710 | - $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." |
|
710 | + $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." |
|
711 | 711 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED' |
712 | 712 | and configuration_value like '%ht_pagantis.php%';"); |
713 | 713 | if (tep_db_num_rows($checkSimulator) == 0) { |
714 | 714 | return true; |
715 | 715 | } |
716 | 716 | |
717 | - $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '') |
|
717 | + $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '') |
|
718 | 718 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'"; |
719 | 719 | tep_db_query($query); |
720 | 720 | |
721 | - $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'"; |
|
721 | + $query = "delete from ".TABLE_CONFIGURATION." where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'"; |
|
722 | 722 | tep_db_query($query); |
723 | 723 | } |
724 | 724 | |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | private function insertLog($exception) |
729 | 729 | { |
730 | 730 | if ($exception instanceof \Exception) { |
731 | - $logEntry= new LogEntry(); |
|
731 | + $logEntry = new LogEntry(); |
|
732 | 732 | $logEntryJson = $logEntry->error($exception)->toJson(); |
733 | 733 | |
734 | 734 | $query = "insert into ".TABLE_PAGANTIS_LOG."(log) values ($logEntryJson)"; |
@@ -120,7 +120,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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, |