@@ -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; |
@@ -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 | } |
@@ -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; |
@@ -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 | } |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function getByAtivosByPessoaId($pessoaId) |
| 32 | 32 | { |
| 33 | - try{ |
|
| 34 | - $this->response = $this->_httpClient->get(__FUNCTION__,[ |
|
| 33 | + try { |
|
| 34 | + $this->response = $this->_httpClient->get(__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 | } |
@@ -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 getByFiltrosAsync(Contracts\IntencaoVenda\GetByFiltrosRequest $getByFiltrosRequest) |
| 56 | 56 | { |
| 57 | - try{ |
|
| 58 | - $this->response = $this->_httpClient->post(__FUNCTION__,[ |
|
| 57 | + try { |
|
| 58 | + $this->response = $this->_httpClient->post(__FUNCTION__, [ |
|
| 59 | 59 | 'body' => json_encode($getByFiltrosRequest), |
| 60 | 60 | ]); |
| 61 | 61 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ); |
| 66 | 66 | }catch (RequestException $ex) { |
| 67 | 67 | $this->requestException($ex); |
| 68 | - }catch (\Exception $ex){ |
|
| 68 | + }catch (\Exception $ex) { |
|
| 69 | 69 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function getById($intencaoVendaId) |
| 79 | 79 | { |
| 80 | - try{ |
|
| 81 | - $this->response = $this->_httpClient->post(__FUNCTION__,[ |
|
| 80 | + try { |
|
| 81 | + $this->response = $this->_httpClient->post(__FUNCTION__, [ |
|
| 82 | 82 | 'query' => $this->addQueryAdditionalParameters([ |
| 83 | 83 | 'intencaoVendaId' => $intencaoVendaId |
| 84 | 84 | ]) |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | ); |
| 91 | 91 | }catch (RequestException $ex) { |
| 92 | 92 | $this->requestException($ex); |
| 93 | - }catch (\Exception $ex){ |
|
| 93 | + }catch (\Exception $ex) { |
|
| 94 | 94 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -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 | } |