@@ -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; |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | public function setProdutos($produtos) |
205 | 205 | { |
206 | 206 | foreach ($produtos as $produto) |
207 | - $this->produtos[] = SerializerHelper::denormalize($produto, Produto::class); |
|
207 | + $this->produtos[ ] = SerializerHelper::denormalize($produto, Produto::class); |
|
208 | 208 | |
209 | 209 | return $this; |
210 | 210 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | { |
442 | 442 | $this->pedidoStatus = $pedidoStatus; |
443 | 443 | |
444 | - if(is_array($this->pedidoStatus)) |
|
444 | + if (is_array($this->pedidoStatus)) |
|
445 | 445 | $this->pedidoStatus = SerializerHelper::denormalize($this->pedidoStatus, PedidoStatus::class); |
446 | 446 | |
447 | 447 | return $this; |
@@ -155,7 +155,7 @@ |
||
155 | 155 | return [ |
156 | 156 | 'status' => $this->status, |
157 | 157 | 'dataInicio' => empty($this->dataInicio) ? null : $this->dataInicio->format('d/m/Y H:i:s'), |
158 | - 'dataFim' => empty($this->dataFim) ? null :$this->dataFim->format('d/m/Y H:i:s'), |
|
158 | + 'dataFim' => empty($this->dataFim) ? null : $this->dataFim->format('d/m/Y H:i:s'), |
|
159 | 159 | 'tipo' => $this->tipo, |
160 | 160 | 'valorComDivergencia' => $this->valorComDivergencia, |
161 | 161 | 'referencia' => $this->referencia |
@@ -63,7 +63,7 @@ |
||
63 | 63 | { |
64 | 64 | $this->pedido = $pedido; |
65 | 65 | |
66 | - if(is_array($this->pedido)) |
|
66 | + if (is_array($this->pedido)) |
|
67 | 67 | $this->pedido = SerializerHelper::denormalize($this->pedido, Pedido::class); |
68 | 68 | |
69 | 69 | return $this; |
@@ -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 | } |
@@ -21,24 +21,24 @@ |
||
21 | 21 | */ |
22 | 22 | public static function getInstance(array $params, Client $client = null) |
23 | 23 | { |
24 | - if(!isset($params[ControlPayParameterConst::CONTROLPAY_OAUTH_TYPE])) |
|
24 | + if (!isset($params[ ControlPayParameterConst::CONTROLPAY_OAUTH_TYPE ])) |
|
25 | 25 | throw new \Exception("Tipo de autenticação não especificado"); |
26 | 26 | |
27 | - switch ($params[ControlPayParameterConst::CONTROLPAY_OAUTH_TYPE]) |
|
27 | + switch ($params[ ControlPayParameterConst::CONTROLPAY_OAUTH_TYPE ]) |
|
28 | 28 | { |
29 | 29 | case BasicAuthentication::class: |
30 | 30 | return new BasicAuthentication( |
31 | - isset($params[ControlPayParameterConst::CONTROLPAY_USER]) ?$params[ControlPayParameterConst::CONTROLPAY_USER] : null, |
|
32 | - isset($params[ControlPayParameterConst::CONTROLPAY_PWD]) ?$params[ControlPayParameterConst::CONTROLPAY_PWD] : null, |
|
33 | - isset($params[ControlPayParameterConst::CONTROLPAY_KEY]) ?$params[ControlPayParameterConst::CONTROLPAY_KEY] : null |
|
31 | + isset($params[ ControlPayParameterConst::CONTROLPAY_USER ]) ? $params[ ControlPayParameterConst::CONTROLPAY_USER ] : null, |
|
32 | + isset($params[ ControlPayParameterConst::CONTROLPAY_PWD ]) ? $params[ ControlPayParameterConst::CONTROLPAY_PWD ] : null, |
|
33 | + isset($params[ ControlPayParameterConst::CONTROLPAY_KEY ]) ? $params[ ControlPayParameterConst::CONTROLPAY_KEY ] : null |
|
34 | 34 | ); |
35 | 35 | break; |
36 | 36 | case KeyQueryStringAuthentication::class: |
37 | 37 | return new KeyQueryStringAuthentication( |
38 | - isset($params[ControlPayParameterConst::CONTROLPAY_USER]) ?$params[ControlPayParameterConst::CONTROLPAY_USER] : null, |
|
39 | - isset($params[ControlPayParameterConst::CONTROLPAY_PWD]) ?$params[ControlPayParameterConst::CONTROLPAY_PWD] : null, |
|
40 | - isset($params[ControlPayParameterConst::CONTROLPAY_KEY]) ?$params[ControlPayParameterConst::CONTROLPAY_KEY] : null, |
|
41 | - isset($params[ControlPayParameterConst::CONTROLPAY_DEFAULT_PESSOA_ID]) ?$params[ControlPayParameterConst::CONTROLPAY_DEFAULT_PESSOA_ID] : null, |
|
38 | + isset($params[ ControlPayParameterConst::CONTROLPAY_USER ]) ? $params[ ControlPayParameterConst::CONTROLPAY_USER ] : null, |
|
39 | + isset($params[ ControlPayParameterConst::CONTROLPAY_PWD ]) ? $params[ ControlPayParameterConst::CONTROLPAY_PWD ] : null, |
|
40 | + isset($params[ ControlPayParameterConst::CONTROLPAY_KEY ]) ? $params[ ControlPayParameterConst::CONTROLPAY_KEY ] : null, |
|
41 | + isset($params[ ControlPayParameterConst::CONTROLPAY_DEFAULT_PESSOA_ID ]) ? $params[ ControlPayParameterConst::CONTROLPAY_DEFAULT_PESSOA_ID ] : null, |
|
42 | 42 | $client |
43 | 43 | ); |
44 | 44 | break; |
@@ -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 | } |
@@ -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 | } |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function login(Contracts\Login\LoginRequest $loginRequest) |
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($loginRequest) |
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 | } |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function logOut() |
55 | 55 | { |
56 | - try{ |
|
57 | - $this->response = $this->_httpClient->post(__FUNCTION__,[]); |
|
56 | + try { |
|
57 | + $this->response = $this->_httpClient->post(__FUNCTION__, [ ]); |
|
58 | 58 | |
59 | 59 | return true; |
60 | 60 | }catch (RequestException $ex) { |
61 | 61 | $this->requestException($ex); |
62 | - }catch (\Exception $ex){ |
|
62 | + }catch (\Exception $ex) { |
|
63 | 63 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
64 | 64 | } |
65 | 65 | } |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function consultaLogin(Contracts\Login\ConsultaLoginRequest $consultaLoginRequest) |
73 | 73 | { |
74 | - try{ |
|
75 | - $this->response = $this->_httpClient->post(__FUNCTION__,[ |
|
74 | + try { |
|
75 | + $this->response = $this->_httpClient->post(__FUNCTION__, [ |
|
76 | 76 | 'body' => json_encode($consultaLoginRequest) |
77 | 77 | ]); |
78 | 78 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ); |
83 | 83 | }catch (RequestException $ex) { |
84 | 84 | $this->requestException($ex); |
85 | - }catch (\Exception $ex){ |
|
85 | + }catch (\Exception $ex) { |
|
86 | 86 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
87 | 87 | } |
88 | 88 | } |