Version Notes
Necessário criar conta no http://www.eupago.pt
Download this release
Release Info
Developer | Eupago |
Extension | Eupago_MB |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/local/Eupago/Multibanco/Block/Form.php +15 -0
- app/code/local/Eupago/Multibanco/Block/Info.php +29 -0
- app/code/local/Eupago/Multibanco/Helper/Data.php +4 -0
- app/code/local/Eupago/Multibanco/Model/Convert/Order.php +24 -0
- app/code/local/Eupago/Multibanco/Model/Convert/Quote.php +20 -0
- app/code/local/Eupago/Multibanco/Model/GerarRef.php +98 -0
- app/code/local/Eupago/Multibanco/Model/Mysql4/Setup.php +5 -0
- app/code/local/Eupago/Multibanco/Model/PaymentAction.php +44 -0
- app/code/local/Eupago/Multibanco/Model/Process.php +96 -0
- app/code/local/Eupago/Multibanco/etc/config.xml +153 -0
- app/code/local/Eupago/Multibanco/etc/system.xml +121 -0
- app/code/local/Eupago/Multibanco/sql/multibanco_setup/mysql4-install-1.0.0.php +20 -0
- app/design/adminhtml/default/default/template/multibanco/form/form.phtml +8 -0
- app/design/adminhtml/default/default/template/multibanco/form/mark.phtml +3 -0
- app/design/adminhtml/default/default/template/multibanco/info/info.phtml +21 -0
- app/design/adminhtml/default/default/template/multibanco/info/pdf/info.phtml +5 -0
- app/design/frontend/default/default/template/checkout/success.phtml +126 -0
- app/design/frontend/default/default/template/multibanco/form/form.phtml +8 -0
- app/design/frontend/default/default/template/multibanco/form/mark.phtml +3 -0
- app/design/frontend/default/default/template/multibanco/info/info.phtml +86 -0
- app/etc/modules/Eupago_Multibanco.xml +12 -0
- package.xml +18 -0
- skin/adminhtml/default/default/images/multibanco/eupagomultibanco.png +0 -0
app/code/local/Eupago/Multibanco/Block/Form.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Multibanco_Block_Form extends Mage_Payment_Block_Form
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$mark = Mage::getConfig()->getBlockClassName('core/template');
|
7 |
+
$mark = new $mark;
|
8 |
+
$mark->setTemplate('multibanco/form/mark.phtml');
|
9 |
+
|
10 |
+
$this->setTemplate('multibanco/form/form.phtml')
|
11 |
+
->setMethodLabelAfterHtml($mark->toHtml())
|
12 |
+
;
|
13 |
+
parent::_construct();
|
14 |
+
}
|
15 |
+
}
|
app/code/local/Eupago/Multibanco/Block/Info.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Multibanco_Block_Info extends Mage_Payment_Block_Info
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->setTemplate('multibanco/info/info.phtml');
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getInfo()
|
11 |
+
{
|
12 |
+
$info = $this->getData('info');
|
13 |
+
if (!($info instanceof Mage_Payment_Model_Info)) {
|
14 |
+
Mage::throwException($this->__('Can not retrieve payment info model object.'));
|
15 |
+
}
|
16 |
+
return $info;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getMethod()
|
20 |
+
{
|
21 |
+
return $this->getInfo()->getMethodInstance();
|
22 |
+
}
|
23 |
+
|
24 |
+
public function toPdf()
|
25 |
+
{
|
26 |
+
$this->setTemplate('multibanco/info/pdf/info.phtml');
|
27 |
+
return $this->toHtml();
|
28 |
+
}
|
29 |
+
}
|
app/code/local/Eupago/Multibanco/Helper/Data.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Multibanco_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
}
|
app/code/local/Eupago/Multibanco/Model/Convert/Order.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Multibanco_Model_Convert_Order extends Mage_Sales_Model_Convert_Order
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* Convert order payment to quote payment
|
6 |
+
*
|
7 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
8 |
+
* @return Mage_Sales_Model_Quote_Payment
|
9 |
+
*/
|
10 |
+
public function paymentToQuotePayment(Mage_Sales_Model_Order_Payment $payment, $quotePayment=null)
|
11 |
+
{
|
12 |
+
$quotePayment = parent::paymentToQuotePayment($payment, $quotePayment);
|
13 |
+
|
14 |
+
var_dump($quotePayment);
|
15 |
+
|
16 |
+
$quotePayment->setEupagoEntidade($payment->getEupagoEntidade())
|
17 |
+
->setEupagoReferencia($payment->getEupagoReferencia())
|
18 |
+
->setEupagoMontante($payment->getEupagoMontante());
|
19 |
+
|
20 |
+
return $quotePayment;
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
}
|
app/code/local/Eupago/Multibanco/Model/Convert/Quote.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Multibanco_Model_Convert_Quote extends Mage_Sales_Model_Convert_Quote
|
3 |
+
{
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Convert quote payment to order payment
|
7 |
+
*
|
8 |
+
* @param Mage_Sales_Model_Quote_Payment $payment
|
9 |
+
* @return Mage_Sales_Model_Quote_Payment
|
10 |
+
*/
|
11 |
+
public function paymentToOrderPayment(Mage_Sales_Model_Quote_Payment $payment)
|
12 |
+
{
|
13 |
+
$orderPayment = parent::paymentToOrderPayment($payment);
|
14 |
+
$orderPayment->setEupagoEntidade($payment->getEupagoEntidade())
|
15 |
+
->setEupagoReferencia($payment->getEupagoReferencia())
|
16 |
+
->setEupagoMontante($payment->getEupagoMontante());
|
17 |
+
return $orderPayment;
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
app/code/local/Eupago/Multibanco/Model/GerarRef.php
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Eupago_Multibanco_Model_GerarRef extends Mage_Payment_Model_Method_Abstract {
|
4 |
+
|
5 |
+
protected $_code = 'multibanco';
|
6 |
+
protected $_paymentMethod = 'multibanco';
|
7 |
+
protected $_formBlockType = 'multibanco/form';
|
8 |
+
protected $_infoBlockType = 'multibanco/info';
|
9 |
+
protected $_allowCurrencyCode = array('EUR');
|
10 |
+
protected $_isGateway = false;
|
11 |
+
protected $_canOrder = true;
|
12 |
+
protected $_canAuthorize = false;
|
13 |
+
protected $_canCapture = true;
|
14 |
+
protected $_canCapturePartial = false;
|
15 |
+
protected $_canRefund = false;
|
16 |
+
protected $_canRefundInvoicePartial = false;
|
17 |
+
protected $_canVoid = false;
|
18 |
+
protected $_canUseInternal = true;
|
19 |
+
protected $_canUseCheckout = true;
|
20 |
+
protected $_canUseForMultishipping = true;
|
21 |
+
protected $_isInitializeNeeded = false;
|
22 |
+
protected $_canFetchTransactionInfo = false;
|
23 |
+
protected $_canReviewPayment = false;
|
24 |
+
protected $_canCreateBillingAgreement = false;
|
25 |
+
protected $_canManageRecurringProfiles = true;
|
26 |
+
|
27 |
+
public function getMensagem() {
|
28 |
+
return $this->getConfigData('mensagem');
|
29 |
+
}
|
30 |
+
|
31 |
+
public function assignData($data) {
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
public function validate() {
|
36 |
+
|
37 |
+
parent::validate();
|
38 |
+
|
39 |
+
$min = $this->getConfigData('min');
|
40 |
+
$max = $this->getConfigData('max');
|
41 |
+
|
42 |
+
if($min=="")
|
43 |
+
$min='0';
|
44 |
+
if($max=="")
|
45 |
+
$max='9999.99';
|
46 |
+
|
47 |
+
|
48 |
+
|
49 |
+
$paymentInfo = $this->getInfoInstance();
|
50 |
+
|
51 |
+
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
52 |
+
$quote = $paymentInfo->getOrder();
|
53 |
+
} else {
|
54 |
+
$quote = $paymentInfo->getQuote();
|
55 |
+
}
|
56 |
+
$currency_code = $quote->getBaseCurrencyCode();
|
57 |
+
|
58 |
+
|
59 |
+
if (!in_array($currency_code, $this->_allowCurrencyCode)) {
|
60 |
+
Mage::throwException(Mage::helper('multibanco')->__('A moeda selecionada (' . $currency_code . ') não é compatível com este meio de pagamento'));
|
61 |
+
}
|
62 |
+
$order_value = number_format($quote->getBaseGrandTotal(), 2, '.', '');
|
63 |
+
if ($order_value < 1) {
|
64 |
+
Mage::throwException(Mage::helper('multibanco')->__('Impossível gerar referência MB para valores inferiores a 1 Euro.'));
|
65 |
+
}
|
66 |
+
if ($order_value >= 999999.99) {
|
67 |
+
Mage::throwException(Mage::helper('multibanco')->__('O valor excede o limite para pagamento na rede MB'));
|
68 |
+
}
|
69 |
+
$order_value = number_format($quote->getBaseGrandTotal(), 2, '.', '');
|
70 |
+
if ($order_value < $min) {
|
71 |
+
Mage::throwException(Mage::helper('multibanco')->__('Meio de pagamento disponível para compras superiores a ' . $min . ' EUR .'));
|
72 |
+
}
|
73 |
+
|
74 |
+
if ($order_value > $max) {
|
75 |
+
Mage::throwException(Mage::helper('multibanco')->__('Meio de pagamento disponível para compras inferiores a ' . $max . ' EUR .'));
|
76 |
+
}
|
77 |
+
|
78 |
+
return $this;
|
79 |
+
}
|
80 |
+
|
81 |
+
public function getQuote() {
|
82 |
+
if (empty($this->_quote)) {
|
83 |
+
$this->_quote = $this->getCheckout()->getQuote();
|
84 |
+
}
|
85 |
+
return $this->_quote;
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getCheckout() {
|
89 |
+
|
90 |
+
if (empty($this->_checkout)) {
|
91 |
+
$this->_checkout = Mage::getSingleton('checkout/session');
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
return $this->_checkout;
|
96 |
+
}
|
97 |
+
|
98 |
+
}
|
app/code/local/Eupago/Multibanco/Model/Mysql4/Setup.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Multibanco_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
app/code/local/Eupago/Multibanco/Model/PaymentAction.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Paygate
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
*
|
29 |
+
* Authorizenet Payment Action Dropdown source
|
30 |
+
*
|
31 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
32 |
+
*/
|
33 |
+
class Eupago_Multibanco_Model_PaymentAction
|
34 |
+
{
|
35 |
+
public function toOptionArray()
|
36 |
+
{
|
37 |
+
return array(
|
38 |
+
array(
|
39 |
+
'value' => Mage_Payment_Model_Method_Abstract::ACTION_ORDER,
|
40 |
+
'label' => Mage::helper('multibanco')->__('Order')
|
41 |
+
),
|
42 |
+
);
|
43 |
+
}
|
44 |
+
}
|
app/code/local/Eupago/Multibanco/Model/Process.php
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Eupago_Multibanco_Model_Process extends Mage_Payment_Model_Method_Abstract {
|
4 |
+
|
5 |
+
protected $_code = 'multibanco';
|
6 |
+
protected $_paymentMethod = 'multibanco';
|
7 |
+
protected $_formBlockType = 'multibanco/form';
|
8 |
+
protected $_infoBlockType = 'multibanco/info';
|
9 |
+
protected $_allowCurrencyCode = array('EUR');
|
10 |
+
protected $_isGateway = false;
|
11 |
+
protected $_canOrder = true;
|
12 |
+
protected $_canAuthorize = false;
|
13 |
+
protected $_canCapture = true;
|
14 |
+
protected $_canCapturePartial = false;
|
15 |
+
protected $_canRefund = false;
|
16 |
+
protected $_canRefundInvoicePartial = false;
|
17 |
+
protected $_canVoid = false;
|
18 |
+
protected $_canUseInternal = true;
|
19 |
+
protected $_canUseCheckout = true;
|
20 |
+
protected $_canUseForMultishipping = true;
|
21 |
+
protected $_isInitializeNeeded = false;
|
22 |
+
protected $_canFetchTransactionInfo = false;
|
23 |
+
protected $_canReviewPayment = false;
|
24 |
+
protected $_canCreateBillingAgreement = false;
|
25 |
+
|
26 |
+
public function orderObserver($observer) {
|
27 |
+
|
28 |
+
$chave_api = $this->getConfigData('chave');
|
29 |
+
|
30 |
+
$id = $observer->getEvent()->getOrder()->getIncrementId();
|
31 |
+
$order_value = $observer->getEvent()->getOrder()->getGrandTotal();
|
32 |
+
$entity = $observer->getEvent()->getOrder()->getId();
|
33 |
+
$sales_flat_order_payment = Mage::getSingleton('core/resource')->getTableName('sales_flat_order_payment');
|
34 |
+
$sales_flat_quote_payment = Mage::getSingleton('core/resource')->getTableName('sales_flat_quote_payment');
|
35 |
+
|
36 |
+
$resource = Mage::getSingleton('core/resource');
|
37 |
+
$writeConnection = $resource->getConnection('core_write');
|
38 |
+
$quote_id = Mage::getSingleton('checkout/session')->getQuoteId();
|
39 |
+
|
40 |
+
if ($quote_id != "") {
|
41 |
+
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
|
42 |
+
$query = $conn->query("SELECT eupago_referencia FROM $sales_flat_quote_payment WHERE quote_id =$quote_id");
|
43 |
+
$referencia = $query->fetchColumn();
|
44 |
+
|
45 |
+
|
46 |
+
if ($referencia == "") {
|
47 |
+
|
48 |
+
$client = @new SoapClient('http://replica.eupago.pt/replica.eupagov1.wsdl', array('cache_wsdl' => WSDL_CACHE_NONE)); // chamada do servi�o SOAP
|
49 |
+
$arraydados = array("chave" => $chave_api, "valor" => $order_value, "id" => $id); //cada canal tem a sua chave
|
50 |
+
$result = $client->gerarReferenciaMB($arraydados);
|
51 |
+
$query = "UPDATE $sales_flat_order_payment SET eupago_montante = $order_value, eupago_entidade = $result->entidade, eupago_referencia = $result->referencia WHERE parent_id =$entity";
|
52 |
+
$writeConnection->query($query);
|
53 |
+
$query = "UPDATE $sales_flat_quote_payment SET eupago_montante = $order_value, eupago_entidade = $result->entidade, eupago_referencia = $result->referencia WHERE quote_id =$quote_id";
|
54 |
+
$writeConnection->query($query);
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
} else {
|
59 |
+
|
60 |
+
$writeConnection = $resource->getConnection('core_write');
|
61 |
+
$query = $conn->query("SELECT eupago_entidade FROM $sales_flat_quote_payment WHERE quote_id =$quote_id");
|
62 |
+
$entidade = $query->fetchColumn();
|
63 |
+
$query = $conn->query("SELECT eupago_montante FROM $sales_flat_quote_payment WHERE quote_id =$quote_id");
|
64 |
+
$montante = $query->fetchColumn();
|
65 |
+
$query = "UPDATE $sales_flat_order_payment SET eupago_montante = $montante, eupago_entidade = $entidade, eupago_referencia = $referencia WHERE parent_id =$entity";
|
66 |
+
$writeConnection->query($query);
|
67 |
+
$query = "UPDATE $sales_flat_quote_payment SET eupago_montante = $montante, eupago_entidade = $entidade, eupago_referencia = $referencia WHERE quote_id =$quote_id";
|
68 |
+
$writeConnection->query($query);
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
|
73 |
+
|
74 |
+
return;
|
75 |
+
}
|
76 |
+
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get checkout session namespace
|
80 |
+
*
|
81 |
+
* @return Mage_Checkout_Model_Session
|
82 |
+
*/
|
83 |
+
public function getCheckout() {
|
84 |
+
return Mage::getSingleton('checkout/session');
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Get current quote
|
89 |
+
*
|
90 |
+
* @return Mage_Sales_Model_Quote
|
91 |
+
*/
|
92 |
+
public function getQuote() {
|
93 |
+
return $this->getCheckout()->getQuote();
|
94 |
+
}
|
95 |
+
|
96 |
+
}
|
app/code/local/Eupago/Multibanco/etc/config.xml
ADDED
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Eupago_Multibanco>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Eupago_Multibanco>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<translate>
|
10 |
+
<modules>
|
11 |
+
<Eupago_Multibanco>
|
12 |
+
<files>
|
13 |
+
<default>Eupago_Multibanco.csv</default>
|
14 |
+
</files>
|
15 |
+
</Eupago_Multibanco>
|
16 |
+
</modules>
|
17 |
+
</translate>
|
18 |
+
</frontend>
|
19 |
+
<adminhtml>
|
20 |
+
<translate>
|
21 |
+
<modules>
|
22 |
+
<Eupago_Multibanco>
|
23 |
+
<files>
|
24 |
+
<default>Eupago_Multibanco.csv</default>
|
25 |
+
</files>
|
26 |
+
</Eupago_Multibanco>
|
27 |
+
</modules>
|
28 |
+
</translate>
|
29 |
+
</adminhtml>
|
30 |
+
<global>
|
31 |
+
<fieldsets>
|
32 |
+
<sales_convert_quote_payment>
|
33 |
+
<eupago_entidade>
|
34 |
+
<to_order_payment>*</to_order_payment>
|
35 |
+
</eupago_entidade>
|
36 |
+
<eupago_referencia>
|
37 |
+
<to_order_payment>*</to_order_payment>
|
38 |
+
</eupago_referencia>
|
39 |
+
<eupago_montante>
|
40 |
+
<to_order_payment>*</to_order_payment>
|
41 |
+
</eupago_montante>
|
42 |
+
</sales_convert_quote_payment>
|
43 |
+
|
44 |
+
<sales_convert_order_payment>
|
45 |
+
<eupago_entidade>
|
46 |
+
<to_quote_payment>*</to_quote_payment>
|
47 |
+
</eupago_entidade>
|
48 |
+
<eupago_referencia>
|
49 |
+
<to_quote_payment>*</to_quote_payment>
|
50 |
+
</eupago_referencia>
|
51 |
+
<eupago_montante>
|
52 |
+
<to_quote_payment>*</to_quote_payment>
|
53 |
+
</eupago_montante>
|
54 |
+
</sales_convert_order_payment>
|
55 |
+
</fieldsets>
|
56 |
+
<models>
|
57 |
+
<multibanco>
|
58 |
+
<class>Eupago_Multibanco_Model</class>
|
59 |
+
<resourceModel>multibanco_mysql4</resourceModel>
|
60 |
+
</multibanco>
|
61 |
+
<sales>
|
62 |
+
<rewrite>
|
63 |
+
<convert_order>Eupago_Multibanco_Model_Convert_Order</convert_order>
|
64 |
+
<convert_quote>Eupago_Multibanco_Model_Convert_Quote</convert_quote>
|
65 |
+
</rewrite>
|
66 |
+
</sales>
|
67 |
+
<multibanco_mysql4>
|
68 |
+
<class>Eupago_Multibanco_Model_Mysql4</class>
|
69 |
+
<entities>
|
70 |
+
<multibanco>
|
71 |
+
<table>eupago</table>
|
72 |
+
</multibanco>
|
73 |
+
</entities>
|
74 |
+
</multibanco_mysql4>
|
75 |
+
</models>
|
76 |
+
<resources>
|
77 |
+
<multibanco_setup>
|
78 |
+
<setup>
|
79 |
+
<module>Eupago_Multibanco</module>
|
80 |
+
<class>Eupago_Multibanco_Model_Mysql4_Setup</class>
|
81 |
+
</setup>
|
82 |
+
<connection>
|
83 |
+
<use>core_setup</use>
|
84 |
+
</connection>
|
85 |
+
</multibanco_setup>
|
86 |
+
<multibanco_write>
|
87 |
+
<connection>
|
88 |
+
<use>core_write</use>
|
89 |
+
</connection>
|
90 |
+
</multibanco_write>
|
91 |
+
<multibanco_read>
|
92 |
+
<connection>
|
93 |
+
<use>core_read</use>
|
94 |
+
</connection>
|
95 |
+
</multibanco_read>
|
96 |
+
</resources>
|
97 |
+
<blocks>
|
98 |
+
<multibanco>
|
99 |
+
<class>Eupago_Multibanco_Block</class>
|
100 |
+
</multibanco>
|
101 |
+
</blocks>
|
102 |
+
<helpers>
|
103 |
+
<multibanco>
|
104 |
+
<class>Eupago_Multibanco_Helper</class>
|
105 |
+
</multibanco>
|
106 |
+
</helpers>
|
107 |
+
<sales>
|
108 |
+
<order>
|
109 |
+
<statuses>
|
110 |
+
<aguarda_pagamento_multibanco translate="label">
|
111 |
+
<label><![CDATA[MB - Aguarda Pagamento]]>
|
112 |
+
</label>
|
113 |
+
</aguarda_pagamento_multibanco>
|
114 |
+
</statuses>
|
115 |
+
<states>
|
116 |
+
<new>
|
117 |
+
<statuses>
|
118 |
+
<aguarda_pagamento_multibanco/>
|
119 |
+
</statuses>
|
120 |
+
</new>
|
121 |
+
</states>
|
122 |
+
</order>
|
123 |
+
</sales>
|
124 |
+
<events>
|
125 |
+
<sales_order_save_after>
|
126 |
+
<observers>
|
127 |
+
<payone_save_status>
|
128 |
+
<type>singleton</type>
|
129 |
+
<class>multibanco/process</class>
|
130 |
+
<method>orderObserver</method>
|
131 |
+
</payone_save_status>
|
132 |
+
</observers>
|
133 |
+
</sales_order_save_after>
|
134 |
+
</events>
|
135 |
+
|
136 |
+
</global>
|
137 |
+
|
138 |
+
<default>
|
139 |
+
|
140 |
+
<payment>
|
141 |
+
<multibanco>
|
142 |
+
<active>0</active>
|
143 |
+
<model>multibanco/gerarRef</model>
|
144 |
+
<title>Multibanco</title>
|
145 |
+
<sort_order>1</sort_order>
|
146 |
+
<allowspecific>0</allowspecific>
|
147 |
+
<chave></chave>
|
148 |
+
<mensagem>Pagamento por Multibanco</mensagem>
|
149 |
+
<payment_action>order</payment_action>
|
150 |
+
</multibanco>
|
151 |
+
</payment>
|
152 |
+
</default>
|
153 |
+
</config>
|
app/code/local/Eupago/Multibanco/etc/system.xml
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<multibanco translate="label" module="payment">
|
7 |
+
<label><![CDATA[euPago - Pagamentos por Referências Multibanco (Oficial)]]>
|
8 |
+
</label>
|
9 |
+
<frontend_type>text</frontend_type>
|
10 |
+
<sort_order>1</sort_order>
|
11 |
+
<show_in_default>1</show_in_default>
|
12 |
+
<show_in_website>1</show_in_website>
|
13 |
+
<show_in_store>1</show_in_store>
|
14 |
+
<fields>
|
15 |
+
<active translate="label">
|
16 |
+
<label>Ativo</label>
|
17 |
+
<frontend_type>select</frontend_type>
|
18 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
19 |
+
<sort_order>5</sort_order>
|
20 |
+
<show_in_default>1</show_in_default>
|
21 |
+
<show_in_website>1</show_in_website>
|
22 |
+
<show_in_store>1</show_in_store>
|
23 |
+
</active>
|
24 |
+
<order_status translate="label">
|
25 |
+
<label>Estado da Encomenda</label>
|
26 |
+
<frontend_type>select</frontend_type>
|
27 |
+
<source_model>adminhtml/system_config_source_order_status_new</source_model>
|
28 |
+
<sort_order>10</sort_order>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>1</show_in_store>
|
32 |
+
</order_status>
|
33 |
+
<sort_order translate="label">
|
34 |
+
<label><![CDATA[Ordem de apresentação]]>
|
35 |
+
</label>
|
36 |
+
<frontend_type>text</frontend_type>
|
37 |
+
<sort_order>15</sort_order>
|
38 |
+
<show_in_default>1</show_in_default>
|
39 |
+
<show_in_website>1</show_in_website>
|
40 |
+
<show_in_store>1</show_in_store>
|
41 |
+
</sort_order>
|
42 |
+
<title translate="label">
|
43 |
+
<label><![CDATA[Título a apresentar no Website]]>
|
44 |
+
</label>
|
45 |
+
<frontend_type>text</frontend_type>
|
46 |
+
<sort_order>20</sort_order>
|
47 |
+
<show_in_default>1</show_in_default>
|
48 |
+
<show_in_website>1</show_in_website>
|
49 |
+
<show_in_store>1</show_in_store>
|
50 |
+
</title>
|
51 |
+
<chave translate="label">
|
52 |
+
<label>Chave da API</label>
|
53 |
+
<frontend_type>text</frontend_type>
|
54 |
+
<sort_order>25</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
</chave>
|
59 |
+
<min translate="label">
|
60 |
+
<label>Valor Mínimo da Encomenda</label>
|
61 |
+
<frontend_type>text</frontend_type>
|
62 |
+
<validate>validate-number</validate>
|
63 |
+
<sort_order>30</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
+
</min>
|
68 |
+
<max translate="label">
|
69 |
+
<label>Valor Máximo da Encomenda</label>
|
70 |
+
<frontend_type>text</frontend_type>
|
71 |
+
<validate>validate-number</validate>
|
72 |
+
<sort_order>35</sort_order>
|
73 |
+
<show_in_default>1</show_in_default>
|
74 |
+
<show_in_website>1</show_in_website>
|
75 |
+
<show_in_store>1</show_in_store>
|
76 |
+
</max>
|
77 |
+
|
78 |
+
<mensagem translate="label">
|
79 |
+
<label><![CDATA[Instruções]]>
|
80 |
+
</label>
|
81 |
+
<frontend_type>text</frontend_type>
|
82 |
+
<sort_order>40</sort_order>
|
83 |
+
<show_in_default>1</show_in_default>
|
84 |
+
<show_in_website>1</show_in_website>
|
85 |
+
<show_in_store>1</show_in_store>
|
86 |
+
</mensagem>
|
87 |
+
<allowspecific translate="label">
|
88 |
+
<label><![CDATA[Pagamento para os Países]]>
|
89 |
+
</label>
|
90 |
+
<frontend_type>allowspecific</frontend_type>
|
91 |
+
<sort_order>45</sort_order>
|
92 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
93 |
+
<show_in_default>1</show_in_default>
|
94 |
+
<show_in_website>1</show_in_website>
|
95 |
+
<show_in_store>1</show_in_store>
|
96 |
+
</allowspecific>
|
97 |
+
<specificcountry translate="label">
|
98 |
+
<label><![CDATA[Pagamento para Países Específicos]]>
|
99 |
+
</label>
|
100 |
+
<frontend_type>multiselect</frontend_type>
|
101 |
+
<sort_order>50</sort_order>
|
102 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
103 |
+
<show_in_default>1</show_in_default>
|
104 |
+
<show_in_website>1</show_in_website>
|
105 |
+
<show_in_store>1</show_in_store>
|
106 |
+
</specificcountry>
|
107 |
+
<payment_action translate="label">
|
108 |
+
<label>Payment Action</label>
|
109 |
+
<frontend_type>select</frontend_type>
|
110 |
+
<source_model>multibanco/paymentAction</source_model>
|
111 |
+
<sort_order>55</sort_order>
|
112 |
+
<show_in_default>0</show_in_default>
|
113 |
+
<show_in_website>0</show_in_website>
|
114 |
+
<show_in_store>0</show_in_store>
|
115 |
+
</payment_action>
|
116 |
+
</fields>
|
117 |
+
</multibanco>
|
118 |
+
</groups>
|
119 |
+
</payment>
|
120 |
+
</sections>
|
121 |
+
</config>
|
app/code/local/Eupago/Multibanco/sql/multibanco_setup/mysql4-install-1.0.0.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->addAttribute('order_payment', 'eupago_entidade', array('type'=>'varchar'));
|
6 |
+
$installer->addAttribute('order_payment', 'eupago_referencia', array('type'=>'varchar'));
|
7 |
+
$installer->addAttribute('order_payment', 'eupago_montante', array('type'=>'varchar'));
|
8 |
+
|
9 |
+
$installer->addAttribute('quote_payment', 'eupago_entidade', array('type'=>'varchar'));
|
10 |
+
$installer->addAttribute('quote_payment', 'eupago_referencia', array('type'=>'varchar'));
|
11 |
+
$installer->addAttribute('quote_payment', 'eupago_montante', array('type'=>'varchar'));
|
12 |
+
$installer->endSetup();
|
13 |
+
|
14 |
+
if (Mage::getVersion() >= 1.1) {
|
15 |
+
$installer->startSetup();
|
16 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'eupago_entidade', 'VARCHAR(255) NOT NULL');
|
17 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'eupago_referencia', 'VARCHAR(255) NOT NULL');
|
18 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'eupago_montante', 'VARCHAR(255) NOT NULL');
|
19 |
+
$installer->endSetup();
|
20 |
+
}
|
app/design/adminhtml/default/default/template/multibanco/form/form.phtml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<fieldset class="form-list">
|
2 |
+
<ul id="payment_form_<?php echo $this->getMethodCode(); ?>" style="display:none">
|
3 |
+
<li><img src="<?php echo $this->getSkinUrl('images/multibanco/eupagomultibanco.png') ?>" border="0" /></li>
|
4 |
+
<?php if ($this->getMethod()->getMensagem()): ?>
|
5 |
+
<?php echo '<li>' . $this->getMethod()->getMensagem() . '</li>'; ?>
|
6 |
+
<?php endif; ?>
|
7 |
+
</ul>
|
8 |
+
</fieldset>
|
app/design/adminhtml/default/default/template/multibanco/form/mark.phtml
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<!-- MB Logo -->
|
2 |
+
<img src="<?php echo $this->getSkinUrl('images/multibanco/mb_mark.gif') ?>" class="v-middle" />
|
3 |
+
<!-- MB Logo -->
|
app/design/adminhtml/default/default/template/multibanco/info/info.phtml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<table border="0" cellspacing="1" cellpadding="0">
|
2 |
+
<tr>
|
3 |
+
<td><img src="<?php echo $this->getSkinUrl('images/multibanco/eupagomultibanco.png') ?>" border="0" alt="<?php echo $this->getMethod()->getTitle(); ?>" title="<?php echo $this->getMethod()->getTitle(); ?>" /></td>
|
4 |
+
</tr>
|
5 |
+
<tr>
|
6 |
+
<td><table width="100%" border="0" cellspacing="1" cellpadding="0">
|
7 |
+
<tr>
|
8 |
+
<td><?php echo $this->__('<strong>Entidade:</strong>'); ?></td>
|
9 |
+
<td><?php echo $this->htmlEscape($this->getInfo()->getEupagoEntidade()) ?></td>
|
10 |
+
</tr>
|
11 |
+
<tr>
|
12 |
+
<td><?php echo $this->__('<strong>Referência:</strong>'); ?> </td>
|
13 |
+
<td><?php echo $this->htmlEscape($this->getInfo()->getEupagoReferencia()); ?></td>
|
14 |
+
</tr>
|
15 |
+
<tr>
|
16 |
+
<td><?php echo $this->__('<strong>Montante:</strong>'); ?></td>
|
17 |
+
<td><?php echo number_format($this->htmlEscape($this->getInfo()->getEupagoMontante()),'2',',','') . ' EUR'; ?></td>
|
18 |
+
</tr>
|
19 |
+
</table></td>
|
20 |
+
</tr>
|
21 |
+
</table>
|
app/design/adminhtml/default/default/template/multibanco/info/pdf/info.phtml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php echo $this->__('Entidade: %s', $this->htmlEscape($this->getInfo()->getEupagoEntidade())) ?>
|
2 |
+
{{pdf_row_separator}}
|
3 |
+
<?php echo utf8_encode($this->__('Refer�ncia: %s', $this->htmlEscape($this->getInfo()->getEupagoReferencia()))) ?>
|
4 |
+
{{pdf_row_separator}}
|
5 |
+
<?php echo $this->__('Montante: %s EUR', $this->htmlEscape($this->getInfo()->getEupagoMontante())) ?>
|
app/design/frontend/default/default/template/checkout/success.phtml
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<div class="page-title">
|
29 |
+
<h1><?php echo $this->__('Your order has been received.') ?></h1>
|
30 |
+
</div>
|
31 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
32 |
+
<h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>
|
33 |
+
|
34 |
+
<?php if ($this->getOrderId()): ?>
|
35 |
+
<?php if ($this->getCanViewOrder()) : ?>
|
36 |
+
<p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
|
37 |
+
<?php else : ?>
|
38 |
+
<p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?></p>
|
39 |
+
<?php endif; ?>
|
40 |
+
|
41 |
+
<p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
|
42 |
+
<?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) : ?>
|
43 |
+
<p>
|
44 |
+
<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
|
45 |
+
<?php echo $this->getChildHtml() ?>
|
46 |
+
</p>
|
47 |
+
|
48 |
+
<?php endif; ?>
|
49 |
+
<?php endif; ?>
|
50 |
+
|
51 |
+
<?php if ($this->getAgreementRefId()): ?>
|
52 |
+
<p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId()))) ?></p>
|
53 |
+
<?php endif; ?>
|
54 |
+
|
55 |
+
<?php if ($profiles = $this->getRecurringProfiles()): ?>
|
56 |
+
<p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
|
57 |
+
<ul class="disc">
|
58 |
+
<?php foreach ($profiles as $profile): ?>
|
59 |
+
<?php $profileIdHtml = ($this->getCanViewProfiles() ? sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id'))); ?>
|
60 |
+
<li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description'))) ?></li>
|
61 |
+
<?php endforeach; ?>
|
62 |
+
</ul>
|
63 |
+
<?php endif; ?>
|
64 |
+
|
65 |
+
<?php
|
66 |
+
$sales_flat_order_payment = Mage::getSingleton('core/resource')->getTableName('sales_flat_order_payment');
|
67 |
+
|
68 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
69 |
+
if ($order->getPayment()->getMethod() == 'multibanco') {
|
70 |
+
|
71 |
+
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
|
72 |
+
$query = $conn->query("SELECT eupago_referencia FROM $sales_flat_order_payment WHERE parent_id=$order->entity_id");
|
73 |
+
$referencia = $query->fetchColumn();
|
74 |
+
$query = $conn->query("SELECT eupago_entidade FROM $sales_flat_order_payment WHERE parent_id=$order->entity_id");
|
75 |
+
$entidade = $query->fetchColumn();
|
76 |
+
$query = $conn->query("SELECT eupago_montante FROM $sales_flat_order_payment WHERE parent_id=$order->entity_id");
|
77 |
+
$valor = $query->fetchColumn();
|
78 |
+
$valor = number_format($valor,'2',',','');
|
79 |
+
}
|
80 |
+
?>
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
<p> Para pagar esta encomenda através da Rede de Caixas Automáticas Multibanco e introduza os seguintes dados:
|
86 |
+
<div align='center'>
|
87 |
+
|
88 |
+
<table style="margin-top: 10px;border: 1px solid #000;" width="450px" cellspacing="0" align="center">
|
89 |
+
<tr>
|
90 |
+
<td colspan="2" style="height:25px;vertical-align:center; text-align:center">
|
91 |
+
<img src="https://seguro.eupago.pt/repositorio/imagens/eupagomultibanco.png" alt="euPago Multibanco" height="25" />
|
92 |
+
</td>
|
93 |
+
</tr>
|
94 |
+
<tr>
|
95 |
+
<td colspan="2" style="height:25px;vertical-align:center;background-color:#3a87ad;font-size:small;text-align:center;color:#ebebeb;">
|
96 |
+
Multibanco (Pagamento de Compras\Serviços)</td>
|
97 |
+
</tr>
|
98 |
+
<tr>
|
99 |
+
<td align="left" style="font-size:small;font-weight:bold;padding-left:15px;">Entidade:</td>
|
100 |
+
<td align="left" style="font-size:small;"><?php echo $entidade; ?></td>
|
101 |
+
</tr>
|
102 |
+
<tr>
|
103 |
+
<td align="left" style="font-size:small;font-weight:bold;padding-left:15px;">Referência:</td>
|
104 |
+
<td align="left" style="font-size:small;"><?php echo $referencia; ?> </td>
|
105 |
+
</tr>
|
106 |
+
<tr>
|
107 |
+
<td align="left" style="font-size:small;font-weight:bold;padding-left:15px;">Valor:</td>
|
108 |
+
<td align="left" style="font-size:small;"><?php echo $valor; ?> EUR </td>
|
109 |
+
</tr>
|
110 |
+
<tr>
|
111 |
+
<td colspan="2" style="height:30px;vertical-align:center;background-color:#3a87ad;font-size:small;text-align:center;color:#ebebeb;">O talão emitido pela caixa automática faz de prova de pagamento.<br/>Conserve-o.</td>
|
112 |
+
</tr>
|
113 |
+
</table>
|
114 |
+
|
115 |
+
</div>
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
</p>
|
120 |
+
|
121 |
+
<div class="buttons-set">
|
122 |
+
<button type="button" class="button" title="<?php echo $this->__('Continue Shopping') ?>" onclick="window.location='<?php echo $this->getUrl() ?>'"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
|
123 |
+
</div>
|
124 |
+
|
125 |
+
|
126 |
+
|
app/design/frontend/default/default/template/multibanco/form/form.phtml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<fieldset class="form-list">
|
2 |
+
<ul id="payment_form_<?php echo $this->getMethodCode(); ?>" style="display:none">
|
3 |
+
<li><img src="<?php echo $this->getSkinUrl('images/multibanco/eupagomultibanco.png') ?>" border="0" /></li>
|
4 |
+
<?php if ($this->getMethod()->getMensagem()): ?>
|
5 |
+
<?php echo '<li>' . $this->getMethod()->getMensagem() . '</li>'; ?>
|
6 |
+
<?php endif; ?>
|
7 |
+
</ul>
|
8 |
+
</fieldset>
|
app/design/frontend/default/default/template/multibanco/form/mark.phtml
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<!-- MB Logo -->
|
2 |
+
<img src="<?php echo $this->getSkinUrl('images/multibanco/mb_mark.gif') ?>" class="v-middle" />
|
3 |
+
<!-- MB Logo -->
|
app/design/frontend/default/default/template/multibanco/info/info.phtml
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<table border="0" cellspacing="1" cellpadding="0">
|
2 |
+
|
3 |
+
<tr>
|
4 |
+
<td><table width="100%" border="0" cellspacing="1" cellpadding="0">
|
5 |
+
|
6 |
+
<?php
|
7 |
+
$referencia = "";
|
8 |
+
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
|
9 |
+
$quote_id = Mage::getSingleton('checkout/session')->getQuoteId();
|
10 |
+
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
|
11 |
+
|
12 |
+
if ($quote_id != "") {
|
13 |
+
|
14 |
+
$sales_flat_quote_payment = Mage::getSingleton('core/resource')->getTableName('sales_flat_quote_payment');
|
15 |
+
$query = $conn->query("SELECT eupago_referencia FROM $sales_flat_quote_payment WHERE quote_id= $quote_id");
|
16 |
+
$referencia = $query->fetchColumn();
|
17 |
+
}
|
18 |
+
if ($referencia == "") {
|
19 |
+
?>
|
20 |
+
<tr>
|
21 |
+
<td><img src="<?php echo $this->getSkinUrl('images/multibanco/eupagomultibanco.png') ?>" border="0" alt="<?php echo $this->getMethod()->getTitle(); ?>" title="<?php echo $this->getMethod()->getTitle(); ?>" /></td>
|
22 |
+
</tr>
|
23 |
+
<tr>
|
24 |
+
<td> Os dados para pagamento multibanco serão apresentados quando finalizar a sua encomenda e/ou enviados para o seu e-mail.</td></tr>
|
25 |
+
<?
|
26 |
+
} else {
|
27 |
+
|
28 |
+
|
29 |
+
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
|
30 |
+
$sales_flat_order_payment = Mage::getSingleton('core/resource')->getTableName('sales_flat_order_payment');
|
31 |
+
$query = $conn->query("SELECT max(parent_id) eupago_referencia FROM $sales_flat_order_payment ");
|
32 |
+
$entity_id = $query->fetchColumn();
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
$query = $conn->query("SELECT eupago_referencia FROM $sales_flat_order_payment WHERE parent_id=$entity_id");
|
37 |
+
$referencia = $query->fetchColumn();
|
38 |
+
$query = $conn->query("SELECT eupago_entidade FROM $sales_flat_order_payment WHERE parent_id=$entity_id");
|
39 |
+
$entidade = $query->fetchColumn();
|
40 |
+
$query = $conn->query("SELECT eupago_montante FROM $sales_flat_order_payment WHERE parent_id=$entity_id");
|
41 |
+
$valor = $query->fetchColumn();
|
42 |
+
$valor = number_format($valor,'2',',','');
|
43 |
+
?>
|
44 |
+
|
45 |
+
<div align='center'>
|
46 |
+
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
<table style="margin-top: 10px;border: 1px solid #000;" width="250px" cellspacing="0" align="center">
|
52 |
+
<tr>
|
53 |
+
<td colspan="2" style="height:25px;vertical-align:center; text-align:center">
|
54 |
+
<img src="https://seguro.eupago.pt/repositorio/imagens/eupagomultibanco.png" alt="euPago Multibanco" height="25" />
|
55 |
+
</td>
|
56 |
+
</tr>
|
57 |
+
<tr>
|
58 |
+
<td colspan="2" style="height:25px;vertical-align:center;background-color:#3a87ad;font-size:small;text-align:center;color:#ebebeb;">
|
59 |
+
Multibanco (Pagamento de Compras\Serviços)</td>
|
60 |
+
</tr>
|
61 |
+
<tr>
|
62 |
+
<td align="left" style="font-size:small;font-weight:bold;padding-left:15px;">Entidade:</td>
|
63 |
+
<td align="left" style="font-size:small;"><?php echo $entidade; ?></td>
|
64 |
+
</tr>
|
65 |
+
<tr>
|
66 |
+
<td align="left" style="font-size:small;font-weight:bold;padding-left:15px;">Referência:</td>
|
67 |
+
<td align="left" style="font-size:small;"><?php echo $referencia; ?> </td>
|
68 |
+
</tr>
|
69 |
+
<tr>
|
70 |
+
<td align="left" style="font-size:small;font-weight:bold;padding-left:15px;">Valor:</td>
|
71 |
+
<td align="left" style="font-size:small;"><?php echo $valor; ?>EUR </td>
|
72 |
+
</tr>
|
73 |
+
|
74 |
+
</table>
|
75 |
+
|
76 |
+
</div>
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
+
<? } ?>
|
82 |
+
</tr>
|
83 |
+
|
84 |
+
</table></td>
|
85 |
+
</tr>
|
86 |
+
</table>
|
app/etc/modules/Eupago_Multibanco.xml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Eupago_Multibanco>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
<depends>
|
8 |
+
<Mage_Payment />
|
9 |
+
</depends>
|
10 |
+
</Eupago_Multibanco>
|
11 |
+
</modules>
|
12 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Eupago_MB</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>GNU General Public License (GPL)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Modulo de pagamento que gera referencias multibanco.</summary>
|
10 |
+
<description>Modulo de pagamento por Entidade e Referencia Multibanco</description>
|
11 |
+
<notes>Necessário criar conta no http://www.eupago.pt</notes>
|
12 |
+
<authors><author><name>euPago</name><user>euPago</user><email>dev@eupago.pt</email></author></authors>
|
13 |
+
<date>2015-12-04</date>
|
14 |
+
<time>15:17:36</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Eupago"><dir name="Multibanco"><dir name="Block"><file name="Form.php" hash="b10bbd2ac4230fb7b5b23163bba5497d"/><file name="Info.php" hash="6b2e8bc2cb50cd10921632d72d283e91"/><file name="Form.php" hash="b10bbd2ac4230fb7b5b23163bba5497d"/><file name="Info.php" hash="6b2e8bc2cb50cd10921632d72d283e91"/><file name="Form.php" hash="b10bbd2ac4230fb7b5b23163bba5497d"/><file name="Info.php" hash="6b2e8bc2cb50cd10921632d72d283e91"/><file name="Form.php" hash="b10bbd2ac4230fb7b5b23163bba5497d"/><file name="Info.php" hash="6b2e8bc2cb50cd10921632d72d283e91"/></dir><dir name="Helper"><file name="Data.php" hash="08f64400e4204040eced048d885fe3da"/><file name="Data.php" hash="08f64400e4204040eced048d885fe3da"/><file name="Data.php" hash="08f64400e4204040eced048d885fe3da"/><file name="Data.php" hash="08f64400e4204040eced048d885fe3da"/></dir><dir name="Model"><dir name="Convert"><file name="Order.php" hash="10fb9abcee863b4a809cd46d39fa0121"/><file name="Quote.php" hash="371acecf7ee5300f3bf9f363ca2c6e39"/><file name="Order.php" hash="10fb9abcee863b4a809cd46d39fa0121"/><file name="Quote.php" hash="371acecf7ee5300f3bf9f363ca2c6e39"/><file name="Order.php" hash="10fb9abcee863b4a809cd46d39fa0121"/><file name="Quote.php" hash="371acecf7ee5300f3bf9f363ca2c6e39"/><file name="Order.php" hash="10fb9abcee863b4a809cd46d39fa0121"/><file name="Quote.php" hash="371acecf7ee5300f3bf9f363ca2c6e39"/><file name="Order.php" hash="10fb9abcee863b4a809cd46d39fa0121"/><file name="Quote.php" hash="371acecf7ee5300f3bf9f363ca2c6e39"/></dir><file name="GerarRef.php" hash="a7e966a5dd1e47544cd8aaea3b460238"/><dir name="Mysql4"><file name="Setup.php" hash="da156d537188951a4f6eccc0adf96f06"/><file name="Setup.php" hash="da156d537188951a4f6eccc0adf96f06"/><file name="Setup.php" hash="da156d537188951a4f6eccc0adf96f06"/></dir><file name="PaymentAction.php" hash="d37848a985083e38e966ec081aa4c02b"/><file name="Process.php" hash="81d907c2ed831b57de60a6b2b42d4c36"/><file name="GerarRef.php" hash="a7e966a5dd1e47544cd8aaea3b460238"/><file name="PaymentAction.php" hash="d37848a985083e38e966ec081aa4c02b"/><file name="Process.php" hash="81d907c2ed831b57de60a6b2b42d4c36"/><file name="GerarRef.php" hash="a7e966a5dd1e47544cd8aaea3b460238"/><file name="PaymentAction.php" hash="d37848a985083e38e966ec081aa4c02b"/><file name="Process.php" hash="81d907c2ed831b57de60a6b2b42d4c36"/><file name="GerarRef.php" hash="a7e966a5dd1e47544cd8aaea3b460238"/><file name="PaymentAction.php" hash="d37848a985083e38e966ec081aa4c02b"/><file name="Process.php" hash="81d907c2ed831b57de60a6b2b42d4c36"/><dir name="Mysgl4"><file name="Setup.php" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir><dir name="etc"><file name="config.xml" hash="50cd1344351761fed3fb8821f7462c19"/><file name="system.xml" hash="a8065db3bfe97c4ce3e29b1b2ca9fe72"/><file name="config.xml" hash="50cd1344351761fed3fb8821f7462c19"/><file name="system.xml" hash="a8065db3bfe97c4ce3e29b1b2ca9fe72"/><file name="config.xml" hash="50cd1344351761fed3fb8821f7462c19"/><file name="system.xml" hash="a8065db3bfe97c4ce3e29b1b2ca9fe72"/><file name="config.xml" hash="50cd1344351761fed3fb8821f7462c19"/><file name="system.xml" hash="a8065db3bfe97c4ce3e29b1b2ca9fe72"/></dir><dir name="sql"><dir name="multibanco_setup"><file name="mysql4-install-1.0.0.php" hash="9f00ec506a0a94d8863cf14e3673d9ef"/><file name="mysql4-install-1.0.0.php" hash="9f00ec506a0a94d8863cf14e3673d9ef"/><file name="mysql4-install-1.0.0.php" hash="9f00ec506a0a94d8863cf14e3673d9ef"/><file name="mysql4-install-1.0.0.php" hash="9f00ec506a0a94d8863cf14e3673d9ef"/><file name="mysql4-install-1.0.0.php" hash="9f00ec506a0a94d8863cf14e3673d9ef"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="multibanco"><file name="eupagomultibanco.png" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="mb_mark.gif" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eupago_Multibanco.xml" hash="65a22db8af02e4fa13ca4b9c0e212c82"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="multibanco"><dir name="form"><file name="form.phtml" hash="a9bed52032750b6d5b01d09306f63cc1"/><file name="mark.phtml" hash="59b0d4028051a96a8c54d5b33b67c8fd"/><file name="form.phtml" hash="a9bed52032750b6d5b01d09306f63cc1"/><file name="mark.phtml" hash="59b0d4028051a96a8c54d5b33b67c8fd"/><file name="form.phtml" hash="a9bed52032750b6d5b01d09306f63cc1"/><file name="mark.phtml" hash="59b0d4028051a96a8c54d5b33b67c8fd"/></dir><dir name="info"><file name="info.phtml" hash="fa6321e93aaf8d3849b6b5219a8b8987"/><dir name="pdf"><file name="info.phtml" hash="30d8927be3ac9f8ec898b21a58d1c574"/><file name="info.phtml" hash="30d8927be3ac9f8ec898b21a58d1c574"/><file name="info.phtml" hash="30d8927be3ac9f8ec898b21a58d1c574"/><file name="info.phtml" hash="30d8927be3ac9f8ec898b21a58d1c574"/></dir><file name="info.phtml" hash="fa6321e93aaf8d3849b6b5219a8b8987"/><file name="info.phtml" hash="fa6321e93aaf8d3849b6b5219a8b8987"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="multibanco"><dir name="form"><file name="form.phtml" hash="a9bed52032750b6d5b01d09306f63cc1"/><file name="mark.phtml" hash="59b0d4028051a96a8c54d5b33b67c8fd"/><file name="form.phtml" hash="a9bed52032750b6d5b01d09306f63cc1"/><file name="mark.phtml" hash="59b0d4028051a96a8c54d5b33b67c8fd"/><file name="form.phtml" hash="a9bed52032750b6d5b01d09306f63cc1"/><file name="mark.phtml" hash="59b0d4028051a96a8c54d5b33b67c8fd"/></dir><dir name="info"><file name="info.phtml" hash="af05ef20596331b8f87cb42b0a7ebb78"/><file name="info.phtml" hash="af05ef20596331b8f87cb42b0a7ebb78"/><file name="info.phtml" hash="af05ef20596331b8f87cb42b0a7ebb78"/></dir></dir><dir name="checkout"><file name="success.phtml" hash="b62f16c7288a3b37ce6a25d3302a77a1"/><file name="success.phtml" hash="b62f16c7288a3b37ce6a25d3302a77a1"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="multibanco"><file name="eupagomultibanco.png" hash="0b8ff29352f558fc8e756339a337a885"/><file name="eupagomultibanco.png" hash="0b8ff29352f558fc8e756339a337a885"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/adminhtml/default/default/images/multibanco/eupagomultibanco.png
ADDED
Binary file
|