@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | } elseif ($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 73 | 73 | if (count($_POST)) { |
| 74 | 74 | foreach ($_POST as $config => $value) { |
| 75 | - if (isset($this->defaultConfigs[$config]) && $response['status']==null) { |
|
| 75 | + if (isset($this->defaultConfigs[$config]) && $response['status'] == null) { |
|
| 76 | 76 | $dbConnection->update( |
| 77 | 77 | $tableName, |
| 78 | 78 | array('value' => $value), |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $formattedResult = array(); |
| 93 | - if ($response['status']==null) { |
|
| 93 | + if ($response['status'] == null) { |
|
| 94 | 94 | $dbResult = $dbConnection->fetchAll("select * from $tableName"); |
| 95 | 95 | foreach ($dbResult as $value) { |
| 96 | 96 | $formattedResult[$value['config']] = $value['value']; |
@@ -26,9 +26,9 @@ |
||
| 26 | 26 | { |
| 27 | 27 | $originalData = $element->getOriginalData(); |
| 28 | 28 | $label = __($originalData['button_label']); |
| 29 | - $url = $this->escapeHtml($originalData['button_url']); |
|
| 29 | + $url = $this->escapeHtml($originalData['button_url']); |
|
| 30 | 30 | $labelCredentials = __($originalData['button_credentials_label']); |
| 31 | - $urlCredentials = $this->escapeHtml($originalData['button_credentials_url']); |
|
| 31 | + $urlCredentials = $this->escapeHtml($originalData['button_credentials_url']); |
|
| 32 | 32 | return <<<EOD |
| 33 | 33 | <div class="pp-buttons-container"> |
| 34 | 34 | <button onclick="javascript:window.open('$url')" class="scalable" type="button" id="bo_pagantis"> |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | $secretKey = $this->getRequest()->getParam('secret'); |
| 45 | 45 | $privateKey = isset($this->config['pagantis_private_key']) ? $this->config['pagantis_private_key'] : null; |
| 46 | 46 | |
| 47 | - if ($secretKey!='' && $privateKey!='') { |
|
| 47 | + if ($secretKey != '' && $privateKey != '') { |
|
| 48 | 48 | $this->checkDbLogTable(); |
| 49 | 49 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
| 50 | 50 | $dbConnection = $this->dbObject->getConnection(); |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | $secretKey = $this->getRequest()->getParam('secret'); |
| 45 | 45 | $privateKey = isset($this->config['pagantis_private_key']) ? $this->config['pagantis_private_key'] : null; |
| 46 | 46 | |
| 47 | - if ($secretKey!='' && $privateKey!='') { |
|
| 47 | + if ($secretKey != '' && $privateKey != '') { |
|
| 48 | 48 | $this->checkDbLogTable(); |
| 49 | 49 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
| 50 | 50 | $dbConnection = $this->dbObject->getConnection(); |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | foreach ($items as $key => $item) { |
| 108 | 108 | $promotedProduct = $this->isPromoted($item); |
| 109 | 109 | if ($promotedProduct == 'true') { |
| 110 | - $promotedAmount+=$item->getPrice()*$item->getQty(); |
|
| 110 | + $promotedAmount += $item->getPrice() * $item->getQty(); |
|
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | $headers = $transfer->getHeaders(); |
| 97 | 97 | |
| 98 | 98 | if (isset($headers['force_result'])) { |
| 99 | - return (int)$headers['force_result']; |
|
| 99 | + return (int) $headers['force_result']; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | return $this->results[mt_rand(0, 1)]; |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | |
| 39 | 39 | $payment->setAdditionalInformation( |
| 40 | 40 | self::FRAUD_MSG_LIST, |
| 41 | - (array)$response[self::FRAUD_MSG_LIST] |
|
| 41 | + (array) $response[self::FRAUD_MSG_LIST] |
|
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | 44 | /** @var $payment Payment */ |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | } elseif ($this->_request->isPost()) { |
| 90 | 90 | if (count($_POST)) { |
| 91 | 91 | foreach ($_POST as $config => $value) { |
| 92 | - if (isset($this->defaultConfigs[$config]) && $response['status']==null) { |
|
| 92 | + if (isset($this->defaultConfigs[$config]) && $response['status'] == null) { |
|
| 93 | 93 | $dbConnection->update( |
| 94 | 94 | $tableName, |
| 95 | 95 | array('value' => $value), |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | $formattedResult = array(); |
| 110 | - if ($response['status']==null) { |
|
| 110 | + if ($response['status'] == null) { |
|
| 111 | 111 | $dbResult = $dbConnection->fetchAll("select * from $tableName"); |
| 112 | 112 | foreach ($dbResult as $value) { |
| 113 | 113 | $formattedResult[$value['config']] = $value['value']; |
@@ -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 | |
@@ -611,9 +611,9 @@ discard block |
||
| 611 | 611 | ->setEntityName('order') |
| 612 | 612 | ->save(); |
| 613 | 613 | |
| 614 | - $comment = 'pagantisOrderId: ' . $this->pagantisOrder->getId(). ' ' . |
|
| 615 | - 'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' . |
|
| 616 | - 'via: '.$this->origin. ' ' . |
|
| 614 | + $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '. |
|
| 615 | + 'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '. |
|
| 616 | + 'via: '.$this->origin.' '. |
|
| 617 | 617 | 'product: '.$this->getProduct(); |
| 618 | 618 | |
| 619 | 619 | $this->magentoOrder->addStatusHistoryComment($comment) |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
| 639 | 639 | $dbConnection = $this->dbObject->getConnection(); |
| 640 | 640 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
| 641 | - $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 641 | + $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 642 | 642 | $dbConnection->update( |
| 643 | 643 | $tableName, |
| 644 | 644 | array('mg_order_id' => $this->magentoOrderId), |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | $this->getMagentoOrderId(); |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | - if ($this->magentoOrderId!='') { |
|
| 716 | + if ($this->magentoOrderId != '') { |
|
| 717 | 717 | /** @var Order $this->magentoOrder */ |
| 718 | 718 | $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId); |
| 719 | 719 | if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) { |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | $orderStatus = strtolower($this->magentoOrder->getStatus()); |
| 739 | 739 | $acceptedStatus = array('processing', 'completed'); |
| 740 | 740 | if (in_array($orderStatus, $acceptedStatus)) { |
| 741 | - if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL']!= '') { |
|
| 741 | + if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') { |
|
| 742 | 742 | $returnUrl = $this->extraConfig['PAGANTIS_OK_URL']; |
| 743 | 743 | } else { |
| 744 | 744 | $returnUrl = 'checkout/onepage/success'; |