Version Notes
Versão estável.
Os bugs devem ser reportados 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 | 2.5.5 |
Comparing to | |
See all releases |
Code changes from version 2.5.4 to 2.5.5
app/code/community/RicardoMartins/PagSeguro/Helper/Params.php
CHANGED
@@ -108,10 +108,12 @@ class RicardoMartins_PagSeguro_Helper_Params extends Mage_Core_Helper_Abstract
|
|
108 |
$return = array();
|
109 |
if ($payment->getAdditionalInformation('installment_quantity')
|
110 |
&& $payment->getAdditionalInformation('installment_value')) {
|
|
|
|
|
111 |
$return = array(
|
112 |
-
'installmentQuantity' => $
|
113 |
'installmentValue' => number_format(
|
114 |
-
$
|
115 |
),
|
116 |
);
|
117 |
} else {
|
108 |
$return = array();
|
109 |
if ($payment->getAdditionalInformation('installment_quantity')
|
110 |
&& $payment->getAdditionalInformation('installment_value')) {
|
111 |
+
$orderTotal = $order->getGrandTotal();
|
112 |
+
$installmentQty = $payment->getAdditionalInformation('installment_quantity');
|
113 |
$return = array(
|
114 |
+
'installmentQuantity' => $installmentQty,
|
115 |
'installmentValue' => number_format(
|
116 |
+
$orderTotal/$installmentQty, 2, '.', ''
|
117 |
),
|
118 |
);
|
119 |
} else {
|
app/code/community/RicardoMartins/PagSeguro/Test/Helper/Params.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class RicardoMartins_PagSeguro_Test_Helper_Params extends EcomDev_PHPUnit_Test_Case
|
3 |
+
{
|
4 |
+
public function testItemValuesWithInstallments()
|
5 |
+
{
|
6 |
+
$order = Mage::getModel('sales/order');
|
7 |
+
$order->setCustomerId(1);
|
8 |
+
$order->addItem($this->getItemData1());
|
9 |
+
|
10 |
+
$payment = Mage::getModel('sales/order_payment')->setAdditionalInformation('installment_quantity', 2);
|
11 |
+
$order->setPayment($payment);
|
12 |
+
|
13 |
+
$helper = Mage::helper('ricardomartins_pagseguro/params');
|
14 |
+
$params = $helper->getItemsParams($order);
|
15 |
+
|
16 |
+
$installments = $helper->getCreditCardInstallmentsParams($order, $payment);
|
17 |
+
$this->assertEquals('33.98', $installments['installmentValue']);
|
18 |
+
|
19 |
+
}
|
20 |
+
|
21 |
+
//@TODO Improve it
|
22 |
+
protected function getItemData1()
|
23 |
+
{
|
24 |
+
return Mage::getModel('sales/order_item')
|
25 |
+
->getCollection()->getFirstItem()
|
26 |
+
->setQtyOrdered(1)
|
27 |
+
->setPrice(33.98)
|
28 |
+
->setName('Produto Teste 1');
|
29 |
+
}
|
30 |
+
}
|
app/code/community/RicardoMartins/PagSeguro/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<RicardoMartins_PagSeguro>
|
5 |
-
<version>2.5.
|
6 |
</RicardoMartins_PagSeguro>
|
7 |
</modules>
|
8 |
<global>
|
@@ -90,4 +90,11 @@
|
|
90 |
</pagseguro>
|
91 |
</payment>
|
92 |
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
</config>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<RicardoMartins_PagSeguro>
|
5 |
+
<version>2.5.5</version>
|
6 |
</RicardoMartins_PagSeguro>
|
7 |
</modules>
|
8 |
<global>
|
90 |
</pagseguro>
|
91 |
</payment>
|
92 |
</default>
|
93 |
+
<phpunit>
|
94 |
+
<suite>
|
95 |
+
<modules>
|
96 |
+
<RicardoMartins_PagSeguro />
|
97 |
+
</modules>
|
98 |
+
</suite>
|
99 |
+
</phpunit>
|
100 |
</config>
|
js/pagseguro/pagseguro.js
CHANGED
@@ -2,10 +2,11 @@
|
|
2 |
* PagSeguro Transparente para Magento
|
3 |
* @author Ricardo Martins <ricardo@ricardomartins.net.br>
|
4 |
* @link https://github.com/r-martins/PagSeguro-Magento-Transparente
|
5 |
-
* @version 2.5.
|
6 |
*/
|
7 |
(function() {
|
8 |
document.observe("dom:loaded", function() {
|
|
|
9 |
RMPagSeguro = function RMPagSeguro(){
|
10 |
this.init = function() {
|
11 |
this.grandTotal = 0;
|
@@ -91,6 +92,7 @@ document.observe("dom:loaded", function() {
|
|
91 |
}
|
92 |
console.log('Falha ao obter o token do cartao.');
|
93 |
console.log(psresponse.errors);
|
|
|
94 |
},
|
95 |
complete: function(psresponse){
|
96 |
//console.log(psresponse);
|
@@ -172,7 +174,7 @@ document.observe("dom:loaded", function() {
|
|
172 |
{
|
173 |
RMPagSeguro.updateSenderHash();
|
174 |
}
|
175 |
-
if($$('input[name="payment[credit_card_token]"]').first().value == '')
|
176 |
{
|
177 |
RMPagSeguro.updateCreditCardToken();
|
178 |
}
|
2 |
* PagSeguro Transparente para Magento
|
3 |
* @author Ricardo Martins <ricardo@ricardomartins.net.br>
|
4 |
* @link https://github.com/r-martins/PagSeguro-Magento-Transparente
|
5 |
+
* @version 2.5.5
|
6 |
*/
|
7 |
(function() {
|
8 |
document.observe("dom:loaded", function() {
|
9 |
+
var errors = false;
|
10 |
RMPagSeguro = function RMPagSeguro(){
|
11 |
this.init = function() {
|
12 |
this.grandTotal = 0;
|
92 |
}
|
93 |
console.log('Falha ao obter o token do cartao.');
|
94 |
console.log(psresponse.errors);
|
95 |
+
errors = true;
|
96 |
},
|
97 |
complete: function(psresponse){
|
98 |
//console.log(psresponse);
|
174 |
{
|
175 |
RMPagSeguro.updateSenderHash();
|
176 |
}
|
177 |
+
if($$('input[name="payment[credit_card_token]"]').first().value == '' && !errors)
|
178 |
{
|
179 |
RMPagSeguro.updateCreditCardToken();
|
180 |
}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>RicardoMartins_PagSeguro</name>
|
4 |
-
<version>2.5.
|
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 reportados 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>2016-
|
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="23c8de35776d54f9717327ba8520f1b6"/><file name="Directpayment.php" hash="98ba4fb562b4ad777dc20b15ca345381"/><dir name="Info"><file name="Cc.php" hash="ef4952bfb9d12dae0b6ce13afeb0d1bb"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f714d82e737808c49bbf623ff38c1823"/><file name="Internal.php" hash="5911252bc71b056c888a61df5f3bf58d"/><file name="Params.php" hash="
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.2.1</min><max>5.7.5</max></php></required></dependencies>
|
21 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>RicardoMartins_PagSeguro</name>
|
4 |
+
<version>2.5.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>MIT</license>
|
7 |
<channel>community</channel>
|
13 |

|
14 |
Os bugs devem ser reportados 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>2016-08-31</date>
|
17 |
+
<time>01:38:05</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="23c8de35776d54f9717327ba8520f1b6"/><file name="Directpayment.php" hash="98ba4fb562b4ad777dc20b15ca345381"/><dir name="Info"><file name="Cc.php" hash="ef4952bfb9d12dae0b6ce13afeb0d1bb"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f714d82e737808c49bbf623ff38c1823"/><file name="Internal.php" hash="5911252bc71b056c888a61df5f3bf58d"/><file name="Params.php" hash="a464aecb4e1b9eaa081cb991caf2d525"/></dir><dir name="Model"><file name="Abstract.php" hash="d0864beabaad0b8da84a4c0aadfbe85e"/><file name="Observer.php" hash="29a784cdb6203baf6b5f0abeeeda99ed"/><dir name="Payment"><file name="Cc.php" hash="b6201a7857ff683e660ae3ff566b1905"/></dir><dir name="Source"><dir name="Customer"><dir name="Address"><dir name="Attributes"><file name="Optional.php" hash="cb7cc6beb016941997051a9d5eb1014c"/></dir><file name="Attributes.php" hash="0ffab3cf1d51871f7d57d95dd95822ec"/></dir><file name="Attributes.php" hash="96c7da94017a8b38bd3804e9b0401a58"/><file name="Cpf.php" hash="da6e6525163d2ba954d69c687d101d7d"/><file name="Dob.php" hash="f82a41da22e5a84e77c35ff91d7dfab9"/></dir><file name="Paymentmethods.php" hash="88897d21a7b5217f834eda0daead22c3"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Token.php" hash="9d099f156f5bd6b18c8f315954da7b7f"/></dir><dir name="Source"><dir name="Customer"><file name="Groups.php" hash="f08bac32afcde8078a098446db79bc65"/></dir></dir></dir></dir></dir><dir name="Test"><dir name="Helper"><file name="Params.php" hash="a596ea4060cdfe0a4d7e981d9543301f"/></dir></dir><dir name="controllers"><file name="AjaxController.php" hash="89b915bbfc061beb7550a56248177c9f"/><file name="NotificationController.php" hash="e7056961e4ada5cc5614c5a40ef78a75"/><file name="TestController.php" hash="0e2c2bd2fc77ced55f880d1860e4318d"/></dir><dir name="etc"><file name="config.xml" hash="7504ea265e1c9423c090c6a7fecf47f2"/><file name="system.xml" hash="cdb81843dc7f5023a2d35ca1fd0dcdd8"/></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="84a6cc4fb73769ac822c9e8e22b8cec8"/></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="0ea9d4ff767a43d1393ddf1e2882a5da"/></dir><file name="cc.phtml" hash="1e5f98f09a867256ddfbd17b22320dcb"/><file name="directpayment.phtml" hash="ff5cb599a494f436024fd63a96f0420c"/><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="f87e23e166b4f9b7db8fa08db1de6c5b"/><dir name="info"><file name="cc.phtml" hash="0a3aa78e0775cd51bb7a168b813dd466"/></dir></dir></dir></dir></dir><dir name="layout"><dir name="ricardomartins_pagseguro"><file name="pagseguro.xml" hash="29cd2dcb80c765d129bba99252ba532c"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="pagseguro"><file name="pagseguro.js" hash="9d1f6296b6ad68555ac9a61cdc5f9365"/></dir></dir></target></contents>
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.2.1</min><max>5.7.5</max></php></required></dependencies>
|
21 |
</package>
|