ET_PaymentRobokassa - Version 1.0.10

Version Notes

stable release

Download this release

Release Info

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


Code changes from version 1.0.7 to 1.0.10

app/code/community/ET/PaymentRobokassa/Block/Adminhtml/System/Config/Form/Field/CallbackUrls.php CHANGED
@@ -26,7 +26,7 @@ class ET_PaymentRobokassa_Block_Adminhtml_System_Config_Form_Field_CallbackUrls
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/result<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>',
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>',
app/code/community/ET/PaymentRobokassa/Helper/Data.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * NOTICE OF LICENSE
4
  *
@@ -16,7 +17,6 @@
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_Helper_Data extends Mage_Core_Helper_Abstract
21
  {
22
 
@@ -59,7 +59,7 @@ 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 . ": " . $answerValue;
63
  }
64
  $forLog[] = '***************************';
65
  $message = implode("\r\n", $forLog);
1
  <?php
2
+
3
  /**
4
  * NOTICE OF LICENSE
5
  *
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
 
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);
app/code/community/ET/PaymentRobokassa/controllers/GateController.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * NOTICE OF LICENSE
4
  *
@@ -16,7 +17,6 @@
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_GateController extends Mage_Core_Controller_Front_Action
21
  {
22
  const MODULENAME = "etpaymentrobokassa";
@@ -40,6 +40,8 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
40
  $helper = Mage::helper("etpaymentrobokassa");
41
  $session = Mage::getSingleton('checkout/session');
42
  $state = Mage_Sales_Model_Order::STATE_NEW;
 
 
43
  $status = Mage::getStoreConfig('payment/etrobokassa/order_status');
44
  if (strlen($status) == 0) {
45
  //$status = 'pending';
@@ -66,8 +68,8 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
66
  if (!$payment) {
67
  $payment = Mage::getSingleton("etpaymentrobokassa/method_etrobokassa");
68
  }
69
-
70
  $dataForSending = $payment->preparePaymentData($order);
 
71
  $dataForSending = array_merge(array('Data transfer' => 'To Robokassa'), $dataForSending);
72
  $helper->log($dataForSending);
73
  $this->getResponse()->setHeader('Content-type', 'text/html; charset=UTF8');
@@ -82,7 +84,6 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
82
  /** @var $helper ET_PaymentRobokassa_Helper_Data */
83
  $helper = Mage::helper("etpaymentrobokassa");
84
  $state = Mage_Sales_Model_Order::STATE_PROCESSING;
85
- $paidStatus = 'paid_robokassa';
86
  $errorStatus = 'error_robokassa';
87
  $answer = $this->getRequest()->getParams();
88
  $payment = Mage::getSingleton(self::MODULENAME . "/method_" . self::PAYMENTNAME);
@@ -92,7 +93,9 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
92
  $order = Mage::getModel('sales/order')->loadByIncrementId($payment->getOrderId($answer));
93
  //true un success, false on fail or array of text on error
94
 
95
- $checkedAnswer = $payment->checkAnswerData($answer);
 
 
96
 
97
  if (is_array($checkedAnswer)) {
98
  $answer['Errors'] = $helper->arrayToRawData($checkedAnswer);
@@ -111,18 +114,27 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
111
  Mage::dispatchEvent('robokassa_success_answer_without_error', $result);
112
  if ($order->getState() == Mage_Sales_Model_Order::STATE_NEW) {
113
  if ($order->canInvoice()) {
114
- $invoice = $order->prepareInvoice();
115
- $invoice->register()->capture();
 
 
 
 
 
116
  $order->addRelatedObject($invoice);
117
  }
 
 
 
118
  $result = $this->_sendEmailAfterPaymentSuccess($order);
 
119
  $order->setState($state,
120
  $paidStatus,
121
  $this->__($helper->__('The amount has been authorized and captured by Robokassa.')),
122
  $result);
123
  $order->save();
124
  }
125
- print 'OK' . $payment->getOrderId($answer);
126
  } else {
127
  if ($order->getId()) {
128
  $order->addStatusToHistory($errorStatus, implode(" / ", $checkedAnswer), false);
1
  <?php
2
+
3
  /**
4
  * NOTICE OF LICENSE
5
  *
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";
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';
68
  if (!$payment) {
69
  $payment = Mage::getSingleton("etpaymentrobokassa/method_etrobokassa");
70
  }
 
71
  $dataForSending = $payment->preparePaymentData($order);
72
+
73
  $dataForSending = array_merge(array('Data transfer' => 'To Robokassa'), $dataForSending);
74
  $helper->log($dataForSending);
75
  $this->getResponse()->setHeader('Content-type', 'text/html; charset=UTF8');
84
  /** @var $helper ET_PaymentRobokassa_Helper_Data */
85
  $helper = Mage::helper("etpaymentrobokassa");
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);
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)) {
101
  $answer['Errors'] = $helper->arrayToRawData($checkedAnswer);
114
  Mage::dispatchEvent('robokassa_success_answer_without_error', $result);
115
  if ($order->getState() == Mage_Sales_Model_Order::STATE_NEW) {
116
  if ($order->canInvoice()) {
117
+ //for partial invoice
118
+ if (!($qtys = $orderPaymentMethod->getInvoiceQtys($order))) {
119
+ $qtys = array();
120
+ }
121
+ $invoice = $order->prepareInvoice($qtys);
122
+ $invoice->register();
123
+ $invoice->capture();
124
  $order->addRelatedObject($invoice);
125
  }
126
+ if (!($paidStatus = $orderPaymentMethod->getPaidStatus())) {
127
+ $paidStatus = 'paid_robokassa';
128
+ }
129
  $result = $this->_sendEmailAfterPaymentSuccess($order);
130
+
131
  $order->setState($state,
132
  $paidStatus,
133
  $this->__($helper->__('The amount has been authorized and captured by Robokassa.')),
134
  $result);
135
  $order->save();
136
  }
137
+ print 'OK' . $orderPaymentMethod->getOrderId($answer);
138
  } else {
139
  if ($order->getId()) {
140
  $order->addStatusToHistory($errorStatus, implode(" / ", $checkedAnswer), false);
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.7</version>
26
  <descr>
27
  <ru_RU><![CDATA[Платёжный модуль Robokassa. Позволяет использовать сервис приёма платежей Robokassa (robokassa.ru) на вашем Magento сайте.]]>
28
  </ru_RU>
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>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ET_PaymentRobokassa</name>
4
- <version>1.0.7</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-03-27</date>
14
- <time>07:27:22</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="c34ef1dbae6dcfe7adaf4739a08136d6"/><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="8e427557290d5bee091f3a181af45a4e"/></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="c286db619b5238b935c5d9276c562646"/></dir><dir name="etc"><file name="config.xml" hash="ee6aacdbc01442e0bc91c1c8d635fb48"/><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.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
  <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>