ET_PaymentRobokassa - Version 1.1.0

Version Notes

stable release

Download this release

Release Info

Developer Magento Core Team
Extension ET_PaymentRobokassa
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.10 to 1.1.0

Files changed (23) hide show
  1. app/code/community/ET/PaymentRobokassa/Block/Adminhtml/Support.php +43 -46
  2. app/code/community/ET/PaymentRobokassa/Block/Adminhtml/System/Config/Form/Field/CallbackUrls.php +50 -10
  3. app/code/community/ET/PaymentRobokassa/Block/Adminhtml/System/Config/Form/Field/Heading.php +13 -1
  4. app/code/community/ET/PaymentRobokassa/Block/Adminhtml/System/Config/Form/Field/Linktoinfo.php +15 -3
  5. app/code/community/ET/PaymentRobokassa/Block/Adminhtml/System/Config/Form/Field/Linktooptions.php +14 -3
  6. app/code/community/ET/PaymentRobokassa/Block/Error.php +0 -34
  7. app/code/community/ET/PaymentRobokassa/Block/Form.php +0 -22
  8. app/code/community/ET/PaymentRobokassa/Block/Info.php +0 -22
  9. app/code/community/ET/PaymentRobokassa/Block/Redirect.php +10 -0
  10. app/code/community/ET/PaymentRobokassa/Block/Single/Form.php +6 -0
  11. app/code/community/ET/PaymentRobokassa/Block/Single/Info.php +6 -0
  12. app/code/community/ET/PaymentRobokassa/Controller/Router.php +35 -15
  13. app/code/community/ET/PaymentRobokassa/Helper/Data.php +44 -21
  14. app/code/community/ET/PaymentRobokassa/Model/Culture.php +6 -0
  15. app/code/community/ET/PaymentRobokassa/Model/Hashtype.php +56 -0
  16. app/code/community/ET/PaymentRobokassa/Model/Method/Etrobokassa.php +149 -89
  17. app/code/community/ET/PaymentRobokassa/Model/Paysystem.php +33 -33
  18. app/code/community/ET/PaymentRobokassa/controllers/GateController.php +47 -24
  19. app/code/community/ET/PaymentRobokassa/etc/config.xml +2 -1
  20. app/code/community/ET/PaymentRobokassa/etc/system.xml +53 -8
  21. app/code/community/ET/PaymentRobokassa/sql/etpaymentrobokassa_setup/mysql4-install-1.0.0.php +2 -2
  22. app/locale/ru_RU/ET_PaymentRobokassa.csv +14 -6
  23. package.xml +4 -4
app/code/community/ET/PaymentRobokassa/Block/Adminhtml/Support.php CHANGED
@@ -12,23 +12,31 @@
12
  *
13
  * @category ET
14
  * @package ET_PaymentRobokassa
15
- * @copyright Copyright (c) 2013 ET Web Solutions (http://etwebsolutions.com)
16
  * @contacts support@etwebsolutions.com
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
 
 
 
20
  class ET_PaymentRobokassa_Block_Adminhtml_Support
21
  extends Mage_Adminhtml_Block_Abstract
22
  implements Varien_Data_Form_Element_Renderer_Interface
23
  {
 
 
 
24
  /**
25
  * Support tab
26
- * version 2.0.0
 
 
27
  */
28
  public function render(Varien_Data_Form_Element_Abstract $element)
29
  {
30
- $helper = Mage::helper('etpaymentrobokassa');
31
- $moduleNameId = 'ET_PaymentRobokassa';
32
 
33
  $moduleVersion = $this->_getConfigValue($moduleNameId, 'version');
34
  $moduleName = $this->_getConfigValue($moduleNameId, 'name');
@@ -110,6 +118,13 @@ class ET_PaymentRobokassa_Block_Adminhtml_Support
110
  return $html;
111
  }
112
 
 
 
 
 
 
 
 
113
  protected function _getConfigValue($module, $config)
114
  {
115
  $locale = Mage::app()->getLocale()->getLocaleCode();
@@ -128,13 +143,19 @@ class ET_PaymentRobokassa_Block_Adminhtml_Support
128
  }
129
  }
130
 
 
131
  const PLATFORM_CE = 'ce';
132
  const PLATFORM_PE = 'pe';
133
  const PLATFORM_EE = 'ee';
134
- const PLATFORM_GO = 'go';
135
  const PLATFORM_UNKNOWN = 'unknown';
136
 
137
- protected static $_platformCode = self::PLATFORM_UNKNOWN;
 
 
 
 
 
 
138
 
139
  /**
140
  * Get edition code
@@ -142,47 +163,23 @@ class ET_PaymentRobokassa_Block_Adminhtml_Support
142
  */
143
  protected function _getPlatform()
144
  {
145
- if (self::$_platformCode == self::PLATFORM_UNKNOWN) {
146
- // from Magento CE version 1.7. we can get platform from Mage class
147
- if (property_exists('Mage', '_currentEdition')) {
148
- switch (Mage::getEdition()) {
149
- case Mage::EDITION_COMMUNITY:
150
- self::$_platformCode = self::PLATFORM_CE;
151
- break;
152
- case Mage::EDITION_PROFESSIONAL:
153
- self::$_platformCode = self::PLATFORM_PE;
154
- break;
155
- case Mage::EDITION_ENTERPRISE:
156
- self::$_platformCode = self::PLATFORM_EE;
157
- break;
158
- case Mage::EDITION_ENTERPRISE:
159
- self::$_platformCode = self::PLATFORM_EE;
160
- break;
161
- default:
162
- self::$_platformCode = self::PLATFORM_UNKNOWN;
163
- }
164
- }
165
-
166
- // if platform still unknown
167
- if (self::$_platformCode == self::PLATFORM_UNKNOWN) {
168
- $modulesArray = (array)Mage::getConfig()->getNode('modules')->children();
169
- $isEnterprise = array_key_exists('Enterprise_Enterprise', $modulesArray);
170
-
171
- $isProfessional = false; // TODO: how determine?
172
- $isGo = false; // TODO: how?
173
-
174
- if ($isEnterprise) {
175
- self::$_platformCode = self::PLATFORM_EE;
176
- } elseif ($isProfessional) {
177
- self::$_platformCode = self::PLATFORM_PE;
178
- } elseif ($isGo) {
179
- self::$_platformCode = self::PLATFORM_GO;
180
- } else {
181
- self::$_platformCode = self::PLATFORM_CE;
182
- }
183
- }
184
  }
185
- return self::$_platformCode;
 
 
 
 
 
 
 
186
  }
187
 
188
  }
12
  *
13
  * @category ET
14
  * @package ET_PaymentRobokassa
15
+ * @copyright Copyright (c) 2015 ET Web Solutions (http://etwebsolutions.com)
16
  * @contacts support@etwebsolutions.com
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ /**
21
+ * Class ET_PaymentRobokassa_Block_Adminhtml_Support
22
+ */
23
  class ET_PaymentRobokassa_Block_Adminhtml_Support
24
  extends Mage_Adminhtml_Block_Abstract
25
  implements Varien_Data_Form_Element_Renderer_Interface
26
  {
27
+
28
+ protected $_helperName = 'etpaymentrobokassa';
29
+
30
  /**
31
  * Support tab
32
+ * version 2.2.1
33
+ *
34
+ * @inheritdoc
35
  */
36
  public function render(Varien_Data_Form_Element_Abstract $element)
37
  {
38
+ $helper = Mage::helper($this->_helperName);
39
+ $moduleNameId = $this->getModuleName();
40
 
41
  $moduleVersion = $this->_getConfigValue($moduleNameId, 'version');
42
  $moduleName = $this->_getConfigValue($moduleNameId, 'name');
118
  return $html;
119
  }
120
 
121
+ /**
122
+ * Retrieve value from configuration
123
+ *
124
+ * @param string $module
125
+ * @param string $config
126
+ * @return Mage_Core_Model_Config_Element|SimpleXMLElement[]
127
+ */
128
  protected function _getConfigValue($module, $config)
129
  {
130
  $locale = Mage::app()->getLocale()->getLocaleCode();
143
  }
144
  }
145
 
146
+
147
  const PLATFORM_CE = 'ce';
148
  const PLATFORM_PE = 'pe';
149
  const PLATFORM_EE = 'ee';
 
150
  const PLATFORM_UNKNOWN = 'unknown';
151
 
152
+ protected $_platformCode = self::PLATFORM_UNKNOWN;
153
+
154
+ protected $_platformNames = array(
155
+ Mage::EDITION_COMMUNITY => self::PLATFORM_CE,
156
+ Mage::EDITION_PROFESSIONAL => self::PLATFORM_PE,
157
+ Mage::EDITION_ENTERPRISE => self::PLATFORM_EE,
158
+ );
159
 
160
  /**
161
  * Get edition code
163
  */
164
  protected function _getPlatform()
165
  {
166
+ if ($this->_platformCode != self::PLATFORM_UNKNOWN) {
167
+ return $this->_platformCode;
168
+ }
169
+
170
+ // from Magento CE version 1.7. we can get platform from Mage class
171
+ if (property_exists('Mage', '_currentEdition') && isset($this->_platformNames[Mage::getEdition()])) {
172
+ $this->_platformCode = $this->_platformNames[Mage::getEdition()];
173
+ return $this->_platformCode;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  }
175
+
176
+ // if platform still unknown
177
+ $modulesArray = (array)Mage::getConfig()->getNode('modules')->children();
178
+ $isEnterprise = array_key_exists('Enterprise_Enterprise', $modulesArray);
179
+
180
+ $this->_platformCode = $isEnterprise ? self::PLATFORM_EE : self::PLATFORM_CE;
181
+
182
+ return $this->_platformCode;
183
  }
184
 
185
  }
app/code/community/ET/PaymentRobokassa/Block/Adminhtml/System/Config/Form/Field/CallbackUrls.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * NOTICE OF LICENSE
5
  *
@@ -17,20 +16,61 @@
17
  * @contacts support@etwebsolutions.com
18
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
19
  */
 
 
 
 
20
  class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_CallbackUrls
21
  extends Mage_Adminhtml_Block_System_Config_Form_Field_Heading
22
  {
 
 
 
 
23
  public function render(Varien_Data_Form_Element_Abstract $element)
24
  {
25
  $baseUrl = Mage::getBaseUrl('web');
26
- return sprintf(
27
- '<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4 id="%s">%s</h4></td></tr>' .
28
- '<tr><td colspan="5"><span>' . $this->__("You have to set callback links for your shop in your account on Robokassa website to make extension work.") . '</span></td></tr>' .
29
- '<tr><td class="label"><label>' . $this->__("Result URL") . '</label></td><td class="value">' . $baseUrl . 'etrobokassa/status<p class="note"><span>' . $this->__("POST or GET data transfer method") . '</span></p></td></tr>' .
30
- '<tr><td class="label"><label>' . $this->__("Success URL") . '</label></td><td class="value">' . $baseUrl . 'etrobokassa/success<p class="note"><span>' . $this->__("POST or GET data transfer method") . '</span></p></td></tr>' .
31
- '<tr><td class="label"><label>' . $this->__("Failure URL") . '</label></td><td class="value">' . $baseUrl . 'etrobokassa/failure<p class="note"><span>' . $this->__("POST or GET data transfer method") . '</span></p></td></tr>' .
32
- '<tr><td class="label"><label>' . $this->__("Documentation") . '</label></td><td class="value"><a href="http://shop.etwebsolutions.com/eng/et-payment-robokassa.html#documentation">http://shop.etwebsolutions.com/eng/et-payment-robokassa.html#documentation</a></td></tr>',
33
- $element->getHtmlId(), $element->getHtmlId(), $element->getLabel()
34
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
  }
1
  <?php
 
2
  /**
3
  * NOTICE OF LICENSE
4
  *
16
  * @contacts support@etwebsolutions.com
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
+
20
+ /**
21
+ * Class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_CallbackUrls
22
+ */
23
  class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_CallbackUrls
24
  extends Mage_Adminhtml_Block_System_Config_Form_Field_Heading
25
  {
26
+ /**
27
+ * @param Varien_Data_Form_Element_Abstract $element
28
+ * @return string
29
+ */
30
  public function render(Varien_Data_Form_Element_Abstract $element)
31
  {
32
  $baseUrl = Mage::getBaseUrl('web');
33
+ $description = "You have to set callback links for your shop in" .
34
+ " your account on Robokassa website to make extension work.";
35
+ $comment = "POST or GET data transfer method";
36
+ return <<<HTML
37
+ <tr class="system-fieldset-sub-head" id="row_{$element->getHtmlId()}">
38
+ <td colspan="5"><h4 id="{$element->getHtmlId()}">{$element->getData('label')}</h4></td>
39
+ </tr>
40
+ <tr>
41
+ <td colspan="5"><span>
42
+ {$this->__($description)}
43
+ </span></td>
44
+ </tr>
45
+ <tr>
46
+ <td class="label"><label>{$this->__("Result URL")}</label></td>
47
+ <td colspan="4" class="value">
48
+ {$baseUrl}etrobokassa/status
49
+ <p class="note"><span>{$this->__($comment)}</span></p>
50
+ </td>
51
+ </tr>
52
+ <tr>
53
+ <td class="label"><label>{$this->__("Success URL")}</label></td>
54
+ <td colspan="4" class="value">
55
+ {$baseUrl}etrobokassa/success
56
+ <p class="note"><span>{$this->__($comment)}</span></p>
57
+ </td>
58
+ </tr>
59
+ <tr>
60
+ <td class="label"><label>{$this->__("Failure URL")}</label></td>
61
+ <td colspan="4" class="value">
62
+ {$baseUrl}etrobokassa/failure
63
+ <p class="note"><span>{$this->__($comment)}</span></p>
64
+ </td>
65
+ </tr>
66
+ <tr>
67
+ <td class="label"><label>{$this->__("Documentation")}</label></td>
68
+ <td colspan="4" class="value">
69
+ <a href="http://shop.etwebsolutions.com/eng/et-payment-robokassa.html#documentation" target="_blank">
70
+ http://shop.etwebsolutions.com/eng/et-payment-robokassa.html#documentation
71
+ </a>
72
+ </td>
73
+ </tr>
74
+ HTML;
75
  }
76
  }
app/code/community/ET/PaymentRobokassa/Block/Adminhtml/System/Config/Form/Field/Heading.php CHANGED
@@ -20,20 +20,32 @@
20
  //if (!class_exists('Mage_Adminhtml_Block_System_Config_Form_Field_Heading')) {
21
  // https://bugs.php.net/bug.php?id=52339
22
  if (version_compare(Mage::getVersion(), '1.4.1', '<')) {
 
 
 
 
23
  class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Heading
24
  extends Mage_Adminhtml_Block_Abstract
25
  implements Varien_Data_Form_Element_Renderer_Interface
26
  {
27
 
 
 
 
 
28
  public function render(Varien_Data_Form_Element_Abstract $element)
29
  {
30
  return sprintf(
31
  '<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4 id="%s">%s</h4></td></tr>',
32
- $element->getHtmlId(), $element->getHtmlId(), $element->getLabel()
33
  );
34
  }
35
  }
36
  } else {
 
 
 
 
37
  class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Heading
38
  extends Mage_Adminhtml_Block_System_Config_Form_Field_Heading
39
  {
20
  //if (!class_exists('Mage_Adminhtml_Block_System_Config_Form_Field_Heading')) {
21
  // https://bugs.php.net/bug.php?id=52339
22
  if (version_compare(Mage::getVersion(), '1.4.1', '<')) {
23
+ /**
24
+ * Class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Heading
25
+ * for old Magento versions
26
+ */
27
  class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Heading
28
  extends Mage_Adminhtml_Block_Abstract
29
  implements Varien_Data_Form_Element_Renderer_Interface
30
  {
31
 
32
+ /**
33
+ * @param Varien_Data_Form_Element_Abstract $element
34
+ * @return string
35
+ */
36
  public function render(Varien_Data_Form_Element_Abstract $element)
37
  {
38
  return sprintf(
39
  '<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4 id="%s">%s</h4></td></tr>',
40
+ $element->getHtmlId(), $element->getHtmlId(), $element->getData('label')
41
  );
42
  }
43
  }
44
  } else {
45
+ /**
46
+ * Class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Heading
47
+ * for new versions
48
+ */
49
  class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Heading
50
  extends Mage_Adminhtml_Block_System_Config_Form_Field_Heading
51
  {
app/code/community/ET/PaymentRobokassa/Block/Adminhtml/System/Config/Form/Field/Linktoinfo.php CHANGED
@@ -17,13 +17,25 @@
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
 
 
 
20
  class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Linktoinfo
21
  extends Mage_Adminhtml_Block_System_Config_Form_Field
22
  {
 
 
 
 
 
 
23
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
24
  {
25
- return '<a href="' . $this->getUrl('*/system_config/edit', array('section' => 'etpaymentrobokassa')) . '">' .
26
- Mage::helper('etpaymentrobokassa')->__('Extension information') .
27
- '</a>';
 
 
 
28
  }
29
  }
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ /**
21
+ * Class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Linktoinfo
22
+ */
23
  class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Linktoinfo
24
  extends Mage_Adminhtml_Block_System_Config_Form_Field
25
  {
26
+ /**
27
+ * @param Varien_Data_Form_Element_Abstract $element
28
+ * @return string
29
+ *
30
+ * @inheritdoc
31
+ */
32
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
33
  {
34
+ /** @var ET_PaymentRobokassa_Helper_Data $helper */
35
+ $helper = Mage::helper('etpaymentrobokassa');
36
+
37
+ $html = '<a href="' . $this->getUrl('*/system_config/edit', array('section' => 'etpaymentrobokassa')) . '">' .
38
+ $helper->__('Extension information') . '</a>';
39
+ return $html;
40
  }
41
  }
app/code/community/ET/PaymentRobokassa/Block/Adminhtml/System/Config/Form/Field/Linktooptions.php CHANGED
@@ -17,13 +17,24 @@
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
 
 
 
20
  class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Linktooptions
21
  extends Mage_Adminhtml_Block_System_Config_Form_Field
22
  {
 
 
 
 
 
 
23
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
24
  {
25
- return '<a href="' . $this->getUrl('*/system_config/edit', array('section' => 'payment')) . '">' .
26
- Mage::helper('etpaymentrobokassa')->__('Go to Payment Methods settings section') .
27
- '</a>';
 
 
28
  }
29
  }
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ /**
21
+ * Class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Linktooptions
22
+ */
23
  class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_Linktooptions
24
  extends Mage_Adminhtml_Block_System_Config_Form_Field
25
  {
26
+ /**
27
+ * @param Varien_Data_Form_Element_Abstract $element
28
+ * @return string
29
+ *
30
+ * @inheritdoc
31
+ */
32
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
33
  {
34
+ /** @var ET_PaymentRobokassa_Helper_Data $helper */
35
+ $helper = Mage::helper('etpaymentrobokassa');
36
+ $html = '<a href="' . $this->getUrl('*/system_config/edit', array('section' => 'payment')) . '">' .
37
+ $helper->__('Go to Payment Methods settings section') . '</a>';
38
+ return $html;
39
  }
40
  }
app/code/community/ET/PaymentRobokassa/Block/Error.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * NOTICE OF LICENSE
5
- *
6
- * You may not sell, sub-license, rent or lease
7
- * any portion of the Software or Documentation to anyone.
8
- *
9
- * DISCLAIMER
10
- *
11
- * Do not edit or add to this file if you wish to upgrade to newer
12
- * versions in the future.
13
- *
14
- * @category ET
15
- * @package ET_PaymentRobokassa
16
- * @copyright Copyright (c) 2015 ET Web Solutions (http://etwebsolutions.com)
17
- * @contacts support@etwebsolutions.com
18
- * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
19
- */
20
- class ET_PaymentRobokassa_Block_Error extends Mage_Core_Block_Abstract
21
- {
22
- protected function _toHtml()
23
- {
24
- $storeId = Mage::app()->getStore()->getId();
25
- $html = '<html><body>';
26
- $html .= $this->__('An error has occurred during the checkout process. Please, contact the store owner.');
27
- $html .= '<br><br><a href="' .
28
- Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . '">' .
29
- $this->__('Back to the main page') . '</a>';
30
- $html .= '</body></html>';
31
- return $html;
32
- }
33
-
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ET/PaymentRobokassa/Block/Form.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- /**
3
- * NOTICE OF LICENSE
4
- *
5
- * You may not sell, sub-license, rent or lease
6
- * any portion of the Software or Documentation to anyone.
7
- *
8
- * DISCLAIMER
9
- *
10
- * Do not edit or add to this file if you wish to upgrade to newer
11
- * versions in the future.
12
- *
13
- * @category ET
14
- * @package ET_PaymentRobokassa
15
- * @copyright Copyright (c) 2013 ET Web Solutions (http://etwebsolutions.com)
16
- * @contacts support@etwebsolutions.com
17
- * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
- */
19
-
20
- class ET_PaymentRobokassa_Block_Form extends Mage_Payment_Block_Form
21
- {
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ET/PaymentRobokassa/Block/Info.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- /**
3
- * NOTICE OF LICENSE
4
- *
5
- * You may not sell, sub-license, rent or lease
6
- * any portion of the Software or Documentation to anyone.
7
- *
8
- * DISCLAIMER
9
- *
10
- * Do not edit or add to this file if you wish to upgrade to newer
11
- * versions in the future.
12
- *
13
- * @category ET
14
- * @package ET_PaymentRobokassa
15
- * @copyright Copyright (c) 2013 ET Web Solutions (http://etwebsolutions.com)
16
- * @contacts support@etwebsolutions.com
17
- * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
- */
19
-
20
- class ET_PaymentRobokassa_Block_Info extends Mage_Payment_Block_Info
21
- {
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ET/PaymentRobokassa/Block/Redirect.php CHANGED
@@ -17,10 +17,16 @@
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
 
 
 
20
  class ET_PaymentRobokassa_Block_Redirect extends Mage_Core_Block_Abstract
21
  {
22
  protected $_postData;
23
 
 
 
 
24
  protected function _toHtml()
25
  {
26
  $html = '<html><body>';
@@ -35,6 +41,10 @@ class ET_PaymentRobokassa_Block_Redirect extends Mage_Core_Block_Abstract
35
  return $html;
36
  }
37
 
 
 
 
 
38
  public function setPostData($data)
39
  {
40
  $this->_postData = $data;
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ /**
21
+ * Class ET_PaymentRobokassa_Block_Redirect
22
+ */
23
  class ET_PaymentRobokassa_Block_Redirect extends Mage_Core_Block_Abstract
24
  {
25
  protected $_postData;
26
 
27
+ /**
28
+ * @return string
29
+ */
30
  protected function _toHtml()
31
  {
32
  $html = '<html><body>';
41
  return $html;
42
  }
43
 
44
+ /**
45
+ * @param $data array
46
+ * @return $this ET_PaymentRobokassa_Block_Redirect
47
+ */
48
  public function setPostData($data)
49
  {
50
  $this->_postData = $data;
app/code/community/ET/PaymentRobokassa/Block/Single/Form.php CHANGED
@@ -17,8 +17,14 @@
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
 
 
 
20
  class ET_PaymentRobokassa_Block_Single_Form extends Mage_Payment_Block_Form
21
  {
 
 
 
22
  protected function _construct()
23
  {
24
  parent::_construct();
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ /**
21
+ * Class ET_PaymentRobokassa_Block_Single_Form
22
+ */
23
  class ET_PaymentRobokassa_Block_Single_Form extends Mage_Payment_Block_Form
24
  {
25
+ /**
26
+ * Internal constructor
27
+ */
28
  protected function _construct()
29
  {
30
  parent::_construct();
app/code/community/ET/PaymentRobokassa/Block/Single/Info.php CHANGED
@@ -17,8 +17,14 @@
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
 
 
 
20
  class ET_PaymentRobokassa_Block_Single_Info extends Mage_Payment_Block_Info
21
  {
 
 
 
22
  protected function _construct()
23
  {
24
  parent::_construct();
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ /**
21
+ * Class ET_PaymentRobokassa_Block_Single_Info
22
+ */
23
  class ET_PaymentRobokassa_Block_Single_Info extends Mage_Payment_Block_Info
24
  {
25
+ /**
26
+ * Internal constructor
27
+ */
28
  protected function _construct()
29
  {
30
  parent::_construct();
app/code/community/ET/PaymentRobokassa/Controller/Router.php CHANGED
@@ -17,29 +17,49 @@
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
- // Нужен из-за того, что платёжный сервер в любом случае
21
- // возвращает на один и тот же адрес, независимо
22
- // от успеха операции и языка.
23
-
 
 
 
 
 
 
 
24
  class ET_PaymentRobokassa_Controller_Router extends Mage_Core_Controller_Varien_Router_Abstract
25
  {
26
  protected $_routerController;
27
  protected $_routerName = 'etrobokassa';
28
  protected $_moduleName = 'etpaymentrobokassa';
29
 
 
 
 
 
 
 
 
30
 
 
 
 
31
  public function initControllerRouters($observer)
32
  {
 
33
  $front = $observer->getEvent()->getFront();
34
  $this->setRouterController();
35
  $front->addRouter($this->_routerName, $this->_routerController);
36
  }
37
 
38
- public function setRouterController()
39
- {
40
- $this->_routerController = new ET_PaymentRobokassa_Controller_Router();
41
- }
42
 
 
 
 
 
 
 
43
  public function match(Zend_Controller_Request_Http $request)
44
  {
45
  if (!Mage::isInstalled()) {
@@ -50,16 +70,16 @@ class ET_PaymentRobokassa_Controller_Router extends Mage_Core_Controller_Varien_
50
  }
51
 
52
  $identifier = trim($request->getPathInfo(), '/');
53
- $allpath = explode("/", $identifier);
54
 
55
  //ne nash modulj
56
- if ($this->_isOurModule($allpath[0])) {
57
  return false;
58
  }
59
 
60
  /* to avoid /gate/ in return urls */
61
- $allpath[2] = $allpath[1];
62
- $allpath[1] = 'gate';
63
 
64
  if ($orderId = $request->getParam("InvId")) {
65
  Mage::app()->getStore()->load(Mage::getModel("sales/order")->load($orderId)->getStoreId());
@@ -67,8 +87,8 @@ class ET_PaymentRobokassa_Controller_Router extends Mage_Core_Controller_Varien_
67
  // var_dump($allpath);
68
  //exit();
69
  $request->setModuleName($this->_moduleName)
70
- ->setControllerName(isset($allpath[1]) ? $allpath[1] : 'gate')
71
- ->setActionName(isset($allpath[2]) ? $allpath[2] : 'success');
72
  $request->setAlias(
73
  Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS,
74
  trim($request->getPathInfo(), '/')
@@ -78,7 +98,7 @@ class ET_PaymentRobokassa_Controller_Router extends Mage_Core_Controller_Varien_
78
  }
79
 
80
  /**
81
- * @param $allpath
82
  * @return bool
83
  */
84
  protected function _isOurModule($urlKey)
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ /**
21
+ * Class ET_PaymentRobokassa_Controller_Router
22
+ *
23
+ * Нужен из-за того, что платёжный сервер в любом случае
24
+ * возвращает на один и тот же адрес, независимо
25
+ * от успеха операции и языка.
26
+ *
27
+ * We need this router, because payment server always return
28
+ * to the same url, regardless of
29
+ * the operation success status and the language
30
+ */
31
  class ET_PaymentRobokassa_Controller_Router extends Mage_Core_Controller_Varien_Router_Abstract
32
  {
33
  protected $_routerController;
34
  protected $_routerName = 'etrobokassa';
35
  protected $_moduleName = 'etpaymentrobokassa';
36
 
37
+ /**
38
+ * Option setter
39
+ */
40
+ public function setRouterController()
41
+ {
42
+ $this->_routerController = new ET_PaymentRobokassa_Controller_Router();
43
+ }
44
 
45
+ /**
46
+ * @param Varien_Event_Observer $observer
47
+ */
48
  public function initControllerRouters($observer)
49
  {
50
+ /* @var $front Mage_Core_Controller_Varien_Front */
51
  $front = $observer->getEvent()->getFront();
52
  $this->setRouterController();
53
  $front->addRouter($this->_routerName, $this->_routerController);
54
  }
55
 
 
 
 
 
56
 
57
+ /**
58
+ * Redirect customer to necessary Store View
59
+ *
60
+ * @param Zend_Controller_Request_Http $request
61
+ * @return bool
62
+ */
63
  public function match(Zend_Controller_Request_Http $request)
64
  {
65
  if (!Mage::isInstalled()) {
70
  }
71
 
72
  $identifier = trim($request->getPathInfo(), '/');
73
+ $allPath = explode("/", $identifier);
74
 
75
  //ne nash modulj
76
+ if ($this->_isOurModule($allPath[0])) {
77
  return false;
78
  }
79
 
80
  /* to avoid /gate/ in return urls */
81
+ $allPath[2] = $allPath[1];
82
+ $allPath[1] = 'gate';
83
 
84
  if ($orderId = $request->getParam("InvId")) {
85
  Mage::app()->getStore()->load(Mage::getModel("sales/order")->load($orderId)->getStoreId());
87
  // var_dump($allpath);
88
  //exit();
89
  $request->setModuleName($this->_moduleName)
90
+ ->setControllerName(isset($allPath[1]) ? $allPath[1] : 'gate')
91
+ ->setActionName(isset($allPath[2]) ? $allPath[2] : 'success');
92
  $request->setAlias(
93
  Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS,
94
  trim($request->getPathInfo(), '/')
98
  }
99
 
100
  /**
101
+ * @param string $urlKey
102
  * @return bool
103
  */
104
  protected function _isOurModule($urlKey)
app/code/community/ET/PaymentRobokassa/Helper/Data.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * NOTICE OF LICENSE
5
  *
@@ -17,40 +16,44 @@
17
  * @contacts support@etwebsolutions.com
18
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
19
  */
 
 
 
 
20
  class ET_PaymentRobokassa_Helper_Data extends Mage_Core_Helper_Abstract
21
  {
22
 
 
 
 
 
 
23
  public function refillCart($order)
24
  {
25
- //probujem zanovo nabitj korzinu
26
- $cartRefilled = true;
27
-
28
  $cart = Mage::getSingleton('checkout/cart');
29
  $items = $order->getItemsCollection();
 
 
 
30
  foreach ($items as $item) {
31
  try {
32
  $cart->addOrderItem($item);
33
- } catch (Mage_Core_Exception $e) {
34
- $cartRefilled = false;
35
- if (Mage::getSingleton('checkout/session')->getUseNotice(true)) {
36
- Mage::getSingleton('checkout/session')->addNotice($e->getMessage());
37
- } else {
38
- Mage::getSingleton('checkout/session')->addError($e->getMessage());
39
- }
40
- $this->_redirect('customer/account/history');
41
  } catch (Exception $e) {
42
- $cartRefilled = false;
43
- Mage::getSingleton('checkout/session')->addException(
44
- $e,
45
- Mage::helper('checkout')->__('Cannot add the item to shopping cart.')
46
  );
47
  }
48
  }
49
  $cart->save();
50
-
51
- return $cartRefilled;
52
  }
53
 
 
 
 
 
 
 
54
  public function log($message)
55
  {
56
  if ($this->isLogEnabled()) {
@@ -59,7 +62,8 @@ class ET_PaymentRobokassa_Helper_Data extends Mage_Core_Helper_Abstract
59
  Mage::dispatchEvent('robokassa_log_file_write_before', $message);
60
  $forLog = array();
61
  foreach ($message as $answerKey => $answerValue) {
62
- $forLog[] = $answerKey . ": " . (is_array($answerValue) ? print_r($answerValue, true) : $answerValue);
 
63
  }
64
  $forLog[] = '***************************';
65
  $message = implode("\r\n", $forLog);
@@ -69,8 +73,15 @@ class ET_PaymentRobokassa_Helper_Data extends Mage_Core_Helper_Abstract
69
  return true;
70
  }
71
 
 
 
 
 
 
 
72
  public function arrayToRawData($array)
73
  {
 
74
  foreach ($array as $key => $value) {
75
  $newArray[] = $key . ": " . $value;
76
  }
@@ -78,14 +89,26 @@ class ET_PaymentRobokassa_Helper_Data extends Mage_Core_Helper_Abstract
78
  return $raw;
79
  }
80
 
 
 
 
 
 
81
  public function isLogEnabled()
82
  {
83
- return Mage::getStoreConfig('payment/etrobokassa/enable_log');
 
84
  }
85
 
 
 
 
 
 
86
  public function getLogFileName()
87
  {
88
- return 'et_robokassa.log';
89
  }
90
 
 
91
  }
1
  <?php
 
2
  /**
3
  * NOTICE OF LICENSE
4
  *
16
  * @contacts support@etwebsolutions.com
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
+
20
+ /**
21
+ * Class ET_PaymentRobokassa_Helper_Data
22
+ */
23
  class ET_PaymentRobokassa_Helper_Data extends Mage_Core_Helper_Abstract
24
  {
25
 
26
+ /**
27
+ * Refilling cart after failed payment
28
+ *
29
+ * @param Mage_Sales_Model_Order $order
30
+ */
31
  public function refillCart($order)
32
  {
33
+ /* @var $cart Mage_Checkout_Model_Cart */
 
 
34
  $cart = Mage::getSingleton('checkout/cart');
35
  $items = $order->getItemsCollection();
36
+ /* @var $checkoutSession Mage_Checkout_Model_Session */
37
+ $checkoutSession = Mage::getSingleton('checkout/session');
38
+ /** @var $item Mage_Sales_Model_Order_Item */
39
  foreach ($items as $item) {
40
  try {
41
  $cart->addOrderItem($item);
 
 
 
 
 
 
 
 
42
  } catch (Exception $e) {
43
+ $checkoutSession->addError(
44
+ Mage::helper('checkout')->__('Cannot add the item %s to shopping cart.', $item->getName())
 
 
45
  );
46
  }
47
  }
48
  $cart->save();
 
 
49
  }
50
 
51
+ /**
52
+ * Writes information to log file
53
+ *
54
+ * @param $message - string or array of strings
55
+ * @return bool
56
+ */
57
  public function log($message)
58
  {
59
  if ($this->isLogEnabled()) {
62
  Mage::dispatchEvent('robokassa_log_file_write_before', $message);
63
  $forLog = array();
64
  foreach ($message as $answerKey => $answerValue) {
65
+ $answer = is_array($answerValue) ? print_r($answerValue, true) : $answerValue;
66
+ $forLog[] = $answerKey . ": " . $answer;
67
  }
68
  $forLog[] = '***************************';
69
  $message = implode("\r\n", $forLog);
73
  return true;
74
  }
75
 
76
+ /**
77
+ * Convert array to string for logging
78
+ *
79
+ * @param $array
80
+ * @return string
81
+ */
82
  public function arrayToRawData($array)
83
  {
84
+ $newArray = array();
85
  foreach ($array as $key => $value) {
86
  $newArray[] = $key . ": " . $value;
87
  }
89
  return $raw;
90
  }
91
 
92
+ /**
93
+ * Is log writing enabled or not?
94
+ *
95
+ * @return bool
96
+ */
97
  public function isLogEnabled()
98
  {
99
+ // for new extensions use variable "log_enabled"
100
+ return (bool)Mage::getStoreConfig('payment/etrobokassa/enable_log');
101
  }
102
 
103
+ /**
104
+ * Function returns log file name
105
+ *
106
+ * @return string
107
+ */
108
  public function getLogFileName()
109
  {
110
+ return Mage::getStoreConfig('payment/etrobokassa/log_file');
111
  }
112
 
113
+
114
  }
app/code/community/ET/PaymentRobokassa/Model/Culture.php CHANGED
@@ -17,9 +17,15 @@
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
 
 
 
20
  class ET_PaymentRobokassa_Model_Culture extends Mage_Core_Model_Abstract
21
  {
22
 
 
 
 
23
  public function toOptionArray()
24
  {
25
  $data = array(
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ /**
21
+ * Class ET_PaymentRobokassa_Model_Culture
22
+ */
23
  class ET_PaymentRobokassa_Model_Culture extends Mage_Core_Model_Abstract
24
  {
25
 
26
+ /**
27
+ * @return array
28
+ */
29
  public function toOptionArray()
30
  {
31
  $data = array(
app/code/community/ET/PaymentRobokassa/Model/Hashtype.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * You may not sell, sub-license, rent or lease
6
+ * any portion of the Software or Documentation to anyone.
7
+ *
8
+ * DISCLAIMER
9
+ *
10
+ * Do not edit or add to this file if you wish to upgrade to newer
11
+ * versions in the future.
12
+ *
13
+ * @category ET
14
+ * @package ET_PaymentRobokassa
15
+ * @copyright Copyright (c) 2013 ET Web Solutions (http://etwebsolutions.com)
16
+ * @contacts support@etwebsolutions.com
17
+ * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
+ */
19
+
20
+ /**
21
+ * Class ET_PaymentRobokassa_Model_Hashtype
22
+ */
23
+ class ET_PaymentRobokassa_Model_Hashtype extends Mage_Core_Model_Abstract
24
+ {
25
+ /**
26
+ * @return array
27
+ */
28
+ public function toOptionArray()
29
+ {
30
+ /** @var $helper ET_PaymentRobokassa_Helper_Data */
31
+ $helper = Mage::helper('etpaymentrobokassa');
32
+ $data = array(
33
+ array('value' => "md5", 'label' => $helper->__('MD5')),
34
+ array('value' => "ripemd160", 'label' => $helper->__('RIPEMD160')),
35
+ array('value' => "sha1", 'label' => $helper->__('SHA1')),
36
+ array('value' => "sha256", 'label' => $helper->__('SHA256')),
37
+ array('value' => "sha384", 'label' => $helper->__('SHA384')),
38
+ array('value' => "sha512", 'label' => $helper->__('SHA512'))
39
+ );
40
+ return $data;
41
+ }
42
+
43
+ /**
44
+ * @return array
45
+ */
46
+ public function getValueArray()
47
+ {
48
+ $data = $this->toOptionArray();
49
+
50
+ $return = array();
51
+ foreach ($data as $value) {
52
+ array_push($return, $value['value']);
53
+ }
54
+ return $return;
55
+ }
56
+ }
app/code/community/ET/PaymentRobokassa/Model/Method/Etrobokassa.php CHANGED
@@ -17,6 +17,9 @@
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
 
 
 
20
  class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Method_Abstract
21
  {
22
 
@@ -29,25 +32,14 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
29
  * @var bool
30
  */
31
  protected $_isGateway = true;
32
- protected $_canOrder = false;
33
- protected $_canAuthorize = false;
34
  protected $_canCapture = true;
35
- protected $_canCapturePartial = false;
36
- protected $_canRefund = false;
37
- protected $_canRefundInvoicePartial = false;
38
- protected $_canVoid = false;
39
- protected $_canUseRobonal = false;
40
  protected $_canUseCheckout = true;
41
  protected $_canUseForMultishipping = false;
42
- protected $_isInitializeNeeded = false;
43
- protected $_canFetchTransactionInfo = false;
44
- protected $_canReviewPayment = false;
45
- protected $_canCreateBillingAgreement = false;
46
  protected $_canManageRecurringProfiles = false;
47
- protected $_canEdit = false;
48
 
49
  protected $_canUseInternal = false; // Payment method will not work in admin panel order
50
 
 
51
  /**
52
  * Payment Method instance configuration
53
  * @var bool
@@ -57,8 +49,7 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
57
  protected $_description;
58
  protected $_testMode;
59
 
60
- protected $_isLogenabled = 0;
61
-
62
 
63
  protected $_sMerchantLogin;
64
  protected $_sInvDesc;
@@ -67,27 +58,29 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
67
  protected $_sCulture;
68
  protected $_transferCurrency;
69
 
70
-
71
  protected $_sMerchantPassOne;
72
  protected $_sMerchantPassTwo;
73
 
74
  protected $_cartRefill;
75
 
76
- protected $_gateUrl = "https://merchant.roboxchange.com/Index.aspx";
77
- //protected $_testUrl="shell/rktest.php";
78
- protected $_testUrl = "http://test.robokassa.ru/Index.aspx";
79
-
80
-
81
  protected $_configRead = false;
82
 
83
-
 
 
84
  public function __construct()
85
  {
86
  parent::__construct();
87
  $this->readConfig();
88
  }
89
 
90
-
 
 
 
 
91
  protected function readConfig()
92
  {
93
  if ($this->_configRead) {
@@ -96,22 +89,29 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
96
  $this->_isActive = $this->getConfigData('active');
97
  $this->_title = $this->getConfigData('title');
98
  $this->_testMode = $this->getConfigDataRobo('test_mode');
99
-
100
  $this->_paymentText = $this->getConfigData('payment_text');
101
  $this->_description = Mage::helper('cms')->getBlockTemplateProcessor()->filter($this->_paymentText);
102
 
103
-
104
  $this->_sMerchantLogin = $this->getConfigDataRobo('sMerchantLogin');
105
 
106
  $this->_sInvDesc = $this->getConfigDataRobo('sInvDesc');
107
 
108
  $this->_sIncCurrLabel = $this->getConfigData('sIncCurrLabel');
109
- $this->_transferCurrency = Mage::app()->getBaseCurrencyCode();
110
 
111
  $this->_sCulture = $this->getConfigDataRobo('sCulture');
112
 
113
- $this->_sMerchantPassOne = Mage::helper('core')->decrypt($this->getConfigDataRobo('sMerchantPass1'));
114
- $this->_sMerchantPassTwo = Mage::helper('core')->decrypt($this->getConfigDataRobo('sMerchantPass2'));
 
 
 
 
 
 
 
 
115
 
116
  $this->_cartRefill = $this->getConfigDataRobo('cart_refill');
117
 
@@ -122,19 +122,33 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
122
 
123
  /**
124
  * To read common settings, like login and passwords.
125
- * all specific methot setting must be read with default function
126
  *
 
 
 
 
127
  */
128
- public function getConfigDataRobo($field, $storeId = null)
129
  {
130
  if (null === $storeId) {
131
- $storeId = $this->getStore();
132
  }
133
  $path = 'payment/etrobokassa/' . $field;
134
- return Mage::getStoreConfig($path, $storeId);
 
 
 
 
 
 
135
  }
136
 
137
-
 
 
 
 
138
  public function getDescription()
139
  {
140
  $this->readConfig();
@@ -142,16 +156,27 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
142
  }
143
 
144
 
 
 
 
 
145
  public function getOrderPlaceRedirectUrl()
146
  {
147
- return $this->getRedirectUrl();
148
  }
149
 
150
- public function getRedirectUrl()
 
 
 
 
 
151
  {
152
- return Mage::getUrl('etrobokassa/redirect');
 
153
  }
154
 
 
155
  /**
156
  * Check whether payment method can be used
157
  * @param Mage_Sales_Model_Quote
@@ -162,21 +187,12 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
162
  return parent::isAvailable($quote);
163
  }
164
 
165
- public function canUseForCurrency($currencyCode)
166
- {
167
- $baseCurrency = Mage::app()->getWebsite()->getBaseCurrency();
168
- $rate = $baseCurrency->getRate($this->_transferCurrency);
169
- $displayCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
170
- $reverseRate = $baseCurrency->getRate($displayCurrencyCode);
171
- if (!$rate || !$reverseRate) {
172
- Mage::helper("etpaymentrobokassa")->log('There is no rate for [' . $displayCurrencyCode . "/"
173
- . $this->_transferCurrency
174
- . '] to convert order amount. Payment method Robokassa not displayed.');
175
- return false;
176
- }
177
- return true;
178
- }
179
-
180
  public function canUseForCountry($country)
181
  {
182
  if (Mage::getStoreConfig('payment/etrobokassa/allowspecific') == 1) {
@@ -194,15 +210,22 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
194
  */
195
  public function preparePaymentData($order)
196
  {
 
197
  $this->readConfig();
 
 
 
 
 
 
198
 
199
- if (empty($this->_sMerchantLogin) || empty($this->_sMerchantPassOne) || empty($this->_sMerchantPassTwo)) {
200
- Mage::helper("etpaymentrobokassa")
201
- ->log('Please enter login information about your Robokassa merchant in admin panel!');
202
  }
203
 
204
- $hash = $this->generateHash($order, $writeLog = true);
205
  $outSum = $this->getOutSum($order);
 
206
  $postData = array(
207
  "MrchLogin" => $this->_sMerchantLogin,
208
  "OutSum" => round($outSum, 2),
@@ -212,31 +235,41 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
212
  "SignatureValue" => $hash,
213
  "IncCurrLabel" => $this->_sIncCurrLabel,
214
  "Email" => $order->getCustomerEmail(),
215
- "Culture" => $this->_sCulture
 
216
  );
217
  $result = array(
218
  'postData' => new Varien_Object($postData),
219
  'order' => $order,
220
  );
 
221
  Mage::dispatchEvent('robokassa_prepare_payment_data', $result);
222
  $postData = $result['postData']->getData();
223
  return $postData;
224
  }
225
 
 
 
 
 
 
 
226
  public function checkAnswerData($answer)
227
  {
228
  try {
229
  $errors = array();
230
  $this->readConfig();
231
  //$order = Mage::getModel("sales/order")->load($this->getOrderId($answer));
232
- $order = Mage::getModel("sales/order")->loadByIncrementId($this->getOrderId($answer));
 
 
233
  $hashArray = array(
234
  $answer["OutSum"],
235
  $answer["InvId"],
236
  $this->_sMerchantPassTwo
237
  );
238
 
239
- $hashCurrent = strtoupper(md5(implode(":", $hashArray)));
240
  $correctHash = (strcmp($hashCurrent, strtoupper($answer['SignatureValue'])) == 0);
241
 
242
  if (!$correctHash) {
@@ -271,44 +304,74 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
271
  }
272
  }
273
 
274
-
275
- public function getGateUrl()
 
 
 
276
  {
277
- $this->readConfig();
278
- if ($this->_testMode) {
279
- return $this->_testUrl;
280
- }
281
- return $this->_gateUrl;
282
  }
283
 
284
 
285
- public function getOrderId($answer)
 
 
 
 
 
 
 
 
 
 
286
  {
287
- return isset($answer["InvId"]) ? $answer["InvId"] : "";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  }
289
 
 
290
  /**
291
- * @param $order Mage_Sales_Model_Order
292
- * @param bool $writeLog
293
  *
 
294
  * @return string
295
  */
296
- public function generateHash($order, $writeLog = false)
297
  {
298
- $outSum = $this->getOutSum($order, $writeLog);
299
- $hashData = array(
300
- "MrchLogin" => $this->_sMerchantLogin,
301
- "OutSum" => round($outSum, 2),
302
- //"InvId" => $order->getId(),
303
- "InvId" => $order->getIncrementId(),
304
- "pass" => $this->_sMerchantPassOne,
305
- );
 
306
 
307
- $hash = strtoupper(md5(implode(":", $hashData)));
 
308
  return $hash;
309
  }
310
 
 
 
311
  /**
 
 
312
  * @param $order Mage_Sales_Model_Order
313
  * @param bool $writeLog
314
  *
@@ -316,18 +379,15 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
316
  */
317
  public function getOutSum($order, $writeLog = false)
318
  {
319
- if ($this->_transferCurrency != $order->getOrderCurrencyCode()) {
320
- $outSum = $order->getBaseCurrency()->convert($order->getBaseGrandTotal(), $this->_transferCurrency);
321
- if ($writeLog) {
322
- Mage::helper("etpaymentrobokassa")->log('Currency converted from [' .
323
- Mage::app()->getStore()->getCurrentCurrencyCode() . '] to [' .
324
- $this->_transferCurrency . '] ' . $order->getBaseGrandTotal() . ' ' . $outSum . '');
325
- }
326
- } else {
327
- $outSum = $order->getGrandTotal();
328
- }
329
 
330
- return $outSum;
 
 
 
 
 
331
  }
332
 
333
  }
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ /**
21
+ * Class ET_PaymentRobokassa_Model_Method_Etrobokassa
22
+ */
23
  class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Method_Abstract
24
  {
25
 
32
  * @var bool
33
  */
34
  protected $_isGateway = true;
 
 
35
  protected $_canCapture = true;
 
 
 
 
 
36
  protected $_canUseCheckout = true;
37
  protected $_canUseForMultishipping = false;
 
 
 
 
38
  protected $_canManageRecurringProfiles = false;
 
39
 
40
  protected $_canUseInternal = false; // Payment method will not work in admin panel order
41
 
42
+
43
  /**
44
  * Payment Method instance configuration
45
  * @var bool
49
  protected $_description;
50
  protected $_testMode;
51
 
52
+ protected $_hashType;
 
53
 
54
  protected $_sMerchantLogin;
55
  protected $_sInvDesc;
58
  protected $_sCulture;
59
  protected $_transferCurrency;
60
 
 
61
  protected $_sMerchantPassOne;
62
  protected $_sMerchantPassTwo;
63
 
64
  protected $_cartRefill;
65
 
66
+ protected $_url = "https://auth.robokassa.ru/Merchant/Index.aspx";
67
+ //protected $_url = "http://test.robokassa.ru/Index.aspx"; // old test url
 
 
 
68
  protected $_configRead = false;
69
 
70
+ /**
71
+ * Constructor
72
+ */
73
  public function __construct()
74
  {
75
  parent::__construct();
76
  $this->readConfig();
77
  }
78
 
79
+ /**
80
+ * Read extension configuration
81
+ *
82
+ * @throws Exception
83
+ */
84
  protected function readConfig()
85
  {
86
  if ($this->_configRead) {
89
  $this->_isActive = $this->getConfigData('active');
90
  $this->_title = $this->getConfigData('title');
91
  $this->_testMode = $this->getConfigDataRobo('test_mode');
92
+ $this->_hashType = $this->getConfigData('hash_type');
93
  $this->_paymentText = $this->getConfigData('payment_text');
94
  $this->_description = Mage::helper('cms')->getBlockTemplateProcessor()->filter($this->_paymentText);
95
 
 
96
  $this->_sMerchantLogin = $this->getConfigDataRobo('sMerchantLogin');
97
 
98
  $this->_sInvDesc = $this->getConfigDataRobo('sInvDesc');
99
 
100
  $this->_sIncCurrLabel = $this->getConfigData('sIncCurrLabel');
101
+ $this->_transferCurrency = Mage::app()->getWebsite()->getBaseCurrencyCode();
102
 
103
  $this->_sCulture = $this->getConfigDataRobo('sCulture');
104
 
105
+
106
+ $passwordFieldOne = 'sMerchantPass1';
107
+ $passwordFieldTwo = 'sMerchantPass2';
108
+ if ($this->_testMode) {
109
+ $passwordFieldOne = 'testModePass1';
110
+ $passwordFieldTwo = 'testModePass2';
111
+ }
112
+
113
+ $this->_sMerchantPassOne = $this->getConfigDataRobo($passwordFieldOne, null, true);
114
+ $this->_sMerchantPassTwo = $this->getConfigDataRobo($passwordFieldTwo, null, true);
115
 
116
  $this->_cartRefill = $this->getConfigDataRobo('cart_refill');
117
 
122
 
123
  /**
124
  * To read common settings, like login and passwords.
125
+ * all specific method setting must be read with default function
126
  *
127
+ * @param string $field
128
+ * @param int|null $storeId
129
+ * @param bool $decrypt - for passwords
130
+ * @return mixed|string
131
  */
132
+ public function getConfigDataRobo($field, $storeId = null, $decrypt = false)
133
  {
134
  if (null === $storeId) {
135
+ $storeId = $this->getData('store'); // we set store in ET_PaymentRobokassaAdvanced_Helper_Data
136
  }
137
  $path = 'payment/etrobokassa/' . $field;
138
+ $result = Mage::getStoreConfig($path, $storeId);
139
+ if ($decrypt) {
140
+ /* @var $coreHelper Mage_Core_Helper_Data */
141
+ $coreHelper = Mage::helper('core');
142
+ $result = $coreHelper->decrypt($result);
143
+ }
144
+ return $result;
145
  }
146
 
147
+ /**
148
+ * Payment method description from configuration
149
+ *
150
+ * @return string
151
+ */
152
  public function getDescription()
153
  {
154
  $this->readConfig();
156
  }
157
 
158
 
159
+ /**
160
+ * Redirect URL to robokassa controller after order place
161
+ * @return string
162
+ */
163
  public function getOrderPlaceRedirectUrl()
164
  {
165
+ return Mage::getUrl('etrobokassa/redirect');
166
  }
167
 
168
+ /**
169
+ * Payment system URL
170
+ *
171
+ * @return string
172
+ */
173
+ public function getGateUrl()
174
  {
175
+ $this->readConfig();
176
+ return $this->_url;
177
  }
178
 
179
+
180
  /**
181
  * Check whether payment method can be used
182
  * @param Mage_Sales_Model_Quote
187
  return parent::isAvailable($quote);
188
  }
189
 
190
+ /**
191
+ * To check billing country is allowed for the payment method
192
+ *
193
+ * @param $country
194
+ * @return bool
195
+ */
 
 
 
 
 
 
 
 
 
196
  public function canUseForCountry($country)
197
  {
198
  if (Mage::getStoreConfig('payment/etrobokassa/allowspecific') == 1) {
210
  */
211
  public function preparePaymentData($order)
212
  {
213
+
214
  $this->readConfig();
215
+ /** @var ET_PaymentRobokassa_Helper_Data $helper */
216
+ $helper = Mage::helper("etpaymentrobokassa");
217
+
218
+ if (empty($this->_sMerchantLogin)) {
219
+ $helper->log('Please enter login information about your Robokassa merchant in admin panel!');
220
+ }
221
 
222
+ if (empty($this->_sMerchantPassOne) || empty($this->_sMerchantPassTwo)) {
223
+ $helper->log('Please enter corrects passwords about your Robokassa merchant in admin panel!');
 
224
  }
225
 
226
+ $hash = $this->generateHash($order, true);
227
  $outSum = $this->getOutSum($order);
228
+
229
  $postData = array(
230
  "MrchLogin" => $this->_sMerchantLogin,
231
  "OutSum" => round($outSum, 2),
235
  "SignatureValue" => $hash,
236
  "IncCurrLabel" => $this->_sIncCurrLabel,
237
  "Email" => $order->getCustomerEmail(),
238
+ "Culture" => $this->_sCulture,
239
+ "IsTest" => $this->_testMode,
240
  );
241
  $result = array(
242
  'postData' => new Varien_Object($postData),
243
  'order' => $order,
244
  );
245
+
246
  Mage::dispatchEvent('robokassa_prepare_payment_data', $result);
247
  $postData = $result['postData']->getData();
248
  return $postData;
249
  }
250
 
251
+ /**
252
+ * Check answer from Robokassa
253
+ *
254
+ * @param array $answer
255
+ * @return array of errors or true
256
+ */
257
  public function checkAnswerData($answer)
258
  {
259
  try {
260
  $errors = array();
261
  $this->readConfig();
262
  //$order = Mage::getModel("sales/order")->load($this->getOrderId($answer));
263
+ /** @var $order Mage_Sales_Model_Order */
264
+ $order = Mage::getModel("sales/order");
265
+ $order->loadByIncrementId($this->getOrderId($answer));
266
  $hashArray = array(
267
  $answer["OutSum"],
268
  $answer["InvId"],
269
  $this->_sMerchantPassTwo
270
  );
271
 
272
+ $hashCurrent = $this->generateHash($hashArray);
273
  $correctHash = (strcmp($hashCurrent, strtoupper($answer['SignatureValue'])) == 0);
274
 
275
  if (!$correctHash) {
304
  }
305
  }
306
 
307
+ /**
308
+ * @param array $answer
309
+ * @return string
310
+ */
311
+ public function getOrderId($answer)
312
  {
313
+ return isset($answer["InvId"]) ? $answer["InvId"] : "";
 
 
 
 
314
  }
315
 
316
 
317
+
318
+ /**
319
+ * Generates Hash string using order data to prepare an array
320
+ * or direct from array
321
+ *
322
+ * @param $data Mage_Sales_Model_Order|array
323
+ * @param bool $writeLog
324
+ *
325
+ * @return string
326
+ */
327
+ public function generateHash($data, $writeLog = false)
328
  {
329
+ $hashData = array();
330
+ if ($data instanceof Mage_Sales_Model_Order) {
331
+ $outSum = $this->getOutSum($data, $writeLog);
332
+ $hashData = array(
333
+ "MrchLogin" => $this->_sMerchantLogin,
334
+ "OutSum" => round($outSum, 2),
335
+ "InvId" => $data->getIncrementId(),
336
+ "pass" => $this->_sMerchantPassOne,
337
+ );
338
+ } else if (is_array($data)) {
339
+ $hashData = $data;
340
+ }
341
+
342
+ $hash = $this->generateHashForArray($hashData);
343
+ return $hash;
344
  }
345
 
346
+
347
  /**
348
+ * Generate Hash string for array
 
349
  *
350
+ * @param array $hashData
351
  * @return string
352
  */
353
+ public function generateHashForArray($hashData)
354
  {
355
+ /** @var ET_PaymentRobokassa_Model_Hashtype $hashModel */
356
+ $hashModel = Mage::getModel('etpaymentrobokassa/hashtype');
357
+ $hashList = $hashModel->getValueArray();
358
+
359
+ if (!in_array($this->_hashType, $hashList)) {
360
+ /** @var ET_PaymentRobokassa_Helper_Data $helper */
361
+ $helper = Mage::helper("etpaymentrobokassa");
362
+ $helper->log($helper->__('Not supported hash type - %s.', $this->_hashType));
363
+ }
364
 
365
+ Mage::log($hashData);
366
+ $hash = strtoupper(hash($this->_hashType, implode(":", $hashData)));
367
  return $hash;
368
  }
369
 
370
+
371
+
372
  /**
373
+ * Get order amount in Base Currency
374
+ *
375
  * @param $order Mage_Sales_Model_Order
376
  * @param bool $writeLog
377
  *
379
  */
380
  public function getOutSum($order, $writeLog = false)
381
  {
382
+ $displayCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
383
+ $baseCurrencyCode = Mage::app()->getBaseCurrencyCode();
 
 
 
 
 
 
 
 
384
 
385
+ if ($writeLog && ($displayCurrencyCode != $baseCurrencyCode)) {
386
+ /** @var ET_PaymentRobokassa_Helper_Data $helper */
387
+ $helper = Mage::helper("etpaymentrobokassa");
388
+ $helper->log('Order amount will be transferred to service Robokassa in base currency.');
389
+ }
390
+ return $order->getBaseGrandTotal();
391
  }
392
 
393
  }
app/code/community/ET/PaymentRobokassa/Model/Paysystem.php CHANGED
@@ -17,6 +17,9 @@
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
 
 
 
20
  class ET_PaymentRobokassa_Model_Paysystem extends Mage_Core_Model_Abstract
21
  {
22
  /**
@@ -26,51 +29,48 @@ class ET_PaymentRobokassa_Model_Paysystem extends Mage_Core_Model_Abstract
26
  */
27
  public function toOptionArray()
28
  {
29
- /** @var $helper ET_PaymentRobokassa_Helper_Data*/
30
  $helper = Mage::helper('etpaymentrobokassa');
 
 
31
  $data = array(
32
  array('value' => "", 'label' => $helper->__('Any')),
33
- array('value' => "BANKOCEAN2R", 'label' => $helper->__("Интернет-Банк Океан")),
34
- array('value' => "OceanBankOceanR", 'label' => $helper->__("Интернет-Банк Океан (platezh.ru)")),
35
- array('value' => "Qiwi29OceanR", 'label' => $helper->__("Платежи через терминалы QIWI")),
36
- array('value' => "YandexMerchantR", 'label' => $helper->__("Яндекс.Деньги")),
37
  array('value' => "WMRM", 'label' => $helper->__("Webmoney WMR (Рубли)")),
38
  array('value' => "WMZM", 'label' => $helper->__("Webmoney WMZ (Доллары)")),
39
  array('value' => "WMEM", 'label' => $helper->__("Webmoney WME (Евро)")),
40
- array('value' => "WMUM", 'label' => $helper->__("Webmoney WMU (Украинские гривны)")),
41
- array('value' => "WMBM", 'label' => $helper->__("Webmoney WMB (Белорусские рубли)")),
42
- array('value' => "WMGM", 'label' => $helper->__("Webmoney WMG (Эквивалент золота)")),
43
- array('value' => "MoneyMailR", 'label' => $helper->__("Электронная платежная система MoneyMail")),
44
- array('value' => "RuPayR", 'label' => $helper->__("Платежный сервис RBK Money")),
45
- array('value' => "W1R", 'label' => $helper->__("Платежный сервис Единый кошелек")),
46
- array('value' => "EasyPayB", 'label' => $helper->__("Электронные деньги EasyPay")),
47
- array('value' => "LiqPayZ", 'label' => $helper->__("Электронные платежи LiqPay")),
48
- array('value' => "MailRuR", 'label' => $helper->__("Электронные платежи Деньги@Mail.Ru")),
49
- array('value' => "ZPaymentR", 'label' => $helper->__("Платежная система Z-Payment")),
50
- array('value' => "TeleMoneyR", 'label' => $helper->__("Платежный сервис TeleMoney")),
51
  array('value' => "AlfaBankOceanR", 'label' => $helper->__("Интернет-Банк Альфа-Банк")),
 
52
  array('value' => "PSKBR", 'label' => $helper->__("Интернет-Банк Промсвязьбанк")),
 
53
  array('value' => "HandyBankMerchantOceanR", 'label' => $helper->__("Система интернет-банкинга HandyBank")),
54
- array('value' => "BSSFederalBankForInnovationAndDevelopmentR",
55
- 'label' => $helper->__("Федеральный банк инноваций и развития (АК ФБ Инноваций и Развития (ЗАО))")),
56
- array('value' => "BSSMezhtopenergobankR", 'label' => $helper->__("Интернет-банк Межтопэнергобанк")),
 
 
 
 
 
 
 
 
 
 
 
57
  array('value' => "RapidaOceanSvyaznoyR", 'label' => $helper->__("Салоны сети Связной")),
58
  array('value' => "RapidaOceanEurosetR", 'label' => $helper->__("Салоны сети Евросеть")),
59
- array('value' => "TerminalsElecsnetOceanR", 'label' => $helper->__("Терминалы самообслуживания Элекснет")),
60
- array('value' => "TerminalsUnikassaR", 'label' => $helper->__("Платежные терминалы Кассира.нет")),
61
- array('value' => "TerminalsMElementR", 'label' => $helper->__("Платежные терминалы Мобил Элемент")),
62
- array('value' => "TerminalsAbsolutplatR", 'label' => $helper->__("Платежные терминалы Абсолют Плат")),
63
- array('value' => "TerminalsPinpayR", 'label' => $helper->__("Платежные терминалы Pinpay")),
64
- array('value' => "TerminalsMoneyMoneyR", 'label' => $helper->__("Платежные терминалы Money-Money")),
65
- array('value' => "TerminalsPkbR", 'label' => $helper->__("Банкоматы банка Петрокоммерц")),
66
- array('value' => "VTB24R", 'label' => $helper->__("Банк ВТБ24")),
67
- array('value' => "MtsR", 'label' => $helper->__("Мобильный оператор МТС")),
68
- array('value' => "MegafonR", 'label' => $helper->__("Мобильный оператор Мегафон")),
69
- array('value' => "BANKOCEANCHECKR", 'label' => $helper->__("Оплата с помощью Iphone")),
70
- array('value' => "IFreeR", 'label' => $helper->__("Оплата с помощью SMS(i-FREE)")),
71
- array('value' => "ContactR", 'label' => $helper->__("Платежная система Contact"))
72
  );
73
-
74
  return $data;
75
  }
76
  }
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ /**
21
+ * Class ET_PaymentRobokassa_Model_Paysystem
22
+ */
23
  class ET_PaymentRobokassa_Model_Paysystem extends Mage_Core_Model_Abstract
24
  {
25
  /**
29
  */
30
  public function toOptionArray()
31
  {
32
+ /** @var $helper ET_PaymentRobokassa_Helper_Data */
33
  $helper = Mage::helper('etpaymentrobokassa');
34
+ // phpcs think that Cyrillic symbols are to long
35
+ // @codingStandardsIgnoreStart
36
  $data = array(
37
  array('value' => "", 'label' => $helper->__('Any')),
38
+ array('value' => "Qiwi50OceanRM", 'label' => $helper->__("Платежные терминалы QIWI Кошелек")),
39
+ array('value' => "TerminalsElecsnetOceanR", 'label' => $helper->__("Терминалы самообслуживания Элекснет")),
40
+ array('value' => "YandexMerchantOceanR", 'label' => $helper->__("Яндекс.Деньги")),
 
41
  array('value' => "WMRM", 'label' => $helper->__("Webmoney WMR (Рубли)")),
42
  array('value' => "WMZM", 'label' => $helper->__("Webmoney WMZ (Доллары)")),
43
  array('value' => "WMEM", 'label' => $helper->__("Webmoney WME (Евро)")),
44
+ array('value' => "W1OceanR", 'label' => $helper->__("Платежный сервис Единый кошелек")),
45
+ array('value' => "ElecsnetWalletR", 'label' => $helper->__("Платежный сервис Элекснет Кошелек")),
46
+ array('value' => "W1UniMoneyOceanR", 'label' => $helper->__("RUR Единый кошелек")),
47
+ array('value' => "Qiwi50OceanRM", 'label' => $helper->__("Электронный QIWI Кошелек")),
48
+ array('value' => "BANKOCEAN2R", 'label' => $helper->__("Интернет-Банк Океан")),
49
+ array('value' => "SberBankR", 'label' => $helper->__("СберБанк")),
 
 
 
 
 
50
  array('value' => "AlfaBankOceanR", 'label' => $helper->__("Интернет-Банк Альфа-Банк")),
51
+ array('value' => "RussianStandardBankR", 'label' => $helper->__("Банк Русский Стандарт")),
52
  array('value' => "PSKBR", 'label' => $helper->__("Интернет-Банк Промсвязьбанк")),
53
+ array('value' => "OceanBankOceanR", 'label' => $helper->__("Интернет-Банк Океан (platezh.ru)")),
54
  array('value' => "HandyBankMerchantOceanR", 'label' => $helper->__("Система интернет-банкинга HandyBank")),
55
+ array('value' => "HandyBankBB", 'label' => $helper->__("Банк Богородский")),
56
+ array('value' => "HandyBankFB", 'label' => $helper->__("ФлексБанк")),
57
+ array('value' => "HandyBankFU", 'label' => $helper->__("ФьsючерБанк")),
58
+ array('value' => "HandyBankKB", 'label' => $helper->__("КранБанк")),
59
+ array('value' => "HandyBankKSB", 'label' => $helper->__("Костромаселькомбанк")),
60
+ array('value' => "HandyBankLOB", 'label' => $helper->__("Липецкий областной банк")),
61
+ array('value' => "HandyBankNSB", 'label' => $helper->__("Независимый строительный банк")),
62
+ array('value' => "HandyBankTB", 'label' => $helper->__("Русский Трастовый Банк")),
63
+ array('value' => "HandyBankVIB", 'label' => $helper->__("ВестИнтерБанк")),
64
+ array('value' => "MINBankR", 'label' => $helper->__("Московский Индустриальный Банк")),
65
+ array('value' => "BSSIntezaR", 'label' => $helper->__("Банк Интеза")),
66
+ array('value' => "FacturaR", 'label' => $helper->__("Платежный сервис Factura.ru")),
67
+ array('value' => "MobicomMtsR", 'label' => $helper->__("МТС")),
68
+ array('value' => "MobicomBeelineR", 'label' => $helper->__("Билайн")),
69
  array('value' => "RapidaOceanSvyaznoyR", 'label' => $helper->__("Салоны сети Связной")),
70
  array('value' => "RapidaOceanEurosetR", 'label' => $helper->__("Салоны сети Евросеть")),
71
+ array('value' => "BANKOCEAN2CHECKR", 'label' => $helper->__("Мобильная ROBOKASSA")),
 
 
 
 
 
 
 
 
 
 
 
 
72
  );
73
+ // @codingStandardsIgnoreEnd
74
  return $data;
75
  }
76
  }
app/code/community/ET/PaymentRobokassa/controllers/GateController.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * NOTICE OF LICENSE
5
  *
@@ -17,31 +16,28 @@
17
  * @contacts support@etwebsolutions.com
18
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
19
  */
 
 
 
 
20
  class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Action
21
  {
22
  const MODULENAME = "etpaymentrobokassa";
23
  const PAYMENTNAME = "etrobokassa";
24
 
25
  /**
26
- * Setting right header of response if session died
27
  *
 
28
  */
29
- protected function _expireAjax()
30
- {
31
- if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
32
- $this->getResponse()->setHeader('HTTP/1.1', '403 Session Expired');
33
- exit;
34
- }
35
- }
36
-
37
  public function redirectAction()
38
  {
39
  /** @var $helper ET_PaymentRobokassa_Helper_Data */
40
  $helper = Mage::helper("etpaymentrobokassa");
41
- $session = Mage::getSingleton('checkout/session');
 
42
  $state = Mage_Sales_Model_Order::STATE_NEW;
43
 
44
- //todo брать $status из настроек подмодулей
45
  $status = Mage::getStoreConfig('payment/etrobokassa/order_status');
46
  if (strlen($status) == 0) {
47
  //$status = 'pending';
@@ -49,12 +45,13 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
49
  }
50
 
51
  /* @var $order Mage_Sales_Model_Order */
52
- $lastOrderId = $session->getLastOrderId();
53
  if (empty($lastOrderId)) {
54
- $helper->log("Error. Redirect to robokassa failed. No data in session about order.");
55
- $this->getResponse()->setHeader('Content-type', 'text/html; charset=UTF8');
56
- $this->getResponse()->setBody(
57
- $this->getLayout()->createBlock('etpaymentrobokassa/error')->toHtml());
 
58
  return;
59
  }
60
  $order = Mage::getModel('sales/order')->load($lastOrderId);
@@ -63,7 +60,7 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
63
  $this->__('Customer redirected to payment Gateway Robokassa'),
64
  false);
65
  $order->save();
66
-
67
  $payment = $order->getPayment()->getMethodInstance();
68
  if (!$payment) {
69
  $payment = Mage::getSingleton("etpaymentrobokassa/method_etrobokassa");
@@ -79,6 +76,11 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
79
  );
80
  }
81
 
 
 
 
 
 
82
  public function statusAction()
83
  {
84
  /** @var $helper ET_PaymentRobokassa_Helper_Data */
@@ -86,6 +88,7 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
86
  $state = Mage_Sales_Model_Order::STATE_PROCESSING;
87
  $errorStatus = 'error_robokassa';
88
  $answer = $this->getRequest()->getParams();
 
89
  $payment = Mage::getSingleton(self::MODULENAME . "/method_" . self::PAYMENTNAME);
90
  if ($payment->getOrderId($answer)) {
91
  /* @var $order Mage_Sales_Model_Order */
@@ -93,8 +96,8 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
93
  $order = Mage::getModel('sales/order')->loadByIncrementId($payment->getOrderId($answer));
94
  //true un success, false on fail or array of text on error
95
 
 
96
  $orderPaymentMethod = $order->getPayment()->getMethodInstance();
97
-
98
  $checkedAnswer = $orderPaymentMethod->checkAnswerData($answer);
99
 
100
  if (is_array($checkedAnswer)) {
@@ -137,8 +140,17 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
137
  print 'OK' . $orderPaymentMethod->getOrderId($answer);
138
  } else {
139
  if ($order->getId()) {
140
- $order->addStatusToHistory($errorStatus, implode(" / ", $checkedAnswer), false);
 
141
  $order->save();
 
 
 
 
 
 
 
 
142
  }
143
  print "Error";
144
  }
@@ -154,11 +166,17 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
154
  }
155
  }
156
 
 
 
 
 
 
157
  public function failureAction()
158
  {
159
  /** @var $helper ET_PaymentRobokassa_Helper_Data */
160
  $helper = Mage::helper("etpaymentrobokassa");
161
 
 
162
  $payment = Mage::getSingleton(self::MODULENAME . "/method_" . self::PAYMENTNAME);
163
  $answer = $this->getRequest()->getParams();
164
 
@@ -187,8 +205,6 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
187
  );
188
  $order->save();
189
  $order->cancel()->save();
190
-
191
- $this->_redirect('checkout/onepage/failure');
192
  } else {
193
  $errorAnswer = 'Incorrect answer. No order number.';
194
  $helper->log($errorAnswer);
@@ -196,11 +212,16 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
196
  $answer = 'No answer data';
197
  }
198
  $helper->log($answer);
199
- print($errorAnswer);
200
- //$this->_redirect('/');
 
201
  }
 
202
  }
203
 
 
 
 
204
  public function successAction()
205
  {
206
  /** @var $session Mage_Checkout_Model_Session */
@@ -209,9 +230,11 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
209
  $answer = $this->getRequest()->getParams();
210
  Mage::dispatchEvent('robokassa_no_session_data_for_success', $answer);
211
  }
 
212
  $this->_redirect("checkout/onepage/success");
213
  }
214
 
 
215
  /**
216
  * Send new order email
217
  * @param $order Mage_Sales_Model_Order
1
  <?php
 
2
  /**
3
  * NOTICE OF LICENSE
4
  *
16
  * @contacts support@etwebsolutions.com
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
+
20
+ /**
21
+ * Class ET_PaymentRobokassa_GateController
22
+ */
23
  class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Action
24
  {
25
  const MODULENAME = "etpaymentrobokassa";
26
  const PAYMENTNAME = "etrobokassa";
27
 
28
  /**
29
+ * Redirect Action
30
  *
31
+ * @throws Exception
32
  */
 
 
 
 
 
 
 
 
33
  public function redirectAction()
34
  {
35
  /** @var $helper ET_PaymentRobokassa_Helper_Data */
36
  $helper = Mage::helper("etpaymentrobokassa");
37
+ /* @var $checkoutSession Mage_Checkout_Model_Session */
38
+ $checkoutSession = Mage::getSingleton('checkout/session');
39
  $state = Mage_Sales_Model_Order::STATE_NEW;
40
 
 
41
  $status = Mage::getStoreConfig('payment/etrobokassa/order_status');
42
  if (strlen($status) == 0) {
43
  //$status = 'pending';
45
  }
46
 
47
  /* @var $order Mage_Sales_Model_Order */
48
+ $lastOrderId = $checkoutSession->getLastOrderId();
49
  if (empty($lastOrderId)) {
50
+ $messageText = $helper->__('Error. Redirect to robokassa failed. No data in session about order.');
51
+ $helper->log($messageText);
52
+
53
+ Mage::getSingleton('core/session')->addError($messageText);
54
+ $this->_redirect('checkout/onepage/failure');
55
  return;
56
  }
57
  $order = Mage::getModel('sales/order')->load($lastOrderId);
60
  $this->__('Customer redirected to payment Gateway Robokassa'),
61
  false);
62
  $order->save();
63
+ /** @var ET_PaymentRobokassa_Model_Method_Etrobokassa $payment */
64
  $payment = $order->getPayment()->getMethodInstance();
65
  if (!$payment) {
66
  $payment = Mage::getSingleton("etpaymentrobokassa/method_etrobokassa");
76
  );
77
  }
78
 
79
+ /**
80
+ * Status Action
81
+ *
82
+ * @throws Exception
83
+ */
84
  public function statusAction()
85
  {
86
  /** @var $helper ET_PaymentRobokassa_Helper_Data */
88
  $state = Mage_Sales_Model_Order::STATE_PROCESSING;
89
  $errorStatus = 'error_robokassa';
90
  $answer = $this->getRequest()->getParams();
91
+ /** @var ET_PaymentRobokassa_Model_Method_Etrobokassa $payment */
92
  $payment = Mage::getSingleton(self::MODULENAME . "/method_" . self::PAYMENTNAME);
93
  if ($payment->getOrderId($answer)) {
94
  /* @var $order Mage_Sales_Model_Order */
96
  $order = Mage::getModel('sales/order')->loadByIncrementId($payment->getOrderId($answer));
97
  //true un success, false on fail or array of text on error
98
 
99
+ /** @var ET_PaymentRobokassa_Model_Method_Etrobokassa $orderPaymentMethod */
100
  $orderPaymentMethod = $order->getPayment()->getMethodInstance();
 
101
  $checkedAnswer = $orderPaymentMethod->checkAnswerData($answer);
102
 
103
  if (is_array($checkedAnswer)) {
140
  print 'OK' . $orderPaymentMethod->getOrderId($answer);
141
  } else {
142
  if ($order->getId()) {
143
+ $historyStatusText = implode(" / ", $checkedAnswer);
144
+ $order->addStatusToHistory($errorStatus, $historyStatusText, false);
145
  $order->save();
146
+ /* @var $quote Mage_Sales_Model_Quote */
147
+ $quote = Mage::getModel("sales/quote");
148
+ $quote->load($order->getQuoteId());
149
+ if ($quote->getId() > 0) {
150
+ /* @var $checkoutHelper Mage_Checkout_Helper_Data */
151
+ $checkoutHelper = Mage::helper('checkout');
152
+ $checkoutHelper->sendPaymentFailedEmail($quote, $historyStatusText);
153
+ }
154
  }
155
  print "Error";
156
  }
166
  }
167
  }
168
 
169
+ /**
170
+ * Failure action
171
+ *
172
+ * @throws Exception
173
+ */
174
  public function failureAction()
175
  {
176
  /** @var $helper ET_PaymentRobokassa_Helper_Data */
177
  $helper = Mage::helper("etpaymentrobokassa");
178
 
179
+ /** @var ET_PaymentRobokassa_Model_Method_Etrobokassa $payment */
180
  $payment = Mage::getSingleton(self::MODULENAME . "/method_" . self::PAYMENTNAME);
181
  $answer = $this->getRequest()->getParams();
182
 
205
  );
206
  $order->save();
207
  $order->cancel()->save();
 
 
208
  } else {
209
  $errorAnswer = 'Incorrect answer. No order number.';
210
  $helper->log($errorAnswer);
212
  $answer = 'No answer data';
213
  }
214
  $helper->log($answer);
215
+ /* @var $checkoutSession Mage_Checkout_Model_Session */
216
+ $checkoutSession = Mage::getSingleton('checkout/session');
217
+ $checkoutSession->addError($helper->__($errorAnswer));
218
  }
219
+ $this->_redirect('checkout/onepage/failure');
220
  }
221
 
222
+ /**
223
+ * Success action
224
+ */
225
  public function successAction()
226
  {
227
  /** @var $session Mage_Checkout_Model_Session */
230
  $answer = $this->getRequest()->getParams();
231
  Mage::dispatchEvent('robokassa_no_session_data_for_success', $answer);
232
  }
233
+
234
  $this->_redirect("checkout/onepage/success");
235
  }
236
 
237
+
238
  /**
239
  * Send new order email
240
  * @param $order Mage_Sales_Model_Order
app/code/community/ET/PaymentRobokassa/etc/config.xml CHANGED
@@ -22,7 +22,7 @@
22
  <modules>
23
  <ET_PaymentRobokassa>
24
  <name>ET Payment Robokassa</name>
25
- <version>1.0.10</version>
26
  <descr>
27
  <ru_RU><![CDATA[Платёжный модуль Robokassa. Позволяет использовать сервис приёма платежей Robokassa (robokassa.ru) на вашем Magento сайте.]]>
28
  </ru_RU>
@@ -193,6 +193,7 @@
193
  <order_status>waiting_robokassa</order_status>
194
  <test_mode>0</test_mode>
195
  <enable_log>1</enable_log>
 
196
  <sInvDesc>Покупка в интернет магазине</sInvDesc>
197
  <result_url>http://example.com/etrobokassa/status</result_url>
198
  <success_url>http://example.com/etrobokassa/success</success_url>
22
  <modules>
23
  <ET_PaymentRobokassa>
24
  <name>ET Payment Robokassa</name>
25
+ <version>1.1.0</version>
26
  <descr>
27
  <ru_RU><![CDATA[Платёжный модуль Robokassa. Позволяет использовать сервис приёма платежей Robokassa (robokassa.ru) на вашем Magento сайте.]]>
28
  </ru_RU>
193
  <order_status>waiting_robokassa</order_status>
194
  <test_mode>0</test_mode>
195
  <enable_log>1</enable_log>
196
+ <log_file>et_robokassa.log</log_file>
197
  <sInvDesc>Покупка в интернет магазине</sInvDesc>
198
  <result_url>http://example.com/etrobokassa/status</result_url>
199
  <success_url>http://example.com/etrobokassa/success</success_url>
app/code/community/ET/PaymentRobokassa/etc/system.xml CHANGED
@@ -135,6 +135,7 @@
135
  <show_in_default>1</show_in_default>
136
  <show_in_website>1</show_in_website>
137
  </heading_robokassa>
 
138
  <test_mode translate="label comment">
139
  <label>Test Mode</label>
140
  <comment><![CDATA[If Enabled - module will connect Robokassa test server for transactions. This server available only for new merchants (not activated).]]></comment>
@@ -145,6 +146,7 @@
145
  <show_in_website>1</show_in_website>
146
  <show_in_store>0</show_in_store>
147
  </test_mode>
 
148
  <enable_log translate="label comment">
149
  <label>Debug Mode</label>
150
  <comment><![CDATA[If Enabled - technical information records into a log file /var/log/et_robokassa.log]]></comment>
@@ -156,9 +158,20 @@
156
  <show_in_store>0</show_in_store>
157
  </enable_log>
158
 
 
 
 
 
 
 
 
 
 
 
 
159
  <sMerchantLogin translate="label comment">
160
- <label>Merchant Login</label>
161
- <comment><![CDATA[Merchant login of Robokassa merchant account]]></comment>
162
  <frontend_type>text</frontend_type>
163
  <sort_order>120</sort_order>
164
  <show_in_default>1</show_in_default>
@@ -173,6 +186,9 @@
173
  <sort_order>130</sort_order>
174
  <show_in_default>1</show_in_default>
175
  <show_in_website>1</show_in_website>
 
 
 
176
  </sMerchantPass1>
177
 
178
  <sMerchantPass2 translate="label comment">
@@ -183,8 +199,37 @@
183
  <sort_order>140</sort_order>
184
  <show_in_default>1</show_in_default>
185
  <show_in_website>1</show_in_website>
 
 
 
186
  </sMerchantPass2>
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  <sCulture translate="label comment">
189
  <label>Language</label>
190
  <comment><![CDATA[Language on Payment Robokassa website]]></comment>
@@ -208,7 +253,7 @@
208
 
209
  <sIncCurrLabel translate="label comment">
210
  <label>Payment System</label>
211
- <comment><![CDATA[Default payment system. Customer can choose other payment system on Robokassa website. If you do not know what to choose, keep the default value - Any.]]></comment>
212
  <frontend_type>select</frontend_type>
213
  <source_model>etpaymentrobokassa/paysystem</source_model>
214
  <sort_order>170</sort_order>
@@ -241,6 +286,7 @@
241
  <show_in_default>1</show_in_default>
242
  <show_in_website>1</show_in_website>
243
  </heading_restrictions>
 
244
  <allowspecific translate="label">
245
  <label>Payment from Applicable Countries</label>
246
  <frontend_type>allowspecific</frontend_type>
@@ -250,6 +296,7 @@
250
  <show_in_website>1</show_in_website>
251
  <show_in_store>0</show_in_store>
252
  </allowspecific>
 
253
  <specificcountry translate="label">
254
  <label>Payment from Specific Countries</label>
255
  <frontend_type>multiselect</frontend_type>
@@ -260,6 +307,7 @@
260
  <show_in_store>0</show_in_store>
261
  <!--depends><allowspecific>1</allowspecific></depends-->
262
  </specificcountry>
 
263
  <min_order_total translate="label">
264
  <label>Minimum Order Total</label>
265
  <frontend_type>text</frontend_type>
@@ -268,6 +316,7 @@
268
  <show_in_website>1</show_in_website>
269
  <show_in_store>0</show_in_store>
270
  </min_order_total>
 
271
  <max_order_total translate="label">
272
  <label>Maximum Order Total</label>
273
  <frontend_type>text</frontend_type>
@@ -309,8 +358,4 @@
309
  </groups>
310
  </payment>
311
  </sections>
312
- </config>
313
-
314
-
315
-
316
-
135
  <show_in_default>1</show_in_default>
136
  <show_in_website>1</show_in_website>
137
  </heading_robokassa>
138
+
139
  <test_mode translate="label comment">
140
  <label>Test Mode</label>
141
  <comment><![CDATA[If Enabled - module will connect Robokassa test server for transactions. This server available only for new merchants (not activated).]]></comment>
146
  <show_in_website>1</show_in_website>
147
  <show_in_store>0</show_in_store>
148
  </test_mode>
149
+
150
  <enable_log translate="label comment">
151
  <label>Debug Mode</label>
152
  <comment><![CDATA[If Enabled - technical information records into a log file /var/log/et_robokassa.log]]></comment>
158
  <show_in_store>0</show_in_store>
159
  </enable_log>
160
 
161
+ <hash_type translate="label comment">
162
+ <label>Hash calculation algorithm</label>
163
+ <comment><![CDATA[Choose hash calculation algorithm which send data to Robokassa. Make sure that your chosen algorithm is the same as the selected in Robokassa.]]></comment>
164
+ <frontend_type>select</frontend_type>
165
+ <source_model>etpaymentrobokassa/hashtype</source_model>
166
+ <sort_order>118</sort_order>
167
+ <show_in_default>1</show_in_default>
168
+ <show_in_website>1</show_in_website>
169
+ <show_in_store>1</show_in_store>
170
+ </hash_type>
171
+
172
  <sMerchantLogin translate="label comment">
173
+ <label>Shop identifier</label>
174
+ <comment><![CDATA[Shop identifier from technical preferences of Robokassa merchant account]]></comment>
175
  <frontend_type>text</frontend_type>
176
  <sort_order>120</sort_order>
177
  <show_in_default>1</show_in_default>
186
  <sort_order>130</sort_order>
187
  <show_in_default>1</show_in_default>
188
  <show_in_website>1</show_in_website>
189
+ <depends>
190
+ <test_mode>0</test_mode>
191
+ </depends>
192
  </sMerchantPass1>
193
 
194
  <sMerchantPass2 translate="label comment">
199
  <sort_order>140</sort_order>
200
  <show_in_default>1</show_in_default>
201
  <show_in_website>1</show_in_website>
202
+ <depends>
203
+ <test_mode>0</test_mode>
204
+ </depends>
205
  </sMerchantPass2>
206
 
207
+ <testModePass1 translate="label comment">
208
+ <label>Test mode Pass #1</label>
209
+ <comment><![CDATA[Test mode password #1 in administration section of Robokassa merchant account]]></comment>
210
+ <frontend_type>obscure</frontend_type>
211
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
212
+ <sort_order>131</sort_order>
213
+ <show_in_default>1</show_in_default>
214
+ <show_in_website>1</show_in_website>
215
+ <depends>
216
+ <test_mode>1</test_mode>
217
+ </depends>
218
+ </testModePass1>
219
+
220
+ <testModePass2 translate="label comment">
221
+ <label>Test mode Pass #2</label>
222
+ <comment><![CDATA[Test mode password #2 in administration section of Robokassa merchant account]]></comment>
223
+ <frontend_type>obscure</frontend_type>
224
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
225
+ <sort_order>141</sort_order>
226
+ <show_in_default>1</show_in_default>
227
+ <show_in_website>1</show_in_website>
228
+ <depends>
229
+ <test_mode>1</test_mode>
230
+ </depends>
231
+ </testModePass2>
232
+
233
  <sCulture translate="label comment">
234
  <label>Language</label>
235
  <comment><![CDATA[Language on Payment Robokassa website]]></comment>
253
 
254
  <sIncCurrLabel translate="label comment">
255
  <label>Payment System</label>
256
+ <comment><![CDATA[Default payment system. Customer can choose other payment system on Robokassa website. Ensure that your chosen option is available under a contract with Robokassa. If you do not know what to choose, keep the default value - Any.]]></comment>
257
  <frontend_type>select</frontend_type>
258
  <source_model>etpaymentrobokassa/paysystem</source_model>
259
  <sort_order>170</sort_order>
286
  <show_in_default>1</show_in_default>
287
  <show_in_website>1</show_in_website>
288
  </heading_restrictions>
289
+
290
  <allowspecific translate="label">
291
  <label>Payment from Applicable Countries</label>
292
  <frontend_type>allowspecific</frontend_type>
296
  <show_in_website>1</show_in_website>
297
  <show_in_store>0</show_in_store>
298
  </allowspecific>
299
+
300
  <specificcountry translate="label">
301
  <label>Payment from Specific Countries</label>
302
  <frontend_type>multiselect</frontend_type>
307
  <show_in_store>0</show_in_store>
308
  <!--depends><allowspecific>1</allowspecific></depends-->
309
  </specificcountry>
310
+
311
  <min_order_total translate="label">
312
  <label>Minimum Order Total</label>
313
  <frontend_type>text</frontend_type>
316
  <show_in_website>1</show_in_website>
317
  <show_in_store>0</show_in_store>
318
  </min_order_total>
319
+
320
  <max_order_total translate="label">
321
  <label>Maximum Order Total</label>
322
  <frontend_type>text</frontend_type>
358
  </groups>
359
  </payment>
360
  </sections>
361
+ </config>
 
 
 
 
app/code/community/ET/PaymentRobokassa/sql/etpaymentrobokassa_setup/mysql4-install-1.0.0.php CHANGED
@@ -17,9 +17,9 @@
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
- $installstatus = version_compare(Mage::getVersion(), '1.4.2.0', '>');
21
 
22
- if ($installstatus) {
23
  /* @var $installer Mage_Sales_Model_Entity_Setup */
24
  $installer = $this;
25
 
17
  * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1)
18
  */
19
 
20
+ $installStatus = version_compare(Mage::getVersion(), '1.4.2.0', '>');
21
 
22
+ if ($installStatus) {
23
  /* @var $installer Mage_Sales_Model_Entity_Setup */
24
  $installer = $this;
25
 
app/locale/ru_RU/ET_PaymentRobokassa.csv CHANGED
@@ -26,14 +26,10 @@
26
  "Merchant Login","Логин продавца"
27
  "If Enabled - technical information records into a log file /var/log/et_robokassa.log","Если включён - ведётся запись технической информации в файл журнала /var/log/et_robokassa.log"
28
  "Merchant login of Robokassa merchant account","Логин продавца в Личный кабинет сервиса по приёму платежей Robokassa"
29
- "Merchant Pass #1","Пароль #1"
30
- "Merchant Pass #2","Пароль #2"
31
- "Password #1 in administration section of Robokassa merchant account","Пароль #1 в разделе администрирования в Личном кабинете продавца Робокассы"
32
- "Password #2 in administration section of Robokassa merchant account","Пароль #2 в разделе администрирования в Личном кабинете продавца Робокассы"
33
  "Language","Язык"
34
  "Language on Payment Robokassa website","Язык общения с клиентом на сайте платёжного сервиса Робокасса"
35
  "Payment System","Платёжная валюта"
36
- "Default payment system. Customer can choose other payment system on Robokassa website. If you do not know what to choose, keep the default value - Any.","Платёжная валюта по умолчанию. Клиент сможет выбрать другую на сайте Робокасса. Если не знаете что выбрать, оставьте значение по умолчанию - Любая."
37
  "Restrictions","Ограничения"
38
  "Payment from Applicable Countries","Оплата из доступных стран"
39
  "Payment from Specific Countries","Оплата из выбранных стран"
@@ -67,4 +63,16 @@
67
  "Documentation","Документация"
68
  "POST or GET data transfer method","Метод передачи данных POST или GET"
69
  "You have to set callback links for your shop in your account on Robokassa website to make extension work.","Для работы модуля необходимо настроить ссылки возврата на ваш магазин в личном кабинете сервиса Робокасса."
70
- "Callback URLs","Ссылки возврата"
 
 
 
 
 
 
 
 
 
 
 
 
26
  "Merchant Login","Логин продавца"
27
  "If Enabled - technical information records into a log file /var/log/et_robokassa.log","Если включён - ведётся запись технической информации в файл журнала /var/log/et_robokassa.log"
28
  "Merchant login of Robokassa merchant account","Логин продавца в Личный кабинет сервиса по приёму платежей Robokassa"
 
 
 
 
29
  "Language","Язык"
30
  "Language on Payment Robokassa website","Язык общения с клиентом на сайте платёжного сервиса Робокасса"
31
  "Payment System","Платёжная валюта"
32
+ "Default payment system. Customer can choose other payment system on Robokassa website. Ensure that your chosen option is available under a contract with Robokassa. If you do not know what to choose, keep the default value - Any.","Платёжная валюта по умолчанию. Клиент сможет выбрать другую на сайте Робокасса. Убедитесь, что выбранное вами значение доступно по договору с Робокассой. Если не знаете что выбрать, оставьте значение по умолчанию - Любая."
33
  "Restrictions","Ограничения"
34
  "Payment from Applicable Countries","Оплата из доступных стран"
35
  "Payment from Specific Countries","Оплата из выбранных стран"
63
  "Documentation","Документация"
64
  "POST or GET data transfer method","Метод передачи данных POST или GET"
65
  "You have to set callback links for your shop in your account on Robokassa website to make extension work.","Для работы модуля необходимо настроить ссылки возврата на ваш магазин в личном кабинете сервиса Робокасса."
66
+ "Callback URLs","Ссылки возврата"
67
+ "Hash calculation algorithm","Алгоритм расчета хеша"
68
+ "Choose which hash calculation algorithm to use to send the data to Robokassa. Make sure that your chosen algorithm is the same as the selected in Robokassa.","Выберите алгоритм расчета хеша, с помощью которого отправлять данные Робокассе. Убедитесь, что выбранный вами алгоритм совпадает с выбранным на Робокассе."
69
+ "Shop identifier","Идентификатор магазина"
70
+ "Shop identifier from technical preferences of Robokassa merchant account","Наименование магазина из технических настроек в личном кабинете сервиса по приёму платежей Robokassa"
71
+ "Merchant Pass #1","Пароль #1"
72
+ "Merchant Pass #2","Пароль #2"
73
+ "Test mode Pass #1","Пароль тестогово режима #1"
74
+ "Test mode Pass #2","Пароль тестогово режима #2"
75
+ "Password #1 in administration section of Robokassa merchant account","Пароль #1 из раздела администрирования в Личном кабинете продавца Робокассы"
76
+ "Password #2 in administration section of Robokassa merchant account","Пароль #2 из раздела администрирования в Личном кабинете продавца Робокассы"
77
+ "Test mode password #1 in administration section of Robokassa merchant account","Пароль тестового режима #1 из раздела администрирования в личном кабинете продавца Робокассы"
78
+ "Test mode password #2 in administration section of Robokassa merchant account","Пароль тестового режима #2 из раздела администрирования в личном кабинете продавца Робокассы"
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ET_PaymentRobokassa</name>
4
- <version>1.0.10</version>
5
  <stability>stable</stability>
6
  <license uri="http://shop.etwebsolutions.com/eng/etws-license-free-v1">ETWS Free License (EFL1)</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>_Free payment extension ET Payment Robokassa allows you to use payment gateway Robokassa (robokassa.ru) on your website._</description>
11
  <notes>stable release</notes>
12
  <authors><author><name>Jurij</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author><author><name>Andrej</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author></authors>
13
- <date>2015-08-03</date>
14
- <time>09:31:34</time>
15
- <contents><target name="magecommunity"><dir name="ET"><dir name="PaymentRobokassa"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="CallbackUrls.php" hash="6be5442c8ce4351462596606713ed92f"/><file name="Heading.php" hash="71c419849070047ca9f024b08ea2cd1e"/><file name="Linktoinfo.php" hash="c4dc4b21897d093dbd9736c3079ce03b"/><file name="Linktooptions.php" hash="687813f8551ed509486fc7da6dc60540"/></dir></dir></dir></dir><file name="Support.php" hash="1e98b88c9d5a482c9f698637f3db0c21"/></dir><dir name="Single"><file name="Form.php" hash="748fa65742a34d66a80209dad81f23ea"/><file name="Info.php" hash="6ca2b3f7f318164f520144419ac3720e"/></dir><file name="Error.php" hash="9915cfd47f14285dcacbfc5f82442e78"/><file name="Form.php" hash="3f3773311e029601aa6755fd2fc6a7f2"/><file name="Info.php" hash="3fc0ac20cd14002acdf8deff3359c68e"/><file name="Redirect.php" hash="45e05f5cc2869584eb90bd0a05e8fbc1"/></dir><dir name="Controller"><file name="Router.php" hash="8271139fa6af2cd57d6a5f45d767d4a1"/></dir><dir name="Helper"><file name="Data.php" hash="303e7391671a4b289e86d02f4b432063"/></dir><dir name="Model"><dir name="Method"><file name="Etrobokassa.php" hash="d33e1721a9bb54ea821574771dcc4543"/></dir><file name="Culture.php" hash="1f549bdc0bcb2dcf53b656bcf2bc4677"/><file name="Paysystem.php" hash="7c081594dc111b4698da9c55be70ecca"/></dir><dir name="controllers"><file name="GateController.php" hash="3c08792fd618b60d5c4aff0d9bd6bb5b"/></dir><dir name="etc"><file name="config.xml" hash="2bff920d346a47f282f42b6c4756e585"/><file name="system.xml" hash="0883de56d65e4732dfe588fda8378338"/></dir><dir name="sql"><dir name="etpaymentrobokassa_setup"><file name="mysql4-install-1.0.0.php" hash="550cabe108b7453b09d2de7e8720459d"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="ru_RU"><file name="ET_PaymentRobokassa.csv" hash="d01d3b5d7c66f80b02053293b3a06ce6"/></dir><dir name="en_US"><file name="ET_PaymentRobokassa.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="mageetc"><dir name="modules"><file name="ET_PaymentRobokassa.xml" hash="29a6a6d442729714e93aded22ce4b1b2"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="et_paymentrobokassa"><dir name="single"><file name="form.phtml" hash="ffdb96cd7677d5b256a49bb8fe5d9145"/><file name="info.phtml" hash="460b5111ae8b9d78e0a320c5878cc30d"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="et_paymentrobokassa"><dir name="single"><file name="form.phtml" hash="594645a04acfd21185ba89fbc3752f60"/><file name="info.phtml" hash="460b5111ae8b9d78e0a320c5878cc30d"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ET_PaymentRobokassa</name>
4
+ <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://shop.etwebsolutions.com/eng/etws-license-free-v1">ETWS Free License (EFL1)</license>
7
  <channel>community</channel>
10
  <description>_Free payment extension ET Payment Robokassa allows you to use payment gateway Robokassa (robokassa.ru) on your website._</description>
11
  <notes>stable release</notes>
12
  <authors><author><name>Jurij</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author><author><name>Andrej</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author></authors>
13
+ <date>2015-11-24</date>
14
+ <time>09:38:09</time>
15
+ <contents><target name="magecommunity"><dir name="ET"><dir name="PaymentRobokassa"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="CallbackUrls.php" hash="04e1786ab6d23e2de189271149538a19"/><file name="Heading.php" hash="ea2b78c217034671778d27101c0a7ffc"/><file name="Linktoinfo.php" hash="bc2a3f55b6d24bf43a41b7f73f060754"/><file name="Linktooptions.php" hash="3e1d44dc057eafac6f7f239261a18a77"/></dir></dir></dir></dir><file name="Support.php" hash="ffc0fd12e423db232cfb926cd1db57c6"/></dir><dir name="Single"><file name="Form.php" hash="a02546ee81500b243b38d68947b77066"/><file name="Info.php" hash="df188e5c31e6855cda3244c01b0857fb"/></dir><file name="Redirect.php" hash="7bc6ac869cae025ced8ae2d3ab6a582c"/></dir><dir name="Controller"><file name="Router.php" hash="d95d83041bccdfedb00ad6eeb2290406"/></dir><dir name="Helper"><file name="Data.php" hash="8508499b764dfb56d584d414b74705d8"/></dir><dir name="Model"><dir name="Method"><file name="Etrobokassa.php" hash="3a8fde56ad43a15e862ddae1afacf168"/></dir><file name="Culture.php" hash="6f6203f8af1071400e24753a7f1ec846"/><file name="Hashtype.php" hash="3a25df44c28f7985b635418bda183809"/><file name="Paysystem.php" hash="cd9e2921b59a78f3f9d1ec9df99e22db"/></dir><dir name="controllers"><file name="GateController.php" hash="bfbf04fa4d460263fa63c2850e447f85"/></dir><dir name="etc"><file name="config.xml" hash="2b34621c6dbd8adcb363f7a220947515"/><file name="system.xml" hash="91a946bade54b124f7f1226492729c5a"/></dir><dir name="sql"><dir name="etpaymentrobokassa_setup"><file name="mysql4-install-1.0.0.php" hash="827064e7fb32b4873a84fc3640790fdf"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="ru_RU"><file name="ET_PaymentRobokassa.csv" hash="b58e67df997c5f1d158ac65438833b58"/></dir><dir name="en_US"><file name="ET_PaymentRobokassa.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="mageetc"><dir name="modules"><file name="ET_PaymentRobokassa.xml" hash="29a6a6d442729714e93aded22ce4b1b2"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="et_paymentrobokassa"><dir name="single"><file name="form.phtml" hash="ffdb96cd7677d5b256a49bb8fe5d9145"/><file name="info.phtml" hash="460b5111ae8b9d78e0a320c5878cc30d"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="et_paymentrobokassa"><dir name="single"><file name="form.phtml" hash="594645a04acfd21185ba89fbc3752f60"/><file name="info.phtml" hash="460b5111ae8b9d78e0a320c5878cc30d"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>