Eupago_MBWAY - Version 1.0.3

Version Notes

added mbway template

Download this release

Release Info

Developer Eupago
Extension Eupago_MBWAY
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/community/Eupago/Mbway/Block/Form/Mbway.php CHANGED
@@ -4,6 +4,12 @@ class Eupago_Mbway_Block_Form_Mbway extends Mage_Payment_Block_Form
4
  protected function _construct()
5
  {
6
  parent::_construct();
7
- $this->setTemplate('eupago/mbway/form/mbway.phtml');
 
 
 
 
 
 
8
  }
9
  }
4
  protected function _construct()
5
  {
6
  parent::_construct();
7
+ if(Mage::getStoreConfig('payment/mbway/frontend_template') == 'mbway')
8
+ $this->setTemplate('eupago/mbway/form/mbway.phtml');
9
+ else
10
+ $this->setTemplate('eupago/mbway/form/default.phtml');
11
+
12
+ if(Mage::getStoreConfig('payment/mbway/mostra_icon'))
13
+ $this->setMethodLabelAfterHtml('<img style="padding:0 5px;"src="'.$this->getSkinUrl('images/eupago/mbway/mbway_icon.png').'" />');
14
  }
15
  }
app/code/community/Eupago/Mbway/Block/Info/Mbway.php CHANGED
@@ -4,7 +4,10 @@ class Eupago_Mbway_Block_Info_Mbway extends Mage_Payment_Block_Info
4
  protected function _construct()
5
  {
6
  parent::_construct();
7
- $this->setTemplate('eupago/mbway/info/mbway.phtml');
 
 
 
8
  }
9
 
10
  public function getInfo()
@@ -28,5 +31,10 @@ class Eupago_Mbway_Block_Info_Mbway extends Mage_Payment_Block_Info
28
  public function getMethod()
29
  {
30
  return $this->getInfo()->getMethodInstance();
 
 
 
 
 
31
  }
32
  }
4
  protected function _construct()
5
  {
6
  parent::_construct();
7
+ if(Mage::getStoreConfig('payment/mbway/frontend_template') == 'mbway')
8
+ $this->setTemplate('eupago/mbway/info/mbway.phtml');
9
+ else
10
+ $this->setTemplate('eupago/mbway/info/default.phtml');
11
  }
12
 
13
  public function getInfo()
31
  public function getMethod()
32
  {
33
  return $this->getInfo()->getMethodInstance();
34
+ }
35
+
36
+ public function getMethodCode()
37
+ {
38
+ return $this->getInfo()->getMethodInstance()->getCode();
39
  }
40
  }
app/code/community/Eupago/Mbway/Model/Mbway.php CHANGED
@@ -166,7 +166,6 @@ class Eupago_Mbway_Model_Mbway extends Mage_Payment_Model_Method_Abstract{
166
  }
167
  $info = $this->getInfoInstance();
168
  $info->setAdditionalInformation('mbway_phone_number', $data->getMbwayPhoneNumber());
169
- //$info->setMbwayPhoneNumber($data->getMbwayPhoneNumber());
170
 
171
  return $this;
172
  }
@@ -189,5 +188,5 @@ class Eupago_Mbway_Model_Mbway extends Mage_Payment_Model_Method_Abstract{
189
 
190
  return $this;
191
  }
192
-
193
  }
166
  }
167
  $info = $this->getInfoInstance();
168
  $info->setAdditionalInformation('mbway_phone_number', $data->getMbwayPhoneNumber());
 
169
 
170
  return $this;
171
  }
188
 
189
  return $this;
190
  }
191
+
192
  }
app/code/community/Eupago/Mbway/Model/System/Config/Template.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Eupago_Mbway_Model_System_Config_Template
3
+ {
4
+ /**
5
+ * Options getter
6
+ *
7
+ * @return array
8
+ */
9
+ public function toOptionArray()
10
+ {
11
+ return array(
12
+ array('value' => 'nenhum', 'label' => Mage::helper('adminhtml')->__('Nenhum')),
13
+ array('value' => 'mbway', 'label' => Mage::helper('adminhtml')->__('Mbway')),
14
+ );
15
+ }
16
+
17
+ /**
18
+ * Get options in "key-value" format
19
+ *
20
+ * @return array
21
+ */
22
+ public function toArray()
23
+ {
24
+ return array(
25
+ 'nenhum' => Mage::helper('adminhtml')->__('Nenhum'),
26
+ 'mbway' => Mage::helper('adminhtml')->__('Mbway'),
27
+ );
28
+ }
29
+ }
app/code/community/Eupago/Mbway/etc/config.xml CHANGED
@@ -16,13 +16,6 @@
16
  <class>Eupago_Mbway_Model</class>
17
  </mbway>
18
  </models>
19
- <fieldsets>
20
- <sales_convert_quote_payment>
21
- <mbway_phone_number>
22
- <to_order_payment>*</to_order_payment>
23
- </mbway_phone_number>
24
- </sales_convert_quote_payment>
25
- </fieldsets>
26
  </global>
27
  <frontend>
28
  <routers>
16
  <class>Eupago_Mbway_Model</class>
17
  </mbway>
18
  </models>
 
 
 
 
 
 
 
19
  </global>
20
  <frontend>
21
  <routers>
app/code/community/Eupago/Mbway/etc/system.xml CHANGED
@@ -33,18 +33,38 @@
33
  <frontend_type>text</frontend_type>
34
  <sort_order>3</sort_order>
35
  <show_in_default>1</show_in_default>
36
- <show_in_website>1</show_in_website>
37
- <show_in_store>1</show_in_store>
38
  </chave>
39
  <order_status translate="label">
40
  <label>New order status</label>
41
  <frontend_type>select</frontend_type>
42
  <source_model>adminhtml/system_config_source_order_status_new</source_model>
43
- <sort_order>6</sort_order>
44
  <show_in_default>1</show_in_default>
45
  <show_in_website>1</show_in_website>
46
  <show_in_store>0</show_in_store>
47
  </order_status>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  </fields>
49
  </mbway>
50
  </groups>
33
  <frontend_type>text</frontend_type>
34
  <sort_order>3</sort_order>
35
  <show_in_default>1</show_in_default>
36
+ <show_in_website>0</show_in_website>
37
+ <show_in_store>0</show_in_store>
38
  </chave>
39
  <order_status translate="label">
40
  <label>New order status</label>
41
  <frontend_type>select</frontend_type>
42
  <source_model>adminhtml/system_config_source_order_status_new</source_model>
43
+ <sort_order>4</sort_order>
44
  <show_in_default>1</show_in_default>
45
  <show_in_website>1</show_in_website>
46
  <show_in_store>0</show_in_store>
47
  </order_status>
48
+ <mostra_icon translate="label">
49
+ <label>Show icon</label>
50
+ <comment>Mostra icon do mbway na listagem de metodos de pagamento antes do titulo</comment>
51
+ <frontend_type>select</frontend_type>
52
+ <source_model>adminhtml/system_config_source_yesno</source_model>
53
+ <sort_order>5</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>0</show_in_store>
57
+ </mostra_icon>
58
+ <frontend_template translate="label">
59
+ <label>Frontend Template</label>
60
+ <comment>Selecione o tema e defina como os seus clientes vêm este método de pagamento</comment>
61
+ <frontend_type>select</frontend_type>
62
+ <source_model>mbway/system_config_template</source_model>
63
+ <sort_order>6</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>0</show_in_store>
67
+ </frontend_template>
68
  </fields>
69
  </mbway>
70
  </groups>
app/design/frontend/base/default/template/eupago/mbway/form/default.phtml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_code=$this->getMethodCode(); echo $this->getMethod()->getConfigData('message');?>
2
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
3
+ <li>
4
+ <span class="input-box">
5
+ <label for="<?php echo $_code ?>_mbway_phone_number" class="required"><em>*</em><?php echo $this->__('Numero Mbway') ?></label>
6
+ <input type="text" title="<?php echo $this->__('Número Mbway:') ?>" class="input-text required-entry" id="<?php echo $_code ?>_mbway_phone_number" name="payment[mbway_phone_number]" value="<?php echo $this->htmlEscape($this->getInfoData('mbway_phone_number')) ?>" />
7
+ </span>
8
+ </li>
9
+ </ul>
10
+
app/design/frontend/base/default/template/eupago/mbway/form/mbway.phtml CHANGED
@@ -1,11 +1,17 @@
1
- <?php $_code=$this->getMethodCode() ?>
2
- <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
3
- <li>
4
- <span class="input-box">
5
- <label for="<?php echo $_code ?>_mbway_phone_number" class="required"><em>*</em><?php echo $this->__('Numero Mbway') ?></label>
6
- <input type="text" title="<?php echo $this->__('Número Mbway:') ?>" class="input-text required-entry" id="<?php echo $_code ?>_mbway_phone_number" name="payment[mbway_phone_number]" value="<?php echo $this->htmlEscape($this->getInfoData('mbway_phone_number')) ?>" />
7
- </span>
8
- </li>
9
- </ul>
10
- <div>
11
- <?php echo $this->getMethod()->getConfigData('message');?>
 
 
 
 
 
 
1
+ <?php $_code=$this->getMethodCode(); echo $this->getMethod()->getConfigData('message'); ?>
2
+ <fieldset class="form-list">
3
+ <ul id="payment_form_<?php echo $this->getMethodCode(); ?>" style="display:none">
4
+ <table cellpadding="0" cellspacing="0" border="0" style="max-width: 370px; color:#666; background-color: #f1f1f1; height: 50px; margin: 10px 0; border: 0px solid #d70510;">
5
+ <tr>
6
+ <td style="border: 0; padding:5px; margin:0; background-color: #D80410; color: #f1f1f1; text-align: center; font-size:small;" colspan="3">Pagamento por MB Way</td>
7
+ </tr>
8
+ <tr>
9
+ <td style="padding: 10px 10px 0 10px;"><label for="<?php echo $_code ?>_mbway_phone_number" class="required"><em>*</em><?php echo $this->__('Insira o número de telefone') ?></label><input style="width:100% !important" type="text" title="<?php echo $this->__('Número Mbway:') ?>" placeholder="<?php echo $this->__('Número Mbway') ?>" class="input-text required-entry" id="<?php echo $_code ?>_mbway_phone_number" name="payment[mbway_phone_number]" value="<?php echo $this->htmlEscape($this->getInfoData('mbway_phone_number')) ?>" />
10
+ </tr>
11
+ <tr>
12
+ <td style="border: 0; padding:10px; margin:0; color: #666; font-size:small;"><?php echo $this->__('Se ainda não instalou a aplicação no smartphone ou ainda não aderiu ao serviço mbway, por favor consulte este'); ?> <a target="_blank" href="https://www.mbway.pt/" >link</a>. </p></td>
13
+ </tr>
14
+ </table>
15
+ </ul>
16
+ </fieldset>
17
+
app/design/frontend/base/default/template/eupago/mbway/info/default.phtml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul id="payment_info_<?php echo $this->getMethodCode() ?>">
2
+ <li style="min-width: 300px;">
3
+ <h4>Mbway</h4>
4
+ <?php
5
+ $mbway_data = $this->getMbwayData();
6
+ if(isset($mbway_data->pedido) && $mbway_data->pedido != ""){
7
+ echo $this->__('Nº Telefone: ').$mbway_data->mbway_phone_number."</br>"
8
+ .$this->__('Nº Pedido: ').$mbway_data->pedido."</br>".$this->__('Valor: ')
9
+ .number_format($mbway_data->valor,2)." EUR";
10
+ }else
11
+ echo $this->__('Vai receber nos seus dispositivos inscritos no MB WAY um pedido de pagamento. Para validar a compra basta aceitar e introduzir o seu PIN MB WAY.') ?>
12
+ </li>
13
+ </ul>
app/design/frontend/base/default/template/eupago/mbway/info/mbway.phtml CHANGED
@@ -1,7 +1,39 @@
1
  <ul id="payment_info_<?php echo $this->getMethodCode() ?>">
2
- <li>
3
- <h4>Mbway</h4>
4
- <?php echo $this->__('Vai receber nos seus dispositivos inscritos no MB WAY um pedido de pagamento. Para validar a compra basta aceitar e introduzir o seu PIN MB WAY.') ?>
5
- <!-- <p><?php //echo $this->__('Para saber mais acerca do mbway por favor clique ') ?><a target="blank" href="https://www.mbway.pt/">aqui</a></p> -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  </li>
7
  </ul>
1
  <ul id="payment_info_<?php echo $this->getMethodCode() ?>">
2
+ <li style="min-width: 300px;">
3
+ <?php
4
+ $mbway_data = $this->getMbwayData();
5
+ if(isset($mbway_data->pedido) && $mbway_data->pedido != ""){?>
6
+ <div align='center'>
7
+ <table cellpadding="0" cellspacing="0" border="0" style="width: 370px; color:#666; background-color: #f1f1f1; height: 50px; margin: 10px 0; border: 0px solid #d70510;">
8
+ <tbody><tr style=" font-size:small; border:0;">
9
+ <td style="border: 0; padding:5px; margin:0; background-color: #D80410; color: #f1f1f1; text-align: center; font-size:small;" colspan="3">Pagamento por MB Way</td>
10
+ </tr>
11
+ <tr style=" font-size:small; border:0;">
12
+ <td rowspan="4" style=" font-size:small;padding: 0 0 0 20px;vertical-align: middle; border:0; "><img src="<?php echo $this->getSkinUrl('images/eupago/mbway/MBWAY_RGB_positivo_s.png'); ?>" style="margin-bottom: 0px; margin-right: 5px;"></td>
13
+
14
+ </tr>
15
+ <tr style=" font-size:small; border:0;">
16
+ <td style="border:0; padding:10px 8px 0 8px;"><?php echo $this->__('Nº Telefone') ?></td>
17
+ <td style="border:0; padding:10px 8px 0 8px;"><?php echo $mbway_data->mbway_phone_number; ?></td>
18
+ </tr>
19
+ <tr style=" font-size:small; border:0;">
20
+ <td style="border:0; padding:10px 8px 0 8px;"><?php echo $this->__('Nº Pedido') ?></td>
21
+ <td style="border:0; padding:10px 8px 0 8px;"><?php echo $mbway_data->pedido; ?></td>
22
+ </tr>
23
+ <tr style=" font-size:small; border:0;">
24
+ <td style="border:0; padding:8px ; "><?php echo $this->__('Valor') ?></td>
25
+ <td style="border:0; padding:8px ;"><?php echo number_format($mbway_data->valor,2).' EUR'; ?> </td>
26
+ </tr>
27
+ <tr>
28
+ <td style="text-align:center;padding-top:5px; font-size: xx-small;border:0; border-top: 0px solid #ddd; background-color: #fff; color: #666" colspan="3"><?php echo $this->__('Foi enviado um pedido de pagamento para o seu smartphone.') ?></td>
29
+ </tr>
30
+ </tbody>
31
+ </table>
32
+ </div>
33
+ <?php }else{
34
+ echo "<h4>Mbway</h4>";
35
+ echo $this->__('Vai receber nos seus dispositivos inscritos no MB WAY um pedido de pagamento. Para validar a compra basta aceitar e introduzir o seu PIN MB WAY.');
36
+ }?>
37
+
38
  </li>
39
  </ul>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
- <name>Eupago_Mbway</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -11,11 +11,11 @@
11
  &#xD;
12
  [EN] - Allow payments by mbway app&#xD;
13
  </description>
14
- <notes>re-orders is now avaiable</notes>
15
  <authors><author><name>Eupago</name><user>eupago</user><email>suporte@eupago.pt</email></author></authors>
16
- <date>2016-11-14</date>
17
- <time>16:38:49</time>
18
- <contents><target name="magecommunity"><dir name="Eupago"><dir name="Mbway"><dir name="Block"><dir name="Form"><file name="Mbway.php" hash="27853132998649907104c43546563bac"/></dir><dir name="Info"><file name="Mbway.php" hash="f9f3c4bc85505be3abcbe31011f68cda"/></dir></dir><dir name="Model"><file name="Mbway.php" hash="4feb7fb37bb9a008c7fd427ed5a3c9af"/></dir><dir name="controllers"><file name="CallbackController.php" hash="162e06ac5e37ae219b2ad83ff3fb38e9"/></dir><dir name="etc"><file name="config.xml" hash="4b38c359f8d9a900dc1a78c1b9ce0185"/><file name="system.xml" hash="c44f0320187747999a57205ee2e76b9d"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eupago_Mbway.xml" hash="1a844093c055d916fc3cc16fa9c86f64"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="eupago"><dir name="mbway"><dir name="form"><file name="mbway.phtml" hash="1fa44aab0a61a78c9a2abf4604264db2"/></dir><dir name="info"><file name="mbway.phtml" hash="2ed70855f58e82278d303695d5194695"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="eupago"><dir name="mbway"><dir name="form"><file name="mbway.phtml" hash="1fa44aab0a61a78c9a2abf4604264db2"/></dir><dir name="info"><file name="mbway.phtml" hash="2486d82ad350cd29d0640ba8799280c0"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
+ <name>Eupago_MBWAY</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
11
  &#xD;
12
  [EN] - Allow payments by mbway app&#xD;
13
  </description>
14
+ <notes>added mbway template</notes>
15
  <authors><author><name>Eupago</name><user>eupago</user><email>suporte@eupago.pt</email></author></authors>
16
+ <date>2016-12-07</date>
17
+ <time>15:29:45</time>
18
+ <contents><target name="magecommunity"><dir name="Eupago"><dir name="Mbway"><dir name="Block"><dir name="Form"><file name="Mbway.php" hash="87f0784cd78d5ce7cfbe532133070d15"/></dir><dir name="Info"><file name="Mbway.php" hash="acadf6f16d5b118124f723ca49aa45be"/></dir></dir><dir name="Model"><file name="Mbway.php" hash="68a6d4f4072a31bd1c94f478ac6a9f17"/><dir name="System"><dir name="Config"><file name="Template.php" hash="718050382dd9d91d291e7827f3267b8e"/></dir></dir></dir><dir name="controllers"><file name="CallbackController.php" hash="162e06ac5e37ae219b2ad83ff3fb38e9"/></dir><dir name="etc"><file name="config.xml" hash="1aa33d93a198cb5ccb97233b3563e453"/><file name="system.xml" hash="033bf9badb6cde28ffb67982a3c821aa"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eupago_Mbway.xml" hash="1a844093c055d916fc3cc16fa9c86f64"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="eupago"><dir name="mbway"><dir name="form"><file name="default.phtml" hash="2325880e1c94f851c8379996786e128f"/><file name="mbway.phtml" hash="3ca1a607601ca50e70b75ad625032cd9"/></dir><dir name="info"><file name="default.phtml" hash="df73cde94c9f2d9e189396ffe9afbaa3"/><file name="mbway.phtml" hash="cab1c28cdf664e28c496ad8ea4edc5a0"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="eupago"><dir name="mbway"><dir name="form"><file name="mbway.phtml" hash="1fa44aab0a61a78c9a2abf4604264db2"/></dir><dir name="info"><file name="mbway.phtml" hash="2486d82ad350cd29d0640ba8799280c0"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
21
  </package>