diff --git a/CHANGELOG.md b/CHANGELOG.md index e945240..30d375c 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +#v0.3.1 + +* Fix: Atualização no link do boleto gerado, agora o link encaminha para um PDF. + #v0.3.0 * Fix: Mensagens de erros para configurações erradas de juros e multa. diff --git a/README.md b/README.md index c040ef0..d3f11af 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Módulo de Integração Gerencianet para WHMCS Oficial - Versão 0.3.0 # +# Módulo de Integração Gerencianet para WHMCS Oficial - Versão 0.3.1 # O módulo Gerencianet para o WHMCS permite gerar boletos com registro por meio da nossa API. Compatível com as versões superiores a 6.0.4 do WHMCS. diff --git a/gerencianet_lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/ApiRequest.php b/gerencianet_lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/ApiRequest.php index 66c727e..f699b97 100755 --- a/gerencianet_lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/ApiRequest.php +++ b/gerencianet_lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/ApiRequest.php @@ -28,12 +28,12 @@ public function send($method, $route, $body) try { return $this->request->send($method, $route, ['json' => $body, - 'headers' => ['Authorization' => 'Bearer '.$this->auth->accessToken, 'api-sdk' => 'whmcs-0.3.0', 'partner-token' => $partner_token]]); + 'headers' => ['Authorization' => 'Bearer '.$this->auth->accessToken, 'api-sdk' => 'whmcs-0.3.1', 'partner-token' => $partner_token]]); } catch (AuthorizationException $e) { $this->auth->authorize(); return $this->request->send($method, $route, ['json' => $body, - 'headers' => ['Authorization' => 'Bearer '.$this->auth->accessToken, 'api-sdk' => 'whmcs-0.3.0', 'partner-token' => $partner_token]]); + 'headers' => ['Authorization' => 'Bearer '.$this->auth->accessToken, 'api-sdk' => 'whmcs-0.3.1', 'partner-token' => $partner_token]]); } } diff --git a/gerencianet_lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Request.php b/gerencianet_lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Request.php index 181f77b..41e966a 100755 --- a/gerencianet_lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Request.php +++ b/gerencianet_lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Request.php @@ -26,7 +26,7 @@ public function __construct(array $options = null) 'base_url' => $this->config['baseUri'], 'headers' => [ 'Content-Type' => 'application/json', - 'api-sdk' => 'whmcs-0.3.0', + 'api-sdk' => 'whmcs-0.3.1', 'partner-token' => $partner_token ], ]); diff --git a/gerencianetcharge.php b/gerencianetcharge.php index 764ac35..8425c01 100755 --- a/gerencianetcharge.php +++ b/gerencianetcharge.php @@ -216,8 +216,8 @@ function gerencianetcharge_link($params) if($chargeDetails['code'] == 200) { $existCharge = true; - if(isset($chargeDetails['data']['payment']['banking_billet']['link'])){ - $url = $chargeDetails['data']['payment']['banking_billet']['link']; + if(isset($chargeDetails['data']['payment']['banking_billet']['pdf']['charge'])){ + $url = $chargeDetails['data']['payment']['banking_billet']['pdf']['charge']; $code = buttonGerencianet(null,$url); return $code; } @@ -473,13 +473,13 @@ function gerencianetcharge_link($params) $data = $resultPaymentDecoded['data']; $chargeId = $data["charge_id"]; - $url = (string)$data["link"]; + $url = (string)$data['pdf']['charge']; $updateTransactionCommand = "updatetransaction"; $updateTransactionValues['transactionid'] = $transactionId ; $updateTransactionValues['description'] = "Boleto Gerencianet: Cobrança aguardando pagamento."; $updatetransresults = localAPI($updateTransactionCommand, $updateTransactionValues, $adminWHMCS); - $code = ""; + $code = ""; return $code; } else {