@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $this->checkPagantisStatus(array('AUTHORIZED')); |
| 292 | 292 | } catch (\Exception $e) { |
| 293 | 293 | $this->getMagentoOrderId(); |
| 294 | - if ($this->magentoOrderId!='') { |
|
| 294 | + if ($this->magentoOrderId != '') { |
|
| 295 | 295 | throw new AlreadyProcessedException(); |
| 296 | 296 | } else { |
| 297 | 297 | throw new WrongStatusException($this->pagantisOrder->getStatus()); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | private function checkMerchantOrderStatus() |
| 306 | 306 | { |
| 307 | - if ($this->quote->getIsActive()=='0') { |
|
| 307 | + if ($this->quote->getIsActive() == '0') { |
|
| 308 | 308 | $this->getMagentoOrderId(); |
| 309 | 309 | throw new AlreadyProcessedException(); |
| 310 | 310 | } |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | $tableName = $this->dbObject->getTableName(self::CONCURRENCY_TABLE); |
| 437 | 437 | if ($mode == false) { |
| 438 | 438 | $dbConnection->delete($tableName, "timestamp<".(time() - 5)); |
| 439 | - } elseif ($this->quoteId!='') { |
|
| 439 | + } elseif ($this->quoteId != '') { |
|
| 440 | 440 | $dbConnection->delete($tableName, "id=".$this->quoteId); |
| 441 | 441 | } |
| 442 | 442 | } catch (Exception $exception) { |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | sleep($expirationSec + 1); |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | - $logMessage = sprintf( |
|
| 475 | + $logMessage = sprintf( |
|
| 476 | 476 | "User waiting %s seconds, default seconds %s, bd time to expire %s seconds", |
| 477 | 477 | $expirationSec, |
| 478 | 478 | self::CONCURRENCY_TIMEOUT, |
@@ -522,14 +522,14 @@ discard block |
||
| 522 | 522 | $this->getPagantisOrderId(); |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | - $pagantisOrderId = $this->pagantisOrderId; |
|
| 526 | - $query = sprintf( |
|
| 525 | + $pagantisOrderId = $this->pagantisOrderId; |
|
| 526 | + $query = sprintf( |
|
| 527 | 527 | "select mg_order_id from %s where id='%s' and order_id='%s'", |
| 528 | 528 | $tableName, |
| 529 | 529 | $this->quoteId, |
| 530 | 530 | $pagantisOrderId |
| 531 | 531 | ); |
| 532 | - $queryResult = $dbConnection->fetchRow($query); |
|
| 532 | + $queryResult = $dbConnection->fetchRow($query); |
|
| 533 | 533 | $this->magentoOrderId = $queryResult['mg_order_id']; |
| 534 | 534 | } catch (\Exception $e) { |
| 535 | 535 | throw new UnknownException($e->getMessage()); |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | $metadataInfo = null; |
| 553 | 553 | foreach ($metadataOrder as $metadataKey => $metadataValue) { |
| 554 | 554 | if ($metadataKey == 'promotedProduct') { |
| 555 | - $metadataInfo.= "/Producto promocionado = $metadataValue"; |
|
| 555 | + $metadataInfo .= "/Producto promocionado = $metadataValue"; |
|
| 556 | 556 | } |
| 557 | 557 | } |
| 558 | 558 | |
@@ -561,9 +561,9 @@ discard block |
||
| 561 | 561 | ->setEntityName('order') |
| 562 | 562 | ->save(); |
| 563 | 563 | |
| 564 | - $comment = 'pagantisOrderId: ' . $this->pagantisOrder->getId(). ' ' . |
|
| 565 | - 'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' . |
|
| 566 | - 'via: '. $this->origin; |
|
| 564 | + $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '. |
|
| 565 | + 'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '. |
|
| 566 | + 'via: '.$this->origin; |
|
| 567 | 567 | $this->magentoOrder->addStatusHistoryComment($comment) |
| 568 | 568 | ->setIsCustomerNotified(false) |
| 569 | 569 | ->setEntityName('order') |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
| 587 | 587 | $dbConnection = $this->dbObject->getConnection(); |
| 588 | 588 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
| 589 | - $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 589 | + $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 590 | 590 | $dbConnection->update( |
| 591 | 591 | $tableName, |
| 592 | 592 | array('mg_order_id' => $this->magentoOrderId), |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | $this->getPagantisOrderId(); |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | - if ($this->magentoOrderId!='') { |
|
| 643 | + if ($this->magentoOrderId != '') { |
|
| 644 | 644 | /** @var Order $this->magentoOrder */ |
| 645 | 645 | $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId); |
| 646 | 646 | if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) { |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | $orderStatus = strtolower($this->magentoOrder->getStatus()); |
| 658 | 658 | $acceptedStatus = array('processing', 'completed'); |
| 659 | 659 | if (in_array($orderStatus, $acceptedStatus)) { |
| 660 | - if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL']!= '') { |
|
| 660 | + if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') { |
|
| 661 | 661 | $returnUrl = $this->extraConfig['PAGANTIS_OK_URL']; |
| 662 | 662 | } else { |
| 663 | 663 | $returnUrl = 'checkout/onepage/success'; |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $this->checkPagantisStatus(array('AUTHORIZED')); |
| 278 | 278 | } catch (\Exception $e) { |
| 279 | 279 | $this->getMagentoOrderId(); |
| 280 | - if ($this->magentoOrderId!='') { |
|
| 280 | + if ($this->magentoOrderId != '') { |
|
| 281 | 281 | throw new AlreadyProcessedException(); |
| 282 | 282 | } else { |
| 283 | 283 | throw new WrongStatusException($this->pagantisOrder->getStatus()); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | */ |
| 291 | 291 | private function checkMerchantOrderStatus() |
| 292 | 292 | { |
| 293 | - if ($this->quote->getIsActive()=='0') { |
|
| 293 | + if ($this->quote->getIsActive() == '0') { |
|
| 294 | 294 | $this->getMagentoOrderId(); |
| 295 | 295 | throw new AlreadyProcessedException(); |
| 296 | 296 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | $tableName = $this->dbObject->getTableName(self::CONCURRENCY_TABLE); |
| 423 | 423 | if ($mode == false) { |
| 424 | 424 | $dbConnection->delete($tableName, "timestamp<".(time() - 5)); |
| 425 | - } elseif ($this->quoteId!='') { |
|
| 425 | + } elseif ($this->quoteId != '') { |
|
| 426 | 426 | $dbConnection->delete($tableName, "id=".$this->quoteId); |
| 427 | 427 | } |
| 428 | 428 | } catch (Exception $exception) { |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | sleep($expirationSec + 1); |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | - $logMessage = sprintf( |
|
| 461 | + $logMessage = sprintf( |
|
| 462 | 462 | "User waiting %s seconds, default seconds %s, bd time to expire %s seconds", |
| 463 | 463 | $expirationSec, |
| 464 | 464 | self::CONCURRENCY_TIMEOUT, |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | if ($this->pagantisOrderId == '') { |
| 508 | 508 | $this->getPagantisOrderId(); |
| 509 | 509 | } |
| 510 | - $pagantisOrderId = $this->pagantisOrderId; |
|
| 510 | + $pagantisOrderId = $this->pagantisOrderId; |
|
| 511 | 511 | |
| 512 | 512 | $query = "select mg_order_id from $tableName where id='$this->quoteId' and order_id='$pagantisOrderId'"; |
| 513 | 513 | $queryResult = $dbConnection->fetchRow($query); |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | $metadataInfo = null; |
| 535 | 535 | foreach ($metadataOrder as $metadataKey => $metadataValue) { |
| 536 | 536 | if ($metadataKey == 'promotedProduct') { |
| 537 | - $metadataInfo.= " Producto promocionado = $metadataValue //"; |
|
| 537 | + $metadataInfo .= " Producto promocionado = $metadataValue //"; |
|
| 538 | 538 | } |
| 539 | 539 | } |
| 540 | 540 | |
@@ -543,8 +543,8 @@ discard block |
||
| 543 | 543 | ->setEntityName('order') |
| 544 | 544 | ->save(); |
| 545 | 545 | |
| 546 | - $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId(). ' ' . |
|
| 547 | - 'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(). ' ' . |
|
| 546 | + $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '. |
|
| 547 | + 'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '. |
|
| 548 | 548 | 'via: '.$this->origin; |
| 549 | 549 | $this->magentoOrder->addStatusHistoryComment($comment) |
| 550 | 550 | ->setIsCustomerNotified(false) |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
| 569 | 569 | $dbConnection = $this->dbObject->getConnection(); |
| 570 | 570 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
| 571 | - $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 571 | + $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 572 | 572 | $dbConnection->update( |
| 573 | 573 | $tableName, |
| 574 | 574 | array('mg_order_id' => $this->magentoOrderId), |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | $this->getPagantisOrderId(); |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | - if ($this->magentoOrderId!='') { |
|
| 625 | + if ($this->magentoOrderId != '') { |
|
| 626 | 626 | /** @var Order $this->magentoOrder */ |
| 627 | 627 | $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId); |
| 628 | 628 | if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) { |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | $orderStatus = strtolower($this->magentoOrder->getStatus()); |
| 640 | 640 | $acceptedStatus = array('processing', 'completed'); |
| 641 | 641 | if (in_array($orderStatus, $acceptedStatus)) { |
| 642 | - if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL']!= '') { |
|
| 642 | + if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') { |
|
| 643 | 643 | $returnUrl = $this->extraConfig['PAGANTIS_OK_URL']; |
| 644 | 644 | } else { |
| 645 | 645 | $returnUrl = 'checkout/onepage/success'; |