Passed
Pull Request — master (#4)
by Raúl
02:29
created
catalog/ext/modules/payment/pagantis/callback.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
         tep_session_register($var);
17 17
     }
18 18
     $destUrl = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true, false);
19
-    $destUrl.="?order_id=$_GET[order_id]&from=notify";
20
-} else {
19
+    $destUrl .= "?order_id=$_GET[order_id]&from=notify";
20
+}else {
21 21
     $destUrl = tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', true, false);
22 22
 }
23 23
 
Please login to merge, or discard this patch.
catalog/ext/modules/payment/pagantis/notifyController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
             if ($this->origin == 'notify') {
77 77
                 $jsonResponse->printResponse();
78
-            } else {
78
+            }else {
79 79
                 if ($exception->getMessage() == AlreadyProcessedException::ERROR_MESSAGE) {
80 80
                     return;
81 81
                 }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
         if ($this->origin == 'notify') {
110 110
             $jsonResponse->printResponse();
111
-        } else {
111
+        }else {
112 112
             return $jsonResponse;
113 113
         }
114 114
     }
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
         try {
181 181
             $this->checkPagantisStatus(array('AUTHORIZED'));
182 182
         } catch (\Exception $e) {
183
-            if ($this->findOscommerceOrderId()!='') {
183
+            if ($this->findOscommerceOrderId() != '') {
184 184
                 throw new AlreadyProcessedException();
185
-            } else {
185
+            }else {
186 186
                 if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
187 187
                     $status = $this->pagantisOrder->getStatus();
188
-                } else {
188
+                }else {
189 189
                     $status = '-';
190 190
                 }
191 191
                 throw new WrongStatusException($status);
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     {
201 201
         global $order;
202 202
 
203
-        if ($order->info['order_status']!=='1') {
203
+        if ($order->info['order_status'] !== '1') {
204 204
             throw new AlreadyProcessedException();
205 205
         }
206 206
     }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
             if ($orderId == null) {
278 278
                 $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where  timestamp<".(time() - 5);
279 279
                 tep_db_query($query);
280
-            } elseif ($orderId!='') {
280
+            } elseif ($orderId != '') {
281 281
                 $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where id='$orderId'";
282 282
                 tep_db_query($query);
283 283
             }
@@ -329,12 +329,12 @@  discard block
 block discarded – undo
329 329
             if (!$payed) {
330 330
                 if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
331 331
                     $status = $this->pagantisOrder->getStatus();
332
-                } else {
332
+                }else {
333 333
                     $status = '-';
334 334
                 }
335 335
                 throw new WrongStatusException($status);
336 336
             }
337
-        } else {
337
+        }else {
338 338
             throw new OrderNotFoundException();
339 339
         }
340 340
     }
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         tep_db_query($query);
368 368
 
369 369
         $comment = "Pagantis id=$this->pagantisOrderId/Via=".ucfirst($this->origin);
370
-        $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY ."(comments, orders_id, orders_status_id, customer_notified, date_added) values
370
+        $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY."(comments, orders_id, orders_status_id, customer_notified, date_added) values
371 371
             ('$comment', ".$insert_id.", '2', -1, now() )";
372 372
         tep_db_query($query);
373 373
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
     private function insertLog($exception)
393 393
     {
394 394
         if ($exception instanceof \Exception) {
395
-            $logEntry= new LogEntry();
395
+            $logEntry = new LogEntry();
396 396
             $logEntryJson = $logEntry->error($exception)->toJson();
397 397
 
398 398
             $query = "insert into ".TABLE_PAGANTIS_LOG."(log) values ('$logEntryJson')";
Please login to merge, or discard this patch.
test/PagantisOscommerceTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 //            $faker->numberBetween(1, 12). '/1975'
80 80
 //        ;
81 81
         $this->configuration['firstname'] = $faker->firstName;
82
-        $this->configuration['lastname'] = $faker->lastName . ' ' . $faker->lastName;
82
+        $this->configuration['lastname'] = $faker->lastName.' '.$faker->lastName;
83 83
         $this->configuration['company'] = $faker->company;
84 84
         $this->configuration['zip'] = '28'.$faker->randomNumber(3, true);
85 85
         $this->configuration['street'] = $faker->streetAddress;
86
-        $this->configuration['phone'] = '6' . $faker->randomNumber(8);
87
-        $this->configuration['email'] = date('ymd') . '@pagantis.com';
86
+        $this->configuration['phone'] = '6'.$faker->randomNumber(8);
87
+        $this->configuration['email'] = date('ymd').'@pagantis.com';
88 88
         parent::__construct($name, $data, $dataName);
89 89
     }
90 90
     /**
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
      */
93 93
     protected function getDNI()
94 94
     {
95
-        $dni = '0000' . rand(pow(10, 4-1), pow(10, 4)-1);
96
-        $value = (int) ($dni / 23);
95
+        $dni = '0000'.rand(pow(10, 4 - 1), pow(10, 4) - 1);
96
+        $value = (int)($dni / 23);
97 97
         $value *= 23;
98
-        $value= $dni - $value;
99
-        $letter= "TRWAGMYFPDXBNJZSQVHLCKEO";
100
-        $dniLetter= substr($letter, $value, 1);
98
+        $value = $dni - $value;
99
+        $letter = "TRWAGMYFPDXBNJZSQVHLCKEO";
100
+        $dniLetter = substr($letter, $value, 1);
101 101
         return $dni.$dniLetter;
102 102
     }
103 103
 
Please login to merge, or discard this patch.
test/Buy/AbstractBuy.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         sleep(3);
97 97
         $productLinkElement->click();
98 98
         $this->assertSame(
99
-            self::PRODUCT_NAME . ', ' . self::TITLE,
99
+            self::PRODUCT_NAME.', '.self::TITLE,
100 100
             $this->webDriver->getTitle()
101 101
         );
102 102
     }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         );
122 122
 
123 123
         $this->assertTrue(
124
-            (bool) WebDriverExpectedCondition::visibilityOfElementLocated($reviewStepSearch)
124
+            (bool)WebDriverExpectedCondition::visibilityOfElementLocated($reviewStepSearch)
125 125
         );
126 126
     }
127 127
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             WebDriverExpectedCondition::visibilityOfElementLocated($checkoutStepPaymentMethodSearch)
141 141
         );
142 142
         $this->assertTrue(
143
-            (bool) WebDriverExpectedCondition::visibilityOfElementLocated($checkoutStepPaymentMethodSearch)
143
+            (bool)WebDriverExpectedCondition::visibilityOfElementLocated($checkoutStepPaymentMethodSearch)
144 144
         );
145 145
     }
146 146
 
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
         $paymentFormElement = WebDriverBy::className('FieldsPreview-desc');
191 191
         $condition = WebDriverExpectedCondition::visibilityOfElementLocated($paymentFormElement);
192 192
         $this->webDriver->wait()->until($condition);
193
-        $this->assertTrue((bool) $condition);
193
+        $this->assertTrue((bool)$condition);
194 194
         $this->assertSame(
195
-            $this->configuration['firstname'] . ' ' . $this->configuration['lastname'],
195
+            $this->configuration['firstname'].' '.$this->configuration['lastname'],
196 196
             $this->findByClass('FieldsPreview-desc')->getText()
197 197
         );
198 198
     }
Please login to merge, or discard this patch.
test/Buy/BuyRegisteredTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         $checkoutStepShippingMethodSearch = WebDriverBy::id('checkout-shipping-method-load');
76 76
         $condition = WebDriverExpectedCondition::visibilityOfElementLocated($checkoutStepShippingMethodSearch);
77 77
         $this->webDriver->wait()->until($condition);
78
-        $this->assertTrue((bool) $condition);
78
+        $this->assertTrue((bool)$condition);
79 79
     }
80 80
 
81 81
     /**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $billingAddressSelector = WebDriverBy::id('billing-address-select');
91 91
         $condition = WebDriverExpectedCondition::visibilityOfElementLocated($billingAddressSelector);
92 92
         $this->webDriver->wait()->until($condition);
93
-        $this->assertTrue((bool) $condition);
93
+        $this->assertTrue((bool)$condition);
94 94
     }
95 95
 
96 96
     /**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     protected function checkPagantisOrderId()
154 154
     {
155
-        $orderId=0;
155
+        $orderId = 0;
156 156
         $notifyUrl = self::OSCURL.self::NOTIFICATION_FOLDER.'?order='.$orderId;
157 157
         $this->assertNotEmpty($notifyUrl, $notifyUrl);
158 158
         $response = Request::post($notifyUrl)->expects('json')->send();
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $this->assertEquals(
163 163
             $response->body->merchant_order_id,
164 164
             $orderId,
165
-            $response->body->merchant_order_id.'!='. $orderId
165
+            $response->body->merchant_order_id.'!='.$orderId
166 166
         );
167 167
         $this->assertContains(
168 168
             NoIdentificationException::ERROR_MESSAGE,
Please login to merge, or discard this patch.
test/Buy/CancelBuyRegisteredTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $checkoutStepShippingMethodSearch = WebDriverBy::id('checkout-shipping-method-load');
40 40
         $condition = WebDriverExpectedCondition::visibilityOfElementLocated($checkoutStepShippingMethodSearch);
41 41
         $this->webDriver->wait()->until($condition);
42
-        $this->assertTrue((bool) $condition);
42
+        $this->assertTrue((bool)$condition);
43 43
     }
44 44
 
45 45
     /**
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $billingAddressSelector = WebDriverBy::id('billing-address-select');
55 55
         $condition = WebDriverExpectedCondition::visibilityOfElementLocated($billingAddressSelector);
56 56
         $this->webDriver->wait()->until($condition);
57
-        $this->assertTrue((bool) $condition);
57
+        $this->assertTrue((bool)$condition);
58 58
     }
59 59
 
60 60
     /**
Please login to merge, or discard this patch.