@@ -125,12 +125,12 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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()); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | ->setType(Channel::ONLINE) |
263 | 263 | ; |
264 | 264 | |
265 | - $haystack = $this->store->getLocale(); |
|
265 | + $haystack = $this->store->getLocale(); |
|
266 | 266 | $language = strstr($haystack, '_', true); |
267 | 267 | $orderConfiguration = new Configuration(); |
268 | 268 | $orderConfiguration |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | ->setUser($orderUser) |
281 | 281 | ; |
282 | 282 | |
283 | - if ($this->config['pagantis_public_key']=='' || $this->config['pagantis_private_key']=='') { |
|
283 | + if ($this->config['pagantis_public_key'] == '' || $this->config['pagantis_private_key'] == '') { |
|
284 | 284 | throw new \Exception('Public and Secret Key not found'); |
285 | 285 | } |
286 | 286 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | } |
307 | 307 | |
308 | 308 | $displayMode = $this->extraConfig['PAGANTIS_FORM_DISPLAY_TYPE']; |
309 | - if ($displayMode==='0') { |
|
309 | + if ($displayMode === '0') { |
|
310 | 310 | echo $url; |
311 | 311 | exit; |
312 | 312 | } else { |
@@ -328,11 +328,11 @@ discard block |
||
328 | 328 | private function getOrders($customerId) |
329 | 329 | { |
330 | 330 | $orderCollection = array(); |
331 | - if ($customerId!='') { |
|
331 | + if ($customerId != '') { |
|
332 | 332 | $this->orderCollection->addAttributeToFilter('customer_id', $customerId) |
333 | 333 | ->addAttributeToFilter( |
334 | 334 | 'status', |
335 | - ['in' => ['processing','pending','complete']] |
|
335 | + ['in' => ['processing', 'pending', 'complete']] |
|
336 | 336 | ) |
337 | 337 | ->load(); |
338 | 338 | $orderCollection = $this->orderCollection->getData(); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | $tableName = $this->dbObject->getTableName(self::ORDERS_TABLE); |
376 | 376 | return $dbConnection->insertOnDuplicate( |
377 | 377 | $tableName, |
378 | - array('id'=>$quoteId,'order_id'=>$pagantisOrderId), |
|
378 | + array('id'=>$quoteId, 'order_id'=>$pagantisOrderId), |
|
379 | 379 | array('order_id') |
380 | 380 | ); |
381 | 381 | } |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $curlVersion = $curlInfo['version']; |
390 | 390 | $magentoVersion = $this->productMetadataInterface->getVersion(); |
391 | 391 | $moduleInfo = $this->moduleList->getOne('Pagantis_Pagantis'); |
392 | - return array( 'magento' => $magentoVersion, |
|
392 | + return array('magento' => $magentoVersion, |
|
393 | 393 | 'pagantis' => $moduleInfo['setup_version'], |
394 | 394 | 'php' => phpversion(), |
395 | 395 | 'curl' => $curlVersion); |
@@ -16,21 +16,21 @@ |
||
16 | 16 | * @var array $defaultConfigs |
17 | 17 | */ |
18 | 18 | public $defaultConfigs = array('PAGANTIS_TITLE'=>'Instant Financing', |
19 | - 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
20 | - 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
21 | - 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
22 | - 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
23 | - 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
24 | - 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
25 | - 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
26 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
27 | - 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
28 | - 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
29 | - 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
30 | - 'PAGANTIS_URL_OK'=>'', |
|
31 | - 'PAGANTIS_URL_KO'=>'', |
|
32 | - 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!', |
|
33 | - 'PAGANTIS_ALLOWED_COUNTRIES' => 'a:2:{i:0;s:2:"es";i:1;s:2:"it";}' |
|
19 | + 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
20 | + 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
21 | + 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
22 | + 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
23 | + 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
24 | + 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
25 | + 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
26 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
27 | + 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
28 | + 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
29 | + 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
30 | + 'PAGANTIS_URL_OK'=>'', |
|
31 | + 'PAGANTIS_URL_KO'=>'', |
|
32 | + 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!', |
|
33 | + 'PAGANTIS_ALLOWED_COUNTRIES' => 'a:2:{i:0;s:2:"es";i:1;s:2:"it";}' |
|
34 | 34 | ); |
35 | 35 | |
36 | 36 | /** |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function execute(\Magento\Framework\Event\Observer $observer) |
17 | 17 | { |
18 | 18 | try { |
19 | - if ($observer->getEvent()->getMethodInstance()->getCode()=="pagantis") { |
|
19 | + if ($observer->getEvent()->getMethodInstance()->getCode() == "pagantis") { |
|
20 | 20 | $checkResult = $observer->getEvent()->getResult(); |
21 | 21 | $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); |
22 | 22 | $config = $objectManager->create('Pagantis\Pagantis\Helper\Config')->getConfig(); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $availableCountry = (in_array(strtolower($locale), $allowedCountries)); |
28 | 28 | if (!isset($config['pagantis_public_key']) || $config['pagantis_public_key'] == '' || |
29 | 29 | !isset($config['pagantis_private_key']) || $config['pagantis_private_key'] == '' || |
30 | - !$availableCountry ) { |
|
30 | + !$availableCountry) { |
|
31 | 31 | $checkResult->setData('is_available', false); |
32 | 32 | } else { |
33 | 33 | $checkResult->setData('is_available', true); |