@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | $response->json(), |
| 40 | 40 | Contracts\IntencaoVenda\GetByFiltrosResponse::class |
| 41 | 41 | ); |
| 42 | - }catch (RequestException $ex) { |
|
| 42 | + } catch (RequestException $ex) { |
|
| 43 | 43 | $responseBody = $ex->getResponse()->json(); |
| 44 | 44 | throw new \Exception($responseBody['message']); |
| 45 | - }catch (\Exception $ex){ |
|
| 45 | + } catch (\Exception $ex){ |
|
| 46 | 46 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | $response->json(), |
| 66 | 66 | Contracts\IntencaoVenda\GetByIdResponse::class |
| 67 | 67 | ); |
| 68 | - }catch (RequestException $ex) { |
|
| 68 | + } catch (RequestException $ex) { |
|
| 69 | 69 | $responseBody = $ex->getResponse()->json(); |
| 70 | 70 | var_dump($responseBody); |
| 71 | 71 | throw new \Exception($responseBody['message']); |
| 72 | - }catch (\Exception $ex){ |
|
| 72 | + } catch (\Exception $ex){ |
|
| 73 | 73 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -90,10 +90,10 @@ discard block |
||
| 90 | 90 | $response->json(), |
| 91 | 91 | Contracts\IntencaoVenda\GetByIntegracaoIdResponse::class |
| 92 | 92 | ); |
| 93 | - }catch (RequestException $ex) { |
|
| 93 | + } catch (RequestException $ex) { |
|
| 94 | 94 | $responseBody = $ex->getResponse()->json(); |
| 95 | 95 | throw new \Exception($responseBody['message']); |
| 96 | - }catch (\Exception $ex){ |
|
| 96 | + } catch (\Exception $ex){ |
|
| 97 | 97 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -39,10 +39,10 @@ |
||
| 39 | 39 | $response->json(), |
| 40 | 40 | Contracts\PagamentoExterno\GetByFiltrosResponse::class |
| 41 | 41 | ); |
| 42 | - }catch (RequestException $ex) { |
|
| 42 | + } catch (RequestException $ex) { |
|
| 43 | 43 | $responseBody = $ex->getResponse()->json(); |
| 44 | 44 | throw new \Exception($responseBody['message']); |
| 45 | - }catch (\Exception $ex){ |
|
| 45 | + } catch (\Exception $ex){ |
|
| 46 | 46 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | $response->json(), |
| 42 | 42 | Contracts\Terminal\GetByPessoaIdResponse::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 | } |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | $response->json(), |
| 68 | 68 | Contracts\Terminal\GetByIdResponse::class |
| 69 | 69 | ); |
| 70 | - }catch (RequestException $ex) { |
|
| 70 | + } catch (RequestException $ex) { |
|
| 71 | 71 | $responseBody = $ex->getResponse()->json(); |
| 72 | 72 | throw new \Exception($responseBody['message']); |
| 73 | - }catch (\Exception $ex){ |
|
| 73 | + } catch (\Exception $ex){ |
|
| 74 | 74 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -91,10 +91,10 @@ discard block |
||
| 91 | 91 | $response->json(), |
| 92 | 92 | Contracts\Terminal\InsertResponse::class |
| 93 | 93 | ); |
| 94 | - }catch (RequestException $ex) { |
|
| 94 | + } catch (RequestException $ex) { |
|
| 95 | 95 | $responseBody = $ex->getResponse()->json(); |
| 96 | 96 | throw new \Exception($responseBody['message']); |
| 97 | - }catch (\Exception $ex){ |
|
| 97 | + } catch (\Exception $ex){ |
|
| 98 | 98 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
| 99 | 99 | } |
| 100 | 100 | } |
@@ -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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | $this->_params[ControlPayParameter::CONTROLPAY_KEY] = getenv('CONTROLPAY_KEY'); |
| 104 | 104 | $this->_params[ControlPayParameter::CONTROLPAY_OAUTH_TYPE] = KeyQueryStringAuthentication::class; |
| 105 | 105 | |
| 106 | - if(!is_null($params)) |
|
| 107 | - foreach ($params as $key => $param) |
|
| 106 | + if(!is_null($params)) { |
|
| 107 | + foreach ($params as $key => $param) |
|
| 108 | 108 | { |
| 109 | 109 | if(!in_array($key, [ |
| 110 | 110 | ControlPayParameter::CONTROLPAY_HOST, |
@@ -115,11 +115,13 @@ discard block |
||
| 115 | 115 | ControlPayParameter::CONTROLPAY_OAUTH_TYPE |
| 116 | 116 | ])) |
| 117 | 117 | throw new \Exception(sprintf("Parâmetro %s inválido", $key)); |
| 118 | + } |
|
| 118 | 119 | } |
| 119 | 120 | |
| 120 | - if(!is_null($params) && is_array($params)) |
|
| 121 | - foreach ($params as $key => $value) |
|
| 121 | + if(!is_null($params) && is_array($params)) { |
|
| 122 | + foreach ($params as $key => $value) |
|
| 122 | 123 | $this->_params[$key] = $value; |
| 124 | + } |
|
| 123 | 125 | |
| 124 | 126 | if(is_null($authentication)) |
| 125 | 127 | { |
@@ -84,8 +84,9 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | $this->pessoa = $pessoa; |
| 86 | 86 | |
| 87 | - if(is_array($pessoa)) |
|
| 88 | - $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
|
| 87 | + if(is_array($pessoa)) { |
|
| 88 | + $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
|
| 89 | + } |
|
| 89 | 90 | |
| 90 | 91 | return $this; |
| 91 | 92 | } |
@@ -106,8 +107,9 @@ discard block |
||
| 106 | 107 | { |
| 107 | 108 | $this->operador = $operador; |
| 108 | 109 | |
| 109 | - if(is_array($this->operador)) |
|
| 110 | - $this->operador = SerializerHelper::denormalize($this->operador, Operador::class); |
|
| 110 | + if(is_array($this->operador)) { |
|
| 111 | + $this->operador = SerializerHelper::denormalize($this->operador, Operador::class); |
|
| 112 | + } |
|
| 111 | 113 | |
| 112 | 114 | return $this; |
| 113 | 115 | } |
@@ -128,8 +130,9 @@ discard block |
||
| 128 | 130 | { |
| 129 | 131 | $this->android = $android; |
| 130 | 132 | |
| 131 | - if(is_array($this->android)) |
|
| 132 | - $this->android = SerializerHelper::denormalize($this->android, Device::class); |
|
| 133 | + if(is_array($this->android)) { |
|
| 134 | + $this->android = SerializerHelper::denormalize($this->android, Device::class); |
|
| 135 | + } |
|
| 133 | 136 | |
| 134 | 137 | return $this; |
| 135 | 138 | } |
@@ -150,8 +153,9 @@ discard block |
||
| 150 | 153 | { |
| 151 | 154 | $this->ios = $ios; |
| 152 | 155 | |
| 153 | - if(is_array($this->ios)) |
|
| 154 | - $this->ios = SerializerHelper::denormalize($this->ios, Device::class); |
|
| 156 | + if(is_array($this->ios)) { |
|
| 157 | + $this->ios = SerializerHelper::denormalize($this->ios, Device::class); |
|
| 158 | + } |
|
| 155 | 159 | |
| 156 | 160 | return $this; |
| 157 | 161 | } |
@@ -68,8 +68,9 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | $this->pessoa = $pessoa; |
| 70 | 70 | |
| 71 | - if(is_array($pessoa)) |
|
| 72 | - $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
|
| 71 | + if(is_array($pessoa)) { |
|
| 72 | + $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
|
| 73 | + } |
|
| 73 | 74 | |
| 74 | 75 | return $this; |
| 75 | 76 | } |
@@ -90,8 +91,9 @@ discard block |
||
| 90 | 91 | { |
| 91 | 92 | $this->operador = $operador; |
| 92 | 93 | |
| 93 | - if(is_array($this->operador)) |
|
| 94 | - $this->operador = SerializerHelper::denormalize($this->operador, Operador::class); |
|
| 94 | + if(is_array($this->operador)) { |
|
| 95 | + $this->operador = SerializerHelper::denormalize($this->operador, Operador::class); |
|
| 96 | + } |
|
| 95 | 97 | |
| 96 | 98 | return $this; |
| 97 | 99 | } |