Version Notes
- Order automatic update
- callback
Download this release
Release Info
Developer | Eupago |
Extension | Eupago_MBWAY |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
app/code/community/Eupago/Mbway/controllers/CallbackController.php
CHANGED
@@ -3,7 +3,8 @@
|
|
3 |
class Eupago_Mbway_CallbackController extends Mage_Core_Controller_Front_Action { // extends Mage_Payment_Model_Method_Abstract
|
4 |
|
5 |
public function autorizeAction(){
|
6 |
-
|
|
|
7 |
///// dados vindos da api para comfirmar
|
8 |
$CallBack = $this->getRequest()->getParams();
|
9 |
$CallBack_valor = $CallBack['valor'];
|
@@ -11,7 +12,7 @@ class Eupago_Mbway_CallbackController extends Mage_Core_Controller_Front_Action
|
|
11 |
$CallBack_chave_api = $CallBack['chave_api'];
|
12 |
$CallBack_orderId = $CallBack['identificador'];
|
13 |
$CallBack_autorizacao = $CallBack['autorizacao'];
|
14 |
-
|
15 |
|
16 |
//mp
|
17 |
//pc:pt -> mbway
|
@@ -33,21 +34,24 @@ class Eupago_Mbway_CallbackController extends Mage_Core_Controller_Front_Action
|
|
33 |
$valor_gerado = $pagamento->eupago_montante;
|
34 |
|
35 |
/////// dados do pagamento MBW
|
36 |
-
$
|
37 |
-
$alias = $
|
38 |
-
$referenciaMBW = $
|
|
|
39 |
|
40 |
|
41 |
/////// gera autorizacao
|
42 |
$chave_api = Mage::getModel('mbway/process')->getConfigData('chave');
|
43 |
$autorizacao = md5(date('Y-m-d').$chave_api);
|
44 |
-
|
|
|
45 |
//////// Confere dados
|
46 |
-
$confere_montantes = (($valor_encomenda == $
|
47 |
$confere_autorizacao = ($autorizacao == $CallBack_autorizacao ? true : false);
|
48 |
-
$confere_referencia = ($
|
49 |
$confere_chave_api = ($CallBack_chave_api == $chave_api ? true : false);
|
50 |
-
|
|
|
51 |
////// se tudo ok, faz o update do estado da encomenda e envia um email ao cliente
|
52 |
if($confere_montantes && $confere_chave_api && $confere_referencia){ /*futuro upgrade -> $confere_autorizacao*/
|
53 |
$order->setData('state', "complete");
|
3 |
class Eupago_Mbway_CallbackController extends Mage_Core_Controller_Front_Action { // extends Mage_Payment_Model_Method_Abstract
|
4 |
|
5 |
public function autorizeAction(){
|
6 |
+
|
7 |
+
|
8 |
///// dados vindos da api para comfirmar
|
9 |
$CallBack = $this->getRequest()->getParams();
|
10 |
$CallBack_valor = $CallBack['valor'];
|
12 |
$CallBack_chave_api = $CallBack['chave_api'];
|
13 |
$CallBack_orderId = $CallBack['identificador'];
|
14 |
$CallBack_autorizacao = $CallBack['autorizacao'];
|
15 |
+
//$CallBack_autorizacao = $CallBack['mp'];
|
16 |
|
17 |
//mp
|
18 |
//pc:pt -> mbway
|
34 |
$valor_gerado = $pagamento->eupago_montante;
|
35 |
|
36 |
/////// dados do pagamento MBW
|
37 |
+
$pagamentoMBW = $order->getPayment();
|
38 |
+
$alias = $pagamentoMBW->eupago_mbw_alias;
|
39 |
+
$referenciaMBW = $pagamentoMBW->eupago_mbw_referencia;
|
40 |
+
$valor_geradoMBW = $pagamentoMBW->eupago_mbw_montante;
|
41 |
|
42 |
|
43 |
/////// gera autorizacao
|
44 |
$chave_api = Mage::getModel('mbway/process')->getConfigData('chave');
|
45 |
$autorizacao = md5(date('Y-m-d').$chave_api);
|
46 |
+
|
47 |
+
|
48 |
//////// Confere dados
|
49 |
+
$confere_montantes = (($valor_encomenda == $valor_geradoMBW) == $CallBack_valor ? true : false);
|
50 |
$confere_autorizacao = ($autorizacao == $CallBack_autorizacao ? true : false);
|
51 |
+
$confere_referencia = ($referenciaMBW == $CallBack_referencia ? true : false);
|
52 |
$confere_chave_api = ($CallBack_chave_api == $chave_api ? true : false);
|
53 |
+
|
54 |
+
|
55 |
////// se tudo ok, faz o update do estado da encomenda e envia um email ao cliente
|
56 |
if($confere_montantes && $confere_chave_api && $confere_referencia){ /*futuro upgrade -> $confere_autorizacao*/
|
57 |
$order->setData('state', "complete");
|
app/etc/modules/Eupago_Mbway.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<modules>
|
4 |
<Eupago_Mbway>
|
5 |
<active>true</active>
|
6 |
-
<codePool>
|
7 |
-
|
8 |
</modules>
|
9 |
</config>
|
3 |
<modules>
|
4 |
<Eupago_Mbway>
|
5 |
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Eupago_Mbway>
|
8 |
</modules>
|
9 |
</config>
|
package.xml
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Eupago_MBWAY</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Modulo de pagamento para MBWAY</summary>
|
10 |
<description>Método de pagamento para MBWAY</description>
|
11 |
-
<notes>-
|
|
|
12 |
<authors><author><name>euPago</name><user>euPago</user><email>dev@eupago.pt</email></author></authors>
|
13 |
-
<date>2016-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Eupago"><dir name="Mbway"><dir name="Block"><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/><dir name="Onepage"><file name="Success.phtml" hash="08fa78dfdbc11b7fd25b5f0bc5e5f117"/><file name="Success.phtml" hash="08fa78dfdbc11b7fd25b5f0bc5e5f117"/><file name="Success.phtml" hash="08fa78dfdbc11b7fd25b5f0bc5e5f117"/></dir><file name="Success.php" hash="a9908a23e6c7987e63f420dec16610a8"/><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/><file name="Success.php" hash="a9908a23e6c7987e63f420dec16610a8"/><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/><file name="Success.php" hash="a9908a23e6c7987e63f420dec16610a8"/><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/></dir><dir name="Helper"><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/></dir><dir name="Model"><dir name="Convert"><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/></dir><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><dir name="Mysql4"><file name="Setup.php" hash="01c41be63649dd0d1f4ab113ecbc7997"/><file name="Setup.php" hash="01c41be63649dd0d1f4ab113ecbc7997"/><file name="Setup.php" hash="01c41be63649dd0d1f4ab113ecbc7997"/></dir><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><dir name="Mysgl4"><file name="Setup.php" hash=""/></dir></dir><dir name="controllers"><file name="CallbackController.php" hash="
|
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>Eupago_MBWAY</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Modulo de pagamento para MBWAY</summary>
|
10 |
<description>Método de pagamento para MBWAY</description>
|
11 |
+
<notes>- Order automatic update
|
12 |
+
- callback</notes>
|
13 |
<authors><author><name>euPago</name><user>euPago</user><email>dev@eupago.pt</email></author></authors>
|
14 |
+
<date>2016-02-09</date>
|
15 |
+
<time>17:09:25</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Eupago"><dir name="Mbway"><dir name="Block"><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/><dir name="Onepage"><file name="Success.phtml" hash="08fa78dfdbc11b7fd25b5f0bc5e5f117"/><file name="Success.phtml" hash="08fa78dfdbc11b7fd25b5f0bc5e5f117"/><file name="Success.phtml" hash="08fa78dfdbc11b7fd25b5f0bc5e5f117"/></dir><file name="Success.php" hash="a9908a23e6c7987e63f420dec16610a8"/><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/><file name="Success.php" hash="a9908a23e6c7987e63f420dec16610a8"/><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/><file name="Success.php" hash="a9908a23e6c7987e63f420dec16610a8"/><file name="Form.php" hash="457132b29be361ff58808f896bbcd51a"/><file name="Info.php" hash="47d3ac60276c028e5e207c87ab5f8fca"/></dir><dir name="Helper"><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/><file name="Data.php" hash="42b48d62c5c77cd4d511c12c8743b461"/></dir><dir name="Model"><dir name="Convert"><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/><file name="Order.php" hash="dcabdd5c4cbe88508a65148af27a676f"/><file name="Quote.php" hash="110590303af75aa88aa1b3f630421c4f"/></dir><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><dir name="Mysql4"><file name="Setup.php" hash="01c41be63649dd0d1f4ab113ecbc7997"/><file name="Setup.php" hash="01c41be63649dd0d1f4ab113ecbc7997"/><file name="Setup.php" hash="01c41be63649dd0d1f4ab113ecbc7997"/></dir><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><file name="GerarRef.php" hash="14251d34e77c9d6910237da24e942b79"/><file name="PaymentAction.php" hash="6306b0a94106f6a461e2ac477518a891"/><file name="Process.php" hash="67d83962812fa838bc78042acc10bf91"/><dir name="Mysgl4"><file name="Setup.php" hash=""/></dir></dir><dir name="controllers"><file name="CallbackController.php" hash="2f9bcf94d35be8d23be571265a068b58"/><file name="CallbackController.php" hash="2f9bcf94d35be8d23be571265a068b58"/><file name="CallbackController.php" hash="2f9bcf94d35be8d23be571265a068b58"/><file name="CallbackController.php" hash="2f9bcf94d35be8d23be571265a068b58"/></dir><dir name="etc"><file name="config.xml" hash="311886de7d89f451650f42af2e1a6932"/><file name="system.xml" hash="9ed7bc7fbcdd13fb87169fa7e582537f"/><file name="config.xml" hash="311886de7d89f451650f42af2e1a6932"/><file name="system.xml" hash="9ed7bc7fbcdd13fb87169fa7e582537f"/><file name="config.xml" hash="311886de7d89f451650f42af2e1a6932"/><file name="system.xml" hash="9ed7bc7fbcdd13fb87169fa7e582537f"/><file name="config.xml" hash="311886de7d89f451650f42af2e1a6932"/><file name="system.xml" hash="9ed7bc7fbcdd13fb87169fa7e582537f"/></dir><dir name="sql"><dir name="mbway_setup"><file name="mysql4-install-1.0.0.php" hash="88957e805ec4b644f266271fe07114db"/><file name="mysql4-install-1.0.0.php" hash="88957e805ec4b644f266271fe07114db"/><file name="mysql4-install-1.0.0.php" hash="88957e805ec4b644f266271fe07114db"/><file name="mysql4-install-1.0.0.php" hash="88957e805ec4b644f266271fe07114db"/><file name="mysql4-install-1.0.0.php" hash="88957e805ec4b644f266271fe07114db"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eupago_Mbway.xml" hash="c37793843e7666d45c6b5fa692007746"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="mbway"><dir name="form"><file name="form.phtml" hash="6c316b9faa97227b78230c22f3ae991b"/><file name="mark.phtml" hash="f013b5347041ada0961252129b44127a"/><file name="form.phtml" hash="6c316b9faa97227b78230c22f3ae991b"/><file name="mark.phtml" hash="f013b5347041ada0961252129b44127a"/><file name="form.phtml" hash="6c316b9faa97227b78230c22f3ae991b"/><file name="mark.phtml" hash="f013b5347041ada0961252129b44127a"/></dir><dir name="info"><file name="info.phtml" hash="d0af4f680c201f7d79813ac08df93683"/><dir name="pdf"><file name="info.phtml" hash="30d8927be3ac9f8ec898b21a58d1c574"/><file name="info.phtml" hash="30d8927be3ac9f8ec898b21a58d1c574"/><file name="info.phtml" hash="30d8927be3ac9f8ec898b21a58d1c574"/><file name="info.phtml" hash="30d8927be3ac9f8ec898b21a58d1c574"/></dir><file name="info.phtml" hash="d0af4f680c201f7d79813ac08df93683"/><file name="info.phtml" hash="d0af4f680c201f7d79813ac08df93683"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="mbway"><dir name="checkout"><file name="success.phtml" hash="f0793610fb7183301f0784fb128ec057"/><file name="success.phtml" hash="f0793610fb7183301f0784fb128ec057"/><file name="success.phtml" hash="f0793610fb7183301f0784fb128ec057"/></dir><dir name="form"><file name="form.phtml" hash="e5eefe077cf0e24992c1c347dc77baf1"/><file name="mark.phtml" hash="a5c4ad861ceaa58b07266fcfd9393ca8"/><file name="form.phtml" hash="e5eefe077cf0e24992c1c347dc77baf1"/><file name="mark.phtml" hash="a5c4ad861ceaa58b07266fcfd9393ca8"/><file name="form.phtml" hash="e5eefe077cf0e24992c1c347dc77baf1"/><file name="mark.phtml" hash="a5c4ad861ceaa58b07266fcfd9393ca8"/></dir><dir name="info"><file name="info.phtml" hash="d67bc540251df859b325dc903cf5815a"/><file name="info.phtml" hash="d67bc540251df859b325dc903cf5815a"/><file name="info.phtml" hash="d67bc540251df859b325dc903cf5815a"/></dir></dir></dir><dir name="layout"><file name="mbway.xml" hash="3abe3cd742f4651a49b5f9bdb986a59e"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="mbway"><file name="eupagombway.png" hash="0b8ff29352f558fc8e756339a337a885"/><file name="eupagombway.png" hash="0b8ff29352f558fc8e756339a337a885"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="mbway"><file name="eupagombway.png" hash="0ca321915123d5a712fb2b4f6744278a"/><file name="mb_mark.gif" hash="bbfd7b49dc892a72a8a87d8d1ae3e4ee"/><file name="eupagombway.png" hash="0ca321915123d5a712fb2b4f6744278a"/><file name="mb_mark.gif" hash="bbfd7b49dc892a72a8a87d8d1ae3e4ee"/></dir></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|