Version Notes
Requisitos:
- Ser cliente BB
- Aderir ao regulamento do Comércio Eletrônico do BB
- Formalizar os convênios para as modalidades de meio de pagamento escolhidas
Download this release
Release Info
Developer | Rafael Patro |
Extension | quack_bb |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Quack/BB/Block/Form.php +33 -0
- app/code/community/Quack/BB/Block/Redirect.php +72 -0
- app/code/community/Quack/BB/Helper/Data.php +85 -0
- app/code/community/Quack/BB/Model/Observer.php +133 -0
- app/code/community/Quack/BB/Model/Session.php +32 -0
- app/code/community/Quack/BB/Model/Sonda.php +205 -0
- app/code/community/Quack/BB/Model/Source/TpPagamento.php +37 -0
- app/code/community/Quack/BB/Model/Standard.php +229 -0
- app/code/community/Quack/BB/controllers/StandardController.php +129 -0
- app/code/community/Quack/BB/etc/config.xml +147 -0
- app/code/community/Quack/BB/etc/system.xml +193 -0
- app/design/frontend/base/default/template/bb/email/redirect.phtml +35 -0
- app/design/frontend/base/default/template/bb/form.phtml +33 -0
- app/design/frontend/base/default/template/bb/info/redirect.phtml +33 -0
- app/design/frontend/base/default/template/bb/redirect.phtml +37 -0
- app/etc/modules/Quack_BB.xml +34 -0
- app/locale/pt_BR/Quack_BB.csv +11 -0
- package.xml +30 -0
app/code/community/Quack/BB/Block/Form.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
class Quack_BB_Block_Form extends Mage_Payment_Block_Form {
|
27 |
+
|
28 |
+
protected function _construct() {
|
29 |
+
parent::_construct();
|
30 |
+
$this->setTemplate( 'bb/form.phtml' );
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
app/code/community/Quack/BB/Block/Redirect.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
class Quack_BB_Block_Redirect extends Mage_Core_Block_Template {
|
27 |
+
|
28 |
+
/**
|
29 |
+
* (non-PHPdoc)
|
30 |
+
* @see Mage_Core_Block_Abstract::_construct()
|
31 |
+
*/
|
32 |
+
protected function _construct() {
|
33 |
+
parent::_construct();
|
34 |
+
$this->setTemplate('bb/redirect.phtml');
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* (non-PHPdoc)
|
39 |
+
* @see Mage_Core_Block_Abstract::_beforeToHtml()
|
40 |
+
*/
|
41 |
+
protected function _beforeToHtml() {
|
42 |
+
$standard = $this->getStandard();
|
43 |
+
$form = new Varien_Data_Form();
|
44 |
+
$form->setAction( $standard->getRequestUrl() )
|
45 |
+
->setId( 'standard_checkout' )
|
46 |
+
->setName( 'standard_checkout' )
|
47 |
+
->setMethod( 'POST' )
|
48 |
+
->setUseContainer( true );
|
49 |
+
foreach ( $standard->getRedirectFields() as $field => $value ) {
|
50 |
+
$form->addField( $field, 'hidden', array(
|
51 |
+
'name' => $field,
|
52 |
+
'value' => $value
|
53 |
+
));
|
54 |
+
}
|
55 |
+
$this->setData('message', Mage::helper('bb')->__('You will be redirected to your bank account in a few momments.'));
|
56 |
+
$this->setData('form', $form->toHtml());
|
57 |
+
return $this;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* @return Quack_BB_Model_Standard
|
62 |
+
*/
|
63 |
+
private function getStandard() {
|
64 |
+
$standard = Mage::getModel( 'bb/standard' );
|
65 |
+
if ( is_numeric( $this->getRequest()->getParam('order_id') ) ) {
|
66 |
+
$order = Mage::getModel('sales/order')->load( $this->getRequest()->getParam('order_id') );
|
67 |
+
$standard->setOrder( $order );
|
68 |
+
}
|
69 |
+
return $standard;
|
70 |
+
}
|
71 |
+
|
72 |
+
}
|
app/code/community/Quack/BB/Helper/Data.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
class Quack_BB_Helper_Data extends Mage_Core_Helper_Abstract
|
27 |
+
{
|
28 |
+
public function getStatusMessage($status) {
|
29 |
+
$message = $this->__("undefined bank status %s", $status);
|
30 |
+
switch ($status) {
|
31 |
+
case '00': $message = $this->__("pagamento efetuado"); break;
|
32 |
+
case '01': $message = $this->__("pagamento não autorizado/transação recusada"); break;
|
33 |
+
case '03': $message = $this->__("pagamento não localizado"); break;
|
34 |
+
case '10': $message = $this->__("campo idConv inválido ou nulo"); break;
|
35 |
+
case '11': $message = $this->__("valor informado é inválido, nulo ou não confere com o valor registrado"); break;
|
36 |
+
case '21': $message = $this->__("pagamento web não autorizado"); break;
|
37 |
+
case '24': $message = $this->__("convênio não cadastrado"); break;
|
38 |
+
case '25': $message = $this->__("convênio não ativo"); break;
|
39 |
+
case '26': $message = $this->__("convênio não permite débito em conta"); break;
|
40 |
+
case '27': $message = $this->__("serviço inválido"); break;
|
41 |
+
case '28': $message = $this->__("boleto emitido"); break;
|
42 |
+
case '29': $message = $this->__("pagamento não efetuado"); break;
|
43 |
+
case '99': $message = $this->__("operação cancelada pelo cliente"); break;
|
44 |
+
case '02':
|
45 |
+
case '22':
|
46 |
+
case '23':
|
47 |
+
case '30': $message = $this->__("erro no processamento da consulta"); break;
|
48 |
+
}
|
49 |
+
return $message;
|
50 |
+
}
|
51 |
+
|
52 |
+
public function getTypeMessage($type) {
|
53 |
+
$message = $this->__("undefined bank method %s", $type);
|
54 |
+
switch ($type) {
|
55 |
+
case '0': $message = $this->__("payment not selected yet"); break;
|
56 |
+
case '21':
|
57 |
+
case '2': $message = $this->__("Bank Slip"); break;
|
58 |
+
case '3':
|
59 |
+
case '7': $message = $this->__("Online Debit"); break;
|
60 |
+
case '5': $message = $this->__("Installment Plan"); break;
|
61 |
+
}
|
62 |
+
return $message;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function strtoascii($str) {
|
66 |
+
setlocale(LC_ALL, 'pt_BR.utf8');
|
67 |
+
return iconv('UTF-8', 'ASCII//TRANSLIT', $str);
|
68 |
+
}
|
69 |
+
|
70 |
+
public function getExpireDate($prazo) {
|
71 |
+
$tmCompra = time();
|
72 |
+
$tmVencimento = $tmCompra + ($prazo * 24 * 60 * 60);
|
73 |
+
$diaSemanaCompra = date('N', $tmCompra);
|
74 |
+
$diaSemanaVencimento = date('N', $tmVencimento);
|
75 |
+
if ($diaSemanaVencimento < $diaSemanaCompra
|
76 |
+
|| $diaSemanaVencimento == 6) {
|
77 |
+
$tmVencimento+= 2 * 24 * 60 * 60;
|
78 |
+
} elseif ($diaSemanaVencimento == 7) {
|
79 |
+
$tmVencimento+= 1 * 24 * 60 * 60;
|
80 |
+
}
|
81 |
+
$dtVenc = date('dmY', $tmVencimento);
|
82 |
+
return $dtVenc;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
?>
|
app/code/community/Quack/BB/Model/Observer.php
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
class Quack_BB_Model_Observer {
|
27 |
+
|
28 |
+
const PAYMENT_METHOD = 'bb_standard';
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Set additional payment information in frontend order view page.
|
32 |
+
*
|
33 |
+
* @param Varien_Event_Observer $observer
|
34 |
+
*/
|
35 |
+
public function setFrontendPaymentInfo(Varien_Event_Observer $observer) {
|
36 |
+
$block = $observer->getEvent()->getBlock(); /* @var $block Mage_Payment_Block_Info */
|
37 |
+
$payment = $observer->getEvent()->getPayment(); /* @var $payment Mage_Payment_Model_Info */
|
38 |
+
$transport = $observer->getEvent()->getTransport(); /* @var $transport Varien_Object */
|
39 |
+
if ($block->getBlockAlias() == 'payment_info' && $payment->getMethodInstance()->getCode() == self::PAYMENT_METHOD) {
|
40 |
+
$order = $payment->getOrder();
|
41 |
+
if ($order instanceof Mage_Sales_Model_Order) {
|
42 |
+
$orderId = $order->getData('entity_id');
|
43 |
+
$baseUrl = Mage::getBaseUrl();
|
44 |
+
$url = "{$baseUrl}bb/standard/redirect/order_id/{$orderId}";
|
45 |
+
$state = $order->getData('state');
|
46 |
+
$transport->setData(array(
|
47 |
+
Mage::helper('bb')->__('Bank Method') => $this->getHelper()->getTypeMessage ( $payment->getAdditionalInformation( 'paymentType' ) ),
|
48 |
+
Mage::helper('bb')->__('Bank Status') => $this->getHelper()->getStatusMessage( $payment->getAdditionalInformation( 'paymentStatus' ) ),
|
49 |
+
));
|
50 |
+
if ($state==Mage_Sales_Model_Order::STATE_NEW) {
|
51 |
+
$childBlock = $block->getLayout()->createBlock('payment/info'); /* @var $childBlock Mage_Payment_Block_Info */
|
52 |
+
$childBlock->setData('paymenturl', $url);
|
53 |
+
$childBlock->setTemplate("bb/info/redirect.phtml");
|
54 |
+
$block->setChild('payment_try_again', $childBlock);
|
55 |
+
}
|
56 |
+
}
|
57 |
+
} elseif ($block->getBlockAlias() == 'payment.info.'.self::PAYMENT_METHOD) {
|
58 |
+
// Checkout Payment Info Block
|
59 |
+
$transport->setData( Mage::helper('bb')->__('For BB clients only') );
|
60 |
+
}
|
61 |
+
return;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Set additional payment information in backend order view page.
|
66 |
+
*
|
67 |
+
* @param Varien_Event_Observer $observer
|
68 |
+
*/
|
69 |
+
public function setBackendPaymentInfo(Varien_Event_Observer $observer) {
|
70 |
+
$payment = $observer->getEvent()->getPayment(); /* @var $payment Mage_Payment_Model_Info */
|
71 |
+
if ($payment->getMethodInstance()->getCode() == self::PAYMENT_METHOD) {
|
72 |
+
$observer->getEvent()->getTransport()->setData(array(
|
73 |
+
Mage::helper('bb')->__('Bank Method') => $this->getHelper()->getTypeMessage ( $payment->getAdditionalInformation( 'paymentType' ) ),
|
74 |
+
Mage::helper('bb')->__('Bank Status') => $this->getHelper()->getStatusMessage( $payment->getAdditionalInformation( 'paymentStatus' ) ),
|
75 |
+
));
|
76 |
+
}
|
77 |
+
return;
|
78 |
+
}
|
79 |
+
|
80 |
+
|
81 |
+
public function checkPayment() {
|
82 |
+
$order = Mage::getModel('sales/order'); /* @var $order Mage_Sales_Model_Order */
|
83 |
+
$capturedPaymentsCounter = 0;
|
84 |
+
$collection = self::loadPending();
|
85 |
+
foreach ($collection as $entity) {
|
86 |
+
$order->load($entity->getParentId());
|
87 |
+
if ($order->canInvoice()) {
|
88 |
+
$invoice = $order->prepareInvoice();
|
89 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
|
90 |
+
try {
|
91 |
+
$invoice->register();
|
92 |
+
} catch (Exception $e) {
|
93 |
+
Mage::log("{$e->getMessage()}");
|
94 |
+
unset($invoice);
|
95 |
+
unset($order);
|
96 |
+
$order = Mage::getModel('sales/order');
|
97 |
+
continue;
|
98 |
+
}
|
99 |
+
$invoice->getOrder()->setIsInProcess(true);
|
100 |
+
$order->addStatusHistoryComment( Mage::helper('bb')->__('Payment auto captured') );
|
101 |
+
$transaction = Mage::getModel('core/resource_transaction')
|
102 |
+
->addObject($invoice)
|
103 |
+
->addObject($invoice->getOrder());
|
104 |
+
$transaction->save();
|
105 |
+
$invoice->sendEmail(true);
|
106 |
+
$capturedPaymentsCounter++;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
$pendingPaymentsCounter = count($collection);
|
110 |
+
return "{$capturedPaymentsCounter} payments captured of {$pendingPaymentsCounter} pending";
|
111 |
+
}
|
112 |
+
|
113 |
+
public function loadPending() {
|
114 |
+
/* @var $order Mage_Sales_Model_Order */
|
115 |
+
$order = Mage::getModel('sales/order');
|
116 |
+
$table = $order->getResource()->getTable('sales/order');
|
117 |
+
/* @var $collection Mage_Sales_Model_Mysql4_Order_Payment_Collection */
|
118 |
+
$collection = Mage::getModel('sales/order_payment')->getCollection();
|
119 |
+
$collection->getSelect()->join($table, "main_table.parent_id = {$table}.entity_id", array());
|
120 |
+
$collection
|
121 |
+
->addAttributeToFilter('method', self::PAYMENT_METHOD)
|
122 |
+
->addAttributeToFilter('amount_paid', array('null' => true))
|
123 |
+
->addAttributeToFilter('state', $order::STATE_NEW);
|
124 |
+
return $collection;
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* @return Quack_BB_Helper_Data
|
129 |
+
*/
|
130 |
+
public function getHelper() {
|
131 |
+
return Mage::helper('bb/data');
|
132 |
+
}
|
133 |
+
}
|
app/code/community/Quack/BB/Model/Session.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
class Quack_BB_Model_Session extends Mage_Core_Model_Session_Abstract
|
27 |
+
{
|
28 |
+
public function __construct()
|
29 |
+
{
|
30 |
+
$this->init('bb');
|
31 |
+
}
|
32 |
+
}
|
app/code/community/Quack/BB/Model/Sonda.php
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
class Quack_BB_Model_Sonda extends Varien_Object {
|
27 |
+
/**
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
public $idConv;
|
31 |
+
/**
|
32 |
+
* @var string
|
33 |
+
*/
|
34 |
+
public $refTran;
|
35 |
+
/**
|
36 |
+
* @var string
|
37 |
+
*/
|
38 |
+
public $valorSonda;
|
39 |
+
/**
|
40 |
+
* @var string
|
41 |
+
*/
|
42 |
+
public $formato;
|
43 |
+
/**
|
44 |
+
* @var string
|
45 |
+
*/
|
46 |
+
protected $valor;
|
47 |
+
/**
|
48 |
+
* @var string
|
49 |
+
*/
|
50 |
+
protected $tpPagamento;
|
51 |
+
/**
|
52 |
+
* @var string
|
53 |
+
*/
|
54 |
+
protected $situacao;
|
55 |
+
/**
|
56 |
+
* @var string
|
57 |
+
*/
|
58 |
+
protected $dataPagamento;
|
59 |
+
|
60 |
+
/**
|
61 |
+
*
|
62 |
+
* @return string
|
63 |
+
*/
|
64 |
+
public function getIdConv() {
|
65 |
+
return $this->idConv;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
*
|
70 |
+
* @param
|
71 |
+
* $idConv
|
72 |
+
*/
|
73 |
+
public function setIdConv($idConv) {
|
74 |
+
$this->idConv = $idConv;
|
75 |
+
return $this;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
*
|
80 |
+
* @return string
|
81 |
+
*/
|
82 |
+
public function getRefTran() {
|
83 |
+
return $this->refTran;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
*
|
88 |
+
* @param
|
89 |
+
* $refTran
|
90 |
+
*/
|
91 |
+
public function setRefTran($refTran) {
|
92 |
+
$this->refTran = $refTran;
|
93 |
+
return $this;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
*
|
98 |
+
* @return string
|
99 |
+
*/
|
100 |
+
public function getValorSonda() {
|
101 |
+
return $this->valorSonda;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
*
|
106 |
+
* @param
|
107 |
+
* $valorSonda
|
108 |
+
*/
|
109 |
+
public function setValorSonda($valorSonda) {
|
110 |
+
$this->valorSonda = $valorSonda;
|
111 |
+
return $this;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
*
|
116 |
+
* @return string
|
117 |
+
*/
|
118 |
+
public function getValor() {
|
119 |
+
return $this->valor;
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
*
|
124 |
+
* @param
|
125 |
+
* $valor
|
126 |
+
*/
|
127 |
+
public function setValor($valor) {
|
128 |
+
$this->valor = $valor;
|
129 |
+
return $this;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
*
|
134 |
+
* @return string
|
135 |
+
*/
|
136 |
+
public function getTpPagamento() {
|
137 |
+
return $this->tpPagamento;
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
*
|
142 |
+
* @param
|
143 |
+
* $tpPagamento
|
144 |
+
*/
|
145 |
+
public function setTpPagamento($tpPagamento) {
|
146 |
+
$this->tpPagamento = $tpPagamento;
|
147 |
+
return $this;
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
*
|
152 |
+
* @return string
|
153 |
+
*/
|
154 |
+
public function getSituacao() {
|
155 |
+
return $this->situacao;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
*
|
160 |
+
* @param
|
161 |
+
* $situacao
|
162 |
+
*/
|
163 |
+
public function setSituacao($situacao) {
|
164 |
+
$this->situacao = $situacao;
|
165 |
+
return $this;
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
*
|
170 |
+
* @return string
|
171 |
+
*/
|
172 |
+
public function getDataPagamento() {
|
173 |
+
return $this->dataPagamento;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
*
|
178 |
+
* @param
|
179 |
+
* $dataPagamento
|
180 |
+
*/
|
181 |
+
public function setDataPagamento($dataPagamento) {
|
182 |
+
$this->dataPagamento = $dataPagamento;
|
183 |
+
return $this;
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
*
|
188 |
+
* @return string
|
189 |
+
*/
|
190 |
+
public function getFormato() {
|
191 |
+
return $this->formato;
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
*
|
196 |
+
* @param
|
197 |
+
* $formato
|
198 |
+
*/
|
199 |
+
public function setFormato($formato) {
|
200 |
+
$this->formato = $formato;
|
201 |
+
return $this;
|
202 |
+
}
|
203 |
+
|
204 |
+
|
205 |
+
}
|
app/code/community/Quack/BB/Model/Source/TpPagamento.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
class Quack_BB_Model_Source_TpPagamento {
|
27 |
+
public function toOptionArray() {
|
28 |
+
return array(
|
29 |
+
array('value' => '0', 'label' => '0 - Todas as modalidades contratadas pelo convenente'),
|
30 |
+
array('value' => '2', 'label' => '2 - Boleto Bancário'),
|
31 |
+
array('value' => '21','label' => '21 - 2ª via de Boleto Bancário, já gerado anteriormente'),
|
32 |
+
array('value' => '3', 'label' => '3 - Débito em Conta via Internet - PF e PJ'),
|
33 |
+
array('value' => '5', 'label' => '5 - BB Crediário Internet'),
|
34 |
+
array('value' => '7', 'label' => '7 - Débito em Conta via Internet PF'),
|
35 |
+
);
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Quack/BB/Model/Standard.php
ADDED
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
class Quack_BB_Model_Standard extends Mage_Payment_Model_Method_Abstract {
|
27 |
+
|
28 |
+
const PAYMENT_TYPE_AUTH = 'AUTHORIZATION';
|
29 |
+
const PAYMENT_TYPE_SALE = 'SALE';
|
30 |
+
|
31 |
+
protected $_code = 'bb_standard';
|
32 |
+
protected $_formBlockType = 'bb/form';
|
33 |
+
protected $_allowCurrencyCode = array('BRL');
|
34 |
+
|
35 |
+
protected $_canUseInternal = true;
|
36 |
+
protected $_canCapture = true;
|
37 |
+
protected $_canUseForMultishipping = true;
|
38 |
+
|
39 |
+
protected $_order = null;
|
40 |
+
|
41 |
+
public function getSession() {
|
42 |
+
return Mage::getSingleton('bb/session');
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Get checkout session namespace
|
47 |
+
* @return Mage_Checkout_Model_Session
|
48 |
+
*/
|
49 |
+
public function getCheckout() {
|
50 |
+
return Mage::getSingleton('checkout/session');
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Get current quote
|
55 |
+
*
|
56 |
+
* @return Mage_Sales_Model_Quote
|
57 |
+
*/
|
58 |
+
public function getQuote() {
|
59 |
+
return $this->getCheckout()->getQuote();
|
60 |
+
}
|
61 |
+
|
62 |
+
public function createFormBlock($name) {
|
63 |
+
$block = $this->getLayout()->createBlock('bb/form', $name)
|
64 |
+
->setMethod ( 'bb_standard' )
|
65 |
+
->setPayment( $this->getPayment() );
|
66 |
+
return $block;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getTransactionId() {
|
70 |
+
return $this->getSessionData('transaction_id');
|
71 |
+
}
|
72 |
+
|
73 |
+
public function setTransactionId($data) {
|
74 |
+
return $this->setSessionData('transaction_id', $data);
|
75 |
+
}
|
76 |
+
|
77 |
+
public function validate() {
|
78 |
+
parent::validate();
|
79 |
+
$currency_code = $this->getQuote()->getBaseCurrencyCode();
|
80 |
+
if ($currency_code == '') {
|
81 |
+
$currency_code = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getBaseCurrencyCode();
|
82 |
+
}
|
83 |
+
if (!in_array($currency_code,$this->_allowCurrencyCode)) {
|
84 |
+
Mage::throwException(Mage::helper('bb')->__('A moeda selecionada ('.$currency_code.') não é compatível com o método de pagamento'));
|
85 |
+
}
|
86 |
+
return $this;
|
87 |
+
}
|
88 |
+
|
89 |
+
public function onOrderValidate(Mage_Sales_Model_Order_Payment $payment) {
|
90 |
+
return $this;
|
91 |
+
}
|
92 |
+
|
93 |
+
public function onInvoiceCreate(Mage_Sales_Model_Order_Payment $payment) {
|
94 |
+
return $this;
|
95 |
+
}
|
96 |
+
|
97 |
+
public function getOrderPlaceRedirectUrl() {
|
98 |
+
return Mage::getUrl('bb/standard/redirect');
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* @param Mage_Sales_Model_Order $order
|
103 |
+
* @return Quack_BB_Model_Standard
|
104 |
+
*/
|
105 |
+
public function setOrder($order) {
|
106 |
+
$this->_order = $order;
|
107 |
+
return $this;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* @return Mage_Sales_Model_Order
|
112 |
+
*/
|
113 |
+
public function getOrder() {
|
114 |
+
if (!($this->_order instanceof Mage_Sales_Model_Order)) {
|
115 |
+
$this->_order = Mage::getModel( 'sales/order' );
|
116 |
+
$orderIncrementId = $this->getCheckout()->getLastRealOrderId();
|
117 |
+
$this->_order->loadByIncrementId( $orderIncrementId );
|
118 |
+
}
|
119 |
+
return $this->_order;
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* @param Mage_Sales_Model_Order $order
|
124 |
+
* @return array
|
125 |
+
*/
|
126 |
+
public function getRedirectFields() {
|
127 |
+
$this->log("Quack_BB_Model_Standard::getRedirectFields() started");
|
128 |
+
$order = $this->getOrder();
|
129 |
+
$a = $order->getBillingAddress();
|
130 |
+
$tpPagamento = $this->getConfigData('tppagamento');
|
131 |
+
$dtVenc = date('dmY');
|
132 |
+
$isBoleto = ($tpPagamento == '2' || $tpPagamento == '21');
|
133 |
+
if ($isBoleto) {
|
134 |
+
$dtVenc = $this->getHelper()->getExpireDate( $this->getConfigData('dtvenc') );
|
135 |
+
}
|
136 |
+
$refTran = $this->getConfigData('reftran').sprintf("%010d", $order->getEntityId());
|
137 |
+
$valor = number_format($order->getGrandTotal(), 2, '', '');
|
138 |
+
$post = array(
|
139 |
+
'idConv' => $this->getConfigData('idconv'),
|
140 |
+
'refTran' => $refTran,
|
141 |
+
'valor' => $valor,
|
142 |
+
'dtVenc' => $dtVenc,
|
143 |
+
'tpPagamento' => $tpPagamento,
|
144 |
+
'urlRetorno' => $this->getConfigData('urlretorno'),
|
145 |
+
'nome' => $a->getFirstname() . ' ' . $a->getLastname(),
|
146 |
+
'endereco' => $a->getStreetFull(),
|
147 |
+
'cidade' => $a->getCity(),
|
148 |
+
'uf' => $a->getRegionCode(),
|
149 |
+
'cep' => $a->getPostcode(),
|
150 |
+
'msgLoja' => $this->getConfigData('msgloja'),
|
151 |
+
);
|
152 |
+
return $post;
|
153 |
+
}
|
154 |
+
|
155 |
+
public function getRequestUrl() {
|
156 |
+
return $this->getConfigData('urlbb');
|
157 |
+
}
|
158 |
+
|
159 |
+
public function getSondaUrl() {
|
160 |
+
return $this->getConfigData('urlsonda');
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* @return Quack_BB_Helper_Data
|
165 |
+
*/
|
166 |
+
public function getHelper() {
|
167 |
+
return Mage::helper('bb/data');
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* (non-PHPdoc)
|
172 |
+
* @see Mage_Payment_Model_Method_Abstract::capture()
|
173 |
+
*/
|
174 |
+
public function capture(Varien_Object $payment, $amount) {
|
175 |
+
parent::capture($payment, $amount);
|
176 |
+
$this->log("Quack_BB_Model_Standard::capture() started");
|
177 |
+
try {/* @var $request Quack_BB_Model_Sonda */
|
178 |
+
$parentId = sprintf("%010d", $payment->getParentId());
|
179 |
+
$request = Mage::getModel('bb/sonda')
|
180 |
+
->setIdConv($this->getConfigData('idconv'))
|
181 |
+
->setValorSonda( number_format($amount, 2, '', '') )
|
182 |
+
->setRefTran("{$this->getConfigData('reftran')}{$parentId}")
|
183 |
+
->setFormato('02');
|
184 |
+
$sonda = $this->sonda( (array)$request );
|
185 |
+
$this->getInfoInstance()
|
186 |
+
->setAdditionalInformation( 'paymentType' , (string)$sonda->getTpPagamento())
|
187 |
+
->setAdditionalInformation( 'paymentStatus' , (string)$sonda->getSituacao())
|
188 |
+
->save();
|
189 |
+
} catch (Exception $e) {
|
190 |
+
Mage::throwException($e->getMessage());
|
191 |
+
}
|
192 |
+
if ($sonda->getSituacao() != '00') {
|
193 |
+
$typeMsg = $this->getHelper()->getTypeMessage ( $sonda->getTpPagamento() );
|
194 |
+
$statMsg = $this->getHelper()->getStatusMessage( $sonda->getSituacao() );
|
195 |
+
Mage::throwException("{$typeMsg}: {$statMsg}");
|
196 |
+
}
|
197 |
+
return $this;
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* @param array $params
|
202 |
+
* @return Quack_BB_Model_Sonda
|
203 |
+
*/
|
204 |
+
public function sonda($params) {
|
205 |
+
$this->log("Quack_BB_Model_Standard::sonda() started");
|
206 |
+
$client = new Zend_Http_Client($this->getSondaUrl());
|
207 |
+
$client->setParameterPost( $params );
|
208 |
+
$result = $client->request('POST')->getBody();
|
209 |
+
$this->log("URI: {$client->getLastRequest()}");
|
210 |
+
$result = preg_replace('/<\![^>]*>/', '', $result); // remove doctype and cdata declarations
|
211 |
+
$result = preg_replace('/<\?[^>]*>/', '', $result); // remove xml version and charset declaration
|
212 |
+
$sonda = Mage::getModel('bb/sonda'); /* @var $sonda Quack_BB_Model_Sonda */
|
213 |
+
$xml = @simplexml_load_string($result);
|
214 |
+
foreach ($xml->children() as $child) {
|
215 |
+
$sonda->setDataUsingMethod( $child['nome'], (string) $child['valor'] );
|
216 |
+
}
|
217 |
+
$this->log($result);
|
218 |
+
return $sonda;
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* @param string $message
|
223 |
+
* @return Quack_BB_Model_Standard
|
224 |
+
*/
|
225 |
+
public function log($message) {
|
226 |
+
Mage::log($message, null, 'bb.log');
|
227 |
+
return $this;
|
228 |
+
}
|
229 |
+
}
|
app/code/community/Quack/BB/controllers/StandardController.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
class Quack_BB_StandardController extends Mage_Core_Controller_Front_Action
|
27 |
+
{
|
28 |
+
public $data=array();
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Order instance
|
32 |
+
*/
|
33 |
+
protected $_order;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Get order
|
37 |
+
*
|
38 |
+
* @return Mage_Sales_Model_Order
|
39 |
+
*/
|
40 |
+
public function getOrder() {
|
41 |
+
if ($this->_order == null) {
|
42 |
+
}
|
43 |
+
return $this->_order;
|
44 |
+
}
|
45 |
+
|
46 |
+
protected function _expireAjax()
|
47 |
+
{
|
48 |
+
if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
|
49 |
+
$this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');
|
50 |
+
exit;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @return Quack_BB_Model_Standard
|
56 |
+
*/
|
57 |
+
public function getStandard() {
|
58 |
+
return Mage::getSingleton('bb/standard');
|
59 |
+
}
|
60 |
+
|
61 |
+
public function getHelper() {
|
62 |
+
return $this->getStandard()->getHelper();
|
63 |
+
}
|
64 |
+
|
65 |
+
public function getConfig($field) {
|
66 |
+
return $this->getStandard()->getConfigData($field);
|
67 |
+
}
|
68 |
+
|
69 |
+
public function redirectAction() {
|
70 |
+
$session = Mage::getSingleton('checkout/session');
|
71 |
+
$session->setBBStandardQuoteId($session->getQuoteId());
|
72 |
+
if ( $this->getStandard()->getOrder()->getPayment() ) {
|
73 |
+
$this->getStandard()->getOrder()->sendNewOrderEmail();
|
74 |
+
}
|
75 |
+
$this->getResponse()->setBody($this->getLayout()->createBlock('bb/redirect')->toHtml());
|
76 |
+
$session->unsQuoteId();
|
77 |
+
$session->unsRedirectUrl();
|
78 |
+
}
|
79 |
+
|
80 |
+
public function cancelAction() {
|
81 |
+
$session = Mage::getSingleton('checkout/session');
|
82 |
+
$session->setQuoteId($session->getBBQuoteId(true));
|
83 |
+
if ($session->getLastRealOrderId()) {
|
84 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId());
|
85 |
+
if ($order->getId()) {
|
86 |
+
$order->cancel()->save();
|
87 |
+
}
|
88 |
+
}
|
89 |
+
$this->_redirect('checkout/cart');
|
90 |
+
}
|
91 |
+
|
92 |
+
public function successAction() {
|
93 |
+
$session = Mage::getSingleton('checkout/session');
|
94 |
+
$session->setQuoteId($session->getBBStandardQuoteId(true));
|
95 |
+
Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();
|
96 |
+
$this->_redirect('checkout/onepage/success', array('_secure'=>false));
|
97 |
+
}
|
98 |
+
|
99 |
+
public function returnAction() {
|
100 |
+
$session = Mage::getSingleton('core/session'); /* @var $session Mage_Core_Model_Session */
|
101 |
+
$refTran = $this->getRequest()->getParam('refTran');
|
102 |
+
$idCobr = substr($refTran, 0, 7);
|
103 |
+
$orderId = substr($refTran, 7);
|
104 |
+
if ($idCobr == $this->getConfig('refTran')) {
|
105 |
+
try {/* @var $order Mage_Sales_Model_Order */
|
106 |
+
$order = Mage::getModel("sales/order")->load((int)$orderId);
|
107 |
+
if ($order->canInvoice()) {
|
108 |
+
$invoice = $order->prepareInvoice();
|
109 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
|
110 |
+
$invoice->register();
|
111 |
+
$invoice->getOrder()->setIsInProcess(true);
|
112 |
+
// $order->addStatusHistoryComment($this->getHelper()->getTypeMessage($tipPag));
|
113 |
+
$transaction = Mage::getModel('core/resource_transaction')
|
114 |
+
->addObject($invoice)
|
115 |
+
->addObject($invoice->getOrder());
|
116 |
+
$transaction->save();
|
117 |
+
// $invoice->sendEmail(true);
|
118 |
+
$session->addSuccess("Pedido efetuado com sucesso!");
|
119 |
+
}
|
120 |
+
} catch (Exception $e) {
|
121 |
+
$session->addError($e->getMessage());
|
122 |
+
$session->addNotice("Se já efetuou o pagamento, aguarde alguns instantes, a confirmação aparecerá em breve.");
|
123 |
+
$session->addNotice("Caso não tenha conseguido realizar o pagamento, acesse seu pedido, e clique em Efetuar Pagamento.");
|
124 |
+
}
|
125 |
+
}
|
126 |
+
$this->_redirect("sales/order/history");
|
127 |
+
}
|
128 |
+
}
|
129 |
+
?>
|
app/code/community/Quack/BB/etc/config.xml
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Este arquivo é parte do programa Quack BB
|
5 |
+
*
|
6 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
7 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
8 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
9 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
10 |
+
*
|
11 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
12 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
13 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
14 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
15 |
+
*
|
16 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
17 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
18 |
+
*
|
19 |
+
* @category Quack
|
20 |
+
* @package Quack_BB
|
21 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
22 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
23 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
24 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
25 |
+
*/
|
26 |
+
-->
|
27 |
+
<config>
|
28 |
+
<modules>
|
29 |
+
<Quack_BB>
|
30 |
+
<version>1.0.0</version>
|
31 |
+
</Quack_BB>
|
32 |
+
</modules>
|
33 |
+
<global>
|
34 |
+
<models>
|
35 |
+
<bb>
|
36 |
+
<class>Quack_BB_Model</class>
|
37 |
+
<resourceModel>bb_mysql4</resourceModel>
|
38 |
+
</bb>
|
39 |
+
</models>
|
40 |
+
<helpers>
|
41 |
+
<bb>
|
42 |
+
<class>Quack_BB_Helper</class>
|
43 |
+
</bb>
|
44 |
+
</helpers>
|
45 |
+
<resources>
|
46 |
+
<bb_setup>
|
47 |
+
<setup>
|
48 |
+
<module>Quack_BB</module>
|
49 |
+
</setup>
|
50 |
+
<connection>
|
51 |
+
<use>core_setup</use>
|
52 |
+
</connection>
|
53 |
+
</bb_setup>
|
54 |
+
<bb_write>
|
55 |
+
<connection>
|
56 |
+
<use>core_write</use>
|
57 |
+
</connection>
|
58 |
+
</bb_write>
|
59 |
+
<bb_read>
|
60 |
+
<connection>
|
61 |
+
<use>core_read</use>
|
62 |
+
</connection>
|
63 |
+
</bb_read>
|
64 |
+
</resources>
|
65 |
+
<blocks>
|
66 |
+
<bb>
|
67 |
+
<class>Quack_BB_Block</class>
|
68 |
+
</bb>
|
69 |
+
</blocks>
|
70 |
+
</global>
|
71 |
+
<frontend>
|
72 |
+
<routers>
|
73 |
+
<bb>
|
74 |
+
<use>standard</use>
|
75 |
+
<args>
|
76 |
+
<module>Quack_BB</module>
|
77 |
+
<frontName>bb</frontName>
|
78 |
+
</args>
|
79 |
+
</bb>
|
80 |
+
</routers>
|
81 |
+
<translate>
|
82 |
+
<modules>
|
83 |
+
<Quack_BB>
|
84 |
+
<files>
|
85 |
+
<default>Quack_BB.csv</default>
|
86 |
+
</files>
|
87 |
+
</Quack_BB>
|
88 |
+
</modules>
|
89 |
+
</translate>
|
90 |
+
<events>
|
91 |
+
<payment_info_block_prepare_specific_information>
|
92 |
+
<observers>
|
93 |
+
<quack_bb_observer>
|
94 |
+
<type>singleton</type>
|
95 |
+
<class>Quack_BB_Model_Observer</class>
|
96 |
+
<method>setFrontendPaymentInfo</method>
|
97 |
+
</quack_bb_observer>
|
98 |
+
</observers>
|
99 |
+
</payment_info_block_prepare_specific_information>
|
100 |
+
</events>
|
101 |
+
</frontend>
|
102 |
+
<adminhtml>
|
103 |
+
<translate>
|
104 |
+
<modules>
|
105 |
+
<Quack_BB>
|
106 |
+
<files>
|
107 |
+
<default>Quack_BB.csv</default>
|
108 |
+
</files>
|
109 |
+
</Quack_BB>
|
110 |
+
</modules>
|
111 |
+
</translate>
|
112 |
+
<events>
|
113 |
+
<payment_info_block_prepare_specific_information>
|
114 |
+
<observers>
|
115 |
+
<quack_bb_observer>
|
116 |
+
<type>singleton</type>
|
117 |
+
<class>Quack_BB_Model_Observer</class>
|
118 |
+
<method>setBackendPaymentInfo</method>
|
119 |
+
</quack_bb_observer>
|
120 |
+
</observers>
|
121 |
+
</payment_info_block_prepare_specific_information>
|
122 |
+
</events>
|
123 |
+
</adminhtml>
|
124 |
+
<default>
|
125 |
+
<payment>
|
126 |
+
<bb_standard>
|
127 |
+
<model>bb/standard</model>
|
128 |
+
<title>Banco do Brasil</title>
|
129 |
+
<allowspecific>1</allowspecific>
|
130 |
+
<urlbb>https://mpag.bb.com.br/site/mpag/</urlbb>
|
131 |
+
<urlsonda>https://mpag.bb.com.br/site/mpag/REC3.jsp</urlsonda>
|
132 |
+
</bb_standard>
|
133 |
+
</payment>
|
134 |
+
</default>
|
135 |
+
<crontab>
|
136 |
+
<jobs>
|
137 |
+
<bb_status_check>
|
138 |
+
<schedule>
|
139 |
+
<cron_expr>*/10 * * * *</cron_expr>
|
140 |
+
</schedule>
|
141 |
+
<run>
|
142 |
+
<model>bb/observer::checkPayment</model>
|
143 |
+
</run>
|
144 |
+
</bb_status_check>
|
145 |
+
</jobs>
|
146 |
+
</crontab>
|
147 |
+
</config>
|
app/code/community/Quack/BB/etc/system.xml
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Este arquivo é parte do programa Quack BB
|
5 |
+
*
|
6 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
7 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
8 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
9 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
10 |
+
*
|
11 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
12 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
13 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
14 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
15 |
+
*
|
16 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
17 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
18 |
+
*
|
19 |
+
* @category Quack
|
20 |
+
* @package Quack_BB
|
21 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
22 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
23 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
24 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
25 |
+
*/
|
26 |
+
-->
|
27 |
+
<config>
|
28 |
+
<sections>
|
29 |
+
<payment>
|
30 |
+
<groups>
|
31 |
+
<bb_standard translate="label" module="bb">
|
32 |
+
<label>Banco do Brasil</label>
|
33 |
+
<frontend_type>text</frontend_type>
|
34 |
+
<sort_order>0</sort_order>
|
35 |
+
<show_in_default>1</show_in_default>
|
36 |
+
<show_in_website>1</show_in_website>
|
37 |
+
<show_in_store>0</show_in_store>
|
38 |
+
<fields>
|
39 |
+
<active translate="label">
|
40 |
+
<label>Enabled</label>
|
41 |
+
<frontend_type>select</frontend_type>
|
42 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
43 |
+
<sort_order>1</sort_order>
|
44 |
+
<show_in_default>1</show_in_default>
|
45 |
+
<show_in_website>1</show_in_website>
|
46 |
+
<show_in_store>1</show_in_store>
|
47 |
+
</active>
|
48 |
+
<title>
|
49 |
+
<label>Título</label>
|
50 |
+
<frontend_type>text</frontend_type>
|
51 |
+
<sort_order>10</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
</title>
|
56 |
+
<urlretorno>
|
57 |
+
<label>URL Retorno</label>
|
58 |
+
<frontend_type>text</frontend_type>
|
59 |
+
<sort_order>20</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
<comment>Endereço (URL) para o qual o cliente será direcionado, através do formulário Retorno, caso deseje voltar identificado ao site do convenente, a partir da última página do processo de pagamento, clicando em botão disponível nessa página. Exemplo: /RetornoBB.asp?1358568</comment>
|
64 |
+
</urlretorno>
|
65 |
+
<urlinforma>
|
66 |
+
<label>URL Informa</label>
|
67 |
+
<frontend_type>text</frontend_type>
|
68 |
+
<sort_order>30</sort_order>
|
69 |
+
<show_in_default>1</show_in_default>
|
70 |
+
<show_in_website>1</show_in_website>
|
71 |
+
<show_in_store>1</show_in_store>
|
72 |
+
<comment>Complemento de endereço (URL) que será acionado, indicando que uma transação foi finalizada no site do BB. Exemplo: /InformaBB.asp?1358568</comment>
|
73 |
+
</urlinforma>
|
74 |
+
<urlbb>
|
75 |
+
<label>URL do Banco</label>
|
76 |
+
<frontend_type>text</frontend_type>
|
77 |
+
<sort_order>40</sort_order>
|
78 |
+
<show_in_default>1</show_in_default>
|
79 |
+
<show_in_website>1</show_in_website>
|
80 |
+
<show_in_store>1</show_in_store>
|
81 |
+
<comment>URL completa do webservice de pagamento.</comment>
|
82 |
+
</urlbb>
|
83 |
+
<urlsonda>
|
84 |
+
<label>URL Sonda</label>
|
85 |
+
<frontend_type>text</frontend_type>
|
86 |
+
<sort_order>45</sort_order>
|
87 |
+
<show_in_default>1</show_in_default>
|
88 |
+
<show_in_website>1</show_in_website>
|
89 |
+
<show_in_store>1</show_in_store>
|
90 |
+
<comment>URL completa do webservice de consulta.</comment>
|
91 |
+
</urlsonda>
|
92 |
+
<idconv>
|
93 |
+
<label>Código de Comércio Eletrônico</label>
|
94 |
+
<frontend_type>text</frontend_type>
|
95 |
+
<sort_order>50</sort_order>
|
96 |
+
<show_in_default>1</show_in_default>
|
97 |
+
<show_in_website>1</show_in_website>
|
98 |
+
<show_in_store>1</show_in_store>
|
99 |
+
<comment>Código do convênio de Comércio Eletrônico fornecido pelo banco (número de 6 dígitos).</comment>
|
100 |
+
</idconv>
|
101 |
+
<reftran>
|
102 |
+
<label>Código de Cobrança</label>
|
103 |
+
<frontend_type>text</frontend_type>
|
104 |
+
<sort_order>55</sort_order>
|
105 |
+
<show_in_default>1</show_in_default>
|
106 |
+
<show_in_website>1</show_in_website>
|
107 |
+
<show_in_store>1</show_in_store>
|
108 |
+
<comment>Código do convênio de Cobrança fornecido pelo banco (número de 6 ou 7 dígitos).</comment>
|
109 |
+
</reftran>
|
110 |
+
<tppagamento>
|
111 |
+
<label>Modalidade de Pagamento</label>
|
112 |
+
<frontend_type>select</frontend_type>
|
113 |
+
<source_model>Quack_BB_Model_Source_TpPagamento</source_model>
|
114 |
+
<sort_order>60</sort_order>
|
115 |
+
<show_in_default>1</show_in_default>
|
116 |
+
<show_in_website>1</show_in_website>
|
117 |
+
<show_in_store>1</show_in_store>
|
118 |
+
</tppagamento>
|
119 |
+
<dtvenc>
|
120 |
+
<label>Prazo de Vencimento</label>
|
121 |
+
<frontend_type>text</frontend_type>
|
122 |
+
<sort_order>70</sort_order>
|
123 |
+
<show_in_default>1</show_in_default>
|
124 |
+
<show_in_website>1</show_in_website>
|
125 |
+
<show_in_store>1</show_in_store>
|
126 |
+
<comment>Número de dias para o vencimento do boleto. Esta opção será usada apenas se escolher boleto como forma de pagamento.</comment>
|
127 |
+
</dtvenc>
|
128 |
+
<msgloja>
|
129 |
+
<label>Mensagem do Boleto</label>
|
130 |
+
<frontend_type>text</frontend_type>
|
131 |
+
<sort_order>75</sort_order>
|
132 |
+
<show_in_default>1</show_in_default>
|
133 |
+
<show_in_website>1</show_in_website>
|
134 |
+
<show_in_store>1</show_in_store>
|
135 |
+
<comment>Mensagem apresentada no boleto de cobrança.</comment>
|
136 |
+
</msgloja>
|
137 |
+
<order_status translate="label">
|
138 |
+
<label>Status dos novos pedidos</label>
|
139 |
+
<frontend_type>select</frontend_type>
|
140 |
+
<source_model>adminhtml/system_config_source_order_status_new</source_model>
|
141 |
+
<sort_order>80</sort_order>
|
142 |
+
<show_in_default>1</show_in_default>
|
143 |
+
<show_in_website>1</show_in_website>
|
144 |
+
<show_in_store>1</show_in_store>
|
145 |
+
</order_status>
|
146 |
+
<allowspecific translate="label">
|
147 |
+
<label>Tipos de Países Permitidos</label>
|
148 |
+
<frontend_type>allowspecific</frontend_type>
|
149 |
+
<sort_order>90</sort_order>
|
150 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
151 |
+
<show_in_default>1</show_in_default>
|
152 |
+
<show_in_website>1</show_in_website>
|
153 |
+
<show_in_store>1</show_in_store>
|
154 |
+
</allowspecific>
|
155 |
+
<specificcountry translate="label">
|
156 |
+
<label>Permitir Pagamento de Países Específicos</label>
|
157 |
+
<frontend_type>multiselect</frontend_type>
|
158 |
+
<sort_order>100</sort_order>
|
159 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
160 |
+
<show_in_default>1</show_in_default>
|
161 |
+
<show_in_website>1</show_in_website>
|
162 |
+
<show_in_store>1</show_in_store>
|
163 |
+
</specificcountry>
|
164 |
+
<min_order_total translate="label">
|
165 |
+
<label>Minimum Order Total</label>
|
166 |
+
<frontend_type>text</frontend_type>
|
167 |
+
<sort_order>102</sort_order>
|
168 |
+
<show_in_default>1</show_in_default>
|
169 |
+
<show_in_website>1</show_in_website>
|
170 |
+
<show_in_store>1</show_in_store>
|
171 |
+
</min_order_total>
|
172 |
+
<max_order_total translate="label">
|
173 |
+
<label>Maximum Order Total</label>
|
174 |
+
<frontend_type>text</frontend_type>
|
175 |
+
<sort_order>108</sort_order>
|
176 |
+
<show_in_default>1</show_in_default>
|
177 |
+
<show_in_website>1</show_in_website>
|
178 |
+
<show_in_store>1</show_in_store>
|
179 |
+
</max_order_total>
|
180 |
+
<sort_order translate="label">
|
181 |
+
<label>Sort order</label>
|
182 |
+
<frontend_type>text</frontend_type>
|
183 |
+
<sort_order>110</sort_order>
|
184 |
+
<show_in_default>1</show_in_default>
|
185 |
+
<show_in_website>1</show_in_website>
|
186 |
+
<show_in_store>1</show_in_store>
|
187 |
+
</sort_order>
|
188 |
+
</fields>
|
189 |
+
</bb_standard>
|
190 |
+
</groups>
|
191 |
+
</payment>
|
192 |
+
</sections>
|
193 |
+
</config>
|
app/design/frontend/base/default/template/bb/email/redirect.phtml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @var $this Mage_Payment_Block_Info
|
28 |
+
*/
|
29 |
+
?>
|
30 |
+
<?php if ($this->getOrder()->getPayment()->getMethod() == 'bb_standard'): ?>
|
31 |
+
<br />
|
32 |
+
<a href="<?php echo Mage::getUrl("bb/standard/redirect/order_id/{$this->getOrder()->getId()}") ?>">Efetuar Pagamento</a>
|
33 |
+
<br />
|
34 |
+
<i>Se já realizou o pagamento, aguarde a compensação. Você receberá uma confirmação em breve.</i>
|
35 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/bb/form.phtml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @var $this Quack_BB_Block_Form
|
28 |
+
*/
|
29 |
+
?>
|
30 |
+
<fieldset class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none">
|
31 |
+
<div><strong>Prossiga se tiver acesso a sua conta bancária pelo computador</strong></div>
|
32 |
+
<div>Caso contrário, escolha outra opção de pagamento, ou fale com seu gerente e solicite seu acesso.</div>
|
33 |
+
</fieldset>
|
app/design/frontend/base/default/template/bb/info/redirect.phtml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @var $this Mage_Payment_Block_Info
|
28 |
+
*/
|
29 |
+
?>
|
30 |
+
<br />
|
31 |
+
<button type="submit" title="Efetuar Pagamento" class="button" onclick="location.href='<?php echo $this->getPaymenturl() ?>'"><span><span>Efetuar Pagamento</span></span></button>
|
32 |
+
<br />
|
33 |
+
<i>Se já realizou o pagamento, aguarde a compensação. Você receberá uma confirmação em breve.</i>
|
app/design/frontend/base/default/template/bb/redirect.phtml
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Este arquivo é parte do programa Quack BB
|
4 |
+
*
|
5 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
6 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
7 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
8 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
9 |
+
*
|
10 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
11 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
12 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
13 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
14 |
+
*
|
15 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
16 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
17 |
+
*
|
18 |
+
* @category Quack
|
19 |
+
* @package Quack_BB
|
20 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
21 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
22 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
23 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
24 |
+
*/
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @var $this Quack_BB_Block_Redirect
|
28 |
+
*/
|
29 |
+
?>
|
30 |
+
<html>
|
31 |
+
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
|
32 |
+
<body>
|
33 |
+
<?php echo $this->getMessage(); ?>
|
34 |
+
<?php echo $this->getForm(); ?>
|
35 |
+
<script type="text/javascript">document.getElementById("standard_checkout").submit();</script>
|
36 |
+
</body>
|
37 |
+
</html>
|
app/etc/modules/Quack_BB.xml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Este arquivo é parte do programa Quack BB
|
5 |
+
*
|
6 |
+
* Quack BB é um software livre; você pode redistribuí-lo e/ou
|
7 |
+
* modificá-lo dentro dos termos da Licença Pública Geral GNU como
|
8 |
+
* publicada pela Fundação do Software Livre (FSF); na versão 3 da
|
9 |
+
* Licença, ou (na sua opinião) qualquer versão.
|
10 |
+
*
|
11 |
+
* Este programa é distribuído na esperança de que possa ser útil,
|
12 |
+
* mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
|
13 |
+
* a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
|
14 |
+
* Licença Pública Geral GNU para maiores detalhes.
|
15 |
+
*
|
16 |
+
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
|
17 |
+
* com este programa, Se não, veja <http://www.gnu.org/licenses/>.
|
18 |
+
*
|
19 |
+
* @category Quack
|
20 |
+
* @package Quack_BB
|
21 |
+
* @author Rafael Patro <rafaelpatro@gmail.com>
|
22 |
+
* @copyright Copyright (c) 2015 Rafael Patro (rafaelpatro@gmail.com)
|
23 |
+
* @license http://www.gnu.org/licenses/gpl.txt
|
24 |
+
* @link https://github.com/rafaelpatro/Quack-BB
|
25 |
+
*/
|
26 |
+
-->
|
27 |
+
<config>
|
28 |
+
<modules>
|
29 |
+
<Quack_BB>
|
30 |
+
<active>true</active>
|
31 |
+
<codePool>community</codePool>
|
32 |
+
</Quack_BB>
|
33 |
+
</modules>
|
34 |
+
</config>
|
app/locale/pt_BR/Quack_BB.csv
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Bank Method","Método"
|
2 |
+
"Bank Status","Situação"
|
3 |
+
"For BB clients only",".::Exclusivo para correntista BB:"
|
4 |
+
"Payment auto captured","Pagamento capturado automaticamente"
|
5 |
+
"undefined bank status %s","situação desconhecida %s"
|
6 |
+
"undefined bank method %s","Débito Online %s"
|
7 |
+
"payment not selected yet","pagamento ainda não escolhido"
|
8 |
+
"Bank Slip","Boleto Bancário"
|
9 |
+
"Online Debit","Débito em Conta via Internet"
|
10 |
+
"Installment Plan","BB Crediário Internet"
|
11 |
+
"You will be redirected to your bank account in a few momments.","Você será redirecionado para o ambiente seguro do banco em alguns instantes."
|
package.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>quack_bb</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.gnu.org/licenses/gpl.txt">GNU general public license</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Módulo de pagamentos Banco do Brasil para Magento. Desenvolvido a partir do Manual de Orientações Técnicas, fornecido pelo Banco do Brasil.</summary>
|
10 |
+
<description>Módulo de pagamentos Banco do Brasil para Magento.
|
11 |
+

|
12 |
+
Esta extensão tem por objetivo gerenciar pagamentos realizados através do convênio de comércio eletrônico do Banco do Brasil.
|
13 |
+

|
14 |
+
- Recebe pagamentos de forma automática, sem necessidade de confirmação manual.
|
15 |
+
- Livre de intermediários, ou gateways de pagamentos.
|
16 |
+
- Extensão completamente gratuita, sem propagandas, ou versões pagas.
|
17 |
+

|
18 |
+
</description>
|
19 |
+
<notes>Requisitos:
|
20 |
+

|
21 |
+
- Ser cliente BB
|
22 |
+
- Aderir ao regulamento do Comércio Eletrônico do BB
|
23 |
+
- Formalizar os convênios para as modalidades de meio de pagamento escolhidas</notes>
|
24 |
+
<authors><author><name>Rafael Patro</name><user>haphaews</user><email>rafaelpatro@gmail.com</email></author></authors>
|
25 |
+
<date>2015-08-16</date>
|
26 |
+
<time>20:02:54</time>
|
27 |
+
<contents><target name="magecommunity"><dir name="Quack"><dir name="BB"><dir name="Block"><file name="Form.php" hash="487e2e426474e30c83f4cf557138d0fc"/><file name="Redirect.php" hash="d8c70382f2efe5ad515be6949685e617"/></dir><dir name="Helper"><file name="Data.php" hash="0baec89c036fcf99c7b6be0ce5e9f49c"/></dir><dir name="Model"><file name="Observer.php" hash="82c807ab9ba2365b155f03800153f1a2"/><file name="Session.php" hash="d514012efb73ea12e9eb1a544fbb25a5"/><file name="Sonda.php" hash="71934267a0a5e7fcb7397edb30995d9b"/><dir name="Source"><file name="TpPagamento.php" hash="ded1fd6a84af631230d86759502c2042"/></dir><file name="Standard.php" hash="3142282d1893c1a1ca6da16da2ca3176"/></dir><dir name="controllers"><file name="StandardController.php" hash="15134bbfa6066bde75f37007beb33c4c"/></dir><dir name="etc"><file name="config.xml" hash="eca5ff9c7942c3a110ea94787ab9af14"/><file name="system.xml" hash="ed540ff827a5a748b32b31790673b605"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="bb"><dir name="email"><file name="redirect.phtml" hash="3823a6600038ec94b52a8597b7b07769"/></dir><file name="form.phtml" hash="cf7d0ae95d126e3dbbb69cd7d30e71d9"/><dir name="info"><file name="redirect.phtml" hash="f043effbc030f551bb85ef8d59fe3e4b"/></dir><file name="redirect.phtml" hash="7f85f10536d055a6f4c894277855ed4c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Quack_BB.xml" hash="728912444f56047563036c4883112fb5"/></dir></target><target name="magelocale"><dir name="pt_BR"><file name="Quack_BB.csv" hash="228f0546a1eb7ee5a56cd6dd4bf7d22d"/></dir></target></contents>
|
28 |
+
<compatible/>
|
29 |
+
<dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php></required></dependencies>
|
30 |
+
</package>
|