@@ -221,7 +221,7 @@ |
||
| 221 | 221 | { |
| 222 | 222 | $this->produtoStatus = $produtoStatus; |
| 223 | 223 | |
| 224 | - if(is_array($this->produtoStatus)) |
|
| 224 | + if (is_array($this->produtoStatus)) |
|
| 225 | 225 | $this->produtoStatus = SerializerHelper::denormalize($this->produtoStatus, ProdutoStatus::class); |
| 226 | 226 | |
| 227 | 227 | return $this; |
@@ -221,8 +221,9 @@ |
||
| 221 | 221 | { |
| 222 | 222 | $this->produtoStatus = $produtoStatus; |
| 223 | 223 | |
| 224 | - if(is_array($this->produtoStatus)) |
|
| 225 | - $this->produtoStatus = SerializerHelper::denormalize($this->produtoStatus, ProdutoStatus::class); |
|
| 224 | + if(is_array($this->produtoStatus)) { |
|
| 225 | + $this->produtoStatus = SerializerHelper::denormalize($this->produtoStatus, ProdutoStatus::class); |
|
| 226 | + } |
|
| 226 | 227 | |
| 227 | 228 | return $this; |
| 228 | 229 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | $this->pessoa = $pessoa; |
| 77 | 77 | |
| 78 | - if(is_array($this->pessoa)) |
|
| 78 | + if (is_array($this->pessoa)) |
|
| 79 | 79 | $this->pessoa = SerializerHelper::denormalize($pessoa, Pessoa::class); |
| 80 | 80 | |
| 81 | 81 | return $this; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | foreach ($contaRecebimentoLancamentos as $contaRecebimentoLancamento) |
| 136 | 136 | { |
| 137 | - $this->contaRecebimentoLancamentos[] = SerializerHelper::denormalize( |
|
| 137 | + $this->contaRecebimentoLancamentos[ ] = SerializerHelper::denormalize( |
|
| 138 | 138 | $contaRecebimentoLancamento, ContaRecebimentoLancamento::class); |
| 139 | 139 | } |
| 140 | 140 | |
@@ -75,8 +75,9 @@ |
||
| 75 | 75 | { |
| 76 | 76 | $this->pessoa = $pessoa; |
| 77 | 77 | |
| 78 | - if(is_array($this->pessoa)) |
|
| 79 | - $this->pessoa = SerializerHelper::denormalize($pessoa, Pessoa::class); |
|
| 78 | + if(is_array($this->pessoa)) { |
|
| 79 | + $this->pessoa = SerializerHelper::denormalize($pessoa, Pessoa::class); |
|
| 80 | + } |
|
| 80 | 81 | |
| 81 | 82 | return $this; |
| 82 | 83 | } |
@@ -579,7 +579,7 @@ |
||
| 579 | 579 | public function setDataLogin($dataLogin) |
| 580 | 580 | { |
| 581 | 581 | $this->dataLogin = \DateTime::createFromFormat('d/m/Y H:i:s.u', $dataLogin); |
| 582 | - return $this; |
|
| 582 | + return $this; |
|
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | /** |
@@ -252,7 +252,7 @@ |
||
| 252 | 252 | { |
| 253 | 253 | $this->pessoaStatus = $pessoaStatus; |
| 254 | 254 | |
| 255 | - if(is_array($this->pessoaStatus)) |
|
| 255 | + if (is_array($this->pessoaStatus)) |
|
| 256 | 256 | $this->pessoaStatus = SerializerHelper::denormalize($this->pessoaStatus, PessoaStatus::class); |
| 257 | 257 | |
| 258 | 258 | return $this; |
@@ -252,8 +252,9 @@ |
||
| 252 | 252 | { |
| 253 | 253 | $this->pessoaStatus = $pessoaStatus; |
| 254 | 254 | |
| 255 | - if(is_array($this->pessoaStatus)) |
|
| 256 | - $this->pessoaStatus = SerializerHelper::denormalize($this->pessoaStatus, PessoaStatus::class); |
|
| 255 | + if(is_array($this->pessoaStatus)) { |
|
| 256 | + $this->pessoaStatus = SerializerHelper::denormalize($this->pessoaStatus, PessoaStatus::class); |
|
| 257 | + } |
|
| 257 | 258 | |
| 258 | 259 | return $this; |
| 259 | 260 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $this->contaRecebimento = $contaRecebimento; |
| 107 | 107 | |
| 108 | - if(is_array($this->contaRecebimento)) |
|
| 108 | + if (is_array($this->contaRecebimento)) |
|
| 109 | 109 | $this->contaRecebimento = SerializerHelper::denormalize($this->contaRecebimento, ContaRecebimento::class); |
| 110 | 110 | |
| 111 | 111 | return $this; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $this->contaPayLancamento = $contaPayLancamento; |
| 129 | 129 | |
| 130 | - if(is_array($this->contaPayLancamento)) |
|
| 130 | + if (is_array($this->contaPayLancamento)) |
|
| 131 | 131 | $this->contaPayLancamento = SerializerHelper::denormalize($this->contaPayLancamento, ContaPayLancamento::class); |
| 132 | 132 | |
| 133 | 133 | return $this; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | { |
| 150 | 150 | $this->pagamento = $pagamento; |
| 151 | 151 | |
| 152 | - if(is_array($this->pagamento)) |
|
| 152 | + if (is_array($this->pagamento)) |
|
| 153 | 153 | $this->pagamento = SerializerHelper::denormalize($this->pagamento, Pagamento::class); |
| 154 | 154 | |
| 155 | 155 | return $this; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | { |
| 172 | 172 | $this->lancamentoTipo = $lancamentoTipo; |
| 173 | 173 | |
| 174 | - if(is_array($this->lancamentoTipo)) |
|
| 174 | + if (is_array($this->lancamentoTipo)) |
|
| 175 | 175 | $this->lancamentoTipo = SerializerHelper::denormalize($this->lancamentoTipo, LancamentoTipo::class); |
| 176 | 176 | |
| 177 | 177 | return $this; |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | { |
| 284 | 284 | $this->intencaoVenda = $intencaoVenda; |
| 285 | 285 | |
| 286 | - if(is_array($this->intencaoVenda)) |
|
| 286 | + if (is_array($this->intencaoVenda)) |
|
| 287 | 287 | $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class); |
| 288 | 288 | |
| 289 | 289 | return $this; |
@@ -105,8 +105,9 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $this->contaRecebimento = $contaRecebimento; |
| 107 | 107 | |
| 108 | - if(is_array($this->contaRecebimento)) |
|
| 109 | - $this->contaRecebimento = SerializerHelper::denormalize($this->contaRecebimento, ContaRecebimento::class); |
|
| 108 | + if(is_array($this->contaRecebimento)) { |
|
| 109 | + $this->contaRecebimento = SerializerHelper::denormalize($this->contaRecebimento, ContaRecebimento::class); |
|
| 110 | + } |
|
| 110 | 111 | |
| 111 | 112 | return $this; |
| 112 | 113 | } |
@@ -127,8 +128,9 @@ discard block |
||
| 127 | 128 | { |
| 128 | 129 | $this->contaPayLancamento = $contaPayLancamento; |
| 129 | 130 | |
| 130 | - if(is_array($this->contaPayLancamento)) |
|
| 131 | - $this->contaPayLancamento = SerializerHelper::denormalize($this->contaPayLancamento, ContaPayLancamento::class); |
|
| 131 | + if(is_array($this->contaPayLancamento)) { |
|
| 132 | + $this->contaPayLancamento = SerializerHelper::denormalize($this->contaPayLancamento, ContaPayLancamento::class); |
|
| 133 | + } |
|
| 132 | 134 | |
| 133 | 135 | return $this; |
| 134 | 136 | } |
@@ -149,8 +151,9 @@ discard block |
||
| 149 | 151 | { |
| 150 | 152 | $this->pagamento = $pagamento; |
| 151 | 153 | |
| 152 | - if(is_array($this->pagamento)) |
|
| 153 | - $this->pagamento = SerializerHelper::denormalize($this->pagamento, Pagamento::class); |
|
| 154 | + if(is_array($this->pagamento)) { |
|
| 155 | + $this->pagamento = SerializerHelper::denormalize($this->pagamento, Pagamento::class); |
|
| 156 | + } |
|
| 154 | 157 | |
| 155 | 158 | return $this; |
| 156 | 159 | } |
@@ -171,8 +174,9 @@ discard block |
||
| 171 | 174 | { |
| 172 | 175 | $this->lancamentoTipo = $lancamentoTipo; |
| 173 | 176 | |
| 174 | - if(is_array($this->lancamentoTipo)) |
|
| 175 | - $this->lancamentoTipo = SerializerHelper::denormalize($this->lancamentoTipo, LancamentoTipo::class); |
|
| 177 | + if(is_array($this->lancamentoTipo)) { |
|
| 178 | + $this->lancamentoTipo = SerializerHelper::denormalize($this->lancamentoTipo, LancamentoTipo::class); |
|
| 179 | + } |
|
| 176 | 180 | |
| 177 | 181 | return $this; |
| 178 | 182 | } |
@@ -283,8 +287,9 @@ discard block |
||
| 283 | 287 | { |
| 284 | 288 | $this->intencaoVenda = $intencaoVenda; |
| 285 | 289 | |
| 286 | - if(is_array($this->intencaoVenda)) |
|
| 287 | - $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class); |
|
| 290 | + if(is_array($this->intencaoVenda)) { |
|
| 291 | + $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class); |
|
| 292 | + } |
|
| 288 | 293 | |
| 289 | 294 | return $this; |
| 290 | 295 | } |
@@ -28,16 +28,16 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | private static function getInstance() |
| 30 | 30 | { |
| 31 | - if(empty(self::$instance['jms.serializer'])) |
|
| 31 | + if (empty(self::$instance[ 'jms.serializer' ])) |
|
| 32 | 32 | { |
| 33 | - self::$instance['jms.serializer'] = SerializerBuilder::create() |
|
| 33 | + self::$instance[ 'jms.serializer' ] = SerializerBuilder::create() |
|
| 34 | 34 | ->setPropertyNamingStrategy(new SerializedNameAnnotationStrategy(new IdenticalPropertyNamingStrategy())) |
| 35 | 35 | ->build(); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - if(empty(self::$instance['symfony.serializer'])) |
|
| 38 | + if (empty(self::$instance[ 'symfony.serializer' ])) |
|
| 39 | 39 | { |
| 40 | - self::$instance['symfony.serializer'] = new Serializer([new ObjectNormalizer()], |
|
| 40 | + self::$instance[ 'symfony.serializer' ] = new Serializer([ new ObjectNormalizer() ], |
|
| 41 | 41 | [ |
| 42 | 42 | 'xml' => new XmlEncoder(), |
| 43 | 43 | 'json' => new JsonEncoder() |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public static function deserialize($data, $class, $format = 'json') |
| 59 | 59 | { |
| 60 | - return self::getInstance()['symfony.serializer']->deserialize($data, $class, $format); |
|
| 60 | + return self::getInstance()[ 'symfony.serializer' ]->deserialize($data, $class, $format); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public static function denormalize($data, $class) |
| 71 | 71 | { |
| 72 | - return self::getInstance()['symfony.serializer']->denormalize($data, $class); |
|
| 72 | + return self::getInstance()[ 'symfony.serializer' ]->denormalize($data, $class); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public static function serialize($data, $format = 'json') |
| 81 | 81 | { |
| 82 | - return self::getInstance()['jms.serializer']->serialize($data, $format); |
|
| 82 | + return self::getInstance()[ 'jms.serializer' ]->serialize($data, $format); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public static function toArray($object) |
| 90 | 90 | { |
| 91 | - return self::getInstance()['jms.serializer']->toArray($object); |
|
| 91 | + return self::getInstance()[ 'jms.serializer' ]->toArray($object); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | } |
| 95 | 95 | \ No newline at end of file |
@@ -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 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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -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 | { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function getParameter($key) |
| 72 | 72 | { |
| 73 | - return isset($this->_params[$key]) ? $this->_params[$key] : null; |
|
| 73 | + return isset($this->_params[ $key ]) ? $this->_params[ $key ] : null; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function setParameter($key, $value) |
| 84 | 84 | { |
| 85 | - $this->_params[$key] = $value; |
|
| 85 | + $this->_params[ $key ] = $value; |
|
| 86 | 86 | $this->loadParameters($this->_params, $this->authentication); |
| 87 | 87 | return $this; |
| 88 | 88 | } |
@@ -96,23 +96,23 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | private function loadParameters($params, IAuthentication $authentication = null) |
| 98 | 98 | { |
| 99 | - $this->_params[ControlPayParameterConst::CONTROLPAY_HOST] = getenv('CONTROLPAY_HOST'); |
|
| 100 | - $this->_params[ControlPayParameterConst::CONTROLPAY_TIMEOUT] = getenv('CONTROLPAY_TIMEOUT'); |
|
| 101 | - $this->_params[ControlPayParameterConst::CONTROLPAY_USER] = getenv('CONTROLPAY_USER'); |
|
| 102 | - $this->_params[ControlPayParameterConst::CONTROLPAY_PWD] = getenv('CONTROLPAY_PWD'); |
|
| 103 | - $this->_params[ControlPayParameterConst::CONTROLPAY_KEY] = getenv('CONTROLPAY_KEY'); |
|
| 104 | - $this->_params[ControlPayParameterConst::CONTROLPAY_DEFAULT_PESSOA_ID] = getenv('CONTROLPAY_DEFAULT_PESSOA_ID'); |
|
| 105 | - $this->_params[ControlPayParameterConst::CONTROLPAY_DEFAULT_TERMINAL_ID] = getenv('CONTROLPAY_DEFAULT_TERMINAL_ID'); |
|
| 106 | - $this->_params[ControlPayParameterConst::CONTROLPAY_DEFAULT_PRODUTO_ID] = getenv('CONTROLPAY_DEFAULT_PRODUTO_ID'); |
|
| 107 | - $this->_params[ControlPayParameterConst::CONTROLPAY_DEFAULT_FORMA_PAGAMENTO_ID] = getenv('CONTROLPAY_DEFAULT_FORMA_PAGAMENTO_ID'); |
|
| 108 | - $this->_params[ControlPayParameterConst::CONTROLPAY_DEFAULT_FORMA_AGUARDA_TEF] = getenv('CONTROLPAY_DEFAULT_FORMA_AGUARDA_TEF'); |
|
| 109 | - $this->_params[ControlPayParameterConst::CONTROLPAY_DEFAULT_SENHA_TECNICA] = getenv('CONTROLPAY_DEFAULT_SENHA_TECNICA'); |
|
| 110 | - $this->_params[ControlPayParameterConst::CONTROLPAY_OAUTH_TYPE] = KeyQueryStringAuthentication::class; |
|
| 111 | - |
|
| 112 | - if(!is_null($params)) |
|
| 99 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_HOST ] = getenv('CONTROLPAY_HOST'); |
|
| 100 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_TIMEOUT ] = getenv('CONTROLPAY_TIMEOUT'); |
|
| 101 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_USER ] = getenv('CONTROLPAY_USER'); |
|
| 102 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_PWD ] = getenv('CONTROLPAY_PWD'); |
|
| 103 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_KEY ] = getenv('CONTROLPAY_KEY'); |
|
| 104 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_DEFAULT_PESSOA_ID ] = getenv('CONTROLPAY_DEFAULT_PESSOA_ID'); |
|
| 105 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_DEFAULT_TERMINAL_ID ] = getenv('CONTROLPAY_DEFAULT_TERMINAL_ID'); |
|
| 106 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_DEFAULT_PRODUTO_ID ] = getenv('CONTROLPAY_DEFAULT_PRODUTO_ID'); |
|
| 107 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_DEFAULT_FORMA_PAGAMENTO_ID ] = getenv('CONTROLPAY_DEFAULT_FORMA_PAGAMENTO_ID'); |
|
| 108 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_DEFAULT_FORMA_AGUARDA_TEF ] = getenv('CONTROLPAY_DEFAULT_FORMA_AGUARDA_TEF'); |
|
| 109 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_DEFAULT_SENHA_TECNICA ] = getenv('CONTROLPAY_DEFAULT_SENHA_TECNICA'); |
|
| 110 | + $this->_params[ ControlPayParameterConst::CONTROLPAY_OAUTH_TYPE ] = KeyQueryStringAuthentication::class; |
|
| 111 | + |
|
| 112 | + if (!is_null($params)) |
|
| 113 | 113 | foreach ($params as $key => $param) |
| 114 | 114 | { |
| 115 | - if(!in_array($key, [ |
|
| 115 | + if (!in_array($key, [ |
|
| 116 | 116 | ControlPayParameterConst::CONTROLPAY_HOST, |
| 117 | 117 | ControlPayParameterConst::CONTROLPAY_TIMEOUT, |
| 118 | 118 | ControlPayParameterConst::CONTROLPAY_USER, |
@@ -129,11 +129,11 @@ discard block |
||
| 129 | 129 | throw new \Exception(sprintf("Parâmetro %s inválido", $key)); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - if(!is_null($params) && is_array($params)) |
|
| 132 | + if (!is_null($params) && is_array($params)) |
|
| 133 | 133 | foreach ($params as $key => $value) |
| 134 | - $this->_params[$key] = $value; |
|
| 134 | + $this->_params[ $key ] = $value; |
|
| 135 | 135 | |
| 136 | - if(is_null($authentication)) |
|
| 136 | + if (is_null($authentication)) |
|
| 137 | 137 | { |
| 138 | 138 | $this->authentication = AuthenticationFactory::getInstance($this->_params, $this); |
| 139 | 139 | return; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | $this->pessoa = $pessoa; |
| 86 | 86 | |
| 87 | - if(is_array($pessoa)) |
|
| 87 | + if (is_array($pessoa)) |
|
| 88 | 88 | $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
| 89 | 89 | |
| 90 | 90 | return $this; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | { |
| 107 | 107 | $this->operador = $operador; |
| 108 | 108 | |
| 109 | - if(is_array($this->operador)) |
|
| 109 | + if (is_array($this->operador)) |
|
| 110 | 110 | $this->operador = SerializerHelper::denormalize($this->operador, Operador::class); |
| 111 | 111 | |
| 112 | 112 | return $this; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | { |
| 129 | 129 | $this->android = $android; |
| 130 | 130 | |
| 131 | - if(is_array($this->android)) |
|
| 131 | + if (is_array($this->android)) |
|
| 132 | 132 | $this->android = SerializerHelper::denormalize($this->android, Device::class); |
| 133 | 133 | |
| 134 | 134 | return $this; |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $this->ios = $ios; |
| 152 | 152 | |
| 153 | - if(is_array($this->ios)) |
|
| 153 | + if (is_array($this->ios)) |
|
| 154 | 154 | $this->ios = SerializerHelper::denormalize($this->ios, Device::class); |
| 155 | 155 | |
| 156 | 156 | return $this; |
@@ -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 | } |