Created
July 24, 2012 00:25
-
-
Save drupalista-br/3167145 to your computer and use it in GitHub Desktop.
Integration example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once '../boleto-lib/Boleto.class.php'; | |
$argumentos = array( | |
'bank_code' => '104', | |
'agencia' => 1234, | |
'agencia_dv' => '2', | |
'conta' => 12345678901, | |
'conta_dv' => 3, | |
'valor_boleto' => '2952.95', | |
'numero_documento' => '27030195', | |
'endereco' => 'street name and number', | |
'cidade_uf'=> 'city and state', | |
'cedente' => 'ABC Company Ltd', | |
'sacado' => 'John Doe', | |
'carteira' => 'A', | |
'carteira_nosso_numero' => '80', | |
'nosso_numero' => '12345678', | |
'cpf_cnpj' => '000.000.000-00', | |
'endereco1' => 'street name and number', | |
'endereco2' => 'city and state', | |
'demonstrativo1' => 'Your text here', | |
'demonstrativo2' => 'Your text here', | |
'demonstrativo3' => 'Your text here', | |
'instrucoes1' => 'Your text here', | |
'instrucoes2' => 'Your text here', | |
'instrucoes3' => 'Your text here', | |
'instrucoes4' => 'Your text here', | |
'data_vencimento' => '25-07-2011', | |
'desconto_abatimento' => '0.00', | |
'outras_deducoes' => '0.00', | |
'mora_multa' => '0.00', | |
'outros_acrescimos' => '50.55', | |
'title' => 'My title', | |
'local_pagamento' => 'Your text here', | |
'especie' => 'Your value here', | |
'quantidade' => 'Your value here', | |
'valor_unitario' => 'Your value here', | |
'especie_doc' => 'Your value here', | |
'data_processamento' => 'dd/mm/yyy', | |
'avalista' => 'Michael Jackson', | |
'aceite'=> 'Your value here', | |
'merchant_logo' => 'images/logo.jpg', | |
); | |
if (in_array($argumentos['bank_code'], Boleto::installedPlugins())) { | |
// Instancia o objeto. | |
$boleto = Boleto::load_boleto($argumentos); | |
// Imprime o boleto. | |
$boleto->output(); | |
} | |
else { | |
// Seu error handler pois o plugin do banco não está instalado. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment