Passed
Pull Request — master (#40)
by Cesar
02:11
created
controllers/front/payment.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,8 +83,8 @@
 block discarded – undo
83 83
         $pagantisPublicKey = Configuration::get('pagantis_public_key');
84 84
         $pagantisPrivateKey = Configuration::get('pagantis_private_key');
85 85
         $okUrl = _PS_BASE_URL_.__PS_BASE_URI__
86
-                 .'index.php?canonical=true&fc=module&module=pagantis&controller=notify&'
87
-                 .http_build_query($query)
86
+                    .'index.php?canonical=true&fc=module&module=pagantis&controller=notify&'
87
+                    .http_build_query($query)
88 88
         ;
89 89
 
90 90
         $firstName = $customer->firstname;
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
     {
26 26
         if (_PS_VERSION_ < 1.6) {
27 27
             Logger::addLog(
28
-                'Pagantis Exception For user ' .
29
-                $customer->email .
30
-                ' : ' .
28
+                'Pagantis Exception For user '.
29
+                $customer->email.
30
+                ' : '.
31 31
                 $exception->getMessage(),
32 32
                 3,
33 33
                 $exception->getCode(),
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
             );
38 38
         } else {
39 39
             PrestaShopLogger::addLog(
40
-                'Pagantis Exception For user ' .
41
-                $customer->email .
42
-                ' : ' .
40
+                'Pagantis Exception For user '.
41
+                $customer->email.
42
+                ' : '.
43 43
                 $exception->getMessage(),
44 44
                 3,
45 45
                 $exception->getCode(),
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $lastName = $customer->lastname;
92 92
         $shippingAddress = new Address($cart->id_address_delivery);
93 93
         $billingAddress = new Address($cart->id_address_invoice);
94
-        $fullAddress = $billingAddress->address1 . ' ' . $billingAddress->address2;
94
+        $fullAddress = $billingAddress->address1.' '.$billingAddress->address2;
95 95
         $city = $billingAddress->city;
96 96
         $postCode = $billingAddress->postcode;
97 97
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             }
110 110
         }
111 111
         if ($fullAddress == ' ') {
112
-            $fullAddress = $shippingAddress->address1 . ' ' . $shippingAddress->address2;
112
+            $fullAddress = $shippingAddress->address1.' '.$shippingAddress->address2;
113 113
         }
114 114
         if (empty($city)) {
115 115
             $city = $shippingAddress->city;
@@ -128,22 +128,22 @@  discard block
 block discarded – undo
128 128
         );
129 129
 
130 130
         try {
131
-            $userAddress =  new \Pagantis\OrdersApiClient\Model\Order\User\Address();
131
+            $userAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address();
132 132
             $userAddress
133 133
                 ->setZipCode($postCode)
134
-                ->setFullName($firstName . ' ' . $lastName)
134
+                ->setFullName($firstName.' '.$lastName)
135 135
                 ->setCountryCode('ES')
136 136
                 ->setCity($city)
137 137
                 ->setAddress($fullAddress)
138 138
             ;
139 139
 
140
-            $orderShippingAddress =  new \Pagantis\OrdersApiClient\Model\Order\User\Address();
140
+            $orderShippingAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address();
141 141
             $orderShippingAddress
142 142
                 ->setZipCode($shippingAddress->postcode)
143
-                ->setFullName($shippingAddress->firstname . ' ' . $shippingAddress->lastname)
143
+                ->setFullName($shippingAddress->firstname.' '.$shippingAddress->lastname)
144 144
                 ->setCountryCode('ES')
145 145
                 ->setCity($shippingAddress->city)
146
-                ->setAddress($shippingAddress->address1 . ' ' . $shippingAddress->address2)
146
+                ->setAddress($shippingAddress->address1.' '.$shippingAddress->address2)
147 147
                 ->setDni($shippingAddress->dni)
148 148
                 ->setFixPhone($shippingAddress->phone)
149 149
                 ->setMobilePhone($shippingAddress->phone_mobile)
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
             $orderBillingAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address();
153 153
             $orderBillingAddress
154 154
                 ->setZipCode($billingAddress->postcode)
155
-                ->setFullName($billingAddress->firstname . ' ' . $billingAddress->lastname)
155
+                ->setFullName($billingAddress->firstname.' '.$billingAddress->lastname)
156 156
                 ->setCountryCode('ES')
157 157
                 ->setCity($billingAddress->city)
158
-                ->setAddress($billingAddress->address1 . ' ' . $billingAddress->address2)
158
+                ->setAddress($billingAddress->address1.' '.$billingAddress->address2)
159 159
                 ->setDni($billingAddress->dni)
160 160
                 ->setFixPhone($billingAddress->phone)
161 161
                 ->setMobilePhone($billingAddress->phone_mobile)
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                 ->setDni($shippingAddress->dni)
174 174
             ;
175 175
 
176
-            if ($customer->birthday!='0000-00-00') {
176
+            if ($customer->birthday != '0000-00-00') {
177 177
                 $orderUser->setDateOfBirth($customer->birthday);
178 178
             }
179 179
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
             Tools::redirect($cancelUrl);
250 250
         }
251 251
 
252
-        $url ='';
252
+        $url = '';
253 253
         try {
254 254
             $orderClient = new \Pagantis\OrdersApiClient\Client(
255 255
                 $pagantisPublicKey,
@@ -259,12 +259,12 @@  discard block
 block discarded – undo
259 259
             if ($order instanceof \Pagantis\OrdersApiClient\Model\Order) {
260 260
                 $url = $order->getActionUrls()->getForm();
261 261
                 $orderId = $order->getId();
262
-                $sql = "INSERT INTO `" . _DB_PREFIX_ . "pagantis_order` (`id`, `order_id`)
262
+                $sql = "INSERT INTO `"._DB_PREFIX_."pagantis_order` (`id`, `order_id`)
263 263
                      VALUES ('$cart->id','$orderId') 
264 264
                      ON DUPLICATE KEY UPDATE `order_id` = '$orderId'";
265 265
                 $result = Db::getInstance()->execute($sql);
266 266
                 if (!$result) {
267
-                    throw new UnknownException('Unable to save pagantis-order-id in database: '. $sql);
267
+                    throw new UnknownException('Unable to save pagantis-order-id in database: '.$sql);
268 268
                 }
269 269
             } else {
270 270
                 throw new OrderNotFoundException();
Please login to merge, or discard this patch.