@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $this->assertNotEmpty($orderUrl); |
| 60 | 60 | |
| 61 | 61 | $orderArray = explode('/', $orderUrl); |
| 62 | - $magentoOrderId = (int)$orderArray['8']; |
|
| 62 | + $magentoOrderId = (int) $orderArray['8']; |
|
| 63 | 63 | $this->assertNotEmpty($magentoOrderId); |
| 64 | 64 | $notifyUrl = self::MAGENTO_URL.self::NOTIFICATION_FOLDER.'?'.self::NOTIFICATION_PARAMETER.'='.$magentoOrderId; |
| 65 | 65 | $response = Request::post($notifyUrl)->expects('json')->send(); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $condition = WebDriverExpectedCondition::visibilityOfElementLocated($elementSearch); |
| 79 | 79 | $this->webDriver->wait()->until($condition); |
| 80 | 80 | $otherElement = $this->findById('payment_us_other_payment_methods-head'); |
| 81 | - if ($otherElement->getAttribute('class')!='open') { |
|
| 81 | + if ($otherElement->getAttribute('class') != 'open') { |
|
| 82 | 82 | $otherElement->click(); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $this->webDriver->wait()->until($condition); |
| 88 | 88 | $this->assertTrue((bool) $condition, "PR4"); |
| 89 | 89 | $paylaterElement = $this->findById('payment_us_paylater-head'); |
| 90 | - if ($paylaterElement->getAttribute('class')!='open') { |
|
| 90 | + if ($paylaterElement->getAttribute('class') != 'open') { |
|
| 91 | 91 | $paylaterElement->click(); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | $this->webDriver->get(self::MAGENTO_URL.self::CHECKOUT_FOLDER); |
| 289 | 289 | $condition = WebDriverExpectedCondition::titleContains(self::CHECKOUT_TITLE); |
| 290 | 290 | $this->webDriver->wait()->until($condition); |
| 291 | - $this->assertTrue((bool)$condition, self::MAGENTO_URL.self::CHECKOUT_FOLDER); |
|
| 291 | + $this->assertTrue((bool) $condition, self::MAGENTO_URL.self::CHECKOUT_FOLDER); |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /** |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | $this->webDriver->wait()->until($condition); |
| 302 | 302 | $this->assertTrue((bool) $condition); |
| 303 | 303 | $this->assertSame( |
| 304 | - $this->configuration['firstname'] . ' ' . $this->configuration['lastname'], |
|
| 304 | + $this->configuration['firstname'].' '.$this->configuration['lastname'], |
|
| 305 | 305 | $this->findByClass('FieldsPreview-desc')->getText() |
| 306 | 306 | ); |
| 307 | 307 | } |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | { |
| 316 | 316 | $condition = WebDriverExpectedCondition::titleContains(self::PMT_TITLE); |
| 317 | 317 | $this->webDriver->wait(300)->until($condition, $this->webDriver->getCurrentURL()); |
| 318 | - $this->assertTrue((bool)$condition, "PR32"); |
|
| 318 | + $this->assertTrue((bool) $condition, "PR32"); |
|
| 319 | 319 | |
| 320 | 320 | SeleniumHelper::finishForm($this->webDriver); |
| 321 | 321 | } |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | $simulatorPrice = $simulatorElement->getAttribute('data-pmt-amount'); |
| 434 | 434 | $simulatorPrice = preg_replace('/[^\x{20}-\x{7F}]/u', '', $simulatorPrice); |
| 435 | 435 | $price = preg_replace('/[^\x{20}-\x{7F}]/u', '', $price); |
| 436 | - $this->assertContains($simulatorPrice, $price, json_encode(array($price,$simulatorPrice))); |
|
| 436 | + $this->assertContains($simulatorPrice, $price, json_encode(array($price, $simulatorPrice))); |
|
| 437 | 437 | |
| 438 | 438 | sleep(2); |
| 439 | 439 | $checkoutButton = WebDriverBy::cssSelector("#checkout-payment-method-load > .payment-methods > .payment-group > ._active > .payment-method-content > .actions-toolbar > .primary"); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | const CC_ERR_MSG = 'Unable to block resource'; |
| 41 | 41 | const CC_NO_QUOTE = 'QuoteId not found'; |
| 42 | - const CC_NO_VALIDATE ='Validation in progress, try again later'; |
|
| 42 | + const CC_NO_VALIDATE = 'Validation in progress, try again later'; |
|
| 43 | 43 | const GMO_ERR_MSG = 'Merchant Order Not Found'; |
| 44 | 44 | const GPOI_ERR_MSG = 'Pmt Order Not Found'; |
| 45 | 45 | const GPOI_NO_ORDERID = 'We can not get the PagaMasTarde identification in database.'; |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $status = $exception->status; |
| 153 | 153 | $response = array(); |
| 154 | 154 | $response['timestamp'] = time(); |
| 155 | - $response['order_id']= $this->magentoOrderId; |
|
| 155 | + $response['order_id'] = $this->magentoOrderId; |
|
| 156 | 156 | $response['result'] = $exception->result; |
| 157 | 157 | $response['result_description'] = $exception->result_description; |
| 158 | 158 | $response = json_encode($response); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $status = $exception->status; |
| 170 | 170 | $response = array(); |
| 171 | 171 | $response['timestamp'] = time(); |
| 172 | - $response['order_id']= $this->magentoOrderId; |
|
| 172 | + $response['order_id'] = $this->magentoOrderId; |
|
| 173 | 173 | $response['result'] = self::CPO_ERR_MSG; |
| 174 | 174 | $response['result_description'] = $exception->result_description; |
| 175 | 175 | $response = json_encode($response); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 181 | 181 | header("HTTP/1.1 $status", true, $status); |
| 182 | 182 | header('Content-Type: application/json', true); |
| 183 | - header('Content-Length: ' . strlen($response)); |
|
| 183 | + header('Content-Length: '.strlen($response)); |
|
| 184 | 184 | echo ($response); |
| 185 | 185 | exit(); |
| 186 | 186 | } else { |
@@ -202,9 +202,9 @@ discard block |
||
| 202 | 202 | $this->blockConcurrency(); |
| 203 | 203 | } catch (\Exception $e) { |
| 204 | 204 | $exceptionObject = new \stdClass(); |
| 205 | - $exceptionObject->method= __FUNCTION__; |
|
| 206 | - $exceptionObject->status='429'; |
|
| 207 | - $exceptionObject->result= self::CC_ERR_MSG; |
|
| 205 | + $exceptionObject->method = __FUNCTION__; |
|
| 206 | + $exceptionObject->status = '429'; |
|
| 207 | + $exceptionObject->result = self::CC_ERR_MSG; |
|
| 208 | 208 | $exceptionObject->result_description = $e->getMessage(); |
| 209 | 209 | throw new \Exception(serialize($exceptionObject)); |
| 210 | 210 | } |
@@ -216,9 +216,9 @@ discard block |
||
| 216 | 216 | $this->quote = $this->quoteRepository->get($this->quoteId); |
| 217 | 217 | } catch (\Exception $e) { |
| 218 | 218 | $exceptionObject = new \stdClass(); |
| 219 | - $exceptionObject->method= __FUNCTION__; |
|
| 220 | - $exceptionObject->status='404'; |
|
| 221 | - $exceptionObject->result= self::GMO_ERR_MSG; |
|
| 219 | + $exceptionObject->method = __FUNCTION__; |
|
| 220 | + $exceptionObject->status = '404'; |
|
| 221 | + $exceptionObject->result = self::GMO_ERR_MSG; |
|
| 222 | 222 | $exceptionObject->result_description = $e->getMessage(); |
| 223 | 223 | throw new \Exception(serialize($exceptionObject)); |
| 224 | 224 | } |
@@ -230,9 +230,9 @@ discard block |
||
| 230 | 230 | $this->getPmtOrderIdDb(); |
| 231 | 231 | } catch (\Exception $e) { |
| 232 | 232 | $exceptionObject = new \stdClass(); |
| 233 | - $exceptionObject->method= __FUNCTION__; |
|
| 234 | - $exceptionObject->status='404'; |
|
| 235 | - $exceptionObject->result= self::GPOI_ERR_MSG; |
|
| 233 | + $exceptionObject->method = __FUNCTION__; |
|
| 234 | + $exceptionObject->status = '404'; |
|
| 235 | + $exceptionObject->result = self::GPOI_ERR_MSG; |
|
| 236 | 236 | $exceptionObject->result_description = $e->getMessage(); |
| 237 | 237 | throw new \Exception(serialize($exceptionObject)); |
| 238 | 238 | } |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | $this->pmtOrder = $this->orderClient->getOrder($this->pmtOrderId); |
| 246 | 246 | } catch (\Exception $e) { |
| 247 | 247 | $exceptionObject = new \stdClass(); |
| 248 | - $exceptionObject->method= __FUNCTION__; |
|
| 249 | - $exceptionObject->status='400'; |
|
| 250 | - $exceptionObject->result= self::GPO_ERR_MSG; |
|
| 248 | + $exceptionObject->method = __FUNCTION__; |
|
| 249 | + $exceptionObject->status = '400'; |
|
| 250 | + $exceptionObject->result = self::GPO_ERR_MSG; |
|
| 251 | 251 | $exceptionObject->result_description = $e->getMessage(); |
| 252 | 252 | throw new \Exception(serialize($exceptionObject)); |
| 253 | 253 | } |
@@ -260,14 +260,14 @@ discard block |
||
| 260 | 260 | } catch (\Exception $e) { |
| 261 | 261 | $this->getMagentoOrderId(); |
| 262 | 262 | $exceptionObject = new \stdClass(); |
| 263 | - $exceptionObject->method= __FUNCTION__; |
|
| 264 | - if ($this->magentoOrderId!='') { |
|
| 265 | - $exceptionObject->status='200'; |
|
| 266 | - $exceptionObject->result= self::CMOS_ALREADY_PROCESSED; |
|
| 263 | + $exceptionObject->method = __FUNCTION__; |
|
| 264 | + if ($this->magentoOrderId != '') { |
|
| 265 | + $exceptionObject->status = '200'; |
|
| 266 | + $exceptionObject->result = self::CMOS_ALREADY_PROCESSED; |
|
| 267 | 267 | $exceptionObject->result_description = self::CMOS_ALREADY_PROCESSED; |
| 268 | 268 | } else { |
| 269 | - $exceptionObject->status='403'; |
|
| 270 | - $exceptionObject->result= self::COS_ERR_MSG; |
|
| 269 | + $exceptionObject->status = '403'; |
|
| 270 | + $exceptionObject->result = self::COS_ERR_MSG; |
|
| 271 | 271 | $exceptionObject->result_description = $e->getMessage(); |
| 272 | 272 | } |
| 273 | 273 | throw new \Exception(serialize($exceptionObject)); |
@@ -280,9 +280,9 @@ discard block |
||
| 280 | 280 | $this->checkCartStatus(); |
| 281 | 281 | } catch (\Exception $e) { |
| 282 | 282 | $exceptionObject = new \stdClass(); |
| 283 | - $exceptionObject->method= __FUNCTION__; |
|
| 284 | - $exceptionObject->status='409'; |
|
| 285 | - $exceptionObject->result= self::CMOS_ERR_MSG; |
|
| 283 | + $exceptionObject->method = __FUNCTION__; |
|
| 284 | + $exceptionObject->status = '409'; |
|
| 285 | + $exceptionObject->result = self::CMOS_ERR_MSG; |
|
| 286 | 286 | $exceptionObject->result_description = $e->getMessage(); |
| 287 | 287 | throw new \Exception(serialize($exceptionObject)); |
| 288 | 288 | } |
@@ -294,9 +294,9 @@ discard block |
||
| 294 | 294 | $this->comparePrices(); |
| 295 | 295 | } catch (\Exception $e) { |
| 296 | 296 | $exceptionObject = new \stdClass(); |
| 297 | - $exceptionObject->method= __FUNCTION__; |
|
| 298 | - $exceptionObject->status='409'; |
|
| 299 | - $exceptionObject->result= self::VA_ERR_MSG; |
|
| 297 | + $exceptionObject->method = __FUNCTION__; |
|
| 298 | + $exceptionObject->status = '409'; |
|
| 299 | + $exceptionObject->result = self::VA_ERR_MSG; |
|
| 300 | 300 | $exceptionObject->result_description = $e->getMessage(); |
| 301 | 301 | throw new \Exception(serialize($exceptionObject)); |
| 302 | 302 | } |
@@ -309,9 +309,9 @@ discard block |
||
| 309 | 309 | $this->updateBdInfo(); |
| 310 | 310 | } catch (\Exception $e) { |
| 311 | 311 | $exceptionObject = new \stdClass(); |
| 312 | - $exceptionObject->method= __FUNCTION__; |
|
| 313 | - $exceptionObject->status='500'; |
|
| 314 | - $exceptionObject->result= self::PMO_ERR_MSG; |
|
| 312 | + $exceptionObject->method = __FUNCTION__; |
|
| 313 | + $exceptionObject->status = '500'; |
|
| 314 | + $exceptionObject->result = self::PMO_ERR_MSG; |
|
| 315 | 315 | $exceptionObject->result_description = $e->getMessage(); |
| 316 | 316 | throw new \Exception(serialize($exceptionObject)); |
| 317 | 317 | } |
@@ -323,9 +323,9 @@ discard block |
||
| 323 | 323 | $this->pmtOrder = $this->orderClient->confirmOrder($this->pmtOrderId); |
| 324 | 324 | } catch (\Exception $e) { |
| 325 | 325 | $exceptionObject = new \stdClass(); |
| 326 | - $exceptionObject->method= __FUNCTION__; |
|
| 327 | - $exceptionObject->status='500'; |
|
| 328 | - $exceptionObject->result= self::CPO_ERR_MSG; |
|
| 326 | + $exceptionObject->method = __FUNCTION__; |
|
| 327 | + $exceptionObject->status = '500'; |
|
| 328 | + $exceptionObject->result = self::CPO_ERR_MSG; |
|
| 329 | 329 | $exceptionObject->result_description = $e->getMessage(); |
| 330 | 330 | throw new \Exception(serialize($exceptionObject)); |
| 331 | 331 | } |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $response = array(); |
| 334 | 334 | $response['status'] = '200'; |
| 335 | 335 | $response['timestamp'] = time(); |
| 336 | - $response['order_id']= $this->magentoOrderId; |
|
| 336 | + $response['order_id'] = $this->magentoOrderId; |
|
| 337 | 337 | $response['result'] = self::CPO_OK_MSG; |
| 338 | 338 | $response = json_encode($response); |
| 339 | 339 | return $response; |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | $tableName = $this->dbObject->getTableName(self::CONCURRENCY_TABLE); |
| 402 | 402 | if ($mode == false) { |
| 403 | 403 | $dbConnection->delete($tableName, "timestamp<".(time() - 5)); |
| 404 | - } elseif ($this->quoteId!='') { |
|
| 404 | + } elseif ($this->quoteId != '') { |
|
| 405 | 405 | $dbConnection->delete($tableName, "id=".$this->quoteId); |
| 406 | 406 | } |
| 407 | 407 | } catch (Exception $exception) { |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | */ |
| 469 | 469 | private function checkCartStatus() |
| 470 | 470 | { |
| 471 | - if ($this->quote->getIsActive()=='0') { |
|
| 471 | + if ($this->quote->getIsActive() == '0') { |
|
| 472 | 472 | $this->getMagentoOrderId(); |
| 473 | 473 | throw new \Exception(self::CMOS_ALREADY_PROCESSED); |
| 474 | 474 | } |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | private function getRedirectUrl() |
| 542 | 542 | { |
| 543 | 543 | $returnUrl = 'checkout/#payment'; |
| 544 | - if ($this->magentoOrderId!='') { |
|
| 544 | + if ($this->magentoOrderId != '') { |
|
| 545 | 545 | /** @var Order $this->magentoOrder */ |
| 546 | 546 | $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId); |
| 547 | 547 | if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) { |