@@ -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"); |
@@ -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(); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $secretKey = $this->getRequest()->getParam('secret'); |
45 | 45 | $privateKey = isset($this->config['pmt_private_key']) ? $this->config['pmt_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(); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } elseif ($_SERVER['REQUEST_METHOD'] == 'POST') { |
51 | 51 | if (count($_POST)) { |
52 | 52 | foreach ($_POST as $config => $value) { |
53 | - if (isset($this->defaultConfigs[$config]) && $response['status']==null) { |
|
53 | + if (isset($this->defaultConfigs[$config]) && $response['status'] == null) { |
|
54 | 54 | $dbConnection->update( |
55 | 55 | $tableName, |
56 | 56 | array('value' => $value), |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | - if ($response['status']==null) { |
|
70 | + if ($response['status'] == null) { |
|
71 | 71 | $dbResult = $dbConnection |
72 | 72 | ->select() |
73 | 73 | ->from($tableName, array('config', 'value')); |
@@ -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()); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | ->setUser($orderUser) |
244 | 244 | ; |
245 | 245 | |
246 | - if ($this->config['pmt_public_key']=='' || $this->config['pmt_private_key']=='') { |
|
246 | + if ($this->config['pmt_public_key'] == '' || $this->config['pmt_private_key'] == '') { |
|
247 | 247 | throw new \Exception('Public and Secret Key not found'); |
248 | 248 | } |
249 | 249 | |
@@ -291,11 +291,11 @@ discard block |
||
291 | 291 | private function getOrders($customerId) |
292 | 292 | { |
293 | 293 | $orderCollection = array(); |
294 | - if ($customerId!='') { |
|
294 | + if ($customerId != '') { |
|
295 | 295 | $this->orderCollection->addAttributeToFilter('customer_id', $customerId) |
296 | 296 | ->addAttributeToFilter( |
297 | 297 | 'status', |
298 | - ['in' => ['processing','pending','complete']] |
|
298 | + ['in' => ['processing', 'pending', 'complete']] |
|
299 | 299 | ) |
300 | 300 | ->load(); |
301 | 301 | $orderCollection = $this->orderCollection->getData(); |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
339 | 339 | return $dbConnection->insertOnDuplicate( |
340 | 340 | $tableName, |
341 | - array('id'=>$quoteId,'order_id'=>$pmtOrderId), |
|
341 | + array('id'=>$quoteId, 'order_id'=>$pmtOrderId), |
|
342 | 342 | array('order_id') |
343 | 343 | ); |
344 | 344 | } |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | $curlVersion = $curlInfo['version']; |
353 | 353 | $magentoVersion = $this->productMetadataInterface->getVersion(); |
354 | 354 | $moduleInfo = $this->moduleList->getOne('DigitalOrigin_Pmt'); |
355 | - return array( 'magento' => $magentoVersion, |
|
355 | + return array('magento' => $magentoVersion, |
|
356 | 356 | 'pmt' => $moduleInfo['setup_version'], |
357 | 357 | 'php' => phpversion(), |
358 | 358 | 'curl' => $curlVersion); |