Version Notes
- forcing PLN while sending order amount to Payu
Download this release
Release Info
Developer | Magento Core Team |
Extension | Orba_Payupl |
Version | 0.2.2 |
Comparing to | |
See all releases |
Code changes from version 0.2.1 to 0.2.2
app/code/community/Orba/Payupl/Model/Payment.php
CHANGED
@@ -21,6 +21,7 @@ class Orba_Payupl_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
21 |
const PAYMENTSTATE_COMPLETED = '99';
|
22 |
const PAYMENTSTATE_ERROR = '888';
|
23 |
|
|
|
24 |
|
25 |
/**
|
26 |
* Get payupl session namespace
|
@@ -95,7 +96,7 @@ class Orba_Payupl_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
95 |
"pos_id" => $this->getConfig()->getPosId(),
|
96 |
"pos_auth_key" => $this->getConfig()->getPosAuthKey(),
|
97 |
"session_id" => $this->getSession()->getEncryptedSessionId().'-'.$order_id,
|
98 |
-
"amount" =>
|
99 |
"desc" => Mage::helper('payupl')->__("Order no %s", $increment_order_id),
|
100 |
"order_id" => $increment_order_id,
|
101 |
"first_name" => $billing->getFirstname(),
|
@@ -297,5 +298,17 @@ class Orba_Payupl_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
297 |
$status = $order->getStatus();
|
298 |
return in_array($status, array(Mage_Sales_Model_Order::STATE_CLOSED, Mage_Sales_Model_Order::STATE_CANCELED, Mage_Sales_Model_Order::STATE_COMPLETE));
|
299 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
|
301 |
}
|
21 |
const PAYMENTSTATE_COMPLETED = '99';
|
22 |
const PAYMENTSTATE_ERROR = '888';
|
23 |
|
24 |
+
const POLISH_ZLOTY_CODE = 'PLN';
|
25 |
|
26 |
/**
|
27 |
* Get payupl session namespace
|
96 |
"pos_id" => $this->getConfig()->getPosId(),
|
97 |
"pos_auth_key" => $this->getConfig()->getPosAuthKey(),
|
98 |
"session_id" => $this->getSession()->getEncryptedSessionId().'-'.$order_id,
|
99 |
+
"amount" => $this->getOrderTotalInPolishCents($order),
|
100 |
"desc" => Mage::helper('payupl')->__("Order no %s", $increment_order_id),
|
101 |
"order_id" => $increment_order_id,
|
102 |
"first_name" => $billing->getFirstname(),
|
298 |
$status = $order->getStatus();
|
299 |
return in_array($status, array(Mage_Sales_Model_Order::STATE_CLOSED, Mage_Sales_Model_Order::STATE_CANCELED, Mage_Sales_Model_Order::STATE_COMPLETE));
|
300 |
}
|
301 |
+
|
302 |
+
protected function getOrderTotalInPolishCents($order) {
|
303 |
+
if ($order->getBaseCurrencyCode() == self::POLISH_ZLOTY_CODE) {
|
304 |
+
$total_pln = $order->getBaseGrandTotal();
|
305 |
+
} else if ($order->getOrderCurrencyCode() == self::POLISH_ZLOTY_CODE) {
|
306 |
+
$total_pln = $order->getGrandTotal();
|
307 |
+
} else {
|
308 |
+
$total_pln = Mage::helper('directory')->currencyConvert($order->getBaseGrandTotal(), $order->getBaseCurrencyCode(), self::POLISH_ZLOTY_CODE);
|
309 |
+
}
|
310 |
+
$rounded_pln = Mage::app()->getStore()->roundPrice($total_pln);
|
311 |
+
return $rounded_pln * 100;
|
312 |
+
}
|
313 |
|
314 |
}
|
app/code/community/Orba/Payupl/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Orba_Payupl>
|
5 |
-
<version>0.2.
|
6 |
</Orba_Payupl>
|
7 |
</modules>
|
8 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Orba_Payupl>
|
5 |
+
<version>0.2.2</version>
|
6 |
</Orba_Payupl>
|
7 |
</modules>
|
8 |
<frontend>
|
app/code/community/Orba/Payupl/sql/payupl_setup/mysql4-install-0.2.2.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$this->startSetup();
|
4 |
+
|
5 |
+
$msg_title = "Moduł Orba Payu.pl został poprawnie zainstalowany! Ważne: Skonfiguruj system po stronie Payu.pl!";
|
6 |
+
$msg_desc = "Po stronie Payu.pl należy skonfigurować system w następujący sposób: <br />"
|
7 |
+
. "Adres powrotu błędnego: http://twojadomena.com/payupl/payment/error/sid/%sessionId%<br />"
|
8 |
+
. "Adres powrotu pozytywnego: http://twojadomena.com/payupl/payment/ok/sid/%sessionId%<br />"
|
9 |
+
. "Adres raportów: http://twojadomena.com/payupl/payment/online <br />"
|
10 |
+
. "Kodowanie przesyłanych danych: UTF-8 <br />"
|
11 |
+
. "W razie problemów prosimy o kontakt na adres e-mail magento@orba.pl.";
|
12 |
+
$url = "http://orba.pl/moduly-magento/payu-pl";
|
13 |
+
|
14 |
+
$message = Mage::getModel( 'adminnotification/inbox' );
|
15 |
+
$message->setDateAdded( date( "c", time() ) );
|
16 |
+
|
17 |
+
$message->setSeverity( Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE );
|
18 |
+
|
19 |
+
$message->setTitle( $msg_title );
|
20 |
+
$message->setDescription( $msg_desc );
|
21 |
+
$message->setUrl( $url );
|
22 |
+
$message->save();
|
23 |
+
|
24 |
+
@mail('magento@orba.pl', '[Instalacja] Payu.pl 0.2.2', "IP: ".$_SERVER['SERVER_ADDR']."\r\nHost: ".gethostbyaddr($_SERVER['SERVER_ADDR']), "From: ".(Mage::getStoreConfig('general/store_information/email_address') ? Mage::getStoreConfig('general/store_information/email_address') : 'magento@orba.pl'));
|
25 |
+
|
26 |
+
$this->endSetup();
|
app/code/community/Orba/Payupl/sql/payupl_setup/mysql4-upgrade-0.2.1-0.2.2.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$this->startSetup();
|
4 |
+
|
5 |
+
@mail('magento@orba.pl', '[Upgrade] Payu.pl 0.2.2', "IP: ".$_SERVER['SERVER_ADDR']."\r\nHost: ".gethostbyaddr($_SERVER['SERVER_ADDR']), "From: ".(Mage::getStoreConfig('general/store_information/email_address') ? Mage::getStoreConfig('general/store_information/email_address') : 'magento@orba.pl'));
|
6 |
+
|
7 |
+
$this->endSetup();
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Orba_Payupl</name>
|
4 |
-
<version>0.2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
|
7 |
<channel>community</channel>
|
@@ -14,11 +14,11 @@ If you are interested in the paid version of our extension with additional featu
|
|
14 |
Moduł dodaje do sklepu nowy sposób płatności, który daje klientom możliwość użycia serwisu Payu.pl do dokonania zapłaty za zakupy.
|
15 |
Istnieje możliwość integracji zarówno kont produkcyjnych jak i tych typu "sandbox".
|
16 |
Jeśli jesteś zainteresowany płatną wersją naszego modułu, który zawiera dodatkowe funkcjonalności oraz pomoc techniczą w cenie, wyślij do nas wiadomość e-mail na adres magento@orba.pl.</description>
|
17 |
-
<notes>-
|
18 |
<authors><author><name>ORBA</name><user>auto-converted</user><email>magento@orba.pl</email></author></authors>
|
19 |
-
<date>
|
20 |
-
<time>
|
21 |
-
<contents><target name="magecommunity"><dir name="Orba"><dir name="Payupl"><dir name="Block"><file name="Form.php" hash="0dcab12715372a78f007a4abde209413"/><file name="Online.php" hash="f3bd6baa76e733cf4578c6c270aa89cc"/><file name="Redirect.php" hash="126e9856816c9531dd81ec031ed14626"/></dir><dir name="Helper"><file name="Data.php" hash="55d8258f52d07246e55042aa227655ae"/></dir><dir name="Model"><file name="Config.php" hash="3e933a833c5448bb641435a42a9aaa06"/><file name="Encoding.php" hash="9103c954ae61349db76a1c123696c602"/><file name="Gateway.php" hash="7b630b4e0c90185716389daec5702570"/><file name="Payment.php" hash="
|
22 |
<compatible/>
|
23 |
<dependencies/>
|
24 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Orba_Payupl</name>
|
4 |
+
<version>0.2.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
|
7 |
<channel>community</channel>
|
14 |
Moduł dodaje do sklepu nowy sposób płatności, który daje klientom możliwość użycia serwisu Payu.pl do dokonania zapłaty za zakupy.
|
15 |
Istnieje możliwość integracji zarówno kont produkcyjnych jak i tych typu "sandbox".
|
16 |
Jeśli jesteś zainteresowany płatną wersją naszego modułu, który zawiera dodatkowe funkcjonalności oraz pomoc techniczą w cenie, wyślij do nas wiadomość e-mail na adres magento@orba.pl.</description>
|
17 |
+
<notes>- forcing PLN while sending order amount to Payu</notes>
|
18 |
<authors><author><name>ORBA</name><user>auto-converted</user><email>magento@orba.pl</email></author></authors>
|
19 |
+
<date>2013-01-07</date>
|
20 |
+
<time>10:04:06</time>
|
21 |
+
<contents><target name="magecommunity"><dir name="Orba"><dir name="Payupl"><dir name="Block"><file name="Form.php" hash="0dcab12715372a78f007a4abde209413"/><file name="Online.php" hash="f3bd6baa76e733cf4578c6c270aa89cc"/><file name="Redirect.php" hash="126e9856816c9531dd81ec031ed14626"/></dir><dir name="Helper"><file name="Data.php" hash="55d8258f52d07246e55042aa227655ae"/></dir><dir name="Model"><file name="Config.php" hash="3e933a833c5448bb641435a42a9aaa06"/><file name="Encoding.php" hash="9103c954ae61349db76a1c123696c602"/><file name="Gateway.php" hash="7b630b4e0c90185716389daec5702570"/><file name="Payment.php" hash="a69d485a3635c33c24f39cbb36e233c2"/><file name="Session.php" hash="aad733c0d69beb14192e22415339343e"/></dir><dir name="controllers"><file name="IndexController.php" hash="2ee7e3bcd53c0eda0eb06f000cf23afb"/><file name="PaymentController.php" hash="7cd1475d17e656b7630b6dc07fc9a848"/></dir><dir name="etc"><file name="config.xml" hash="2e35c6f0c36977ff9e323ebf91a4ac37"/><file name="system.xml" hash="a83fcef20fc8a1dc08df1bc767b66df6"/></dir><dir name="sql"><dir name="payupl_setup"><file name="mysql4-install-0.1.0.php" hash="1c24d60e370bb07d601e02fcd1833c12"/><file name="mysql4-install-0.1.1.php" hash="8a734508ca8764fe397e8e98b2abda45"/><file name="mysql4-install-0.1.10.php" hash="59f3be8df67ac4eb1af1382b32f82d61"/><file name="mysql4-install-0.1.2.php" hash="212e958f7dcaca1209844703f1946b4e"/><file name="mysql4-install-0.1.3.php" hash="964592d00bb4cf8224ab5d2d73669d25"/><file name="mysql4-install-0.1.4.1.php" hash="0ad9b065639c15858c92dc443056d1c9"/><file name="mysql4-install-0.1.4.php" hash="0ad9b065639c15858c92dc443056d1c9"/><file name="mysql4-install-0.1.5.php" hash="af851501e249c0f711539724c129ef75"/><file name="mysql4-install-0.1.6.php" hash="86e34723c7192e7b3e63f9f6d6209140"/><file name="mysql4-install-0.1.7.php" hash="ef811c98a328f0c405435bb8d5baf2b3"/><file name="mysql4-install-0.1.8.php" hash="9f772cd5cbec3a46cd0b421ad482e965"/><file name="mysql4-install-0.1.9.php" hash="81a8706be704903850ed23ed63992b43"/><file name="mysql4-install-0.2.0.php" hash="008b767fc311dc1b4ac398a4fe3617da"/><file name="mysql4-install-0.2.1.php" hash="c84b836e0a171a74475c3e68419221c9"/><file name="mysql4-install-0.2.2.php" hash="acfff9b789376eeee001f1785def2156"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="6489810a00f175b7092ee1911ecd445a"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="6ac5c8851ecbf6d02b28e41e69ef6333"/><file name="mysql4-upgrade-0.1.10.1-0.2.0.php" hash="b841e126ebae169facd0fb77895164ec"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="3a6b72462611f26b3634588d6036e3f6"/><file name="mysql4-upgrade-0.1.3-0.1.4.1.php" hash="434df0ba3e565a5c9fcbf4697c3f616e"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="434df0ba3e565a5c9fcbf4697c3f616e"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="fc98e0f71e7dfa6e245aa9f4780f9ffd"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="35c607c4cc7eb567b35d835f571aae9c"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="884c9fd4ce6fc1f6c55005c50c003585"/><file name="mysql4-upgrade-0.1.7-0.1.8.php" hash="964aff66ba063a41b043de03d00c9a64"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="413667f250d057d1e3b8842e70a7c8c7"/><file name="mysql4-upgrade-0.1.9-0.1.10.php" hash="bb7a995e2321efa7f04ff1be6bdab5ad"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="1287922306e67edb45b76489be1b5951"/><file name="mysql4-upgrade-0.2.1-0.2.2.php" hash="9360b20bc3d1d3eeb172986ec4d8fae7"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="payupl.xml" hash="2370be1560e9a6296d6c5ed4d2d3d5ef"/></dir><dir name="template"><dir name="payupl"><file name="form.phtml" hash="1924fced96f1f107ce02d2636f4e3671"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Orba_Payupl.xml" hash="172c1f5e1e622b602af9667e90ae5d5c"/></dir></target><target name="magelocale"><dir name="pl_PL"><file name="Orba_Payupl.csv" hash="e4a0cbae2342c13e46d454db7d9d502f"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="payupl"><file name="logo.jpg" hash="fc75365ea69655f8b9e3e66d75dc8362"/></dir></dir></dir></dir></dir></target></contents>
|
22 |
<compatible/>
|
23 |
<dependencies/>
|
24 |
</package>
|