forked from Claudio/integracao
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.4 KiB
51 lines
1.4 KiB
3 years ago
|
<?php
|
||
|
|
||
|
/*
|
||
|
* Desenvolvido por: Jose Henrique Joanoni
|
||
|
* Programador Jr. | Simples IP.
|
||
|
* Copyright 2020
|
||
|
*/
|
||
|
|
||
|
include 'IxcSoft.php';
|
||
|
|
||
|
$registros = array(
|
||
|
"id" => '',
|
||
|
"reg_ura" => $ura,
|
||
|
"reg_tronco" => $tronco,
|
||
|
"reg_uniqueid" => $uid,
|
||
|
"reg_id_metodo" => $idMetodo,
|
||
|
"reg_uniqueid" => $uid,
|
||
|
"reg_uniqueid_old" => $uidOld,
|
||
|
"reg_fone" => $numero,
|
||
|
"reg_status_exec" => '1',
|
||
|
"reg_inicio" => date());
|
||
|
|
||
|
|
||
|
$ixc = new IxcSoft("16:7d3a613faefb179bb33cbc57a6f9bb82b300247025b570d6f949f268ef58c537", "45.227.80.2", true);
|
||
|
$ixc->db()->setRegistros($registros);
|
||
|
$ixc->db()->setIdAudioError('83');
|
||
|
|
||
|
$sendType = $ixc->agi()->get_variable('EXTEN',true);
|
||
|
$codCliente = $ixc->agi()->get_variable('CODCLIENTE', true);
|
||
|
|
||
|
if ($sendType == 1) {
|
||
|
$envio = $ixc->enviaBoleto('mail', $codCliente);
|
||
|
|
||
|
if ($envio['registros'][0]['sucesso'] == 1) {
|
||
|
$ixc->agi()->exec_goto($ixc->db()->getAnuncio('FATURA_ENVIADA')); // Sucesso
|
||
|
} else {
|
||
|
$ixc->agi()->exec_goto($ixc->db()->getURA('ENVIO_FATURA_ERRO')); // Falha
|
||
|
}
|
||
|
} elseif ($sendType == 2) {
|
||
|
$envio = $ixc->enviaBoleto('mail', $codCliente);
|
||
|
|
||
|
if ($envio['registros'][0]['sucesso'] == 1) {
|
||
|
$ixc->agi()->exec_goto($ixc->db()->getAnuncio('FATURA_ENVIADA')); // Sucesso
|
||
|
} else {
|
||
|
$ixc->agi()->exec_goto($ixc->db()->getURA('ENVIO_FATURA_ERRO')); // Falha
|
||
|
}
|
||
|
}
|
||
|
|
||
|
$ixc->db()->atualizaIntegracao();
|
||
|
|
||
|
?>
|