Skip to content

Commit

Permalink
Atualização no link do boleto gerado, agora o link encaminha para um …
Browse files Browse the repository at this point in the history
…PDF.
  • Loading branch information
thiagogresende committed Jan 9, 2019
1 parent 7a92670 commit 95fcc26
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
],
]);
Expand Down
8 changes: 4 additions & 4 deletions gerencianetcharge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 = "<meta http-equiv='refresh' content='0;url=" . $resultPaymentDecoded["data"]["link"] . "'>";
$code = "<meta http-equiv='refresh' content='0;url=" . $resultPaymentDecoded["data"]['pdf']['charge'] . "'>";
return $code;
}
else {
Expand Down

0 comments on commit 95fcc26

Please sign in to comment.