@@ -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_paylater"> |
@@ -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()=="paylater") { |
|
19 | + if ($observer->getEvent()->getMethodInstance()->getCode() == "paylater") { |
|
20 | 20 | $checkResult = $observer->getEvent()->getResult(); |
21 | 21 | $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); |
22 | 22 | $config = $objectManager->create('DigitalOrigin\Pmt\Helper\Config')->getConfig(); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $secretKey = $this->getRequest()->getParam('secret'); |
44 | 44 | $privateKey = isset($this->config['secret_key']) ? $this->config['secret_key'] : null; |
45 | 45 | |
46 | - if ($secretKey!='' && $privateKey!='') { |
|
46 | + if ($secretKey != '' && $privateKey != '') { |
|
47 | 47 | $this->checkDbLogTable(); |
48 | 48 | /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */ |
49 | 49 | $dbConnection = $this->dbObject->getConnection(); |
@@ -346,9 +346,9 @@ |
||
346 | 346 | $magentoVersion = $this->productMetadataInterface->getVersion(); |
347 | 347 | $moduleInfo = $this->moduleList->getOne('DigitalOrigin_Pmt'); |
348 | 348 | return array( 'magento' => $magentoVersion, |
349 | - 'pmt' => $moduleInfo['setup_version'], |
|
350 | - 'php' => phpversion(), |
|
351 | - 'curl' => $curlVersion); |
|
349 | + 'pmt' => $moduleInfo['setup_version'], |
|
350 | + 'php' => phpversion(), |
|
351 | + 'curl' => $curlVersion); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | $customer = $quote->getCustomer(); |
102 | 102 | $shippingAddress = $quote->getShippingAddress(); |
103 | 103 | |
104 | - if (isset($params['email']) && $params['email']!='') { |
|
104 | + if (isset($params['email']) && $params['email'] != '') { |
|
105 | 105 | $this->session->setEmail($params['email']); //Get guest email after refresh page |
106 | 106 | $customer->setEmail($params['email']); |
107 | 107 | $quote->setCheckoutMethod('guest'); |
108 | 108 | $quote->getBillingAddress()->setEmail($params['email']); |
109 | - } elseif ($customer->getEmail()=='') { |
|
109 | + } elseif ($customer->getEmail() == '') { |
|
110 | 110 | $customer->setEmail($this->session->getEmail()); |
111 | 111 | $quote->setCheckoutMethod('guest'); |
112 | 112 | $quote->getBillingAddress()->setEmail($this->session->getEmail()); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $currentQuote->setCustomerEmail($customer->getEmail()); |
118 | 118 | $this->quoteRepository->save($currentQuote); |
119 | 119 | |
120 | - $userAddress = new Address(); |
|
120 | + $userAddress = new Address(); |
|
121 | 121 | $userAddress |
122 | 122 | ->setZipCode($shippingAddress->getPostcode()) |
123 | 123 | ->setFullName($shippingAddress->getFirstname()." ".$shippingAddress->getLastname()) |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | ->setMobilePhone($shippingAddress->getTelephone()) |
138 | 138 | ; |
139 | 139 | |
140 | - $orderBillingAddress = new Address(); |
|
140 | + $orderBillingAddress = new Address(); |
|
141 | 141 | $billingAddress = $quote->getBillingAddress(); |
142 | 142 | $orderBillingAddress |
143 | 143 | ->setZipCode($billingAddress->getPostcode()) |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | if ($customer->getDob()) { |
165 | 165 | $orderUser->setDateOfBirth($customer->getDob()); |
166 | 166 | } |
167 | - if ($customer->getTaxvat()!='') { |
|
167 | + if ($customer->getTaxvat() != '') { |
|
168 | 168 | $orderUser->setDni($customer->getTaxvat()); |
169 | 169 | $orderBillingAddress->setDni($customer->getTaxvat()); |
170 | 170 | $orderShippingAddress->setDni($customer->getTaxvat()); |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | ->setUser($orderUser) |
237 | 237 | ; |
238 | 238 | |
239 | - if ($this->config['public_key']=='' || $this->config['secret_key']=='') { |
|
239 | + if ($this->config['public_key'] == '' || $this->config['secret_key'] == '') { |
|
240 | 240 | throw new \Exception('Public and Secret Key not found'); |
241 | 241 | } |
242 | 242 | |
@@ -284,11 +284,11 @@ discard block |
||
284 | 284 | private function getOrders($customerId) |
285 | 285 | { |
286 | 286 | $orderCollection = array(); |
287 | - if ($customerId!='') { |
|
287 | + if ($customerId != '') { |
|
288 | 288 | $this->orderCollection->addAttributeToFilter('customer_id', $customerId) |
289 | 289 | ->addAttributeToFilter( |
290 | 290 | 'status', |
291 | - ['in' => ['processing','pending','complete']] |
|
291 | + ['in' => ['processing', 'pending', 'complete']] |
|
292 | 292 | ) |
293 | 293 | ->load(); |
294 | 294 | $orderCollection = $this->orderCollection->getData(); |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
332 | 332 | return $dbConnection->insertOnDuplicate( |
333 | 333 | $tableName, |
334 | - array('id'=>$quoteId,'order_id'=>$pmtOrderId), |
|
334 | + array('id'=>$quoteId, 'order_id'=>$pmtOrderId), |
|
335 | 335 | array('order_id') |
336 | 336 | ); |
337 | 337 | } |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | $curlVersion = $curlInfo['version']; |
346 | 346 | $magentoVersion = $this->productMetadataInterface->getVersion(); |
347 | 347 | $moduleInfo = $this->moduleList->getOne('DigitalOrigin_Pmt'); |
348 | - return array( 'magento' => $magentoVersion, |
|
348 | + return array('magento' => $magentoVersion, |
|
349 | 349 | 'pmt' => $moduleInfo['setup_version'], |
350 | 350 | 'php' => phpversion(), |
351 | 351 | 'curl' => $curlVersion); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $this->checkPmtStatus(array('AUTHORIZED')); |
235 | 235 | } catch (\Exception $e) { |
236 | 236 | $this->getMagentoOrderId(); |
237 | - if ($this->magentoOrderId!='') { |
|
237 | + if ($this->magentoOrderId != '') { |
|
238 | 238 | throw new AlreadyProcessedException(); |
239 | 239 | } else { |
240 | 240 | throw new WrongStatusException($this->pmtOrder->getStatus()); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | private function checkMerchantOrderStatus() |
246 | 246 | { |
247 | - if ($this->quote->getIsActive()=='0') { |
|
247 | + if ($this->quote->getIsActive() == '0') { |
|
248 | 248 | $this->getMagentoOrderId(); |
249 | 249 | throw new AlreadyProcessedException(); |
250 | 250 | } |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $tableName = $this->dbObject->getTableName(self::CONCURRENCY_TABLE); |
358 | 358 | if ($mode == false) { |
359 | 359 | $dbConnection->delete($tableName, "timestamp<".(time() - 5)); |
360 | - } elseif ($this->quoteId!='') { |
|
360 | + } elseif ($this->quoteId != '') { |
|
361 | 361 | $dbConnection->delete($tableName, "id=".$this->quoteId); |
362 | 362 | } |
363 | 363 | } catch (Exception $exception) { |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | private function getRedirectUrl() |
485 | 485 | { |
486 | 486 | $returnUrl = 'checkout/#payment'; |
487 | - if ($this->magentoOrderId!='') { |
|
487 | + if ($this->magentoOrderId != '') { |
|
488 | 488 | /** @var Order $this->magentoOrder */ |
489 | 489 | $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId); |
490 | 490 | if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $condition = WebDriverExpectedCondition::visibilityOfElementLocated($elementSearch); |
79 | 79 | $this->webDriver->wait()->until($condition); |
80 | 80 | $otherElement = $this->findById('payment_us_other_payment_methods-head'); |
81 | - if ($otherElement->getAttribute('class')!='open') { |
|
81 | + if ($otherElement->getAttribute('class') != 'open') { |
|
82 | 82 | $otherElement->click(); |
83 | 83 | } |
84 | 84 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this->webDriver->wait()->until($condition); |
88 | 88 | $this->assertTrue((bool) $condition, "PR4"); |
89 | 89 | $paylaterElement = $this->findById('payment_us_paylater-head'); |
90 | - if ($paylaterElement->getAttribute('class')!='open') { |
|
90 | + if ($paylaterElement->getAttribute('class') != 'open') { |
|
91 | 91 | $paylaterElement->click(); |
92 | 92 | } |
93 | 93 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $this->webDriver->get($this->configuration['magentoUrl'].self::CHECKOUT_FOLDER); |
289 | 289 | $condition = WebDriverExpectedCondition::titleContains(self::CHECKOUT_TITLE); |
290 | 290 | $this->webDriver->wait()->until($condition); |
291 | - $this->assertTrue((bool)$condition, $this->configuration['magentoUrl'].self::CHECKOUT_FOLDER); |
|
291 | + $this->assertTrue((bool) $condition, $this->configuration['magentoUrl'].self::CHECKOUT_FOLDER); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | $this->webDriver->wait()->until($condition); |
302 | 302 | $this->assertTrue((bool) $condition); |
303 | 303 | $this->assertSame( |
304 | - $this->configuration['firstname'] . ' ' . $this->configuration['lastname'], |
|
304 | + $this->configuration['firstname'].' '.$this->configuration['lastname'], |
|
305 | 305 | $this->findByClass('FieldsPreview-desc')->getText() |
306 | 306 | ); |
307 | 307 | } |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | { |
316 | 316 | $condition = WebDriverExpectedCondition::titleContains(self::PMT_TITLE); |
317 | 317 | $this->webDriver->wait(300)->until($condition, $this->webDriver->getCurrentURL()); |
318 | - $this->assertTrue((bool)$condition, "PR32"); |
|
318 | + $this->assertTrue((bool) $condition, "PR32"); |
|
319 | 319 | |
320 | 320 | SeleniumHelper::finishForm($this->webDriver); |
321 | 321 | } |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | $simulatorPrice = $simulatorElement->getAttribute('data-pmt-amount'); |
434 | 434 | $simulatorPrice = preg_replace('/[^\x{20}-\x{7F}]/u', '', $simulatorPrice); |
435 | 435 | $price = preg_replace('/[^\x{20}-\x{7F}]/u', '', $price); |
436 | - $this->assertContains($simulatorPrice, $price, json_encode(array($price,$simulatorPrice))); |
|
436 | + $this->assertContains($simulatorPrice, $price, json_encode(array($price, $simulatorPrice))); |
|
437 | 437 | |
438 | 438 | sleep(2); |
439 | 439 | $checkoutButton = WebDriverBy::cssSelector("#checkout-payment-method-load > .payment-methods > .payment-group > ._active > .payment-method-content > .actions-toolbar > .primary"); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | /** |
27 | 27 | * testMagentoOpen |
28 | - */ |
|
28 | + */ |
|
29 | 29 | public function testPaylaterMg21BasicTest() |
30 | 30 | { |
31 | 31 | $this->webDriver->get($this->configuration['magentoUrl']); |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $this->assertNotEmpty($orderUrl); |
60 | 60 | |
61 | 61 | $orderArray = explode('/', $orderUrl); |
62 | - $magentoOrderId = (int)$orderArray['8']; |
|
62 | + $magentoOrderId = (int) $orderArray['8']; |
|
63 | 63 | $this->assertNotEmpty($magentoOrderId); |
64 | 64 | $notifyUrl = $this->configuration['magentoUrl'].self::NOTIFICATION_FOLDER.'?'.self::NOTIFICATION_PARAMETER.'='.$magentoOrderId; |
65 | 65 | $response = Request::post($notifyUrl)->expects('json')->send(); |