@@ -166,9 +166,9 @@ |
||
| 166 | 166 | |
| 167 | 167 | $body = array('PAGANTIS_TITLE' => 'changed'); |
| 168 | 168 | $response = Request::post($configUrl) |
| 169 | - ->body($body, Mime::FORM) |
|
| 170 | - ->expectsJSON() |
|
| 171 | - ->send(); |
|
| 169 | + ->body($body, Mime::FORM) |
|
| 170 | + ->expectsJSON() |
|
| 171 | + ->send(); |
|
| 172 | 172 | $title = $response->body->PAGANTIS_TITLE; |
| 173 | 173 | $this->assertEquals('changed', $title, "PR62=>".$configUrl." = ".$title); |
| 174 | 174 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $this->assertNotEmpty($orderUrl); |
| 84 | 84 | |
| 85 | 85 | $orderArray = explode('/', $orderUrl); |
| 86 | - $magentoOrderId = (int)$orderArray['8']; |
|
| 86 | + $magentoOrderId = (int) $orderArray['8']; |
|
| 87 | 87 | $this->assertNotEmpty($magentoOrderId); |
| 88 | 88 | $notifyFile = 'index/'; |
| 89 | 89 | $quoteId = ($magentoOrderId) - 1; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $version = ''; |
| 137 | 137 | if (version_compare($this->version, '23') >= 0) { |
| 138 | - $version = "V2"; |
|
| 138 | + $version = "V2"; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $logUrl = sprintf( |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $condition = WebDriverExpectedCondition::visibilityOfElementLocated($elementSearch); |
| 78 | 78 | $this->webDriver->wait()->until($condition); |
| 79 | 79 | $otherElement = $this->findById('payment_us_other_payment_methods-head'); |
| 80 | - if ($otherElement->getAttribute('class')!='open') { |
|
| 80 | + if ($otherElement->getAttribute('class') != 'open') { |
|
| 81 | 81 | $otherElement->click(); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $this->webDriver->wait()->until($condition); |
| 87 | 87 | $this->assertTrue((bool) $condition, "PR4"); |
| 88 | 88 | $pagantisElement = $this->findById('payment_us_pagantis-head'); |
| 89 | - if ($pagantisElement->getAttribute('class')!='open') { |
|
| 89 | + if ($pagantisElement->getAttribute('class') != 'open') { |
|
| 90 | 90 | $pagantisElement->click(); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $this->webDriver->get($this->configuration['magentoUrl'].self::CHECKOUT_FOLDER); |
| 279 | 279 | $condition = WebDriverExpectedCondition::titleContains(self::CHECKOUT_TITLE); |
| 280 | 280 | $this->webDriver->wait()->until($condition); |
| 281 | - $this->assertTrue((bool)$condition, $this->configuration['magentoUrl'].self::CHECKOUT_FOLDER); |
|
| 281 | + $this->assertTrue((bool) $condition, $this->configuration['magentoUrl'].self::CHECKOUT_FOLDER); |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | /** |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $this->webDriver->wait()->until($condition); |
| 292 | 292 | $this->assertTrue((bool) $condition); |
| 293 | 293 | $this->assertSame( |
| 294 | - $this->configuration['firstname'] . ' ' . $this->configuration['lastname'], |
|
| 294 | + $this->configuration['firstname'].' '.$this->configuration['lastname'], |
|
| 295 | 295 | $this->findByClass('FieldsPreview-desc')->getText() |
| 296 | 296 | ); |
| 297 | 297 | } |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | { |
| 306 | 306 | $condition = WebDriverExpectedCondition::titleContains(self::PAGANTIS_TITLE); |
| 307 | 307 | $this->webDriver->wait(300)->until($condition, $this->webDriver->getCurrentURL()); |
| 308 | - $this->assertTrue((bool)$condition, "PR32"); |
|
| 308 | + $this->assertTrue((bool) $condition, "PR32"); |
|
| 309 | 309 | |
| 310 | 310 | SeleniumHelper::finishForm($this->webDriver); |
| 311 | 311 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * testMagentoOpen |
| 28 | - */ |
|
| 28 | + */ |
|
| 29 | 29 | public function testpagantisMg21BasicTest() |
| 30 | 30 | { |
| 31 | 31 | $this->webDriver->get($this->configuration['magentoUrl']); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public function execute(\Magento\Framework\Event\Observer $observer) |
| 17 | 17 | { |
| 18 | 18 | try { |
| 19 | - if ($observer->getEvent()->getMethodInstance()->getCode()=="pagantis") { |
|
| 19 | + if ($observer->getEvent()->getMethodInstance()->getCode() == "pagantis") { |
|
| 20 | 20 | $checkResult = $observer->getEvent()->getResult(); |
| 21 | 21 | $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); |
| 22 | 22 | $config = $objectManager->create('Pagantis\Pagantis\Helper\Config')->getConfig(); |
@@ -16,20 +16,20 @@ |
||
| 16 | 16 | * @var array $defaultConfigs |
| 17 | 17 | */ |
| 18 | 18 | public $defaultConfigs = array('PAGANTIS_TITLE'=>'Instant Financing', |
| 19 | - 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pmtSDK.simulator.types.SIMPLE', |
|
| 20 | - 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pmtSDK.simulator.skins.BLUE', |
|
| 21 | - 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
| 22 | - 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
| 23 | - 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
| 24 | - 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
| 25 | - 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pmtSDK.simulator.positions.INNER', |
|
| 26 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
| 27 | - 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
| 28 | - 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
| 29 | - 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
| 30 | - 'PAGANTIS_URL_OK'=>'', |
|
| 31 | - 'PAGANTIS_URL_KO'=>'', |
|
| 32 | - 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!' |
|
| 19 | + 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pmtSDK.simulator.types.SIMPLE', |
|
| 20 | + 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pmtSDK.simulator.skins.BLUE', |
|
| 21 | + 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
| 22 | + 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
| 23 | + 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
| 24 | + 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
| 25 | + 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pmtSDK.simulator.positions.INNER', |
|
| 26 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
| 27 | + 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
| 28 | + 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
| 29 | + 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
| 30 | + 'PAGANTIS_URL_OK'=>'', |
|
| 31 | + 'PAGANTIS_URL_KO'=>'', |
|
| 32 | + 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!' |
|
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -24,22 +24,22 @@ discard block |
||
| 24 | 24 | $installer->startSetup(); |
| 25 | 25 | |
| 26 | 26 | $table = $installer->getConnection() |
| 27 | - ->newTable($installer->getTable(self::CONFIG_TABLE)) |
|
| 28 | - ->addColumn( |
|
| 29 | - 'id', |
|
| 30 | - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, |
|
| 31 | - null, |
|
| 32 | - ['identity' => true, 'unsigned' => true, 'nullable' => |
|
| 33 | - false, 'primary' => true], |
|
| 34 | - 'Entity ID' |
|
| 35 | - ) |
|
| 36 | - ->addColumn( |
|
| 37 | - 'config', |
|
| 38 | - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, |
|
| 39 | - 60, |
|
| 40 | - ['nullable' => false], |
|
| 41 | - 'Config' |
|
| 42 | - ) |
|
| 27 | + ->newTable($installer->getTable(self::CONFIG_TABLE)) |
|
| 28 | + ->addColumn( |
|
| 29 | + 'id', |
|
| 30 | + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, |
|
| 31 | + null, |
|
| 32 | + ['identity' => true, 'unsigned' => true, 'nullable' => |
|
| 33 | + false, 'primary' => true], |
|
| 34 | + 'Entity ID' |
|
| 35 | + ) |
|
| 36 | + ->addColumn( |
|
| 37 | + 'config', |
|
| 38 | + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, |
|
| 39 | + 60, |
|
| 40 | + ['nullable' => false], |
|
| 41 | + 'Config' |
|
| 42 | + ) |
|
| 43 | 43 | ->addColumn( |
| 44 | 44 | 'value', |
| 45 | 45 | \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | ['nullable' => false], |
| 48 | 48 | 'Value' |
| 49 | 49 | ) |
| 50 | - ->setComment('Pagantis config table'); |
|
| 50 | + ->setComment('Pagantis config table'); |
|
| 51 | 51 | |
| 52 | 52 | $installer->getConnection()->createTable($table); |
| 53 | 53 | |
@@ -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"> |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $this->checkPagantisStatus(array('AUTHORIZED')); |
| 263 | 263 | } catch (\Exception $e) { |
| 264 | 264 | $this->getMagentoOrderId(); |
| 265 | - if ($this->magentoOrderId!='') { |
|
| 265 | + if ($this->magentoOrderId != '') { |
|
| 266 | 266 | throw new AlreadyProcessedException(); |
| 267 | 267 | } else { |
| 268 | 268 | throw new WrongStatusException($this->pagantisOrder->getStatus()); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | */ |
| 276 | 276 | private function checkMerchantOrderStatus() |
| 277 | 277 | { |
| 278 | - if ($this->quote->getIsActive()=='0') { |
|
| 278 | + if ($this->quote->getIsActive() == '0') { |
|
| 279 | 279 | $this->getMagentoOrderId(); |
| 280 | 280 | throw new AlreadyProcessedException(); |
| 281 | 281 | } |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | $tableName = $this->dbObject->getTableName(self::CONCURRENCY_TABLE); |
| 398 | 398 | if ($mode == false) { |
| 399 | 399 | $dbConnection->delete($tableName, "timestamp<".(time() - 5)); |
| 400 | - } elseif ($this->quoteId!='') { |
|
| 400 | + } elseif ($this->quoteId != '') { |
|
| 401 | 401 | $dbConnection->delete($tableName, "id=".$this->quoteId); |
| 402 | 402 | } |
| 403 | 403 | } catch (Exception $exception) { |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
| 453 | 453 | $dbConnection = $this->dbObject->getConnection(); |
| 454 | 454 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
| 455 | - $pagantisOrderId = $this->pagantisOrderId; |
|
| 455 | + $pagantisOrderId = $this->pagantisOrderId; |
|
| 456 | 456 | |
| 457 | 457 | $query = "select mg_order_id from $tableName where id='$this->quoteId' and order_id='$pagantisOrderId'"; |
| 458 | 458 | $queryResult = $dbConnection->fetchRow($query); |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
| 493 | 493 | $dbConnection = $this->dbObject->getConnection(); |
| 494 | 494 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
| 495 | - $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 495 | + $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 496 | 496 | $dbConnection->update( |
| 497 | 497 | $tableName, |
| 498 | 498 | array('mg_order_id' => $this->magentoOrderId), |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | { |
| 526 | 526 | //$returnUrl = 'checkout/#payment'; |
| 527 | 527 | $returnUrl = $this->_url->getUrl('checkout', ['_fragment' => 'payment']); |
| 528 | - if ($this->magentoOrderId!='') { |
|
| 528 | + if ($this->magentoOrderId != '') { |
|
| 529 | 529 | /** @var Order $this->magentoOrder */ |
| 530 | 530 | $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId); |
| 531 | 531 | if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) { |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | $orderStatus = strtolower($this->magentoOrder->getStatus()); |
| 543 | 543 | $acceptedStatus = array('processing', 'completed'); |
| 544 | 544 | if (in_array($orderStatus, $acceptedStatus)) { |
| 545 | - if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL']!= '') { |
|
| 545 | + if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') { |
|
| 546 | 546 | $returnUrl = $this->extraConfig['PAGANTIS_OK_URL']; |
| 547 | 547 | } else { |
| 548 | 548 | $returnUrl = 'checkout/onepage/success'; |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $this->checkPagantisStatus(array('AUTHORIZED')); |
| 266 | 266 | } catch (\Exception $e) { |
| 267 | 267 | $this->getMagentoOrderId(); |
| 268 | - if ($this->magentoOrderId!='') { |
|
| 268 | + if ($this->magentoOrderId != '') { |
|
| 269 | 269 | throw new AlreadyProcessedException(); |
| 270 | 270 | } else { |
| 271 | 271 | throw new WrongStatusException($this->pagantisOrder->getStatus()); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | */ |
| 279 | 279 | private function checkMerchantOrderStatus() |
| 280 | 280 | { |
| 281 | - if ($this->quote->getIsActive()=='0') { |
|
| 281 | + if ($this->quote->getIsActive() == '0') { |
|
| 282 | 282 | $this->getMagentoOrderId(); |
| 283 | 283 | throw new AlreadyProcessedException(); |
| 284 | 284 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | $tableName = $this->dbObject->getTableName(self::CONCURRENCY_TABLE); |
| 401 | 401 | if ($mode == false) { |
| 402 | 402 | $dbConnection->delete($tableName, "timestamp<".(time() - 5)); |
| 403 | - } elseif ($this->quoteId!='') { |
|
| 403 | + } elseif ($this->quoteId != '') { |
|
| 404 | 404 | $dbConnection->delete($tableName, "id=".$this->quoteId); |
| 405 | 405 | } |
| 406 | 406 | } catch (Exception $exception) { |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
| 456 | 456 | $dbConnection = $this->dbObject->getConnection(); |
| 457 | 457 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
| 458 | - $pagantisOrderId = $this->pagantisOrderId; |
|
| 458 | + $pagantisOrderId = $this->pagantisOrderId; |
|
| 459 | 459 | |
| 460 | 460 | $query = "select mg_order_id from $tableName where id='$this->quoteId' and order_id='$pagantisOrderId'"; |
| 461 | 461 | $queryResult = $dbConnection->fetchRow($query); |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
| 496 | 496 | $dbConnection = $this->dbObject->getConnection(); |
| 497 | 497 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
| 498 | - $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 498 | + $pagantisOrderId = $this->pagantisOrder->getId(); |
|
| 499 | 499 | $dbConnection->update( |
| 500 | 500 | $tableName, |
| 501 | 501 | array('mg_order_id' => $this->magentoOrderId), |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | { |
| 529 | 529 | //$returnUrl = 'checkout/#payment'; |
| 530 | 530 | $returnUrl = $this->_url->getUrl('checkout', ['_fragment' => 'payment']); |
| 531 | - if ($this->magentoOrderId!='') { |
|
| 531 | + if ($this->magentoOrderId != '') { |
|
| 532 | 532 | /** @var Order $this->magentoOrder */ |
| 533 | 533 | $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId); |
| 534 | 534 | if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) { |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | $orderStatus = strtolower($this->magentoOrder->getStatus()); |
| 546 | 546 | $acceptedStatus = array('processing', 'completed'); |
| 547 | 547 | if (in_array($orderStatus, $acceptedStatus)) { |
| 548 | - if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL']!= '') { |
|
| 548 | + if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') { |
|
| 549 | 549 | $returnUrl = $this->extraConfig['PAGANTIS_OK_URL']; |
| 550 | 550 | } else { |
| 551 | 551 | $returnUrl = 'checkout/onepage/success'; |