Version Notes
Versão estável.
Os bugs devem ser reportador na área de Issues no github do projeto em https://github.com/r-martins/PagSeguro-Magento-Transparente
Download this release
Release Info
| Developer | Ricardo Martins |
| Extension | RicardoMartins_PagSeguro |
| Version | 1.0.4 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.1 to 1.0.4
- app/code/community/RicardoMartins/PagSeguro/Helper/Data.php +1 -3
- app/code/community/RicardoMartins/PagSeguro/Helper/Params.php +1 -1
- app/code/community/RicardoMartins/PagSeguro/Model/Abstract.php +2 -2
- app/code/community/RicardoMartins/PagSeguro/Model/Payment/Cc.php +10 -1
- app/code/community/RicardoMartins/PagSeguro/etc/config.xml +1 -1
- app/code/community/RicardoMartins/PagSeguro/etc/system.xml +1 -1
- app/design/adminhtml/base/default/template/ricardomartins_pagseguro/form/info/cc.phtml +5 -1
- app/design/frontend/base/default/template/ricardomartins_pagseguro/form/info/cc.phtml +5 -1
- package.xml +5 -5
app/code/community/RicardoMartins/PagSeguro/Helper/Data.php
CHANGED
|
@@ -115,8 +115,6 @@ class RicardoMartins_PagSeguro_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 115 |
}else{
|
| 116 |
Mage::log(var_export($obj, true), Zend_Log::DEBUG, 'pagseguro.log', true);
|
| 117 |
}
|
| 118 |
-
}else{
|
| 119 |
-
Mage::log(var_export('debug inativo', true), null, 'martins.log', true);
|
| 120 |
}
|
| 121 |
}
|
| 122 |
|
|
@@ -138,4 +136,4 @@ class RicardoMartins_PagSeguro_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 138 |
|
| 139 |
return Mage::helper('core')->decrypt($token);
|
| 140 |
}
|
| 141 |
-
}
|
| 115 |
}else{
|
| 116 |
Mage::log(var_export($obj, true), Zend_Log::DEBUG, 'pagseguro.log', true);
|
| 117 |
}
|
|
|
|
|
|
|
| 118 |
}
|
| 119 |
}
|
| 120 |
|
| 136 |
|
| 137 |
return Mage::helper('core')->decrypt($token);
|
| 138 |
}
|
| 139 |
+
}
|
app/code/community/RicardoMartins/PagSeguro/Helper/Params.php
CHANGED
|
@@ -49,7 +49,7 @@ class RicardoMartins_PagSeguro_Helper_Params extends Mage_Core_Helper_Abstract
|
|
| 49 |
|
| 50 |
|
| 51 |
$retorno = array(
|
| 52 |
-
'senderName' => sprintf('%s %s'
|
| 53 |
'senderEmail' => $order->getCustomerEmail(),
|
| 54 |
'senderHash' => $payment['additional_information']['sender_hash'],
|
| 55 |
'senderCPF' => $digits->filter($cpf),
|
| 49 |
|
| 50 |
|
| 51 |
$retorno = array(
|
| 52 |
+
'senderName' => sprintf('%s %s',trim($order->getCustomerFirstname()), trim($order->getCustomerLastname())),
|
| 53 |
'senderEmail' => $order->getCustomerEmail(),
|
| 54 |
'senderHash' => $payment['additional_information']['sender_hash'],
|
| 55 |
'senderCPF' => $digits->filter($cpf),
|
app/code/community/RicardoMartins/PagSeguro/Model/Abstract.php
CHANGED
|
@@ -28,12 +28,12 @@ class RicardoMartins_PagSeguro_Model_Abstract extends Mage_Payment_Model_Method_
|
|
| 28 |
if($order->canCancel())
|
| 29 |
{
|
| 30 |
$payment->registerRefundNotification(floatval($resultXML->grossAmount));
|
| 31 |
-
$order->cancel();
|
| 32 |
-
$order->save();
|
| 33 |
}else{
|
| 34 |
$order->addStatusHistoryComment('Devolvido: o valor foi devolvido ao comprador, mas o pedido encontra-se em um estado que não pode ser cancelado.')
|
| 35 |
->save();
|
| 36 |
}
|
|
|
|
|
|
|
| 37 |
}
|
| 38 |
|
| 39 |
if($processedState->getStateChanged())
|
| 28 |
if($order->canCancel())
|
| 29 |
{
|
| 30 |
$payment->registerRefundNotification(floatval($resultXML->grossAmount));
|
|
|
|
|
|
|
| 31 |
}else{
|
| 32 |
$order->addStatusHistoryComment('Devolvido: o valor foi devolvido ao comprador, mas o pedido encontra-se em um estado que não pode ser cancelado.')
|
| 33 |
->save();
|
| 34 |
}
|
| 35 |
+
$order->cancel();
|
| 36 |
+
$order->save();
|
| 37 |
}
|
| 38 |
|
| 39 |
if($processedState->getStateChanged())
|
app/code/community/RicardoMartins/PagSeguro/Model/Payment/Cc.php
CHANGED
|
@@ -84,7 +84,16 @@ class RicardoMartins_PagSeguro_Model_Payment_Cc extends RicardoMartins_PagSeguro
|
|
| 84 |
}
|
| 85 |
|
| 86 |
if(isset($xmlRetorno->code)){
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
}
|
| 89 |
return $this;
|
| 90 |
}
|
| 84 |
}
|
| 85 |
|
| 86 |
if(isset($xmlRetorno->code)){
|
| 87 |
+
|
| 88 |
+
$additional = array('transaction_id'=>(string)$xmlRetorno->code);
|
| 89 |
+
if($existing = $payment->getAdditionalInformation())
|
| 90 |
+
{
|
| 91 |
+
if(is_array($existing))
|
| 92 |
+
{
|
| 93 |
+
$additional = array_merge($additional,$existing);
|
| 94 |
+
}
|
| 95 |
+
}
|
| 96 |
+
$payment->setAdditionalInformation($additional);
|
| 97 |
}
|
| 98 |
return $this;
|
| 99 |
}
|
app/code/community/RicardoMartins/PagSeguro/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<RicardoMartins_PagSeguro>
|
| 5 |
-
<version>1.0.
|
| 6 |
</RicardoMartins_PagSeguro>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<RicardoMartins_PagSeguro>
|
| 5 |
+
<version>1.0.4</version>
|
| 6 |
</RicardoMartins_PagSeguro>
|
| 7 |
</modules>
|
| 8 |
<global>
|
app/code/community/RicardoMartins/PagSeguro/etc/system.xml
CHANGED
|
@@ -30,7 +30,7 @@
|
|
| 30 |
<payment>
|
| 31 |
<groups>
|
| 32 |
<pagseguro module="ricardomartins_pagseguro">
|
| 33 |
-
<comment><![CDATA[<a href="http://r-martins.github.io/PagSeguro-Magento-Transparente" target="_blank">Precisa de ajuda?</a><br/> Lembre-se de <a href="https://pagseguro.uol.com.br/receba-pagamentos.jhtml#checkout-transparent" target="_blank">solicitar acesso</a> à API transparente.]]></comment>
|
| 34 |
<label>PagSeguro - Ricardo Martins</label>
|
| 35 |
<frontend_type>text</frontend_type>
|
| 36 |
<sort_order>110</sort_order>
|
| 30 |
<payment>
|
| 31 |
<groups>
|
| 32 |
<pagseguro module="ricardomartins_pagseguro">
|
| 33 |
+
<comment><![CDATA[<a href="http://r-martins.github.io/PagSeguro-Magento-Transparente" target="_blank">Precisa de ajuda?</a><br/> Lembre-se de <a href="https://pagseguro.uol.com.br/receba-pagamentos.jhtml#checkout-transparent" target="_blank">solicitar acesso</a> à API transparente.<br/>Para suporte a TEF e Boleto, solicite a <a href="http://r-martins.github.io/PagSeguro-Magento-Transparente/pro" target="_blank">versão PRO</a>.]]></comment>
|
| 34 |
<label>PagSeguro - Ricardo Martins</label>
|
| 35 |
<frontend_type>text</frontend_type>
|
| 36 |
<sort_order>110</sort_order>
|
app/design/adminhtml/base/default/template/ricardomartins_pagseguro/form/info/cc.phtml
CHANGED
|
@@ -2,10 +2,14 @@
|
|
| 2 |
<?php if($info = $this->getInfo()): ?>
|
| 3 |
<br/>
|
| 4 |
<?php if($additional = $info->getAdditionalInformation()):?>
|
| 5 |
-
Id Transação: <?php echo $this->escapeHtml($additional['transaction_id']);?>
|
| 6 |
<br/>
|
| 7 |
<?php endif;?>
|
| 8 |
Bandeira: <?php echo ucfirst($this->escapeHtml($info->getCcType()));?>
|
| 9 |
<br/>
|
| 10 |
Últimos 4 dígitos: <?php echo $this->escapeHtml($info->getCcLast4());?>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
<?php endif; ?>
|
| 2 |
<?php if($info = $this->getInfo()): ?>
|
| 3 |
<br/>
|
| 4 |
<?php if($additional = $info->getAdditionalInformation()):?>
|
| 5 |
+
Id Transação: <?php echo (isset($additional['transaction_id']))?$this->escapeHtml($additional['transaction_id']):'Desconhecido';?>
|
| 6 |
<br/>
|
| 7 |
<?php endif;?>
|
| 8 |
Bandeira: <?php echo ucfirst($this->escapeHtml($info->getCcType()));?>
|
| 9 |
<br/>
|
| 10 |
Últimos 4 dígitos: <?php echo $this->escapeHtml($info->getCcLast4());?>
|
| 11 |
+
<?php if(isset($additional['installment_quantity']) && isset($additional['installment_value'])):?>
|
| 12 |
+
<br/>
|
| 13 |
+
Parcelas: <?php echo $this->escapeHtml($additional['installment_quantity']);?>x <?php echo Mage::helper('core')->formatCurrency($additional['installment_value']);?>
|
| 14 |
+
<?php endif;?>
|
| 15 |
<?php endif; ?>
|
app/design/frontend/base/default/template/ricardomartins_pagseguro/form/info/cc.phtml
CHANGED
|
@@ -2,10 +2,14 @@
|
|
| 2 |
<?php if($info = $this->getInfo()): ?>
|
| 3 |
<br/>
|
| 4 |
<?php if($additional = $info->getAdditionalInformation()):?>
|
| 5 |
-
Id Transação: <?php echo $this->escapeHtml($additional['transaction_id']);?>
|
| 6 |
<br/>
|
| 7 |
<?php endif;?>
|
| 8 |
Bandeira: <?php echo ucfirst($this->escapeHtml($info->getCcType()));?>
|
| 9 |
<br/>
|
| 10 |
Últimos 4 dígitos: <?php echo $this->escapeHtml($info->getCcLast4());?>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
<?php endif; ?>
|
| 2 |
<?php if($info = $this->getInfo()): ?>
|
| 3 |
<br/>
|
| 4 |
<?php if($additional = $info->getAdditionalInformation()):?>
|
| 5 |
+
Id Transação: <?php echo (isset($additional['transaction_id']))?$this->escapeHtml($additional['transaction_id']):'Desconhecido';?>
|
| 6 |
<br/>
|
| 7 |
<?php endif;?>
|
| 8 |
Bandeira: <?php echo ucfirst($this->escapeHtml($info->getCcType()));?>
|
| 9 |
<br/>
|
| 10 |
Últimos 4 dígitos: <?php echo $this->escapeHtml($info->getCcLast4());?>
|
| 11 |
+
<?php if(isset($additional['installment_quantity']) && isset($additional['installment_value'])):?>
|
| 12 |
+
<br/>
|
| 13 |
+
Parcelas: <?php echo $this->escapeHtml($additional['installment_quantity']);?>x <?php echo Mage::helper('core')->formatCurrency($additional['installment_value']);?>
|
| 14 |
+
<?php endif;?>
|
| 15 |
<?php endif; ?>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>RicardoMartins_PagSeguro</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>MIT</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -13,9 +13,9 @@ Os dados do cartão são enviados para o site do pagseguro de forma segu
|
|
| 13 |

|
| 14 |
Os bugs devem ser reportador na área de Issues no github do projeto em https://github.com/r-martins/PagSeguro-Magento-Transparente</notes>
|
| 15 |
<authors><author><name>Ricardo Martins</name><user>MAG001517858</user><email>ricardo@ricardomartins.info</email></author></authors>
|
| 16 |
-
<date>2014-
|
| 17 |
-
<time>
|
| 18 |
-
<contents><target name="magecommunity"><dir name="RicardoMartins"><dir name="PagSeguro"><dir name="Block"><dir name="Form"><dir name="Cc"><file name="Dob.php" hash="ed45c9f5576c289897eb5c86a46c6d85"/></dir><file name="Cc.php" hash="3ec300291bfb59a545bfb99a23f2d670"/><file name="Directpayment.php" hash="937273e541d362f353b2bde87c041631"/><dir name="Info"><file name="Cc.php" hash="ef4952bfb9d12dae0b6ce13afeb0d1bb"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="
|
| 19 |
<compatible/>
|
| 20 |
-
<dependencies><required><php><min>5.2.1</min><max>5.
|
| 21 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>RicardoMartins_PagSeguro</name>
|
| 4 |
+
<version>1.0.4</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>MIT</license>
|
| 7 |
<channel>community</channel>
|
| 13 |

|
| 14 |
Os bugs devem ser reportador na área de Issues no github do projeto em https://github.com/r-martins/PagSeguro-Magento-Transparente</notes>
|
| 15 |
<authors><author><name>Ricardo Martins</name><user>MAG001517858</user><email>ricardo@ricardomartins.info</email></author></authors>
|
| 16 |
+
<date>2014-07-18</date>
|
| 17 |
+
<time>12:37:41</time>
|
| 18 |
+
<contents><target name="magecommunity"><dir name="RicardoMartins"><dir name="PagSeguro"><dir name="Block"><dir name="Form"><dir name="Cc"><file name="Dob.php" hash="ed45c9f5576c289897eb5c86a46c6d85"/></dir><file name="Cc.php" hash="3ec300291bfb59a545bfb99a23f2d670"/><file name="Directpayment.php" hash="937273e541d362f353b2bde87c041631"/><dir name="Info"><file name="Cc.php" hash="ef4952bfb9d12dae0b6ce13afeb0d1bb"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="11e27b9bd5bca778377bba7b99d13cf0"/><file name="Internal.php" hash="fbf64a95060a3d2f47ef44bde57a5c70"/><file name="Params.php" hash="fab4af2bba941b46dd19e94669152ffa"/></dir><dir name="Model"><file name="Abstract.php" hash="7ab8bfcabcd409805ec7df0f4b95d855"/><file name="Observer.php" hash="e709c92bc86416ffdcfe2fda5b8a4d37"/><dir name="Payment"><file name="Cc.php" hash="b73df4a160f97380f200d90268de8691"/></dir><dir name="Source"><dir name="Customer"><dir name="Address"><dir name="Attributes"><file name="Optional.php" hash="966a3dd2db773c460c0aba9921da36a0"/></dir><file name="Attributes.php" hash="c51bd60053e598daf9558d717c70d0e2"/></dir><file name="Attributes.php" hash="0e62e095d16e30c358410603197e1328"/><file name="Dob.php" hash="754ae1fbbae1c8ee89100201b59172bf"/></dir><file name="Paymentmethods.php" hash="5ea1877c9f73a6dec6bc91900309a5a5"/></dir></dir><dir name="controllers"><file name="AjaxController.php" hash="9b6c47c1c81e32168c447d3f67faaffd"/><file name="NotificationController.php" hash="47641a62f0d1850ea7711d997bfa1fa5"/><file name="TestController.php" hash="b0d6a8e347b45f3013435a4c2ac4a16b"/></dir><dir name="etc"><file name="config.xml" hash="3a180d72a72cecb186755869f845f336"/><file name="system.xml" hash="77ecc06b086a90c44175b55a54ae9fc0"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RicardoMartins_PagSeguro.xml" hash="82d8294eccac1fb4047f27566b0c9f2a"/></dir></target><target name="magelocale"><dir name="pt_BR"><file name="RicardoMartins_PagSeguro.csv" hash="6c1504a7d1c8d5f3b4127f36d6459bfa"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="pagseguro"><dir><dir name="selo"><file name="selo01_160x90.gif" hash="e6729bb969abb20588f134f7d29ea0ec"/><file name="selo01_200x60.gif" hash="e91ed131018bae7d9abc2cc1a72f539b"/><file name="selo01_300x60.gif" hash="13b07e35250b30a61c86c98815e3310c"/><file name="selo02_160x90.gif" hash="4e65530d2c42bae4e5fab617a4d0afdf"/><file name="selo02_200x60.gif" hash="ba629a85cef8982423c7679a4875283c"/><file name="selo02_300x60.gif" hash="5827aca40455f22caffee1392917f16c"/><file name="selo03_160x90.gif" hash="e3c69ace0991d7841728c6203fc305bf"/><file name="selo03_200x60.gif" hash="63135b65df64a70629748d66f5c0c453"/><file name="selo03_300x60.gif" hash="e88f1529f2d27d4732cd7c374752618e"/><file name="selo04_160x90.gif" hash="8e71cb1942c15427ba96ac21aacdb9d6"/><file name="selo04_200x60.gif" hash="f08b80b40541e35491a8d966cb420c78"/><file name="selo04_300x60.gif" hash="43f9fc4ad730111654777c26059e9fbf"/></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="ricardomartins_pagseguro"><dir><dir name="form"><dir name="cc"><file name="dob.phtml" hash="32306fe3702175d3bbc7975c0ca54271"/></dir><file name="cc.phtml" hash="6e0a672021b19acd5c94880d41efeb50"/><file name="directpayment.phtml" hash="e4c2ed8d53d1334f6715f3c6fb638369"/><dir name="info"><file name="cc.phtml" hash="0a3aa78e0775cd51bb7a168b813dd466"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="ricardomartins_pagseguro"><dir><dir name="form"><file name="directpayment.phtml" hash="d7f02da712e3bb310a6f785ebc36e3d3"/><dir name="info"><file name="cc.phtml" hash="0a3aa78e0775cd51bb7a168b813dd466"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="pagseguro"><file name="pagseguro.js" hash="0be6fd340e0be7af5a6f07a280cfc059"/></dir></dir></target></contents>
|
| 19 |
<compatible/>
|
| 20 |
+
<dependencies><required><php><min>5.2.1</min><max>5.5.0</max></php></required></dependencies>
|
| 21 |
</package>
|
