@@ -11,7 +11,6 @@ |
||
11 | 11 | * @package Test\Configure |
12 | 12 | * |
13 | 13 | * @group oscommerce-configure |
14 | - |
|
15 | 14 | */ |
16 | 15 | class ConfigureTest extends PagantisOscommerceTest |
17 | 16 | { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $this->webDriver->get(self::OSCURL); |
31 | 31 | $condition = WebDriverExpectedCondition::titleContains(self::TITLE); |
32 | 32 | $this->webDriver->wait()->until($condition); |
33 | - $this->assertTrue((bool) $condition); |
|
33 | + $this->assertTrue((bool)$condition); |
|
34 | 34 | $this->quit(); |
35 | 35 | } |
36 | 36 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $this->webDriver->get(self::OSCURL.self::BACKOFFICE_FOLDER); |
43 | 43 | $condition = WebDriverExpectedCondition::titleContains(self::ADMIN_TITLE); |
44 | 44 | $this->webDriver->wait()->until($condition); |
45 | - $this->assertTrue((bool) $condition); |
|
45 | + $this->assertTrue((bool)$condition); |
|
46 | 46 | $this->quit(); |
47 | 47 | } |
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | $faker = Factory::create(); |
74 | 74 | $this->configuration['dni'] = $this->getDNI(); |
75 | 75 | $this->configuration['birthdate'] = |
76 | - $faker->numberBetween(1, 28) . '/' . |
|
77 | - $faker->numberBetween(1, 12). '/1975' |
|
76 | + $faker->numberBetween(1, 28).'/'. |
|
77 | + $faker->numberBetween(1, 12).'/1975' |
|
78 | 78 | ; |
79 | 79 | $this->configuration['firstname'] = $faker->firstName; |
80 | - $this->configuration['lastname'] = $faker->lastName . ' ' . $faker->lastName; |
|
80 | + $this->configuration['lastname'] = $faker->lastName.' '.$faker->lastName; |
|
81 | 81 | $this->configuration['company'] = $faker->company; |
82 | 82 | $this->configuration['zip'] = '28'.$faker->randomNumber(3, true); |
83 | 83 | $this->configuration['street'] = $faker->streetAddress; |
84 | - $this->configuration['phone'] = '6' . $faker->randomNumber(8); |
|
85 | - $this->configuration['email'] = date('ymd') . '@pagamastarde.com'; |
|
84 | + $this->configuration['phone'] = '6'.$faker->randomNumber(8); |
|
85 | + $this->configuration['email'] = date('ymd').'@pagamastarde.com'; |
|
86 | 86 | parent::__construct($name, $data, $dataName); |
87 | 87 | } |
88 | 88 | /** |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function getDNI() |
92 | 92 | { |
93 | - $dni = '0000' . rand(pow(10, 4-1), pow(10, 4)-1); |
|
94 | - $value = (int) ($dni / 23); |
|
93 | + $dni = '0000'.rand(pow(10, 4 - 1), pow(10, 4) - 1); |
|
94 | + $value = (int)($dni / 23); |
|
95 | 95 | $value *= 23; |
96 | - $value= $dni - $value; |
|
97 | - $letter= "TRWAGMYFPDXBNJZSQVHLCKEO"; |
|
98 | - $dniLetter= substr($letter, $value, 1); |
|
96 | + $value = $dni - $value; |
|
97 | + $letter = "TRWAGMYFPDXBNJZSQVHLCKEO"; |
|
98 | + $dniLetter = substr($letter, $value, 1); |
|
99 | 99 | return $dni.$dniLetter; |
100 | 100 | } |
101 | 101 |
@@ -17,21 +17,21 @@ |
||
17 | 17 | define('DIR_WS_HTTPS_CATALOG', '/'); |
18 | 18 | define('DIR_FS_CATALOG', '/var/www/html/'); |
19 | 19 | define('DIR_WS_IMAGES', 'images/'); |
20 | -define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); |
|
21 | -define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/'); |
|
20 | +define('DIR_WS_ICONS', DIR_WS_IMAGES.'icons/'); |
|
21 | +define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG.'images/'); |
|
22 | 22 | define('DIR_WS_INCLUDES', 'includes/'); |
23 | -define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); |
|
24 | -define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); |
|
25 | -define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); |
|
26 | -define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); |
|
27 | -define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); |
|
28 | -define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/'); |
|
29 | -define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/'); |
|
30 | -define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/'); |
|
31 | -define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/'); |
|
32 | -define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/'); |
|
33 | -define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); |
|
34 | -define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); |
|
23 | +define('DIR_WS_BOXES', DIR_WS_INCLUDES.'boxes/'); |
|
24 | +define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES.'functions/'); |
|
25 | +define('DIR_WS_CLASSES', DIR_WS_INCLUDES.'classes/'); |
|
26 | +define('DIR_WS_MODULES', DIR_WS_INCLUDES.'modules/'); |
|
27 | +define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES.'languages/'); |
|
28 | +define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG.'includes/languages/'); |
|
29 | +define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG.'includes/languages/'); |
|
30 | +define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG.'images/'); |
|
31 | +define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG.'includes/modules/'); |
|
32 | +define('DIR_FS_BACKUP', DIR_FS_ADMIN.'backups/'); |
|
33 | +define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG.'download/'); |
|
34 | +define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG.'pub/'); |
|
35 | 35 | |
36 | 36 | define('DB_SERVER', getenv('OSCOMMERCE_DB_HOST')); |
37 | 37 | define('DB_SERVER_USERNAME', getenv('OSCOMMERCE_DB_USER')); |
@@ -9,17 +9,17 @@ |
||
9 | 9 | define('DIR_WS_HTTP_CATALOG', '/'); |
10 | 10 | define('DIR_WS_HTTPS_CATALOG', '/'); |
11 | 11 | define('DIR_WS_IMAGES', 'images/'); |
12 | -define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); |
|
12 | +define('DIR_WS_ICONS', DIR_WS_IMAGES.'icons/'); |
|
13 | 13 | define('DIR_WS_INCLUDES', 'includes/'); |
14 | -define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); |
|
15 | -define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); |
|
16 | -define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); |
|
17 | -define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); |
|
14 | +define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES.'functions/'); |
|
15 | +define('DIR_WS_CLASSES', DIR_WS_INCLUDES.'classes/'); |
|
16 | +define('DIR_WS_MODULES', DIR_WS_INCLUDES.'modules/'); |
|
17 | +define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES.'languages/'); |
|
18 | 18 | |
19 | 19 | define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/'); |
20 | 20 | define('DIR_FS_CATALOG', '/var/www/html'); |
21 | -define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); |
|
22 | -define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); |
|
21 | +define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG.'download/'); |
|
22 | +define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG.'pub/'); |
|
23 | 23 | |
24 | 24 | define('DB_SERVER', getenv('OSCOMMERCE_DB_HOST')); |
25 | 25 | define('DB_SERVER_USERNAME', getenv('OSCOMMERCE_DB_USER')); |
@@ -29,26 +29,26 @@ discard block |
||
29 | 29 | public $order_id; |
30 | 30 | |
31 | 31 | public $defaultConfigs = array('PMT_TITLE'=>'Instant Financing', |
32 | - 'PMT_SIMULATOR_DISPLAY_TYPE'=>'pmtSDK.simulator.types.SIMPLE', |
|
33 | - 'PMT_SIMULATOR_DISPLAY_SKIN'=>'pmtSDK.simulator.skins.BLUE', |
|
34 | - 'PMT_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
35 | - 'PMT_SIMULATOR_START_INSTALLMENTS'=>3, |
|
36 | - 'PMT_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
37 | - 'PMT_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
38 | - 'PMT_SIMULATOR_DISPLAY_CSS_POSITION'=>'pmtSDK.simulator.positions.INNER', |
|
39 | - 'PMT_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
40 | - 'PMT_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
41 | - 'PMT_FORM_DISPLAY_TYPE'=>0, |
|
42 | - 'PMT_DISPLAY_MIN_AMOUNT'=>1, |
|
43 | - 'PMT_URL_OK'=>'', |
|
44 | - 'PMT_URL_KO'=>'', |
|
45 | - 'PMT_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente |
|
32 | + 'PMT_SIMULATOR_DISPLAY_TYPE'=>'pmtSDK.simulator.types.SIMPLE', |
|
33 | + 'PMT_SIMULATOR_DISPLAY_SKIN'=>'pmtSDK.simulator.skins.BLUE', |
|
34 | + 'PMT_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
35 | + 'PMT_SIMULATOR_START_INSTALLMENTS'=>3, |
|
36 | + 'PMT_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
37 | + 'PMT_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
38 | + 'PMT_SIMULATOR_DISPLAY_CSS_POSITION'=>'pmtSDK.simulator.positions.INNER', |
|
39 | + 'PMT_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
40 | + 'PMT_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
41 | + 'PMT_FORM_DISPLAY_TYPE'=>0, |
|
42 | + 'PMT_DISPLAY_MIN_AMOUNT'=>1, |
|
43 | + 'PMT_URL_OK'=>'', |
|
44 | + 'PMT_URL_KO'=>'', |
|
45 | + 'PMT_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente |
|
46 | 46 | online y sin papeleos,¡y la respuesta es inmediata!' |
47 | 47 | ); |
48 | 48 | |
49 | 49 | /** |
50 | - * Constructor |
|
51 | - */ |
|
50 | + * Constructor |
|
51 | + */ |
|
52 | 52 | public function __construct() |
53 | 53 | { |
54 | 54 | global $order; |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | **************/ |
98 | 98 | |
99 | 99 | /** |
100 | - * Here you can implement using payment zones (refer to standard PayPal module as reference) |
|
101 | - */ |
|
100 | + * Here you can implement using payment zones (refer to standard PayPal module as reference) |
|
101 | + */ |
|
102 | 102 | public function update_status() |
103 | 103 | { |
104 | 104 | global $order, $db; |
@@ -366,10 +366,10 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
369 | - * Post-processing activities |
|
370 | - * |
|
371 | - * @return boolean |
|
372 | - */ |
|
369 | + * Post-processing activities |
|
370 | + * |
|
371 | + * @return boolean |
|
372 | + */ |
|
373 | 373 | public function after_process() |
374 | 374 | { |
375 | 375 | global $insert_id, $order, $currencies; |
@@ -527,16 +527,16 @@ discard block |
||
527 | 527 | } |
528 | 528 | |
529 | 529 | /** |
530 | - * Internal list of configuration keys used for configuration of the module |
|
531 | - * |
|
532 | - * @return array |
|
533 | - */ |
|
530 | + * Internal list of configuration keys used for configuration of the module |
|
531 | + * |
|
532 | + * @return array |
|
533 | + */ |
|
534 | 534 | public function keys() |
535 | 535 | { |
536 | 536 | return array('MODULE_PAYMENT_PAGANTIS_STATUS', |
537 | - 'MODULE_PAYMENT_PAGANTIS_PK', |
|
538 | - 'MODULE_PAYMENT_PAGANTIS_SK', |
|
539 | - 'MODULE_PAYMENT_PAGANTIS_SIMULATOR'); |
|
537 | + 'MODULE_PAYMENT_PAGANTIS_PK', |
|
538 | + 'MODULE_PAYMENT_PAGANTIS_SK', |
|
539 | + 'MODULE_PAYMENT_PAGANTIS_SIMULATOR'); |
|
540 | 540 | } |
541 | 541 | |
542 | 542 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | if (strpos($_SERVER[REQUEST_URI], "checkout_payment.php") <= 0) { |
59 | 59 | $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_ADMIN_TITLE; // Payment module title in Admin |
60 | - } else { |
|
60 | + }else { |
|
61 | 61 | $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_CATALOG_TITLE; // Payment module title in Catalog |
62 | 62 | } |
63 | 63 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $this->order_status = MODULE_PAYMENT_PAGANTIS_ORDER_STATUS_ID; |
70 | 70 | } |
71 | 71 | |
72 | - if (strpos($_SERVER[REQUEST_URI], "checkout_confirmation.php")!==false && $_SESSION['order_id']) { |
|
72 | + if (strpos($_SERVER[REQUEST_URI], "checkout_confirmation.php") !== false && $_SESSION['order_id']) { |
|
73 | 73 | if ($pmtOrderId = $this->getPmtOrderId($_SESSION['order_id'])) { |
74 | 74 | $this->form_action_url = "https://form.pagamastarde.com/orders/$pmtOrderId"; |
75 | 75 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $_SERVER['REQUEST_URI'] |
88 | 88 | ) |
89 | 89 | ); |
90 | - $this->form_action_url = $this->base_url . '/catalog/ext/modules/payment/pagantis/bypass.php'; |
|
90 | + $this->form_action_url = $this->base_url.'/catalog/ext/modules/payment/pagantis/bypass.php'; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /*************** |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | if (strpos($_SERVER[REQUEST_URI], "checkout_process.php") > 0) { |
107 | 107 | if ($_POST) { |
108 | 108 | die('aqui hemos llegado por notificación'); |
109 | - } else { |
|
109 | + }else { |
|
110 | 110 | echo "pasamos de largo pq es un GET"; |
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
114 | 114 | if ($this->enabled && (int)MODULE_PAYMENT_PAGANTIS_ZONE > 0 && isset($order->billing['country']['id'])) { |
115 | 115 | $check_flag = false; |
116 | - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAGANTIS_ZONE . "' and zone_country_id = '" . (int)$order->billing['country']['id'] . "' order by zone_id"); |
|
116 | + $check_query = tep_db_query("select zone_id from ".TABLE_ZONES_TO_GEO_ZONES." where geo_zone_id = '".MODULE_PAYMENT_PAGANTIS_ZONE."' and zone_country_id = '".(int)$order->billing['country']['id']."' order by zone_id"); |
|
117 | 117 | while ($check = tep_db_fetch_array($check_query)) { |
118 | 118 | if ($check['zone_id'] < 1) { |
119 | 119 | $check_flag = true; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $id_hash = time().serialize($order->products).''.serialize($order->customer).''.serialize($order->delivery); |
214 | 214 | $this->order_id = md5($id_hash); |
215 | 215 | $_SESSION['order_id'] = $this->order_id; |
216 | - $sql = sprintf("insert into " . TABLE_PAGANTIS . " (order_id) values ('%s')", $this->order_id); |
|
216 | + $sql = sprintf("insert into ".TABLE_PAGANTIS." (order_id) values ('%s')", $this->order_id); |
|
217 | 217 | tep_db_query($sql); |
218 | 218 | |
219 | 219 | $userAddress = new Address(); |
@@ -326,16 +326,16 @@ discard block |
||
326 | 326 | $url = $pagantisOrder->getActionUrls()->getForm(); |
327 | 327 | $this->insertRow($this->order_id, serialize($global_vars)); |
328 | 328 | die($this->order_id); |
329 | - } else { |
|
329 | + }else { |
|
330 | 330 | throw new OrderNotFoundException(); |
331 | 331 | } |
332 | 332 | |
333 | 333 | if ($url == "") { |
334 | 334 | throw new UnknownException(_("No ha sido posible obtener una respuesta de Pagantis")); |
335 | - } else { //if ($this->extraConfig['PAGANTIS_FORM_DISPLAY_TYPE'] == '0') { |
|
335 | + }else { //if ($this->extraConfig['PAGANTIS_FORM_DISPLAY_TYPE'] == '0') { |
|
336 | 336 | $output = "\n"; |
337 | - $output.= tep_draw_hidden_field("formUrl", $url) . "\n"; |
|
338 | - $output.= tep_draw_hidden_field("cancelUrl", $cancelUrl) . "\n"; |
|
337 | + $output .= tep_draw_hidden_field("formUrl", $url)."\n"; |
|
338 | + $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl)."\n"; |
|
339 | 339 | return $output; |
340 | 340 | } /*else { |
341 | 341 | $template_fields = array( |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | { |
360 | 360 | if (!$_POST) { |
361 | 361 | die('aqui hemos llegado por order'); |
362 | - } else { |
|
362 | + }else { |
|
363 | 363 | echo "pasamos de largo pq es un POST y ya debe estar verificado"; |
364 | 364 | } |
365 | 365 | exit; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | if (MODULE_PAYMENT_PAGANTIS_TESTMODE == 'Test') { |
383 | 383 | $secret_key = MODULE_PAYMENT_PAGANTIS_TSK; |
384 | 384 | $public_key = MODULE_PAYMENT_PAGANTIS_TK; |
385 | - } else { |
|
385 | + }else { |
|
386 | 386 | $secret_key = MODULE_PAYMENT_PAGANTIS_PSK; |
387 | 387 | $public_key = MODULE_PAYMENT_PAGANTIS_PK; |
388 | 388 | } |
@@ -405,8 +405,8 @@ discard block |
||
405 | 405 | } |
406 | 406 | //$this->notify('NOTIFY_PAYMENT_AUTHNETSIM_POSTPROCESS_HOOK'); |
407 | 407 | if ($notififcation_check && $this->notification['event'] == 'charge.created') { |
408 | - $sql = "insert into " . TABLE_ORDERS_STATUS_HISTORY . " (comments, orders_id, orders_status_id, customer_notified, date_added) values |
|
409 | - ('".'Pagantis. Transaction ID: ' .$this->notification['data']['id']."', ".$insert_id.", '".$this->order_status."', -1, now() )"; |
|
408 | + $sql = "insert into ".TABLE_ORDERS_STATUS_HISTORY." (comments, orders_id, orders_status_id, customer_notified, date_added) values |
|
409 | + ('".'Pagantis. Transaction ID: '.$this->notification['data']['id']."', ".$insert_id.", '".$this->order_status."', -1, now() )"; |
|
410 | 410 | tep_db_query($sql); |
411 | 411 | } |
412 | 412 | unset($_SESSION['order_id']); |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | public function check() |
422 | 422 | { |
423 | 423 | if (!isset($this->_check)) { |
424 | - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAGANTIS_STATUS'"); |
|
424 | + $check_query = tep_db_query("select configuration_value from ".TABLE_CONFIGURATION." where configuration_key = 'MODULE_PAYMENT_PAGANTIS_STATUS'"); |
|
425 | 425 | $this->_check = tep_db_num_rows($check_query); |
426 | 426 | } |
427 | 427 | $this->install_pagantis_tables(); |
@@ -440,10 +440,10 @@ discard block |
||
440 | 440 | tep_redirect(tep_href_link(FILENAME_MODULES, 'set=payment&module=pagantis', 'NONSSL')); |
441 | 441 | return 'failed'; |
442 | 442 | } |
443 | - 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_PAYMENT_PAGANTIS_STATUS', 'True', '', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); |
|
444 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Public Key', 'MODULE_PAYMENT_PAGANTIS_PK', '', 'MANDATORY. You can get in your pagantis profile', '6', '0', now())"); |
|
445 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Secret Key', 'MODULE_PAYMENT_PAGANTIS_SK', '', 'MANDATORY. You can get in your pagantis profile', '6', '0', now())"); |
|
446 | - 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 ('Include simulator', 'MODULE_PAYMENT_PAGANTIS_SIMULATOR', 'True', 'Do you want to include simulator in product page?', '6', '3', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); |
|
443 | + 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_PAYMENT_PAGANTIS_STATUS', 'True', '', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); |
|
444 | + tep_db_query("insert into ".TABLE_CONFIGURATION." (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Public Key', 'MODULE_PAYMENT_PAGANTIS_PK', '', 'MANDATORY. You can get in your pagantis profile', '6', '0', now())"); |
|
445 | + tep_db_query("insert into ".TABLE_CONFIGURATION." (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Secret Key', 'MODULE_PAYMENT_PAGANTIS_SK', '', 'MANDATORY. You can get in your pagantis profile', '6', '0', now())"); |
|
446 | + 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 ('Include simulator', 'MODULE_PAYMENT_PAGANTIS_SIMULATOR', 'True', 'Do you want to include simulator in product page?', '6', '3', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); |
|
447 | 447 | |
448 | 448 | $this->install_pagantis_tables(); |
449 | 449 | } |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | */ |
454 | 454 | private function install_pagantis_tables() |
455 | 455 | { |
456 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS . " ( |
|
456 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS." ( |
|
457 | 457 | `id` int(11) NOT NULL auto_increment, |
458 | 458 | `insert_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
459 | 459 | `order_id` varchar(150) NOT NULL, |
@@ -462,32 +462,32 @@ discard block |
||
462 | 462 | KEY (order_id))"; |
463 | 463 | tep_db_query($sql); |
464 | 464 | |
465 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_LOG . " ( |
|
465 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_LOG." ( |
|
466 | 466 | id int NOT NULL AUTO_INCREMENT, |
467 | 467 | log text NOT NULL, |
468 | 468 | createdAt timestamp DEFAULT CURRENT_TIMESTAMP, |
469 | 469 | UNIQUE KEY id (id))"; |
470 | 470 | tep_db_query($sql); |
471 | 471 | |
472 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONFIG . " ( |
|
472 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONFIG." ( |
|
473 | 473 | id int NOT NULL AUTO_INCREMENT, |
474 | 474 | config varchar(60) NOT NULL, |
475 | 475 | value varchar(100) NOT NULL, |
476 | 476 | UNIQUE KEY id(id))"; |
477 | 477 | tep_db_query($sql); |
478 | 478 | foreach ((array)$this->extraConfig as $configKey => $configValue) { |
479 | - $query = "INSERT INTO " . TABLE_PAGANTIS_CONFIG . " (config, value) values ($configKey, $configValue)"; |
|
479 | + $query = "INSERT INTO ".TABLE_PAGANTIS_CONFIG." (config, value) values ($configKey, $configValue)"; |
|
480 | 480 | tep_db_query($query); |
481 | 481 | } |
482 | 482 | |
483 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_ORDERS . " ( |
|
483 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_ORDERS." ( |
|
484 | 484 | id int NOT NULL AUTO_INCREMENT, |
485 | 485 | os_order_id varchar(50) NOT NULL, |
486 | 486 | pmt_order_id varchar(50) NOT NULL, |
487 | 487 | UNIQUE KEY id(id))"; |
488 | 488 | tep_db_query($sql); |
489 | 489 | |
490 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONCURRENCY . " ( |
|
490 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONCURRENCY." ( |
|
491 | 491 | id int NOT NULL, |
492 | 492 | `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, |
493 | 493 | UNIQUE KEY id(id))"; |
@@ -501,28 +501,28 @@ discard block |
||
501 | 501 | { |
502 | 502 | $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS."'"); |
503 | 503 | if (tep_db_num_rows($checkTable) > 0) { |
504 | - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); |
|
505 | - tep_db_query("drop table " . TABLE_PAGANTIS); |
|
504 | + tep_db_query("delete from ".TABLE_CONFIGURATION." where configuration_key in ('".implode("', '", $this->keys())."')"); |
|
505 | + tep_db_query("drop table ".TABLE_PAGANTIS); |
|
506 | 506 | } |
507 | 507 | |
508 | 508 | $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_LOG."'"); |
509 | 509 | if (tep_db_num_rows($checkTable) > 0) { |
510 | - tep_db_query("drop table " . TABLE_PAGANTIS_LOG); |
|
510 | + tep_db_query("drop table ".TABLE_PAGANTIS_LOG); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONFIG."'"); |
514 | 514 | if (tep_db_num_rows($checkTable) > 0) { |
515 | - tep_db_query("drop table " . TABLE_PAGANTIS_CONFIG); |
|
515 | + tep_db_query("drop table ".TABLE_PAGANTIS_CONFIG); |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_ORDERS."'"); |
519 | 519 | if (tep_db_num_rows($checkTable) > 0) { |
520 | - tep_db_query("drop table " . TABLE_PAGANTIS_ORDERS); |
|
520 | + tep_db_query("drop table ".TABLE_PAGANTIS_ORDERS); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONCURRENCY."'"); |
524 | 524 | if (tep_db_num_rows($checkTable) > 0) { |
525 | - tep_db_query("drop table " . TABLE_PAGANTIS_CONCURRENCY); |
|
525 | + tep_db_query("drop table ".TABLE_PAGANTIS_CONCURRENCY); |
|
526 | 526 | } |
527 | 527 | } |
528 | 528 | |
@@ -592,13 +592,13 @@ discard block |
||
592 | 592 | */ |
593 | 593 | private function insertRow($orderId, $pmtOrderId) |
594 | 594 | { |
595 | - $query = "select * from ". TABLE_PAGANTIS_ORDERS ." where os_order_id='$orderId'"; |
|
595 | + $query = "select * from ".TABLE_PAGANTIS_ORDERS." where os_order_id='$orderId'"; |
|
596 | 596 | $resultsSelect = tep_db_query($query); |
597 | 597 | $countResults = tep_db_num_rows($resultsSelect); |
598 | 598 | if ($countResults == 0) { |
599 | - $query = "INSERT INTO " . TABLE_PAGANTIS_ORDERS ."(os_order_id, pmt_order_id) values ('$orderId', '$pmtOrderId')"; |
|
600 | - } else { |
|
601 | - $query = "UPDATE " . TABLE_PAGANTIS_ORDERS . " set pmt_order_id='$pmtOrderId' where os_order_id='$orderId'"; |
|
599 | + $query = "INSERT INTO ".TABLE_PAGANTIS_ORDERS."(os_order_id, pmt_order_id) values ('$orderId', '$pmtOrderId')"; |
|
600 | + }else { |
|
601 | + $query = "UPDATE ".TABLE_PAGANTIS_ORDERS." set pmt_order_id='$pmtOrderId' where os_order_id='$orderId'"; |
|
602 | 602 | } |
603 | 603 | tep_db_query($query); |
604 | 604 | } |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | private function getPmtOrderId($osOrderId) |
624 | 624 | { |
625 | 625 | $result = ''; |
626 | - $query = "select pmt_order_id from ". TABLE_PAGANTIS_ORDERS ." where os_order_id='$osOrderId'"; |
|
626 | + $query = "select pmt_order_id from ".TABLE_PAGANTIS_ORDERS." where os_order_id='$osOrderId'"; |
|
627 | 627 | $resultsSelect = tep_db_query($query); |
628 | 628 | while ($orderRow = tep_db_fetch_array($resultsSelect)) { |
629 | 629 | $result = $orderRow['pmt_order_id']; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | $publicKey = MODULE_PAYMENT_PAGANTIS_PK; |
16 | 16 | $widget = ''; |
17 | - if ( MODULE_PAYMENT_PAGANTIS_SIMULATOR == 'True' ) |
|
17 | + if (MODULE_PAYMENT_PAGANTIS_SIMULATOR == 'True') |
|
18 | 18 | { |
19 | 19 | $widget = '<script> |
20 | 20 | var simulatorId = null; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | <div class="PagantisSimulator"></div>'; |
51 | 51 | } |
52 | 52 | |
53 | - define('MODULE_PAYMENT_PAGANTIS_TEXT_CATALOG_TITLE', 'Instant financing'. $widget); // Payment option title as displayed to the customer |
|
53 | + define('MODULE_PAYMENT_PAGANTIS_TEXT_CATALOG_TITLE', 'Instant financing'.$widget); // Payment option title as displayed to the customer |
|
54 | 54 | |
55 | 55 | define('MODULE_PAYMENT_PAGANTIS_TEXT_ADMIN_TITLE', 'Pagantis'); |
56 | 56 |
@@ -11,24 +11,24 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | global $customer_id, $order; |
14 | - if ( MODULE_PAYMENT_PAGANTIS_DISCOUNT == 'True' ){ |
|
14 | + if (MODULE_PAYMENT_PAGANTIS_DISCOUNT == 'True') { |
|
15 | 15 | $discount = 1; |
16 | - }else{ |
|
16 | + }else { |
|
17 | 17 | $discount = 0; |
18 | 18 | } |
19 | 19 | |
20 | - if ( MODULE_PAYMENT_PAGANTIS_TESTMODE == 'Test' ){ |
|
20 | + if (MODULE_PAYMENT_PAGANTIS_TESTMODE == 'Test') { |
|
21 | 21 | $key = MODULE_PAYMENT_PAGANTIS_TK; |
22 | - }else{ |
|
22 | + }else { |
|
23 | 23 | $key = MODULE_PAYMENT_PAGANTIS_PK; |
24 | 24 | } |
25 | 25 | |
26 | 26 | $widget = ''; |
27 | - if ( MODULE_PAYMENT_PAGANTIS_SIMULATOR == 'True' ) { |
|
28 | - $widget = '<br/>'; |
|
27 | + if (MODULE_PAYMENT_PAGANTIS_SIMULATOR == 'True') { |
|
28 | + $widget = '<br/>'; |
|
29 | 29 | } |
30 | 30 | |
31 | - define('MODULE_PAYMENT_PAGANTIS_TEXT_CATALOG_TITLE', 'Instant financing'); // Payment option title as displayed to the customer |
|
31 | + define('MODULE_PAYMENT_PAGANTIS_TEXT_CATALOG_TITLE', 'Instant financing'); // Payment option title as displayed to the customer |
|
32 | 32 | |
33 | 33 | define('MODULE_PAYMENT_PAGANTIS_TEXT_ADMIN_TITLE', 'Pagantis'); |
34 | 34 |
@@ -13,13 +13,13 @@ |
||
13 | 13 | global $customer_id, $order; |
14 | 14 | if ( MODULE_PAYMENT_PAGANTIS_DISCOUNT == 'True' ){ |
15 | 15 | $discount = 1; |
16 | - }else{ |
|
16 | + } else{ |
|
17 | 17 | $discount = 0; |
18 | 18 | } |
19 | 19 | |
20 | 20 | if ( MODULE_PAYMENT_PAGANTIS_TESTMODE == 'Test' ){ |
21 | 21 | $key = MODULE_PAYMENT_PAGANTIS_TK; |
22 | - }else{ |
|
22 | + } else{ |
|
23 | 23 | $key = MODULE_PAYMENT_PAGANTIS_PK; |
24 | 24 | } |
25 | 25 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | $destUrl = $_POST['formUrl']; |
5 | 5 | } elseif ($_POST['cancelUrl']) { |
6 | 6 | $destUrl = $_POST['cancelUrl']; |
7 | -} else { |
|
7 | +}else { |
|
8 | 8 | $destUrl = $_SERVER['HTTP_REFERER']; |
9 | 9 | } |
10 | 10 |