@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | { |
29 | 29 | if (_PS_VERSION_ < 1.6) { |
30 | 30 | Logger::addLog( |
31 | - 'Pagantis Exception For user ' . |
|
32 | - $customer->email . |
|
33 | - ' : ' . |
|
31 | + 'Pagantis Exception For user '. |
|
32 | + $customer->email. |
|
33 | + ' : '. |
|
34 | 34 | $exception->getMessage(), |
35 | 35 | 3, |
36 | 36 | $exception->getCode(), |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | ); |
41 | 41 | } else { |
42 | 42 | PrestaShopLogger::addLog( |
43 | - 'Pagantis Exception For user ' . |
|
44 | - $customer->email . |
|
45 | - ' : ' . |
|
43 | + 'Pagantis Exception For user '. |
|
44 | + $customer->email. |
|
45 | + ' : '. |
|
46 | 46 | $exception->getMessage(), |
47 | 47 | 3, |
48 | 48 | $exception->getCode(), |
@@ -104,24 +104,24 @@ discard block |
||
104 | 104 | ); |
105 | 105 | |
106 | 106 | try { |
107 | - $userAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
|
107 | + $userAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
|
108 | 108 | $userAddress |
109 | 109 | ->setZipCode($shippingAddress->postcode) |
110 | - ->setFullName($shippingAddress->firstname . ' ' . $shippingAddress->lastname) |
|
110 | + ->setFullName($shippingAddress->firstname.' '.$shippingAddress->lastname) |
|
111 | 111 | ->setCountryCode($this->language) |
112 | 112 | ->setCity($shippingAddress->city) |
113 | - ->setAddress($shippingAddress->address1 . ' ' . $shippingAddress->address2) |
|
113 | + ->setAddress($shippingAddress->address1.' '.$shippingAddress->address2) |
|
114 | 114 | ->setTaxId($this->getTaxId($customer, $shippingAddress, $billingAddress)) |
115 | 115 | ->setNationalId($this->getNationalId($customer, $shippingAddress, $billingAddress)) |
116 | 116 | ; |
117 | 117 | |
118 | - $orderShippingAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
|
118 | + $orderShippingAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
|
119 | 119 | $orderShippingAddress |
120 | 120 | ->setZipCode($shippingAddress->postcode) |
121 | - ->setFullName($shippingAddress->firstname . ' ' . $shippingAddress->lastname) |
|
121 | + ->setFullName($shippingAddress->firstname.' '.$shippingAddress->lastname) |
|
122 | 122 | ->setCountryCode($this->language) |
123 | 123 | ->setCity($shippingAddress->city) |
124 | - ->setAddress($shippingAddress->address1 . ' ' . $shippingAddress->address2) |
|
124 | + ->setAddress($shippingAddress->address1.' '.$shippingAddress->address2) |
|
125 | 125 | ->setTaxId($this->getTaxId($customer, $shippingAddress, $billingAddress)) |
126 | 126 | ->setNationalId($this->getNationalId($customer, $shippingAddress, $billingAddress)) |
127 | 127 | ->setFixPhone($shippingAddress->phone) |
@@ -131,10 +131,10 @@ discard block |
||
131 | 131 | $orderBillingAddress = new \Pagantis\OrdersApiClient\Model\Order\User\Address(); |
132 | 132 | $orderBillingAddress |
133 | 133 | ->setZipCode($billingAddress->postcode) |
134 | - ->setFullName($billingAddress->firstname . ' ' . $billingAddress->lastname) |
|
134 | + ->setFullName($billingAddress->firstname.' '.$billingAddress->lastname) |
|
135 | 135 | ->setCountryCode($this->language) |
136 | 136 | ->setCity($billingAddress->city) |
137 | - ->setAddress($billingAddress->address1 . ' ' . $billingAddress->address2) |
|
137 | + ->setAddress($billingAddress->address1.' '.$billingAddress->address2) |
|
138 | 138 | ->setTaxId($this->getTaxId($customer, $billingAddress, $shippingAddress)) |
139 | 139 | ->setNationalId($this->getNationalId($customer, $billingAddress, $shippingAddress)) |
140 | 140 | ->setFixPhone($billingAddress->phone) |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | ->setNationalId($this->getNationalId($customer, $shippingAddress, $billingAddress)) |
155 | 155 | ; |
156 | 156 | |
157 | - if ($customer->birthday!='0000-00-00') { |
|
157 | + if ($customer->birthday != '0000-00-00') { |
|
158 | 158 | $orderUser->setDateOfBirth($customer->birthday); |
159 | 159 | } |
160 | 160 | |
@@ -188,12 +188,12 @@ discard block |
||
188 | 188 | ->setQuantity($item['quantity']) |
189 | 189 | ->setDescription($item['name']); |
190 | 190 | if ($promotedProduct) { |
191 | - $promotedAmount+=$product->getAmount(); |
|
191 | + $promotedAmount += $product->getAmount(); |
|
192 | 192 | $finalPrice = Product::getPriceStatic($item['id_product']); |
193 | - $promotedMessage = 'Promoted Item: ' . $product->getDescription() . |
|
194 | - ' Price: ' . $finalPrice . |
|
195 | - ' Qty: ' . $product->getQuantity() . |
|
196 | - ' Item ID: ' . $item['id_product']; |
|
193 | + $promotedMessage = 'Promoted Item: '.$product->getDescription(). |
|
194 | + ' Price: '.$finalPrice. |
|
195 | + ' Qty: '.$product->getQuantity(). |
|
196 | + ' Item ID: '.$item['id_product']; |
|
197 | 197 | $metadataOrder->addMetadata('promotedProduct', $promotedMessage); |
198 | 198 | } |
199 | 199 | $details->addProduct($product); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | Tools::redirect($cancelUrl); |
244 | 244 | } |
245 | 245 | |
246 | - $url =''; |
|
246 | + $url = ''; |
|
247 | 247 | try { |
248 | 248 | $orderClient = new \Pagantis\OrdersApiClient\Client( |
249 | 249 | $pagantisPublicKey, |
@@ -254,12 +254,12 @@ discard block |
||
254 | 254 | if ($order instanceof \Pagantis\OrdersApiClient\Model\Order) { |
255 | 255 | $url = $order->getActionUrls()->getForm(); |
256 | 256 | $orderId = $order->getId(); |
257 | - $sql = "INSERT INTO `" . _DB_PREFIX_ . "pagantis_order` (`id`, `order_id`) |
|
257 | + $sql = "INSERT INTO `"._DB_PREFIX_."pagantis_order` (`id`, `order_id`) |
|
258 | 258 | VALUES ('$cart->id','$orderId') |
259 | 259 | ON DUPLICATE KEY UPDATE `order_id` = '$orderId'"; |
260 | 260 | $result = Db::getInstance()->execute($sql); |
261 | 261 | if (!$result) { |
262 | - throw new UnknownException('Unable to save pagantis-order-id in database: '. $sql); |
|
262 | + throw new UnknownException('Unable to save pagantis-order-id in database: '.$sql); |
|
263 | 263 | } |
264 | 264 | } else { |
265 | 265 | throw new OrderNotFoundException(); |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | if (count($langArray) != 2 && isset($lang['locale'])) { |
359 | 359 | $langArray = explode("-", $lang['locale']); |
360 | 360 | } |
361 | - $this->language = Tools::strtoupper($langArray[count($langArray)-1]); |
|
361 | + $this->language = Tools::strtoupper($langArray[count($langArray) - 1]); |
|
362 | 362 | // Prevent null language detection |
363 | 363 | $this->language = ($this->language) ? $this->language : 'ES'; |
364 | 364 | } |