@@ -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 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | ); |
| 62 | 62 | foreach ($newConfigs as $config => $value) { |
| 63 | 63 | $setup->getConnection() |
| 64 | - ->insert($prefixedTableName, array('config' => $config, 'value' => $value)); |
|
| 64 | + ->insert($prefixedTableName, array('config' => $config, 'value' => $value)); |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
@@ -72,14 +72,14 @@ discard block |
||
| 72 | 72 | ); |
| 73 | 73 | foreach ($newConfigs as $config => $value) { |
| 74 | 74 | $setup->getConnection() |
| 75 | - ->insert($prefixedTableName, array('config' => $config, 'value' => $value)); |
|
| 75 | + ->insert($prefixedTableName, array('config' => $config, 'value' => $value)); |
|
| 76 | 76 | } |
| 77 | 77 | $setup->getConnection() |
| 78 | - ->update( |
|
| 79 | - $prefixedTableName, |
|
| 80 | - array('value' => 'sdk.simulator.types.PRODUCT_PAGE'), |
|
| 81 | - "config='PAGANTIS_SIMULATOR_DISPLAY_TYPE'" |
|
| 82 | - ); |
|
| 78 | + ->update( |
|
| 79 | + $prefixedTableName, |
|
| 80 | + array('value' => 'sdk.simulator.types.PRODUCT_PAGE'), |
|
| 81 | + "config='PAGANTIS_SIMULATOR_DISPLAY_TYPE'" |
|
| 82 | + ); |
|
| 83 | 83 | |
| 84 | 84 | } |
| 85 | 85 | |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | ); |
| 94 | 94 | foreach ($newConfigs as $config => $value) { |
| 95 | 95 | $setup->getConnection() |
| 96 | - ->insert($prefixedTableName, array('config' => $config, 'value' => $value)); |
|
| 96 | + ->insert($prefixedTableName, array('config' => $config, 'value' => $value)); |
|
| 97 | 97 | } |
| 98 | 98 | $setup->getConnection() |
| 99 | - ->update( |
|
| 100 | - $prefixedTableName, |
|
| 101 | - array('value' => 'Instant financing'), |
|
| 102 | - "config='PAGANTIS_TITLE'" |
|
| 103 | - ); |
|
| 99 | + ->update( |
|
| 100 | + $prefixedTableName, |
|
| 101 | + array('value' => 'Instant financing'), |
|
| 102 | + "config='PAGANTIS_TITLE'" |
|
| 103 | + ); |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); |
@@ -16,28 +16,28 @@ discard block |
||
| 16 | 16 | * @var array $defaultConfigs |
| 17 | 17 | */ |
| 18 | 18 | public $defaultConfigs = array( |
| 19 | - 'PAGANTIS_TITLE'=>'Instant financing', |
|
| 20 | - 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'sdk.simulator.types.PRODUCT_PAGE', |
|
| 21 | - 'PAGANTIS_SIMULATOR_DISPLAY_TYPE_CHECKOUT'=>'sdk.simulator.types.CHECKOUT_PAGE', |
|
| 22 | - 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'sdk.simulator.skins.BLUE', |
|
| 23 | - 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
| 24 | - 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
| 25 | - 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
| 26 | - 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
| 27 | - 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'sdk.simulator.positions.INNER', |
|
| 28 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
| 29 | - 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
| 30 | - 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
| 31 | - 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
| 32 | - 'PAGANTIS_DISPLAY_MAX_AMOUNT'=>0, |
|
| 33 | - 'PAGANTIS_URL_OK'=>'', |
|
| 34 | - 'PAGANTIS_URL_KO'=>'', |
|
| 35 | - 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!', |
|
| 36 | - 'PAGANTIS_ALLOWED_COUNTRIES' => 'a:3:{i:0;s:2:"es";i:1;s:2:"it";i:2;s:2:"fr";}', |
|
| 37 | - 'PAGANTIS_PROMOTION_EXTRA' => '<p class="promoted">Finance this product <span class="pg-no-interest">without interest!</span></p>', |
|
| 38 | - 'PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR' => '.', |
|
| 39 | - 'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ',', |
|
| 40 | - 'PAGANTIS_SIMULATOR_DISPLAY_SITUATION' => '', |
|
| 19 | + 'PAGANTIS_TITLE'=>'Instant financing', |
|
| 20 | + 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'sdk.simulator.types.PRODUCT_PAGE', |
|
| 21 | + 'PAGANTIS_SIMULATOR_DISPLAY_TYPE_CHECKOUT'=>'sdk.simulator.types.CHECKOUT_PAGE', |
|
| 22 | + 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'sdk.simulator.skins.BLUE', |
|
| 23 | + 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
| 24 | + 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
| 25 | + 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
| 26 | + 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
| 27 | + 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'sdk.simulator.positions.INNER', |
|
| 28 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
| 29 | + 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
| 30 | + 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
| 31 | + 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
| 32 | + 'PAGANTIS_DISPLAY_MAX_AMOUNT'=>0, |
|
| 33 | + 'PAGANTIS_URL_OK'=>'', |
|
| 34 | + 'PAGANTIS_URL_KO'=>'', |
|
| 35 | + 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!', |
|
| 36 | + 'PAGANTIS_ALLOWED_COUNTRIES' => 'a:3:{i:0;s:2:"es";i:1;s:2:"it";i:2;s:2:"fr";}', |
|
| 37 | + 'PAGANTIS_PROMOTION_EXTRA' => '<p class="promoted">Finance this product <span class="pg-no-interest">without interest!</span></p>', |
|
| 38 | + 'PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR' => '.', |
|
| 39 | + 'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ',', |
|
| 40 | + 'PAGANTIS_SIMULATOR_DISPLAY_SITUATION' => '', |
|
| 41 | 41 | //4x |
| 42 | 42 | 'PAGANTIS_DISPLAY_MIN_AMOUNT_4x'=>0, |
| 43 | 43 | 'PAGANTIS_DISPLAY_MAX_AMOUNT_4x'=>800, |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | if ($setup->tableExists($prefixedTableName)) { |
| 55 | 55 | foreach ($this->defaultConfigs as $config => $value) { |
| 56 | 56 | $setup->getConnection() |
| 57 | - ->insert(self::CONFIG_TABLE, array('config' => $config, 'value' => $value)); |
|
| 57 | + ->insert(self::CONFIG_TABLE, array('config' => $config, 'value' => $value)); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -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 { |
@@ -589,11 +589,11 @@ discard block |
||
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | $this->magentoOrder->addStatusHistoryComment($metadataInfo) |
| 592 | - ->setIsCustomerNotified(false) |
|
| 593 | - ->setEntityName('order') |
|
| 594 | - ->setTitle($this->getProduct()) |
|
| 595 | - ->setPayment($this->getProduct()) |
|
| 596 | - ->save(); |
|
| 592 | + ->setIsCustomerNotified(false) |
|
| 593 | + ->setEntityName('order') |
|
| 594 | + ->setTitle($this->getProduct()) |
|
| 595 | + ->setPayment($this->getProduct()) |
|
| 596 | + ->save(); |
|
| 597 | 597 | |
| 598 | 598 | $comment = sprintf( |
| 599 | 599 | 'pagantisOrderId: %s || pagantisOrderStatus: %s || via: %s || product: %s', |
@@ -604,9 +604,9 @@ discard block |
||
| 604 | 604 | ); |
| 605 | 605 | |
| 606 | 606 | $this->magentoOrder->addStatusHistoryComment($comment) |
| 607 | - ->setIsCustomerNotified(false) |
|
| 608 | - ->setEntityName('order') |
|
| 609 | - ->save(); |
|
| 607 | + ->setIsCustomerNotified(false) |
|
| 608 | + ->setEntityName('order') |
|
| 609 | + ->save(); |
|
| 610 | 610 | |
| 611 | 611 | if ($this->magentoOrderId == '') { |
| 612 | 612 | throw new UnknownException('Order can not be saved'); |
@@ -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'; |
@@ -607,9 +607,9 @@ discard block |
||
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | $this->magentoOrder->addStatusHistoryComment($metadataInfo) |
| 610 | - ->setIsCustomerNotified(false) |
|
| 611 | - ->setEntityName('order') |
|
| 612 | - ->save(); |
|
| 610 | + ->setIsCustomerNotified(false) |
|
| 611 | + ->setEntityName('order') |
|
| 612 | + ->save(); |
|
| 613 | 613 | |
| 614 | 614 | $comment = sprintf( |
| 615 | 615 | 'pagantisOrderId: %s || pagantisOrderStatus: %s || via: %s || product: %s', |
@@ -620,9 +620,9 @@ discard block |
||
| 620 | 620 | ); |
| 621 | 621 | |
| 622 | 622 | $this->magentoOrder->addStatusHistoryComment($comment) |
| 623 | - ->setIsCustomerNotified(false) |
|
| 624 | - ->setEntityName('order') |
|
| 625 | - ->save(); |
|
| 623 | + ->setIsCustomerNotified(false) |
|
| 624 | + ->setEntityName('order') |
|
| 625 | + ->save(); |
|
| 626 | 626 | |
| 627 | 627 | if ($this->magentoOrderId == '') { |
| 628 | 628 | throw new UnknownException('Order can not be saved'); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $this->checkoutSession = $checkoutSession; |
| 155 | 155 | $this->_request = $request; |
| 156 | 156 | $this->origin = ( |
| 157 | - $this->_request->isPost() || $this->_request->getParam('origin')=='notification' |
|
| 157 | + $this->_request->isPost() || $this->_request->getParam('origin') == 'notification' |
|
| 158 | 158 | ) ? 'Notification' : 'Order'; |
| 159 | 159 | $this->product = $this->_request->getParam('product'); |
| 160 | 160 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | private function getPagantisOrder() |
| 310 | 310 | { |
| 311 | 311 | try { |
| 312 | - if ($this->getProduct()===ConfigProvider::CODE4X) { |
|
| 312 | + if ($this->getProduct() === ConfigProvider::CODE4X) { |
|
| 313 | 313 | $this->orderClient = new Client( |
| 314 | 314 | $this->config['pagantis_public_key_4x'], |
| 315 | 315 | $this->config['pagantis_private_key_4x'] |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | $this->checkPagantisStatus(array('AUTHORIZED')); |
| 337 | 337 | } catch (\Exception $e) { |
| 338 | 338 | $this->getMagentoOrderId(); |
| 339 | - if ($this->magentoOrderId!='') { |
|
| 339 | + if ($this->magentoOrderId != '') { |
|
| 340 | 340 | throw new AlreadyProcessedException(); |
| 341 | 341 | } else { |
| 342 | 342 | throw new WrongStatusException($this->pagantisOrder->getStatus()); |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | */ |
| 350 | 350 | private function checkMerchantOrderStatus() |
| 351 | 351 | { |
| 352 | - if ($this->quote->getIsActive()=='0') { |
|
| 352 | + if ($this->quote->getIsActive() == '0') { |
|
| 353 | 353 | $this->getMagentoOrderId(); |
| 354 | 354 | throw new AlreadyProcessedException(); |
| 355 | 355 | } |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | $tableName = $this->dbObject->getTableName(self::CONCURRENCY_TABLE); |
| 482 | 482 | if ($mode == false) { |
| 483 | 483 | $dbConnection->delete($tableName, "timestamp<".(time() - 5)); |
| 484 | - } elseif ($this->quoteId!='') { |
|
| 484 | + } elseif ($this->quoteId != '') { |
|
| 485 | 485 | $dbConnection->delete($tableName, "id=".$this->quoteId); |
| 486 | 486 | } |
| 487 | 487 | } catch (Exception $exception) { |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | $this->getPagantisOrderId(); |
| 521 | 521 | $this->getMagentoOrderId(); |
| 522 | 522 | |
| 523 | - $logMessage = sprintf( |
|
| 523 | + $logMessage = sprintf( |
|
| 524 | 524 | "User waiting %s seconds, default seconds %s, bd time to expire %s seconds[quoteId=%s][origin=%s]", |
| 525 | 525 | $expirationSec, |
| 526 | 526 | self::CONCURRENCY_TIMEOUT, |
@@ -572,14 +572,14 @@ discard block |
||
| 572 | 572 | $this->getPagantisOrderId(); |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | - $pagantisOrderId = $this->pagantisOrderId; |
|
| 576 | - $query = sprintf( |
|
| 575 | + $pagantisOrderId = $this->pagantisOrderId; |
|
| 576 | + $query = sprintf( |
|
| 577 | 577 | "select mg_order_id from %s where id='%s' and order_id='%s'", |
| 578 | 578 | $tableName, |
| 579 | 579 | $this->quoteId, |
| 580 | 580 | $pagantisOrderId |
| 581 | 581 | ); |
| 582 | - $queryResult = $dbConnection->fetchRow($query); |
|
| 582 | + $queryResult = $dbConnection->fetchRow($query); |
|
| 583 | 583 | $this->magentoOrderId = $queryResult['mg_order_id']; |
| 584 | 584 | } catch (\Exception $e) { |
| 585 | 585 | throw new UnknownException($e->getMessage()); |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | $metadataInfo = null; |
| 603 | 603 | foreach ($metadataOrder as $metadataKey => $metadataValue) { |
| 604 | 604 | if ($metadataKey == 'promotedProduct') { |
| 605 | - $metadataInfo.= "/Producto promocionado = $metadataValue"; |
|
| 605 | + $metadataInfo .= "/Producto promocionado = $metadataValue"; |
|
| 606 | 606 | } |
| 607 | 607 | } |
| 608 | 608 | |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
| 642 | 642 | $dbConnection = $this->dbObject->getConnection(); |
| 643 | 643 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
| 644 | - $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 644 | + $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 645 | 645 | $dbConnection->update( |
| 646 | 646 | $tableName, |
| 647 | 647 | array('mg_order_id' => $this->magentoOrderId), |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | $this->getMagentoOrderId(); |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | - if ($this->magentoOrderId!='') { |
|
| 719 | + if ($this->magentoOrderId != '') { |
|
| 720 | 720 | /** @var Order $this->magentoOrder */ |
| 721 | 721 | $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId); |
| 722 | 722 | if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) { |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | $orderStatus = strtolower($this->magentoOrder->getStatus()); |
| 742 | 742 | $acceptedStatus = array('processing', 'completed'); |
| 743 | 743 | if (in_array($orderStatus, $acceptedStatus)) { |
| 744 | - if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL']!= '') { |
|
| 744 | + if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') { |
|
| 745 | 745 | $returnUrl = $this->extraConfig['PAGANTIS_OK_URL']; |
| 746 | 746 | } else { |
| 747 | 747 | $returnUrl = 'checkout/onepage/success'; |