Version Notes
Alteração no sql de setup para lojas com uso de prefixo na tabela...
Download this release
Release Info
| Developer | O2TI |
| Extension | o2ti_moip |
| Version | 1.2.3 |
| Comparing to | |
| See all releases | |
Code changes from version 1.2.2 to 1.2.3
- app/code/local/O2TI/Moip/Model/Api.php +3 -2
- app/code/local/O2TI/Moip/controllers/StandardController.php +10 -2
- app/code/local/O2TI/Moip/sql/moip_setup/mysql4-upgrade-0.2.1-0.2.4.php +1 -1
- app/design/frontend/base/default/template/O2TI/moip/boleto.phtml +1 -1
- app/design/frontend/base/default/template/O2TI/moip/cartao.phtml +1 -1
- app/design/frontend/base/default/template/O2TI/moip/transferencia.phtml +1 -0
- package.xml +5 -5
app/code/local/O2TI/Moip/Model/Api.php
CHANGED
|
@@ -187,9 +187,10 @@ class O2TI_Moip_Model_Api {
|
|
| 187 |
endif;
|
| 188 |
endif;
|
| 189 |
|
| 190 |
-
|
| 191 |
$alterapedido = rand(999999, 99999999);
|
| 192 |
-
|
|
|
|
| 193 |
$recebedor = array(
|
| 194 |
'LoginMoIP' => $pgto['conta_moip'],
|
| 195 |
'Apelido' => $pgto['apelido'],
|
| 187 |
endif;
|
| 188 |
endif;
|
| 189 |
|
| 190 |
+
if( Mage::getSingleton('moip/standard')->getConfigData('ambiente') == "teste")
|
| 191 |
$alterapedido = rand(999999, 99999999);
|
| 192 |
+
else
|
| 193 |
+
$alterapedido = "";
|
| 194 |
$recebedor = array(
|
| 195 |
'LoginMoIP' => $pgto['conta_moip'],
|
| 196 |
'Apelido' => $pgto['apelido'],
|
app/code/local/O2TI/Moip/controllers/StandardController.php
CHANGED
|
@@ -37,13 +37,21 @@ class O2TI_Moip_StandardController extends Mage_Core_Controller_Front_Action {
|
|
| 37 |
$ch = curl_init();
|
| 38 |
curl_setopt($ch, CURLOPT_URL,$url);
|
| 39 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
| 40 |
-
curl_setopt($ch, CURLOPT_TIMEOUT,
|
| 41 |
curl_setopt($ch, CURLOPT_POST, true);
|
| 42 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
|
| 43 |
curl_setopt($ch, CURLOPT_HTTPHEADER, array($header, $documento));
|
| 44 |
$res = curl_exec($ch);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
curl_close($ch);
|
| 46 |
|
|
|
|
| 47 |
$res = simplexml_load_string($res);
|
| 48 |
if($res->Resposta->Status == "Sucesso"){
|
| 49 |
$result['status'] = (string)$res->Resposta->Status;
|
|
@@ -57,7 +65,7 @@ class O2TI_Moip_StandardController extends Mage_Core_Controller_Front_Action {
|
|
| 57 |
else {
|
| 58 |
$result['status'] = (string)$res->Resposta->Status;
|
| 59 |
$result['erro'] = (string)$res->Resposta->Erro;
|
| 60 |
-
Mage::log(
|
| 61 |
Mage::log($xml, null, 'O2TI_Moip.log', true);
|
| 62 |
return $result;
|
| 63 |
}
|
| 37 |
$ch = curl_init();
|
| 38 |
curl_setopt($ch, CURLOPT_URL,$url);
|
| 39 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
| 40 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, 500);
|
| 41 |
curl_setopt($ch, CURLOPT_POST, true);
|
| 42 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
|
| 43 |
curl_setopt($ch, CURLOPT_HTTPHEADER, array($header, $documento));
|
| 44 |
$res = curl_exec($ch);
|
| 45 |
+
if($res === false)
|
| 46 |
+
{
|
| 47 |
+
|
| 48 |
+
Mage::log(curl_error($ch), null, 'O2TI_Moip.log', true);
|
| 49 |
+
Mage::log($xml, null, 'O2TI_Moip.log', true);
|
| 50 |
+
$this->generateToken($xml);
|
| 51 |
+
}
|
| 52 |
curl_close($ch);
|
| 53 |
|
| 54 |
+
|
| 55 |
$res = simplexml_load_string($res);
|
| 56 |
if($res->Resposta->Status == "Sucesso"){
|
| 57 |
$result['status'] = (string)$res->Resposta->Status;
|
| 65 |
else {
|
| 66 |
$result['status'] = (string)$res->Resposta->Status;
|
| 67 |
$result['erro'] = (string)$res->Resposta->Erro;
|
| 68 |
+
Mage::log("erro em status do server moip".$result['erro'], null, 'O2TI_Moip.log', true);
|
| 69 |
Mage::log($xml, null, 'O2TI_Moip.log', true);
|
| 70 |
return $result;
|
| 71 |
}
|
app/code/local/O2TI/Moip/sql/moip_setup/mysql4-upgrade-0.2.1-0.2.4.php
CHANGED
|
@@ -14,7 +14,7 @@ $installer->startSetup();
|
|
| 14 |
$tablePrefix = (string) Mage::getConfig()->getTablePrefix();
|
| 15 |
|
| 16 |
$installer->run("
|
| 17 |
-
CREATE TABLE IF NOT EXISTS `
|
| 18 |
`order_id` int(11) NOT NULL AUTO_INCREMENT,
|
| 19 |
`realorder_id` int(11) DEFAULT NULL,
|
| 20 |
`meio_pg` longtext DEFAULT NULL,
|
| 14 |
$tablePrefix = (string) Mage::getConfig()->getTablePrefix();
|
| 15 |
|
| 16 |
$installer->run("
|
| 17 |
+
CREATE TABLE IF NOT EXISTS `".$tablePrefix."o2ti_moip` (
|
| 18 |
`order_id` int(11) NOT NULL AUTO_INCREMENT,
|
| 19 |
`realorder_id` int(11) DEFAULT NULL,
|
| 20 |
`meio_pg` longtext DEFAULT NULL,
|
app/design/frontend/base/default/template/O2TI/moip/boleto.phtml
CHANGED
|
@@ -67,7 +67,7 @@ if (Mage::getSingleton('moip/standard')->getConfigData('ambiente') == "teste") {
|
|
| 67 |
</div>
|
| 68 |
</div>
|
| 69 |
</div>
|
| 70 |
-
|
| 71 |
<!-- js importantes não alterem -->
|
| 72 |
<script type="text/javascript">
|
| 73 |
//<