Lusopay_LusopayGateway - Version 2.0.0

Version Notes

Novo sistema de callback

Download this release

Release Info

Developer Lusopay
Extension Lusopay_LusopayGateway
Version 2.0.0
Comparing to
See all releases


Code changes from version 1.6.1 to 2.0.0

Files changed (46) hide show
  1. app/code/local/Lusopay/Lusopaygateway/Block/Checkout/Info/LusopayMBPS.php +17 -0
  2. app/code/local/Lusopay/Lusopaygateway/Block/Checkout/Success.php +135 -0
  3. app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Block/Form.php +3 -3
  4. app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Block/Info.php +3 -3
  5. app/code/local/Lusopay/Lusopaygateway/Helper/Data.php +4 -0
  6. app/code/local/Lusopay/Lusopaygateway/Model/AtivarCallback.php +161 -0
  7. app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Model/Convert/Order.php +6 -7
  8. app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Model/Convert/Quote.php +4 -8
  9. app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Model/GerarRef.php +32 -27
  10. app/code/local/Lusopay/Lusopaygateway/Model/Mysql4/Setup.php +5 -0
  11. app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Model/PaymentAction.php +2 -2
  12. app/code/local/Lusopay/Lusopaygateway/controllers/CallbackController.php +155 -0
  13. app/code/local/Lusopay/Lusopaygateway/etc/config.xml +142 -0
  14. app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/etc/system.xml +14 -4
  15. app/code/local/Lusopay/Lusopaygateway/sql/lusopaygateway_setup/mysql4-install-2.1.0.php +37 -0
  16. app/code/local/Magnimeios/Magnimeiosgateway/Helper/Data.php +0 -4
  17. app/code/local/Magnimeios/Magnimeiosgateway/Model/Mysql4/Setup.php +0 -6
  18. app/code/local/Magnimeios/Magnimeiosgateway/etc/config.xml +0 -126
  19. app/code/local/Magnimeios/Magnimeiosgateway/sql/magnimeiosgateway_setup/mysql4-install-2.0.0.php +0 -25
  20. app/design/adminhtml/{default/default/template/magnimeiosgateway → base/default/template/lusopaygateway}/form/form.phtml +1 -1
  21. app/design/adminhtml/base/default/template/lusopaygateway/form/mark.phtml +3 -0
  22. app/design/adminhtml/{default/default/template/magnimeiosgateway → base/default/template/lusopaygateway}/info/info.phtml +4 -4
  23. app/design/adminhtml/{default/default/template/magnimeiosgateway → base/default/template/lusopaygateway}/info/pdf/info.phtml +4 -4
  24. app/design/adminhtml/default/default/template/lusopaygateway/form/form.phtml +8 -0
  25. app/design/adminhtml/default/default/template/lusopaygateway/form/mark.phtml +3 -0
  26. app/design/adminhtml/default/default/template/lusopaygateway/info/info.phtml +106 -0
  27. app/design/adminhtml/default/default/template/lusopaygateway/info/pdf/info.phtml +62 -0
  28. app/design/adminhtml/default/default/template/magnimeiosgateway/form/mark.phtml +0 -3
  29. app/design/frontend/base/default/layout/lusopaygateway.xml +8 -0
  30. app/design/frontend/base/default/template/lusopaygateway/checkout/success.phtml +3 -0
  31. app/design/frontend/base/default/template/lusopaygateway/form/form.phtml +8 -0
  32. app/design/frontend/base/default/template/lusopaygateway/form/mark.phtml +3 -0
  33. app/design/frontend/base/default/template/lusopaygateway/info/info.phtml +101 -0
  34. app/design/frontend/base/default/template/magnimeiosgateway/form/form.phtml +0 -7
  35. app/design/frontend/base/default/template/magnimeiosgateway/form/mark.phtml +0 -3
  36. app/design/frontend/base/default/template/magnimeiosgateway/info/info.phtml +0 -90
  37. app/etc/modules/{Magnimeios_Magnimeiosgateway.xml → Lusopay_Lusopaygateway.xml} +2 -2
  38. package.xml +6 -6
  39. skin/adminhtml/{default/default/images/magnimeiosgateway → base/default/images/lusopaygateway}/Logo_Lusopay_256x85px.png +0 -0
  40. skin/adminhtml/{default/default/images/magnimeiosgateway → base/default/images/lusopaygateway}/logo.png +0 -0
  41. skin/adminhtml/default/default/images/lusopaygateway/Logo_Lusopay_256x85px.png +0 -0
  42. skin/adminhtml/default/default/images/lusopaygateway/logo.png +0 -0
  43. skin/frontend/base/default/images/{magnimeiosgateway → lusopaygateway}/Logo_Lusopay_MBePayshop125x80px.png +0 -0
  44. skin/frontend/base/default/images/{magnimeiosgateway → lusopaygateway}/logo.png +0 -0
  45. skin/frontend/default/default/images/lusopaygateway/Logo_Lusopay_MBePayshop125x80px.png +0 -0
  46. skin/frontend/default/default/images/lusopaygateway/logo.png +0 -0
app/code/local/Lusopay/Lusopaygateway/Block/Checkout/Info/LusopayMBPS.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Display the simple and extended part payment monthly fee information
4
+ * if activated in admin. The different display conditions are used in the
5
+ * custom $_template
6
+ */
7
+ class Lusopay_Lusopaygateway_Block_Checkout_Success_Info_LusopayMBPS
8
+ extends Mage_Core_Block_Template
9
+ {
10
+ protected $_template = 'lusopaygateway/checkout/success.phtml';
11
+
12
+ public function getMbInfo()
13
+ {
14
+ return "OIOI";
15
+ }
16
+
17
+ }
app/code/local/Lusopay/Lusopaygateway/Block/Checkout/Success.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Lusopay_Lusopaygateway_Block_Checkout_Success extends Mage_Checkout_Block_Onepage_Success
4
+ {
5
+ protected function _toHtml()
6
+ {
7
+
8
+ $read = Mage::getSingleton( 'core/resource' )->getConnection( 'core_read' ); // To read from the database
9
+
10
+ $order_id = $this->getOrderId();
11
+
12
+ //var_dump($order_id);
13
+
14
+ $query = "SELECT * FROM magnimeiosreferences WHERE id_order = ".$order_id;
15
+
16
+ $result = $read->query($query);
17
+
18
+ while($row=$result->fetch()){
19
+
20
+ $refMB = $row['refMB'];
21
+ $refPS = $row['refPS'];
22
+ $valor= $row['value'];
23
+ }
24
+
25
+ if(!is_null($refMB) || $refMB != -1){
26
+
27
+ $refMB = substr($refMB,0,3).' '.substr($refMB,3,3).' '.substr($refMB,6,3);
28
+
29
+ $tabela ='
30
+ <table cellpadding="3" width="400px" cellspacing="0" style="margin-top: 10px;border: 1px solid #DCDCDC" align="center">
31
+ <tr>
32
+ <td style="font-size: x-small; border-top: 0px; border-left: 0px; border-right: 0px; border-bottom: 1px solid #DCDCDC; background-color: #DCDCDC; color: black" colspan="3"><center>Pagamento por Multibanco (By LUSOPAY)</center></td>
33
+ </tr>
34
+ <tr>
35
+ <td rowspan="4"><img src="http://www.lusopay.pt/imagens/modulos/Logo_Lusopay_MB125x80px.png" alt=""/></td>
36
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Entidade:</td>
37
+ <td style="font-size: x-small; text-align:left">11024</td>
38
+ </tr>
39
+ <tr>
40
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Refer&ecirc;ncia:</td>
41
+ <td style="font-size: x-small; text-align:left">' . $refMB . '</td>
42
+ </tr>
43
+ <tr>
44
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
45
+ <td style="font-size: x-small; text-align:left">' . $valor . '</td>
46
+ </tr>
47
+ <tr>
48
+ <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
49
+ <td style="font-size: x-small; text-align:left">&nbsp;</td>
50
+ </tr>
51
+ <tr>
52
+ <td style="font-size: xx-small;border-top: 1px solid #DCDCDC; border-left: 0px; border-right: 0px; border-bottom: 0px; background-color: #DCDCDC; color: black" colspan="3"><center>O tal&atilde;o emitido pela caixa autom&aacute;tica faz prova de pagamento. Conserve-o.</center></td>
53
+ </tr>
54
+ </table>';
55
+
56
+ }
57
+ if(!is_null($refPS) || $refPS != -1){
58
+
59
+ $refPS = substr($refPS,0,3).' '.substr($refPS,3,3).' '.substr($refPS,6,3).' '.substr($refPS,9,3).' '.substr($refPS,12,1);
60
+
61
+ $tabela.='<table cellpadding="3" width="400px" cellspacing="0" style="margin-top: 10px;border: 1px solid #DCDCDC" align="center">
62
+ <tr>
63
+ <td style="font-size: x-small; border-top: 0px; border-left: 0px; border-right: 0px; border-bottom: 1px solid #DCDCDC; background-color: #DCDCDC; color: black" colspan="3"><center>Pagamento por Payshop (By LUSOPAY)</center></td>
64
+ </tr>
65
+ <tr>
66
+ <td rowspan="4"><img src="http://www.lusopay.pt/imagens/modulos/Logo_Lusopay_Payshop125x80px.png" alt=""/></td>
67
+ </tr>
68
+ <tr>
69
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Refer&ecirc;ncia:</td>
70
+ <td style="font-size: x-small; text-align:left">' . $refPS . '</td>
71
+ </tr>
72
+ <tr>
73
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
74
+ <td style="font-size: x-small; text-align:left">' . $valor . '</td>
75
+ </tr>
76
+ <tr>
77
+ <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
78
+ <td style="font-size: x-small; text-align:left">&nbsp;</td>
79
+ </tr>
80
+ <tr>
81
+ <td style="font-size: xx-small;border-top: 1px solid #DCDCDC; border-left: 0px; border-right: 0px; border-bottom: 0px; background-color: #DCDCDC; color: black" colspan="3"><center>O tal&atilde;o emitido faz prova de pagamento. Conserve-o.</center></td>
82
+ </tr>
83
+ </table>';
84
+ }
85
+
86
+ /*
87
+
88
+ $query = "SELECT * FROM ifthenpay_ifmb_callback WHERE order_id = :order_id";
89
+
90
+ $binds = array(
91
+ 'order_id' => $this->getOrderId()
92
+ );
93
+ $result = $read->query( $query, $binds );
94
+ while ( $row = $result->fetch() ) {
95
+ $ifmbInfo = '<div>
96
+ <br/><br/><h2>' . $this->__('Utilize os dados abaixo para proceder ao pagamento da sua encomenda. Estes dados foram igualmente enviados para o seu email.') . '</h2><br/>
97
+ <table border="0" cellspacing="1" cellpadding="0" style="margin: 0 auto;">
98
+ <tr>
99
+ <td style="padding-bottom: 10px;">
100
+ <img src="' . $this->getSkinUrl('images/ifmb/multibanco_horizontal.gif'). '" border="0" alt="multibanco" title="multibanco" style="width: 100%;"/>
101
+ </td>
102
+ </tr>
103
+ <tr>
104
+ <td>
105
+ <table width="100%" border="0" cellspacing="1" cellpadding="0">
106
+ <tr>
107
+ <td style="text-align: left;">' . $this->__('<strong>Entidade:</strong>') . '</td>
108
+ <td style="text-align: right;">' . $row["entidade"] . '</td>
109
+ </tr>
110
+ <tr>
111
+ <td style="text-align: left;">' . $this->__('<strong>Referência:</strong>') . '</td>
112
+ <td style="text-align: right;padding-left: 10px;">' . $row["referencia"] . '</td>
113
+ </tr>
114
+ <tr>
115
+ <td style="text-align: left;">' . $this->__('<strong>Montante:</strong>') . '</td>
116
+ <td style="text-align: right;">' . $row["valor"] . ' EUR</td>
117
+ </tr>
118
+ </table>
119
+ </td>
120
+ </tr>
121
+ </table></div>';
122
+ }
123
+
124
+ */
125
+ $html = parent::_toHtml();
126
+
127
+ $html .= $tabela;
128
+
129
+
130
+
131
+ return $html;
132
+ }
133
+ }
134
+
135
+ ?>
app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Block/Form.php RENAMED
@@ -1,13 +1,13 @@
1
  <?php
2
- class Magnimeios_Magnimeiosgateway_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('magnimeiosgateway/form/mark.phtml');
9
 
10
- $this->setTemplate('magnimeiosgateway/form/form.phtml')
11
  ->setMethodLabelAfterHtml($mark->toHtml())
12
  ;
13
  parent::_construct();
1
  <?php
2
+ class Lusopay_Lusopaygateway_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('lusopaygateway/form/mark.phtml');
9
 
10
+ $this->setTemplate('lusopaygateway/form/form.phtml')
11
  ->setMethodLabelAfterHtml($mark->toHtml())
12
  ;
13
  parent::_construct();
app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Block/Info.php RENAMED
@@ -1,10 +1,10 @@
1
  <?php
2
- class Magnimeios_Magnimeiosgateway_Block_Info extends Mage_Payment_Block_Info
3
  {
4
  protected function _construct()
5
  {
6
  parent::_construct();
7
- $this->setTemplate('magnimeiosgateway/info/info.phtml');
8
  }
9
 
10
  public function getInfo()
@@ -23,7 +23,7 @@ class Magnimeios_Magnimeiosgateway_Block_Info extends Mage_Payment_Block_Info
23
 
24
  public function toPdf()
25
  {
26
- $this->setTemplate('magnimeiosgateway/info/pdf/info.phtml');
27
  return $this->toHtml();
28
  }
29
  }
1
  <?php
2
+ class Lusopay_Lusopaygateway_Block_Info extends Mage_Payment_Block_Info
3
  {
4
  protected function _construct()
5
  {
6
  parent::_construct();
7
+ $this->setTemplate('lusopaygateway/info/info.phtml');
8
  }
9
 
10
  public function getInfo()
23
 
24
  public function toPdf()
25
  {
26
+ $this->setTemplate('lusopaygateway/info/pdf/info.phtml');
27
  return $this->toHtml();
28
  }
29
  }
app/code/local/Lusopay/Lusopaygateway/Helper/Data.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class Lusopay_Lusopaygateway_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
app/code/local/Lusopay/Lusopaygateway/Model/AtivarCallback.php ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Lusopay_Lusopaygateway_Model_AtivarCallback extends Mage_Core_Model_Config_Data
4
+ {
5
+ public function getCommentText(Mage_Core_Model_Config_Element $element, $currentValue)
6
+ {
7
+ $chave_anti=md5(time());
8
+
9
+ $read = Mage::getSingleton( 'core/resource' )->getConnection( 'core_read' ); // To read from the database
10
+
11
+
12
+ $query = "SELECT * FROM lusopay_config ORDER BY id ASC LIMIT 1";
13
+
14
+ $row = $read->prepare($query);
15
+ $row->execute();
16
+
17
+ if($result = $row->fetch()){
18
+
19
+ $chave_anti = $result['antiphishing'];
20
+ }else{
21
+ $lusopaygateway_save_conn = Mage::getSingleton('core/resource')->getConnection('core_write');
22
+ $lusopaygateway_save_conn->beginTransaction();
23
+ $fields = array();
24
+ $fields['antiphishing'] = $chave_anti;
25
+ $lusopaygateway_save_conn->insert('lusopay_config',$fields);
26
+ $lusopaygateway_save_conn->commit();
27
+ }
28
+
29
+ $skinUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
30
+
31
+ $urlCallback = Mage::getBaseUrl() . 'lusopaygateway/callback/check/entidade/«entidade»/referencia/«referencia»/valor/«valor»/chave/'.$chave_anti;
32
+
33
+
34
+ $result = "<p id='lusopaygateway_callback_info'></p>";
35
+ $result .= "<script type='text/javascript'>
36
+
37
+ function render_callback_info(){
38
+
39
+ var infolusopay = $('lusopaygateway_callback_info');
40
+ var field_value = $('payment_lusopaygateway_active_callback').getValue();
41
+ switch (field_value.toLowerCase())
42
+ {
43
+ case '1':
44
+ infolusopay.innerHTML ='<br/>Foi enviado o pedido de activação do sistema callback para o geral@lusopay.com.';
45
+ ".$this->sendRequest()."
46
+ break;
47
+ case '0':
48
+ infolusopay.innerHTML = 'Ao mudar para \"yes\", será enviado um email a pedir a activação do sistema callback.<br/>Trata-se de um sistema que altera de forma automática e em tempo real,os estados das encomendas para pagos no preciso momento em que o cliente paga a referência e envia a factura.';
49
+ break;
50
+ }
51
+ }
52
+
53
+ function init_comment()
54
+ {
55
+ render_callback_info();
56
+ $('payment_lusopaygateway_active_callback').observe('change', function(){
57
+ render_callback_info();
58
+ });
59
+ }
60
+ document.observe('dom:loaded', function(){init_comment();});
61
+ </script>";
62
+
63
+ return $result;
64
+
65
+ }
66
+
67
+ public function getStatusSendEmail($antiphishing){
68
+
69
+ $read = Mage::getSingleton( 'core/resource' )->getConnection( 'core_read' );
70
+
71
+ $query = "SELECT * FROM lusopay_config WHERE antiphishing= '". $antiphishing."'";
72
+
73
+ $row = $read->prepare($query);
74
+ $row->execute();
75
+
76
+ if ($result = $row->fetch()){
77
+ $sendEmail = $result['sendemail'];
78
+ return $sendEmail;
79
+ }
80
+
81
+ }
82
+
83
+ public function updateSendEmail($antiphishing){
84
+
85
+ $write = Mage::getSingleton('core/resource') -> getConnection('core_write');
86
+
87
+ $query = "UPDATE lusopay_config SET sendemail = 1 WHERE antiphishing='". $antiphishing."'";
88
+ $write->query($query);
89
+
90
+ }
91
+
92
+ public function sendRequest()
93
+ {
94
+ if ($this->getStatusSendEmail($this->getChaveAntiphishing()) == 0 && Mage::getStoreConfig('payment/lusopaygateway/active_callback') == '1')
95
+ {
96
+ $body = "
97
+ <fieldset>
98
+
99
+ Desejo activar o sistema Callback<br/><br/>
100
+ Os meus dados:<br/><br/>
101
+
102
+ NIF: ".Mage::getStoreConfig('payment/lusopaygateway/nif')."<br/><br/>
103
+
104
+ Url do callback:<br/><br/>
105
+
106
+ ".Mage::getBaseUrl() . "lusopaygateway/callback/check/entidade/&laquo;entidade&raquo;/referencia/&laquo;referencia&raquo;/valor/&laquo;valor&raquo;/chave/".$this->getChaveAntiphishing()."<br/><br/>
107
+
108
+ Obrigado.
109
+
110
+ </fieldset>";
111
+ $mail = Mage::getModel('core/email');
112
+ $mail->setToName('LUSOPAY');
113
+ $mail->setToEmail('geral@lusopay.com');
114
+ $mail->setBody($body);
115
+ $mail->setSubject('Activar Callback');
116
+ $mail->setFromEmail(Mage::getStoreConfig('trans_email/ident_general/email'));
117
+ $mail->setFromName(Mage::getStoreConfig('trans_email/ident_general/name'));
118
+ $mail->setType('html');// You can use 'html' or 'text'
119
+
120
+ //var_dump($mail);
121
+
122
+ try {
123
+
124
+ $mail->send();
125
+ $this->updateSendEmail($this->getChaveAntiphishing());
126
+ Mage::getSingleton('core/session')->addSuccess('Pedido enviado com sucesso!');
127
+ //$this->_redirect('');
128
+ }
129
+ catch (Exception $e) {
130
+ Mage::getSingleton('core/session')->addError('Ocorreu um erro ao enviar o pedido!');
131
+ //$this->_redirect('');
132
+ }
133
+ }
134
+
135
+ }
136
+
137
+ public function getChaveAntiphishing(){
138
+ $chave_anti=md5(time());
139
+
140
+ $read = Mage::getSingleton( 'core/resource' )->getConnection( 'core_read' ); // To read from the database
141
+
142
+
143
+ $query = "SELECT * FROM lusopay_config ORDER BY id ASC LIMIT 1";
144
+
145
+ $row = $read->prepare($query);
146
+ $row->execute();
147
+
148
+ if($result = $row->fetch()){
149
+
150
+ $chave_anti = $result['antiphishing'];
151
+ return $chave_anti;
152
+ }else{
153
+ return Mage::throwException(Mage::helper('lusopaygateway')->__('Não foi encontrada nenhuma chave!!'));
154
+ }
155
+ }
156
+
157
+
158
+
159
+
160
+ }
161
+ ?>
app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Model/Convert/Order.php RENAMED
@@ -1,5 +1,5 @@
1
  <?php
2
- class Magnimeios_Magnimeiosgateway_Model_Convert_Order extends Mage_Sales_Model_Convert_Order
3
  {
4
  /**
5
  * Convert order payment to quote payment
@@ -10,12 +10,11 @@ class Magnimeios_Magnimeiosgateway_Model_Convert_Order extends Mage_Sales_Model_
10
  public function paymentToQuotePayment(Mage_Sales_Model_Order_Payment $payment, $quotePayment=null)
11
  {
12
  $quotePayment = parent::paymentToQuotePayment($payment, $quotePayment);
13
-
14
- $quotePayment->setMagnimeiosEntidade($payment->getMagnimeiosEntidade())
15
- ->setMagnimeiosReferencia($payment->getMagnimeiosReferencia())
16
- ->setMagnimeiosMontante($payment->getMagnimeiosMontante());
17
-
18
-
19
  return $quotePayment;
20
  }
21
  }
1
  <?php
2
+ class Lusopay_Lusopaygateway_Model_Convert_Order extends Mage_Sales_Model_Convert_Order
3
  {
4
  /**
5
  * Convert order payment to quote payment
10
  public function paymentToQuotePayment(Mage_Sales_Model_Order_Payment $payment, $quotePayment=null)
11
  {
12
  $quotePayment = parent::paymentToQuotePayment($payment, $quotePayment);
13
+
14
+ $quotePayment->setLusopayEntidade($payment->getLusopayEntidade())
15
+ ->setLusopayReferencia($payment->getLusopayReferencia())
16
+ ->setLusopayMontante($payment->getLusopayMontante());
17
+
 
18
  return $quotePayment;
19
  }
20
  }
app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Model/Convert/Quote.php RENAMED
@@ -1,5 +1,5 @@
1
  <?php
2
- class Magnimeios_Magnimeiosgateway_Model_Convert_Quote extends Mage_Sales_Model_Convert_Quote
3
  {
4
 
5
  /**
@@ -10,14 +10,10 @@ class Magnimeios_Magnimeiosgateway_Model_Convert_Quote extends Mage_Sales_Model_
10
  */
11
  public function paymentToOrderPayment(Mage_Sales_Model_Quote_Payment $payment)
12
  {
13
-
14
  $orderPayment = parent::paymentToOrderPayment($payment);
15
- //$orderPayment->setMagnimeiosEntidade($payment->getMagnimeiosEntidade())
16
- // ->setMagnimeiosReferencia($payment->getMagnimeiosReferencia())
17
- // ->setMagnimeiosMontante($payment->getMagnimeiosMontante());
18
-
19
-
20
-
21
  return $orderPayment;
22
  }
23
 
1
  <?php
2
+ class Lusopay_Lusopaygateway_Model_Convert_Quote extends Mage_Sales_Model_Convert_Quote
3
  {
4
 
5
  /**
10
  */
11
  public function paymentToOrderPayment(Mage_Sales_Model_Quote_Payment $payment)
12
  {
 
13
  $orderPayment = parent::paymentToOrderPayment($payment);
14
+ $orderPayment->setLusopayEntidade($payment->getLusopayEntidade())
15
+ ->setLusopayReferencia($payment->getLusopayReferencia())
16
+ ->setLusopayMontante($payment->getLusopayMontante());
 
 
 
17
  return $orderPayment;
18
  }
19
 
app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Model/GerarRef.php RENAMED
@@ -1,11 +1,11 @@
1
  <?php
2
- class Magnimeios_Magnimeiosgateway_Model_GerarRef extends Mage_Payment_Model_Method_Abstract
3
  {
4
- protected $_code = 'magnimeiosgateway';
5
 
6
- protected $_paymentMethod = 'magnimeiosgateway';
7
- protected $_formBlockType = 'magnimeiosgateway/form';
8
- protected $_infoBlockType = 'magnimeiosgateway/info';
9
  protected $_allowCurrencyCode = array('EUR');
10
 
11
 
@@ -73,9 +73,8 @@ class Magnimeios_Magnimeiosgateway_Model_GerarRef extends Mage_Payment_Model_Met
73
  $update=false;
74
  $order_value = number_format($this -> getQuote() -> getGrandTotal(),2,'.','');
75
 
76
- $chave = $this->getConfigData('chave');
77
- $nif = $this->getConfigData('nif');
78
-
79
 
80
 
81
 
@@ -162,16 +161,19 @@ $ch = curl_init();
162
  $connection->commit();
163
 
164
  $info = $this->getInfoInstance();
165
- $info->setMagnimeiosEntidade("11024")
166
- ->setMagnimeiosReferencia($referencias)
167
- ->setMagnimeiosMontante($order_value);
168
 
169
 
170
  //$this->run("INSERT INTO `magnimeiosreferences`(`id_order`, `refMB`, `refPS`, `value`) VALUES (". $order_id .",'". $refs[2] ."','". $refs[1] ."','". $order_value .")");
171
  }
172
  else {
173
- $referencias = "Error";
174
- }
 
 
 
175
 
176
  }
177
 
@@ -187,17 +189,17 @@ $ch = curl_init();
187
 
188
 
189
  $info = $this->getInfoInstance();
190
- $info->setMagnimeiosEntidade("11024")
191
- ->setMagnimeiosReferencia("<ps>" . $ref[2] . "</ps><mb>". $ref[1] ."</mb>")
192
- ->setMagnimeiosMontante($valor);
193
  }
194
  else
195
  {
196
  //echo "entrou aqui update";
197
  $order_value = number_format($this -> getQuote() -> getGrandTotal(),2,'.','');
198
 
199
- $chave = $this->getConfigData('chave');
200
- $nif = $this->getConfigData('nif');
201
 
202
  $soapUrl = "https://services.lusopay.com/PaymentServices/PaymentServices.svc?wsdl";
203
 
@@ -276,13 +278,16 @@ $ch = curl_init();
276
  $connection->commit();
277
 
278
  $info = $this->getInfoInstance();
279
- $info->setMagnimeiosEntidade("11024")
280
- ->setMagnimeiosReferencia($referencias)
281
- ->setMagnimeiosMontante($order_value);
282
 
283
  }
284
  else {
285
- $referencias = "Error";
 
 
 
286
  }
287
  }
288
 
@@ -298,17 +303,17 @@ $ch = curl_init();
298
  {
299
  parent::validate();
300
  $order_value = number_format($this->getQuote()->getGrandTotal(),2,'.','');
301
-
302
  if ($order_value < 2) {
303
- Mage::throwException(Mage::helper('magnimeiosgateway')->__('Impossível gerar referência MB ou Payshop para valores inferiores a 2 Euro.'));
304
  }
305
-
306
  if ($order_value >= 999999.99) {
307
- Mage::throwException(Mage::helper('magnimeiosgateway')->__('O valor excede o limite para pagamento na rede MB e PS'));
308
  }
309
  $currency_code = $this->getQuote()->getBaseCurrencyCode();
310
  if (!in_array($currency_code,$this->_allowCurrencyCode)) {
311
- Mage::throwException(Mage::helper('magnimeiosgateway')->__('A moeda selecionada ('.$currency_code.') não é compatível com o Pagamento'));
312
  }
313
  return $this;
314
  }
1
  <?php
2
+ class Lusopay_Lusopaygateway_Model_GerarRef extends Mage_Payment_Model_Method_Abstract
3
  {
4
+ protected $_code = 'lusopaygateway';
5
 
6
+ protected $_paymentMethod = 'lusopaygateway';
7
+ protected $_formBlockType = 'lusopaygateway/form';
8
+ protected $_infoBlockType = 'lusopaygateway/info';
9
  protected $_allowCurrencyCode = array('EUR');
10
 
11
 
73
  $update=false;
74
  $order_value = number_format($this -> getQuote() -> getGrandTotal(),2,'.','');
75
 
76
+ $chave = $this->getConfigData('chave');
77
+ $nif = $this->getConfigData('nif');
 
78
 
79
 
80
 
161
  $connection->commit();
162
 
163
  $info = $this->getInfoInstance();
164
+ $info->setLusopayEntidade("11024")
165
+ ->setLusopayReferencia($referencias)
166
+ ->setLusopayMontante($order_value);
167
 
168
 
169
  //$this->run("INSERT INTO `magnimeiosreferences`(`id_order`, `refMB`, `refPS`, `value`) VALUES (". $order_id .",'". $refs[2] ."','". $refs[1] ."','". $order_value .")");
170
  }
171
  else {
172
+ $message = "/<a:message>(.*?)<\/a:message>/s";
173
+ if(preg_match($message,$response,$message_value)) {
174
+ echo $message_value[1];
175
+ }
176
+ }
177
 
178
  }
179
 
189
 
190
 
191
  $info = $this->getInfoInstance();
192
+ $info->setLusopayEntidade("11024")
193
+ ->setLusopayReferencia("<ps>" . $ref[2] . "</ps><mb>". $ref[1] ."</mb>")
194
+ ->setLusopayMontante($valor);
195
  }
196
  else
197
  {
198
  //echo "entrou aqui update";
199
  $order_value = number_format($this -> getQuote() -> getGrandTotal(),2,'.','');
200
 
201
+ $chave = $this->getConfigData('chave');
202
+ $nif = $this->getConfigData('nif');
203
 
204
  $soapUrl = "https://services.lusopay.com/PaymentServices/PaymentServices.svc?wsdl";
205
 
278
  $connection->commit();
279
 
280
  $info = $this->getInfoInstance();
281
+ $info->setLusopayEntidade("11024")
282
+ ->setLusopayReferencia($referencias)
283
+ ->setLusopayMontante($order_value);
284
 
285
  }
286
  else {
287
+ $message = "/<a:message>(.*?)<\/a:message>/s";
288
+ if(preg_match($message,$response,$message_value)) {
289
+ echo $message_value[1];
290
+ }
291
  }
292
  }
293
 
303
  {
304
  parent::validate();
305
  $order_value = number_format($this->getQuote()->getGrandTotal(),2,'.','');
306
+ /*
307
  if ($order_value < 2) {
308
+ Mage::throwException(Mage::helper('lusopaygateway')->__('Impossível gerar referência MB ou Payshop para valores inferiores a 1.2 Euro.'));
309
  }
310
+ */
311
  if ($order_value >= 999999.99) {
312
+ Mage::throwException(Mage::helper('lusopaygateway')->__('O valor excede o limite para pagamento na rede MB e PS'));
313
  }
314
  $currency_code = $this->getQuote()->getBaseCurrencyCode();
315
  if (!in_array($currency_code,$this->_allowCurrencyCode)) {
316
+ Mage::throwException(Mage::helper('lusopaygateway')->__('A moeda selecionada ('.$currency_code.') não é compatível com o Pagamento'));
317
  }
318
  return $this;
319
  }
app/code/local/Lusopay/Lusopaygateway/Model/Mysql4/Setup.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Lusopay_Lusopaygateway_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup
3
+ {
4
+
5
+ }
app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/Model/PaymentAction.php RENAMED
@@ -30,14 +30,14 @@
30
  *
31
  * @author Magento Core Team <core@magentocommerce.com>
32
  */
33
- class Magnimeios_Magnimeiosgateway_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('magnimeiosgateway')->__('Order')
41
  ),
42
  );
43
  }
30
  *
31
  * @author Magento Core Team <core@magentocommerce.com>
32
  */
33
+ class Lusopay_Lusopaygateway_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('lusopaygateway')->__('Order')
41
  ),
42
  );
43
  }
app/code/local/Lusopay/Lusopaygateway/controllers/CallbackController.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Lusopay_Lusopaygateway_CallbackController extends Mage_Core_Controller_Front_Action {
4
+ public function checkAction() {
5
+ $db = Mage::getSingleton('core/resource') -> getConnection('core_write');
6
+ //$read = Mage::getSingleton( 'core/resource' )->getConnection( 'core_read' ); // To read from the database
7
+
8
+ $query = "SELECT * FROM lusopay_config ORDER BY id ASC LIMIT 1";
9
+
10
+ $stmt = $db -> prepare($query);
11
+ $stmt -> execute();
12
+
13
+ $db = Mage::getSingleton('core/resource') -> getConnection('core_read');
14
+
15
+
16
+ if ($result = $stmt -> fetch()) {
17
+ if ($this -> getRequest() -> getParam('chave') == $result['antiphishing']) {
18
+
19
+ $entidade = $this -> getRequest() -> getParam('entidade');
20
+ $ref = $this -> getRequest() -> getParam('referencia');
21
+ //$refPS = $this -> getRequest() -> getParam('ref');
22
+ $valor = $this -> getRequest() -> getParam('valor');
23
+ $valor_final = str_replace(',', '.',$valor);
24
+
25
+ if ($entidade == '11024') {
26
+
27
+ $query = "SELECT * FROM magnimeiosreferences WHERE refMB =" . $ref . " AND value=" . $valor_final . " AND STATUS IS NULL";
28
+
29
+ }
30
+ elseif($entidade == '10120') {
31
+ $refPayshop = $entidade.$ref;
32
+
33
+ $query = "SELECT * FROM magnimeiosreferences where refPS like '%" . $refPayshop . "%' AND value=" . $valor_final . " AND STATUS IS NULL";
34
+
35
+ }
36
+
37
+ //var_dump($query);
38
+
39
+ $result = $db -> query($query);
40
+
41
+ if ($row = $result -> fetch()) {
42
+
43
+ $oid = $row["id_order"];
44
+
45
+ $order = Mage::getModel('sales/order') -> load($oid, 'increment_id');
46
+ $id = $order -> getId();
47
+
48
+ try {
49
+ $invoice = $order -> prepareInvoice();
50
+
51
+ $invoice -> register();
52
+ Mage::getModel('core/resource_transaction') -> addObject($invoice) -> addObject($invoice -> getOrder()) -> save();
53
+
54
+ $invoice -> sendEmail(true, '');
55
+ $order -> setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
56
+ $order -> save();
57
+
58
+ $sql = "UPDATE magnimeiosreferences SET `STATUS` = 'PAGO' WHERE `id_order` = " . $oid;
59
+ $db -> query($sql);
60
+
61
+ echo 'True';
62
+ } catch (Exception $e) {
63
+ print_r($e);
64
+ echo 'False';
65
+ }
66
+
67
+ } else {
68
+ echo 'False';
69
+ }
70
+
71
+ } else {
72
+ echo 'False';
73
+ }
74
+
75
+ } else {
76
+ echo 'False';
77
+ }
78
+
79
+ /*
80
+
81
+ $query = "SELECT * FROM ifthenpay_ifmb_config ORDER BY id ASC LIMIT 1";
82
+
83
+ $stmt = $db->prepare($query);
84
+ $stmt->execute();
85
+
86
+ if ($result = $stmt->fetch()) {
87
+ if( $this->getRequest()->getParam('key') == $result["antiphishing"]){
88
+
89
+ //$order = Mage::getModel('sales/order')->load($incrementId, 'increment_id');
90
+ //$id = $order->getId();
91
+ $entidade = $this->getRequest()->getParam('entidade');
92
+ $referencia = $this->getRequest()->getParam('referencia');
93
+ $valor = number_format($this->getRequest()->getParam('valor'),2);
94
+
95
+ $db = Mage::getSingleton( 'core/resource' )->getConnection( 'core_read' ); // To read from the database
96
+
97
+ $query = "SELECT * FROM ifthenpay_ifmb_callback WHERE entidade=:entidade and referencia_sem_espacos=:referencia and valor=:valor and check_mb is null ORDER BY id DESC LIMIT 1";
98
+
99
+ $binds = array(
100
+ 'entidade' => $entidade,
101
+ 'referencia' => $referencia,
102
+ 'valor' => $valor
103
+ );
104
+
105
+ $result = $db->query( $query, $binds );
106
+
107
+ if($row = $result->fetch()){
108
+ $oid = $row["order_id"];
109
+
110
+ $order = Mage::getModel('sales/order')->load($oid, 'increment_id');
111
+ $id = $order->getId();
112
+
113
+ try {
114
+ $invoice = $order->prepareInvoice();
115
+
116
+ $invoice->register();
117
+ Mage::getModel('core/resource_transaction')
118
+ ->addObject($invoice)
119
+ ->addObject($invoice->getOrder())
120
+ ->save();
121
+
122
+ $invoice->sendEmail(true, '');
123
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
124
+ $order->save();
125
+
126
+ $sql = "UPDATE ifthenpay_ifmb_callback SET `check_mb` = 'done' WHERE `order_id` = ".$oid;
127
+ $db->query($sql);
128
+
129
+ echo "Check Callback Done";
130
+ }
131
+ catch (Exception $e) {
132
+ print_r($e);
133
+ echo 'error';
134
+ }
135
+ }
136
+ else
137
+ {
138
+ //Pagamento não encontrado
139
+ echo "ERRO P404";
140
+ }
141
+ }
142
+ else
143
+ {
144
+ //Chave Anti-Phishing Inválida
145
+ echo "ERRO K203";
146
+ }
147
+ }else{
148
+ //Chave Anti-Phishing não configurada. Tem de Activar primeiro o Callback.
149
+ echo "ERRO K404";
150
+ }
151
+ */
152
+ }
153
+
154
+ }
155
+ ?>
app/code/local/Lusopay/Lusopaygateway/etc/config.xml ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Lusopay_Lusopaygateway>
5
+ <version>2.1.0</version>
6
+ </Lusopay_Lusopaygateway>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <routeurfrontend>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Lusopay_Lusopaygateway</module>
14
+ <frontName>lusopaygateway</frontName>
15
+ </args>
16
+ </routeurfrontend>
17
+ </routers>
18
+ <translate>
19
+ <modules>
20
+ <Lusopay_Lusopaygateway>
21
+ <files>
22
+ <default>Lusopay_Lusopaygateway.csv</default>
23
+ </files>
24
+ </Lusopay_Lusopaygateway>
25
+ </modules>
26
+ </translate>
27
+ </frontend>
28
+ <adminhtml>
29
+ <translate>
30
+ <modules>
31
+ <Lusopay_Lusopaygateway>
32
+ <files>
33
+ <default>Lusopay_Lusopaygateway.csv</default>
34
+ </files>
35
+ </Lusopay_Lusopaygateway>
36
+ </modules>
37
+ </translate>
38
+ </adminhtml>
39
+ <global>
40
+ <fieldsets>
41
+ <sales_convert_quote_payment>
42
+ <lusopay_entidade><to_order_payment>*</to_order_payment></lusopay_entidade>
43
+ <lusopay_referencia><to_order_payment>*</to_order_payment></lusopay_referencia>
44
+ <lusopay_montante><to_order_payment>*</to_order_payment></lusopay_montante>
45
+ </sales_convert_quote_payment>
46
+
47
+ <sales_convert_order_payment>
48
+ <lusopay_entidade><to_quote_payment>*</to_quote_payment></lusopay_entidade>
49
+ <lusopay_referencia><to_quote_payment>*</to_quote_payment></lusopay_referencia>
50
+ <lusopay_montante><to_quote_payment>*</to_quote_payment></lusopay_montante>
51
+ </sales_convert_order_payment>
52
+ </fieldsets>
53
+ <models>
54
+ <lusopaygateway>
55
+ <class>Lusopay_Lusopaygateway_Model</class>
56
+ <resourceModel>lusopaygateway_mysql4</resourceModel>
57
+ </lusopaygateway>
58
+ <sales>
59
+ <rewrite>
60
+ <convert_order>Lusopay_Lusopaygateway_Model_Convert_Order</convert_order>
61
+ <convert_quote>Lusopay_Lusopaygateway_Model_Convert_Quote</convert_quote>
62
+ </rewrite>
63
+ </sales>
64
+ <lusopaygateway_mysql4>
65
+ <class>Lusopay_Lusopaygateway_Model_Mysql4</class>
66
+ <entities>
67
+ <lusopaygateway>
68
+ <table>magnimeiosreferences</table>
69
+ </lusopaygateway>
70
+ </entities>
71
+ </lusopaygateway_mysql4>
72
+ </models>
73
+ <resources>
74
+ <lusopaygateway_setup>
75
+ <setup>
76
+ <module>Lusopay_Lusopaygateway</module>
77
+ <class>Lusopay_Lusopaygateway_Model_Mysql4_Setup</class>
78
+ </setup>
79
+ <connection>
80
+ <use>core_setup</use>
81
+ </connection>
82
+ </lusopaygateway_setup>
83
+ <lusopaygateway_write>
84
+ <connection>
85
+ <use>core_write</use>
86
+ </connection>
87
+ </lusopaygateway_write>
88
+ <lusopaygateway_read>
89
+ <connection>
90
+ <use>core_read</use>
91
+ </connection>
92
+ </lusopaygateway_read>
93
+ </resources>
94
+ <blocks>
95
+ <lusopaygateway>
96
+ <class>Lusopay_Lusopaygateway_Block</class>
97
+ </lusopaygateway>
98
+ <checkout>
99
+ <rewrite>
100
+ <onepage_success>Lusopay_Lusopaygateway_Block_Checkout_Success</onepage_success>
101
+ </rewrite>
102
+ </checkout>
103
+ </blocks>
104
+ <helpers>
105
+ <lusopaygateway>
106
+ <class>Lusopay_Lusopaygateway_Helper</class>
107
+ </lusopaygateway>
108
+ </helpers>
109
+ <sales>
110
+ <order>
111
+ <statuses>
112
+ <aguarda_pagamento_lusopaygateway translate="label"><label><![CDATA[MB - Aguarda Pagamento Multibanco / Payshop]]></label></aguarda_pagamento_lusopaygateway>
113
+ </statuses>
114
+ <states>
115
+ <new>
116
+ <statuses>
117
+ <aguarda_pagamento_lusopaygateway/>
118
+ </statuses>
119
+ </new>
120
+ </states>
121
+ </order>
122
+ </sales>
123
+ </global>
124
+ <default>
125
+ <payment>
126
+ <lusopaygateway>
127
+ <active>0</active>
128
+ <model>lusopaygateway/gerarRef</model>
129
+ <title>Multibanco / Payshop (by LUSOPAY)</title>
130
+ <sort_order>1</sort_order>
131
+ <order_status>pending</order_status>
132
+ <allowspecific>1</allowspecific>
133
+ <specificcountry>PT</specificcountry>
134
+ <chave></chave>
135
+ <nif></nif>
136
+ <mensagem></mensagem>
137
+ <payment_action>order</payment_action>
138
+ <active_callback>0</active_callback>
139
+ </lusopaygateway>
140
+ </payment>
141
+ </default>
142
+ </config>
app/code/local/{Magnimeios/Magnimeiosgateway → Lusopay/Lusopaygateway}/etc/system.xml RENAMED
@@ -3,8 +3,8 @@
3
  <sections>
4
  <payment>
5
  <groups>
6
- <magnimeiosgateway translate="label" module="payment">
7
- <label><![CDATA[Pagamentos por Multibanco e / ou Payshop (by LUSOPAY)]]></label>
8
  <frontend_type>text</frontend_type>
9
  <sort_order>1</sort_order>
10
  <show_in_default>1</show_in_default>
@@ -87,17 +87,27 @@
87
  <show_in_website>1</show_in_website>
88
  <show_in_store>1</show_in_store>
89
  </specificcountry>
 
 
 
 
 
 
 
 
 
 
90
  <payment_action translate="label">
91
  <label>Payment Action</label>
92
  <frontend_type>select</frontend_type>
93
- <source_model>magnimeiosgateway/paymentAction</source_model>
94
  <sort_order>20</sort_order>
95
  <show_in_default>0</show_in_default>
96
  <show_in_website>0</show_in_website>
97
  <show_in_store>0</show_in_store>
98
  </payment_action>
99
  </fields>
100
- </magnimeiosgateway>
101
  </groups>
102
  </payment>
103
  </sections>
3
  <sections>
4
  <payment>
5
  <groups>
6
+ <lusopaygateway translate="label" module="payment">
7
+ <label><![CDATA[LUSOPAY - Pagamentos por Refer&ecirc;ncias Multibanco e / ou Payshop]]></label>
8
  <frontend_type>text</frontend_type>
9
  <sort_order>1</sort_order>
10
  <show_in_default>1</show_in_default>
87
  <show_in_website>1</show_in_website>
88
  <show_in_store>1</show_in_store>
89
  </specificcountry>
90
+ <active_callback translate="label">
91
+ <label><![CDATA[Ativar Callback]]></label>
92
+ <frontend_type>select</frontend_type>
93
+ <source_model>adminhtml/system_config_source_yesno</source_model>
94
+ <sort_order>50</sort_order>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ <show_in_store>1</show_in_store>
98
+ <comment><model>lusopaygateway/AtivarCallback</model></comment>
99
+ </active_callback>
100
  <payment_action translate="label">
101
  <label>Payment Action</label>
102
  <frontend_type>select</frontend_type>
103
+ <source_model>lusopaygateway/paymentAction</source_model>
104
  <sort_order>20</sort_order>
105
  <show_in_default>0</show_in_default>
106
  <show_in_website>0</show_in_website>
107
  <show_in_store>0</show_in_store>
108
  </payment_action>
109
  </fields>
110
+ </lusopaygateway>
111
  </groups>
112
  </payment>
113
  </sections>
app/code/local/Lusopay/Lusopaygateway/sql/lusopaygateway_setup/mysql4-install-2.1.0.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+ //$installer->run("CREATE TABLE IF NOT EXISTS `lusopayreferences` (`id` int(11) NOT NULL AUTO_INCREMENT, `order_id` int(22) NOT NULL, `entidade` int(11) NOT NULL, `referencia` varchar(11) NOT NULL, `referencia_sem_espacos` varchar(9) NOT NULL, `valor` decimal(10,2) NOT NULL, `check_mb` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`))");
7
+
8
+ if ($installer->getConnection()->showTableStatus('magnimeiosreferences')){
9
+ $installer->startSetup();
10
+ $installer->getConnection()->addColumn($installer->getTable('magnimeiosreferences'), 'status', 'VARCHAR(10)');
11
+ $installer->endSetup();
12
+ }else{
13
+ $installer->startSetup();
14
+ $installer->run("CREATE TABLE IF NOT EXISTS `magnimeiosreferences` (id_order int, refMB VARCHAR(9), refPS VARCHAR(13), value VARCHAR(10), status VARCHAR(10))");
15
+ $installer->endSetup();
16
+ }
17
+
18
+ //$installer->run("CREATE TABLE IF NOT EXISTS `lusopayreferences` (id_order int, refMB VARCHAR(9), refPS VARCHAR(13), value VARCHAR(10), status VARCHAR(10))");
19
+
20
+ $installer->run("CREATE TABLE IF NOT EXISTS `lusopay_config` (`id` int(11) NOT NULL AUTO_INCREMENT, `antiphishing` varchar(50) DEFAULT NULL, `sendemail` tinyint(1) NOT NULL, PRIMARY KEY (`id`))");
21
+
22
+ $installer->addAttribute('order_payment', 'lusopay_entidade', array('type'=>'varchar'));
23
+ $installer->addAttribute('order_payment', 'lusopay_referencia', array('type'=>'varchar'));
24
+ $installer->addAttribute('order_payment', 'lusopay_montante', array('type'=>'varchar'));
25
+
26
+ $installer->addAttribute('quote_payment', 'lusopay_entidade', array('type'=>'varchar'));
27
+ $installer->addAttribute('quote_payment', 'lusopay_referencia', array('type'=>'varchar'));
28
+ $installer->addAttribute('quote_payment', 'lusopay_montante', array('type'=>'varchar'));
29
+ $installer->endSetup();
30
+
31
+ if (Mage::getVersion() >= 1.1) {
32
+ $installer->startSetup();
33
+ $installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'lusopay_entidade', 'VARCHAR(255) NOT NULL');
34
+ $installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'lusopay_referencia', 'VARCHAR(255) NOT NULL');
35
+ $installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'lusopay_montante', 'VARCHAR(255) NOT NULL');
36
+ $installer->endSetup();
37
+ }
app/code/local/Magnimeios/Magnimeiosgateway/Helper/Data.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
- class Magnimeios_Magnimeiosgateway_Helper_Data extends Mage_Core_Helper_Abstract
3
- {
4
- }
 
 
 
 
app/code/local/Magnimeios/Magnimeiosgateway/Model/Mysql4/Setup.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- class Magnimeios_Magnimeiosgateway_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup
3
- {
4
-
5
-
6
- }
 
 
 
 
 
 
app/code/local/Magnimeios/Magnimeiosgateway/etc/config.xml DELETED
@@ -1,126 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Magnimeios_Magnimeiosgateway>
5
- <version>2.0.0</version>
6
- </Magnimeios_Magnimeiosgateway>
7
- </modules>
8
- <frontend>
9
- <translate>
10
- <modules>
11
- <Magnimeios_Magnimeiosgateway>
12
- <files>
13
- <default>Magnimeios_Magnimeiosgateway.csv</default>
14
- </files>
15
- </Magnimeios_Magnimeiosgateway>
16
- </modules>
17
- </translate>
18
- </frontend>
19
- <adminhtml>
20
- <translate>
21
- <modules>
22
- <Magnimeios_Magnimeiosgateway>
23
- <files>
24
- <default>Magnimeios_Magnimeiosgateway.csv</default>
25
- </files>
26
- </Magnimeios_Magnimeiosgateway>
27
- </modules>
28
- </translate>
29
- </adminhtml>
30
- <global>
31
- <fieldsets>
32
- <sales_convert_quote_payment>
33
- <magnimeios_entidade><to_order_payment>*</to_order_payment></magnimeios_entidade>
34
- <magnimeios_referencia><to_order_payment>*</to_order_payment></magnimeios_referencia>
35
- <magnimeios_montante><to_order_payment>*</to_order_payment></magnimeios_montante>
36
- </sales_convert_quote_payment>
37
-
38
- <sales_convert_order_payment>
39
- <magnimeios_entidade><to_quote_payment>*</to_quote_payment></magnimeios_entidade>
40
- <magnimeios_referencia><to_quote_payment>*</to_quote_payment></magnimeios_referencia>
41
- <magnimeios_montante><to_quote_payment>*</to_quote_payment></magnimeios_montante>
42
- </sales_convert_order_payment>
43
- </fieldsets>
44
- <models>
45
- <magnimeiosgateway>
46
- <class>Magnimeios_Magnimeiosgateway_Model</class>
47
- <resourceModel>magnimeiosgateway_mysql4</resourceModel>
48
- </magnimeiosgateway>
49
- <sales>
50
- <rewrite>
51
- <convert_order>Magnimeios_Magnimeiosgateway_Model_Convert_Order</convert_order>
52
- <convert_quote>Magnimeios_Magnimeiosgateway_Model_Convert_Quote</convert_quote>
53
- </rewrite>
54
- </sales>
55
- <magnimeiosgateway_mysql4>
56
- <class>Magnimeios_Magnimeiosgateway_Model_Mysql4</class>
57
- <entities>
58
- <magnimeiosgateway>
59
- <table>magnimeiosreferences</table>
60
- </magnimeiosgateway>
61
- </entities>
62
- </magnimeiosgateway_mysql4>
63
- </models>
64
- <resources>
65
- <magnimeiosgateway_setup>
66
- <setup>
67
- <module>Magnimeios_Magnimeiosgateway</module>
68
- <class>Magnimeios_Magnimeiosgateway_Model_Mysql4_Setup</class>
69
- </setup>
70
- <connection>
71
- <use>core_setup</use>
72
- </connection>
73
- </magnimeiosgateway_setup>
74
- <magnimeiosgateway_write>
75
- <connection>
76
- <use>core_write</use>
77
- </connection>
78
- </magnimeiosgateway_write>
79
- <magnimeiosgateway_read>
80
- <connection>
81
- <use>core_read</use>
82
- </connection>
83
- </magnimeiosgateway_read>
84
- </resources>
85
- <blocks>
86
- <magnimeiosgateway>
87
- <class>Magnimeios_Magnimeiosgateway_Block</class>
88
- </magnimeiosgateway>
89
- </blocks>
90
- <helpers>
91
- <magnimeiosgateway>
92
- <class>Magnimeios_Magnimeiosgateway_Helper</class>
93
- </magnimeiosgateway>
94
- </helpers>
95
- <sales>
96
- <order>
97
- <statuses>
98
- <aguarda_pagamento_magnimeiosgateway translate="label"><label><![CDATA[MB - Aguarda Pagamento]]></label></aguarda_pagamento_magnimeiosgateway>
99
- </statuses>
100
- <states>
101
- <new>
102
- <statuses>
103
- <aguarda_pagamento_magnimeiosgateway/>
104
- </statuses>
105
- </new>
106
- </states>
107
- </order>
108
- </sales>
109
- </global>
110
- <default>
111
- <payment>
112
- <magnimeiosgateway>
113
- <active>0</active>
114
- <model>magnimeiosgateway/gerarRef</model>
115
- <title>Pagamento por Multibanco e / ou Payshop (by LUSOPAY)</title>
116
- <sort_order>1</sort_order>
117
- <allowspecific>0</allowspecific>
118
- <chave></chave>
119
- <nif></nif>
120
- <order_status>pending</order_status>
121
- <mensagem>Pagamento por Multibanco e / ou Payshop</mensagem>
122
- <payment_action>order</payment_action>
123
- </magnimeiosgateway>
124
- </payment>
125
- </default>
126
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Magnimeios/Magnimeiosgateway/sql/magnimeiosgateway_setup/mysql4-install-2.0.0.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- $installer = $this;
3
-
4
- $installer->startSetup();
5
-
6
- $installer->run("CREATE TABLE IF NOT EXISTS `magnimeiosreferences` (id_order int, refMB VARCHAR(9), refPS VARCHAR(13), value VARCHAR(10))");
7
-
8
-
9
- $installer->addAttribute('order_payment', 'magnimeios_entidade', array('type'=>'varchar'));
10
- $installer->addAttribute('order_payment', 'magnimeios_referencia', array('type'=>'varchar'));
11
- $installer->addAttribute('order_payment', 'magnimeios_montante', array('type'=>'varchar'));
12
-
13
- $installer->addAttribute('quote_payment', 'magnimeios_entidade', array('type'=>'varchar'));
14
- $installer->addAttribute('quote_payment', 'magnimeios_referencia', array('type'=>'varchar'));
15
- $installer->addAttribute('quote_payment', 'magnimeios_montante', array('type'=>'varchar'));
16
-
17
- $installer->endSetup();
18
-
19
- if (Mage::getVersion() >= 1.1) {
20
- $installer->startSetup();
21
- $installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'magnimeios_entidade', 'VARCHAR(255) NOT NULL');
22
- $installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'magnimeios_referencia', 'VARCHAR(255) NOT NULL');
23
- $installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'magnimeios_montante', 'VARCHAR(255) NOT NULL');
24
- $installer->endSetup();
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/{default/default/template/magnimeiosgateway → base/default/template/lusopaygateway}/form/form.phtml RENAMED
@@ -1,6 +1,6 @@
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/magnimeiosgateway/Logo_Lusopay_256x85px.png') ?>" border="0" /></li>
4
  <?php if ($this->getMethod()->getMensagem()): ?>
5
  <?php echo '<li>' . $this->getMethod()->getMensagem() . '</li>'; ?>
6
  <?php endif; ?>
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/lusopaygateway/Logo_Lusopay_256x85px.png') ?>" border="0" /></li>
4
  <?php if ($this->getMethod()->getMensagem()): ?>
5
  <?php echo '<li>' . $this->getMethod()->getMensagem() . '</li>'; ?>
6
  <?php endif; ?>
app/design/adminhtml/base/default/template/lusopaygateway/form/mark.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <!-- MB Logo -->
2
+ <img src="<?php echo $this->getSkinUrl('images/lusopaygateway/logo.png') ?>" class="v-middle" />
3
+ <!-- MB Logo -->
app/design/adminhtml/{default/default/template/magnimeiosgateway → base/default/template/lusopaygateway}/info/info.phtml RENAMED
@@ -1,7 +1,7 @@
1
 
2
  <?php
3
  //Get Referencias
4
- $referencias = $this->htmlEscape($this->getInfo()->getMagnimeiosReferencia());
5
 
6
  if(!is_null($referencias)){
7
 
@@ -47,7 +47,7 @@
47
  <tr>
48
  <td rowspan="4"><div align="center"><img src="https://www.lusopay.com/App_Files/cms/documents/images/Logo_Lusopay_MB125x80px.png" alt=""></div></td>
49
  <td style="font-size: x-small; font-weight:bold; text-align:left">Entidade:</td>
50
- <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosEntidade()) ?></span></td>
51
  </tr>
52
  <tr>
53
  <td style="font-size: x-small; font-weight:bold; text-align:left">Referência:</td>
@@ -55,7 +55,7 @@
55
  </tr>
56
  <tr>
57
  <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
58
- <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosMontante()) . ' EUR' ?></span></td>
59
  </tr>
60
  <tr>
61
  <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
@@ -83,7 +83,7 @@
83
  </tr>
84
  <tr>
85
  <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
86
- <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosMontante()) . ' EUR' ?></span></td>
87
  </tr>
88
  <tr>
89
  <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
1
 
2
  <?php
3
  //Get Referencias
4
+ $referencias = $this->htmlEscape($this->getInfo()->getLusopayReferencia());
5
 
6
  if(!is_null($referencias)){
7
 
47
  <tr>
48
  <td rowspan="4"><div align="center"><img src="https://www.lusopay.com/App_Files/cms/documents/images/Logo_Lusopay_MB125x80px.png" alt=""></div></td>
49
  <td style="font-size: x-small; font-weight:bold; text-align:left">Entidade:</td>
50
+ <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getLusopayEntidade()) ?></span></td>
51
  </tr>
52
  <tr>
53
  <td style="font-size: x-small; font-weight:bold; text-align:left">Referência:</td>
55
  </tr>
56
  <tr>
57
  <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
58
+ <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getLusopayMontante()) . ' EUR' ?></span></td>
59
  </tr>
60
  <tr>
61
  <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
83
  </tr>
84
  <tr>
85
  <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
86
+ <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getLusopayMontante()) . ' EUR' ?></span></td>
87
  </tr>
88
  <tr>
89
  <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
app/design/adminhtml/{default/default/template/magnimeiosgateway → base/default/template/lusopaygateway}/info/pdf/info.phtml RENAMED
@@ -1,6 +1,6 @@
1
 
2
  <?php
3
- $referencias = $this->htmlEscape($this->getInfo()->getMagnimeiosReferencia());
4
 
5
  if(!is_null($referencias)){
6
  $re1='.*?'; # Non-greedy match on filler
@@ -40,11 +40,11 @@
40
  {{pdf_row_separator}}
41
  Pagamento por Multibanco (By LUSOPAY)
42
  {{pdf_row_separator}}
43
- Entidade: <?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosEntidade()) ?>
44
  {{pdf_row_separator}}
45
  Referência: <?php echo $int2 ?>
46
  {{pdf_row_separator}}
47
- Valor: <?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosMontante()) . ' EUR' ?>
48
  {{pdf_row_separator}}
49
  {{pdf_row_separator}}
50
  {{pdf_row_separator}}
@@ -53,7 +53,7 @@
53
 
54
  Referência: <?php echo $int1 ?>
55
  {{pdf_row_separator}}
56
- Valor: <?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosMontante()) . ' EUR' ?>
57
 
58
 
59
  <?php }
1
 
2
  <?php
3
+ $referencias = $this->htmlEscape($this->getInfo()->getLusopayReferencia());
4
 
5
  if(!is_null($referencias)){
6
  $re1='.*?'; # Non-greedy match on filler
40
  {{pdf_row_separator}}
41
  Pagamento por Multibanco (By LUSOPAY)
42
  {{pdf_row_separator}}
43
+ Entidade: <?php echo $this->htmlEscape($this->getInfo()->getLusopayEntidade()) ?>
44
  {{pdf_row_separator}}
45
  Referência: <?php echo $int2 ?>
46
  {{pdf_row_separator}}
47
+ Valor: <?php echo $this->htmlEscape($this->getInfo()->getLusopayMontante()) . ' EUR' ?>
48
  {{pdf_row_separator}}
49
  {{pdf_row_separator}}
50
  {{pdf_row_separator}}
53
 
54
  Referência: <?php echo $int1 ?>
55
  {{pdf_row_separator}}
56
+ Valor: <?php echo $this->htmlEscape($this->getInfo()->getLusopayMontante()) . ' EUR' ?>
57
 
58
 
59
  <?php }
app/design/adminhtml/default/default/template/lusopaygateway/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/lusopaygateway/Logo_Lusopay_256x85px.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/lusopaygateway/form/mark.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <!-- MB Logo -->
2
+ <img src="<?php echo $this->getSkinUrl('images/lusopaygateway/logo.png') ?>" class="v-middle" />
3
+ <!-- MB Logo -->
app/design/adminhtml/default/default/template/lusopaygateway/info/info.phtml ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+ //Get Referencias
4
+ $referencias = $this->htmlEscape($this->getInfo()->getLusopayReferencia());
5
+
6
+ if(!is_null($referencias)){
7
+
8
+ $re1='.*?'; # Non-greedy match on filler
9
+ $re2='(\\d+)'; # Integer Number 1
10
+ $re3='.*?'; # Non-greedy match on filler
11
+ $re4='(\\d+)'; # Integer Number 2
12
+
13
+ if ($c=preg_match_all ("/".$re1.$re2.$re3.$re4."/is", $referencias, $matches))
14
+ {
15
+ $int1=$matches[1][0];
16
+ $int2=$matches[2][0];
17
+ }
18
+
19
+ if ($int1 == '1'){
20
+ $showPS = 'display:none;';
21
+ $int1='';
22
+ }
23
+ else{
24
+ $showPS = '';
25
+ $int1 = substr($int1,0,3).' '.substr($int1,3,3).' '.substr($int1,6,3).' '.substr($int1,9,3).' '.substr($int1,12,1);
26
+ }
27
+
28
+ if ($int2 == '1'){
29
+ $showMB = 'display:none;';
30
+ $int2='';
31
+ }
32
+ else{
33
+ $showMB = '';
34
+ $int2 = substr($int2,0,3).' '.substr($int2,3,3).' '.substr($int2,6,3);
35
+ }
36
+
37
+
38
+ ?>
39
+
40
+
41
+
42
+ <div align="center">
43
+ <table cellpadding="3" width="400px" cellspacing="0" style="margin-top: 10px;border: 1px solid #DCDCDC;<?php echo $showMB;?>">
44
+ <tbody><tr>
45
+ <td style="font-size: x-small; border-bottom: 1px solid #DCDCDC; background-color: #DCDCDC; color: Black" colspan="3"><center>Pagamento por Multibanco (By LUSOPAY)</center></td>
46
+ </tr>
47
+ <tr>
48
+ <td rowspan="4"><div align="center"><img src="https://www.lusopay.com/App_Files/cms/documents/images/Logo_Lusopay_MB125x80px.png" alt=""></div></td>
49
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Entidade:</td>
50
+ <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getLusopayEntidade()) ?></span></td>
51
+ </tr>
52
+ <tr>
53
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Referência:</td>
54
+ <td style="font-size: x-small; text-align:left"><span><?php echo $int2 ?></span></td>
55
+ </tr>
56
+ <tr>
57
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
58
+ <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getLusopayMontante()) . ' EUR' ?></span></td>
59
+ </tr>
60
+ <tr>
61
+ <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
62
+ <td style="font-size: x-small; text-align:left">&nbsp;</td>
63
+ </tr>
64
+ <tr>
65
+ <td style="font-size: xx-small;border-top: 1px solid #DCDCDC; background-color: #DCDCDC; color: Black" colspan="3"><center>O tal&atilde;o emitido pela caixa autom&aacute;tica faz prova de pagamento. Conserve-o.</center></td>
66
+ </tr>
67
+ </tbody></table>
68
+
69
+
70
+
71
+
72
+ <table cellpadding="3" width="400px" cellspacing="0" style="margin-top: 10px;border: 1px solid #DCDCDC;<?php echo $showPS;?>">
73
+ <tbody>
74
+ <tr>
75
+ <td style="font-size: x-small; border-bottom: 1px solid #DCDCDC; background-color: #DCDCDC; color: Black" colspan="3"><center>Pagamento por Payshop (By LUSOPAY)</center></td>
76
+ </tr>
77
+ <tr>
78
+ <td rowspan="4"><div align="center"><img src="https://www.lusopay.com/App_Files/cms/documents/images/Logo_Lusopay_Payshop125x80px.png" alt=""></div></td>
79
+ </tr>
80
+ <tr>
81
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Referência:</td>
82
+ <td style="font-size: x-small; text-align:left"><span><?php echo $int1 ?></span></td>
83
+ </tr>
84
+ <tr>
85
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
86
+ <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getLusopayMontante()) . ' EUR' ?></span></td>
87
+ </tr>
88
+ <tr>
89
+ <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
90
+ <td style="font-size: x-small; text-align:left">&nbsp;</td>
91
+ </tr>
92
+ <tr>
93
+ <td style="font-size: xx-small;border-top: 1px solid #DCDCDC; background-color: #DCDCDC; color: Black" colspan="3"><center>O tal&atilde;o emitido faz prova de pagamento. Conserve-o.</center></td>
94
+ </tr>
95
+ </tbody></table>
96
+
97
+ </div>
98
+
99
+ <?php }
100
+ else{
101
+ echo "A geração da referencia falhou";
102
+ }
103
+
104
+
105
+
106
+
app/design/adminhtml/default/default/template/lusopaygateway/info/pdf/info.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+ $referencias = $this->htmlEscape($this->getInfo()->getLusopayReferencia());
4
+
5
+ if(!is_null($referencias)){
6
+ $re1='.*?'; # Non-greedy match on filler
7
+ $re2='(\\d+)'; # Integer Number 1
8
+ $re3='.*?'; # Non-greedy match on filler
9
+ $re4='(\\d+)'; # Integer Number 2
10
+
11
+ if ($c=preg_match_all ("/".$re1.$re2.$re3.$re4."/is", $referencias, $matches))
12
+ {
13
+ $int1=$matches[1][0];
14
+ $int2=$matches[2][0];
15
+ }
16
+
17
+ if ($int1 == '1'){
18
+ $showPS = 'display:none;';
19
+ $int1='';
20
+ }
21
+ else{
22
+ $showPS = '';
23
+ $int1 = substr($int1,0,3).' '.substr($int1,3,3).' '.substr($int1,6,3).' '.substr($int1,9,3).' '.substr($int1,12,1);
24
+ }
25
+
26
+ if ($int2 == '1'){
27
+ $showMB = 'display:none;';
28
+ $int2='';
29
+ }
30
+ else{
31
+ $showMB = '';
32
+ $int2 = substr($int2,0,3).' '.substr($int2,3,3).' '.substr($int2,6,3);
33
+ }
34
+
35
+
36
+ ?>
37
+
38
+ <?php echo $this->escapeHtml($this->getMethod()->getTitle()) ?>
39
+ {{pdf_row_separator}}
40
+ {{pdf_row_separator}}
41
+ Pagamento por Multibanco (By LUSOPAY)
42
+ {{pdf_row_separator}}
43
+ Entidade: <?php echo $this->htmlEscape($this->getInfo()->getLusopayEntidade()) ?>
44
+ {{pdf_row_separator}}
45
+ Referência: <?php echo $int2 ?>
46
+ {{pdf_row_separator}}
47
+ Valor: <?php echo $this->htmlEscape($this->getInfo()->getLusopayMontante()) . ' EUR' ?>
48
+ {{pdf_row_separator}}
49
+ {{pdf_row_separator}}
50
+ {{pdf_row_separator}}
51
+ Pagamento por Payshop (by LUSOPAY)
52
+ {{pdf_row_separator}}
53
+
54
+ Referência: <?php echo $int1 ?>
55
+ {{pdf_row_separator}}
56
+ Valor: <?php echo $this->htmlEscape($this->getInfo()->getLusopayMontante()) . ' EUR' ?>
57
+
58
+
59
+ <?php }
60
+ else{
61
+ echo "A geração da referencia falhou";
62
+ }
app/design/adminhtml/default/default/template/magnimeiosgateway/form/mark.phtml DELETED
@@ -1,3 +0,0 @@
1
- <!-- Magnimeios Logo -->
2
- <img src="<?php echo $this->getSkinUrl('images/magnimeiosgateway/logo.png') ?>" class="v-middle" />
3
- <!-- Magnimeios Logo -->
 
 
 
app/design/frontend/base/default/layout/lusopaygateway.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <checkout_onepage_success>
4
+ <reference name="checkout.success">
5
+ <block type="lusopaygateway/checkout_success" name="checkout.success.lusopay.checkout" before="-" template="lusopaygateway/checkout/success.phtml">
6
+ </reference>
7
+ </checkout_onepage_success>
8
+ </layout>
app/design/frontend/base/default/template/lusopaygateway/checkout/success.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ echo $this->getMbInfo();
3
+ ?>
app/design/frontend/base/default/template/lusopaygateway/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/ifmb/multibanco_horizontal.gif') ?>" 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/base/default/template/lusopaygateway/form/mark.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <!-- MB Logo -->
2
+ <img src="<?php echo $this->getSkinUrl('images/lusopaygateway/logo.png') ?>" class="v-middle" />
3
+ <!-- MB Logo -->
app/design/frontend/base/default/template/lusopaygateway/info/info.phtml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //Get Referencias
3
+ $referencias = $this->htmlEscape($this->getInfo()->getLusopayReferencia());
4
+
5
+ if(!is_null($referencias)){
6
+
7
+ $re1='.*?'; # Non-greedy match on filler
8
+ $re2='(\\d+)'; # Integer Number 1
9
+ $re3='.*?'; # Non-greedy match on filler
10
+ $re4='(\\d+)'; # Integer Number 2
11
+
12
+ if ($c=preg_match_all ("/".$re1.$re2.$re3.$re4."/is", $referencias, $matches))
13
+ {
14
+ $int1=$matches[1][0];
15
+ $int2=$matches[2][0];
16
+ }
17
+
18
+ if ($int1 == '1'){
19
+ $showPS = 'display:none;';
20
+ $int1='';
21
+ }
22
+ else{
23
+ $showPS = '';
24
+ $int1 = substr($int1,0,3).' '.substr($int1,3,3).' '.substr($int1,6,3).' '.substr($int1,9,3).' '.substr($int1,12,1);
25
+ }
26
+
27
+ if ($int2 == '1'){
28
+ $showMB = 'display:none;';
29
+ $int2='';
30
+ }
31
+ else{
32
+ $showMB = '';
33
+ $int2 = substr($int2,0,3).' '.substr($int2,3,3).' '.substr($int2,6,3);
34
+ }
35
+
36
+
37
+ ?>
38
+
39
+
40
+
41
+ <div align="center">
42
+ <table cellpadding="3" width="400px" cellspacing="0" style="margin-top: 10px;border: 1px solid #DCDCDC;<?php echo $showMB;?>">
43
+ <tbody><tr>
44
+ <td style="font-size: x-small; border-bottom: 1px solid #DCDCDC; background-color: #DCDCDC; color: Black" colspan="3"><center>Pagamento por Multibanco (By LUSOPAY)</center></td>
45
+ </tr>
46
+ <tr>
47
+ <td rowspan="4"><div align="center"><img src="https://www.lusopay.com/App_Files/cms/documents/images/Logo_Lusopay_MB125x80px.png" alt=""></div></td>
48
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Entidade:</td>
49
+ <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getLusopayEntidade()) ?></span></td>
50
+ </tr>
51
+ <tr>
52
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Referência:</td>
53
+ <td style="font-size: x-small; text-align:left"><span><?php echo $int2 ?></span></td>
54
+ </tr>
55
+ <tr>
56
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
57
+ <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getLusopayMontante()) . ' EUR' ?></span></td>
58
+ </tr>
59
+ <tr>
60
+ <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
61
+ <td style="font-size: x-small; text-align:left">&nbsp;</td>
62
+ </tr>
63
+ <tr>
64
+ <td style="font-size: xx-small;border-top: 1px solid #DCDCDC; background-color: #DCDCDC; color: Black" colspan="3"><center>O tal&atilde;o emitido pela caixa autom&aacute;tica faz prova de pagamento. Conserve-o.</center></td>
65
+ </tr>
66
+ </tbody></table>
67
+
68
+
69
+
70
+
71
+ <table cellpadding="3" width="400px" cellspacing="0" style="margin-top: 10px;border: 1px solid #DCDCDC;<?php echo $showPS;?>">
72
+ <tbody>
73
+ <tr>
74
+ <td style="font-size: x-small; border-bottom: 1px solid #DCDCDC; background-color: #DCDCDC; color: Black" colspan="3"><center>Pagamento por Payshop (By LUSOPAY)</center></td>
75
+ </tr>
76
+ <tr>
77
+ <td rowspan="4"><div align="center"><img src="https://www.lusopay.com/App_Files/cms/documents/images/Logo_Lusopay_Payshop125x80px.png" alt=""></div></td>
78
+ </tr>
79
+ <tr>
80
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Referência:</td>
81
+ <td style="font-size: x-small; text-align:left"><span><?php echo $int1 ?></span></td>
82
+ </tr>
83
+ <tr>
84
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
85
+ <td style="font-size: x-small; text-align:left"><span><?php echo $this->htmlEscape($this->getInfo()->getLusopayMontante()) . ' EUR' ?></span></td>
86
+ </tr>
87
+ <tr>
88
+ <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
89
+ <td style="font-size: x-small; text-align:left">&nbsp;</td>
90
+ </tr>
91
+ <tr>
92
+ <td style="font-size: xx-small;border-top: 1px solid #DCDCDC; background-color: #DCDCDC; color: Black" colspan="3"><center>O tal&atilde;o emitido faz prova de pagamento. Conserve-o.</center></td>
93
+ </tr>
94
+ </tbody></table>
95
+
96
+ </div>
97
+
98
+ <?php }
99
+ else{
100
+ echo "A geração da referencia falhou";
101
+ }
app/design/frontend/base/default/template/magnimeiosgateway/form/form.phtml DELETED
@@ -1,7 +0,0 @@
1
- <fieldset class="form-list">
2
- <ul id="payment_form_<?php echo $this->getMethodCode(); ?>" style="display:none">
3
- <?php if ($this->getMethod()->getMensagem()): ?>
4
- <?php echo '<li>' . 'Após confirmação da encomenda vai receber um e-mail com as referências.' . '</li>'; ?>
5
- <?php endif; ?>
6
- </ul>
7
- </fieldset>
 
 
 
 
 
 
 
app/design/frontend/base/default/template/magnimeiosgateway/form/mark.phtml DELETED
@@ -1,3 +0,0 @@
1
- <!-- Magnimeios Logo -->
2
- <!--<img src="<?php echo $this->getSkinUrl('images/magnimeiosgateway/logo.png') ?>" class="v-middle" />-->
3
- <!-- Magnimeios Logo -->
 
 
 
app/design/frontend/base/default/template/magnimeiosgateway/info/info.phtml DELETED
@@ -1,90 +0,0 @@
1
-
2
- <?php
3
-
4
-
5
- $referencias = $this->htmlEscape($this->getInfo()->getMagnimeiosReferencia());
6
-
7
-
8
-
9
- if(!is_null($referencias)){
10
-
11
- $re1='.*?'; # Non-greedy match on filler
12
- $re2='(\\d+)'; # Integer Number 1
13
- $re3='.*?'; # Non-greedy match on filler
14
- $re4='(\\d+)'; # Integer Number 2
15
-
16
- if ($c=preg_match_all ("/".$re1.$re2.$re3.$re4."/is", $referencias, $matches))
17
- {
18
- $int1=$matches[1][0];
19
- $int2=$matches[2][0];
20
- }
21
-
22
-
23
-
24
- if ($int1 == '1'){
25
- $showPS = 'display:none;';
26
- $int1='';
27
- }
28
- else{
29
- $showPS = '';
30
- $int1 = substr($int1,0,3).' '.substr($int1,3,3).' '.substr($int1,6,3).' '.substr($int1,9,4);
31
- }
32
-
33
- if ($int2 == '1'){
34
- $showMB = 'display:none;';
35
- $int2='';
36
- }
37
- else{
38
- $showMB = '';
39
- $int2 = substr($int2,0,3).' '.substr($int2,3,3).' '.substr($int2,6,3);
40
- }
41
-
42
-
43
-
44
- ?>
45
-
46
-
47
-
48
-
49
- <table border="0" cellspacing="1" cellpadding="0" Style="<?php echo $showMB;?>">
50
- <tr>
51
- <td colspan="2"><img src="https://www.lusopay.com/App_Files/cms/documents/images/Logo_Lusopay_MB125x80px.png" border="0" alt="<?php echo $this->getMethod()->getTitle(); ?>" title="Pagamento por Multibanco" /></td>
52
- </tr>
53
-
54
-
55
- <tr>
56
- <td><?php echo $this->__('<strong>Entidade:</strong>'); ?></td>
57
- <td><?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosEntidade()) ?></td>
58
- </tr>
59
- <tr>
60
- <td><?php echo $this->__('<strong>Referência:</strong>'); ?> </td>
61
- <td>&nbsp;<?php echo $int2 ?></td>
62
- </tr>
63
- <tr>
64
- <td><?php echo $this->__('<strong>Montante:</strong>'); ?></td>
65
- <td><?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosMontante()) . ' EUR'; ?></td>
66
- </tr>
67
- </table>
68
- <table border="0" cellspacing="1" cellpadding="0" Style="<?php echo $showPS;?>">
69
- <tr>
70
- <td colspan="2"><img src="https://www.lusopay.com/App_Files/cms/documents/images/Logo_Lusopay_Payshop125x80px.png" border="0" alt="<?php echo $this->getMethod()->getTitle(); ?>" title="Pagamento por Payshop" /></td>
71
- </tr>
72
- <tr>
73
- <td><?php echo $this->__('<strong>Referência:</strong>'); ?> </td>
74
- <td><?php echo $int1 ?></td>
75
- </tr>
76
- <tr>
77
- <td><?php echo $this->__('<strong>Montante:</strong>'); ?></td>
78
- <td><?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosMontante()) . ' EUR'; ?></td>
79
- </tr>
80
- </table>
81
- <?php
82
-
83
- }
84
- else {
85
- echo "A geração da referencia falhou!";
86
- }
87
-
88
- ?>
89
- <?php echo $this->getChildHtml()?>
90
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/{Magnimeios_Magnimeiosgateway.xml → Lusopay_Lusopaygateway.xml} RENAMED
@@ -1,12 +1,12 @@
1
  <?xml version="1.0"?>
2
  <config>
3
  <modules>
4
- <Magnimeios_Magnimeiosgateway>
5
  <active>true</active>
6
  <codePool>local</codePool>
7
  <depends>
8
  <Mage_Payment />
9
  </depends>
10
- </Magnimeios_Magnimeiosgateway>
11
  </modules>
12
  </config>
1
  <?xml version="1.0"?>
2
  <config>
3
  <modules>
4
+ <Lusopay_Lusopaygateway>
5
  <active>true</active>
6
  <codePool>local</codePool>
7
  <depends>
8
  <Mage_Payment />
9
  </depends>
10
+ </Lusopay_Lusopaygateway>
11
  </modules>
12
  </config>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Lusopay_LusopayGateway</name>
4
- <version>1.6.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Pagamentos por Multibanco e / ou Payshop (by LUSOPAY)</summary>
10
- <description>Metodo de pagamento atrav&#xE9;s da gera&#xE7;&#xE3;o refer&#xEA;ncias Multibanco e payshop</description>
11
- <notes>Vers&#xE3;o para magento 1.9</notes>
12
  <authors><author><name>Lusopay</name><user>lusopay</user><email>hf@lusopay.com</email></author></authors>
13
- <date>2015-03-24</date>
14
- <time>11:03:54</time>
15
- <contents><target name="magelocal"><dir name="Magnimeios"><dir name="Magnimeiosgateway"><dir name="Block"><file name="Form.php" hash="3f75ba24352b086af9c008039f9bc63f"/><file name="Info.php" hash="70f29099be47705bb11c1c5765c58b24"/><file name="Form.php" hash="3f75ba24352b086af9c008039f9bc63f"/><file name="Info.php" hash="70f29099be47705bb11c1c5765c58b24"/></dir><dir name="Helper"><file name="Data.php" hash="cc2d593bb9bf9228d46291519801922c"/><file name="Data.php" hash="cc2d593bb9bf9228d46291519801922c"/></dir><dir name="Model"><dir name="Convert"><file name="Order.php" hash="5b2063bb5a1e5186b1e7052e694a208c"/><file name="Quote.php" hash="67c336422be52cffee09ab454677eeee"/><file name="Quote.php" hash="67c336422be52cffee09ab454677eeee"/><file name="Order.php" hash="5b2063bb5a1e5186b1e7052e694a208c"/></dir><file name="GerarRef.php" hash="c0e3472fd07d20c742fdec7229c3cd87"/><dir name="Mysql4"><file name="Setup.php" hash="81bb2624d9a505d700353013efebf632"/><file name="Setup.php" hash="81bb2624d9a505d700353013efebf632"/></dir><file name="PaymentAction.php" hash="52b0609d8c62770fb03ed1ca830a17a7"/><file name="GerarRef.php" hash="c0e3472fd07d20c742fdec7229c3cd87"/><file name="PaymentAction.php" hash="52b0609d8c62770fb03ed1ca830a17a7"/></dir><dir name="etc"><file name="config.xml" hash="5af65afe91e361e06cb79fe5dde89214"/><file name="system.xml" hash="2bfdf005b6527f0fa3107e62378b0610"/><file name="config.xml" hash="5af65afe91e361e06cb79fe5dde89214"/><file name="system.xml" hash="2bfdf005b6527f0fa3107e62378b0610"/></dir><dir name="sql"><dir name="magnimeiosgateway_setup"><file name="mysql4-install-2.0.0.php" hash="cfdf054ed86842fdc86de599aecf4fff"/><file name="mysql4-install-2.0.0.php" hash="cfdf054ed86842fdc86de599aecf4fff"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="magnimeiosgateway"><dir name="info"><dir name="pdf"><file name="info.phtml" hash="5782769a75900a3aecae1e4e0f78b0c8"/></dir><file name="info.phtml" hash="d07b20ae60559a61b2c8f314816da303"/></dir><dir name="form"><file name="form.phtml" hash="9d041c914f3feada5a4bf4958afa04aa"/><file name="mark.phtml" hash="747f61cb869f185ac3e808f6707838ed"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="magnimeiosgateway"><dir name="form"><file name="form.phtml" hash="b2493fedcfcfd316e214e4dc43a25536"/><file name="mark.phtml" hash="c7d148bf708105b0d8c42a2fbb4814d0"/></dir><dir name="info"><file name="info.phtml" hash="437a2fff201cafe45c9dd23902aa1212"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magnimeios_Magnimeiosgateway.xml" hash="bf2c21eae3198cddf69ab496cb29443f"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="magnimeiosgateway"><file name="Logo_Lusopay_256x85px.png" hash="bcc54ae1f8a25cf10f8642a8f91339e2"/><file name="logo.png" hash="c2e0e05d5dd6ac2331020dff60adf696"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="magnimeiosgateway"><file name="Logo_Lusopay_MBePayshop125x80px.png" hash="dbe096eb26c34cf69816b97fb049926b"/><file name="logo.png" hash="ad194614eeee86b5dc1fe688e5a0d573"/></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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Lusopay_LusopayGateway</name>
4
+ <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Pagamentos por Multibanco e / ou Payshop (by LUSOPAY)</summary>
10
+ <description>Metodo de pagamento atrav&#xE9;s da gera&#xE7;&#xE3;o refer&#xEA;ncias Multibanco e payshop e com sistema callback.</description>
11
+ <notes>Novo sistema de callback</notes>
12
  <authors><author><name>Lusopay</name><user>lusopay</user><email>hf@lusopay.com</email></author></authors>
13
+ <date>2015-07-15</date>
14
+ <time>16:44:02</time>
15
+ <contents><target name="magelocal"><dir name="Lusopay"><dir name="Lusopaygateway"><dir name="Block"><dir name="Checkout"><dir name="Info"><file name="LusopayMBPS.php" hash="9accdc26c19f3d34a33f281cfef0bd38"/><file name="LusopayMBPS.php" hash="9accdc26c19f3d34a33f281cfef0bd38"/></dir><file name="Success.php" hash="8dab8ca8f0c14a1d40c9ec27880dfff1"/><file name="Success.php" hash="8dab8ca8f0c14a1d40c9ec27880dfff1"/></dir><file name="Form.php" hash="e65c00a9b9d82c0d135e7aab08822bb6"/><file name="Info.php" hash="bd17826cf9628a98c54b5ad32865f6db"/><file name="Form.php" hash="e65c00a9b9d82c0d135e7aab08822bb6"/><file name="Info.php" hash="bd17826cf9628a98c54b5ad32865f6db"/></dir><dir name="Helper"><file name="Data.php" hash="ae6b3d8abdf8658798cbfbd6f19d3e0f"/><file name="Data.php" hash="ae6b3d8abdf8658798cbfbd6f19d3e0f"/></dir><dir name="Model"><file name="AtivarCallback.php" hash="ac51086ed4409ed6e6f5234fe06d2196"/><dir name="Convert"><file name="Order.php" hash="794affe91c0017a594d5d073f261b790"/><file name="Quote.php" hash="b07b70a22f55e165b02882993cd605d6"/><file name="Order.php" hash="794affe91c0017a594d5d073f261b790"/><file name="Quote.php" hash="b07b70a22f55e165b02882993cd605d6"/></dir><file name="GerarRef.php" hash="129212cc2e50db579bd77e6c58d9172c"/><dir name="Mysql4"><file name="Setup.php" hash="41aebc65c29b7999d18233a1a0ed7d85"/><file name="Setup.php" hash="41aebc65c29b7999d18233a1a0ed7d85"/></dir><file name="PaymentAction.php" hash="c4d0d9944cf85b515d12bd24aba80189"/><file name="AtivarCallback.php" hash="ac51086ed4409ed6e6f5234fe06d2196"/><file name="GerarRef.php" hash="129212cc2e50db579bd77e6c58d9172c"/><file name="PaymentAction.php" hash="c4d0d9944cf85b515d12bd24aba80189"/></dir><dir name="controllers"><file name="CallbackController.php" hash="5f8c2ec46c9138c902b4ae4d003e7497"/><file name="CallbackController.php" hash="5f8c2ec46c9138c902b4ae4d003e7497"/></dir><dir name="etc"><file name="config.xml" hash="4e6ed6bf71726c43304d4d554a9f6b61"/><file name="system.xml" hash="ccc450ae12e90fdbbba73cc1810b7cf5"/><file name="config.xml" hash="4e6ed6bf71726c43304d4d554a9f6b61"/><file name="system.xml" hash="ccc450ae12e90fdbbba73cc1810b7cf5"/></dir><dir name="sql"><dir name="lusopaygateway_setup"><file name="mysql4-install-2.1.0.php" hash="fda2e0ffc8de6b6c3b487d2c9e5f5a74"/><file name="mysql4-install-2.1.0.php" hash="fda2e0ffc8de6b6c3b487d2c9e5f5a74"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="lusopaygateway"><dir name="form"><file name="form.phtml" hash="3ca8074665193315d2277b2b6e3710d8"/><file name="mark.phtml" hash="d998f986ec4bbdb301733631e5bb0dff"/></dir><dir name="info"><file name="info.phtml" hash="fc825e459e89a3aed4e58b6ef708d04b"/><dir name="pdf"><file name="info.phtml" hash="a2142c28f0f38dbc608a1e7c05ec3f17"/></dir></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="lusopaygateway"><dir name="form"><file name="mark.phtml" hash="d998f986ec4bbdb301733631e5bb0dff"/><file name="form.phtml" hash="3ca8074665193315d2277b2b6e3710d8"/></dir><dir name="info"><file name="info.phtml" hash="18eced229719cd898dba1996518b17af"/><dir name="pdf"><file name="info.phtml" hash="a2142c28f0f38dbc608a1e7c05ec3f17"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="lusopaygateway.xml" hash="a5341c5b267dda1e652706dc2f2c131e"/></dir><dir name="template"><dir name="lusopaygateway"><dir name="checkout"><file name="success.phtml" hash="890651282fa0b4d1cbdeaabbce67e5ce"/></dir><dir name="form"><file name="form.phtml" hash="357405fda2c5827381cba52f1871c4d8"/><file name="mark.phtml" hash="d998f986ec4bbdb301733631e5bb0dff"/></dir><dir name="info"><file name="info.phtml" hash="bd55aac5fa86fd9243389deabfc418aa"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Lusopay_Lusopaygateway.xml" hash="1832d38a8ce201c40497ef6b8f9ee37a"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="images"><dir name="lusopaygateway"><file name="logo.png" hash="c2e0e05d5dd6ac2331020dff60adf696"/><file name="Logo_Lusopay_256x85px.png" hash="bcc54ae1f8a25cf10f8642a8f91339e2"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="images"><dir name="lusopaygateway"><file name="logo.png" hash="c2e0e05d5dd6ac2331020dff60adf696"/><file name="Logo_Lusopay_256x85px.png" hash="bcc54ae1f8a25cf10f8642a8f91339e2"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="lusopaygateway"><file name="logo.png" hash="ad194614eeee86b5dc1fe688e5a0d573"/><file name="Logo_Lusopay_MBePayshop125x80px.png" hash="dbe096eb26c34cf69816b97fb049926b"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="images"><dir name="lusopaygateway"><file name="logo.png" hash="ad194614eeee86b5dc1fe688e5a0d573"/><file name="Logo_Lusopay_MBePayshop125x80px.png" hash="dbe096eb26c34cf69816b97fb049926b"/></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/magnimeiosgateway → base/default/images/lusopaygateway}/Logo_Lusopay_256x85px.png RENAMED
File without changes
skin/adminhtml/{default/default/images/magnimeiosgateway → base/default/images/lusopaygateway}/logo.png RENAMED
File without changes
skin/adminhtml/default/default/images/lusopaygateway/Logo_Lusopay_256x85px.png ADDED
Binary file
skin/adminhtml/default/default/images/lusopaygateway/logo.png ADDED
Binary file
skin/frontend/base/default/images/{magnimeiosgateway → lusopaygateway}/Logo_Lusopay_MBePayshop125x80px.png RENAMED
File without changes
skin/frontend/base/default/images/{magnimeiosgateway → lusopaygateway}/logo.png RENAMED
File without changes
skin/frontend/default/default/images/lusopaygateway/Logo_Lusopay_MBePayshop125x80px.png ADDED
Binary file
skin/frontend/default/default/images/lusopaygateway/logo.png ADDED
Binary file