@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | */ |
306 | 306 | public function getFinalPrice4x() |
307 | 307 | { |
308 | - return number_format($this->getProduct()->getFinalPrice()/4, 2); |
|
308 | + return number_format($this->getProduct()->getFinalPrice() / 4, 2); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | $minAmount = $this->getMinAmount(); |
543 | 543 | $totalPrice = (string) floor($this->getFinalPrice()); |
544 | 544 | |
545 | - return ($totalPrice>=$minAmount && ($totalPrice<=$maxAmount||$maxAmount=='0')); |
|
545 | + return ($totalPrice >= $minAmount && ($totalPrice <= $maxAmount || $maxAmount == '0')); |
|
546 | 546 | } |
547 | 547 | |
548 | 548 | /** |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $minAmount = $this->getMinAmount4x(); |
555 | 555 | $totalPrice = (string) floor($this->getFinalPrice()); |
556 | 556 | |
557 | - return ($totalPrice>=$minAmount && ($totalPrice<=$maxAmount||$maxAmount=='0')); |
|
557 | + return ($totalPrice >= $minAmount && ($totalPrice <= $maxAmount || $maxAmount == '0')); |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | /** |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | public function execute(\Magento\Framework\Event\Observer $observer) |
18 | 18 | { |
19 | 19 | try { |
20 | - if ($observer->getEvent()->getMethodInstance()->getCode()==ConfigProvider::CODE) { |
|
20 | + if ($observer->getEvent()->getMethodInstance()->getCode() == ConfigProvider::CODE) { |
|
21 | 21 | $checkResult = $observer->getEvent()->getResult(); |
22 | 22 | $totalPrice = (string) floor($observer->getEvent()->getQuote()->getGrandTotal()); |
23 | 23 | $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | $availableCountry = (in_array(strtolower($locale), $allowedCountries)); |
30 | 30 | $maxAmount = $extraConfig['PAGANTIS_DISPLAY_MAX_AMOUNT']; |
31 | 31 | $minAmount = $extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT']; |
32 | - $validAmount = ($totalPrice>=$minAmount && ($totalPrice<=$maxAmount||$maxAmount=='0')); |
|
32 | + $validAmount = ($totalPrice >= $minAmount && ($totalPrice <= $maxAmount || $maxAmount == '0')); |
|
33 | 33 | $disabledPg = (!isset($config['pagantis_public_key']) || $config['pagantis_public_key'] == '' || |
34 | 34 | !isset($config['pagantis_private_key']) || $config['pagantis_private_key'] == '' || |
35 | - !$availableCountry || !$validAmount || $config['active_12x']!=='1' |
|
36 | - || $config['active']!=='1' ); |
|
35 | + !$availableCountry || !$validAmount || $config['active_12x'] !== '1' |
|
36 | + || $config['active'] !== '1'); |
|
37 | 37 | if ($disabledPg) { |
38 | 38 | $checkResult->setData('is_available', false); |
39 | 39 | } else { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | - if ($observer->getEvent()->getMethodInstance()->getCode()==ConfigProvider::CODE4X) { |
|
44 | + if ($observer->getEvent()->getMethodInstance()->getCode() == ConfigProvider::CODE4X) { |
|
45 | 45 | $checkResult = $observer->getEvent()->getResult(); |
46 | 46 | $totalPrice = (string) floor($observer->getEvent()->getQuote()->getGrandTotal()); |
47 | 47 | $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | $availableCountry = (in_array(strtolower($locale), $allowedCountries)); |
54 | 54 | $maxAmount = $extraConfig['PAGANTIS_DISPLAY_MAX_AMOUNT_4x']; |
55 | 55 | $minAmount = $extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT_4x']; |
56 | - $validAmount = ($totalPrice>=$minAmount && ($totalPrice<=$maxAmount||$maxAmount=='0')); |
|
57 | - $disabledPg4x = (!isset($config['pagantis_public_key_4x']) || $config['pagantis_public_key_4x']=='' || |
|
58 | - !isset($config['pagantis_private_key_4x']) || $config['pagantis_private_key_4x']=='' || |
|
59 | - !$availableCountry || !$validAmount || $config['active_4x']!=='1' |
|
60 | - || $config['active']!=='1' ); |
|
56 | + $validAmount = ($totalPrice >= $minAmount && ($totalPrice <= $maxAmount || $maxAmount == '0')); |
|
57 | + $disabledPg4x = (!isset($config['pagantis_public_key_4x']) || $config['pagantis_public_key_4x'] == '' || |
|
58 | + !isset($config['pagantis_private_key_4x']) || $config['pagantis_private_key_4x'] == '' || |
|
59 | + !$availableCountry || !$validAmount || $config['active_4x'] !== '1' |
|
60 | + || $config['active'] !== '1'); |
|
61 | 61 | if ($disabledPg4x) { |
62 | 62 | $checkResult->setData('is_available', false); |
63 | 63 | } else { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $this->checkoutSession = $checkoutSession; |
153 | 153 | $this->_request = $request; |
154 | 154 | $this->origin = ( |
155 | - $this->_request->isPost() || $this->_request->getParam('origin')=='notification' |
|
155 | + $this->_request->isPost() || $this->_request->getParam('origin') == 'notification' |
|
156 | 156 | ) ? 'Notification' : 'Order'; |
157 | 157 | $this->product = $this->_request->getParam('product'); |
158 | 158 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $this->checkPagantisStatus(array('AUTHORIZED')); |
318 | 318 | } catch (\Exception $e) { |
319 | 319 | $this->getMagentoOrderId(); |
320 | - if ($this->magentoOrderId!='') { |
|
320 | + if ($this->magentoOrderId != '') { |
|
321 | 321 | throw new AlreadyProcessedException(); |
322 | 322 | } else { |
323 | 323 | throw new WrongStatusException($this->pagantisOrder->getStatus()); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | */ |
331 | 331 | private function checkMerchantOrderStatus() |
332 | 332 | { |
333 | - if ($this->quote->getIsActive()=='0') { |
|
333 | + if ($this->quote->getIsActive() == '0') { |
|
334 | 334 | $this->getMagentoOrderId(); |
335 | 335 | throw new AlreadyProcessedException(); |
336 | 336 | } |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | $tableName = $this->dbObject->getTableName(self::CONCURRENCY_TABLE); |
463 | 463 | if ($mode == false) { |
464 | 464 | $dbConnection->delete($tableName, "timestamp<".(time() - 5)); |
465 | - } elseif ($this->quoteId!='') { |
|
465 | + } elseif ($this->quoteId != '') { |
|
466 | 466 | $dbConnection->delete($tableName, "id=".$this->quoteId); |
467 | 467 | } |
468 | 468 | } catch (Exception $exception) { |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | $this->getPagantisOrderId(); |
502 | 502 | $this->getMagentoOrderId(); |
503 | 503 | |
504 | - $logMessage = sprintf( |
|
504 | + $logMessage = sprintf( |
|
505 | 505 | "User waiting %s seconds, default seconds %s, bd time to expire %s seconds[quoteId=%s][origin=%s]", |
506 | 506 | $expirationSec, |
507 | 507 | self::CONCURRENCY_TIMEOUT, |
@@ -552,15 +552,15 @@ discard block |
||
552 | 552 | if ($this->pagantisOrderId == '') { |
553 | 553 | $this->getPagantisOrderId(); |
554 | 554 | } |
555 | - $pagantisOrderId = $this->pagantisOrderId; |
|
555 | + $pagantisOrderId = $this->pagantisOrderId; |
|
556 | 556 | |
557 | - $query = sprintf( |
|
557 | + $query = sprintf( |
|
558 | 558 | "select mg_order_id from %s where id='%s' and order_id='%s'", |
559 | 559 | $tableName, |
560 | 560 | $this->quoteId, |
561 | 561 | $pagantisOrderId |
562 | 562 | ); |
563 | - $queryResult = $dbConnection->fetchRow($query); |
|
563 | + $queryResult = $dbConnection->fetchRow($query); |
|
564 | 564 | $this->magentoOrderId = $queryResult['mg_order_id']; |
565 | 565 | } catch (\Exception $e) { |
566 | 566 | throw new UnknownException($e->getMessage()); |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | $metadataInfo = null; |
585 | 585 | foreach ($metadataOrder as $metadataKey => $metadataValue) { |
586 | 586 | if ($metadataKey == 'promotedProduct') { |
587 | - $metadataInfo.= " Producto promocionado = $metadataValue //"; |
|
587 | + $metadataInfo .= " Producto promocionado = $metadataValue //"; |
|
588 | 588 | } |
589 | 589 | } |
590 | 590 | |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
626 | 626 | $dbConnection = $this->dbObject->getConnection(); |
627 | 627 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
628 | - $pagantisOrderId = $this->pagantisOrder->getId(); |
|
628 | + $pagantisOrderId = $this->pagantisOrder->getId(); |
|
629 | 629 | $dbConnection->update( |
630 | 630 | $tableName, |
631 | 631 | array('mg_order_id' => $this->magentoOrderId), |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | $this->getMagentoOrderId(); |
702 | 702 | } |
703 | 703 | |
704 | - if ($this->magentoOrderId!='') { |
|
704 | + if ($this->magentoOrderId != '') { |
|
705 | 705 | /** @var Order $this->magentoOrder */ |
706 | 706 | $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId); |
707 | 707 | if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) { |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | $orderStatus = strtolower($this->magentoOrder->getStatus()); |
728 | 728 | $acceptedStatus = array('processing', 'completed'); |
729 | 729 | if (in_array($orderStatus, $acceptedStatus)) { |
730 | - if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL']!= '') { |
|
730 | + if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') { |
|
731 | 731 | $returnUrl = $this->extraConfig['PAGANTIS_OK_URL']; |
732 | 732 | } else { |
733 | 733 | $returnUrl = 'checkout/onepage/success'; |