Lusopay_LusopayGateway - Version 2.1.0

Version Notes

Novo sistema de callback

Download this release

Release Info

Developer Lusopay
Extension Lusopay_LusopayGateway
Version 2.1.0
Comparing to
See all releases


Code changes from version 2.0.0 to 2.1.0

Files changed (45) hide show
  1. app/code/local/Lusopay/Lusopaygateway/Helper/Data.php +0 -4
  2. app/code/local/Lusopay/Lusopaygateway/Model/Mysql4/Setup.php +0 -5
  3. app/code/local/Lusopay/Lusopaygateway/controllers/CallbackController.php +0 -155
  4. app/code/local/Lusopay/Lusopaygateway/sql/lusopaygateway_setup/mysql4-install-2.1.0.php +0 -37
  5. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Block/Checkout/Info/LusopayMBPS.php +2 -2
  6. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Block/Checkout/Success.php +1 -40
  7. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Block/Form.php +3 -3
  8. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Block/Info.php +3 -3
  9. app/code/local/Magnimeios/Magnimeiosgateway/Helper/Data.php +4 -0
  10. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Model/AtivarCallback.php +14 -14
  11. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Model/Convert/Order.php +4 -4
  12. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Model/Convert/Quote.php +4 -4
  13. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Model/GerarRef.php +17 -17
  14. app/code/local/Magnimeios/Magnimeiosgateway/Model/Mysql4/Setup.php +5 -0
  15. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Model/PaymentAction.php +2 -2
  16. app/code/local/Magnimeios/Magnimeiosgateway/controllers/CallbackController.php +82 -0
  17. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/etc/config.xml +41 -41
  18. app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/etc/system.xml +4 -4
  19. app/code/local/Magnimeios/Magnimeiosgateway/sql/magnimeiosgateway_setup/mysql4-install-2.1.0.php +36 -0
  20. app/design/adminhtml/base/default/template/lusopaygateway/form/mark.phtml +0 -3
  21. app/design/adminhtml/base/default/template/{lusopaygateway → magnimeiosgateway}/form/form.phtml +1 -1
  22. app/design/adminhtml/base/default/template/magnimeiosgateway/form/mark.phtml +3 -0
  23. app/design/adminhtml/base/default/template/{lusopaygateway → magnimeiosgateway}/info/info.phtml +4 -4
  24. app/design/adminhtml/{default/default/template/lusopaygateway → base/default/template/magnimeiosgateway}/info/pdf/info.phtml +4 -4
  25. app/design/adminhtml/default/default/template/lusopaygateway/form/mark.phtml +0 -3
  26. app/design/adminhtml/default/default/template/{lusopaygateway → magnimeiosgateway}/form/form.phtml +1 -1
  27. app/design/adminhtml/default/default/template/magnimeiosgateway/form/mark.phtml +3 -0
  28. app/design/{frontend/base/default/template/lusopaygateway → adminhtml/default/default/template/magnimeiosgateway}/info/info.phtml +10 -5
  29. app/design/adminhtml/{base/default/template/lusopaygateway → default/default/template/magnimeiosgateway}/info/pdf/info.phtml +4 -4
  30. app/design/frontend/base/default/layout/{lusopaygateway.xml → magnimeiosgateway.xml} +1 -1
  31. app/design/frontend/base/default/template/lusopaygateway/form/mark.phtml +0 -3
  32. app/design/frontend/base/default/template/{lusopaygateway → magnimeiosgateway}/checkout/success.phtml +0 -0
  33. app/design/frontend/base/default/template/{lusopaygateway → magnimeiosgateway}/form/form.phtml +0 -0
  34. app/design/frontend/base/default/template/magnimeiosgateway/form/mark.phtml +3 -0
  35. app/design/{adminhtml/default/default/template/lusopaygateway → frontend/base/default/template/magnimeiosgateway}/info/info.phtml +5 -10
  36. app/etc/modules/{Lusopay_Lusopaygateway.xml → Magnimeios_Magnimeiosgateway.xml} +2 -2
  37. package.xml +4 -4
  38. skin/adminhtml/base/default/images/{lusopaygateway → magnimeiosgateway}/Logo_Lusopay_256x85px.png +0 -0
  39. skin/adminhtml/base/default/images/{lusopaygateway → magnimeiosgateway}/logo.png +0 -0
  40. skin/adminhtml/default/default/images/{lusopaygateway → magnimeiosgateway}/Logo_Lusopay_256x85px.png +0 -0
  41. skin/adminhtml/default/default/images/{lusopaygateway → magnimeiosgateway}/logo.png +0 -0
  42. skin/frontend/base/default/images/{lusopaygateway → magnimeiosgateway}/Logo_Lusopay_MBePayshop125x80px.png +0 -0
  43. skin/frontend/base/default/images/{lusopaygateway → magnimeiosgateway}/logo.png +0 -0
  44. skin/frontend/default/default/images/lusopaygateway/Logo_Lusopay_MBePayshop125x80px.png +0 -0
  45. skin/frontend/default/default/images/lusopaygateway/logo.png +0 -0
app/code/local/Lusopay/Lusopaygateway/Helper/Data.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
- class Lusopay_Lusopaygateway_Helper_Data extends Mage_Core_Helper_Abstract
3
- {
4
- }
 
 
 
 
app/code/local/Lusopay/Lusopaygateway/Model/Mysql4/Setup.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
- class Lusopay_Lusopaygateway_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup
3
- {
4
-
5
- }
 
 
 
 
 
app/code/local/Lusopay/Lusopaygateway/controllers/CallbackController.php DELETED
@@ -1,155 +0,0 @@
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/sql/lusopaygateway_setup/mysql4-install-2.1.0.php DELETED
@@ -1,37 +0,0 @@
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/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Block/Checkout/Info/LusopayMBPS.php RENAMED
@@ -4,10 +4,10 @@
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
  {
4
  * if activated in admin. The different display conditions are used in the
5
  * custom $_template
6
  */
7
+ class Magnimeios_Magnimeiosgateway_Block_Checkout_Success_Info_LusopayMBPS
8
  extends Mage_Core_Block_Template
9
  {
10
+ protected $_template = 'magnimeiosgateway/checkout/success.phtml';
11
 
12
  public function getMbInfo()
13
  {
app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Block/Checkout/Success.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class Lusopay_Lusopaygateway_Block_Checkout_Success extends Mage_Checkout_Block_Onepage_Success
4
  {
5
  protected function _toHtml()
6
  {
@@ -83,45 +83,6 @@ class Lusopay_Lusopaygateway_Block_Checkout_Success extends Mage_Checkout_Block_
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;
1
  <?php
2
 
3
+ class Magnimeios_Magnimeiosgateway_Block_Checkout_Success extends Mage_Checkout_Block_Onepage_Success
4
  {
5
  protected function _toHtml()
6
  {
83
  </table>';
84
  }
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  $html = parent::_toHtml();
87
 
88
  $html .= $tabela;
app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Block/Form.php RENAMED
@@ -1,13 +1,13 @@
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();
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();
app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Block/Info.php RENAMED
@@ -1,10 +1,10 @@
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,7 +23,7 @@ class Lusopay_Lusopaygateway_Block_Info extends Mage_Payment_Block_Info
23
 
24
  public function toPdf()
25
  {
26
- $this->setTemplate('lusopaygateway/info/pdf/info.phtml');
27
  return $this->toHtml();
28
  }
29
  }
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
 
24
  public function toPdf()
25
  {
26
+ $this->setTemplate('magnimeiosgateway/info/pdf/info.phtml');
27
  return $this->toHtml();
28
  }
29
  }
app/code/local/Magnimeios/Magnimeiosgateway/Helper/Data.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class Magnimeios_Magnimeiosgateway_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Model/AtivarCallback.php RENAMED
@@ -1,6 +1,6 @@
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
  {
@@ -18,26 +18,26 @@ class Lusopay_Lusopaygateway_Model_AtivarCallback extends Mage_Core_Model_Config
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':
@@ -53,7 +53,7 @@ class Lusopay_Lusopaygateway_Model_AtivarCallback extends Mage_Core_Model_Config
53
  function init_comment()
54
  {
55
  render_callback_info();
56
- $('payment_lusopaygateway_active_callback').observe('change', function(){
57
  render_callback_info();
58
  });
59
  }
@@ -91,7 +91,7 @@ class Lusopay_Lusopaygateway_Model_AtivarCallback extends Mage_Core_Model_Config
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>
@@ -99,11 +99,11 @@ class Lusopay_Lusopaygateway_Model_AtivarCallback extends Mage_Core_Model_Config
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
 
@@ -150,7 +150,7 @@ class Lusopay_Lusopaygateway_Model_AtivarCallback extends Mage_Core_Model_Config
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
 
1
  <?php
2
 
3
+ class Magnimeios_Magnimeiosgateway_Model_AtivarCallback extends Mage_Core_Model_Config_Data
4
  {
5
  public function getCommentText(Mage_Core_Model_Config_Element $element, $currentValue)
6
  {
18
 
19
  $chave_anti = $result['antiphishing'];
20
  }else{
21
+ $magnimeiosgateway_save_conn = Mage::getSingleton('core/resource')->getConnection('core_write');
22
+ $magnimeiosgateway_save_conn->beginTransaction();
23
  $fields = array();
24
  $fields['antiphishing'] = $chave_anti;
25
+ $magnimeiosgateway_save_conn->insert('lusopay_config',$fields);
26
+ $magnimeiosgateway_save_conn->commit();
27
  }
28
 
29
  $skinUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
30
 
31
+ $urlCallback = Mage::getBaseUrl() . 'magnimeiosgateway/callback/check/entidade/«entidade»/referencia/«referencia»/valor/«valor»/chave/'.$chave_anti;
32
 
33
 
34
+ $result = "<p id='magnimeiosgateway_callback_info'></p>";
35
  $result .= "<script type='text/javascript'>
36
 
37
  function render_callback_info(){
38
 
39
+ var infolusopay = $('magnimeiosgateway_callback_info');
40
+ var field_value = $('payment_magnimeiosgateway_active_callback').getValue();
41
  switch (field_value.toLowerCase())
42
  {
43
  case '1':
53
  function init_comment()
54
  {
55
  render_callback_info();
56
+ $('payment_magnimeiosgateway_active_callback').observe('change', function(){
57
  render_callback_info();
58
  });
59
  }
91
 
92
  public function sendRequest()
93
  {
94
+ if ($this->getStatusSendEmail($this->getChaveAntiphishing()) == 0 && Mage::getStoreConfig('payment/magnimeiosgateway/active_callback') == '1')
95
  {
96
  $body = "
97
  <fieldset>
99
  Desejo activar o sistema Callback<br/><br/>
100
  Os meus dados:<br/><br/>
101
 
102
+ NIF: ".Mage::getStoreConfig('payment/magnimeiosgateway/nif')."<br/><br/>
103
 
104
  Url do callback:<br/><br/>
105
 
106
+ ".Mage::getBaseUrl() . "magnimeiosgateway/callback/check/entidade/&laquo;entidade&raquo;/referencia/&laquo;referencia&raquo;/valor/&laquo;valor&raquo;/chave/".$this->getChaveAntiphishing()."<br/><br/>
107
 
108
  Obrigado.
109
 
150
  $chave_anti = $result['antiphishing'];
151
  return $chave_anti;
152
  }else{
153
+ return Mage::throwException(Mage::helper('magnimeiosgateway')->__('Não foi encontrada nenhuma chave!!'));
154
  }
155
  }
156
 
app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Model/Convert/Order.php RENAMED
@@ -1,5 +1,5 @@
1
  <?php
2
- class Lusopay_Lusopaygateway_Model_Convert_Order extends Mage_Sales_Model_Convert_Order
3
  {
4
  /**
5
  * Convert order payment to quote payment
@@ -11,9 +11,9 @@ class Lusopay_Lusopaygateway_Model_Convert_Order extends Mage_Sales_Model_Conver
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
  }
1
  <?php
2
+ class Magnimeios_Magnimeiosgateway_Model_Convert_Order extends Mage_Sales_Model_Convert_Order
3
  {
4
  /**
5
  * Convert order payment to quote payment
11
  {
12
  $quotePayment = parent::paymentToQuotePayment($payment, $quotePayment);
13
 
14
+ $quotePayment->setMagnimeiosEntidade($payment->getMagnimeiosEntidade())
15
+ ->setMagnimeiosReferencia($payment->getMagnimeiosReferencia())
16
+ ->setMagnimeiosMontante($payment->getMagnimeiosMontante());
17
 
18
  return $quotePayment;
19
  }
app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Model/Convert/Quote.php RENAMED
@@ -1,5 +1,5 @@
1
  <?php
2
- class Lusopay_Lusopaygateway_Model_Convert_Quote extends Mage_Sales_Model_Convert_Quote
3
  {
4
 
5
  /**
@@ -11,9 +11,9 @@ class Lusopay_Lusopaygateway_Model_Convert_Quote extends Mage_Sales_Model_Conver
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
 
1
  <?php
2
+ class Magnimeios_Magnimeiosgateway_Model_Convert_Quote extends Mage_Sales_Model_Convert_Quote
3
  {
4
 
5
  /**
11
  public function paymentToOrderPayment(Mage_Sales_Model_Quote_Payment $payment)
12
  {
13
  $orderPayment = parent::paymentToOrderPayment($payment);
14
+ $orderPayment->setMagnimeiosEntidade($payment->getMagnimeiosEntidade())
15
+ ->setMagnimeiosReferencia($payment->getMagnimeiosReferencia())
16
+ ->setMagnimeiosMontante($payment->getMagnimeiosMontante());
17
  return $orderPayment;
18
  }
19
 
app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Model/GerarRef.php RENAMED
@@ -1,11 +1,11 @@
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
 
@@ -161,9 +161,9 @@ $ch = curl_init();
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 .")");
@@ -189,9 +189,9 @@ $ch = curl_init();
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
  {
@@ -278,9 +278,9 @@ $ch = curl_init();
278
  $connection->commit();
279
 
280
  $info = $this->getInfoInstance();
281
- $info->setLusopayEntidade("11024")
282
- ->setLusopayReferencia($referencias)
283
- ->setLusopayMontante($order_value);
284
 
285
  }
286
  else {
@@ -305,15 +305,15 @@ $ch = curl_init();
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
  }
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
 
161
  $connection->commit();
162
 
163
  $info = $this->getInfoInstance();
164
+ $info->setMagnimeiosEntidade("11024")
165
+ ->setMagnimeiosReferencia($referencias)
166
+ ->setMagnimeiosMontante($order_value);
167
 
168
 
169
  //$this->run("INSERT INTO `magnimeiosreferences`(`id_order`, `refMB`, `refPS`, `value`) VALUES (". $order_id .",'". $refs[2] ."','". $refs[1] ."','". $order_value .")");
189
 
190
 
191
  $info = $this->getInfoInstance();
192
+ $info->setMagnimeiosEntidade("11024")
193
+ ->setMagnimeiosReferencia("<ps>" . $ref[2] . "</ps><mb>". $ref[1] ."</mb>")
194
+ ->setMagnimeiosMontante($valor);
195
  }
196
  else
197
  {
278
  $connection->commit();
279
 
280
  $info = $this->getInfoInstance();
281
+ $info->setMagnimeiosEntidade("11024")
282
+ ->setMagnimeiosReferencia($referencias)
283
+ ->setMagnimeiosMontante($order_value);
284
 
285
  }
286
  else {
305
  $order_value = number_format($this->getQuote()->getGrandTotal(),2,'.','');
306
  /*
307
  if ($order_value < 2) {
308
+ Mage::throwException(Mage::helper('magnimeiosgateway')->__('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('magnimeiosgateway')->__('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('magnimeiosgateway')->__('A moeda selecionada ('.$currency_code.') não é compatível com o Pagamento'));
317
  }
318
  return $this;
319
  }
app/code/local/Magnimeios/Magnimeiosgateway/Model/Mysql4/Setup.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Magnimeios_Magnimeiosgateway_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup
3
+ {
4
+
5
+ }
app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/Model/PaymentAction.php RENAMED
@@ -30,14 +30,14 @@
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
  }
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
  }
app/code/local/Magnimeios/Magnimeiosgateway/controllers/CallbackController.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magnimeios_Magnimeiosgateway_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
+ }
82
+ ?>
app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/etc/config.xml RENAMED
@@ -1,38 +1,38 @@
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>
@@ -51,70 +51,70 @@
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>
@@ -123,9 +123,9 @@
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>
@@ -136,7 +136,7 @@
136
  <mensagem></mensagem>
137
  <payment_action>order</payment_action>
138
  <active_callback>0</active_callback>
139
- </lusopaygateway>
140
  </payment>
141
  </default>
142
  </config>
1
  <?xml version="1.0"?>
2
  <config>
3
  <modules>
4
+ <Magnimeios_Magnimeiosgateway>
5
  <version>2.1.0</version>
6
+ </Magnimeios_Magnimeiosgateway>
7
  </modules>
8
  <frontend>
9
  <routers>
10
  <routeurfrontend>
11
  <use>standard</use>
12
  <args>
13
+ <module>Magnimeios_Magnimeiosgateway</module>
14
+ <frontName>magnimeiosgateway</frontName>
15
  </args>
16
  </routeurfrontend>
17
  </routers>
18
  <translate>
19
  <modules>
20
+ <Magnimeios_Magnimeiosgateway>
21
  <files>
22
+ <default>Magnimeios_Magnimeiosgateway.csv</default>
23
  </files>
24
+ </Magnimeios_Magnimeiosgateway>
25
  </modules>
26
  </translate>
27
  </frontend>
28
  <adminhtml>
29
  <translate>
30
  <modules>
31
+ <Magnimeios_Magnimeiosgateway>
32
  <files>
33
+ <default>Magnimeios_Magnimeiosgateway.csv</default>
34
  </files>
35
+ </Magnimeios_Magnimeiosgateway>
36
  </modules>
37
  </translate>
38
  </adminhtml>
51
  </sales_convert_order_payment>
52
  </fieldsets>
53
  <models>
54
+ <magnimeiosgateway>
55
+ <class>Magnimeios_Magnimeiosgateway_Model</class>
56
+ <resourceModel>magnimeiosgateway_mysql4</resourceModel>
57
+ </magnimeiosgateway>
58
  <sales>
59
  <rewrite>
60
+ <convert_order>Magnimeios_Magnimeiosgateway_Model_Convert_Order</convert_order>
61
+ <convert_quote>Magnimeios_Magnimeiosgateway_Model_Convert_Quote</convert_quote>
62
  </rewrite>
63
  </sales>
64
+ <magnimeiosgateway_mysql4>
65
+ <class>Magnimeios_Magnimeiosgateway_Model_Mysql4</class>
66
  <entities>
67
+ <magnimeiosgateway>
68
  <table>magnimeiosreferences</table>
69
+ </magnimeiosgateway>
70
  </entities>
71
+ </magnimeiosgateway_mysql4>
72
  </models>
73
  <resources>
74
+ <magnimeiosgateway_setup>
75
  <setup>
76
+ <module>Magnimeios_Magnimeiosgateway</module>
77
+ <class>Magnimeios_Magnimeiosgateway_Model_Mysql4_Setup</class>
78
  </setup>
79
  <connection>
80
  <use>core_setup</use>
81
  </connection>
82
+ </magnimeiosgateway_setup>
83
+ <magnimeiosgateway_write>
84
  <connection>
85
  <use>core_write</use>
86
  </connection>
87
+ </magnimeiosgateway_write>
88
+ <magnimeiosgateway_read>
89
  <connection>
90
  <use>core_read</use>
91
  </connection>
92
+ </magnimeiosgateway_read>
93
  </resources>
94
  <blocks>
95
+ <magnimeiosgateway>
96
+ <class>Magnimeios_Magnimeiosgateway_Block</class>
97
+ </magnimeiosgateway>
98
  <checkout>
99
  <rewrite>
100
+ <onepage_success>Magnimeios_Magnimeiosgateway_Block_Checkout_Success</onepage_success>
101
  </rewrite>
102
  </checkout>
103
  </blocks>
104
  <helpers>
105
+ <magnimeiosgateway>
106
+ <class>Magnimeios_Magnimeiosgateway_Helper</class>
107
+ </magnimeiosgateway>
108
  </helpers>
109
  <sales>
110
  <order>
111
  <statuses>
112
+ <aguarda_pagamento_magnimeiosgateway translate="label"><label><![CDATA[MB - Aguarda Pagamento Multibanco / Payshop]]></label></aguarda_pagamento_magnimeiosgateway>
113
  </statuses>
114
  <states>
115
  <new>
116
  <statuses>
117
+ <aguarda_pagamento_magnimeiosgateway/>
118
  </statuses>
119
  </new>
120
  </states>
123
  </global>
124
  <default>
125
  <payment>
126
+ <magnimeiosgateway>
127
  <active>0</active>
128
+ <model>magnimeiosgateway/gerarRef</model>
129
  <title>Multibanco / Payshop (by LUSOPAY)</title>
130
  <sort_order>1</sort_order>
131
  <order_status>pending</order_status>
136
  <mensagem></mensagem>
137
  <payment_action>order</payment_action>
138
  <active_callback>0</active_callback>
139
+ </magnimeiosgateway>
140
  </payment>
141
  </default>
142
  </config>
app/code/local/{Lusopay/Lusopaygateway → Magnimeios/Magnimeiosgateway}/etc/system.xml RENAMED
@@ -3,7 +3,7 @@
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>
@@ -95,19 +95,19 @@
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>
3
  <sections>
4
  <payment>
5
  <groups>
6
+ <magnimeiosgateway 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>
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>magnimeiosgateway/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>magnimeiosgateway/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
+ </magnimeiosgateway>
111
  </groups>
112
  </payment>
113
  </sections>
app/code/local/Magnimeios/Magnimeiosgateway/sql/magnimeiosgateway_setup/mysql4-install-2.1.0.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+
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
+
19
+ $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`))");
20
+
21
+ $installer->addAttribute('order_payment', 'magnimeios_entidade', array('type'=>'varchar'));
22
+ $installer->addAttribute('order_payment', 'magnimeios_referencia', array('type'=>'varchar'));
23
+ $installer->addAttribute('order_payment', 'magnimeios_montante', array('type'=>'varchar'));
24
+
25
+ $installer->addAttribute('quote_payment', 'magnimeios_entidade', array('type'=>'varchar'));
26
+ $installer->addAttribute('quote_payment', 'magnimeios_referencia', array('type'=>'varchar'));
27
+ $installer->addAttribute('quote_payment', 'magnimeios_montante', array('type'=>'varchar'));
28
+ $installer->endSetup();
29
+
30
+ if (Mage::getVersion() >= 1.1) {
31
+ $installer->startSetup();
32
+ $installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'magnimeios_entidade', 'VARCHAR(255) NOT NULL');
33
+ $installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'magnimeios_referencia', 'VARCHAR(255) NOT NULL');
34
+ $installer->getConnection()->addColumn($installer->getTable('sales_flat_quote_payment'), 'magnimeios_montante', 'VARCHAR(255) NOT NULL');
35
+ $installer->endSetup();
36
+ }
app/design/adminhtml/base/default/template/lusopaygateway/form/mark.phtml DELETED
@@ -1,3 +0,0 @@
1
- <!-- MB Logo -->
2
- <img src="<?php echo $this->getSkinUrl('images/lusopaygateway/logo.png') ?>" class="v-middle" />
3
- <!-- MB Logo -->
 
 
 
app/design/adminhtml/base/default/template/{lusopaygateway → magnimeiosgateway}/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/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; ?>
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; ?>
app/design/adminhtml/base/default/template/magnimeiosgateway/form/mark.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <!-- MB Logo -->
2
+ <img src="<?php echo $this->getSkinUrl('images/magnimeiosgateway/logo.png') ?>" class="v-middle" />
3
+ <!-- MB Logo -->
app/design/adminhtml/base/default/template/{lusopaygateway → magnimeiosgateway}/info/info.phtml RENAMED
@@ -1,7 +1,7 @@
1
 
2
  <?php
3
  //Get Referencias
4
- $referencias = $this->htmlEscape($this->getInfo()->getLusopayReferencia());
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()->getLusopayEntidade()) ?></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()->getLusopayMontante()) . ' 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()->getLusopayMontante()) . ' 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()->getMagnimeiosReferencia());
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()->getMagnimeiosEntidade()) ?></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()->getMagnimeiosMontante()) . ' 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()->getMagnimeiosMontante()) . ' 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/lusopaygateway → base/default/template/magnimeiosgateway}/info/pdf/info.phtml RENAMED
@@ -1,6 +1,6 @@
1
 
2
  <?php
3
- $referencias = $this->htmlEscape($this->getInfo()->getLusopayReferencia());
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()->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,7 +53,7 @@
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 }
1
 
2
  <?php
3
+ $referencias = $this->htmlEscape($this->getInfo()->getMagnimeiosReferencia());
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()->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
 
54
  Referência: <?php echo $int1 ?>
55
  {{pdf_row_separator}}
56
+ Valor: <?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosMontante()) . ' EUR' ?>
57
 
58
 
59
  <?php }
app/design/adminhtml/default/default/template/lusopaygateway/form/mark.phtml DELETED
@@ -1,3 +0,0 @@
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 → magnimeiosgateway}/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/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; ?>
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; ?>
app/design/adminhtml/default/default/template/magnimeiosgateway/form/mark.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <!-- MB Logo -->
2
+ <img src="<?php echo $this->getSkinUrl('images/magnimeiosgateway/logo.png') ?>" class="v-middle" />
3
+ <!-- MB Logo -->
app/design/{frontend/base/default/template/lusopaygateway → adminhtml/default/default/template/magnimeiosgateway}/info/info.phtml RENAMED
@@ -1,6 +1,7 @@
 
1
  <?php
2
  //Get Referencias
3
- $referencias = $this->htmlEscape($this->getInfo()->getLusopayReferencia());
4
 
5
  if(!is_null($referencias)){
6
 
@@ -46,7 +47,7 @@
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>
@@ -54,7 +55,7 @@
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>
@@ -82,7 +83,7 @@
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>
@@ -98,4 +99,8 @@
98
  <?php }
99
  else{
100
  echo "A geração da referencia falhou";
101
- }
 
 
 
 
1
+
2
  <?php
3
  //Get Referencias
4
+ $referencias = $this->htmlEscape($this->getInfo()->getMagnimeiosReferencia());
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()->getMagnimeiosEntidade()) ?></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()->getMagnimeiosMontante()) . ' 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()->getMagnimeiosMontante()) . ' EUR' ?></span></td>
87
  </tr>
88
  <tr>
89
  <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
99
  <?php }
100
  else{
101
  echo "A geração da referencia falhou";
102
+ }
103
+
104
+
105
+
106
+
app/design/adminhtml/{base/default/template/lusopaygateway → default/default/template/magnimeiosgateway}/info/pdf/info.phtml RENAMED
@@ -1,6 +1,6 @@
1
 
2
  <?php
3
- $referencias = $this->htmlEscape($this->getInfo()->getLusopayReferencia());
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()->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,7 +53,7 @@
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 }
1
 
2
  <?php
3
+ $referencias = $this->htmlEscape($this->getInfo()->getMagnimeiosReferencia());
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()->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
 
54
  Referência: <?php echo $int1 ?>
55
  {{pdf_row_separator}}
56
+ Valor: <?php echo $this->htmlEscape($this->getInfo()->getMagnimeiosMontante()) . ' EUR' ?>
57
 
58
 
59
  <?php }
app/design/frontend/base/default/layout/{lusopaygateway.xml → magnimeiosgateway.xml} RENAMED
@@ -2,7 +2,7 @@
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>
2
  <layout version="0.1.0">
3
  <checkout_onepage_success>
4
  <reference name="checkout.success">
5
+ <block type="magnimeiosgateway/checkout_success" name="checkout.success.lusopay.checkout" before="-" template="magnimeiosgateway/checkout/success.phtml">
6
  </reference>
7
  </checkout_onepage_success>
8
  </layout>
app/design/frontend/base/default/template/lusopaygateway/form/mark.phtml DELETED
@@ -1,3 +0,0 @@
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 → magnimeiosgateway}/checkout/success.phtml RENAMED
File without changes
app/design/frontend/base/default/template/{lusopaygateway → magnimeiosgateway}/form/form.phtml RENAMED
File without changes
app/design/frontend/base/default/template/magnimeiosgateway/form/mark.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <!-- MB Logo -->
2
+ <img src="<?php echo $this->getSkinUrl('images/magnimeiosgateway/logo.png') ?>" class="v-middle" />
3
+ <!-- MB Logo -->
app/design/{adminhtml/default/default/template/lusopaygateway → frontend/base/default/template/magnimeiosgateway}/info/info.phtml RENAMED
@@ -1,7 +1,6 @@
1
-
2
  <?php
3
  //Get Referencias
4
- $referencias = $this->htmlEscape($this->getInfo()->getLusopayReferencia());
5
 
6
  if(!is_null($referencias)){
7
 
@@ -47,7 +46,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,7 +54,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()->getLusopayMontante()) . ' EUR' ?></span></td>
59
  </tr>
60
  <tr>
61
  <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
@@ -83,7 +82,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()->getLusopayMontante()) . ' EUR' ?></span></td>
87
  </tr>
88
  <tr>
89
  <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
@@ -99,8 +98,4 @@
99
  <?php }
100
  else{
101
  echo "A geração da referencia falhou";
102
- }
103
-
104
-
105
-
106
-
 
1
  <?php
2
  //Get Referencias
3
+ $referencias = $this->htmlEscape($this->getInfo()->getMagnimeiosReferencia());
4
 
5
  if(!is_null($referencias)){
6
 
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()->getMagnimeiosEntidade()) ?></span></td>
50
  </tr>
51
  <tr>
52
  <td style="font-size: x-small; font-weight:bold; text-align:left">Referência:</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()->getMagnimeiosMontante()) . ' EUR' ?></span></td>
58
  </tr>
59
  <tr>
60
  <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</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()->getMagnimeiosMontante()) . ' EUR' ?></span></td>
86
  </tr>
87
  <tr>
88
  <td style="font-size: x-small; font-weight:bold; text-align:left">&nbsp;</td>
98
  <?php }
99
  else{
100
  echo "A geração da referencia falhou";
101
+ }
 
 
 
 
app/etc/modules/{Lusopay_Lusopaygateway.xml → Magnimeios_Magnimeiosgateway.xml} RENAMED
@@ -1,12 +1,12 @@
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>
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>
package.xml CHANGED
@@ -1,7 +1,7 @@
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>
@@ -10,9 +10,9 @@
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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Lusopay_LusopayGateway</name>
4
+ <version>2.1.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>
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-20</date>
14
+ <time>14:52:03</time>
15
+ <contents><target name="magelocal"><dir name="Magnimeios"><dir name="Magnimeiosgateway"><dir name="Block"><dir name="Checkout"><dir name="Info"><file name="LusopayMBPS.php" hash="b6274051d8914c43fddfa8d9572e2557"/><file name="LusopayMBPS.php" hash="b6274051d8914c43fddfa8d9572e2557"/></dir><file name="Success.php" hash="5768870f7c610a6d34f9ee2f80670257"/><file name="Success.php" hash="5768870f7c610a6d34f9ee2f80670257"/></dir><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"><file name="AtivarCallback.php" hash="01db9f3b75f892c68b0343b3c6f39ec9"/><dir name="Convert"><file name="Order.php" hash="4db18a43bb43a11690141dbaa8ed5799"/><file name="Quote.php" hash="2741e8f49ea614e099296a8df8318377"/><file name="Order.php" hash="4db18a43bb43a11690141dbaa8ed5799"/><file name="Quote.php" hash="2741e8f49ea614e099296a8df8318377"/></dir><file name="GerarRef.php" hash="6254717ad1913cc4e6392b33cc50c919"/><dir name="Mysql4"><file name="Setup.php" hash="99eb9cd753f0d2f58f3eb3c8ee3c6ff4"/><file name="Setup.php" hash="99eb9cd753f0d2f58f3eb3c8ee3c6ff4"/></dir><file name="PaymentAction.php" hash="52b0609d8c62770fb03ed1ca830a17a7"/><file name="AtivarCallback.php" hash="01db9f3b75f892c68b0343b3c6f39ec9"/><file name="GerarRef.php" hash="6254717ad1913cc4e6392b33cc50c919"/><file name="PaymentAction.php" hash="52b0609d8c62770fb03ed1ca830a17a7"/></dir><dir name="controllers"><file name="CallbackController.php" hash="d0d73d81fc8e814163d1b389a61291a3"/><file name="CallbackController.php" hash="d0d73d81fc8e814163d1b389a61291a3"/></dir><dir name="etc"><file name="config.xml" hash="79297d8e89fa8561ea2eddaf8fa2feba"/><file name="system.xml" hash="8c12150a0d33977951836bd63b3268c4"/><file name="config.xml" hash="79297d8e89fa8561ea2eddaf8fa2feba"/><file name="system.xml" hash="8c12150a0d33977951836bd63b3268c4"/></dir><dir name="sql"><dir name="magnimeiosgateway_setup"><file name="mysql4-install-2.1.0.php" hash="3bd68c1602cbd1b60ecb860af582bb81"/><file name="mysql4-install-2.1.0.php" hash="3bd68c1602cbd1b60ecb860af582bb81"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="magnimeiosgateway"><dir name="form"><file name="form.phtml" hash="9d041c914f3feada5a4bf4958afa04aa"/><file name="mark.phtml" hash="49b022bdb40ed3aaf8055e05a0e725f3"/></dir><dir name="info"><file name="info.phtml" hash="d07b20ae60559a61b2c8f314816da303"/><dir name="pdf"><file name="info.phtml" hash="5782769a75900a3aecae1e4e0f78b0c8"/></dir></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="magnimeiosgateway"><dir name="form"><file name="mark.phtml" hash="49b022bdb40ed3aaf8055e05a0e725f3"/><file name="form.phtml" hash="9d041c914f3feada5a4bf4958afa04aa"/></dir><dir name="info"><file name="info.phtml" hash="0fd23136fccb26bc8dca3f5a2476791e"/><dir name="pdf"><file name="info.phtml" hash="5782769a75900a3aecae1e4e0f78b0c8"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="magnimeiosgateway.xml" hash="dfceba032c2112335d3de7a876c151c0"/></dir><dir name="template"><dir name="magnimeiosgateway"><dir name="checkout"><file name="success.phtml" hash="890651282fa0b4d1cbdeaabbce67e5ce"/></dir><dir name="form"><file name="form.phtml" hash="357405fda2c5827381cba52f1871c4d8"/><file name="mark.phtml" hash="49b022bdb40ed3aaf8055e05a0e725f3"/></dir><dir name="info"><file name="info.phtml" hash="c9abacb184a9f75fb32a5a8e268a2470"/></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="base"><dir name="default"><dir name="images"><dir name="magnimeiosgateway"><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="magnimeiosgateway"><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="magnimeiosgateway"><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="magnimeiosgateway"><file name="logo.png" hash=""/><file name="Logo_Lusopay_MBePayshop125x80px.png" hash=""/></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/base/default/images/{lusopaygateway → magnimeiosgateway}/Logo_Lusopay_256x85px.png RENAMED
File without changes
skin/adminhtml/base/default/images/{lusopaygateway → magnimeiosgateway}/logo.png RENAMED
File without changes
skin/adminhtml/default/default/images/{lusopaygateway → magnimeiosgateway}/Logo_Lusopay_256x85px.png RENAMED
File without changes
skin/adminhtml/default/default/images/{lusopaygateway → magnimeiosgateway}/logo.png RENAMED
File without changes
skin/frontend/base/default/images/{lusopaygateway → magnimeiosgateway}/Logo_Lusopay_MBePayshop125x80px.png RENAMED
File without changes
skin/frontend/base/default/images/{lusopaygateway → magnimeiosgateway}/logo.png RENAMED
File without changes
skin/frontend/default/default/images/lusopaygateway/Logo_Lusopay_MBePayshop125x80px.png DELETED
Binary file
skin/frontend/default/default/images/lusopaygateway/logo.png DELETED
Binary file