Passed
Pull Request — master (#39)
by pablo
05:16
created
Controller/Payment/Index.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
             $customer = $quote->getCustomer();
126 126
             $shippingAddress = $quote->getShippingAddress();
127 127
 
128
-            if (isset($params['email']) && $params['email']!='') {
128
+            if (isset($params['email']) && $params['email'] != '') {
129 129
                 $this->session->setEmail($params['email']); //Get guest email after refresh page
130 130
                 $customer->setEmail($params['email']);
131 131
                 $quote->setCheckoutMethod('guest');
132 132
                 $quote->getBillingAddress()->setEmail($params['email']);
133
-            } elseif ($customer->getEmail()=='') {
133
+            } elseif ($customer->getEmail() == '') {
134 134
                 $customer->setEmail($this->session->getEmail());
135 135
                 $quote->setCheckoutMethod('guest');
136 136
                 $quote->getBillingAddress()->setEmail($this->session->getEmail());
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             $currentQuote->setCustomerEmail($customer->getEmail());
142 142
             $this->quoteRepository->save($currentQuote);
143 143
 
144
-            $userAddress =  new Address();
144
+            $userAddress = new Address();
145 145
             $userAddress
146 146
                 ->setZipCode($shippingAddress->getPostcode())
147 147
                 ->setFullName($shippingAddress->getFirstname()." ".$shippingAddress->getLastname())
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                 ->setTaxId($tax_id)
164 164
             ;
165 165
 
166
-            $orderBillingAddress =  new Address();
166
+            $orderBillingAddress = new Address();
167 167
             $billingAddress = $quote->getBillingAddress();
168 168
             $orderBillingAddress
169 169
                 ->setZipCode($billingAddress->getPostcode())
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             if ($customer->getDob()) {
193 193
                 $orderUser->setDateOfBirth($customer->getDob());
194 194
             }
195
-            if ($customer->getTaxvat()!='') {
195
+            if ($customer->getTaxvat() != '') {
196 196
                 $orderUser->setDni($customer->getTaxvat());
197 197
                 $orderBillingAddress->setDni($customer->getTaxvat());
198 198
                 $orderShippingAddress->setDni($customer->getTaxvat());
@@ -232,11 +232,11 @@  discard block
 block discarded – undo
232 232
 
233 233
                 $promotedProduct = $this->isPromoted($item);
234 234
                 if ($promotedProduct == 'true') {
235
-                    $promotedAmount+=$product->getAmount()*$item->getQty();
236
-                    $promotedMessage = 'Promoted Item: ' . $item->getName() .
237
-                                       ' Price: ' . $item->getPrice() .
238
-                                       ' Qty: ' . $item->getQty() .
239
-                                       ' Item ID: ' . $item->getItemId();
235
+                    $promotedAmount += $product->getAmount() * $item->getQty();
236
+                    $promotedMessage = 'Promoted Item: '.$item->getName().
237
+                                       ' Price: '.$item->getPrice().
238
+                                       ' Qty: '.$item->getQty().
239
+                                       ' Item ID: '.$item->getItemId();
240 240
                     $metadataOrder->addMetadata('promotedProduct', $promotedMessage);
241 241
                 }
242 242
             }
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
                 $okUrlRoute = 'pagantis/notify/indexV2';
262 262
             }
263 263
 
264
-            $okUrlUser = $this->_url->getUrl($okUrlRoute, ['_query' => ['quoteId'=>$quoteId,'origin'=>'redirect']]);
265
-            $okUrlNot  = $this->_url->getUrl($okUrlRoute, ['_query' => ['quoteId'=>$quoteId,'origin'=>'notification']]);
264
+            $okUrlUser = $this->_url->getUrl($okUrlRoute, ['_query' => ['quoteId'=>$quoteId, 'origin'=>'redirect']]);
265
+            $okUrlNot  = $this->_url->getUrl($okUrlRoute, ['_query' => ['quoteId'=>$quoteId, 'origin'=>'notification']]);
266 266
 
267 267
             $orderConfigurationUrls
268 268
                 ->setCancel($cancelUrl)
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                 ->setType(Channel::ONLINE)
278 278
             ;
279 279
 
280
-            $haystack  = ($this->store->getLocale()!=null) ? $this->store->getLocale() : $this->getResolverCountry();
280
+            $haystack = ($this->store->getLocale() != null) ? $this->store->getLocale() : $this->getResolverCountry();
281 281
             $language = strstr($haystack, '_', true);
282 282
             $orderConfiguration = new Configuration();
283 283
             $orderConfiguration
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                 ->setUser($orderUser)
296 296
             ;
297 297
 
298
-            if ($this->config['pagantis_public_key']=='' || $this->config['pagantis_private_key']=='') {
298
+            if ($this->config['pagantis_public_key'] == '' || $this->config['pagantis_private_key'] == '') {
299 299
                 throw new \Exception('Public and Secret Key not found');
300 300
             }
301 301
 
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
         }
322 322
 
323 323
         $displayMode = $this->extraConfig['PAGANTIS_FORM_DISPLAY_TYPE'];
324
-        if ($displayMode==='0') {
324
+        if ($displayMode === '0') {
325 325
             echo $url;
326 326
             exit;
327 327
         } else {
@@ -343,11 +343,11 @@  discard block
 block discarded – undo
343 343
     private function getOrders($customerId)
344 344
     {
345 345
         $orderCollection = array();
346
-        if ($customerId!='') {
346
+        if ($customerId != '') {
347 347
             $this->orderCollection->addAttributeToFilter('customer_id', $customerId)
348 348
                             ->addAttributeToFilter(
349 349
                                 'status',
350
-                                ['in' => ['processing','pending','complete']]
350
+                                ['in' => ['processing', 'pending', 'complete']]
351 351
                             )
352 352
                             ->load();
353 353
             $orderCollection = $this->orderCollection->getData();
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
         $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE);
391 391
         return $dbConnection->insertOnDuplicate(
392 392
             $tableName,
393
-            array('id'=>$quoteId,'order_id'=>$pagantisOrderId),
393
+            array('id'=>$quoteId, 'order_id'=>$pagantisOrderId),
394 394
             array('order_id')
395 395
         );
396 396
     }
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         $curlVersion = $curlInfo['version'];
405 405
         $magentoVersion = $this->productMetadataInterface->getVersion();
406 406
         $moduleInfo = $this->moduleList->getOne('Pagantis_Pagantis');
407
-        return array(  'magento' => $magentoVersion,
407
+        return array('magento' => $magentoVersion,
408 408
                        'pagantis' => $moduleInfo['setup_version'],
409 409
                        'php' => phpversion(),
410 410
                        'curl' => $curlVersion);
Please login to merge, or discard this patch.