@@ -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']; |
@@ -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']; |
@@ -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 | } |
@@ -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(); |
@@ -150,16 +150,16 @@ discard block |
||
150 | 150 | $faker = Factory::create(); |
151 | 151 | $this->configuration['dni'] = $this->getDNI(); |
152 | 152 | $this->configuration['birthdate'] = |
153 | - $faker->numberBetween(1, 28) . '/' . |
|
154 | - $faker->numberBetween(1, 12). '/1975' |
|
153 | + $faker->numberBetween(1, 28).'/'. |
|
154 | + $faker->numberBetween(1, 12).'/1975' |
|
155 | 155 | ; |
156 | 156 | $this->configuration['firstname'] = $faker->firstName; |
157 | - $this->configuration['lastname'] = $faker->lastName . ' ' . $faker->lastName; |
|
157 | + $this->configuration['lastname'] = $faker->lastName.' '.$faker->lastName; |
|
158 | 158 | $this->configuration['company'] = $faker->company; |
159 | 159 | $this->configuration['zip'] = '28'.$faker->randomNumber(3, true); |
160 | 160 | $this->configuration['street'] = $faker->streetAddress; |
161 | - $this->configuration['phone'] = '6' . $faker->randomNumber(8); |
|
162 | - $this->configuration['email'] = date('ymd') . '@pagantis.com'; |
|
161 | + $this->configuration['phone'] = '6'.$faker->randomNumber(8); |
|
162 | + $this->configuration['email'] = date('ymd').'@pagantis.com'; |
|
163 | 163 | |
164 | 164 | if (!isset($_SERVER['argv']) || |
165 | 165 | !isset($_SERVER['argv'][4]) || |
@@ -183,12 +183,12 @@ discard block |
||
183 | 183 | */ |
184 | 184 | protected function getDNI() |
185 | 185 | { |
186 | - $dni = '0000' . rand(pow(10, 4-1), pow(10, 4)-1); |
|
186 | + $dni = '0000'.rand(pow(10, 4 - 1), pow(10, 4) - 1); |
|
187 | 187 | $value = (int) ($dni / 23); |
188 | 188 | $value *= 23; |
189 | - $value= $dni - $value; |
|
190 | - $letter= "TRWAGMYFPDXBNJZSQVHLCKEO"; |
|
191 | - $dniLetter= substr($letter, $value, 1); |
|
189 | + $value = $dni - $value; |
|
190 | + $letter = "TRWAGMYFPDXBNJZSQVHLCKEO"; |
|
191 | + $dniLetter = substr($letter, $value, 1); |
|
192 | 192 | return $dni.$dniLetter; |
193 | 193 | } |
194 | 194 |
@@ -16,7 +16,7 @@ discard block |
||
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(); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $availableCountry = (in_array(strtolower($locale), $allowedCountries)); |
28 | 28 | if (!isset($config['pagantis_public_key']) || $config['pagantis_public_key'] == '' || |
29 | 29 | !isset($config['pagantis_private_key']) || $config['pagantis_private_key'] == '' || |
30 | - !$availableCountry ) { |
|
30 | + !$availableCountry) { |
|
31 | 31 | $checkResult->setData('is_available', false); |
32 | 32 | } else { |
33 | 33 | $checkResult->setData('is_available', true); |