Version Notes
- First upload
Download this release
Release Info
Developer | Eupago |
Extension | Eupago_MBWAY |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Eupago/Mbway/Block/Form.php +15 -0
- app/code/community/Eupago/Mbway/Block/Info.php +29 -0
- app/code/community/Eupago/Mbway/Block/Onepage/Success.phtml +126 -0
- app/code/community/Eupago/Mbway/Block/Success.php +12 -0
- app/code/community/Eupago/Mbway/Helper/Data.php +4 -0
- app/code/community/Eupago/Mbway/Model/Convert/Order.php +24 -0
- app/code/community/Eupago/Mbway/Model/Convert/Quote.php +20 -0
- app/code/community/Eupago/Mbway/Model/GerarRef.php +96 -0
- app/code/community/Eupago/Mbway/Model/Mysql4/Setup.php +5 -0
- app/code/community/Eupago/Mbway/Model/PaymentAction.php +44 -0
- app/code/community/Eupago/Mbway/Model/Process.php +139 -0
- app/code/community/Eupago/Mbway/controllers/CallbackController.php +61 -0
- app/code/community/Eupago/Mbway/etc/config.xml +173 -0
- app/code/community/Eupago/Mbway/etc/system.xml +125 -0
- app/code/community/Eupago/Mbway/sql/mbway_setup/mysql4-install-1.0.0.php +20 -0
- app/design/adminhtml/default/default/template/mbway/form/form.phtml +8 -0
- app/design/adminhtml/default/default/template/mbway/form/mark.phtml +3 -0
- app/design/adminhtml/default/default/template/mbway/info/info.phtml +21 -0
- app/design/adminhtml/default/default/template/mbway/info/pdf/info.phtml +5 -0
- app/design/frontend/base/default/layout/mbway.xml +15 -0
- app/design/frontend/base/default/template/mbway/checkout/success.phtml +123 -0
- app/design/frontend/base/default/template/mbway/form/form.phtml +18 -0
- app/design/frontend/base/default/template/mbway/form/mark.phtml +3 -0
- app/design/frontend/base/default/template/mbway/info/info.phtml +20 -0
- app/etc/modules/Eupago_Mbway.xml +9 -0
- package.xml +18 -0
- skin/adminhtml/default/default/images/mbway/eupagombway.png +0 -0
- skin/frontend/base/default/images/mbway/eupagombway.png +0 -0
- skin/frontend/base/default/images/mbway/mb_mark.gif +0 -0
app/code/community/Eupago/Mbway/Block/Form.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Mbway_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('mbway/form/mark.phtml');
|
9 |
+
|
10 |
+
$this->setTemplate('mbway/form/form.phtml')
|
11 |
+
->setMethodLabelAfterHtml($mark->toHtml())
|
12 |
+
;
|
13 |
+
parent::_construct();
|
14 |
+
}
|
15 |
+
}
|
app/code/community/Eupago/Mbway/Block/Info.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Mbway_Block_Info extends Mage_Payment_Block_Info
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->setTemplate('mbway/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('mbway/info/pdf/info.phtml');
|
27 |
+
return $this->toHtml();
|
28 |
+
}
|
29 |
+
}
|
app/code/community/Eupago/Mbway/Block/Onepage/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 |
+
|
29 |
+
<div class="page-title">
|
30 |
+
<h1><?php echo $this->__('Your order has been received.') ?></h1>
|
31 |
+
</div>
|
32 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
33 |
+
<h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>
|
34 |
+
|
35 |
+
<?php if ($this->getOrderId()): ?>
|
36 |
+
<?php if ($this->getCanViewOrder()) : ?>
|
37 |
+
<p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
|
38 |
+
<?php else : ?>
|
39 |
+
<p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?></p>
|
40 |
+
<?php endif; ?>
|
41 |
+
|
42 |
+
<p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
|
43 |
+
<?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) : ?>
|
44 |
+
<p>
|
45 |
+
<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
|
46 |
+
<?php echo $this->getChildHtml() ?>
|
47 |
+
</p>
|
48 |
+
|
49 |
+
<?php endif; ?>
|
50 |
+
<?php endif; ?>
|
51 |
+
|
52 |
+
<?php if ($this->getAgreementRefId()): ?>
|
53 |
+
<p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId()))) ?></p>
|
54 |
+
<?php endif; ?>
|
55 |
+
|
56 |
+
<?php if ($profiles = $this->getRecurringProfiles()): ?>
|
57 |
+
<p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
|
58 |
+
<ul class="disc">
|
59 |
+
<?php foreach ($profiles as $profile): ?>
|
60 |
+
<?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'))); ?>
|
61 |
+
<li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description'))) ?></li>
|
62 |
+
<?php endforeach; ?>
|
63 |
+
</ul>
|
64 |
+
<?php endif; ?>
|
65 |
+
|
66 |
+
<?php
|
67 |
+
$sales_flat_order_payment = Mage::getSingleton('core/resource')->getTableName('sales_flat_order_payment');
|
68 |
+
|
69 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
70 |
+
if ($order->getPayment()->getMethod() == 'multibanco') {
|
71 |
+
|
72 |
+
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
|
73 |
+
$query = $conn->query("SELECT eupago_mbw_referencia FROM $sales_flat_order_payment WHERE parent_id=$order->entity_id");
|
74 |
+
$referencia = $query->fetchColumn();
|
75 |
+
$query = $conn->query("SELECT eupago_mbw_alias FROM $sales_flat_order_payment WHERE parent_id=$order->entity_id");
|
76 |
+
$alias = $query->fetchColumn();
|
77 |
+
$query = $conn->query("SELECT eupago_mbw_montante FROM $sales_flat_order_payment WHERE parent_id=$order->entity_id");
|
78 |
+
$valor = $query->fetchColumn();
|
79 |
+
$valor = number_format($valor,'2',',','');
|
80 |
+
}
|
81 |
+
?>
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
<div align='center'>
|
88 |
+
|
89 |
+
<table cellpadding="0" cellspacing="0" border="0" style="width: 370px; color:#666; background-color: #f1f1f1; height: 50px; margin: 10px 0; border: 0px solid #d70510;">
|
90 |
+
<tbody><tr style=" font-size:small; border:0;">
|
91 |
+
<td style="border: 0; padding:5px; margin:0; background-color: #D80410; color: #f1f1f1; text-align: center; font-size:small;" colspan="3">Pagamento por MB Way</td>
|
92 |
+
</tr>
|
93 |
+
<tr style=" font-size:small; border:0;">
|
94 |
+
<td rowspan="4" style=" font-size:small;padding: 0px 15px;vertical-align: middle; border:0; "><img src="https://seguro.eupago.pt/repositorio/imagens/MBWay.png" style="margin-bottom: 0px; margin-right: 5px;"></td>
|
95 |
+
|
96 |
+
</tr>
|
97 |
+
<tr style=" font-size:small; border:0;">
|
98 |
+
<td style="border:0; padding:10px 8px 0 8px;">N. Telefone:</td>
|
99 |
+
<td style="border:0; padding:10px 8px 0 8px;"><?php echo $alias; ?></td>
|
100 |
+
</tr>
|
101 |
+
<tr style=" font-size:small; border:0;">
|
102 |
+
<td style="border:0; padding:10px 8px 0 8px;">N. Pedido:</td>
|
103 |
+
<td style="border:0; padding:10px 8px 0 8px;"><?php echo $referencia; ?></td>
|
104 |
+
</tr>
|
105 |
+
<tr style=" font-size:small; border:0;">
|
106 |
+
<td style="border:0; padding:8px ; ">Valor:</td>
|
107 |
+
<td style="border:0; padding:8px ;"><?php echo $valor; ?> </td>
|
108 |
+
</tr>
|
109 |
+
<tr>
|
110 |
+
<td style="text-align:center;padding-top:5px; font-size: xx-small;border:0; border-top: 0px solid #ddd; background-color: #fff; color: #666" colspan="3">Foi enviado um pedido de pagamento para o seu smartphone.</td>
|
111 |
+
</tr>
|
112 |
+
</tbody>
|
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/code/community/Eupago/Mbway/Block/Success.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Mbway_Block_Success extends Mage_Checkout_Block_Onepage_Success
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->setTemplate('/mbway/checkout/success.phtml');
|
8 |
+
}
|
9 |
+
|
10 |
+
}
|
11 |
+
|
12 |
+
?>
|
app/code/community/Eupago/Mbway/Helper/Data.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Mbway_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
}
|
app/code/community/Eupago/Mbway/Model/Convert/Order.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Mbway_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->setEupago_mbw_alias($payment->getEupago_mbw_alias())
|
17 |
+
->setEupago_mbw_referencia($payment->getEupago_mbw_referencia())
|
18 |
+
->setEupago_mbw_montante($payment->getEupago_mbw_montante());
|
19 |
+
|
20 |
+
return $quotePayment;
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
}
|
app/code/community/Eupago/Mbway/Model/Convert/Quote.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Mbway_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->setEupago_mbw_alias($payment->getEupago_mbw_alias())
|
15 |
+
->setEupago_mbw_referencia($payment->getEupago_mbw_referencia())
|
16 |
+
->setEupago_mbw_montante($payment->getEupago_mbw_montante());
|
17 |
+
return $orderPayment;
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
app/code/community/Eupago/Mbway/Model/GerarRef.php
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Eupago_Mbway_Model_GerarRef extends Mage_Payment_Model_Method_Abstract {
|
4 |
+
|
5 |
+
protected $_code = 'mbway';
|
6 |
+
protected $_paymentMethod = 'mbway';
|
7 |
+
protected $_formBlockType = 'mbway/form';
|
8 |
+
protected $_infoBlockType = 'mbway/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 |
+
$_SESSION['alias'] = $data->alias;
|
33 |
+
}
|
34 |
+
|
35 |
+
|
36 |
+
public function validate() {
|
37 |
+
|
38 |
+
parent::validate();
|
39 |
+
|
40 |
+
$min = $this->getConfigData('min');
|
41 |
+
$max = $this->getConfigData('max');
|
42 |
+
|
43 |
+
if($min=="")
|
44 |
+
$min='0';
|
45 |
+
if($max=="")
|
46 |
+
$max='9999.99';
|
47 |
+
|
48 |
+
$paymentInfo = $this->getInfoInstance();
|
49 |
+
|
50 |
+
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
51 |
+
$quote = $paymentInfo->getOrder();
|
52 |
+
} else {
|
53 |
+
$quote = $paymentInfo->getQuote();
|
54 |
+
}
|
55 |
+
$currency_code = $quote->getBaseCurrencyCode();
|
56 |
+
|
57 |
+
if (!in_array($currency_code, $this->_allowCurrencyCode)) {
|
58 |
+
Mage::throwException(Mage::helper('mbway')->__('A moeda selecionada (' . $currency_code . ') não é compatível com este meio de pagamento'));
|
59 |
+
}
|
60 |
+
$order_value = number_format($quote->getBaseGrandTotal(), 2, '.', '');
|
61 |
+
if ($order_value < 1) {
|
62 |
+
Mage::throwException(Mage::helper('mbway')->__('Impossível gerar referência MB para valores inferiores a 1 Euro.'));
|
63 |
+
}
|
64 |
+
if ($order_value >= 999999.99) {
|
65 |
+
Mage::throwException(Mage::helper('mbway')->__('O valor excede o limite para pagamento na rede MB'));
|
66 |
+
}
|
67 |
+
$order_value = number_format($quote->getBaseGrandTotal(), 2, '.', '');
|
68 |
+
if ($order_value < $min) {
|
69 |
+
Mage::throwException(Mage::helper('mbway')->__('Meio de pagamento disponível para compras superiores a ' . $min . ' EUR .'));
|
70 |
+
}
|
71 |
+
|
72 |
+
if ($order_value > $max) {
|
73 |
+
Mage::throwException(Mage::helper('mbway')->__('Meio de pagamento disponível para compras inferiores a ' . $max . ' EUR .'));
|
74 |
+
}
|
75 |
+
|
76 |
+
return $this;
|
77 |
+
}
|
78 |
+
|
79 |
+
public function getQuote() {
|
80 |
+
if (empty($this->_quote)) {
|
81 |
+
$this->_quote = $this->getCheckout()->getQuote();
|
82 |
+
}
|
83 |
+
return $this->_quote;
|
84 |
+
}
|
85 |
+
|
86 |
+
public function getCheckout() {
|
87 |
+
|
88 |
+
if (empty($this->_checkout)) {
|
89 |
+
$this->_checkout = Mage::getSingleton('checkout/session');
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
return $this->_checkout;
|
94 |
+
}
|
95 |
+
|
96 |
+
}
|
app/code/community/Eupago/Mbway/Model/Mysql4/Setup.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Eupago_Mbway_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
app/code/community/Eupago/Mbway/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_Mbway_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('mbway')->__('Order')
|
41 |
+
),
|
42 |
+
);
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Eupago/Mbway/Model/Process.php
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Eupago_Mbway_Model_Process extends Mage_Payment_Model_Method_Abstract {
|
4 |
+
|
5 |
+
protected $_code = 'mbway';
|
6 |
+
protected $_paymentMethod = 'mbway';
|
7 |
+
protected $_formBlockType = 'mbway/form';
|
8 |
+
protected $_infoBlockType = 'mbway/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 $chave_api = $this->getConfigData('chave');
|
26 |
+
|
27 |
+
public function orderObserver($observer) {
|
28 |
+
|
29 |
+
$chave_api = $this->getConfigData('chave');
|
30 |
+
|
31 |
+
$id = $observer->getEvent()->getOrder()->getIncrementId();
|
32 |
+
$order_value = $observer->getEvent()->getOrder()->getGrandTotal();
|
33 |
+
$entity = $observer->getEvent()->getOrder()->getId();
|
34 |
+
$sales_flat_order_payment = Mage::getSingleton('core/resource')->getTableName('sales_flat_order_payment');
|
35 |
+
$sales_flat_quote_payment = Mage::getSingleton('core/resource')->getTableName('sales_flat_quote_payment');
|
36 |
+
|
37 |
+
$resource = Mage::getSingleton('core/resource');
|
38 |
+
$writeConnection = $resource->getConnection('core_write');
|
39 |
+
$quote_id = Mage::getSingleton('checkout/session')->getQuoteId();
|
40 |
+
|
41 |
+
if ($quote_id != "") {
|
42 |
+
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
|
43 |
+
$query = $conn->query("SELECT eupago_mbw_referencia FROM $sales_flat_quote_payment WHERE quote_id =$quote_id");
|
44 |
+
$referencia = $query->fetchColumn();
|
45 |
+
|
46 |
+
|
47 |
+
if($chave_api){
|
48 |
+
$demo = explode("-",$chave_api);
|
49 |
+
if($demo['0']=='demo'){
|
50 |
+
// $url = 'https://replica.eupago.pt/replica.eupagov3.wsdl';
|
51 |
+
$url = 'http://replica.eupago.pt/replica.eupagov3_no_ssl.wsdl';
|
52 |
+
}
|
53 |
+
else {
|
54 |
+
$url ='https://seguro.eupago.pt/eupagov3.wsdl';
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
|
59 |
+
if ($referencia == "") {
|
60 |
+
if(class_exists('SOAPClient')){
|
61 |
+
$alias = $_SESSION['alias'];
|
62 |
+
$arraydados = array("chave" => $chave_api, "valor" => $order_value, "id" => $id, "alias" => $alias); //cada canal tem a sua chave
|
63 |
+
$client = @new SoapClient($url, array('cache_wsdl' => WSDL_CACHE_NONE)); // chamada do servi�o SOAP
|
64 |
+
$result = $client->pedidoMBW($arraydados);
|
65 |
+
if($result->estado == 0){
|
66 |
+
$telefone = explode('#',$result->alias);
|
67 |
+
$query = "UPDATE $sales_flat_order_payment SET eupago_mbw_montante = $order_value, eupago_mbw_alias = $telefone[1], eupago_mbw_referencia = $result->referencia WHERE parent_id =$entity";
|
68 |
+
$query = "UPDATE $sales_flat_quote_payment SET eupago_mbw_montante = $order_value, eupago_mbw_alias = $telefone[1], eupago_mbw_referencia = $result->referencia WHERE quote_id =$quote_id";
|
69 |
+
}else{
|
70 |
+
// Mage::getSingleton('core/session')->addError('O número de telefone parece não estar associado ao MBWAY.. por favor tente novamente');
|
71 |
+
|
72 |
+
if($result->estado == -9){
|
73 |
+
Mage::throwException("O número de telefone parece não estar associado ao MBWAY.. por favor tente novamente");
|
74 |
+
}else{
|
75 |
+
$erro = $result->resposta;
|
76 |
+
Mage::throwException($erro);
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
}else{
|
81 |
+
$client = new Varien_Http_Client();
|
82 |
+
$client->setUri('https://replica.eupago.pt/bridge_clientes/bridge.php?servico=mb&chave_api='.$chave_api.'&valor='.$order_value.'&identificador='.$id)
|
83 |
+
->setMethod('GET')
|
84 |
+
->setConfig(array(
|
85 |
+
'maxredirects'=>1,
|
86 |
+
'timeout'=>30,
|
87 |
+
));
|
88 |
+
|
89 |
+
$response = $client->request()->getBody();
|
90 |
+
$dados = explode('#', $response);
|
91 |
+
$alias = $dados['1']; // tenho de ver por aqui
|
92 |
+
$referencia = $dados['2'];
|
93 |
+
$query = "UPDATE $sales_flat_order_payment SET eupago_mbw_montante = $order_value, eupago_mbw_alias = $alias, eupago_mbw_referencia = $referencia WHERE parent_id =$entity";
|
94 |
+
$query = "UPDATE $sales_flat_quote_payment SET eupago_mbw_montante = $order_value, eupago_mbw_alias = $alias, eupago_mbw_referencia = $referencia WHERE quote_id =$quote_id";
|
95 |
+
|
96 |
+
}
|
97 |
+
|
98 |
+
|
99 |
+
$writeConnection->query($query);
|
100 |
+
$writeConnection->query($query);
|
101 |
+
} else {
|
102 |
+
|
103 |
+
$writeConnection = $resource->getConnection('core_write');
|
104 |
+
$query = $conn->query("SELECT eupago_mbw_alias FROM $sales_flat_quote_payment WHERE quote_id =$quote_id");
|
105 |
+
$alias = $query->fetchColumn();
|
106 |
+
$query = $conn->query("SELECT eupago_mbw_montante FROM $sales_flat_quote_payment WHERE quote_id =$quote_id");
|
107 |
+
$montante = $query->fetchColumn();
|
108 |
+
$query = "UPDATE $sales_flat_order_payment SET eupago_mbw_montante = $montante, eupago_mbw_alias = $alias, eupago_mbw_referencia = $referencia WHERE parent_id =$entity";
|
109 |
+
$writeConnection->query($query);
|
110 |
+
$query = "UPDATE $sales_flat_quote_payment SET eupago_mbw_montante = $montante, eupago_mbw_alias = $alias, eupago_mbw_referencia = $referencia WHERE quote_id =$quote_id";
|
111 |
+
$writeConnection->query($query);
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
|
116 |
+
|
117 |
+
return;
|
118 |
+
}
|
119 |
+
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Get checkout session namespace
|
123 |
+
*
|
124 |
+
* @return Mage_Checkout_Model_Session
|
125 |
+
*/
|
126 |
+
public function getCheckout() {
|
127 |
+
return Mage::getSingleton('checkout/session');
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Get current quote
|
132 |
+
*
|
133 |
+
* @return Mage_Sales_Model_Quote
|
134 |
+
*/
|
135 |
+
public function getQuote() {
|
136 |
+
return $this->getCheckout()->getQuote();
|
137 |
+
}
|
138 |
+
|
139 |
+
}
|
app/code/community/Eupago/Mbway/controllers/CallbackController.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Eupago_Mbway_CallbackController extends Mage_Core_Controller_Front_Action { // extends Mage_Payment_Model_Method_Abstract
|
4 |
+
|
5 |
+
public function autorizeAction(){
|
6 |
+
|
7 |
+
///// dados vindos da api para comfirmar
|
8 |
+
$CallBack = $this->getRequest()->getParams();
|
9 |
+
$CallBack_valor = $CallBack['valor'];
|
10 |
+
$CallBack_referencia = $CallBack['referencia'];
|
11 |
+
$CallBack_chave_api = $CallBack['chave_api'];
|
12 |
+
$CallBack_orderId = $CallBack['identificador'];
|
13 |
+
$CallBack_autorizacao = $CallBack['autorizacao'];
|
14 |
+
$CallBack_autorizacao = $CallBack['mp'];
|
15 |
+
|
16 |
+
//mp
|
17 |
+
//pc:pt -> mbway
|
18 |
+
//ps:pt -> payshop
|
19 |
+
//mw:pt -> mbway
|
20 |
+
//pq:pt -> pagaqui
|
21 |
+
|
22 |
+
////// dados de encomenda
|
23 |
+
$OrderNumber = $CallBack_orderId; //$CallBack_orderId vaem da api Eupago[order-id]
|
24 |
+
$order = Mage::getModel('sales/order')->load($OrderNumber, 'increment_id');
|
25 |
+
$valor_encomenda = $order->grand_total; //retirado do valor total da encomenda
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
/////// dados do pagamento
|
30 |
+
$pagamento = $order->getPayment();
|
31 |
+
$entidade = $pagamento->eupago_entidade;
|
32 |
+
$referencia = $pagamento->eupago_referencia;
|
33 |
+
$valor_gerado = $pagamento->eupago_montante;
|
34 |
+
|
35 |
+
/////// dados do pagamento MBW
|
36 |
+
$pagamento = $order->getPayment();
|
37 |
+
$alias = $pagamento->eupago_mbw_alias;
|
38 |
+
$referenciaMBW = $pagamento->eupago_mbw_referencia;
|
39 |
+
|
40 |
+
|
41 |
+
/////// gera autorizacao
|
42 |
+
$chave_api = Mage::getModel('mbway/process')->getConfigData('chave');
|
43 |
+
$autorizacao = md5(date('Y-m-d').$chave_api);
|
44 |
+
|
45 |
+
//////// Confere dados
|
46 |
+
$confere_montantes = (($valor_encomenda == $valor_gerado) == $CallBack_valor ? true : false);
|
47 |
+
$confere_autorizacao = ($autorizacao == $CallBack_autorizacao ? true : false);
|
48 |
+
$confere_referencia = ($referencia == $CallBack_referencia ? true : false);
|
49 |
+
$confere_chave_api = ($CallBack_chave_api == $chave_api ? true : false);
|
50 |
+
|
51 |
+
////// se tudo ok, faz o update do estado da encomenda e envia um email ao cliente
|
52 |
+
if($confere_montantes && $confere_chave_api && $confere_referencia){ /*futuro upgrade -> $confere_autorizacao*/
|
53 |
+
$order->setData('state', "complete");
|
54 |
+
$order->setStatus("processing");
|
55 |
+
$order->sendOrderUpdateEmail();
|
56 |
+
$history = $order->addStatusHistoryComment('Order marked as complete automatically.', false);
|
57 |
+
$history->setIsCustomerNotified(true);
|
58 |
+
$order->save();
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
app/code/community/Eupago/Mbway/etc/config.xml
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Eupago_Mbway>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Eupago_Mbway>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<translate>
|
10 |
+
<modules>
|
11 |
+
<Eupago_Mbway>
|
12 |
+
<files>
|
13 |
+
<default>Eupago_Mbway.csv</default>
|
14 |
+
</files>
|
15 |
+
</Eupago_Mbway>
|
16 |
+
</modules>
|
17 |
+
</translate>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<yourmodule>
|
21 |
+
<file>mbway.xml</file>
|
22 |
+
</yourmodule>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
<routers>
|
26 |
+
<Eupago_Mbway>
|
27 |
+
<use>standard</use>
|
28 |
+
<args>
|
29 |
+
<module>Eupago_Mbway</module>
|
30 |
+
<frontName>Eupago</frontName>
|
31 |
+
</args>
|
32 |
+
</Eupago_Mbway>
|
33 |
+
</routers>
|
34 |
+
</frontend>
|
35 |
+
<adminhtml>
|
36 |
+
<translate>
|
37 |
+
<modules>
|
38 |
+
<Eupago_Mbway>
|
39 |
+
<files>
|
40 |
+
<default>Eupago_Mbway.csv</default>
|
41 |
+
</files>
|
42 |
+
</Eupago_Mbway>
|
43 |
+
</modules>
|
44 |
+
</translate>
|
45 |
+
</adminhtml>
|
46 |
+
<global>
|
47 |
+
<fieldsets>
|
48 |
+
<sales_convert_quote_payment>
|
49 |
+
<eupago_mbw_alias>
|
50 |
+
<to_order_payment>*</to_order_payment>
|
51 |
+
</eupago_mbw_alias>
|
52 |
+
<eupago_mbw_referencia>
|
53 |
+
<to_order_payment>*</to_order_payment>
|
54 |
+
</eupago_mbw_referencia>
|
55 |
+
<eupago_mbw_montante>
|
56 |
+
<to_order_payment>*</to_order_payment>
|
57 |
+
</eupago_mbw_montante>
|
58 |
+
</sales_convert_quote_payment>
|
59 |
+
|
60 |
+
<sales_convert_order_payment>
|
61 |
+
<eupago_mbw_alias>
|
62 |
+
<to_quote_payment>*</to_quote_payment>
|
63 |
+
</eupago_mbw_alias>
|
64 |
+
<eupago_mbw_referencia>
|
65 |
+
<to_quote_payment>*</to_quote_payment>
|
66 |
+
</eupago_mbw_referencia>
|
67 |
+
<eupago_mbw_montante>
|
68 |
+
<to_quote_payment>*</to_quote_payment>
|
69 |
+
</eupago_mbw_montante>
|
70 |
+
</sales_convert_order_payment>
|
71 |
+
</fieldsets>
|
72 |
+
<models>
|
73 |
+
<mbway>
|
74 |
+
<class>Eupago_Mbway_Model</class>
|
75 |
+
<resourceModel>mbway_mysql4</resourceModel>
|
76 |
+
</mbway>
|
77 |
+
<sales>
|
78 |
+
<rewrite>
|
79 |
+
<convert_order>Eupago_Mbway_Model_Convert_Order</convert_order>
|
80 |
+
<convert_quote>Eupago_Mbway_Model_Convert_Quote</convert_quote>
|
81 |
+
</rewrite>
|
82 |
+
</sales>
|
83 |
+
<mbway_mysql4>
|
84 |
+
<class>Eupago_Mbway_Model_Mysql4</class>
|
85 |
+
<entities>
|
86 |
+
<mbway>
|
87 |
+
<table>eupago</table>
|
88 |
+
</mbway>
|
89 |
+
</entities>
|
90 |
+
</mbway_mysql4>
|
91 |
+
</models>
|
92 |
+
<resources>
|
93 |
+
<mbway_setup>
|
94 |
+
<setup>
|
95 |
+
<module>Eupago_Mbway</module>
|
96 |
+
<class>Eupago_Mbway_Model_Mysql4_Setup</class>
|
97 |
+
</setup>
|
98 |
+
<connection>
|
99 |
+
<use>core_setup</use>
|
100 |
+
</connection>
|
101 |
+
</mbway_setup>
|
102 |
+
<mbway_write>
|
103 |
+
<connection>
|
104 |
+
<use>core_write</use>
|
105 |
+
</connection>
|
106 |
+
</mbway_write>
|
107 |
+
<mbway_read>
|
108 |
+
<connection>
|
109 |
+
<use>core_read</use>
|
110 |
+
</connection>
|
111 |
+
</mbway_read>
|
112 |
+
</resources>
|
113 |
+
<blocks>
|
114 |
+
<mbway>
|
115 |
+
<class>Eupago_Mbway_Block</class>
|
116 |
+
</mbway>
|
117 |
+
<checkout>
|
118 |
+
<rewrite>
|
119 |
+
<checkout_onepage_success>Eupago_Mbway_Block_Success</checkout_onepage_success>
|
120 |
+
</rewrite>
|
121 |
+
</checkout>
|
122 |
+
</blocks>
|
123 |
+
<helpers>
|
124 |
+
<Eupago_Mbway>
|
125 |
+
<class>Eupago_Mbway_Helper</class>
|
126 |
+
</Eupago_Mbway>
|
127 |
+
</helpers>
|
128 |
+
<sales>
|
129 |
+
<order>
|
130 |
+
<statuses>
|
131 |
+
<aguarda_pagamento_mbway translate="label">
|
132 |
+
<label><![CDATA[MB - Aguarda Pagamento]]>
|
133 |
+
</label>
|
134 |
+
</aguarda_pagamento_mbway>
|
135 |
+
</statuses>
|
136 |
+
<states>
|
137 |
+
<new>
|
138 |
+
<statuses>
|
139 |
+
<aguarda_pagamento_mbway/>
|
140 |
+
</statuses>
|
141 |
+
</new>
|
142 |
+
</states>
|
143 |
+
</order>
|
144 |
+
</sales>
|
145 |
+
<events>
|
146 |
+
<sales_order_save_after>
|
147 |
+
<observers>
|
148 |
+
<payone_save_status>
|
149 |
+
<type>singleton</type>
|
150 |
+
<class>mbway/process</class>
|
151 |
+
<method>orderObserver</method>
|
152 |
+
</payone_save_status>
|
153 |
+
</observers>
|
154 |
+
</sales_order_save_after>
|
155 |
+
</events>
|
156 |
+
|
157 |
+
</global>
|
158 |
+
|
159 |
+
<default>
|
160 |
+
<payment>
|
161 |
+
<mbway>
|
162 |
+
<active>0</active>
|
163 |
+
<model>mbway/gerarRef</model>
|
164 |
+
<title>Mbway</title>
|
165 |
+
<sort_order>1</sort_order>
|
166 |
+
<allowspecific>0</allowspecific>
|
167 |
+
<chave></chave>
|
168 |
+
<mensagem>Pagamentos por MBWAY</mensagem>
|
169 |
+
<payment_action>order</payment_action>
|
170 |
+
</mbway>
|
171 |
+
</payment>
|
172 |
+
</default>
|
173 |
+
</config>
|
app/code/community/Eupago/Mbway/etc/system.xml
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<mbway translate="label" module="payment">
|
7 |
+
<label><![CDATA[euPago - Pagamentos por MBWAY (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 |
+
<comment>Se ainda não tiver uma chave <![CDATA[ <a target="_blank" href="https://eupago.pt/registo?magento#registo_form">clique aqui</a> ]]></comment>
|
54 |
+
<frontend_type>text</frontend_type>
|
55 |
+
<sort_order>25</sort_order>
|
56 |
+
<show_in_default>1</show_in_default>
|
57 |
+
<show_in_website>1</show_in_website>
|
58 |
+
<show_in_store>1</show_in_store>
|
59 |
+
</chave>
|
60 |
+
<min translate="label">
|
61 |
+
<label>Valor Mínimo da Encomenda</label>
|
62 |
+
<frontend_type>text</frontend_type>
|
63 |
+
<validate>validate-number</validate>
|
64 |
+
<sort_order>30</sort_order>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<show_in_website>1</show_in_website>
|
67 |
+
<show_in_store>1</show_in_store>
|
68 |
+
</min>
|
69 |
+
<max translate="label">
|
70 |
+
<label>Valor Máximo da Encomenda</label>
|
71 |
+
<frontend_type>text</frontend_type>
|
72 |
+
<validate>validate-number</validate>
|
73 |
+
<sort_order>35</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
</max>
|
78 |
+
|
79 |
+
<mensagem translate="label">
|
80 |
+
<label><![CDATA[Instruções]]>
|
81 |
+
</label>
|
82 |
+
<frontend_type>text</frontend_type>
|
83 |
+
<sort_order>40</sort_order>
|
84 |
+
<show_in_default>1</show_in_default>
|
85 |
+
<show_in_website>1</show_in_website>
|
86 |
+
<show_in_store>1</show_in_store>
|
87 |
+
</mensagem>
|
88 |
+
<allowspecific translate="label">
|
89 |
+
<label><![CDATA[Pagamento para os Países]]>
|
90 |
+
</label>
|
91 |
+
<frontend_type>allowspecific</frontend_type>
|
92 |
+
<sort_order>45</sort_order>
|
93 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
94 |
+
<show_in_default>1</show_in_default>
|
95 |
+
<show_in_website>1</show_in_website>
|
96 |
+
<show_in_store>1</show_in_store>
|
97 |
+
</allowspecific>
|
98 |
+
<specificcountry translate="label">
|
99 |
+
<label><![CDATA[Pagamento para Países Específicos]]>
|
100 |
+
</label>
|
101 |
+
<frontend_type>multiselect</frontend_type>
|
102 |
+
<sort_order>50</sort_order>
|
103 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
104 |
+
<show_in_default>1</show_in_default>
|
105 |
+
<show_in_website>1</show_in_website>
|
106 |
+
<show_in_store>1</show_in_store>
|
107 |
+
</specificcountry>
|
108 |
+
<payment_action translate="label">
|
109 |
+
<label>Payment Action</label>
|
110 |
+
<frontend_type>select</frontend_type>
|
111 |
+
<source_model>mbway/paymentAction</source_model>
|
112 |
+
<sort_order>55</sort_order>
|
113 |
+
<show_in_default>0</show_in_default>
|
114 |
+
<show_in_website>0</show_in_website>
|
115 |
+
<show_in_store>0</show_in_store>
|
116 |
+
</payment_action>
|
117 |
+
</fields>
|
118 |
+
</mbway>
|
119 |
+
</groups>
|
120 |
+
</payment>
|
121 |
+
<info>
|
122 |
+
<label><![CDATA[Pagamento para Países Específicos]]></label>
|
123 |
+
</info>
|
124 |
+
</sections>
|
125 |
+
</config>
|
app/code/community/Eupago/Mbway/sql/mbway_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_mbw_alias', array('type'=>'varchar'));
|
6 |
+
$installer->addAttribute('order_payment', 'eupago_mbw_referencia', array('type'=>'varchar'));
|
7 |
+
$installer->addAttribute('order_payment', 'eupago_mbw_montante', array('type'=>'varchar'));
|
8 |
+
|
9 |
+
$installer->addAttribute('quote_payment', 'eupago_mbw_alias', array('type'=>'varchar'));
|
10 |
+
$installer->addAttribute('quote_payment', 'eupago_mbw_referencia', array('type'=>'varchar'));
|
11 |
+
$installer->addAttribute('quote_payment', 'eupago_mbw_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_mbw_alias', 'VARCHAR(255) NOT NULL');
|
17 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'eupago_mbw_referencia', 'VARCHAR(255) NOT NULL');
|
18 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'eupago_mbw_montante', 'VARCHAR(255) NOT NULL');
|
19 |
+
$installer->endSetup();
|
20 |
+
}
|
app/design/adminhtml/default/default/template/mbway/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/mbway/eupagombway.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/mbway/form/mark.phtml
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<!-- MB Logo -->
|
2 |
+
<img src="<?php echo $this->getSkinUrl('images/mbway/mb_mark.gif') ?>" class="v-middle" />
|
3 |
+
<!-- MB Logo -->
|
app/design/adminhtml/default/default/template/mbway/info/info.phtml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<table border="0" cellspacing="1" cellpadding="0">
|
2 |
+
|
3 |
+
<tr>
|
4 |
+
<td><table width="100%" border="0" cellspacing="1" cellpadding="0">
|
5 |
+
<tr style=" font-size:small; border:0;">
|
6 |
+
<td rowspan="4" style=" font-size:small;padding: 0px 15px;vertical-align: middle; border:0; "><img src="https://seguro.eupago.pt/repositorio/imagens/MBWay.png" style="margin-bottom: 0px; margin-right: 5px;"></td>
|
7 |
+
<tr>
|
8 |
+
<td style="padding-right:5px;"><?php echo $this->__('<strong>Telefone:</strong>'); ?></td>
|
9 |
+
<td style="padding-right:5px;"><?php echo $this->htmlEscape($this->getInfo()->getEupago_mbw_alias()) ?></td>
|
10 |
+
</tr>
|
11 |
+
<tr>
|
12 |
+
<td style="padding-right:5px;"><?php echo $this->__('<strong>Referência:</strong>'); ?> </td>
|
13 |
+
<td style="padding-right:5px;"><?php echo $this->htmlEscape($this->getInfo()->getEupago_mbw_referencia()); ?></td>
|
14 |
+
</tr>
|
15 |
+
<tr>
|
16 |
+
<td style="padding-right:5px;"><?php echo $this->__('<strong>Montante:</strong>'); ?></td>
|
17 |
+
<td style="padding-right:5px;"><?php echo number_format($this->htmlEscape($this->getInfo()->getEupago_mbw_montante()),'2',',','') . ' EUR'; ?></td>
|
18 |
+
</tr>
|
19 |
+
</table></td>
|
20 |
+
</tr>
|
21 |
+
</table>
|
app/design/adminhtml/default/default/template/mbway/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/base/default/layout/mbway.xml
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<checkout_onepage_success translate="label">
|
4 |
+
<label>One Page Checkout Success</label>
|
5 |
+
<!-- <reference name="root">
|
6 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
7 |
+
</reference> -->
|
8 |
+
<reference name="content">
|
9 |
+
<reference name="checkout.success">
|
10 |
+
<action method="setTemplate"><template>mbway/checkout/success.phtml</template></action>
|
11 |
+
</reference>
|
12 |
+
</reference>
|
13 |
+
</checkout_onepage_success>
|
14 |
+
</layout>
|
15 |
+
|
app/design/frontend/base/default/template/mbway/checkout/success.phtml
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
29 |
+
<div class="page-title">
|
30 |
+
<h1><?php echo $this->__('Your order has been received.') ?></h1>
|
31 |
+
</div>
|
32 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
33 |
+
<h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>
|
34 |
+
|
35 |
+
<?php if ($this->getOrderId()): ?>
|
36 |
+
<?php if ($this->getCanViewOrder()) : ?>
|
37 |
+
<p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
|
38 |
+
<?php else : ?>
|
39 |
+
<p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?></p>
|
40 |
+
<?php endif; ?>
|
41 |
+
|
42 |
+
<p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
|
43 |
+
<?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) : ?>
|
44 |
+
<p>
|
45 |
+
<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
|
46 |
+
<?php echo $this->getChildHtml() ?>
|
47 |
+
</p>
|
48 |
+
|
49 |
+
<?php endif; ?>
|
50 |
+
<?php endif; ?>
|
51 |
+
|
52 |
+
<?php if ($this->getAgreementRefId()): ?>
|
53 |
+
<p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId()))) ?></p>
|
54 |
+
<?php endif; ?>
|
55 |
+
|
56 |
+
<?php if ($profiles = $this->getRecurringProfiles()): ?>
|
57 |
+
<p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
|
58 |
+
<ul class="disc">
|
59 |
+
<?php foreach ($profiles as $profile): ?>
|
60 |
+
<?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'))); ?>
|
61 |
+
<li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description'))) ?></li>
|
62 |
+
<?php endforeach; ?>
|
63 |
+
</ul>
|
64 |
+
<?php endif; ?>
|
65 |
+
|
66 |
+
<?php
|
67 |
+
$sales_flat_order_payment = Mage::getSingleton('core/resource')->getTableName('sales_flat_order_payment');
|
68 |
+
|
69 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
70 |
+
if ($order->getPayment()->getMethod() == 'mbway') {
|
71 |
+
|
72 |
+
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
|
73 |
+
$query = $conn->query("SELECT eupago_mbw_referencia FROM $sales_flat_order_payment WHERE parent_id=$order->entity_id");
|
74 |
+
$referencia = $query->fetchColumn();
|
75 |
+
$query = $conn->query("SELECT eupago_mbw_alias FROM $sales_flat_order_payment WHERE parent_id=$order->entity_id");
|
76 |
+
$alias = $query->fetchColumn();
|
77 |
+
$query = $conn->query("SELECT eupago_mbw_montante FROM $sales_flat_order_payment WHERE parent_id=$order->entity_id");
|
78 |
+
$valor = $query->fetchColumn();
|
79 |
+
$valor = number_format($valor,'2',',','');
|
80 |
+
}
|
81 |
+
?>
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
<div align='center'>
|
88 |
+
|
89 |
+
<table cellpadding="0" cellspacing="0" border="0" style="width: 370px; color:#666; background-color: #f1f1f1; height: 50px; margin: 10px 0; border: 0px solid #d70510;">
|
90 |
+
<tbody><tr style=" font-size:small; border:0;">
|
91 |
+
<td style="border: 0; padding:5px; margin:0; background-color: #D80410; color: #f1f1f1; text-align: center; font-size:small;" colspan="3">Pagamento por MB Way</td>
|
92 |
+
</tr>
|
93 |
+
<tr style=" font-size:small; border:0;">
|
94 |
+
<td rowspan="4" style=" font-size:small;padding: 0px 15px;vertical-align: middle; border:0; "><img src="https://seguro.eupago.pt/repositorio/imagens/MBWay.png" style="margin-bottom: 0px; margin-right: 5px;"></td>
|
95 |
+
|
96 |
+
</tr>
|
97 |
+
<tr style=" font-size:small; border:0;">
|
98 |
+
<td style="border:0; padding:10px 8px 0 8px;">N. Telefone:</td>
|
99 |
+
<td style="border:0; padding:10px 8px 0 8px;"><?php echo $alias; ?></td>
|
100 |
+
</tr>
|
101 |
+
<tr style=" font-size:small; border:0;">
|
102 |
+
<td style="border:0; padding:10px 8px 0 8px;">N. Pedido:</td>
|
103 |
+
<td style="border:0; padding:10px 8px 0 8px;"><?php echo $referencia; ?></td>
|
104 |
+
</tr>
|
105 |
+
<tr style=" font-size:small; border:0;">
|
106 |
+
<td style="border:0; padding:8px ; ">Valor:</td>
|
107 |
+
<td style="border:0; padding:8px ;"><?php echo $valor; ?> </td>
|
108 |
+
</tr>
|
109 |
+
<tr>
|
110 |
+
<td style="text-align:center;padding-top:5px; font-size: xx-small;border:0; border-top: 0px solid #ddd; background-color: #fff; color: #666" colspan="3">Foi enviado um pedido de pagamento para o seu smartphone.</td>
|
111 |
+
</tr>
|
112 |
+
</tbody>
|
113 |
+
</table>
|
114 |
+
|
115 |
+
</div>
|
116 |
+
|
117 |
+
|
118 |
+
<div class="buttons-set">
|
119 |
+
<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>
|
120 |
+
</div>
|
121 |
+
|
122 |
+
|
123 |
+
|
app/design/frontend/base/default/template/mbway/form/form.phtml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<fieldset class="form-list">
|
2 |
+
<ul id="payment_form_<?php echo $this->getMethodCode(); ?>" style="display:none">
|
3 |
+
<table cellpadding="0" cellspacing="0" border="0" style="width: 370px; color:#666; background-color: #f1f1f1; height: 50px; margin: 10px 0; border: 0px solid #d70510;">
|
4 |
+
<tr>
|
5 |
+
<td style="border: 0; padding:5px; margin:0; background-color: #D80410; color: #f1f1f1; text-align: center; font-size:small;" colspan="3">Pagamento por MB Way</td>
|
6 |
+
</tr>
|
7 |
+
<tr>
|
8 |
+
<td style="padding: 10px 10px 0 10px;"><label>Insira o número de telefone</label><input type="text" title="<?php echo $this->__('alias') ?>" name="payment[alias]" placeholder="Número de telefone" value="<?php echo $this->htmlEscape($this->getInfoData('alias')) ?>" required /></td>
|
9 |
+
</tr>
|
10 |
+
<tr>
|
11 |
+
<td style="border: 0; padding:10px; margin:0; color: #666; font-size:small;">Se ainda não instalou a aplicação no smartphone ou ainda não aderiu ao serviço mbway, por favor consulte este <a target="_blank" href="https://www.mbway.pt/" >link</a>. </p></td>
|
12 |
+
</tr>
|
13 |
+
</table>
|
14 |
+
</ul>
|
15 |
+
</fieldset>
|
16 |
+
<script>
|
17 |
+
|
18 |
+
</script>
|
app/design/frontend/base/default/template/mbway/form/mark.phtml
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<!-- MB Logo -->
|
2 |
+
<img src="https://seguro.eupago.pt/repositorio/imagens/MBWay.png" style="margin-bottom: 0px; width: 40px; height: 20px; margin-right: 5px;" class="v-middle">
|
3 |
+
<!-- MB Logo -->
|
app/design/frontend/base/default/template/mbway/info/info.phtml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<?php if($_SESSION['alias'] == ""){
|
5 |
+
echo '<div class="alert alert-danger" style="color: #a94442; background-color: #f2dede; border-color: #ebccd1; padding: 10px; width: 100%; display: block;">
|
6 |
+
<strong>ALERTA!</strong> Por favor insira o número de telefone
|
7 |
+
</div>';
|
8 |
+
}else{
|
9 |
+
echo '<img src="https://seguro.eupago.pt/repositorio/imagens/MBWay.png" class="v-middle">';
|
10 |
+
}?>
|
11 |
+
|
12 |
+
|
13 |
+
<!--<table cellpadding="0" cellspacing="0" border="0" style="width: 370px; color:#666; background-color: #f1f1f1; height: 50px; margin: 10px 0; border: 0px solid #d70510;">
|
14 |
+
<tr>
|
15 |
+
<td style="border: 0; padding:5px; margin:0; background-color: #D80410; color: #f1f1f1; text-align: center; font-size:small;" colspan="3">Pagamento por MB Way</td>
|
16 |
+
</tr>
|
17 |
+
<tr>
|
18 |
+
<td style="border: 0; padding:10px; margin:0; color: #666; font-size:small;">Se ainda não instalou a aplicação no smartphone ou ainda não aderiu ao serviço mbway, por favor consulte este <a target="_blank" href="https://www.mbway.pt/" >link</a>. </p></td>
|
19 |
+
</tr>
|
20 |
+
</table>-->
|
app/etc/modules/Eupago_Mbway.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Eupago_Mbway>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Eupago_Mbway>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Eupago_MBWAY</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 para MBWAY</summary>
|
10 |
+
<description>Método de pagamento para MBWAY</description>
|
11 |
+
<notes>- First upload</notes>
|
12 |
+
<authors><author><name>euPago</name><user>euPago</user><email>dev@eupago.pt</email></author></authors>
|
13 |
+
<date>2016-01-15</date>
|
14 |
+
<time>18:21:58</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Eupago"><dir name="Mbway"><dir name="Block"><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/><dir name="Onepage"><file name="Success.phtml" hash="08fa78dfdbc11b7fd25b5f0bc5e5f117"/><file name="Success.phtml" hash="08fa78dfdbc11b7fd25b5f0bc5e5f117"/><file name="Success.phtml" hash="08fa78dfdbc11b7fd25b5f0bc5e5f117"/></dir><file name="Success.php" hash="a9908a23e6c7987e63f420dec16610a8"/><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/><file name="Success.php" hash="a9908a23e6c7987e63f420dec16610a8"/><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/><file name="Success.php" hash="a9908a23e6c7987e63f420dec16610a8"/><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/></dir><dir name="Helper"><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/></dir><dir name="Model"><dir name="Convert"><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/></dir><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><dir name="Mysql4"><file name="Setup.php" hash="01c41be63649dd0d1f4ab113ecbc7997"/><file name="Setup.php" hash="01c41be63649dd0d1f4ab113ecbc7997"/><file name="Setup.php" hash="01c41be63649dd0d1f4ab113ecbc7997"/></dir><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><dir name="Mysgl4"><file name="Setup.php" hash=""/></dir></dir><dir name="controllers"><file name="CallbackController.php" hash="1ad192a6f64c6e6489e411b79c41655f"/><file name="CallbackController.php" hash="1ad192a6f64c6e6489e411b79c41655f"/></dir><dir name="etc"><file name="config.xml" hash="311886de7d89f451650f42af2e1a6932"/><file name="system.xml" hash="9ed7bc7fbcdd13fb87169fa7e582537f"/><file name="config.xml" hash="311886de7d89f451650f42af2e1a6932"/><file name="system.xml" hash="9ed7bc7fbcdd13fb87169fa7e582537f"/><file name="config.xml" hash="311886de7d89f451650f42af2e1a6932"/><file name="system.xml" hash="9ed7bc7fbcdd13fb87169fa7e582537f"/><file name="config.xml" hash="311886de7d89f451650f42af2e1a6932"/><file name="system.xml" hash="9ed7bc7fbcdd13fb87169fa7e582537f"/></dir><dir name="sql"><dir name="mbway_setup"><file name="mysql4-install-1.0.0.php" hash="88957e805ec4b644f266271fe07114db"/><file name="mysql4-install-1.0.0.php" hash="88957e805ec4b644f266271fe07114db"/><file name="mysql4-install-1.0.0.php" hash="88957e805ec4b644f266271fe07114db"/><file name="mysql4-install-1.0.0.php" hash="88957e805ec4b644f266271fe07114db"/><file name="mysql4-install-1.0.0.php" hash="88957e805ec4b644f266271fe07114db"/></dir></dir></dir><dir name="mbway"><dir name="controllers"><file name="CallbackController.php" hash="1ad192a6f64c6e6489e411b79c41655f"/><file name="CallbackController.php" hash="1ad192a6f64c6e6489e411b79c41655f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eupago_Mbway.xml" hash="6d6dd906ecd94ffdbba8dffd839c4338"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="mbway"><dir name="form"><file name="form.phtml" hash="6c316b9faa97227b78230c22f3ae991b"/><file name="mark.phtml" hash="f013b5347041ada0961252129b44127a"/><file name="form.phtml" hash="6c316b9faa97227b78230c22f3ae991b"/><file name="mark.phtml" hash="f013b5347041ada0961252129b44127a"/><file name="form.phtml" hash="6c316b9faa97227b78230c22f3ae991b"/><file name="mark.phtml" hash="f013b5347041ada0961252129b44127a"/></dir><dir name="info"><file name="info.phtml" hash="d0af4f680c201f7d79813ac08df93683"/><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="d0af4f680c201f7d79813ac08df93683"/><file name="info.phtml" hash="d0af4f680c201f7d79813ac08df93683"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="mbway"><dir name="checkout"><file name="success.phtml" hash="f0793610fb7183301f0784fb128ec057"/><file name="success.phtml" hash="f0793610fb7183301f0784fb128ec057"/><file name="success.phtml" hash="f0793610fb7183301f0784fb128ec057"/></dir><dir name="form"><file name="form.phtml" hash="e5eefe077cf0e24992c1c347dc77baf1"/><file name="mark.phtml" hash="a5c4ad861ceaa58b07266fcfd9393ca8"/><file name="form.phtml" hash="e5eefe077cf0e24992c1c347dc77baf1"/><file name="mark.phtml" hash="a5c4ad861ceaa58b07266fcfd9393ca8"/><file name="form.phtml" hash="e5eefe077cf0e24992c1c347dc77baf1"/><file name="mark.phtml" hash="a5c4ad861ceaa58b07266fcfd9393ca8"/></dir><dir name="info"><file name="info.phtml" hash="d67bc540251df859b325dc903cf5815a"/><file name="info.phtml" hash="d67bc540251df859b325dc903cf5815a"/><file name="info.phtml" hash="d67bc540251df859b325dc903cf5815a"/></dir></dir></dir><dir name="layout"><file name="mbway.xml" hash="3abe3cd742f4651a49b5f9bdb986a59e"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="mbway"><file name="eupagombway.png" hash="0b8ff29352f558fc8e756339a337a885"/><file name="eupagombway.png" hash="0b8ff29352f558fc8e756339a337a885"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="mbway"><file name="eupagombway.png" hash="0ca321915123d5a712fb2b4f6744278a"/><file name="mb_mark.gif" hash="bbfd7b49dc892a72a8a87d8d1ae3e4ee"/><file name="eupagombway.png" hash="0ca321915123d5a712fb2b4f6744278a"/><file name="mb_mark.gif" hash="bbfd7b49dc892a72a8a87d8d1ae3e4ee"/></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/mbway/eupagombway.png
ADDED
Binary file
|
skin/frontend/base/default/images/mbway/eupagombway.png
ADDED
Binary file
|
skin/frontend/base/default/images/mbway/mb_mark.gif
ADDED
Binary file
|