PayU_Account - Version 1.8.0

Version Notes

* SDK 1.9.2 compatible
* Fixed PayU order cancelling
* Fixed adding customer shipping address in orders that are not virtual
* Fixed status changing for Payment Review after complete payment
* Fixed updating customer data
* Changed order number in PayU description

Download this release

Release Info

Developer PayU
Extension PayU_Account
Version 1.8.0
Comparing to
See all releases


Code changes from version 0.1.6.5.1 to 1.8.0

Files changed (32) hide show
  1. app/code/local/PayU/Account/Block/Adminhtml/Sales/Order/View.php +2 -2
  2. app/code/local/PayU/Account/Block/Advertisement.php +2 -2
  3. app/code/local/PayU/Account/Block/BeforeSummary.php +2 -2
  4. app/code/local/PayU/Account/Block/Button.php +2 -2
  5. app/code/local/PayU/Account/Block/Form.php +2 -2
  6. app/code/local/PayU/Account/Block/Onestep/Checkout.php +2 -2
  7. app/code/local/PayU/Account/Block/Redirect.php +2 -2
  8. app/code/local/PayU/Account/Block/UpdateInfo.php +32 -26
  9. app/code/local/PayU/Account/Helper/Data.php +2 -2
  10. app/code/local/PayU/Account/Model/Advertisement.php +2 -2
  11. app/code/local/PayU/Account/Model/Button.php +2 -2
  12. app/code/local/PayU/Account/Model/Config.php +3 -3
  13. app/code/local/PayU/Account/Model/Environment.php +2 -3
  14. app/code/local/PayU/Account/Model/PayU.php +0 -90
  15. app/code/local/PayU/Account/Model/Payment.php +140 -100
  16. app/code/local/PayU/Account/Model/Session.php +2 -2
  17. app/code/local/PayU/Account/Model/Thumbnail.php +2 -2
  18. app/code/local/PayU/Account/Model/ValidityTime.php +2 -3
  19. app/code/local/PayU/Account/controllers/Adminhtml/Sales/OrderController.php +7 -7
  20. app/code/local/PayU/Account/controllers/Checkout/CartController.php +5 -5
  21. app/code/local/PayU/Account/controllers/PaymentController.php +2 -2
  22. app/code/local/PayU/Account/etc/config.xml +46 -46
  23. app/code/local/PayU/Account/etc/system.xml +7 -29
  24. app/design/frontend/base/default/template/payu_account/info/payu_account.phtml +6 -21
  25. app/locale/pl_PL/PayU_Account.csv +3 -1
  26. lib/payu/sdk/OpenPayU/OAuth.php +4 -1
  27. lib/payu/sdk/OpenPayU/OpenPayU.php +4 -1
  28. lib/payu/sdk/OpenPayU/OpenPayUBase.php +3 -0
  29. lib/payu/sdk/OpenPayU/OpenPayUOAuth.php +12 -4
  30. lib/payu/sdk/OpenPayU/Order.php +22 -7
  31. lib/payu/sdk/openpayu.php +4 -3
  32. package.xml +11 -8
app/code/local/PayU/Account/Block/Adminhtml/Sales/Order/View.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Adminhtml Sales Order View
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Adminhtml Sales Order View
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Block/Advertisement.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Advertisement Block
6
  * Payment
7
  *
8
  * @copyright Copyright (c) 2011-2012 PayU
9
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
10
  * http://www.payu.com
11
  * http://www.openpayu.com
12
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Advertisement Block
6
  * Payment
7
  *
8
  * @copyright Copyright (c) 2011-2012 PayU
9
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
10
  * http://www.payu.com
11
  * http://www.openpayu.com
12
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Block/BeforeSummary.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU BeforeSummary Redirection Block
6
  * Payment
7
  *
8
  * @copyright Copyright (c) 2011-2012 PayU
9
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
10
  * http://www.payu.com
11
  * http://www.openpayu.com
12
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU BeforeSummary Redirection Block
6
  * Payment
7
  *
8
  * @copyright Copyright (c) 2011-2012 PayU
9
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
10
  * http://www.payu.com
11
  * http://www.openpayu.com
12
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Block/Button.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Button Block
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Button Block
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Block/Form.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Form Block
6
  * Payment
7
  *
8
  * @copyright Copyright (c) 2011-2012 PayU
9
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
10
  * http://www.payu.com
11
  * http://www.openpayu.com
12
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Form Block
6
  * Payment
7
  *
8
  * @copyright Copyright (c) 2011-2012 PayU
9
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
10
  * http://www.payu.com
11
  * http://www.openpayu.com
12
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Block/Onestep/Checkout.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU One Step Checkout Block
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU One Step Checkout Block
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Block/Redirect.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Payment Redirect Block
6
  * Payment
7
  *
8
  * @copyright Copyright (c) 2011-2012 PayU
9
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
10
  * http://www.payu.com
11
  * http://www.openpayu.com
12
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Payment Redirect Block
6
  * Payment
7
  *
8
  * @copyright Copyright (c) 2011-2012 PayU
9
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
10
  * http://www.payu.com
11
  * http://www.openpayu.com
12
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Block/UpdateInfo.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Update Info Block
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
@@ -42,34 +42,40 @@ class PayU_Account_Block_UpdateInfo extends Mage_Adminhtml_Block_System_Config_F
42
 
43
  }
44
  $html .= Mage::helper('payu_account')->__('Documents attached to this implementation').":<br>";
45
-
46
- foreach($latestVersion['docs']['guides'] as $doc){
47
-
48
- $html .= $this->getLayout()->createBlock('adminhtml/widget_button')
49
- ->setType('button')
50
- ->setClass('scalable')
51
- ->setLabel($doc['name'])
52
- ->setOnClick("window.open('".$doc['url']."')")
53
- ->toHtml();
54
- $html .= "<br>";
55
-
 
 
 
56
  }
57
-
58
  if(count($latestVersion['docs']['websites']) > 0){
59
  $html .= Mage::helper('payu_account')->__('More info on').":<br>";
60
  }
61
-
62
- foreach($latestVersion['docs']['websites'] as $key => $website){
63
-
64
-
65
- $html .= $this->getLayout()->createBlock('adminhtml/widget_button')
66
- ->setType('button')
67
- ->setClass('scalable')
68
- ->setLabel($website['name'])
69
- ->setOnClick("window.open('".$website['url']."')")
70
- ->toHtml();
71
- $html .= "<br>";
72
-
 
 
 
73
  }
74
 
75
  $html .= $latestVersion['description'];
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Update Info Block
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
42
 
43
  }
44
  $html .= Mage::helper('payu_account')->__('Documents attached to this implementation').":<br>";
45
+
46
+ if(isset($latestVersion['docs']['guides']))
47
+ {
48
+ foreach($latestVersion['docs']['guides'] as $doc){
49
+
50
+ $html .= $this->getLayout()->createBlock('adminhtml/widget_button')
51
+ ->setType('button')
52
+ ->setClass('scalable')
53
+ ->setLabel($doc['name'])
54
+ ->setOnClick("window.open('".$doc['url']."')")
55
+ ->toHtml();
56
+ $html .= "<br>";
57
+
58
+ }
59
  }
60
+
61
  if(count($latestVersion['docs']['websites']) > 0){
62
  $html .= Mage::helper('payu_account')->__('More info on').":<br>";
63
  }
64
+
65
+ if(isset($latestVersion['docs']['websites']))
66
+ {
67
+ foreach($latestVersion['docs']['websites'] as $key => $website){
68
+
69
+
70
+ $html .= $this->getLayout()->createBlock('adminhtml/widget_button')
71
+ ->setType('button')
72
+ ->setClass('scalable')
73
+ ->setLabel($website['name'])
74
+ ->setOnClick("window.open('".$website['url']."')")
75
+ ->toHtml();
76
+ $html .= "<br>";
77
+
78
+ }
79
  }
80
 
81
  $html .= $latestVersion['description'];
app/code/local/PayU/Account/Helper/Data.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Data Helper Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Data Helper Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Model/Advertisement.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Logo Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Logo Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Model/Button.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Button Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Button Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Model/Config.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Config Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
@@ -14,7 +14,7 @@
14
  class PayU_Account_Model_Config
15
  {
16
  /** @var string self version */
17
- protected $_pluginVersion = '0.1.6.5.1';
18
 
19
  /** @var string minimum Magento e-commerce version */
20
  protected $_minimumMageVersion = '1.6.0';
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Config Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
14
  class PayU_Account_Model_Config
15
  {
16
  /** @var string self version */
17
+ protected $_pluginVersion = '1.8.0';
18
 
19
  /** @var string minimum Magento e-commerce version */
20
  protected $_minimumMageVersion = '1.6.0';
app/code/local/PayU/Account/Model/Environment.php CHANGED
@@ -1,12 +1,11 @@
1
  <?php
2
 
3
-
4
  /**
5
- * ver. 0.1.6.5.1
6
  * PayU Environment Model
7
  *
8
  * @copyright Copyright (c) 2011-2012 PayU
9
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
10
  * http://www.payu.com
11
  * http://www.openpayu.com
12
  * http://twitter.com/openpayu
1
  <?php
2
 
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Environment Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Model/PayU.php DELETED
@@ -1,90 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * ver. 0.1.6.5.1
5
- * PayU Standard Payment Model
6
- *
7
- * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
- * http://www.payu.com
10
- * http://www.openpayu.com
11
- * http://twitter.com/openpayu
12
- */
13
-
14
- class PayU_Account_Model_PaymentMethod extends Mage_Payment_Model_Method_Cc
15
- {
16
- /**
17
- * unique internal payment method identifier
18
- *
19
- * @var string [a-z0-9_]
20
- */
21
- protected $_code = 'payu_account';
22
-
23
- /**
24
- * Here are examples of flags that will determine functionality availability
25
- * of this module to be used by frontend and backend.
26
- *
27
- * @see all flags and their defaults in Mage_Payment_Model_Method_Abstract
28
- *
29
- * It is possible to have a custom dynamic logic by overloading
30
- * public function can* for each flag respectively
31
- */
32
-
33
- /**
34
- * Is this payment method a gateway (online auth/charge) ?
35
- */
36
- protected $_isGateway = true;
37
-
38
- /**
39
- * Can authorize online?
40
- */
41
- protected $_canAuthorize = true;
42
-
43
- /**
44
- * Can capture funds online?
45
- */
46
- protected $_canCapture = true;
47
-
48
- /**
49
- * Can capture partial amounts online?
50
- */
51
- protected $_canCapturePartial = false;
52
-
53
- /**
54
- * Can refund online?
55
- */
56
- protected $_canRefund = false;
57
-
58
- /**
59
- * Can void transactions online?
60
- */
61
- protected $_canVoid = true;
62
-
63
- /**
64
- * Can use this payment method in administration panel?
65
- */
66
- protected $_canUseInternal = true;
67
-
68
- /**
69
- * Can show this payment method as an option on checkout payment page?
70
- */
71
- protected $_canUseCheckout = true;
72
-
73
- /**
74
- * Is this payment method suitable for multi-shipping checkout?
75
- */
76
- protected $_canUseForMultishipping = true;
77
-
78
- /**
79
- * Can save credit card information for future processing?
80
- */
81
- protected $_canSaveCc = true;
82
-
83
- /**
84
- * Here you will need to implement authorize, capture and void public methods
85
- *
86
- * @see examples of transaction specific public methods such as
87
- * authorize, capture and void in Mage_Paygate_Model_Authorizenet
88
- */
89
- }
90
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/PayU/Account/Model/Payment.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
- * PayU -Standard Payment Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
- * http://www.payu.com
10
- * http://www.openpayu.com
11
- * http://twitter.com/openpayu
12
  */
13
 
14
  require_once('lib/payu/sdk/openpayu.php');
@@ -42,7 +42,7 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
42
  * Payment method title
43
  * @var string
44
  */
45
- protected $_title = 'PayU account';
46
 
47
  /**
48
  *
@@ -58,19 +58,6 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
58
  */
59
  protected $_isInitializeNeeded = true;
60
 
61
- /**
62
- *
63
- * Can use internal
64
- * @var boolean
65
- */
66
- protected $_canUseInternal = false;
67
-
68
- /**
69
- *
70
- * Enter description here ...
71
- * @var unknown_type
72
- */
73
- protected $_canUseForMultishipping = false;
74
 
75
  /**
76
  * Transaction id
@@ -86,20 +73,33 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
86
 
87
  protected $_tempInfo = "AWAITING_PayU";
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  /**
90
  * PayU payment statuses
91
  *
92
  * @var string
93
  */
94
- const PAYMENT_STATUS_NEW = 'PAYMENT_STATUS_NEW';
95
- const PAYMENT_STATUS_CANCEL = 'PAYMENT_STATUS_CANCEL';
96
- const PAYMENT_STATUS_REJECT = 'PAYMENT_STATUS_REJECT';
97
- const PAYMENT_STATUS_INIT = 'PAYMENT_STATUS_INIT';
98
- const PAYMENT_STATUS_SENT = 'PAYMENT_STATUS_SENT';
99
- const PAYMENT_STATUS_NOAUTH = 'PAYMENT_STATUS_NOAUTH';
100
- const PAYMENT_STATUS_REJECT_DONE = 'PAYMENT_STATUS_REJECT_DONE';
101
- const PAYMENT_STATUS_END = 'PAYMENT_STATUS_END';
102
- const PAYMENT_STATUS_ERROR = 'PAYMENT_STATUS_ERROR';
103
 
104
  const NEW_PAYMENT_URL = "payu_account/payment/new";
105
 
@@ -109,11 +109,11 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
109
  * @var string
110
  */
111
 
112
- const ORDER_STATUS_PENDING = 'ORDER_STATUS_PENDING';
113
- const ORDER_STATUS_SENT = 'ORDER_STATUS_SENT';
114
- const ORDER_STATUS_COMPLETE = 'ORDER_STATUS_COMPLETE';
115
- const ORDER_STATUS_CANCEL = 'ORDER_STATUS_CANCEL';
116
- const ORDER_STATUS_REJECT = 'ORDER_STATUS_REJECT';
117
 
118
  /**
119
  * Constructor
@@ -126,6 +126,11 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
126
  $this->initializeOpenPayUConfiguration();
127
  }
128
 
 
 
 
 
 
129
  /**
130
  * Initializes the payment ...
131
  *
@@ -135,7 +140,6 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
135
  */
136
  public function orderCreateRequest(Mage_Sales_Model_Order $order, $allShippingRates)
137
  {
138
-
139
  $this->_order = $order;
140
 
141
  /**
@@ -262,9 +266,9 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
262
  $orderInfo = array(
263
  'MerchantPosId' => OpenPayU_Configuration::getMerchantPosId(),
264
  'SessionId' => $sessionid,
265
- 'OrderUrl' => $this->_myUrl . 'cancelPayment?order=' . $this->_order->getRealOrderId(),
266
  'OrderCreateDate' => date("c"),
267
- 'OrderDescription' => 'Order no ' . $this->_order->getId(),
268
  'MerchantAuthorizationKey' => OpenPayU_Configuration::getPosAuthKey(),
269
  'OrderType' => $orderType,
270
  'ShoppingCart' => $shoppingCart,
@@ -311,22 +315,24 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
311
  if (!empty($shippingAddressId))
312
  $shippingAddress = $this->_order->getShippingAddress();
313
 
314
- $customer_sheet['Shipping'] = array(
315
- 'Street' => trim(implode(' ', $shippingAddress->getStreet())),
316
- 'PostalCode' => $shippingAddress->getPostcode(),
317
- 'City' => $shippingAddress->getCity(),
318
- 'CountryCode' => $shippingAddress->getCountry(),
319
- 'AddressType' => 'SHIPPING',
320
- 'RecipientName' => trim($shippingAddress->getFirstname() . ' ' . $shippingAddress->getLastname()),
321
- 'RecipientPhone' => $shippingAddress->getTelephone(),
322
- 'RecipientEmail' => $shippingAddress->getEmail()
323
- );
 
 
 
324
 
325
  $OCReq['Customer'] = $customer_sheet;
326
  }
327
  }
328
 
329
-
330
  // send message OrderCreateRequest, $result->response = OrderCreateResponse message
331
  $result = OpenPayU_Order::create($OCReq);
332
 
@@ -372,7 +378,6 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
372
 
373
  // if guest payment
374
  if (!$customerSession->isLoggedIn()) {
375
- ;
376
 
377
  $billingAddress = array
378
  (
@@ -401,12 +406,26 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
401
 
402
  } else {
403
  $customer = $customerSession->getCustomer();
404
- $checkout->saveBilling($customer->getDefaultBilling(), false);
405
- $checkout->saveShipping($customer->getDefaultShipping(), false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  $checkout->saveCheckoutMethod('register');
407
 
408
- $checkout->getQuote()->setCustomerId($customerSession->getCustomerId())
409
- ->setCustomerIsGuest(false);
410
  }
411
 
412
  $checkout->getQuote()->getBillingAddress()->setShippingMethod('flatrate_flatrate')->setCollectShippingRates(true);
@@ -416,7 +435,7 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
416
  $checkout->getQuote()->collectTotals()->save();
417
 
418
  // assigning the payment method type
419
- $checkout->savePayment(array('method' => 'payu_account'));
420
 
421
  $checkout->saveOrder();
422
 
@@ -527,18 +546,30 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
527
  public function rejectOrder($order)
528
  {
529
  $this->_order = $order;
530
- $result = $this->orderStatusUpdateRequest(PayU_Account_Model_Payment::ORDER_STATUS_REJECT);
531
- if ($result) {
532
- $this->updateOrderStatus(PayU_Account_Model_Payment::ORDER_STATUS_REJECT);
533
- return $result;
 
 
534
  }
 
 
 
 
 
 
 
 
 
 
535
  }
536
 
537
  public function cancelOrder($order)
538
  {
539
  $this->_order = $order;
540
  $result = $this->orderStatusUpdateRequest(PayU_Account_Model_Payment::ORDER_STATUS_CANCEL);
541
- if ($result) {
542
  $this->updateOrderStatus(PayU_Account_Model_Payment::ORDER_STATUS_CANCEL);
543
  return $result;
544
  }
@@ -571,7 +602,6 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
571
  */
572
  protected function retrieveAndUpdateBySessionId($sessionId)
573
  {
574
-
575
  $this->setOrderBySessionId($sessionId);
576
 
577
  $result = OpenPayU_Order::retrieve($sessionId);
@@ -602,36 +632,36 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
602
 
603
  // update customer data of the order
604
  $this->updateCustomerData($orderRetrieveResponse);
605
-
606
-
607
  }
608
-
609
-
610
  }
611
 
612
  protected function orderStatusUpdateRequest($status)
613
  {
614
  $sessionId = $this->_order->getPayment()->getLastTransId();
 
 
 
 
 
 
615
  $result = OpenPayU_Order::updateStatus($sessionId, $status, true);
 
616
  if ($result->getSuccess())
617
- return $result;
618
  else
619
  Mage::log("PayU error while updating status: " . $result->getError());
620
- return false;
621
  }
622
 
623
  protected function setOrderBySessionId($sess)
624
  {
625
-
626
  $orderId = $this->getOrderIdBySessionId($sess);
627
  $this->_order = Mage::getModel('sales/order')->load($orderId);
628
-
629
  }
630
 
631
  /** @return xml Processing the OrderNotifyRequest from PayU */
632
  public function orderNotifyRequest()
633
  {
634
-
635
  /** @var xml get posted document */
636
  $document = Mage::app()->getRequest()->getPost('DOCUMENT');
637
 
@@ -656,11 +686,9 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
656
 
657
  if ($orderId > 0) {
658
 
659
-
660
  $this->setOrderBySessionId($sessionId);
661
 
662
  $this->retrieveAndUpdateBySessionId($sessionId);
663
-
664
  }
665
 
666
 
@@ -683,23 +711,13 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
683
  */
684
  protected function updateCustomerData($data)
685
  {
686
-
687
  try {
688
-
689
  $customerRecord = $data['CustomerRecord'];
690
 
691
  $this->_order->setCustomerFirstname($customerRecord['FirstName']);
692
  $this->_order->setCustomerLastname($customerRecord['LastName']);
693
  $this->_order->setCustomerEmail($customerRecord['Email']);
694
 
695
- $billing = $this->_order->getBillingAddress();
696
-
697
- $billing->setFirstname($customerRecord['FirstName']);
698
- $billing->setLastname($customerRecord['LastName']);
699
- $billing->setTelephone($customerRecord['Phone']);
700
-
701
- $this->_order->setBillingAddress($billing)->save();
702
-
703
  if (isset($data['Shipping'])) {
704
 
705
  $shippingAddress = $data['Shipping']['Address'];
@@ -713,7 +731,6 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
713
 
714
  $this->_order->setBillingAddress($billing)->save();
715
 
716
-
717
  $recipient = explode(" ", $shippingAddress['RecipientName']);
718
 
719
  $shipping = $this->_order->getShippingAddress();
@@ -728,7 +745,9 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
728
 
729
  $this->_order->setShippingAddress($shipping)->save();
730
 
731
- } elseif (isset($data['Invoice']['Billing'])) {
 
 
732
  $billingAddress = $data['Invoice']['Billing'];
733
 
734
  $billing = $this->_order->getBillingAddress();
@@ -736,10 +755,22 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
736
  $billing->setFirstname('');
737
  $billing->setLastname('');
738
  $billing->setCompany($billingAddress['RecipientName']);
 
739
  $billing->setCity($billingAddress['City']);
740
  $billing->setStreet($billingAddress['Street'] . " " . $billingAddress['HouseNumber'] . (isset($billingAddress['ApartmentNumber']) ? " / " . $billingAddress['ApartmentNumber'] : ''));
741
  $billing->setPostcode($billingAddress['PostalCode']);
742
  $billing->setCountryId($billingAddress['CountryCode']);
 
 
 
 
 
 
 
 
 
 
 
743
 
744
  $this->_order->setBillingAddress($billing)->save();
745
  }
@@ -764,9 +795,7 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
764
  */
765
  protected function updateShippingInfo($data)
766
  {
767
-
768
  try {
769
-
770
  $typeChosen = $data['Shipping']['ShippingType'];
771
  $cost = $data['Shipping']['ShippingCost']['Gross'];
772
 
@@ -778,11 +807,8 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
778
  $shipping = Mage::getModel('shipping/shipping');
779
  $shippingRates = $shipping->collectRatesByAddress($address)->getResult();
780
 
781
- #file_put_contents("payu.log", "shipping: " . date("H:i:s") . " " . print_r($shippingRates, 1) . "\n", FILE_APPEND);
782
-
783
  $shippingCostList = array();
784
 
785
-
786
  foreach ($shippingRates->getAllRates() as $rate) {
787
  $type = $rate->getCarrierTitle() . ' - ' . $rate->getMethodTitle();
788
 
@@ -819,7 +845,6 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
819
  */
820
  protected function updateOrderStatus($orderStatus)
821
  {
822
-
823
  $payment = $this->_order->getPayment();
824
  $currentState = $payment->getAdditionalInformation('payu_order_status');
825
 
@@ -836,6 +861,10 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
836
  $this->updatePaymentStatusDenied($payment);
837
  break;
838
 
 
 
 
 
839
  case PayU_Account_Model_Payment::ORDER_STATUS_SENT :
840
  $this->updatePaymentStatusInProgress($payment);
841
  break;
@@ -846,8 +875,6 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
846
 
847
  default:
848
  break;
849
-
850
-
851
  }
852
 
853
  $payment->setAdditionalInformation('payu_order_status', $orderStatus)->save();
@@ -867,11 +894,9 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
867
  */
868
  protected function updatePaymentStatus($paymentStatus, $payUOrderStatus)
869
  {
870
-
871
  $payment = $this->_order->getPayment();
872
  $currentState = $payment->getAdditionalInformation('payu_payment_status');
873
 
874
-
875
  // change the payment status if needed
876
  if ($currentState != $paymentStatus) {
877
  try {
@@ -889,6 +914,10 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
889
  $this->updatePaymentStatusDenied($payment);
890
  break;
891
 
 
 
 
 
892
  case PayU_Account_Model_Payment::PAYMENT_STATUS_REJECT_DONE :
893
  $this->updatePaymentStatusReturned($payment);
894
  break;
@@ -1039,12 +1068,28 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
1039
  {
1040
  $transaction = $payment->setTransactionId($this->_transactionId);
1041
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1042
 
1043
  $payment->setPreparedMessage("PayU - " . Mage::helper('payu_account')->__('Transaction awaits approval.'))
1044
  ->setParentTransactionId($this->_transactionId) // this is the authorization transaction ID
1045
  ->registerVoidNotification();
1046
 
1047
- $comment = $this->_order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true, "PayU - " . Mage::helper('payu_account')->__('The transaction is pending.'), false)
1048
  ->save();
1049
 
1050
  }
@@ -1073,14 +1118,13 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
1073
  */
1074
  public function updatePaymentStatusCompleted($payment)
1075
  {
1076
-
1077
  $transaction = $payment->setTransactionId($this->_transactionId);
1078
  $transaction->setPreparedMessage("PayU - " . Mage::helper('payu_account')->__('The transaction completed successfully.'));
1079
 
1080
  $payment->setIsTransactionApproved(true);
1081
  $payment->setIsTransactionClosed(true);
1082
 
1083
- $comment = $this->_order->setState(Mage_Sales_Model_Order::STATE_COMPLETE, true, "PayU - " . Mage::helper('payu_account')->__('The transaction completed successfully.'), true)
1084
  ->sendOrderUpdateEmail(true, "PayU - " . Mage::helper('payu_account')->__('Thank you.') . " " . Mage::helper('payu_account')->__('The transaction completed successfully.'))
1085
  ->save();
1086
  $transaction->save();
@@ -1111,7 +1155,6 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
1111
  /** Recalculating the costs of shipping */
1112
  public function shippingCostRetrieve()
1113
  {
1114
-
1115
  $document = Mage::app()->getRequest()->getPost('DOCUMENT');
1116
 
1117
  $result = OpenPayU_Order::consumeMessage($document);
@@ -1191,7 +1234,6 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
1191
  /** Initialize PayU configuration */
1192
  protected function initializeOpenPayUConfiguration()
1193
  {
1194
-
1195
  $this->_config = $this->getConfig();
1196
 
1197
  $this->_myUrl = $this->_config->getBaseUrl();
@@ -1202,8 +1244,6 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract
1202
  OpenPayU_Configuration::setClientId($this->_config->getClientId());
1203
  OpenPayU_Configuration::setClientSecret($this->_config->getClientSecret());
1204
  OpenPayU_Configuration::setSignatureKey($this->_config->getSignatureKey());
1205
-
1206
-
1207
  }
1208
 
1209
  }
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
+ * PayU -Standard Payment Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
+ * http://www.payu.com
10
+ * http://www.openpayu.com
11
+ * http://twitter.com/openpayu
12
  */
13
 
14
  require_once('lib/payu/sdk/openpayu.php');
42
  * Payment method title
43
  * @var string
44
  */
45
+ protected $_title = 'PayU';
46
 
47
  /**
48
  *
58
  */
59
  protected $_isInitializeNeeded = true;
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  /**
63
  * Transaction id
73
 
74
  protected $_tempInfo = "AWAITING_PayU";
75
 
76
+ protected $_isGateway = true;
77
+ protected $_canOrder = true;
78
+ protected $_canAuthorize = true;
79
+ protected $_canCapture = true;
80
+ protected $_canCapturePartial = true;
81
+ protected $_canRefund = false;
82
+ protected $_canVoid = false;
83
+ protected $_canUseInternal = false;
84
+ protected $_canUseCheckout = true;
85
+ protected $_canUseForMultishipping = false;
86
+ protected $_canSaveCc = false;
87
+ protected $_canReviewPayment = true;
88
+
89
  /**
90
  * PayU payment statuses
91
  *
92
  * @var string
93
  */
94
+ const PAYMENT_STATUS_NEW = 'PAYMENT_STATUS_NEW';
95
+ const PAYMENT_STATUS_CANCEL = 'PAYMENT_STATUS_CANCEL';
96
+ const PAYMENT_STATUS_REJECT = 'PAYMENT_STATUS_REJECT';
97
+ const PAYMENT_STATUS_INIT = 'PAYMENT_STATUS_INIT';
98
+ const PAYMENT_STATUS_SENT = 'PAYMENT_STATUS_SENT';
99
+ const PAYMENT_STATUS_NOAUTH = 'PAYMENT_STATUS_NOAUTH';
100
+ const PAYMENT_STATUS_REJECT_DONE = 'PAYMENT_STATUS_REJECT_DONE';
101
+ const PAYMENT_STATUS_END = 'PAYMENT_STATUS_END';
102
+ const PAYMENT_STATUS_ERROR = 'PAYMENT_STATUS_ERROR';
103
 
104
  const NEW_PAYMENT_URL = "payu_account/payment/new";
105
 
109
  * @var string
110
  */
111
 
112
+ const ORDER_STATUS_PENDING = 'ORDER_STATUS_PENDING';
113
+ const ORDER_STATUS_SENT = 'ORDER_STATUS_SENT';
114
+ const ORDER_STATUS_COMPLETE = 'ORDER_STATUS_COMPLETE';
115
+ const ORDER_STATUS_CANCEL = 'ORDER_STATUS_CANCEL';
116
+ const ORDER_STATUS_REJECT = 'ORDER_STATUS_REJECT';
117
 
118
  /**
119
  * Constructor
126
  $this->initializeOpenPayUConfiguration();
127
  }
128
 
129
+ public function getTitle()
130
+ {
131
+ return $this->_title;
132
+ }
133
+
134
  /**
135
  * Initializes the payment ...
136
  *
140
  */
141
  public function orderCreateRequest(Mage_Sales_Model_Order $order, $allShippingRates)
142
  {
 
143
  $this->_order = $order;
144
 
145
  /**
266
  $orderInfo = array(
267
  'MerchantPosId' => OpenPayU_Configuration::getMerchantPosId(),
268
  'SessionId' => $sessionid,
269
+ 'OrderUrl' => Mage::getBaseUrl() . 'sales/order/view/order_id/' . $this->_order->getId().'/',
270
  'OrderCreateDate' => date("c"),
271
+ 'OrderDescription' => 'Order no ' . $this->_order->getRealOrderId(),
272
  'MerchantAuthorizationKey' => OpenPayU_Configuration::getPosAuthKey(),
273
  'OrderType' => $orderType,
274
  'ShoppingCart' => $shoppingCart,
315
  if (!empty($shippingAddressId))
316
  $shippingAddress = $this->_order->getShippingAddress();
317
 
318
+ if(!$this->_order->getIsVirtual())
319
+ {
320
+ $customer_sheet['Shipping'] = array(
321
+ 'Street' => trim(implode(' ', $shippingAddress->getStreet())),
322
+ 'PostalCode' => $shippingAddress->getPostcode(),
323
+ 'City' => $shippingAddress->getCity(),
324
+ 'CountryCode' => $shippingAddress->getCountry(),
325
+ 'AddressType' => 'SHIPPING',
326
+ 'RecipientName' => trim($shippingAddress->getFirstname() . ' ' . $shippingAddress->getLastname()),
327
+ 'RecipientPhone' => $shippingAddress->getTelephone(),
328
+ 'RecipientEmail' => $shippingAddress->getEmail()
329
+ );
330
+ }
331
 
332
  $OCReq['Customer'] = $customer_sheet;
333
  }
334
  }
335
 
 
336
  // send message OrderCreateRequest, $result->response = OrderCreateResponse message
337
  $result = OpenPayU_Order::create($OCReq);
338
 
378
 
379
  // if guest payment
380
  if (!$customerSession->isLoggedIn()) {
 
381
 
382
  $billingAddress = array
383
  (
406
 
407
  } else {
408
  $customer = $customerSession->getCustomer();
409
+
410
+ $billing = $checkout->getQuote()->getBillingAddress();
411
+ $shipping = $checkout->getQuote()->isVirtual() ? null : $checkout->getQuote()->getShippingAddress();
412
+
413
+ $customerBilling = $billing->exportCustomerAddress();
414
+
415
+ $billing->setCustomerAddress($customerBilling);
416
+ $customerBilling->setIsDefaultBilling(true);
417
+
418
+ if ($shipping && !$shipping->getSameAsBilling()) {
419
+ $customerShipping = $shipping->exportCustomerAddress();
420
+ $shipping->setCustomerAddress($customerShipping);
421
+ $customerShipping->setIsDefaultShipping(true);
422
+ } else {
423
+ $customerBilling->setIsDefaultShipping(true);
424
+ }
425
+
426
  $checkout->saveCheckoutMethod('register');
427
 
428
+ $checkout->getQuote()->setCustomerId($customerSession->getCustomerId())->setCustomerIsGuest(false);
 
429
  }
430
 
431
  $checkout->getQuote()->getBillingAddress()->setShippingMethod('flatrate_flatrate')->setCollectShippingRates(true);
435
  $checkout->getQuote()->collectTotals()->save();
436
 
437
  // assigning the payment method type
438
+ $checkout->savePayment(array('method' => $this->_code));
439
 
440
  $checkout->saveOrder();
441
 
546
  public function rejectOrder($order)
547
  {
548
  $this->_order = $order;
549
+
550
+ $sessionId = $this->_order->getPayment()->getLastTransId();
551
+
552
+ if (empty($sessionId)) {
553
+ Mage::log("PayU sessionId empty: " . $this->getId());
554
+ return false;
555
  }
556
+
557
+ $result = OpenPayU_Order::cancel($sessionId, false);
558
+
559
+ if($result->getSuccess())
560
+ {
561
+ $this->updateOrderStatus(PayU_Account_Model_Payment::ORDER_STATUS_CANCEL);
562
+ return true;
563
+ }
564
+
565
+ return false;
566
  }
567
 
568
  public function cancelOrder($order)
569
  {
570
  $this->_order = $order;
571
  $result = $this->orderStatusUpdateRequest(PayU_Account_Model_Payment::ORDER_STATUS_CANCEL);
572
+ if ($result === true) {
573
  $this->updateOrderStatus(PayU_Account_Model_Payment::ORDER_STATUS_CANCEL);
574
  return $result;
575
  }
602
  */
603
  protected function retrieveAndUpdateBySessionId($sessionId)
604
  {
 
605
  $this->setOrderBySessionId($sessionId);
606
 
607
  $result = OpenPayU_Order::retrieve($sessionId);
632
 
633
  // update customer data of the order
634
  $this->updateCustomerData($orderRetrieveResponse);
 
 
635
  }
 
 
636
  }
637
 
638
  protected function orderStatusUpdateRequest($status)
639
  {
640
  $sessionId = $this->_order->getPayment()->getLastTransId();
641
+
642
+ if (empty($sessionId)) {
643
+ Mage::log("PayU sessionId empty: " . $this->getId());
644
+ return false;
645
+ }
646
+
647
  $result = OpenPayU_Order::updateStatus($sessionId, $status, true);
648
+
649
  if ($result->getSuccess())
650
+ return true;
651
  else
652
  Mage::log("PayU error while updating status: " . $result->getError());
653
+ return $result;
654
  }
655
 
656
  protected function setOrderBySessionId($sess)
657
  {
 
658
  $orderId = $this->getOrderIdBySessionId($sess);
659
  $this->_order = Mage::getModel('sales/order')->load($orderId);
 
660
  }
661
 
662
  /** @return xml Processing the OrderNotifyRequest from PayU */
663
  public function orderNotifyRequest()
664
  {
 
665
  /** @var xml get posted document */
666
  $document = Mage::app()->getRequest()->getPost('DOCUMENT');
667
 
686
 
687
  if ($orderId > 0) {
688
 
 
689
  $this->setOrderBySessionId($sessionId);
690
 
691
  $this->retrieveAndUpdateBySessionId($sessionId);
 
692
  }
693
 
694
 
711
  */
712
  protected function updateCustomerData($data)
713
  {
 
714
  try {
 
715
  $customerRecord = $data['CustomerRecord'];
716
 
717
  $this->_order->setCustomerFirstname($customerRecord['FirstName']);
718
  $this->_order->setCustomerLastname($customerRecord['LastName']);
719
  $this->_order->setCustomerEmail($customerRecord['Email']);
720
 
 
 
 
 
 
 
 
 
721
  if (isset($data['Shipping'])) {
722
 
723
  $shippingAddress = $data['Shipping']['Address'];
731
 
732
  $this->_order->setBillingAddress($billing)->save();
733
 
 
734
  $recipient = explode(" ", $shippingAddress['RecipientName']);
735
 
736
  $shipping = $this->_order->getShippingAddress();
745
 
746
  $this->_order->setShippingAddress($shipping)->save();
747
 
748
+ }
749
+
750
+ if (isset($data['Invoice']['Billing'])) {
751
  $billingAddress = $data['Invoice']['Billing'];
752
 
753
  $billing = $this->_order->getBillingAddress();
755
  $billing->setFirstname('');
756
  $billing->setLastname('');
757
  $billing->setCompany($billingAddress['RecipientName']);
758
+ $billing->setTelephone($customerRecord['Phone']);
759
  $billing->setCity($billingAddress['City']);
760
  $billing->setStreet($billingAddress['Street'] . " " . $billingAddress['HouseNumber'] . (isset($billingAddress['ApartmentNumber']) ? " / " . $billingAddress['ApartmentNumber'] : ''));
761
  $billing->setPostcode($billingAddress['PostalCode']);
762
  $billing->setCountryId($billingAddress['CountryCode']);
763
+ $this->_order->setCustomerTaxvat($billingAddress['TIN']);
764
+
765
+ $this->_order->setBillingAddress($billing)->save();
766
+ }
767
+ else
768
+ {
769
+ $billing = $this->_order->getBillingAddress();
770
+
771
+ $billing->setFirstname($customerRecord['FirstName']);
772
+ $billing->setLastname($customerRecord['LastName']);
773
+ $billing->setTelephone($customerRecord['Phone']);
774
 
775
  $this->_order->setBillingAddress($billing)->save();
776
  }
795
  */
796
  protected function updateShippingInfo($data)
797
  {
 
798
  try {
 
799
  $typeChosen = $data['Shipping']['ShippingType'];
800
  $cost = $data['Shipping']['ShippingCost']['Gross'];
801
 
807
  $shipping = Mage::getModel('shipping/shipping');
808
  $shippingRates = $shipping->collectRatesByAddress($address)->getResult();
809
 
 
 
810
  $shippingCostList = array();
811
 
 
812
  foreach ($shippingRates->getAllRates() as $rate) {
813
  $type = $rate->getCarrierTitle() . ' - ' . $rate->getMethodTitle();
814
 
845
  */
846
  protected function updateOrderStatus($orderStatus)
847
  {
 
848
  $payment = $this->_order->getPayment();
849
  $currentState = $payment->getAdditionalInformation('payu_order_status');
850
 
861
  $this->updatePaymentStatusDenied($payment);
862
  break;
863
 
864
+ case PayU_Account_Model_Payment::ORDER_STATUS_COMPLETE :
865
+ $this->updatePaymentStatusCompleted($payment);
866
+ break;
867
+
868
  case PayU_Account_Model_Payment::ORDER_STATUS_SENT :
869
  $this->updatePaymentStatusInProgress($payment);
870
  break;
875
 
876
  default:
877
  break;
 
 
878
  }
879
 
880
  $payment->setAdditionalInformation('payu_order_status', $orderStatus)->save();
894
  */
895
  protected function updatePaymentStatus($paymentStatus, $payUOrderStatus)
896
  {
 
897
  $payment = $this->_order->getPayment();
898
  $currentState = $payment->getAdditionalInformation('payu_payment_status');
899
 
 
900
  // change the payment status if needed
901
  if ($currentState != $paymentStatus) {
902
  try {
914
  $this->updatePaymentStatusDenied($payment);
915
  break;
916
 
917
+ case PayU_Account_Model_Payment::PAYMENT_STATUS_SENT :
918
+ $this->updatePaymentStatusSent($payment);
919
+ break;
920
+
921
  case PayU_Account_Model_Payment::PAYMENT_STATUS_REJECT_DONE :
922
  $this->updatePaymentStatusReturned($payment);
923
  break;
1068
  {
1069
  $transaction = $payment->setTransactionId($this->_transactionId);
1070
 
1071
+ $payment->setPreparedMessage("PayU - " . Mage::helper('payu_account')->__('The transaction is pending.'))
1072
+ ->setParentTransactionId($this->_transactionId) // this is the authorization transaction ID
1073
+ ->registerVoidNotification();
1074
+
1075
+ $comment = $this->_order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true, "PayU - " . Mage::helper('payu_account')->__('The transaction is pending.'), false)
1076
+ ->save();
1077
+
1078
+ }
1079
+
1080
+ /**
1081
+ * Update payment status to sent
1082
+ * @param $payment
1083
+ */
1084
+ public function updatePaymentStatusSent($payment)
1085
+ {
1086
+ $transaction = $payment->setTransactionId($this->_transactionId);
1087
 
1088
  $payment->setPreparedMessage("PayU - " . Mage::helper('payu_account')->__('Transaction awaits approval.'))
1089
  ->setParentTransactionId($this->_transactionId) // this is the authorization transaction ID
1090
  ->registerVoidNotification();
1091
 
1092
+ $comment = $this->_order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, true, "PayU - " . Mage::helper('payu_account')->__('Transaction awaits approval.'), false)
1093
  ->save();
1094
 
1095
  }
1118
  */
1119
  public function updatePaymentStatusCompleted($payment)
1120
  {
 
1121
  $transaction = $payment->setTransactionId($this->_transactionId);
1122
  $transaction->setPreparedMessage("PayU - " . Mage::helper('payu_account')->__('The transaction completed successfully.'));
1123
 
1124
  $payment->setIsTransactionApproved(true);
1125
  $payment->setIsTransactionClosed(true);
1126
 
1127
+ $comment = $this->_order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, true, "PayU - " . Mage::helper('payu_account')->__('The transaction completed successfully.'), false)
1128
  ->sendOrderUpdateEmail(true, "PayU - " . Mage::helper('payu_account')->__('Thank you.') . " " . Mage::helper('payu_account')->__('The transaction completed successfully.'))
1129
  ->save();
1130
  $transaction->save();
1155
  /** Recalculating the costs of shipping */
1156
  public function shippingCostRetrieve()
1157
  {
 
1158
  $document = Mage::app()->getRequest()->getPost('DOCUMENT');
1159
 
1160
  $result = OpenPayU_Order::consumeMessage($document);
1234
  /** Initialize PayU configuration */
1235
  protected function initializeOpenPayUConfiguration()
1236
  {
 
1237
  $this->_config = $this->getConfig();
1238
 
1239
  $this->_myUrl = $this->_config->getBaseUrl();
1244
  OpenPayU_Configuration::setClientId($this->_config->getClientId());
1245
  OpenPayU_Configuration::setClientSecret($this->_config->getClientSecret());
1246
  OpenPayU_Configuration::setSignatureKey($this->_config->getSignatureKey());
 
 
1247
  }
1248
 
1249
  }
app/code/local/PayU/Account/Model/Session.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Session Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Session Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Model/Thumbnail.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Thumbnail Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Thumbnail Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/Model/ValidityTime.php CHANGED
@@ -1,12 +1,11 @@
1
  <?php
2
 
3
-
4
  /**
5
- * ver. 0.1.6.5.1
6
  * PayU Validity Time Model
7
  *
8
  * @copyright Copyright (c) 2011-2012 PayU
9
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
10
  * http://www.payu.com
11
  * http://www.openpayu.com
12
  * http://twitter.com/openpayu
1
  <?php
2
 
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Validity Time Model
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/controllers/Adminhtml/Sales/OrderController.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Adminhtml Sales Order Controller
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
@@ -27,7 +27,7 @@ class PayU_Account_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_
27
 
28
  $session = Mage::getSingleton('adminhtml/session');
29
 
30
- if($payu->cancelOrder($order)->getSuccess()){
31
  $session->addSuccess( Mage::helper('payu_account')->__('The order has been cancelled in PayU.') );
32
  }else{
33
  $session->addError( Mage::helper('payu_account')->__('There was a problem while cancelling the order in PayU.') );
@@ -46,8 +46,8 @@ class PayU_Account_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_
46
  $payu = Mage::getModel('payu_account/payment');
47
 
48
  $session = Mage::getSingleton('adminhtml/session');
49
-
50
- if($payu->rejectOrder($order)->getSuccess()){
51
  $session->addSuccess( Mage::helper('payu_account')->__('The order has been rejected in PayU.') );
52
  }else{
53
  $session->addError( Mage::helper('payu_account')->__('There was a problem while rejecting the order in PayU.') );
@@ -64,8 +64,8 @@ class PayU_Account_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_
64
 
65
  $payu = Mage::getModel('payu_account/payment');
66
  $session = Mage::getSingleton('adminhtml/session');
67
-
68
- if($payu->completeOrder($order)->getSuccess()){
69
  $session->addSuccess(Mage::helper('payu_account')->__('The order is completing in PayU, please wait while status changes.'));
70
  }else{
71
  $session->addError(Mage::helper('payu_account')->__('There was a problem while completing the order in PayU.'));
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Adminhtml Sales Order Controller
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
27
 
28
  $session = Mage::getSingleton('adminhtml/session');
29
 
30
+ if($payu->cancelOrder($order)){
31
  $session->addSuccess( Mage::helper('payu_account')->__('The order has been cancelled in PayU.') );
32
  }else{
33
  $session->addError( Mage::helper('payu_account')->__('There was a problem while cancelling the order in PayU.') );
46
  $payu = Mage::getModel('payu_account/payment');
47
 
48
  $session = Mage::getSingleton('adminhtml/session');
49
+
50
+ if($payu->rejectOrder($order)){
51
  $session->addSuccess( Mage::helper('payu_account')->__('The order has been rejected in PayU.') );
52
  }else{
53
  $session->addError( Mage::helper('payu_account')->__('There was a problem while rejecting the order in PayU.') );
64
 
65
  $payu = Mage::getModel('payu_account/payment');
66
  $session = Mage::getSingleton('adminhtml/session');
67
+
68
+ if($payu->completeOrder($order)){
69
  $session->addSuccess(Mage::helper('payu_account')->__('The order is completing in PayU, please wait while status changes.'));
70
  }else{
71
  $session->addError(Mage::helper('payu_account')->__('There was a problem while completing the order in PayU.'));
app/code/local/PayU/Account/controllers/Checkout/CartController.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
- * PayU Cart Controller
6
- *
7
- * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
+ * PayU Cart Controller
6
+ *
7
+ * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/controllers/PaymentController.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  /**
4
- * ver. 0.1.6.5.1
5
  * PayU Standard Payment Controller
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
- * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
1
  <?php
2
 
3
  /**
4
+ * ver. 1.8.0
5
  * PayU Standard Payment Controller
6
  *
7
  * @copyright Copyright (c) 2011-2012 PayU
8
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
9
  * http://www.payu.com
10
  * http://www.openpayu.com
11
  * http://twitter.com/openpayu
app/code/local/PayU/Account/etc/config.xml CHANGED
@@ -3,10 +3,55 @@
3
 
4
  <modules>
5
  <PayU_Account>
6
- <version>0.1.6.5.1</version>
 
 
 
7
  </PayU_Account>
8
  </modules>
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  <adminhtml>
11
  <translate>
12
  <modules>
@@ -18,7 +63,6 @@
18
  </modules>
19
  </translate>
20
  </adminhtml>
21
-
22
  <admin>
23
  <routers>
24
  <adminhtml>
@@ -66,50 +110,6 @@
66
  </translate>
67
  </frontend>
68
 
69
- <global>
70
- <blocks>
71
- <payu_account>
72
- <class>PayU_Account_Block</class>
73
- </payu_account>
74
- <adminhtml>
75
- <rewrite>
76
- <sales_order_view>PayU_Account_Block_Adminhtml_Sales_Order_View</sales_order_view>
77
- </rewrite>
78
- </adminhtml>
79
- </blocks>
80
- <models>
81
- <payu_account>
82
- <class>PayU_Account_Model</class>
83
- </payu_account>
84
- </models>
85
- <helpers>
86
- <payu_account>
87
- <class>PayU_Account_Helper</class>
88
- </payu_account>
89
- </helpers>
90
- <resources>
91
-
92
- <payu_account_setup>
93
- <setup>
94
- <module>PayU_Account</module>
95
- </setup>
96
- <connection>
97
- <use>core_setup</use>
98
- </connection>
99
- </payu_account_setup>
100
- <payu_account_write>
101
- <connection>
102
- <use>core_write</use>
103
- </connection>
104
- </payu_account_write>
105
- <payu_account_read>
106
- <connection>
107
- <use>core_read</use>
108
- </connection>
109
- </payu_account_read>
110
- </resources>
111
- </global>
112
-
113
  <default>
114
  <payment>
115
  <payu_account>
3
 
4
  <modules>
5
  <PayU_Account>
6
+ <version>1.8.0</version>
7
+ <depends>
8
+ <Mage_Payment />
9
+ </depends>
10
  </PayU_Account>
11
  </modules>
12
 
13
+ <global>
14
+ <models>
15
+ <payu_account>
16
+ <class>PayU_Account_Model</class>
17
+ </payu_account>
18
+ </models>
19
+ <helpers>
20
+ <payu_account>
21
+ <class>PayU_Account_Helper</class>
22
+ </payu_account>
23
+ </helpers>
24
+ <blocks>
25
+ <payu_account>
26
+ <class>PayU_Account_Block</class>
27
+ </payu_account>
28
+ <adminhtml>
29
+ <rewrite>
30
+ <sales_order_view>PayU_Account_Block_Adminhtml_Sales_Order_View</sales_order_view>
31
+ </rewrite>
32
+ </adminhtml>
33
+ </blocks>
34
+ <resources>
35
+ <payu_account_setup>
36
+ <setup>
37
+ <module>PayU_Account</module>
38
+ </setup>
39
+ <connection>
40
+ <use>core_setup</use>
41
+ </connection>
42
+ </payu_account_setup>
43
+ <payu_account_write>
44
+ <connection>
45
+ <use>core_write</use>
46
+ </connection>
47
+ </payu_account_write>
48
+ <payu_account_read>
49
+ <connection>
50
+ <use>core_read</use>
51
+ </connection>
52
+ </payu_account_read>
53
+ </resources>
54
+ </global>
55
  <adminhtml>
56
  <translate>
57
  <modules>
63
  </modules>
64
  </translate>
65
  </adminhtml>
 
66
  <admin>
67
  <routers>
68
  <adminhtml>
110
  </translate>
111
  </frontend>
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  <default>
114
  <payment>
115
  <payu_account>
app/code/local/PayU/Account/etc/system.xml CHANGED
@@ -5,12 +5,13 @@
5
  <groups>
6
  <payu_account translate="label" module="paygate">
7
  <label>PayU account</label>
 
8
  <sort_order>670</sort_order>
9
  <show_in_default>1</show_in_default>
10
  <show_in_website>1</show_in_website>
11
  <show_in_store>1</show_in_store>
 
12
  <fields>
13
-
14
  <header1 translate="label">
15
  <label>Main parameters</label>
16
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
@@ -19,7 +20,6 @@
19
  <show_in_website>1</show_in_website>
20
  <show_in_store>1</show_in_store>
21
  </header1>
22
-
23
  <active translate="label">
24
  <label>Enabled</label>
25
  <frontend_type>select</frontend_type>
@@ -29,7 +29,6 @@
29
  <show_in_website>1</show_in_website>
30
  <show_in_store>1</show_in_store>
31
  </active>
32
-
33
  <onestepcheckoutenabled translate="label">
34
  <label>OneStepCheckout Enabled</label>
35
  <frontend_type>select</frontend_type>
@@ -39,7 +38,6 @@
39
  <show_in_website>1</show_in_website>
40
  <show_in_store>1</show_in_store>
41
  </onestepcheckoutenabled>
42
-
43
  <selfreturn translate="label">
44
  <label>Self-Return Enabled</label>
45
  <frontend_type>select</frontend_type>
@@ -49,7 +47,6 @@
49
  <show_in_website>1</show_in_website>
50
  <show_in_store>1</show_in_store>
51
  </selfreturn>
52
-
53
  <order_status translate="label">
54
  <label>New Order Status</label>
55
  <frontend_type>select</frontend_type>
@@ -59,7 +56,6 @@
59
  <show_in_website>1</show_in_website>
60
  <show_in_store>0</show_in_store>
61
  </order_status>
62
-
63
  <validity_time translate="label comment">
64
  <label>Order Validity Time</label>
65
  <frontend_type>select</frontend_type>
@@ -69,7 +65,6 @@
69
  <show_in_website>1</show_in_website>
70
  <show_in_store>1</show_in_store>
71
  </validity_time>
72
-
73
  <environment translate="label">
74
  <label>Test Mode Enabled</label>
75
  <frontend_type>select</frontend_type>
@@ -79,7 +74,6 @@
79
  <show_in_website>1</show_in_website>
80
  <show_in_store>1</show_in_store>
81
  </environment>
82
-
83
  <header2 translate="label">
84
  <label>Parameters of production environment</label>
85
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
@@ -88,7 +82,6 @@
88
  <show_in_website>1</show_in_website>
89
  <show_in_store>1</show_in_store>
90
  </header2>
91
-
92
  <oauth_client_name translate="label">
93
  <label>POS ID (pos_id)</label>
94
  <comment>OAuth protocol - client_id</comment>
@@ -98,7 +91,6 @@
98
  <show_in_website>1</show_in_website>
99
  <show_in_store>1</show_in_store>
100
  </oauth_client_name>
101
-
102
  <oauth_client_secret translate="label">
103
  <label>Key (MD5)</label>
104
  <comment>OAuth protocol - client_secret</comment>
@@ -108,7 +100,6 @@
108
  <show_in_website>1</show_in_website>
109
  <show_in_store>1</show_in_store>
110
  </oauth_client_secret>
111
-
112
  <signature_key translate="label">
113
  <label>Second key (MD5)</label>
114
  <comment>Symmetrical key for encrypting communication</comment>
@@ -118,26 +109,23 @@
118
  <show_in_website>1</show_in_website>
119
  <show_in_store>1</show_in_store>
120
  </signature_key>
121
-
122
  <pos_auth_key translate="label">
123
- <label>Pos Auth Key</label>
124
  <comment>pos_auth_key</comment>
125
  <frontend_type>text</frontend_type>
126
- <sort_order>10</sort_order>
127
  <show_in_default>1</show_in_default>
128
  <show_in_website>1</show_in_website>
129
  <show_in_store>1</show_in_store>
130
  </pos_auth_key>
131
-
132
  <header3 translate="label">
133
  <label>Parameters of test environment (Sandbox)</label>
134
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
135
- <sort_order>12</sort_order>
136
  <show_in_default>1</show_in_default>
137
  <show_in_website>1</show_in_website>
138
  <show_in_store>1</show_in_store>
139
  </header3>
140
-
141
  <sandbox_oauth_client_name translate="label">
142
  <label>POS ID (pos_id)</label>
143
  <comment>OAuth protocol - client_id</comment>
@@ -147,7 +135,6 @@
147
  <show_in_website>1</show_in_website>
148
  <show_in_store>1</show_in_store>
149
  </sandbox_oauth_client_name>
150
-
151
  <sandbox_oauth_client_secret translate="label">
152
  <label>Key (MD5)</label>
153
  <comment>OAuth protocol - client_secret</comment>
@@ -157,27 +144,24 @@
157
  <show_in_website>1</show_in_website>
158
  <show_in_store>1</show_in_store>
159
  </sandbox_oauth_client_secret>
160
-
161
  <sandbox_signature_key translate="label">
162
  <label>Second key (MD5)</label>
163
  <comment>Symmetrical key for encrypting communication</comment>
164
  <frontend_type>text</frontend_type>
165
- <sort_order>17</sort_order>
166
  <show_in_default>1</show_in_default>
167
  <show_in_website>1</show_in_website>
168
  <show_in_store>1</show_in_store>
169
  </sandbox_signature_key>
170
-
171
  <sandbox_pos_auth_key translate="label">
172
  <label>POS Auth Key</label>
173
  <comment>pos_auth_key</comment>
174
  <frontend_type>text</frontend_type>
175
- <sort_order>16</sort_order>
176
  <show_in_default>1</show_in_default>
177
  <show_in_website>1</show_in_website>
178
  <show_in_store>1</show_in_store>
179
  </sandbox_pos_auth_key>
180
-
181
  <header4 translate="label">
182
  <label>Settings of external resources</label>
183
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
@@ -186,7 +170,6 @@
186
  <show_in_website>1</show_in_website>
187
  <show_in_store>1</show_in_store>
188
  </header4>
189
-
190
  <payubutton translate="label">
191
  <label>OneStepCheckout button</label>
192
  <frontend_type>select</frontend_type>
@@ -196,7 +179,6 @@
196
  <show_in_website>1</show_in_website>
197
  <show_in_store>1</show_in_store>
198
  </payubutton>
199
-
200
  <payuthumbnail translate="label">
201
  <label>Small logo</label>
202
  <frontend_type>select</frontend_type>
@@ -206,7 +188,6 @@
206
  <show_in_website>1</show_in_website>
207
  <show_in_store>1</show_in_store>
208
  </payuthumbnail>
209
-
210
  <payuadvertisement translate="label">
211
  <label>PayU advertisement</label>
212
  <source_model>payu_account/advertisement</source_model>
@@ -216,7 +197,6 @@
216
  <show_in_website>1</show_in_website>
217
  <show_in_store>1</show_in_store>
218
  </payuadvertisement>
219
-
220
  <header5 translate="label">
221
  <label>PayU Plugin Information</label>
222
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
@@ -225,7 +205,6 @@
225
  <show_in_website>0</show_in_website>
226
  <show_in_store>0</show_in_store>
227
  </header5>
228
-
229
  <payuupdate translate="label">
230
  <label></label>
231
  <frontend_type>multiline</frontend_type>
@@ -235,7 +214,6 @@
235
  <show_in_website>0</show_in_website>
236
  <show_in_store>0</show_in_store>
237
  </payuupdate>
238
-
239
  </fields>
240
  </payu_account>
241
  </groups>
5
  <groups>
6
  <payu_account translate="label" module="paygate">
7
  <label>PayU account</label>
8
+ <frontend_type>text</frontend_type>
9
  <sort_order>670</sort_order>
10
  <show_in_default>1</show_in_default>
11
  <show_in_website>1</show_in_website>
12
  <show_in_store>1</show_in_store>
13
+ <comment>Important: This plugin works only with checkout points of sales (POS).</comment>
14
  <fields>
 
15
  <header1 translate="label">
16
  <label>Main parameters</label>
17
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
20
  <show_in_website>1</show_in_website>
21
  <show_in_store>1</show_in_store>
22
  </header1>
 
23
  <active translate="label">
24
  <label>Enabled</label>
25
  <frontend_type>select</frontend_type>
29
  <show_in_website>1</show_in_website>
30
  <show_in_store>1</show_in_store>
31
  </active>
 
32
  <onestepcheckoutenabled translate="label">
33
  <label>OneStepCheckout Enabled</label>
34
  <frontend_type>select</frontend_type>
38
  <show_in_website>1</show_in_website>
39
  <show_in_store>1</show_in_store>
40
  </onestepcheckoutenabled>
 
41
  <selfreturn translate="label">
42
  <label>Self-Return Enabled</label>
43
  <frontend_type>select</frontend_type>
47
  <show_in_website>1</show_in_website>
48
  <show_in_store>1</show_in_store>
49
  </selfreturn>
 
50
  <order_status translate="label">
51
  <label>New Order Status</label>
52
  <frontend_type>select</frontend_type>
56
  <show_in_website>1</show_in_website>
57
  <show_in_store>0</show_in_store>
58
  </order_status>
 
59
  <validity_time translate="label comment">
60
  <label>Order Validity Time</label>
61
  <frontend_type>select</frontend_type>
65
  <show_in_website>1</show_in_website>
66
  <show_in_store>1</show_in_store>
67
  </validity_time>
 
68
  <environment translate="label">
69
  <label>Test Mode Enabled</label>
70
  <frontend_type>select</frontend_type>
74
  <show_in_website>1</show_in_website>
75
  <show_in_store>1</show_in_store>
76
  </environment>
 
77
  <header2 translate="label">
78
  <label>Parameters of production environment</label>
79
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
82
  <show_in_website>1</show_in_website>
83
  <show_in_store>1</show_in_store>
84
  </header2>
 
85
  <oauth_client_name translate="label">
86
  <label>POS ID (pos_id)</label>
87
  <comment>OAuth protocol - client_id</comment>
91
  <show_in_website>1</show_in_website>
92
  <show_in_store>1</show_in_store>
93
  </oauth_client_name>
 
94
  <oauth_client_secret translate="label">
95
  <label>Key (MD5)</label>
96
  <comment>OAuth protocol - client_secret</comment>
100
  <show_in_website>1</show_in_website>
101
  <show_in_store>1</show_in_store>
102
  </oauth_client_secret>
 
103
  <signature_key translate="label">
104
  <label>Second key (MD5)</label>
105
  <comment>Symmetrical key for encrypting communication</comment>
109
  <show_in_website>1</show_in_website>
110
  <show_in_store>1</show_in_store>
111
  </signature_key>
 
112
  <pos_auth_key translate="label">
113
+ <label>POS Auth Key</label>
114
  <comment>pos_auth_key</comment>
115
  <frontend_type>text</frontend_type>
116
+ <sort_order>12</sort_order>
117
  <show_in_default>1</show_in_default>
118
  <show_in_website>1</show_in_website>
119
  <show_in_store>1</show_in_store>
120
  </pos_auth_key>
 
121
  <header3 translate="label">
122
  <label>Parameters of test environment (Sandbox)</label>
123
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
124
+ <sort_order>13</sort_order>
125
  <show_in_default>1</show_in_default>
126
  <show_in_website>1</show_in_website>
127
  <show_in_store>1</show_in_store>
128
  </header3>
 
129
  <sandbox_oauth_client_name translate="label">
130
  <label>POS ID (pos_id)</label>
131
  <comment>OAuth protocol - client_id</comment>
135
  <show_in_website>1</show_in_website>
136
  <show_in_store>1</show_in_store>
137
  </sandbox_oauth_client_name>
 
138
  <sandbox_oauth_client_secret translate="label">
139
  <label>Key (MD5)</label>
140
  <comment>OAuth protocol - client_secret</comment>
144
  <show_in_website>1</show_in_website>
145
  <show_in_store>1</show_in_store>
146
  </sandbox_oauth_client_secret>
 
147
  <sandbox_signature_key translate="label">
148
  <label>Second key (MD5)</label>
149
  <comment>Symmetrical key for encrypting communication</comment>
150
  <frontend_type>text</frontend_type>
151
+ <sort_order>16</sort_order>
152
  <show_in_default>1</show_in_default>
153
  <show_in_website>1</show_in_website>
154
  <show_in_store>1</show_in_store>
155
  </sandbox_signature_key>
 
156
  <sandbox_pos_auth_key translate="label">
157
  <label>POS Auth Key</label>
158
  <comment>pos_auth_key</comment>
159
  <frontend_type>text</frontend_type>
160
+ <sort_order>17</sort_order>
161
  <show_in_default>1</show_in_default>
162
  <show_in_website>1</show_in_website>
163
  <show_in_store>1</show_in_store>
164
  </sandbox_pos_auth_key>
 
165
  <header4 translate="label">
166
  <label>Settings of external resources</label>
167
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
170
  <show_in_website>1</show_in_website>
171
  <show_in_store>1</show_in_store>
172
  </header4>
 
173
  <payubutton translate="label">
174
  <label>OneStepCheckout button</label>
175
  <frontend_type>select</frontend_type>
179
  <show_in_website>1</show_in_website>
180
  <show_in_store>1</show_in_store>
181
  </payubutton>
 
182
  <payuthumbnail translate="label">
183
  <label>Small logo</label>
184
  <frontend_type>select</frontend_type>
188
  <show_in_website>1</show_in_website>
189
  <show_in_store>1</show_in_store>
190
  </payuthumbnail>
 
191
  <payuadvertisement translate="label">
192
  <label>PayU advertisement</label>
193
  <source_model>payu_account/advertisement</source_model>
197
  <show_in_website>1</show_in_website>
198
  <show_in_store>1</show_in_store>
199
  </payuadvertisement>
 
200
  <header5 translate="label">
201
  <label>PayU Plugin Information</label>
202
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
205
  <show_in_website>0</show_in_website>
206
  <show_in_store>0</show_in_store>
207
  </header5>
 
208
  <payuupdate translate="label">
209
  <label></label>
210
  <frontend_type>multiline</frontend_type>
214
  <show_in_website>0</show_in_website>
215
  <show_in_store>0</show_in_store>
216
  </payuupdate>
 
217
  </fields>
218
  </payu_account>
219
  </groups>
app/design/frontend/base/default/template/payu_account/info/payu_account.phtml CHANGED
@@ -1,27 +1,12 @@
1
  <?php
2
  /**
3
- * Magento
4
  *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package default_default
23
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
27
  <?php echo $this->getMethod()->getTitle() ?>
1
  <?php
2
  /**
3
+ * ver. 1.8
4
  *
5
+ * @copyright Copyright (c) 2011-2012 PayU
6
+ * @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0)
7
+ * http://www.payu.com
8
+ * http://www.openpayu.com
9
+ * http://twitter.com/openpayu
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  */
11
  ?>
12
  <?php echo $this->getMethod()->getTitle() ?>
app/locale/pl_PL/PayU_Account.csv CHANGED
@@ -35,6 +35,7 @@
35
  "The transaction has been rejected.","Transakcja została odrzucona."
36
  "The transaction is in progress.","Transakcja w trakcie realizacji."
37
  "Transaction awaits approval.","Transakcja oczekuje na akceptację."
 
38
  "The transaction is pending.","Transakcja w toku."
39
  "Transaction returned.","Transakcja zwrócona."
40
  "The transaction has been returned.","Transakcja została zwrócona."
@@ -53,4 +54,5 @@
53
  "CAUTION: PayU plugin is not up to date.","UWAGA: Plugin PayU nie jest aktualny."
54
  "OK: PayU account plugin is up to date.","OK: Plugin konto PayU jest aktualny."
55
  "The latest version of PayU plugin is","Najnowszą wersją pluginu PayU jest"
56
- "PayU plugin information","Informacje o wtyczce PayU"
 
35
  "The transaction has been rejected.","Transakcja została odrzucona."
36
  "The transaction is in progress.","Transakcja w trakcie realizacji."
37
  "Transaction awaits approval.","Transakcja oczekuje na akceptację."
38
+ "Transaction awaiting manual approval.","Transakcja oczekuje na ręczną akceptację."
39
  "The transaction is pending.","Transakcja w toku."
40
  "Transaction returned.","Transakcja zwrócona."
41
  "The transaction has been returned.","Transakcja została zwrócona."
54
  "CAUTION: PayU plugin is not up to date.","UWAGA: Plugin PayU nie jest aktualny."
55
  "OK: PayU account plugin is up to date.","OK: Plugin konto PayU jest aktualny."
56
  "The latest version of PayU plugin is","Najnowszą wersją pluginu PayU jest"
57
+ "PayU plugin information","Informacje o wtyczce PayU"
58
+ "Important: This plugin works only with Checkout points of sales (POS).","Ważne: Plugin działa tylko z POS-ami typu Checkout."
lib/payu/sdk/OpenPayU/OAuth.php CHANGED
@@ -10,6 +10,9 @@
10
  http://twitter.com/openpayu
11
  */
12
 
 
 
 
13
  class OpenPayU_OAuth extends OpenPayUOAuth
14
  {
15
  /**
@@ -95,4 +98,4 @@ class OpenPayU_OAuth extends OpenPayUOAuth
95
 
96
  return $result;
97
  }
98
- }
10
  http://twitter.com/openpayu
11
  */
12
 
13
+ if (!defined('OPENPAYU_LIBRARY'))
14
+ exit;
15
+
16
  class OpenPayU_OAuth extends OpenPayUOAuth
17
  {
18
  /**
98
 
99
  return $result;
100
  }
101
+ }
lib/payu/sdk/OpenPayU/OpenPayU.php CHANGED
@@ -10,6 +10,9 @@
10
  http://twitter.com/openpayu
11
  */
12
 
 
 
 
13
  class OpenPayU extends OpenPayUBase
14
  {
15
 
@@ -131,7 +134,7 @@ class OpenPayU extends OpenPayUBase
131
  if (isset($arr['OpenPayU']['OrderDomainResponse']['OrderCreateResponse']['Status']))
132
  $status_code = $arr['OpenPayU']['OrderDomainResponse']['OrderCreateResponse']['Status'];
133
 
134
- if ($status_code == null)
135
  $status_code = $arr['OpenPayU']['HeaderResponse']['Status'];
136
 
137
  return $status_code;
10
  http://twitter.com/openpayu
11
  */
12
 
13
+ if (!defined('OPENPAYU_LIBRARY'))
14
+ exit;
15
+
16
  class OpenPayU extends OpenPayUBase
17
  {
18
 
134
  if (isset($arr['OpenPayU']['OrderDomainResponse']['OrderCreateResponse']['Status']))
135
  $status_code = $arr['OpenPayU']['OrderDomainResponse']['OrderCreateResponse']['Status'];
136
 
137
+ if (!isset($status_code))
138
  $status_code = $arr['OpenPayU']['HeaderResponse']['Status'];
139
 
140
  return $status_code;
lib/payu/sdk/OpenPayU/OpenPayUBase.php CHANGED
@@ -10,6 +10,9 @@
10
  http://twitter.com/openpayu
11
  */
12
 
 
 
 
13
  class OpenPayUBase extends OpenPayUNetwork
14
  {
15
 
10
  http://twitter.com/openpayu
11
  */
12
 
13
+ if (!defined('OPENPAYU_LIBRARY'))
14
+ exit;
15
+
16
  class OpenPayUBase extends OpenPayUNetwork
17
  {
18
 
lib/payu/sdk/OpenPayU/OpenPayUOAuth.php CHANGED
@@ -9,6 +9,8 @@
9
  http://openpayu.com
10
  http://twitter.com/openpayu
11
  */
 
 
12
 
13
  class OpenPayuOAuth extends OpenPayUBase
14
  {
@@ -30,7 +32,9 @@ class OpenPayuOAuth extends OpenPayUBase
30
 
31
  $resp_json = json_decode($response);
32
  OpenPayU::addOutputConsole('oauth response', $response);
33
- $access_token = $resp_json->{"access_token"};
 
 
34
 
35
  if (empty($access_token))
36
  throw new Exception('access_token is empty, error: ' . $response);
@@ -55,7 +59,9 @@ class OpenPayuOAuth extends OpenPayUBase
55
 
56
  $resp_json = json_decode($response);
57
  OpenPayU::addOutputConsole('oauth response', $response);
58
- $access_token = $resp_json->{"access_token"};
 
 
59
 
60
  if (empty($access_token))
61
  throw new Exception('access_token is empty, error: ' . $response);
@@ -79,7 +85,8 @@ class OpenPayuOAuth extends OpenPayUBase
79
  $resp_json = json_decode($response);
80
  OpenPayU::addOutputConsole('oauth response', $response);
81
 
82
- $access_token = $resp_json->{'access_token'};
 
83
 
84
  if (empty($access_token))
85
  throw new Exception('access_token is empty, error: ' . $response);
@@ -103,7 +110,8 @@ class OpenPayuOAuth extends OpenPayUBase
103
  $resp_json = json_decode($response);
104
  OpenPayU::addOutputConsole('oauth response', $response);
105
 
106
- $access_token = $resp_json->{'access_token'};
 
107
 
108
  if (empty($access_token))
109
  throw new Exception('access_token is empty, error: ' . $response);
9
  http://openpayu.com
10
  http://twitter.com/openpayu
11
  */
12
+ if (!defined('OPENPAYU_LIBRARY'))
13
+ exit;
14
 
15
  class OpenPayuOAuth extends OpenPayUBase
16
  {
32
 
33
  $resp_json = json_decode($response);
34
  OpenPayU::addOutputConsole('oauth response', $response);
35
+
36
+ if (isset($resp_json->{"access_token"}))
37
+ $access_token = $resp_json->{"access_token"};
38
 
39
  if (empty($access_token))
40
  throw new Exception('access_token is empty, error: ' . $response);
59
 
60
  $resp_json = json_decode($response);
61
  OpenPayU::addOutputConsole('oauth response', $response);
62
+
63
+ if (isset($resp_json->{"access_token"}))
64
+ $access_token = $resp_json->{"access_token"};
65
 
66
  if (empty($access_token))
67
  throw new Exception('access_token is empty, error: ' . $response);
85
  $resp_json = json_decode($response);
86
  OpenPayU::addOutputConsole('oauth response', $response);
87
 
88
+ if (isset($resp_json->{"access_token"}))
89
+ $access_token = $resp_json->{'access_token'};
90
 
91
  if (empty($access_token))
92
  throw new Exception('access_token is empty, error: ' . $response);
110
  $resp_json = json_decode($response);
111
  OpenPayU::addOutputConsole('oauth response', $response);
112
 
113
+ if (isset($resp_json->{"access_token"}))
114
+ $access_token = $resp_json->{'access_token'};
115
 
116
  if (empty($access_token))
117
  throw new Exception('access_token is empty, error: ' . $response);
lib/payu/sdk/OpenPayU/Order.php CHANGED
@@ -10,6 +10,9 @@
10
  http://twitter.com/openpayu
11
  */
12
 
 
 
 
13
  class OpenPayU_Order extends OpenPayU
14
  {
15
 
@@ -55,7 +58,10 @@ class OpenPayU_Order extends OpenPayU
55
  $result = new OpenPayU_Result();
56
  $result->setStatus($status);
57
  $result->setError($status['StatusCode']);
58
- $result->setMessage($status['StatusDesc']);
 
 
 
59
  $result->setSuccess($status['StatusCode'] == 'OPENPAYU_SUCCESS' ? TRUE : FALSE);
60
  $result->setRequest($order);
61
  $result->setResponse(OpenPayU::parseOpenPayUDocument($response));
@@ -106,7 +112,10 @@ class OpenPayU_Order extends OpenPayU
106
  $result = new OpenPayU_Result();
107
  $result->setStatus($status);
108
  $result->setError($status['StatusCode']);
109
- $result->setMessage($status['StatusDesc']);
 
 
 
110
  $result->setSuccess($status['StatusCode'] == 'OPENPAYU_SUCCESS' ? TRUE : FALSE);
111
  $result->setRequest($req);
112
  $result->setResponse($response);
@@ -140,13 +149,13 @@ class OpenPayU_Order extends OpenPayU
140
  switch (key($msg)) {
141
  case 'OrderNotifyRequest':
142
  return self::consumeNotification($xml, $response, $debug);
143
- break;
144
  case 'ShippingCostRetrieveRequest':
145
  return self::consumeShippingCostRetrieveRequest($xml, $debug);
146
- break;
147
  default:
148
  return key($msg);
149
- break;
150
  }
151
  }
152
 
@@ -268,7 +277,10 @@ class OpenPayU_Order extends OpenPayU
268
 
269
  $result->setStatus($status);
270
  $result->setError($status['StatusCode']);
271
- $result->setMessage($status['StatusDesc']);
 
 
 
272
  $result->setSuccess($status['StatusCode'] == 'OPENPAYU_SUCCESS' ? TRUE : FALSE);
273
  $result->setResponse(OpenPayU::parseOpenPayUDocument($response));
274
 
@@ -325,7 +337,10 @@ class OpenPayU_Order extends OpenPayU
325
 
326
  $result->setStatus($status);
327
  $result->setError($status['StatusCode']);
328
- $result->setMessage($status['StatusDesc']);
 
 
 
329
  $result->setSuccess($status['StatusCode'] == 'OPENPAYU_SUCCESS' ? TRUE : FALSE);
330
  $result->setResponse(OpenPayU::parseOpenPayUDocument($response));
331
 
10
  http://twitter.com/openpayu
11
  */
12
 
13
+ if (!defined('OPENPAYU_LIBRARY'))
14
+ exit;
15
+
16
  class OpenPayU_Order extends OpenPayU
17
  {
18
 
58
  $result = new OpenPayU_Result();
59
  $result->setStatus($status);
60
  $result->setError($status['StatusCode']);
61
+
62
+ if (isset($status['StatusDesc']))
63
+ $result->setMessage($status['StatusDesc']);
64
+
65
  $result->setSuccess($status['StatusCode'] == 'OPENPAYU_SUCCESS' ? TRUE : FALSE);
66
  $result->setRequest($order);
67
  $result->setResponse(OpenPayU::parseOpenPayUDocument($response));
112
  $result = new OpenPayU_Result();
113
  $result->setStatus($status);
114
  $result->setError($status['StatusCode']);
115
+
116
+ if (isset($status['StatusDesc']))
117
+ $result->setMessage($status['StatusDesc']);
118
+
119
  $result->setSuccess($status['StatusCode'] == 'OPENPAYU_SUCCESS' ? TRUE : FALSE);
120
  $result->setRequest($req);
121
  $result->setResponse($response);
149
  switch (key($msg)) {
150
  case 'OrderNotifyRequest':
151
  return self::consumeNotification($xml, $response, $debug);
152
+ break;
153
  case 'ShippingCostRetrieveRequest':
154
  return self::consumeShippingCostRetrieveRequest($xml, $debug);
155
+ break;
156
  default:
157
  return key($msg);
158
+ break;
159
  }
160
  }
161
 
277
 
278
  $result->setStatus($status);
279
  $result->setError($status['StatusCode']);
280
+
281
+ if (isset($status['StatusDesc']))
282
+ $result->setMessage($status['StatusDesc']);
283
+
284
  $result->setSuccess($status['StatusCode'] == 'OPENPAYU_SUCCESS' ? TRUE : FALSE);
285
  $result->setResponse(OpenPayU::parseOpenPayUDocument($response));
286
 
337
 
338
  $result->setStatus($status);
339
  $result->setError($status['StatusCode']);
340
+
341
+ if (isset($status['StatusDesc']))
342
+ $result->setMessage($status['StatusDesc']);
343
+
344
  $result->setSuccess($status['StatusCode'] == 'OPENPAYU_SUCCESS' ? TRUE : FALSE);
345
  $result->setResponse(OpenPayU::parseOpenPayUDocument($response));
346
 
lib/payu/sdk/openpayu.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /*
4
- ver. 0.1.9
5
  OpenPayU Standard Library
6
 
7
  @copyright Copyright (c) 2011-2012 PayU
@@ -13,9 +13,10 @@
13
 
14
  include_once('openpayu_domain.php');
15
 
 
16
  /*
17
  these files are obsolete and will be removed in future.
18
- valid only for SDK 0.0.x
19
  */
20
  include_once('OpenPayU/OpenPayUNetwork.php');
21
  include_once('OpenPayU/OpenPayUBase.php');
@@ -23,7 +24,7 @@ include_once('OpenPayU/OpenPayU.php');
23
  include_once('OpenPayU/OpenPayUOAuth.php');
24
 
25
  /*
26
- these files are 0.1.x compatible
27
  */
28
  include_once('OpenPayU/Result.php');
29
  include_once('OpenPayU/ResultOAuth.php');
1
  <?php
2
 
3
  /*
4
+ ver. 1.9.2
5
  OpenPayU Standard Library
6
 
7
  @copyright Copyright (c) 2011-2012 PayU
13
 
14
  include_once('openpayu_domain.php');
15
 
16
+ define('OPENPAYU_LIBRARY', true);
17
  /*
18
  these files are obsolete and will be removed in future.
19
+ valid only for SDK 0.x
20
  */
21
  include_once('OpenPayU/OpenPayUNetwork.php');
22
  include_once('OpenPayU/OpenPayUBase.php');
24
  include_once('OpenPayU/OpenPayUOAuth.php');
25
 
26
  /*
27
+ these files are 1.x compatible
28
  */
29
  include_once('OpenPayU/Result.php');
30
  include_once('OpenPayU/ResultOAuth.php');
package.xml CHANGED
@@ -1,20 +1,23 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>PayU_Account</name>
4
- <version>0.1.6.5.1</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/LGPL-3.0">LGPL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Official PayU payment gateway module.</summary>
10
  <description>PayU account is a new tool for making payments for items bought in several places on the Internet. By choosing it, you will increase transaction security and speed up the shopping process, as the time of waiting for funds from buyers is reduced to the minimum. The PayU account allows a buyer to define his favourite payment channels as well as save in one place personal and contact details needed to make payment for shopping. If a buyer uses a payment card, he may also save its details on the PayU account and afterwards, pay with one click, while data for delivery will be completed automatically. As a result, a payment is made within not more than a few seconds. An additional functionality for registered users of the PayU account is access to the whole transaction history in shops which have made this payment method available. Moreover, a special searcher allows you to sort items bought by such criteria as: date, transaction status, amount.</description>
11
- <notes>* Fixed Email empty value in new order&#xD;
12
- * Changed description labels in configuration&#xD;
13
- * Updated order statuses list</notes>
 
 
 
14
  <authors><author><name>PayU</name><user>PayU</user><email>openpayu@payu.pl</email></author></authors>
15
- <date>2012-11-16</date>
16
- <time>14:22:38</time>
17
- <contents><target name="magelocal"><dir name="PayU"><dir name="Account"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="View.php" hash="f82428f58d5b15ba5f4bd9a4dd8bec39"/></dir></dir></dir><file name="Advertisement.php" hash="d0da1d6bb06f324d26eea648b7fa9e02"/><file name="BeforeSummary.php" hash="7080c1d5771ed5cb0bc69f8e776fd728"/><file name="Button.php" hash="e81ae633ebd864eac4158d756c266583"/><file name="Form.php" hash="dd3ae4a644f43e1313bdd0c51c5d4f21"/><dir name="Onestep"><file name="Checkout.php" hash="97f5c2a2699bea719af61daf1a3360a3"/></dir><file name="Redirect.php" hash="3e71ac5664ac67e234a10ddcd7df655a"/><file name="UpdateInfo.php" hash="c62bdbfced3aca7aab86e6ad6a369943"/></dir><dir name="Helper"><file name="Data.php" hash="1c7b2d1e5fed49ac12bb56de09decc91"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Sales"><file name="Order.php" hash="faf6a7c3551674bbc4050d82b6900ae7"/></dir></dir><file name="Advertisement.php" hash="01b64fc8937fb81d3d407caac76fab4c"/><file name="Button.php" hash="55b5acc41cd8f19c1b44fe28a246bde6"/><file name="Config.php" hash="17307583e4486bd68e89487fc10a3631"/><file name="Environment.php" hash="0aa8943f090b85aac5fcceb0c99ea6bd"/><file name="PayU.php" hash="dede4435c2434c5658d6d38ee8c4c7bc"/><file name="Payment.php" hash="14c11b0c515f69c8456ab67447b3e62d"/><file name="Session.php" hash="0873e65998a8bb486a5ac752630e1194"/><file name="Thumbnail.php" hash="ca0ab08ce411d91606db7aa7985018a3"/><file name="ValidityTime.php" hash="6b0fe87971219061cbcd30da0becdf77"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><file name="OrderController.php" hash="135034b7624c96ecc747023c21880f7e"/></dir></dir><dir name="Checkout"><file name="CartController.php" hash="d069c4773562ddd72a4ceca13506ab99"/></dir><file name="PaymentController.php" hash="3bdb3564701ce0deefb93cf1b2864fdb"/></dir><dir name="etc"><file name="config.xml" hash="878dbd1417e427aed03209e70ed9f90e"/><file name="system.xml" hash="7075e0bc4f3debfe8858c3905b38c80d"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="payu_account.xml" hash="433c0d85f093a87658cca04fa2dcddd4"/></dir><dir name="template"><dir name="payu_account"><file name="advertisement.phtml" hash="2fc6547dc439c7a5c65b190b0b3bbd26"/><file name="form.phtml" hash="9dd9fd37672b2f249cd5b8701b8ce511"/><dir name="info"><file name="payu_account.phtml" hash="89ff5f164123bad98d94beafd8138532"/></dir><dir name="onestep"><file name="checkout.phtml" hash="e4149c323496f479233b48442ef99212"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PayU_Account.xml" hash="aa06ac3ab552c6069423bcafd5c0140d"/></dir></target><target name="magelocale"><dir name="pl_PL"><file name="PayU_Account.csv" hash="e73b234da35f2cefa78ffa8f36a4123b"/></dir></target><target name="magelib"><dir name="payu"><dir name="sdk"><dir name="OpenPayU"><file name="Configuration.php" hash="247d5b8eee40df9f2328e44a513b302d"/><file name="OAuth.php" hash="22a906bd9ffd37a7f9720ac12efd3117"/><file name="OpenPayU.php" hash="4013d4d8aaa4b985a2a26e01ee97312d"/><file name="OpenPayUBase.php" hash="8ff7b263a1463d749fc14c5b5f02659c"/><file name="OpenPayUNetwork.php" hash="a6090839643a7279459f358ae2a0e410"/><file name="OpenPayUOAuth.php" hash="701a2c75af0b9f0df8471e7f108e389a"/><file name="Order.php" hash="20f94d108ab5d27c3ec3fbef3d647729"/><file name="Result.php" hash="6ad2be85b87dfc7410c11ed3a507079e"/><file name="ResultOAuth.php" hash="b7ac42eb16a0be6bd38f3b3310025a5b"/></dir><file name="openpayu.php" hash="04068271490f87c9bdd7f280c5da34d6"/><file name="openpayu_domain.php" hash="b38e5963a8ad5e515bca8864851722d6"/></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>5.4.7</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>PayU_Account</name>
4
+ <version>1.8.0</version>
5
  <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/GPL-3.0">GPL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Official PayU payment gateway module.</summary>
10
  <description>PayU account is a new tool for making payments for items bought in several places on the Internet. By choosing it, you will increase transaction security and speed up the shopping process, as the time of waiting for funds from buyers is reduced to the minimum. The PayU account allows a buyer to define his favourite payment channels as well as save in one place personal and contact details needed to make payment for shopping. If a buyer uses a payment card, he may also save its details on the PayU account and afterwards, pay with one click, while data for delivery will be completed automatically. As a result, a payment is made within not more than a few seconds. An additional functionality for registered users of the PayU account is access to the whole transaction history in shops which have made this payment method available. Moreover, a special searcher allows you to sort items bought by such criteria as: date, transaction status, amount.</description>
11
+ <notes>* SDK 1.9.2 compatible&#xD;
12
+ * Fixed PayU order cancelling&#xD;
13
+ * Fixed adding customer shipping address in orders that are not virtual&#xD;
14
+ * Fixed status changing for Payment Review after complete payment&#xD;
15
+ * Fixed updating customer data&#xD;
16
+ * Changed order number in PayU description</notes>
17
  <authors><author><name>PayU</name><user>PayU</user><email>openpayu@payu.pl</email></author></authors>
18
+ <date>2013-01-09</date>
19
+ <time>09:00:47</time>
20
+ <contents><target name="magelocal"><dir name="PayU"><dir name="Account"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="View.php" hash="cd9a46683285dbdfd6b486da7cecb00c"/></dir></dir></dir><file name="Advertisement.php" hash="e992985d5d540ff5f96586f55fcd214e"/><file name="BeforeSummary.php" hash="5e6bb947a0ded3aa3a438ce35e62d650"/><file name="Button.php" hash="fa5e5e870ca17fc1d41ec284c26fc0a1"/><file name="Form.php" hash="fd28a15228ee3e3751c0b8354a0c6e52"/><dir name="Onestep"><file name="Checkout.php" hash="d47ad30f49bc19cb710bf6ea3b02a134"/></dir><file name="Redirect.php" hash="a96180c4dd5ee7bd062a3dced00fe9f0"/><file name="UpdateInfo.php" hash="5bcbde5c4710ecd9680bec5ab83318b5"/></dir><dir name="Helper"><file name="Data.php" hash="17689d5d8eefce0f629956dabc650dc4"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Sales"><file name="Order.php" hash="faf6a7c3551674bbc4050d82b6900ae7"/></dir></dir><file name="Advertisement.php" hash="065cefc6e855a4a776735b48289bc421"/><file name="Button.php" hash="96e26771d626e80c7edef9683d3f96af"/><file name="Config.php" hash="04bb8d21d57601bc5bd67dc812dfdd17"/><file name="Environment.php" hash="9f1be124f01490e28f6d7451a40d3ddc"/><file name="Payment.php" hash="c8186c30731f1a28f57a2d432566e7d4"/><file name="Session.php" hash="fc2c641276974a24dce771ddae53a603"/><file name="Thumbnail.php" hash="1dc8fbf677ae5bdf8f132d1f3c03e9ec"/><file name="ValidityTime.php" hash="66afc1084c745101a0dcc91ebef371e9"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><file name="OrderController.php" hash="04760cf92a60f65a6b79f944ba2def75"/></dir></dir><dir name="Checkout"><file name="CartController.php" hash="0d6d11ba957d86db5cf2c9a0374827b1"/></dir><file name="PaymentController.php" hash="c898741ed860129369d36cfdfcb5f97b"/></dir><dir name="etc"><file name="config.xml" hash="ca492b2841f1db11079d44fba5573cea"/><file name="system.xml" hash="ce8b4b9be869e975ac39c66718f3135e"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="payu_account.xml" hash="433c0d85f093a87658cca04fa2dcddd4"/></dir><dir name="template"><dir name="payu_account"><file name="advertisement.phtml" hash="2fc6547dc439c7a5c65b190b0b3bbd26"/><file name="form.phtml" hash="9dd9fd37672b2f249cd5b8701b8ce511"/><dir name="info"><file name="payu_account.phtml" hash="7dca844484f24df5755843cb333a2522"/></dir><dir name="onestep"><file name="checkout.phtml" hash="e4149c323496f479233b48442ef99212"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PayU_Account.xml" hash="aa06ac3ab552c6069423bcafd5c0140d"/></dir></target><target name="magelocale"><dir name="pl_PL"><file name="PayU_Account.csv" hash="8b47bf3369251cf0aa73afaf45432286"/></dir></target><target name="magelib"><dir name="payu"><dir name="sdk"><dir name="OpenPayU"><file name="Configuration.php" hash="247d5b8eee40df9f2328e44a513b302d"/><file name="OAuth.php" hash="a79961511507adb26da90ab62ece13e5"/><file name="OpenPayU.php" hash="51e2264ca697426e1e22af771101e51d"/><file name="OpenPayUBase.php" hash="86f1055be25d83c201f1c446d9241162"/><file name="OpenPayUNetwork.php" hash="a6090839643a7279459f358ae2a0e410"/><file name="OpenPayUOAuth.php" hash="3a02719cce05c3bf000a6fb16c3549a3"/><file name="Order.php" hash="0443d276c32f6b3ccf9367266c39ef7c"/><file name="Result.php" hash="6ad2be85b87dfc7410c11ed3a507079e"/><file name="ResultOAuth.php" hash="b7ac42eb16a0be6bd38f3b3310025a5b"/></dir><file name="openpayu.php" hash="41e9d45960644cd2071cd2845e39b253"/><file name="openpayu_domain.php" hash="b38e5963a8ad5e515bca8864851722d6"/></dir></dir></target></contents>
21
  <compatible/>
22
  <dependencies><required><php><min>5.2.0</min><max>5.4.7</max></php></required></dependencies>
23
  </package>