Skip to content

Instantly share code, notes, and snippets.

@drupalista-br
drupalista-br / uc_boleto-example-no-libraries.module.php
Created July 21, 2011 07:24
Drupal Example for Boleto integration (with no libraries module)
<?php
/**
* Implementation of hook_someHook().
*/
function uc_boleto_someHook($someArgument) {
/**
* 1a Opcao:
*/
$myArguments = array('library_location' => base_path().drupal_get_path('module', 'boleto').'/boleto-lib', //adjust to the location where you have stored Boleto's library. If it is outside your current application folder you gotta use ../
'bank_code' => '001', //Merchant's bank code (NO check digit). Note that this is not the same as the branch number
@drupalista-br
drupalista-br / uc_boleto-example-with-libraries.module.php
Created July 21, 2011 07:31
Drupal Example for Boleto integration (with libraries module - RECOMMENDED)
<?php
/**
* Implementation of hook_someHook().
*/
function ub_boleto_someHook($someArgument) {
/**
* 2a Opcao - Usar o Modulo Libraries (RECOMMENDAVEL)
* Project: http://drupal.org/project/libraries
@drupalista-br
drupalista-br / Cielo_xml_requisicao_transacao.xml
Created April 25, 2012 21:20
Cielo XML Requisição Transação
<?xml version='1.0' encoding='ISO-8859-1'?>
<requisicao-transacao id='846f0af7e0cc7f8bd47ec7c99ee3056a' versao='1.1.0'>
<dados-ec>
<numero>1001734898</numero>
<chave>e84827130b9837473681c2787007da5914d6359947015a5cdb2b8843db0fa832</chave>
</dados-ec>
<dados-pedido>
<numero>4</numero>
<valor>100</valor>
<moeda>986</moeda>
@drupalista-br
drupalista-br / Cielo_resposta_requisicao_transacao.txt
Created April 25, 2012 21:36
Cielo Resposta da Requisição de Transação
[response] => Array
(
[@attributes] => Array
(
[versao] => 1.1.0
[id] => 846f0af7e0cc7f8bd47ec7c99ee3056a
)
[tid] => 10017348980814F61001
[dados-pedido] => Array
@drupalista-br
drupalista-br / Cielo_resposta_requisicao_consulta.txt
Created April 25, 2012 21:44
Cielo Resposta da Requisição de Consulta
[response] => Array
(
[@attributes] => Array
(
[versao] => 1.1.0
[id] => e12f2ffa513f26d03cb83d0b2d485daa
)
[tid] => 1001734898080DE3A001
[dados-pedido] => Array
@drupalista-br
drupalista-br / cielo-xml-follow-up.xml
Created May 29, 2012 20:19
Cielo - XML follow up on a non-autheticated transaction
<?xml version="1.0" encoding="ISO-8859-1"?>
<transacao versao="1.1.0" id="dd07a04ebc4093747ef91b05f4d0b404" xmlns="http://ecommerce.cbmp.com.br">
<tid>10017348980846041001</tid>
<pan>b1SQ6jpKCDt3n9C0dgD/ZkPQ1Bh+7aJESqr/CwP64P0=</pan>
<dados-pedido>
<numero>34</numero>
<valor>100</valor>
<moeda>986</moeda>
<data-hora>2012-05-29T17:08:31.874-03:00</data-hora>
<idioma>PT</idioma>
@drupalista-br
drupalista-br / my_application.php
Created July 24, 2012 00:25
Integration example.
<?php
include_once '../boleto-lib/Boleto.class.php';
$argumentos = array(
'bank_code' => '104',
'agencia' => 1234,
'agencia_dv' => '2',
'conta' => 12345678901,
'conta_dv' => 3,
@drupalista-br
drupalista-br / boleto.test.php
Created July 24, 2012 01:18
Sample code of how to implement a bank plugin unit test mockery.
<?php
/**
* @file
* Unit testing.
*/
require_once "../../../unit-testing/boleto.test.php";
class TestOfXXX extends BoletoTestCase{
protected $mockingArguments;
@drupalista-br
drupalista-br / Banco_XXX.php
Created July 24, 2012 01:22
Sample code on how to implement the bank plugin class.
<?php
/**
* This code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*
* @author Fulano de Tal <[email protected]>
*/
class Banco_XXX extends Boleto{
function setUp(){
@drupalista-br
drupalista-br / boleto_integration_own_template.php
Created July 24, 2012 02:47
Sample code of how to integrate without using the built in html template.
<?php
include_once 'boleto-lib/Boleto.class.php';
$argumentos = array(
// Argumentos aqui.
);
// Instancia o objeto.
$boleto = Boleto::load_boleto($argumentos);