@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | sleep(3); |
97 | 97 | $productLinkElement->click(); |
98 | 98 | $this->assertSame( |
99 | - self::PRODUCT_NAME . ', ' . self::TITLE, |
|
99 | + self::PRODUCT_NAME.', '.self::TITLE, |
|
100 | 100 | $this->webDriver->getTitle() |
101 | 101 | ); |
102 | 102 | } |
@@ -181,9 +181,9 @@ discard block |
||
181 | 181 | $paymentFormElement = WebDriverBy::className('FieldsPreview-desc'); |
182 | 182 | $condition = WebDriverExpectedCondition::visibilityOfElementLocated($paymentFormElement); |
183 | 183 | $this->webDriver->wait()->until($condition); |
184 | - $this->assertTrue((bool) $condition); |
|
184 | + $this->assertTrue((bool)$condition); |
|
185 | 185 | $this->assertSame( |
186 | - $this->configuration['firstname'] . ' ' . $this->configuration['lastname'], |
|
186 | + $this->configuration['firstname'].' '.$this->configuration['lastname'], |
|
187 | 187 | $this->findByClass('FieldsPreview-desc')->getText() |
188 | 188 | ); |
189 | 189 | } |
@@ -83,22 +83,22 @@ discard block |
||
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 |
||
133 | 133 | |
134 | 134 | if ($this->origin == 'notify') { |
135 | 135 | $jsonResponse->printResponse(); |
136 | - } else { |
|
136 | + }else { |
|
137 | 137 | return $jsonResponse; |
138 | 138 | } |
139 | 139 | } |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | try { |
206 | 206 | $this->checkPagantisStatus(array('AUTHORIZED')); |
207 | 207 | } catch (\Exception $e) { |
208 | - if ($this->findOscommerceOrderId()!='') { |
|
208 | + if ($this->findOscommerceOrderId() != '') { |
|
209 | 209 | throw new AlreadyProcessedException(); |
210 | - } else { |
|
210 | + }else { |
|
211 | 211 | if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) { |
212 | 212 | $status = $this->pagantisOrder->getStatus(); |
213 | - } else { |
|
213 | + }else { |
|
214 | 214 | $status = '-'; |
215 | 215 | } |
216 | 216 | throw new WrongStatusException($status); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | { |
226 | 226 | global $order; |
227 | 227 | |
228 | - if ($order->info['order_status']!=='1') { |
|
228 | + if ($order->info['order_status'] !== '1') { |
|
229 | 229 | throw new AlreadyProcessedException(); |
230 | 230 | } |
231 | 231 | } |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | if ($orderId == null) { |
303 | 303 | $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where timestamp<".(time() - 5); |
304 | 304 | tep_db_query($query); |
305 | - } elseif ($orderId!='') { |
|
305 | + } elseif ($orderId != '') { |
|
306 | 306 | $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where id='$orderId'"; |
307 | 307 | tep_db_query($query); |
308 | 308 | } |
@@ -354,12 +354,12 @@ discard block |
||
354 | 354 | if (!$payed) { |
355 | 355 | if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) { |
356 | 356 | $status = $this->pagantisOrder->getStatus(); |
357 | - } else { |
|
357 | + }else { |
|
358 | 358 | $status = '-'; |
359 | 359 | } |
360 | 360 | throw new WrongStatusException($status); |
361 | 361 | } |
362 | - } else { |
|
362 | + }else { |
|
363 | 363 | throw new OrderNotFoundException(); |
364 | 364 | } |
365 | 365 | } |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | tep_db_query($query); |
393 | 393 | |
394 | 394 | $comment = "Pagantis id=$this->pagantisOrderId/Via=".ucfirst($this->origin); |
395 | - $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY ."(comments, orders_id, orders_status_id, customer_notified, date_added) values |
|
395 | + $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY."(comments, orders_id, orders_status_id, customer_notified, date_added) values |
|
396 | 396 | ('$comment', ".$insert_id.", '2', -1, now() )"; |
397 | 397 | tep_db_query($query); |
398 | 398 | |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | private function insertLog($exception) |
418 | 418 | { |
419 | 419 | if ($exception instanceof \Exception) { |
420 | - $logEntry= new LogEntry(); |
|
420 | + $logEntry = new LogEntry(); |
|
421 | 421 | $logEntryJson = $logEntry->error($exception)->toJson(); |
422 | 422 | |
423 | 423 | $query = "insert into ".TABLE_PAGANTIS_LOG."(log) values ('$logEntryJson')"; |
@@ -32,23 +32,23 @@ discard block |
||
32 | 32 | public $pgNotify; |
33 | 33 | |
34 | 34 | public $defaultConfigs = array('PAGANTIS_TITLE'=>'Instant Financing', |
35 | - 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
36 | - 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
37 | - 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
38 | - 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
39 | - 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
40 | - 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
41 | - 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
42 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
43 | - 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
44 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR_CHECKOUT'=>'default', |
|
45 | - 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
46 | - 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
47 | - 'PAGANTIS_URL_OK'=>'', |
|
48 | - 'PAGANTIS_URL_KO'=>'', |
|
49 | - 'PAGANTIS_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente online y sin papeleos,¡y la respuesta es inmediata!', |
|
50 | - 'PAGANTIS_PROMOTION' => '', |
|
51 | - 'PAGANTIS_PROMOTED_PRODUCT_CODE' => '<p>PRODUCTO PROMOCIONADO CON PAGANTIS<img style="height: 40px; vertical-align: middle;" src="/ext/modules/payment/pagantis/img/logo_pagantis.png"/>AL 0%' |
|
35 | + 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
36 | + 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
37 | + 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
38 | + 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
39 | + 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
40 | + 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
41 | + 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
42 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
43 | + 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
44 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR_CHECKOUT'=>'default', |
|
45 | + 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
46 | + 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
47 | + 'PAGANTIS_URL_OK'=>'', |
|
48 | + 'PAGANTIS_URL_KO'=>'', |
|
49 | + 'PAGANTIS_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente online y sin papeleos,¡y la respuesta es inmediata!', |
|
50 | + 'PAGANTIS_PROMOTION' => '', |
|
51 | + 'PAGANTIS_PROMOTED_PRODUCT_CODE' => '<p>PRODUCTO PROMOCIONADO CON PAGANTIS<img style="height: 40px; vertical-align: middle;" src="/ext/modules/payment/pagantis/img/logo_pagantis.png"/>AL 0%' |
|
52 | 52 | ); |
53 | 53 | |
54 | 54 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | try { |
160 | 160 | include_once('./ext/modules/payment/pagantis/vendor/autoload.php'); |
161 | 161 | global $order, $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, |
162 | - $payment, $comments, $customer_default_address_id, $cartID; |
|
162 | + $payment, $comments, $customer_default_address_id, $cartID; |
|
163 | 163 | $global_vars = array(); |
164 | 164 | $global_vars['customer_id'] = serialize($customer_id); |
165 | 165 | $global_vars['sendTo'] = serialize($sendto); |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | |
65 | 65 | if (strpos($_SERVER[REQUEST_URI], "checkout_payment.php") <= 0) { |
66 | 66 | $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_ADMIN_TITLE; // Payment module title in Admin |
67 | - } else { |
|
68 | - $this->title = $this->extraConfig['PAGANTIS_TITLE'] .'<br/><br/><div class="buttonSet" style="display:none"></div><br/>'; // Payment module title in Catalog |
|
67 | + }else { |
|
68 | + $this->title = $this->extraConfig['PAGANTIS_TITLE'].'<br/><br/><div class="buttonSet" style="display:none"></div><br/>'; // Payment module title in Catalog |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $this->enabled = ((MODULE_PAYMENT_PAGANTIS_STATUS == 'True') ? true : false); |
@@ -75,12 +75,12 @@ discard block |
||
75 | 75 | "%s://%s%s%s", |
76 | 76 | isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', |
77 | 77 | $_SERVER['SERVER_NAME'], |
78 | - isset($_SERVER['SERVER_PORT']) ? ":" . $_SERVER['SERVER_PORT'] : '', |
|
78 | + isset($_SERVER['SERVER_PORT']) ? ":".$_SERVER['SERVER_PORT'] : '', |
|
79 | 79 | $_SERVER['REQUEST_URI'] |
80 | 80 | ) |
81 | 81 | ); |
82 | 82 | |
83 | - $this->form_action_url = $this->base_url . '/ext/modules/payment/pagantis/bypass.php'; |
|
83 | + $this->form_action_url = $this->base_url.'/ext/modules/payment/pagantis/bypass.php'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /*************** |
@@ -179,14 +179,14 @@ discard block |
||
179 | 179 | throw new UnknownException("Order not found"); |
180 | 180 | } |
181 | 181 | |
182 | - $id_hash = time() . serialize($order->products) . '' . serialize($order->customer) . '' . serialize($order->delivery); |
|
182 | + $id_hash = time().serialize($order->products).''.serialize($order->customer).''.serialize($order->delivery); |
|
183 | 183 | $this->os_order_reference = md5($id_hash); |
184 | 184 | $_SESSION['order_id'] = $this->os_order_reference; |
185 | 185 | |
186 | 186 | $userAddress = new Address(); |
187 | 187 | $userAddress |
188 | 188 | ->setZipCode($order->billing['postcode']) |
189 | - ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname']) |
|
189 | + ->setFullName($order->billing['firstname'].' '.$order->billing['lastname']) |
|
190 | 190 | ->setCountryCode('ES') |
191 | 191 | ->setCity($order->billing['city']) |
192 | 192 | ->setAddress($order->billing['street_address']) |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $orderShippingAddress = new Address(); |
199 | 199 | $orderShippingAddress |
200 | 200 | ->setZipCode($order->delivery['postcode']) |
201 | - ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname']) |
|
201 | + ->setFullName($order->billing['firstname'].' '.$order->billing['lastname']) |
|
202 | 202 | ->setCountryCode('ES') |
203 | 203 | ->setCity($order->delivery['city']) |
204 | 204 | ->setAddress($order->delivery['street_address']) |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $orderUser = new \Pagantis\OrdersApiClient\Model\Order\User(); |
209 | 209 | $orderUser |
210 | 210 | ->setAddress($userAddress) |
211 | - ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname']) |
|
211 | + ->setFullName($order->billing['firstname'].' '.$order->billing['lastname']) |
|
212 | 212 | ->setBillingAddress($orderBillingAddress) |
213 | 213 | ->setEmail($order->customer['email_address']) |
214 | 214 | ->setFixPhone($order->customer['telephone']) |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | ->setQuantity(intval($item['qty'])) |
238 | 238 | ->setDescription($item['name']); |
239 | 239 | if ($promotedProduct) { |
240 | - $promotedAmount+=$product->getAmount(); |
|
240 | + $promotedAmount += $product->getAmount(); |
|
241 | 241 | } |
242 | 242 | $details->addProduct($product); |
243 | 243 | } |
@@ -256,9 +256,9 @@ discard block |
||
256 | 256 | ); |
257 | 257 | |
258 | 258 | $cancelUrl = trim(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false)); |
259 | - if ($this->extraConfig['PAGANTIS_URL_KO']!='') { |
|
259 | + if ($this->extraConfig['PAGANTIS_URL_KO'] != '') { |
|
260 | 260 | $koUrl = $this->extraConfig['PAGANTIS_URL_KO']; |
261 | - } else { |
|
261 | + }else { |
|
262 | 262 | $koUrl = $cancelUrl; |
263 | 263 | } |
264 | 264 | |
@@ -303,16 +303,16 @@ discard block |
||
303 | 303 | if ($pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) { |
304 | 304 | $url = $pagantisOrder->getActionUrls()->getForm(); |
305 | 305 | $this->insertRow($this->os_order_reference, $pagantisOrder->getId(), serialize($global_vars)); |
306 | - } else { |
|
306 | + }else { |
|
307 | 307 | throw new OrderNotFoundException(); |
308 | 308 | } |
309 | 309 | |
310 | 310 | if ($url == "") { |
311 | 311 | throw new UnknownException(_("No ha sido posible obtener una respuesta de Pagantis")); |
312 | - } else { |
|
312 | + }else { |
|
313 | 313 | $output = "\n"; |
314 | - $output .= tep_draw_hidden_field("formUrl", $url) . "\n"; |
|
315 | - $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl) . "\n"; |
|
314 | + $output .= tep_draw_hidden_field("formUrl", $url)."\n"; |
|
315 | + $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl)."\n"; |
|
316 | 316 | return $output; |
317 | 317 | |
318 | 318 | } //TODO IFRAME |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | return 'failed'; |
379 | 379 | } |
380 | 380 | |
381 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
381 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
382 | 382 | ( |
383 | 383 | configuration_title, |
384 | 384 | configuration_key, |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | ', |
402 | 402 | now() |
403 | 403 | )"); |
404 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
404 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
405 | 405 | ( |
406 | 406 | configuration_title, |
407 | 407 | configuration_key, |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | '0', |
422 | 422 | now() |
423 | 423 | )"); |
424 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
424 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
425 | 425 | ( |
426 | 426 | configuration_title, |
427 | 427 | configuration_key, |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | '0', |
442 | 442 | now() |
443 | 443 | )"); |
444 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
444 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
445 | 445 | ( |
446 | 446 | configuration_title, |
447 | 447 | configuration_key, |
@@ -473,14 +473,14 @@ discard block |
||
473 | 473 | */ |
474 | 474 | private function installPagantisTables() |
475 | 475 | { |
476 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_LOG . " ( |
|
476 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_LOG." ( |
|
477 | 477 | id int NOT NULL AUTO_INCREMENT, |
478 | 478 | log text NOT NULL, |
479 | 479 | createdAt timestamp DEFAULT CURRENT_TIMESTAMP, |
480 | 480 | UNIQUE KEY id (id))"; |
481 | 481 | tep_db_query($sql); |
482 | 482 | |
483 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONFIG . " ( |
|
483 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONFIG." ( |
|
484 | 484 | id int NOT NULL AUTO_INCREMENT, |
485 | 485 | config varchar(60) NOT NULL, |
486 | 486 | value varchar(200) NOT NULL, |
@@ -488,10 +488,10 @@ discard block |
||
488 | 488 | tep_db_query($sql); |
489 | 489 | |
490 | 490 | // check if table has records |
491 | - $check_query = tep_db_query("select value from " . TABLE_PAGANTIS_CONFIG); |
|
491 | + $check_query = tep_db_query("select value from ".TABLE_PAGANTIS_CONFIG); |
|
492 | 492 | if (tep_db_num_rows($check_query) === 0) { |
493 | 493 | foreach ((array)$this->defaultConfigs as $configKey => $configValue) { |
494 | - $query = "INSERT INTO " . TABLE_PAGANTIS_CONFIG . " |
|
494 | + $query = "INSERT INTO ".TABLE_PAGANTIS_CONFIG." |
|
495 | 495 | ( |
496 | 496 | config, |
497 | 497 | value |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | } |
506 | 506 | } |
507 | 507 | |
508 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_ORDERS . " ( |
|
508 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_ORDERS." ( |
|
509 | 509 | id int NOT NULL AUTO_INCREMENT, |
510 | 510 | os_order_id varchar(50), |
511 | 511 | os_order_reference varchar(50) NOT NULL, |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | UNIQUE KEY id(id))"; |
515 | 515 | tep_db_query($sql); |
516 | 516 | |
517 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONCURRENCY . " ( |
|
517 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONCURRENCY." ( |
|
518 | 518 | id varchar(50) NOT NULL, |
519 | 519 | `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, |
520 | 520 | UNIQUE KEY id(id))"; |
@@ -526,29 +526,29 @@ discard block |
||
526 | 526 | */ |
527 | 527 | public function remove() |
528 | 528 | { |
529 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_LOG . "'"); |
|
529 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_LOG."'"); |
|
530 | 530 | if (tep_db_num_rows($checkTable) > 0) { |
531 | - tep_db_query("drop table " . TABLE_PAGANTIS_LOG); |
|
531 | + tep_db_query("drop table ".TABLE_PAGANTIS_LOG); |
|
532 | 532 | } |
533 | 533 | |
534 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONFIG . "'"); |
|
534 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONFIG."'"); |
|
535 | 535 | if (tep_db_num_rows($checkTable) > 0) { |
536 | - tep_db_query("drop table " . TABLE_PAGANTIS_CONFIG); |
|
536 | + tep_db_query("drop table ".TABLE_PAGANTIS_CONFIG); |
|
537 | 537 | } |
538 | 538 | |
539 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_ORDERS . "'"); |
|
539 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_ORDERS."'"); |
|
540 | 540 | if (tep_db_num_rows($checkTable) > 0) { |
541 | - tep_db_query("drop table " . TABLE_PAGANTIS_ORDERS); |
|
541 | + tep_db_query("drop table ".TABLE_PAGANTIS_ORDERS); |
|
542 | 542 | } |
543 | 543 | |
544 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONCURRENCY . "'"); |
|
544 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONCURRENCY."'"); |
|
545 | 545 | if (tep_db_num_rows($checkTable) > 0) { |
546 | - tep_db_query("drop table " . TABLE_PAGANTIS_CONCURRENCY); |
|
546 | + tep_db_query("drop table ".TABLE_PAGANTIS_CONCURRENCY); |
|
547 | 547 | } |
548 | 548 | |
549 | - tep_db_query("DELETE FROM ". TABLE_CONFIGURATION ." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')"); |
|
549 | + tep_db_query("DELETE FROM ".TABLE_CONFIGURATION." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')"); |
|
550 | 550 | |
551 | - $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key like '%_PAGANTIS_%'"; |
|
551 | + $query = "delete from ".TABLE_CONFIGURATION." where configuration_key like '%_PAGANTIS_%'"; |
|
552 | 552 | tep_db_query($query); |
553 | 553 | |
554 | 554 | $this->uninstallSimulator(); |
@@ -603,13 +603,13 @@ discard block |
||
603 | 603 | */ |
604 | 604 | private function insertRow($orderId, $pagantisOrderId, $globalVars) |
605 | 605 | { |
606 | - $query = "select * from " . TABLE_PAGANTIS_ORDERS . " where os_order_reference='$orderId'"; |
|
606 | + $query = "select * from ".TABLE_PAGANTIS_ORDERS." where os_order_reference='$orderId'"; |
|
607 | 607 | $resultsSelect = tep_db_query($query); |
608 | 608 | $countResults = tep_db_num_rows($resultsSelect); |
609 | 609 | if ($countResults == 0) { |
610 | - $query = "INSERT INTO " . TABLE_PAGANTIS_ORDERS . " |
|
610 | + $query = "INSERT INTO ".TABLE_PAGANTIS_ORDERS." |
|
611 | 611 | (os_order_reference, pagantis_order_id, globals) values ('$orderId', '$pagantisOrderId','$globalVars')"; |
612 | - } else { |
|
612 | + }else { |
|
613 | 613 | $query = "UPDATE ".TABLE_PAGANTIS_ORDERS." set pagantis_order_id='$pagantisOrderId' |
614 | 614 | where os_order_reference='$orderId'"; |
615 | 615 | } |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | |
651 | 651 | if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') { |
652 | 652 | $promotedProducts = array(); |
653 | - } else { |
|
653 | + }else { |
|
654 | 654 | $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION'])); |
655 | 655 | } |
656 | 656 | |
@@ -663,12 +663,12 @@ discard block |
||
663 | 663 | private function getDescription() |
664 | 664 | { |
665 | 665 | $descriptionCode = "<img src=\"images/icon_info.gif\" border=\"0\" alt=\"Info\" title=\"Info\"> <strong>Module version:</strong> $this->version<br/><br/>"; |
666 | - $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/>"; |
|
667 | - $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/>"; |
|
666 | + $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/>"; |
|
667 | + $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/>"; |
|
668 | 668 | if (MODULE_PAYMENT_PAGANTIS_STATUS == 'True') { |
669 | 669 | $pagantisPromotionUrl = $this->base_url.'/admin/promotion.php'; |
670 | 670 | $linkDescription = "Si desea gestionar los productos promocionados pulse aquí"; |
671 | - $descriptionCode.= "<a href='$pagantisPromotionUrl'>$linkDescription</a>"; |
|
671 | + $descriptionCode .= "<a href='$pagantisPromotionUrl'>$linkDescription</a>"; |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | return $descriptionCode; |
@@ -679,34 +679,34 @@ discard block |
||
679 | 679 | */ |
680 | 680 | private function installSimulator() |
681 | 681 | { |
682 | - $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." |
|
682 | + $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." |
|
683 | 683 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED' |
684 | 684 | and configuration_value like '%ht_pagantis.php%';"); |
685 | 685 | if (tep_db_num_rows($checkSimulator) > 0) { |
686 | 686 | return true; |
687 | 687 | } |
688 | 688 | |
689 | - $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = concat(configuration_value, ';ht_pagantis.php') |
|
689 | + $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = concat(configuration_value, ';ht_pagantis.php') |
|
690 | 690 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'"; |
691 | 691 | tep_db_query($query); |
692 | 692 | |
693 | - 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())"); |
|
693 | + 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())"); |
|
694 | 694 | } |
695 | 695 | |
696 | 696 | private function uninstallSimulator() |
697 | 697 | { |
698 | - $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." |
|
698 | + $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." |
|
699 | 699 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED' |
700 | 700 | and configuration_value like '%ht_pagantis.php%';"); |
701 | 701 | if (tep_db_num_rows($checkSimulator) == 0) { |
702 | 702 | return true; |
703 | 703 | } |
704 | 704 | |
705 | - $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '') |
|
705 | + $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '') |
|
706 | 706 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'"; |
707 | 707 | tep_db_query($query); |
708 | 708 | |
709 | - $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'"; |
|
709 | + $query = "delete from ".TABLE_CONFIGURATION." where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'"; |
|
710 | 710 | tep_db_query($query); |
711 | 711 | } |
712 | 712 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | private function getConfig($config = '') |
69 | 69 | { |
70 | - $query = "select * from ".TABLE_CONFIGURATION . " where configuration_key ='" . $config . "'"; |
|
70 | + $query = "select * from ".TABLE_CONFIGURATION." where configuration_key ='".$config."'"; |
|
71 | 71 | $result = tep_db_query($query); |
72 | 72 | $resultArray = tep_db_fetch_array($result); |
73 | 73 | return $resultArray['configuration_value']; |
@@ -85,27 +85,27 @@ discard block |
||
85 | 85 | //Show promoted html |
86 | 86 | if (isset($productId) && $this->isPromoted($productId)) { |
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) { |
@@ -116,79 +116,79 @@ discard block |
||
116 | 116 | $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'] = 'pmtSDK.simulator.skins.BLUE'; |
117 | 117 | $simulatorCode = 'pmtSDK'; |
118 | 118 | } |
119 | - echo "<script src='".$this->sdkFile."'></script>". PHP_EOL; |
|
120 | - echo '<script>'. PHP_EOL; |
|
121 | - echo ' function loadSimulator()'. PHP_EOL; |
|
122 | - echo ' {'. PHP_EOL; |
|
123 | - echo ' if (typeof '.$simulatorCode.' != \'undefined\') {'. PHP_EOL; |
|
124 | - echo ' var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL; |
|
125 | - echo ' var priceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL; |
|
126 | - echo ' var checkoutPriceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL; |
|
127 | - echo ' var quantitySelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR']. '\';'. PHP_EOL; |
|
128 | - echo ' var checkoutPage = \'' . $checkoutPage.'\';'. PHP_EOL; |
|
129 | - |
|
130 | - echo ' if (positionSelector === \'default\') {'. PHP_EOL; |
|
131 | - echo ' positionSelector = \'.buttonSet\''. PHP_EOL; |
|
132 | - echo ' }'. PHP_EOL; |
|
133 | - |
|
134 | - echo ' if (priceSelector === \'default\') {'. PHP_EOL; |
|
135 | - echo ' priceSelector = \'#bodyContent>form>div>h1\''. PHP_EOL; |
|
136 | - echo ' }'. PHP_EOL; |
|
137 | - |
|
138 | - echo ' if (checkoutPriceSelector == \'default\' && checkoutPage == \'1\') {'. PHP_EOL; |
|
139 | - echo ' priceSelector = \'#columnRight > .infoBoxContainer > .infoBoxContents > tbody > tr:last-child > td\';'. PHP_EOL; |
|
140 | - echo ' }'. PHP_EOL; |
|
141 | - echo ' '.$simulatorCode.'.product_simulator = {};'. PHP_EOL; |
|
142 | - echo ' '.$simulatorCode.'.product_simulator.id = \'product-simulator\';'. PHP_EOL; |
|
143 | - echo ' '.$simulatorCode.'.product_simulator.publicKey = \'' . $this->pk . '\';'. PHP_EOL; |
|
144 | - echo ' '.$simulatorCode.'.product_simulator.selector = positionSelector;'. PHP_EOL; |
|
145 | - echo ' '.$simulatorCode.'.product_simulator.numInstalments = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'] . '\';'. PHP_EOL; |
|
146 | - echo ' '.$simulatorCode.'.product_simulator.type = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'] . ';'. PHP_EOL; |
|
147 | - echo ' '.$simulatorCode.'.product_simulator.skin = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'] . ';'. PHP_EOL; |
|
148 | - echo ' '.$simulatorCode.'.product_simulator.position = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'] . ';'. PHP_EOL; |
|
149 | - echo ' '.$simulatorCode.'.product_simulator.itemAmountSelector = priceSelector;'. PHP_EOL; |
|
150 | - echo ' var promotedProduct = \'' . $this->isPromoted($productId) .'\';'. PHP_EOL; |
|
151 | - echo ' if(promotedProduct == true) { ' . PHP_EOL; |
|
152 | - echo ' '.$simulatorCode.'.product_simulator.itemPromotedAmountSelector = priceSelector;'. PHP_EOL; |
|
153 | - echo ' }' . PHP_EOL; |
|
154 | - echo ' '.$simulatorCode.'.simulator.init('.$simulatorCode.'.product_simulator);'. PHP_EOL; |
|
155 | - echo ' clearInterval(window.OSSimulatorId);'. PHP_EOL; |
|
156 | - echo ' return true;'. PHP_EOL; |
|
157 | - echo ' }'. PHP_EOL; |
|
158 | - echo ' return false;'. PHP_EOL; |
|
159 | - echo ' }'. PHP_EOL; |
|
160 | - echo ' window.OSSimulatorId = setInterval(function () {'. PHP_EOL; |
|
161 | - echo ' loadSimulator();'. PHP_EOL; |
|
162 | - echo ' }, 2000);'. PHP_EOL; |
|
163 | - echo '</script>'. PHP_EOL; |
|
119 | + echo "<script src='".$this->sdkFile."'></script>".PHP_EOL; |
|
120 | + echo '<script>'.PHP_EOL; |
|
121 | + echo ' function loadSimulator()'.PHP_EOL; |
|
122 | + echo ' {'.PHP_EOL; |
|
123 | + echo ' if (typeof '.$simulatorCode.' != \'undefined\') {'.PHP_EOL; |
|
124 | + echo ' var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL; |
|
125 | + echo ' var priceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL; |
|
126 | + echo ' var checkoutPriceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL; |
|
127 | + echo ' var quantitySelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'].'\';'.PHP_EOL; |
|
128 | + echo ' var checkoutPage = \''.$checkoutPage.'\';'.PHP_EOL; |
|
129 | + |
|
130 | + echo ' if (positionSelector === \'default\') {'.PHP_EOL; |
|
131 | + echo ' positionSelector = \'.buttonSet\''.PHP_EOL; |
|
132 | + echo ' }'.PHP_EOL; |
|
133 | + |
|
134 | + echo ' if (priceSelector === \'default\') {'.PHP_EOL; |
|
135 | + echo ' priceSelector = \'#bodyContent>form>div>h1\''.PHP_EOL; |
|
136 | + echo ' }'.PHP_EOL; |
|
137 | + |
|
138 | + echo ' if (checkoutPriceSelector == \'default\' && checkoutPage == \'1\') {'.PHP_EOL; |
|
139 | + echo ' priceSelector = \'#columnRight > .infoBoxContainer > .infoBoxContents > tbody > tr:last-child > td\';'.PHP_EOL; |
|
140 | + echo ' }'.PHP_EOL; |
|
141 | + echo ' '.$simulatorCode.'.product_simulator = {};'.PHP_EOL; |
|
142 | + echo ' '.$simulatorCode.'.product_simulator.id = \'product-simulator\';'.PHP_EOL; |
|
143 | + echo ' '.$simulatorCode.'.product_simulator.publicKey = \''.$this->pk.'\';'.PHP_EOL; |
|
144 | + echo ' '.$simulatorCode.'.product_simulator.selector = positionSelector;'.PHP_EOL; |
|
145 | + echo ' '.$simulatorCode.'.product_simulator.numInstalments = \''.$this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'].'\';'.PHP_EOL; |
|
146 | + echo ' '.$simulatorCode.'.product_simulator.type = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'].';'.PHP_EOL; |
|
147 | + echo ' '.$simulatorCode.'.product_simulator.skin = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'].';'.PHP_EOL; |
|
148 | + echo ' '.$simulatorCode.'.product_simulator.position = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'].';'.PHP_EOL; |
|
149 | + echo ' '.$simulatorCode.'.product_simulator.itemAmountSelector = priceSelector;'.PHP_EOL; |
|
150 | + echo ' var promotedProduct = \''.$this->isPromoted($productId).'\';'.PHP_EOL; |
|
151 | + echo ' if(promotedProduct == true) { '.PHP_EOL; |
|
152 | + echo ' '.$simulatorCode.'.product_simulator.itemPromotedAmountSelector = priceSelector;'.PHP_EOL; |
|
153 | + echo ' }'.PHP_EOL; |
|
154 | + echo ' '.$simulatorCode.'.simulator.init('.$simulatorCode.'.product_simulator);'.PHP_EOL; |
|
155 | + echo ' clearInterval(window.OSSimulatorId);'.PHP_EOL; |
|
156 | + echo ' return true;'.PHP_EOL; |
|
157 | + echo ' }'.PHP_EOL; |
|
158 | + echo ' return false;'.PHP_EOL; |
|
159 | + echo ' }'.PHP_EOL; |
|
160 | + echo ' window.OSSimulatorId = setInterval(function () {'.PHP_EOL; |
|
161 | + echo ' loadSimulator();'.PHP_EOL; |
|
162 | + echo ' }, 2000);'.PHP_EOL; |
|
163 | + echo '</script>'.PHP_EOL; |
|
164 | 164 | |
165 | 165 | if ($checkoutPage) { |
166 | - echo '<script>' . PHP_EOL; |
|
167 | - echo 'function checkSelected(value)'. PHP_EOL; |
|
168 | - echo '{'. PHP_EOL; |
|
169 | - echo 'var simulator = document.getElementsByClassName("buttonSet");' . PHP_EOL; |
|
170 | - echo ' if(simulator == "undefined") { return false; } '. PHP_EOL; |
|
171 | - echo 'if(value==\'pagantis\') { var status="" } else { var status="none";} simulator[0].style.display=status; ' . PHP_EOL; |
|
172 | - echo '}'. PHP_EOL; |
|
173 | - |
|
174 | - echo 'function showSimulator()'. PHP_EOL; |
|
175 | - echo '{'. PHP_EOL; |
|
176 | - echo 'var elements = document.querySelectorAll("input[name=\'payment\']");' . PHP_EOL; |
|
177 | - echo 'if(elements == null) { return false };' . PHP_EOL; |
|
166 | + echo '<script>'.PHP_EOL; |
|
167 | + echo 'function checkSelected(value)'.PHP_EOL; |
|
168 | + echo '{'.PHP_EOL; |
|
169 | + echo 'var simulator = document.getElementsByClassName("buttonSet");'.PHP_EOL; |
|
170 | + echo ' if(simulator == "undefined") { return false; } '.PHP_EOL; |
|
171 | + echo 'if(value==\'pagantis\') { var status="" } else { var status="none";} simulator[0].style.display=status; '.PHP_EOL; |
|
172 | + echo '}'.PHP_EOL; |
|
173 | + |
|
174 | + echo 'function showSimulator()'.PHP_EOL; |
|
175 | + echo '{'.PHP_EOL; |
|
176 | + echo 'var elements = document.querySelectorAll("input[name=\'payment\']");'.PHP_EOL; |
|
177 | + echo 'if(elements == null) { return false };'.PHP_EOL; |
|
178 | 178 | |
179 | 179 | echo 'for(var i = 0, max = elements.length; i < max; i++) { elements[i].onclick = function() { |
180 | 180 | checkSelected(this.value); |
181 | 181 | } }' . PHP_EOL; |
182 | 182 | echo 'clearInterval(window.OSdisplayId);'; |
183 | - echo 'return true;'. PHP_EOL; |
|
184 | - echo '};'. PHP_EOL; |
|
183 | + echo 'return true;'.PHP_EOL; |
|
184 | + echo '};'.PHP_EOL; |
|
185 | 185 | |
186 | - echo ' window.OSdisplayId = setInterval(function () {'. PHP_EOL; |
|
187 | - echo ' showSimulator();'. PHP_EOL; |
|
188 | - echo ' }, 2000);'. PHP_EOL; |
|
186 | + echo ' window.OSdisplayId = setInterval(function () {'.PHP_EOL; |
|
187 | + echo ' showSimulator();'.PHP_EOL; |
|
188 | + echo ' }, 2000);'.PHP_EOL; |
|
189 | 189 | |
190 | 190 | |
191 | - echo '</script>'. PHP_EOL; |
|
191 | + echo '</script>'.PHP_EOL; |
|
192 | 192 | } |
193 | 193 | } |
194 | 194 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * install |
212 | 212 | */ |
213 | 213 | function install() { |
214 | - 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())"); |
|
214 | + 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())"); |
|
215 | 215 | |
216 | 216 | } |
217 | 217 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * remove |
220 | 220 | */ |
221 | 221 | function remove() { |
222 | - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); |
|
222 | + tep_db_query("delete from ".TABLE_CONFIGURATION." where configuration_key in ('".implode("', '", $this->keys())."')"); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') { |
247 | 247 | $promotedProducts = array(); |
248 | - } else { |
|
248 | + }else { |
|
249 | 249 | $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION'])); |
250 | 250 | } |
251 | 251 |
@@ -3,12 +3,12 @@ discard block |
||
3 | 3 | require('includes/application_top.php'); |
4 | 4 | |
5 | 5 | define('TABLE_PAGANTIS_CONFIG', 'pagantis_config'); |
6 | -define('TABLE_PRODUCTS_DESCRIPTIONS','products_description'); |
|
6 | +define('TABLE_PRODUCTS_DESCRIPTIONS', 'products_description'); |
|
7 | 7 | |
8 | 8 | //Check if module is installed |
9 | -$result = tep_db_query("select * from " . TABLE_CONFIGURATION . " where configuration_key='MODULE_PAYMENT_PAGANTIS_STATUS'"); |
|
9 | +$result = tep_db_query("select * from ".TABLE_CONFIGURATION." where configuration_key='MODULE_PAYMENT_PAGANTIS_STATUS'"); |
|
10 | 10 | $resultSelect = tep_db_fetch_array($result); |
11 | -if (tep_db_num_rows($result) == 0 || $resultSelect['configuration_value'] !=='True') { |
|
11 | +if (tep_db_num_rows($result) == 0 || $resultSelect['configuration_value'] !== 'True') { |
|
12 | 12 | tep_redirect('/admin/index.php'); |
13 | 13 | } |
14 | 14 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $resultSelect = tep_db_fetch_array($result); |
32 | 32 | if ($resultSelect['value'] == '') { |
33 | 33 | $promotedProducts = array(); |
34 | - } else { |
|
34 | + }else { |
|
35 | 35 | $promotedProducts = array_values((array)unserialize($resultSelect['value'])); |
36 | 36 | } |
37 | 37 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | protected function checkPagantisOrderId() |
141 | 141 | { |
142 | - $orderId=0; |
|
142 | + $orderId = 0; |
|
143 | 143 | $notifyUrl = self::OSCURL.self::NOTIFICATION_FOLDER.'?order='.$orderId; |
144 | 144 | $this->assertNotEmpty($notifyUrl, $notifyUrl); |
145 | 145 | $response = Request::post($notifyUrl)->expects('json')->send(); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $this->assertEquals( |
150 | 150 | $response->body->merchant_order_id, |
151 | 151 | $orderId, |
152 | - $response->body->merchant_order_id.'!='. $orderId |
|
152 | + $response->body->merchant_order_id.'!='.$orderId |
|
153 | 153 | ); |
154 | 154 | $this->assertContains( |
155 | 155 | NoIdentificationException::ERROR_MESSAGE, |