Skip to content

Instantly share code, notes, and snippets.

@mauriciogofas
Last active January 12, 2021 20:48
Show Gist options
  • Save mauriciogofas/e83dcf2bc8652e0bdac59c2e981fb6e1 to your computer and use it in GitHub Desktop.
Save mauriciogofas/e83dcf2bc8652e0bdac59c2e981fb6e1 to your computer and use it in GitHub Desktop.
Gofas Gerencianet Boleto para WHMCS: Exemplo de configuração adicional para alterar a data de vencimento do Boleto. /modules/gateways/gofasgerencianetboleto/params/customparams/configuracao_adicional.php
<?php
/**
* Módulo Gerencinet Boleto para WHMCS
* @author Mauricio Gofas | gofas.net
* @see https://gofas.net/?p=7893
* @copyright 2016->2018 Gofas Softwares
* @license https://gofas.net?p=9340
* @support https://gofas.net/?p=7856
* @version 2.2.1
*/
if(!defined('WHMCS')) { die(); }
if( $params['configuracao_adicional'] ) {
if( (int)strtotime($invoice_duedate) >= (int)strtotime(date('Y-m-d') ) ) { // Se a data de vencimento da fatura é igual ou maior que hoje
$billet_duedate = date('Y-m-d', strtotime($billet_duedate.' +'.$params['configuracao_adicional'].' days')); // soma X dias à data de vencimento do Boleto
$body2['payment']['banking_billet']['expire_at'] = $billet_duedate; // Passa nova data de vencimento para a API Gerencianet
$body3['payment']['banking_billet']['expire_at'] = $billet_duedate; // ||
}
if($debug_or_log) { // Salva no log e exibe no debug o resultado do processamento da data de vencimento
$log_result['configuracao_adicional_invoice_duedate'] = $billet_duedate;
$log_result['configuracao_adicional_bodys'] = array($body2,$body3);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment