@@ -41,10 +41,10 @@ |
||
| 41 | 41 | $response->json(), |
| 42 | 42 | Contracts\Produto\GetByAtivosByPessoaIdResponse::class |
| 43 | 43 | ); |
| 44 | - }catch (RequestException $ex) { |
|
| 44 | + } catch (RequestException $ex) { |
|
| 45 | 45 | $responseBody = $ex->getResponse()->json(); |
| 46 | 46 | throw new \Exception($responseBody['message']); |
| 47 | - }catch (\Exception $ex){ |
|
| 47 | + } catch (\Exception $ex){ |
|
| 48 | 48 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function getByFiltros(Contracts\PagamentoExterno\GetByFiltrosRequest $getByFiltrosRequest) |
| 32 | 32 | { |
| 33 | - try{ |
|
| 34 | - $this->response = $this->_httpClient->post(__FUNCTION__,[ |
|
| 33 | + try { |
|
| 34 | + $this->response = $this->_httpClient->post(__FUNCTION__, [ |
|
| 35 | 35 | 'body' => json_encode($getByFiltrosRequest), |
| 36 | 36 | ]); |
| 37 | 37 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | ); |
| 42 | 42 | }catch (RequestException $ex) { |
| 43 | 43 | $this->requestException($ex); |
| 44 | - }catch (\Exception $ex){ |
|
| 44 | + }catch (\Exception $ex) { |
|
| 45 | 45 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | $response->json(), |
| 41 | 41 | Contracts\Login\LoginResponse::class |
| 42 | 42 | ); |
| 43 | - }catch (RequestException $ex) { |
|
| 43 | + } catch (RequestException $ex) { |
|
| 44 | 44 | $responseBody = $ex->getResponse()->json(); |
| 45 | 45 | throw new \Exception($responseBody['message']); |
| 46 | - }catch (\Exception $ex){ |
|
| 46 | + } catch (\Exception $ex){ |
|
| 47 | 47 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -58,10 +58,10 @@ discard block |
||
| 58 | 58 | $this->_httpClient->post(__FUNCTION__,[]); |
| 59 | 59 | |
| 60 | 60 | return true; |
| 61 | - }catch (RequestException $ex) { |
|
| 61 | + } catch (RequestException $ex) { |
|
| 62 | 62 | $responseBody = $ex->getResponse()->json(); |
| 63 | 63 | throw new \Exception($responseBody['message']); |
| 64 | - }catch (\Exception $ex){ |
|
| 64 | + } catch (\Exception $ex){ |
|
| 65 | 65 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | $response->json(), |
| 83 | 83 | Contracts\Login\ConsultaLoginResponse::class |
| 84 | 84 | ); |
| 85 | - }catch (RequestException $ex) { |
|
| 85 | + } catch (RequestException $ex) { |
|
| 86 | 86 | $responseBody = $ex->getResponse()->json(); |
| 87 | 87 | throw new \Exception($responseBody['message']); |
| 88 | - }catch (\Exception $ex){ |
|
| 88 | + } catch (\Exception $ex){ |
|
| 89 | 89 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function getByPessoaId($pessoaId) |
| 32 | 32 | { |
| 33 | - try{ |
|
| 34 | - $this->response = $this->_httpClient->post(__FUNCTION__,[ |
|
| 33 | + try { |
|
| 34 | + $this->response = $this->_httpClient->post(__FUNCTION__, [ |
|
| 35 | 35 | 'query' => $this->addQueryAdditionalParameters([ |
| 36 | 36 | 'pessoaId' => $pessoaId |
| 37 | 37 | ]) |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ); |
| 44 | 44 | }catch (RequestException $ex) { |
| 45 | 45 | $this->requestException($ex); |
| 46 | - }catch (\Exception $ex){ |
|
| 46 | + }catch (\Exception $ex) { |
|
| 47 | 47 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function getById($terminalId) |
| 57 | 57 | { |
| 58 | - try{ |
|
| 59 | - $this->response = $this->_httpClient->post(__FUNCTION__,[ |
|
| 58 | + try { |
|
| 59 | + $this->response = $this->_httpClient->post(__FUNCTION__, [ |
|
| 60 | 60 | 'query' => $this->addQueryAdditionalParameters([ |
| 61 | 61 | 'terminalId' => $terminalId |
| 62 | 62 | ]) |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | ); |
| 69 | 69 | }catch (RequestException $ex) { |
| 70 | 70 | $this->requestException($ex); |
| 71 | - }catch (\Exception $ex){ |
|
| 71 | + }catch (\Exception $ex) { |
|
| 72 | 72 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 73 | 73 | } |
| 74 | 74 | } |
@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function insert(Contracts\Terminal\InsertRequest $insertRequest) |
| 82 | 82 | { |
| 83 | - try{ |
|
| 84 | - $this->response = $this->_httpClient->post(__FUNCTION__,[ |
|
| 83 | + try { |
|
| 84 | + $this->response = $this->_httpClient->post(__FUNCTION__, [ |
|
| 85 | 85 | 'body' => json_encode($insertRequest) |
| 86 | 86 | ]); |
| 87 | 87 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | ); |
| 92 | 92 | }catch (RequestException $ex) { |
| 93 | 93 | $this->requestException($ex); |
| 94 | - }catch (\Exception $ex){ |
|
| 94 | + }catch (\Exception $ex) { |
|
| 95 | 95 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | $response->json(), |
| 46 | 46 | Contracts\Venda\VenderResponse::class |
| 47 | 47 | ); |
| 48 | - }catch (RequestException $ex) { |
|
| 48 | + } catch (RequestException $ex) { |
|
| 49 | 49 | $responseBody = $ex->getResponse()->json(); |
| 50 | 50 | throw new \Exception($responseBody['message']); |
| 51 | - }catch (\Exception $ex){ |
|
| 51 | + } catch (\Exception $ex){ |
|
| 52 | 52 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -72,11 +72,11 @@ discard block |
||
| 72 | 72 | $response->json(), |
| 73 | 73 | Contracts\Venda\ConsultarVendasResponse::class |
| 74 | 74 | ); |
| 75 | - }catch (RequestException $ex) { |
|
| 75 | + } catch (RequestException $ex) { |
|
| 76 | 76 | $responseBody = $ex->getResponse()->json(); |
| 77 | 77 | var_dump($responseBody); |
| 78 | 78 | throw new \Exception($responseBody['message']); |
| 79 | - }catch (\Exception $ex){ |
|
| 79 | + } catch (\Exception $ex){ |
|
| 80 | 80 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function getByFiltros(Contracts\IntencaoVenda\GetByFiltrosRequest $getByFiltrosRequest) |
| 33 | 33 | { |
| 34 | - try{ |
|
| 35 | - $this->response = $this->_httpClient->post(__FUNCTION__,[ |
|
| 34 | + try { |
|
| 35 | + $this->response = $this->_httpClient->post(__FUNCTION__, [ |
|
| 36 | 36 | 'body' => json_encode($getByFiltrosRequest), |
| 37 | 37 | ]); |
| 38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | ); |
| 43 | 43 | }catch (RequestException $ex) { |
| 44 | 44 | $this->requestException($ex); |
| 45 | - }catch (\Exception $ex){ |
|
| 45 | + }catch (\Exception $ex) { |
|
| 46 | 46 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function getById($intencaoVendaId) |
| 56 | 56 | { |
| 57 | - try{ |
|
| 58 | - $this->response = $this->_httpClient->post(__FUNCTION__,[ |
|
| 57 | + try { |
|
| 58 | + $this->response = $this->_httpClient->post(__FUNCTION__, [ |
|
| 59 | 59 | 'query' => $this->addQueryAdditionalParameters([ |
| 60 | 60 | 'intencaoVendaId' => $intencaoVendaId |
| 61 | 61 | ]) |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ); |
| 68 | 68 | }catch (RequestException $ex) { |
| 69 | 69 | $this->requestException($ex); |
| 70 | - }catch (\Exception $ex){ |
|
| 70 | + }catch (\Exception $ex) { |
|
| 71 | 71 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -337,7 +337,7 @@ |
||
| 337 | 337 | { |
| 338 | 338 | |
| 339 | 339 | foreach ($produtosVendidos as $produto) |
| 340 | - $this->produtosVendidos[] = is_array($produto) ? SerializerHelper::denormalize($produto, Produto::class) : $produto; |
|
| 340 | + $this->produtosVendidos[ ] = is_array($produto) ? SerializerHelper::denormalize($produto, Produto::class) : $produto; |
|
| 341 | 341 | |
| 342 | 342 | return $this; |
| 343 | 343 | } |
@@ -336,8 +336,9 @@ |
||
| 336 | 336 | public function setProdutosVendidos($produtosVendidos) |
| 337 | 337 | { |
| 338 | 338 | |
| 339 | - foreach ($produtosVendidos as $produto) |
|
| 340 | - $this->produtosVendidos[] = is_array($produto) ? SerializerHelper::denormalize($produto, Produto::class) : $produto; |
|
| 339 | + foreach ($produtosVendidos as $produto) { |
|
| 340 | + $this->produtosVendidos[] = is_array($produto) ? SerializerHelper::denormalize($produto, Produto::class) : $produto; |
|
| 341 | + } |
|
| 341 | 342 | |
| 342 | 343 | return $this; |
| 343 | 344 | } |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | { |
| 63 | 63 | $this->intencaoVenda = $intencaoVenda; |
| 64 | 64 | |
| 65 | - if(is_array($this->intencaoVenda)) |
|
| 65 | + if (is_array($this->intencaoVenda)) |
|
| 66 | 66 | $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class); |
| 67 | 67 | |
| 68 | 68 | return $this; |
@@ -62,8 +62,9 @@ |
||
| 62 | 62 | { |
| 63 | 63 | $this->intencaoVenda = $intencaoVenda; |
| 64 | 64 | |
| 65 | - if(is_array($this->intencaoVenda)) |
|
| 66 | - $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class); |
|
| 65 | + if(is_array($this->intencaoVenda)) { |
|
| 66 | + $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class); |
|
| 67 | + } |
|
| 67 | 68 | |
| 68 | 69 | return $this; |
| 69 | 70 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * @param \DateTime $data |
| 47 | - * @return InserirResponse |
|
| 47 | + * @return GetByFiltrosResponse |
|
| 48 | 48 | */ |
| 49 | 49 | public function setData($data) |
| 50 | 50 | { |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | public function setPedidos($pedidos) |
| 68 | 68 | { |
| 69 | 69 | foreach ($pedidos as $pedido) |
| 70 | - $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 70 | + $this->pedidos[ ] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 71 | 71 | |
| 72 | 72 | return $this; |
| 73 | 73 | } |
@@ -66,8 +66,9 @@ |
||
| 66 | 66 | */ |
| 67 | 67 | public function setPedidos($pedidos) |
| 68 | 68 | { |
| 69 | - foreach ($pedidos as $pedido) |
|
| 70 | - $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 69 | + foreach ($pedidos as $pedido) { |
|
| 70 | + $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 71 | + } |
|
| 71 | 72 | |
| 72 | 73 | return $this; |
| 73 | 74 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * @param \DateTime $data |
| 47 | - * @return InserirResponse |
|
| 47 | + * @return GetByPessoaIdByReferenciaResponse |
|
| 48 | 48 | */ |
| 49 | 49 | public function setData($data) |
| 50 | 50 | { |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | public function setPedidos($pedidos) |
| 68 | 68 | { |
| 69 | 69 | foreach ($pedidos as $pedido) |
| 70 | - $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 70 | + $this->pedidos[ ] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 71 | 71 | |
| 72 | 72 | return $this; |
| 73 | 73 | } |
@@ -66,8 +66,9 @@ |
||
| 66 | 66 | */ |
| 67 | 67 | public function setPedidos($pedidos) |
| 68 | 68 | { |
| 69 | - foreach ($pedidos as $pedido) |
|
| 70 | - $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 69 | + foreach ($pedidos as $pedido) { |
|
| 70 | + $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 71 | + } |
|
| 71 | 72 | |
| 72 | 73 | return $this; |
| 73 | 74 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * @param \DateTime $data |
| 47 | - * @return InserirResponse |
|
| 47 | + * @return GetPedidosByPessoaIdResponse |
|
| 48 | 48 | */ |
| 49 | 49 | public function setData($data) |
| 50 | 50 | { |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | public function setPedidos($pedidos) |
| 68 | 68 | { |
| 69 | 69 | foreach ($pedidos as $pedido) |
| 70 | - $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 70 | + $this->pedidos[ ] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 71 | 71 | |
| 72 | 72 | return $this; |
| 73 | 73 | } |
@@ -66,8 +66,9 @@ |
||
| 66 | 66 | */ |
| 67 | 67 | public function setPedidos($pedidos) |
| 68 | 68 | { |
| 69 | - foreach ($pedidos as $pedido) |
|
| 70 | - $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 69 | + foreach ($pedidos as $pedido) { |
|
| 70 | + $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class); |
|
| 71 | + } |
|
| 71 | 72 | |
| 72 | 73 | return $this; |
| 73 | 74 | } |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Integracao\ControlPay\Contracts\Pedido; |
| 4 | 4 | |
| 5 | -use Integracao\ControlPay\Helpers\SerializerHelper; |
|
| 6 | 5 | use Integracao\ControlPay\Model\Produto; |
| 7 | 6 | |
| 8 | 7 | /** |