@@ -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'; |
@@ -360,9 +360,9 @@ |
||
| 360 | 360 | $magentoVersion = $this->productMetadataInterface->getVersion(); |
| 361 | 361 | $moduleInfo = $this->moduleList->getOne('Pagantis_Pagantis'); |
| 362 | 362 | return array( 'magento' => $magentoVersion, |
| 363 | - 'pagantis' => $moduleInfo['setup_version'], |
|
| 364 | - 'php' => phpversion(), |
|
| 365 | - 'curl' => $curlVersion); |
|
| 363 | + 'pagantis' => $moduleInfo['setup_version'], |
|
| 364 | + 'php' => phpversion(), |
|
| 365 | + 'curl' => $curlVersion); |
|
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | /** |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | $customer = $quote->getCustomer(); |
| 108 | 108 | $shippingAddress = $quote->getShippingAddress(); |
| 109 | 109 | |
| 110 | - if (isset($params['email']) && $params['email']!='') { |
|
| 110 | + if (isset($params['email']) && $params['email'] != '') { |
|
| 111 | 111 | $this->session->setEmail($params['email']); //Get guest email after refresh page |
| 112 | 112 | $customer->setEmail($params['email']); |
| 113 | 113 | $quote->setCheckoutMethod('guest'); |
| 114 | 114 | $quote->getBillingAddress()->setEmail($params['email']); |
| 115 | - } elseif ($customer->getEmail()=='') { |
|
| 115 | + } elseif ($customer->getEmail() == '') { |
|
| 116 | 116 | $customer->setEmail($this->session->getEmail()); |
| 117 | 117 | $quote->setCheckoutMethod('guest'); |
| 118 | 118 | $quote->getBillingAddress()->setEmail($this->session->getEmail()); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $currentQuote->setCustomerEmail($customer->getEmail()); |
| 124 | 124 | $this->quoteRepository->save($currentQuote); |
| 125 | 125 | |
| 126 | - $userAddress = new Address(); |
|
| 126 | + $userAddress = new Address(); |
|
| 127 | 127 | $userAddress |
| 128 | 128 | ->setZipCode($shippingAddress->getPostcode()) |
| 129 | 129 | ->setFullName($shippingAddress->getFirstname()." ".$shippingAddress->getLastname()) |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | ->setMobilePhone($shippingAddress->getTelephone()) |
| 144 | 144 | ; |
| 145 | 145 | |
| 146 | - $orderBillingAddress = new Address(); |
|
| 146 | + $orderBillingAddress = new Address(); |
|
| 147 | 147 | $billingAddress = $quote->getBillingAddress(); |
| 148 | 148 | $orderBillingAddress |
| 149 | 149 | ->setZipCode($billingAddress->getPostcode()) |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | if ($customer->getDob()) { |
| 171 | 171 | $orderUser->setDateOfBirth($customer->getDob()); |
| 172 | 172 | } |
| 173 | - if ($customer->getTaxvat()!='') { |
|
| 173 | + if ($customer->getTaxvat() != '') { |
|
| 174 | 174 | $orderUser->setDni($customer->getTaxvat()); |
| 175 | 175 | $orderBillingAddress->setDni($customer->getTaxvat()); |
| 176 | 176 | $orderShippingAddress->setDni($customer->getTaxvat()); |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | ->setUser($orderUser) |
| 251 | 251 | ; |
| 252 | 252 | |
| 253 | - if ($this->config['pagantis_public_key']=='' || $this->config['pagantis_private_key']=='') { |
|
| 253 | + if ($this->config['pagantis_public_key'] == '' || $this->config['pagantis_private_key'] == '') { |
|
| 254 | 254 | throw new \Exception('Public and Secret Key not found'); |
| 255 | 255 | } |
| 256 | 256 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | $displayMode = $this->extraConfig['PAGANTIS_FORM_DISPLAY_TYPE']; |
| 279 | - if ($displayMode==='0') { |
|
| 279 | + if ($displayMode === '0') { |
|
| 280 | 280 | echo $url; |
| 281 | 281 | exit; |
| 282 | 282 | } else { |
@@ -298,11 +298,11 @@ discard block |
||
| 298 | 298 | private function getOrders($customerId) |
| 299 | 299 | { |
| 300 | 300 | $orderCollection = array(); |
| 301 | - if ($customerId!='') { |
|
| 301 | + if ($customerId != '') { |
|
| 302 | 302 | $this->orderCollection->addAttributeToFilter('customer_id', $customerId) |
| 303 | 303 | ->addAttributeToFilter( |
| 304 | 304 | 'status', |
| 305 | - ['in' => ['processing','pending','complete']] |
|
| 305 | + ['in' => ['processing', 'pending', 'complete']] |
|
| 306 | 306 | ) |
| 307 | 307 | ->load(); |
| 308 | 308 | $orderCollection = $this->orderCollection->getData(); |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
| 346 | 346 | return $dbConnection->insertOnDuplicate( |
| 347 | 347 | $tableName, |
| 348 | - array('id'=>$quoteId,'order_id'=>$pagantisOrderId), |
|
| 348 | + array('id'=>$quoteId, 'order_id'=>$pagantisOrderId), |
|
| 349 | 349 | array('order_id') |
| 350 | 350 | ); |
| 351 | 351 | } |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | $curlVersion = $curlInfo['version']; |
| 360 | 360 | $magentoVersion = $this->productMetadataInterface->getVersion(); |
| 361 | 361 | $moduleInfo = $this->moduleList->getOne('Pagantis_Pagantis'); |
| 362 | - return array( 'magento' => $magentoVersion, |
|
| 362 | + return array('magento' => $magentoVersion, |
|
| 363 | 363 | 'pagantis' => $moduleInfo['setup_version'], |
| 364 | 364 | 'php' => phpversion(), |
| 365 | 365 | 'curl' => $curlVersion); |