@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | header('HTTP/1.1 200 Ok', true, 200); |
| 46 | 46 | header('Content-Type: application/json', true); |
| 47 | - header('Content-Length: ' . Tools::strlen($result)); |
|
| 47 | + header('Content-Length: '.Tools::strlen($result)); |
|
| 48 | 48 | |
| 49 | 49 | echo $result; |
| 50 | 50 | exit(); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | header('HTTP/1.1 200 Ok', true, 200); |
| 68 | 68 | header('Content-Type: application/json', true); |
| 69 | - header('Content-Length: ' . Tools::strlen($result)); |
|
| 69 | + header('Content-Length: '.Tools::strlen($result)); |
|
| 70 | 70 | |
| 71 | 71 | echo $result; |
| 72 | 72 | exit(); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | header('HTTP/1.1 403 Forbidden', true, 403); |
| 92 | 92 | header('Content-Type: application/json', true); |
| 93 | - header('Content-Length: ' . Tools::strlen($result)); |
|
| 93 | + header('Content-Length: '.Tools::strlen($result)); |
|
| 94 | 94 | |
| 95 | 95 | echo $result; |
| 96 | 96 | exit(); |
@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | if (_PS_VERSION_ < 1.6) { |
| 27 | 27 | Logger::addLog( |
| 28 | - 'Pagantis Exception For user ' . |
|
| 29 | - $customer->email . |
|
| 30 | - ' : ' . |
|
| 28 | + 'Pagantis Exception For user '. |
|
| 29 | + $customer->email. |
|
| 30 | + ' : '. |
|
| 31 | 31 | $exception->getMessage(), |
| 32 | 32 | 3, |
| 33 | 33 | $exception->getCode(), |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | ); |
| 38 | 38 | } else { |
| 39 | 39 | PrestaShopLogger::addLog( |
| 40 | - 'Pagantis Exception For user ' . |
|
| 41 | - $customer->email . |
|
| 42 | - ' : ' . |
|
| 40 | + 'Pagantis Exception For user '. |
|
| 41 | + $customer->email. |
|
| 42 | + ' : '. |
|
| 43 | 43 | $exception->getMessage(), |
| 44 | 44 | 3, |
| 45 | 45 | $exception->getCode(), |
@@ -98,22 +98,22 @@ discard block |
||
| 98 | 98 | ); |
| 99 | 99 | |
| 100 | 100 | try { |
| 101 | - $userAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
|
| 101 | + $userAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
|
| 102 | 102 | $userAddress |
| 103 | 103 | ->setZipCode($shippingAddress->postcode) |
| 104 | - ->setFullName($shippingAddress->firstname . ' ' . $shippingAddress->lastname) |
|
| 104 | + ->setFullName($shippingAddress->firstname.' '.$shippingAddress->lastname) |
|
| 105 | 105 | ->setCountryCode('ES') |
| 106 | 106 | ->setCity($shippingAddress->city) |
| 107 | - ->setAddress($shippingAddress->address1 . ' ' . $shippingAddress->address2) |
|
| 107 | + ->setAddress($shippingAddress->address1.' '.$shippingAddress->address2) |
|
| 108 | 108 | ; |
| 109 | 109 | |
| 110 | - $orderShippingAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
|
| 110 | + $orderShippingAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
|
| 111 | 111 | $orderShippingAddress |
| 112 | 112 | ->setZipCode($shippingAddress->postcode) |
| 113 | - ->setFullName($shippingAddress->firstname . ' ' . $shippingAddress->lastname) |
|
| 113 | + ->setFullName($shippingAddress->firstname.' '.$shippingAddress->lastname) |
|
| 114 | 114 | ->setCountryCode('ES') |
| 115 | 115 | ->setCity($shippingAddress->city) |
| 116 | - ->setAddress($shippingAddress->address1 . ' ' . $shippingAddress->address2) |
|
| 116 | + ->setAddress($shippingAddress->address1.' '.$shippingAddress->address2) |
|
| 117 | 117 | ->setDni($shippingAddress->dni) |
| 118 | 118 | ->setFixPhone($shippingAddress->phone) |
| 119 | 119 | ->setMobilePhone($shippingAddress->phone_mobile) |
@@ -122,10 +122,10 @@ discard block |
||
| 122 | 122 | $orderBillingAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
| 123 | 123 | $orderBillingAddress |
| 124 | 124 | ->setZipCode($billingAddress->postcode) |
| 125 | - ->setFullName($billingAddress->firstname . ' ' . $billingAddress->lastname) |
|
| 125 | + ->setFullName($billingAddress->firstname.' '.$billingAddress->lastname) |
|
| 126 | 126 | ->setCountryCode('ES') |
| 127 | 127 | ->setCity($billingAddress->city) |
| 128 | - ->setAddress($billingAddress->address1 . ' ' . $billingAddress->address2) |
|
| 128 | + ->setAddress($billingAddress->address1.' '.$billingAddress->address2) |
|
| 129 | 129 | ->setDni($billingAddress->dni) |
| 130 | 130 | ->setFixPhone($billingAddress->phone) |
| 131 | 131 | ->setMobilePhone($billingAddress->phone_mobile) |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | ->setDni($shippingAddress->dni) |
| 144 | 144 | ; |
| 145 | 145 | |
| 146 | - if ($customer->birthday!='0000-00-00') { |
|
| 146 | + if ($customer->birthday != '0000-00-00') { |
|
| 147 | 147 | $orderUser->setDateOfBirth($customer->birthday); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | Tools::redirect($cancelUrl); |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - $url =''; |
|
| 222 | + $url = ''; |
|
| 223 | 223 | try { |
| 224 | 224 | $orderClient = new \Pagantis\OrdersApiClient\Client( |
| 225 | 225 | $pagantisPublicKey, |
@@ -229,12 +229,12 @@ discard block |
||
| 229 | 229 | if ($order instanceof \Pagantis\OrdersApiClient\Model\Order) { |
| 230 | 230 | $url = $order->getActionUrls()->getForm(); |
| 231 | 231 | $orderId = $order->getId(); |
| 232 | - $sql = "INSERT INTO `" . _DB_PREFIX_ . "pagantis_order` (`id`, `order_id`) |
|
| 232 | + $sql = "INSERT INTO `"._DB_PREFIX_."pagantis_order` (`id`, `order_id`) |
|
| 233 | 233 | VALUES ('$cart->id','$orderId') |
| 234 | 234 | ON DUPLICATE KEY UPDATE `order_id` = '$orderId'"; |
| 235 | 235 | $result = Db::getInstance()->execute($sql); |
| 236 | 236 | if (!$result) { |
| 237 | - throw new UnknownException('Unable to save pagantis-order-id in database: '. $sql); |
|
| 237 | + throw new UnknownException('Unable to save pagantis-order-id in database: '.$sql); |
|
| 238 | 238 | } |
| 239 | 239 | } else { |
| 240 | 240 | throw new OrderNotFoundException(); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $parsedUrl = parse_url($url); |
| 36 | 36 | $separator = ($parsedUrl['query'] == null) ? '?' : '&'; |
| 37 | - $redirectUrl = $url. $separator . http_build_query($parameters); |
|
| 37 | + $redirectUrl = $url.$separator.http_build_query($parameters); |
|
| 38 | 38 | Tools::redirect($redirectUrl); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | $response = $exception->getMessage(); |
| 77 | 77 | } else { |
| 78 | 78 | $response = 'Unable to serialize log.'. |
| 79 | - 'data: '. json_encode($data). |
|
| 80 | - 'exception: '. json_encode($exception); |
|
| 79 | + 'data: '.json_encode($data). |
|
| 80 | + 'exception: '.json_encode($exception); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | exit; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | -define('_PS_PAYLATER_DIR', _PS_MODULE_DIR_. '/pagantis'); |
|
| 14 | +define('_PS_PAYLATER_DIR', _PS_MODULE_DIR_.'/pagantis'); |
|
| 15 | 15 | |
| 16 | 16 | require _PS_PAYLATER_DIR.'/vendor/autoload.php'; |
| 17 | 17 | |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | { |
| 68 | 68 | $this->name = 'pagantis'; |
| 69 | 69 | $this->tab = 'payments_gateways'; |
| 70 | -<<<<<<< HEAD:pagantis.php |
|
| 70 | +<< << << < HEAD:pagantis.php |
|
| 71 | 71 | $this->version = '8.0.0'; |
| 72 | 72 | $this->author = 'Pagantis'; |
| 73 | -======= |
|
| 73 | +=== === = |
|
| 74 | 74 | $this->version = '7.2.2'; |
| 75 | 75 | $this->author = 'Paga+Tarde'; |
| 76 | ->>>>>>> baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 76 | +>> >> >> > baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 77 | 77 | $this->currencies = true; |
| 78 | 78 | $this->currencies_mode = 'checkbox'; |
| 79 | 79 | $this->module_key = '2b9bc901b4d834bb7069e7ea6510438f'; |
@@ -199,18 +199,18 @@ discard block |
||
| 199 | 199 | public function checkHooks() |
| 200 | 200 | { |
| 201 | 201 | try { |
| 202 | - $sql_content = 'select * from ' . _DB_PREFIX_. 'hook_module where |
|
| 203 | - id_module = \'' . Module::getModuleIdByName($this->name) . '\' and |
|
| 204 | - id_shop = \'' . Shop::getContextShopID() . '\' and |
|
| 205 | - id_hook = \'' . Hook::getIdByName('header') . '\''; |
|
| 202 | + $sql_content = 'select * from '._DB_PREFIX_.'hook_module where |
|
| 203 | + id_module = \'' . Module::getModuleIdByName($this->name).'\' and |
|
| 204 | + id_shop = \'' . Shop::getContextShopID().'\' and |
|
| 205 | + id_hook = \'' . Hook::getIdByName('header').'\''; |
|
| 206 | 206 | $hook_exists = Db::getInstance()->ExecuteS($sql_content); |
| 207 | 207 | if (empty($hook_exists)) { |
| 208 | - $sql_insert = 'insert into ' . _DB_PREFIX_. 'hook_module |
|
| 208 | + $sql_insert = 'insert into '._DB_PREFIX_.'hook_module |
|
| 209 | 209 | (id_module, id_shop, id_hook, position) |
| 210 | 210 | values |
| 211 | - (\''. Module::getModuleIdByName($this->name) . '\', |
|
| 212 | - \''. Shop::getContextShopID() . '\', |
|
| 213 | - \''. Hook::getIdByName('header') . '\', |
|
| 211 | + (\''. Module::getModuleIdByName($this->name).'\', |
|
| 212 | + \''. Shop::getContextShopID().'\', |
|
| 213 | + \''. Hook::getIdByName('header').'\', |
|
| 214 | 214 | 150)'; |
| 215 | 215 | Db::getInstance()->execute($sql_insert); |
| 216 | 216 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public function checkEnvVariables() |
| 226 | 226 | { |
| 227 | - $sql_content = 'select * from ' . _DB_PREFIX_. 'pagantis_config'; |
|
| 227 | + $sql_content = 'select * from '._DB_PREFIX_.'pagantis_config'; |
|
| 228 | 228 | $dbConfigs = Db::getInstance()->executeS($sql_content); |
| 229 | 229 | |
| 230 | 230 | // Convert a multimple dimension array for SQL insert statements into a simple key/value |
@@ -243,15 +243,15 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | Db::getInstance()->insert('pagantis_config', $data); |
| 245 | 245 | } |
| 246 | -<<<<<<< HEAD:pagantis.php |
|
| 246 | +<< << << < HEAD:pagantis.php |
|
| 247 | 247 | |
| 248 | 248 | foreach (array_merge($this->defaultConfigs, $simpleDbConfigs) as $key => $value) { |
| 249 | - putenv($key . '=' . $value); |
|
| 249 | + putenv($key.'='.$value); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | - putenv("PAGANTIS_DEFAULT_CONFIGS" . '=' . json_encode($this->defaultConfigs)); |
|
| 253 | -======= |
|
| 254 | ->>>>>>> baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 252 | + putenv("PAGANTIS_DEFAULT_CONFIGS".'='.json_encode($this->defaultConfigs)); |
|
| 253 | +=== === = |
|
| 254 | +>> >> >> > baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /** |
@@ -288,15 +288,15 @@ discard block |
||
| 288 | 288 | $cart = $this->context->cart; |
| 289 | 289 | $currency = new Currency($cart->id_currency); |
| 290 | 290 | $availableCurrencies = array('EUR'); |
| 291 | -<<<<<<< HEAD:pagantis.php |
|
| 291 | +<< << << < HEAD:pagantis.php |
|
| 292 | 292 | $pagantisDisplayMinAmount = getenv('PAGANTIS_DISPLAY_MIN_AMOUNT'); |
| 293 | 293 | $pagantisPublicKey = Configuration::get('pagantis_public_key'); |
| 294 | 294 | $pagantisPrivateKey = Configuration::get('pagantis_private_key'); |
| 295 | -======= |
|
| 295 | +=== === = |
|
| 296 | 296 | $pmtDisplayMinAmount = Paylater::getExtraConfig('PMT_DISPLAY_MIN_AMOUNT'); |
| 297 | 297 | $pmtPublicKey = Configuration::get('pmt_public_key'); |
| 298 | 298 | $pmtPrivateKey = Configuration::get('pmt_private_key'); |
| 299 | ->>>>>>> baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 299 | +>> >> >> > baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 300 | 300 | |
| 301 | 301 | return ( |
| 302 | 302 | $cart->getOrderTotal() >= $pagantisDisplayMinAmount && |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | } else { |
| 338 | 338 | $this->context->controller->addJS('https://cdn.pagamastarde.com/js/pmt-v2/sdk.js'); |
| 339 | 339 | } |
| 340 | - $this->context->controller->addJS($this->getPathUri(). 'views/js/simulator.js'); |
|
| 340 | + $this->context->controller->addJS($this->getPathUri().'views/js/simulator.js'); |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /** @var Cart $cart */ |
| 354 | -<<<<<<< HEAD:pagantis.php |
|
| 354 | +<< << << < HEAD:pagantis.php |
|
| 355 | 355 | $cart = $this->context->cart; |
| 356 | 356 | $orderTotal = $cart->getOrderTotal(); |
| 357 | 357 | $link = $this->context->link; |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | $pagantisSimulatorSkin = getenv('PAGANTIS_SIMULATOR_DISPLAY_SKIN'); |
| 366 | 366 | $pagantisSimulatorPosition = getenv('PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'); |
| 367 | 367 | $pagantisTitle = $this->l(getenv('PAGANTIS_TITLE')); |
| 368 | -======= |
|
| 368 | +=== === = |
|
| 369 | 369 | $cart = $this->context->cart; |
| 370 | 370 | $orderTotal = $cart->getOrderTotal(); |
| 371 | 371 | $link = $this->context->link; |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | $pmtSimulatorSkin = Paylater::getExtraConfig('PMT_SIMULATOR_DISPLAY_SKIN'); |
| 380 | 380 | $pmtSimulatorPosition = Paylater::getExtraConfig('PMT_SIMULATOR_DISPLAY_CSS_POSITION'); |
| 381 | 381 | $pmtTitle = $this->l(Paylater::getExtraConfig('PMT_TITLE')); |
| 382 | ->>>>>>> baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 382 | +>> >> >> > baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 383 | 383 | |
| 384 | 384 | $this->context->smarty->assign($this->getButtonTemplateVars($cart)); |
| 385 | 385 | $this->context->smarty->assign(array( |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | $paymentOption |
| 403 | 403 | ->setCallToActionText($pagantisTitle) |
| 404 | 404 | ->setAction($link->getModuleLink('pagantis', 'payment')) |
| 405 | - ->setLogo($this->getPathUri(). 'logo.gif') |
|
| 405 | + ->setLogo($this->getPathUri().'logo.gif') |
|
| 406 | 406 | ->setModuleName(__CLASS__) |
| 407 | 407 | ; |
| 408 | 408 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | 'input' => array( |
| 433 | 433 | array( |
| 434 | 434 | 'name' => 'pagantis_is_enabled', |
| 435 | - 'type' => (version_compare(_PS_VERSION_, '1.6')<0) ?'radio' :'switch', |
|
| 435 | + 'type' => (version_compare(_PS_VERSION_, '1.6') < 0) ? 'radio' : 'switch', |
|
| 436 | 436 | 'label' => $this->l('Module is enabled'), |
| 437 | 437 | 'prefix' => '<i class="icon icon-key"></i>', |
| 438 | 438 | 'class' => 't', |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | ), |
| 473 | 473 | array( |
| 474 | 474 | 'name' => 'pagantis_simulator_is_enabled', |
| 475 | - 'type' => (version_compare(_PS_VERSION_, '1.6')<0) ?'radio' :'switch', |
|
| 475 | + 'type' => (version_compare(_PS_VERSION_, '1.6') < 0) ? 'radio' : 'switch', |
|
| 476 | 476 | 'label' => $this->l('Simulator is enabled'), |
| 477 | 477 | 'prefix' => '<i class="icon icon-key"></i>', |
| 478 | 478 | 'class' => 't', |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | $message = $this->displayError($error); |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | - $logo = $this->getPathUri(). 'views/img/logo_pagantis.png'; |
|
| 591 | + $logo = $this->getPathUri().'views/img/logo_pagantis.png'; |
|
| 592 | 592 | $tpl = $this->local_path.'views/templates/admin/config-info.tpl'; |
| 593 | 593 | $this->context->smarty->assign(array( |
| 594 | 594 | 'logo' => $logo, |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | /** @var Cart $cart */ |
| 617 | -<<<<<<< HEAD:pagantis.php |
|
| 617 | +<< << << < HEAD:pagantis.php |
|
| 618 | 618 | $cart = $params['cart']; |
| 619 | 619 | $orderTotal = $cart->getOrderTotal(); |
| 620 | 620 | $link = $this->context->link; |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | $pagantisSimulatorSkin = getenv('PAGANTIS_SIMULATOR_DISPLAY_SKIN'); |
| 629 | 629 | $pagantisSimulatorPosition = getenv('PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'); |
| 630 | 630 | $pagantisTitle = $this->l(getenv('PAGANTIS_TITLE')); |
| 631 | -======= |
|
| 631 | +=== === = |
|
| 632 | 632 | $cart = $params['cart']; |
| 633 | 633 | $orderTotal = $cart->getOrderTotal(); |
| 634 | 634 | $link = $this->context->link; |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | $pmtSimulatorSkin = Paylater::getExtraConfig('PMT_SIMULATOR_DISPLAY_SKIN'); |
| 643 | 643 | $pmtSimulatorPosition = Paylater::getExtraConfig('PMT_SIMULATOR_DISPLAY_CSS_POSITION'); |
| 644 | 644 | $pmtTitle = $this->l(Paylater::getExtraConfig('PMT_TITLE')); |
| 645 | ->>>>>>> baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 645 | +>> >> >> > baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 646 | 646 | $this->context->smarty->assign($this->getButtonTemplateVars($cart)); |
| 647 | 647 | $this->context->smarty->assign(array( |
| 648 | 648 | 'amount' => $orderTotal, |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | */ |
| 684 | 684 | public function productPageSimulatorDisplay($functionName) |
| 685 | 685 | { |
| 686 | -<<<<<<< HEAD:pagantis.php |
|
| 686 | +<< << << < HEAD:pagantis.php |
|
| 687 | 687 | $productConfiguration = getenv('PAGANTIS_SIMULATOR_DISPLAY_POSITION'); |
| 688 | 688 | /** @var ProductCore $product */ |
| 689 | 689 | $product = new Product(Tools::getValue('id_product')); |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | $pagantisSimulatorSkin = getenv('PAGANTIS_SIMULATOR_DISPLAY_SKIN'); |
| 700 | 700 | $pagantisSimulatorPosition = getenv('PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'); |
| 701 | 701 | $pagantisDisplayMinAmount = getenv('PAGANTIS_DISPLAY_MIN_AMOUNT'); |
| 702 | -======= |
|
| 702 | +=== === = |
|
| 703 | 703 | $productConfiguration = Paylater::getExtraConfig('PMT_SIMULATOR_DISPLAY_POSITION'); |
| 704 | 704 | /** @var ProductCore $product */ |
| 705 | 705 | $product = new Product(Tools::getValue('id_product')); |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | $pmtSimulatorSkin = Paylater::getExtraConfig('PMT_SIMULATOR_DISPLAY_SKIN'); |
| 716 | 716 | $pmtSimulatorPosition = Paylater::getExtraConfig('PMT_SIMULATOR_DISPLAY_CSS_POSITION'); |
| 717 | 717 | $pmtDisplayMinAmount = Paylater::getExtraConfig('PMT_DISPLAY_MIN_AMOUNT'); |
| 718 | ->>>>>>> baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 718 | +>> >> >> > baa9ffd6dc8be8aa8739e095731c2af1e9011fdf:paylater.php |
|
| 719 | 719 | |
| 720 | 720 | if ($functionName != $productConfiguration || |
| 721 | 721 | $amount <= 0 || |
@@ -814,10 +814,10 @@ discard block |
||
| 814 | 814 | */ |
| 815 | 815 | public function checkLogoExists() |
| 816 | 816 | { |
| 817 | - $logo = _PS_MODULE_DIR_ . '/onepagecheckoutps/views/img/payments/'. Tools::strtolower(__CLASS__). '.png'; |
|
| 818 | - if (!file_exists($logo) && is_dir(_PS_MODULE_DIR_ . '/onepagecheckoutps/views/img/payments')) { |
|
| 817 | + $logo = _PS_MODULE_DIR_.'/onepagecheckoutps/views/img/payments/'.Tools::strtolower(__CLASS__).'.png'; |
|
| 818 | + if (!file_exists($logo) && is_dir(_PS_MODULE_DIR_.'/onepagecheckoutps/views/img/payments')) { |
|
| 819 | 819 | copy( |
| 820 | - _PS_PAYLATER_DIR . '/views/img/logo-64x64.png', |
|
| 820 | + _PS_PAYLATER_DIR.'/views/img/logo-64x64.png', |
|
| 821 | 821 | $logo |
| 822 | 822 | ); |
| 823 | 823 | } |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | return ''; |
| 830 | 830 | } |
| 831 | 831 | |
| 832 | - $sql = 'SELECT value FROM '._DB_PREFIX_.'pmt_config where config = \'' . pSQL($config) . '\' limit 1'; |
|
| 832 | + $sql = 'SELECT value FROM '._DB_PREFIX_.'pmt_config where config = \''.pSQL($config).'\' limit 1'; |
|
| 833 | 833 | if ($results = Db::getInstance()->ExecuteS($sql)) { |
| 834 | 834 | if (is_array($results) && count($results) === 1 && isset($results[0]['value'])) { |
| 835 | 835 | return $results[0]['value']; |
@@ -18,12 +18,12 @@ discard block |
||
| 18 | 18 | public function initContent() |
| 19 | 19 | { |
| 20 | 20 | $this->authorize(); |
| 21 | - $method = Tools::strtolower($_SERVER['REQUEST_METHOD']) . "Method"; |
|
| 21 | + $method = Tools::strtolower($_SERVER['REQUEST_METHOD'])."Method"; |
|
| 22 | 22 | if (method_exists($this, $method)) { |
| 23 | 23 | header('HTTP/1.1 200 Ok', true, 200); |
| 24 | 24 | header('Content-Type: application/json', true); |
| 25 | 25 | $result = json_encode($this->{$method}()); |
| 26 | - header('Content-Length: ' . Tools::strlen($result)); |
|
| 26 | + header('Content-Length: '.Tools::strlen($result)); |
|
| 27 | 27 | echo $result; |
| 28 | 28 | exit(); |
| 29 | 29 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function getExtraConfigs() |
| 40 | 40 | { |
| 41 | - $sql_content = 'select * from ' . _DB_PREFIX_. 'pagantis_config'; |
|
| 41 | + $sql_content = 'select * from '._DB_PREFIX_.'pagantis_config'; |
|
| 42 | 42 | $dbConfigs = Db::getInstance()->executeS($sql_content); |
| 43 | 43 | |
| 44 | 44 | $simpleDbConfigs = array(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | Db::getInstance()->update( |
| 68 | 68 | 'pagantis_config', |
| 69 | 69 | array('value' => pSQL($value)), |
| 70 | - 'config = \''. pSQL($config) .'\'' |
|
| 70 | + 'config = \''.pSQL($config).'\'' |
|
| 71 | 71 | ); |
| 72 | 72 | } else { |
| 73 | 73 | $errors[$config] = $value; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function getMethod() |
| 93 | 93 | { |
| 94 | - $sql_content = 'select * from ' . _DB_PREFIX_. 'pagantis_config'; |
|
| 94 | + $sql_content = 'select * from '._DB_PREFIX_.'pagantis_config'; |
|
| 95 | 95 | $dbConfigs = Db::getInstance()->executeS($sql_content); |
| 96 | 96 | |
| 97 | 97 | $simpleDbConfigs = array(); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | private function getPagantisOrderId() |
| 197 | 197 | { |
| 198 | 198 | try { |
| 199 | - $this->pagantisOrderId= Db::getInstance()->getValue( |
|
| 199 | + $this->pagantisOrderId = Db::getInstance()->getValue( |
|
| 200 | 200 | 'select order_id from '._DB_PREFIX_.'pagantis_order where id = '.$this->merchantOrderId |
| 201 | 201 | ); |
| 202 | 202 | |
@@ -278,8 +278,8 @@ discard block |
||
| 278 | 278 | Configuration::get('PS_OS_PAYMENT'), |
| 279 | 279 | $this->merchantOrder->getOrderTotal(true), |
| 280 | 280 | $this->module->displayName, |
| 281 | - 'pagantisOrderId: ' . $this->pagantisOrder->getId(). |
|
| 282 | - 'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(), |
|
| 281 | + 'pagantisOrderId: '.$this->pagantisOrder->getId(). |
|
| 282 | + 'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(), |
|
| 283 | 283 | array('transaction_id' => $this->pagantisOrderId), |
| 284 | 284 | null, |
| 285 | 285 | false, |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | protected function unblockConcurrency() |
| 339 | 339 | { |
| 340 | 340 | try { |
| 341 | - Db::getInstance()->delete('pagantis_cart_process', 'timestamp < ' . (time() - 6)); |
|
| 341 | + Db::getInstance()->delete('pagantis_cart_process', 'timestamp < '.(time() - 6)); |
|
| 342 | 342 | } catch (\Exception $exception) { |
| 343 | 343 | throw new ConcurrencyException(); |
| 344 | 344 | } |
@@ -356,15 +356,15 @@ discard block |
||
| 356 | 356 | { |
| 357 | 357 | if ($this->merchantOrder && $this->processError === true) { |
| 358 | 358 | sleep(5); |
| 359 | - $id = (!is_null($this->pagantisOrder))?$this->pagantisOrder->getId():null; |
|
| 360 | - $status = (!is_null($this->pagantisOrder))?$this->pagantisOrder->getStatus():null; |
|
| 359 | + $id = (!is_null($this->pagantisOrder)) ? $this->pagantisOrder->getId() : null; |
|
| 360 | + $status = (!is_null($this->pagantisOrder)) ? $this->pagantisOrder->getStatus() : null; |
|
| 361 | 361 | $this->module->validateOrder( |
| 362 | 362 | $this->merchantOrderId, |
| 363 | 363 | Configuration::get('PS_OS_ERROR'), |
| 364 | 364 | $this->merchantOrder->getOrderTotal(true), |
| 365 | 365 | $this->module->displayName, |
| 366 | - ' pagantisOrderId: ' . $id. |
|
| 367 | - ' pagantisOrderStatus: '. $status, |
|
| 366 | + ' pagantisOrderId: '.$id. |
|
| 367 | + ' pagantisOrderStatus: '.$status, |
|
| 368 | 368 | null, |
| 369 | 369 | null, |
| 370 | 370 | false, |
@@ -400,9 +400,9 @@ discard block |
||
| 400 | 400 | 'id_cart' => $this->merchantOrderId, |
| 401 | 401 | 'key' => $this->config['secureKey'], |
| 402 | 402 | 'id_module' => $this->module->id, |
| 403 | - 'id_order' => ($this->pagantisOrder)?$this->pagantisOrder->getId(): null, |
|
| 403 | + 'id_order' => ($this->pagantisOrder) ? $this->pagantisOrder->getId() : null, |
|
| 404 | 404 | ); |
| 405 | - $url = ($error)? $this->config['urlKO'] : $this->config['urlOK']; |
|
| 405 | + $url = ($error) ? $this->config['urlKO'] : $this->config['urlOK']; |
|
| 406 | 406 | return $this->redirect($url, $parameters); |
| 407 | 407 | } |
| 408 | 408 | } |