Version Notes
stable release
Download this release
Release Info
Developer | Magento Core Team |
Extension | ET_PaymentRobokassa |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.3
- app/code/community/ET/PaymentRobokassa/Block/Adminhtml/Support.php +86 -20
- app/code/community/ET/PaymentRobokassa/Model/Method/Etrobokassa.php +6 -1
- app/code/community/ET/PaymentRobokassa/controllers/GateController.php +44 -27
- app/code/community/ET/PaymentRobokassa/etc/config.xml +1 -1
- app/locale/ru_RU/ET_PaymentRobokassa.csv +4 -2
- package.xml +4 -4
app/code/community/ET/PaymentRobokassa/Block/Adminhtml/Support.php
CHANGED
@@ -23,7 +23,7 @@ class ET_PaymentRobokassa_Block_Adminhtml_Support
|
|
23 |
{
|
24 |
/**
|
25 |
* Support tab
|
26 |
-
* version
|
27 |
*/
|
28 |
public function render(Varien_Data_Form_Element_Abstract $element)
|
29 |
{
|
@@ -35,15 +35,24 @@ class ET_PaymentRobokassa_Block_Adminhtml_Support
|
|
35 |
$moduleShortDescription = $this->_getConfigValue($moduleNameId, 'descr');
|
36 |
$moduleLicense = $this->_getConfigValue($moduleNameId, 'license');
|
37 |
|
38 |
-
$linkParameters = '
|
39 |
$moduleLicenseLink = $this->_getConfigValue($moduleNameId, 'licenselink') . $linkParameters;
|
40 |
$moduleSupportLink = $this->_getConfigValue($moduleNameId, 'redminelink') . $linkParameters;
|
41 |
$moduleLink = $this->_getConfigValue($moduleNameId, 'permanentlink') . $linkParameters;
|
42 |
$servicesLink = $this->_getConfigValue($moduleNameId, 'ourserviceslink') . $linkParameters;
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
$html =
|
45 |
'<style>
|
46 |
-
.line {border-top: 1px solid #c6c6c6; }
|
47 |
.developer-label {color: #000000; font-weight:bold; width: 150px;}
|
48 |
.developer-text { padding-bottom: 15px;}
|
49 |
.developer {width: 600px; }
|
@@ -54,46 +63,46 @@ class ET_PaymentRobokassa_Block_Adminhtml_Support
|
|
54 |
<tr>
|
55 |
<td class="developer-label">' . $helper->__('Extension:') . '</td>
|
56 |
<td class="developer-text">' . $helper->__(
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
</tr>
|
62 |
<tr>
|
63 |
<td class="developer-label">' . $helper->__('License:') . '</td>
|
64 |
<td class="developer-text">' . $helper->__(
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
</tr>
|
70 |
<tr>
|
71 |
<td class="developer-label">' . $helper->__('Short Description:') . '</td>
|
72 |
-
<td class="developer-text">'
|
73 |
</tr>
|
74 |
<tr>
|
75 |
<td class="developer-label">' . $helper->__('Documentation:') . '</td>
|
76 |
<td class="developer-text">' . $helper->__(
|
77 |
-
|
78 |
-
'frequently asked questions on <a href="%s" target="
|
79 |
-
|
80 |
</tr>
|
81 |
<tr>
|
82 |
<td class="developer-label line">' . $helper->__('Support:') . '</td>
|
83 |
<td class="developer-text line">' . $helper->__(
|
84 |
-
|
85 |
'</a>.<br>You can see information freely, but you will have to sign up to open a ticket.<br>' .
|
86 |
'<br>Please, report all bugs and feature requests that are related to this extension.<br>' .
|
87 |
'<br>If by some reason you can not submit a question, bug report or feature request to our ' .
|
88 |
'ticket system, you can write us an email - support@etwebsolutions.com.',
|
89 |
-
|
90 |
</tr>
|
91 |
<tr>
|
92 |
-
<td class="developer-label line"
|
93 |
<td class="developer-text line">' . $helper->__(
|
94 |
-
|
95 |
'<br>You can see a list of provided services on <a href="%s" target="_blank">our website</a>.',
|
96 |
-
|
97 |
</tr>
|
98 |
</table>';
|
99 |
|
@@ -119,4 +128,61 @@ class ET_PaymentRobokassa_Block_Adminhtml_Support
|
|
119 |
}
|
120 |
}
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
}
|
23 |
{
|
24 |
/**
|
25 |
* Support tab
|
26 |
+
* version 2.0.0
|
27 |
*/
|
28 |
public function render(Varien_Data_Form_Element_Abstract $element)
|
29 |
{
|
35 |
$moduleShortDescription = $this->_getConfigValue($moduleNameId, 'descr');
|
36 |
$moduleLicense = $this->_getConfigValue($moduleNameId, 'license');
|
37 |
|
38 |
+
$linkParameters = '';
|
39 |
$moduleLicenseLink = $this->_getConfigValue($moduleNameId, 'licenselink') . $linkParameters;
|
40 |
$moduleSupportLink = $this->_getConfigValue($moduleNameId, 'redminelink') . $linkParameters;
|
41 |
$moduleLink = $this->_getConfigValue($moduleNameId, 'permanentlink') . $linkParameters;
|
42 |
$servicesLink = $this->_getConfigValue($moduleNameId, 'ourserviceslink') . $linkParameters;
|
43 |
|
44 |
+
$magentoVersion = Mage::getVersion();
|
45 |
+
$magentoPlatform = $this->_getPlatform();
|
46 |
+
$logoLink = 'https://shop.etwebsolutions.com/logotypes/' .
|
47 |
+
$magentoPlatform . '/' .
|
48 |
+
$magentoVersion . '/' .
|
49 |
+
$moduleNameId . '/' .
|
50 |
+
$moduleVersion . '/' .
|
51 |
+
'logo.png';
|
52 |
+
|
53 |
$html =
|
54 |
'<style>
|
55 |
+
.line {border-top: 1px solid #c6c6c6; padding-top: 10px;}
|
56 |
.developer-label {color: #000000; font-weight:bold; width: 150px;}
|
57 |
.developer-text { padding-bottom: 15px;}
|
58 |
.developer {width: 600px; }
|
63 |
<tr>
|
64 |
<td class="developer-label">' . $helper->__('Extension:') . '</td>
|
65 |
<td class="developer-text">' . $helper->__(
|
66 |
+
'<strong>%s</strong> (version %s)',
|
67 |
+
$moduleName,
|
68 |
+
$moduleVersion
|
69 |
+
) . '</td>
|
70 |
</tr>
|
71 |
<tr>
|
72 |
<td class="developer-label">' . $helper->__('License:') . '</td>
|
73 |
<td class="developer-text">' . $helper->__(
|
74 |
+
'<a href="%s" target="_blank">%s</a>',
|
75 |
+
$moduleLicenseLink,
|
76 |
+
$moduleLicense
|
77 |
+
) . '</td>
|
78 |
</tr>
|
79 |
<tr>
|
80 |
<td class="developer-label">' . $helper->__('Short Description:') . '</td>
|
81 |
+
<td class="developer-text">' . $moduleShortDescription . '</td>
|
82 |
</tr>
|
83 |
<tr>
|
84 |
<td class="developer-label">' . $helper->__('Documentation:') . '</td>
|
85 |
<td class="developer-text">' . $helper->__(
|
86 |
+
'You can see description of extension features and answers to the ' .
|
87 |
+
'frequently asked questions on <a href="%s" target="_blank">our website</a>.',
|
88 |
+
$moduleLink) . '</td>
|
89 |
</tr>
|
90 |
<tr>
|
91 |
<td class="developer-label line">' . $helper->__('Support:') . '</td>
|
92 |
<td class="developer-text line">' . $helper->__(
|
93 |
+
'Extension support is available through <a href="%s" target="_blank">issue tracking system' .
|
94 |
'</a>.<br>You can see information freely, but you will have to sign up to open a ticket.<br>' .
|
95 |
'<br>Please, report all bugs and feature requests that are related to this extension.<br>' .
|
96 |
'<br>If by some reason you can not submit a question, bug report or feature request to our ' .
|
97 |
'ticket system, you can write us an email - support@etwebsolutions.com.',
|
98 |
+
$moduleSupportLink) . '</td>
|
99 |
</tr>
|
100 |
<tr>
|
101 |
+
<td class="developer-label line"><img src="' . $logoLink . '" width="100px" height="34px"> </td>
|
102 |
<td class="developer-text line">' . $helper->__(
|
103 |
+
'You can hire our team to customize the extension. E-mail us on sales@etwebsolutions.com.<br>' .
|
104 |
'<br>You can see a list of provided services on <a href="%s" target="_blank">our website</a>.',
|
105 |
+
$servicesLink) . '</td>
|
106 |
</tr>
|
107 |
</table>';
|
108 |
|
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
|
141 |
+
* @return string
|
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 |
}
|
app/code/community/ET/PaymentRobokassa/Model/Method/Etrobokassa.php
CHANGED
@@ -229,7 +229,6 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
|
|
229 |
$this->_sMerchantPassTwo
|
230 |
);
|
231 |
|
232 |
-
|
233 |
$hashCurrent = strtoupper(md5(implode(":", $hashArray)));
|
234 |
$correctHash = (strcmp($hashCurrent, strtoupper($answer['SignatureValue'])) == 0);
|
235 |
|
@@ -281,6 +280,9 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
|
|
281 |
return isset($answer["InvId"]) ? $answer["InvId"] : "";
|
282 |
}
|
283 |
|
|
|
|
|
|
|
284 |
public function generateHash($order, $writeLog = false)
|
285 |
{
|
286 |
if ($this->_transferCurrency != $order->getOrderCurrencyCode()) {
|
@@ -305,6 +307,9 @@ class ET_PaymentRobokassa_Model_Method_Etrobokassa extends Mage_Payment_Model_Me
|
|
305 |
return $hash;
|
306 |
}
|
307 |
|
|
|
|
|
|
|
308 |
public function getOutSum($order)
|
309 |
{
|
310 |
$outSum = $order->getBaseCurrency()->convert($order->getBaseGrandTotal(), $this->_transferCurrency);
|
229 |
$this->_sMerchantPassTwo
|
230 |
);
|
231 |
|
|
|
232 |
$hashCurrent = strtoupper(md5(implode(":", $hashArray)));
|
233 |
$correctHash = (strcmp($hashCurrent, strtoupper($answer['SignatureValue'])) == 0);
|
234 |
|
280 |
return isset($answer["InvId"]) ? $answer["InvId"] : "";
|
281 |
}
|
282 |
|
283 |
+
/**
|
284 |
+
* @param $order Mage_Sales_Model_Order
|
285 |
+
*/
|
286 |
public function generateHash($order, $writeLog = false)
|
287 |
{
|
288 |
if ($this->_transferCurrency != $order->getOrderCurrencyCode()) {
|
307 |
return $hash;
|
308 |
}
|
309 |
|
310 |
+
/**
|
311 |
+
* @param $order Mage_Sales_Model_Order
|
312 |
+
*/
|
313 |
public function getOutSum($order)
|
314 |
{
|
315 |
$outSum = $order->getBaseCurrency()->convert($order->getBaseGrandTotal(), $this->_transferCurrency);
|
app/code/community/ET/PaymentRobokassa/controllers/GateController.php
CHANGED
@@ -36,6 +36,8 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
|
|
36 |
|
37 |
public function redirectAction()
|
38 |
{
|
|
|
|
|
39 |
$session = Mage::getSingleton('checkout/session');
|
40 |
$state = Mage_Sales_Model_Order::STATE_NEW;
|
41 |
$status = Mage::getStoreConfig('payment/etrobokassa/order_status');
|
@@ -43,7 +45,7 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
|
|
43 |
//$status = 'pending';
|
44 |
$status = Mage::getModel('sales/order')->getConfig()->getStateDefaultStatus($state);
|
45 |
}
|
46 |
-
|
47 |
$order = Mage::getModel('sales/order')->load($session->getLastOrderId());
|
48 |
$order->setState($state,
|
49 |
$status,
|
@@ -58,7 +60,7 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
|
|
58 |
|
59 |
$dataForSending = $payment->preparePaymentData($order);
|
60 |
$dataForSending = array_merge(array('Data transfer' => 'To Robokassa'), $dataForSending);
|
61 |
-
|
62 |
$this->getResponse()->setHeader('Content-type', 'text/html; charset=UTF8');
|
63 |
$this->getResponse()->setBody(
|
64 |
$this->getLayout()->createBlock('etpaymentrobokassa/redirect')->setGateUrl(
|
@@ -68,19 +70,21 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
|
|
68 |
|
69 |
public function statusAction()
|
70 |
{
|
|
|
|
|
71 |
$state = Mage_Sales_Model_Order::STATE_PROCESSING;
|
72 |
$paidStatus = 'paid_robokassa';
|
73 |
$errorStatus = 'error_robokassa';
|
74 |
$answer = $this->getRequest()->getParams();
|
75 |
$payment = Mage::getSingleton(self::MODULENAME . "/method_" . self::PAYMENTNAME);
|
76 |
if ($payment->getOrderId($answer)) {
|
77 |
-
/* @var $order Mage_Sales_Model_Order*/
|
78 |
$order = Mage::getModel('sales/order')->load($payment->getOrderId($answer));
|
79 |
|
80 |
//true un success, false on fail or array of text on error
|
81 |
$checkedAnswer = $payment->checkAnswerData($answer);
|
82 |
if (is_array($checkedAnswer)) {
|
83 |
-
$answer['Errors'] =
|
84 |
}
|
85 |
$result = array(
|
86 |
'answer' => new Varien_Object($answer),
|
@@ -90,7 +94,7 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
|
|
90 |
$answer = $result['answer']->getData();
|
91 |
$answer = array_merge(array('Data transfer' => 'From Robokassa'), $answer);
|
92 |
|
93 |
-
|
94 |
|
95 |
if ($checkedAnswer === true) {
|
96 |
Mage::dispatchEvent('robokassa_success_answer_without_error', $result);
|
@@ -100,14 +104,11 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
|
|
100 |
$invoice->register()->capture();
|
101 |
$order->addRelatedObject($invoice);
|
102 |
}
|
|
|
103 |
$order->setState($state,
|
104 |
$paidStatus,
|
105 |
-
$this->__(
|
106 |
-
|
107 |
-
'The amount has been authorized and captured by Robokassa.')
|
108 |
-
),
|
109 |
-
false);
|
110 |
-
$this->_sendEmailAfterPaymentSuccess($order);
|
111 |
$order->save();
|
112 |
}
|
113 |
print 'OK' . $payment->getOrderId($answer);
|
@@ -119,20 +120,27 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
|
|
119 |
print "Error";
|
120 |
}
|
121 |
} else {
|
122 |
-
|
123 |
-
|
124 |
-
)
|
125 |
-
|
|
|
|
|
|
|
|
|
126 |
}
|
127 |
}
|
128 |
|
129 |
public function failureAction()
|
130 |
{
|
|
|
|
|
131 |
|
132 |
$payment = Mage::getSingleton(self::MODULENAME . "/method_" . self::PAYMENTNAME);
|
133 |
$answer = $this->getRequest()->getParams();
|
134 |
|
135 |
if ($payment->getOrderId($answer)) {
|
|
|
136 |
$order = Mage::getModel('sales/order')->load($payment->getOrderId($answer));
|
137 |
$result = new Varien_Object(array(
|
138 |
'answer' => $answer,
|
@@ -141,14 +149,14 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
|
|
141 |
Mage::dispatchEvent('robokassa_failure_answer', $result);
|
142 |
$answer = $result->getData('answer');
|
143 |
$answer = array_merge(array('Data transfer' => 'From Robokassa'), $answer);
|
144 |
-
|
145 |
if (Mage::getStoreConfig('payment/' . self::PAYMENTNAME . '/cart_refill')) {
|
146 |
-
|
147 |
}
|
148 |
|
149 |
$order->addStatusToHistory(
|
150 |
$order->getStatus(),
|
151 |
-
|
152 |
false
|
153 |
);
|
154 |
$order->save();
|
@@ -156,17 +164,22 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
|
|
156 |
|
157 |
$this->_redirect('checkout/onepage/failure');
|
158 |
} else {
|
159 |
-
|
160 |
-
|
161 |
-
)
|
162 |
-
|
|
|
|
|
|
|
|
|
163 |
}
|
164 |
}
|
165 |
|
166 |
public function successAction()
|
167 |
{
|
|
|
168 |
$session = Mage::getSingleton('checkout/session');
|
169 |
-
if(!$session->getLastOrderId() || !$session->getLastQuoteId() || !$session->getLastSuccessQuoteId()){
|
170 |
$answer = $this->getRequest()->getParams();
|
171 |
Mage::dispatchEvent('robokassa_no_session_data_for_success', $answer);
|
172 |
}
|
@@ -176,12 +189,16 @@ class ET_PaymentRobokassa_GateController extends Mage_Core_Controller_Front_Acti
|
|
176 |
/**
|
177 |
* Send new order email
|
178 |
* @param $order Mage_Sales_Model_Order
|
|
|
179 |
*/
|
180 |
protected function _sendEmailAfterPaymentSuccess($order)
|
181 |
{
|
182 |
-
$order->sendNewOrderEmail()
|
183 |
-
|
184 |
-
|
|
|
|
|
|
|
|
|
185 |
}
|
186 |
-
|
187 |
}
|
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 |
$status = Mage::getStoreConfig('payment/etrobokassa/order_status');
|
45 |
//$status = 'pending';
|
46 |
$status = Mage::getModel('sales/order')->getConfig()->getStateDefaultStatus($state);
|
47 |
}
|
48 |
+
/* @var $order Mage_Sales_Model_Order */
|
49 |
$order = Mage::getModel('sales/order')->load($session->getLastOrderId());
|
50 |
$order->setState($state,
|
51 |
$status,
|
60 |
|
61 |
$dataForSending = $payment->preparePaymentData($order);
|
62 |
$dataForSending = array_merge(array('Data transfer' => 'To Robokassa'), $dataForSending);
|
63 |
+
$helper->log($dataForSending);
|
64 |
$this->getResponse()->setHeader('Content-type', 'text/html; charset=UTF8');
|
65 |
$this->getResponse()->setBody(
|
66 |
$this->getLayout()->createBlock('etpaymentrobokassa/redirect')->setGateUrl(
|
70 |
|
71 |
public function statusAction()
|
72 |
{
|
73 |
+
/** @var $helper ET_PaymentRobokassa_Helper_Data */
|
74 |
+
$helper = Mage::helper("etpaymentrobokassa");
|
75 |
$state = Mage_Sales_Model_Order::STATE_PROCESSING;
|
76 |
$paidStatus = 'paid_robokassa';
|
77 |
$errorStatus = 'error_robokassa';
|
78 |
$answer = $this->getRequest()->getParams();
|
79 |
$payment = Mage::getSingleton(self::MODULENAME . "/method_" . self::PAYMENTNAME);
|
80 |
if ($payment->getOrderId($answer)) {
|
81 |
+
/* @var $order Mage_Sales_Model_Order */
|
82 |
$order = Mage::getModel('sales/order')->load($payment->getOrderId($answer));
|
83 |
|
84 |
//true un success, false on fail or array of text on error
|
85 |
$checkedAnswer = $payment->checkAnswerData($answer);
|
86 |
if (is_array($checkedAnswer)) {
|
87 |
+
$answer['Errors'] = $helper->arrayToRawData($checkedAnswer);
|
88 |
}
|
89 |
$result = array(
|
90 |
'answer' => new Varien_Object($answer),
|
94 |
$answer = $result['answer']->getData();
|
95 |
$answer = array_merge(array('Data transfer' => 'From Robokassa'), $answer);
|
96 |
|
97 |
+
$helper->log($answer);
|
98 |
|
99 |
if ($checkedAnswer === true) {
|
100 |
Mage::dispatchEvent('robokassa_success_answer_without_error', $result);
|
104 |
$invoice->register()->capture();
|
105 |
$order->addRelatedObject($invoice);
|
106 |
}
|
107 |
+
$result = $this->_sendEmailAfterPaymentSuccess($order);
|
108 |
$order->setState($state,
|
109 |
$paidStatus,
|
110 |
+
$this->__($helper->__('The amount has been authorized and captured by Robokassa.')),
|
111 |
+
$result);
|
|
|
|
|
|
|
|
|
112 |
$order->save();
|
113 |
}
|
114 |
print 'OK' . $payment->getOrderId($answer);
|
120 |
print "Error";
|
121 |
}
|
122 |
} else {
|
123 |
+
$errorAnswer = 'Incorrect answer. No order number.';
|
124 |
+
$helper->log($errorAnswer);
|
125 |
+
if (!$answer) {
|
126 |
+
$answer = 'No answer data';
|
127 |
+
}
|
128 |
+
$helper->log($answer);
|
129 |
+
print($errorAnswer);
|
130 |
+
//$this->_redirect('/');
|
131 |
}
|
132 |
}
|
133 |
|
134 |
public function failureAction()
|
135 |
{
|
136 |
+
/** @var $helper ET_PaymentRobokassa_Helper_Data */
|
137 |
+
$helper = Mage::helper("etpaymentrobokassa");
|
138 |
|
139 |
$payment = Mage::getSingleton(self::MODULENAME . "/method_" . self::PAYMENTNAME);
|
140 |
$answer = $this->getRequest()->getParams();
|
141 |
|
142 |
if ($payment->getOrderId($answer)) {
|
143 |
+
/** @var $order Mage_Sales_Model_Order */
|
144 |
$order = Mage::getModel('sales/order')->load($payment->getOrderId($answer));
|
145 |
$result = new Varien_Object(array(
|
146 |
'answer' => $answer,
|
149 |
Mage::dispatchEvent('robokassa_failure_answer', $result);
|
150 |
$answer = $result->getData('answer');
|
151 |
$answer = array_merge(array('Data transfer' => 'From Robokassa'), $answer);
|
152 |
+
$helper->log($answer);
|
153 |
if (Mage::getStoreConfig('payment/' . self::PAYMENTNAME . '/cart_refill')) {
|
154 |
+
$helper->refillCart($order);
|
155 |
}
|
156 |
|
157 |
$order->addStatusToHistory(
|
158 |
$order->getStatus(),
|
159 |
+
$helper->__('Payment failed'),
|
160 |
false
|
161 |
);
|
162 |
$order->save();
|
164 |
|
165 |
$this->_redirect('checkout/onepage/failure');
|
166 |
} else {
|
167 |
+
$errorAnswer = 'Incorrect answer. No order number.';
|
168 |
+
$helper->log($errorAnswer);
|
169 |
+
if (!$answer) {
|
170 |
+
$answer = 'No answer data';
|
171 |
+
}
|
172 |
+
$helper->log($answer);
|
173 |
+
print($errorAnswer);
|
174 |
+
//$this->_redirect('/');
|
175 |
}
|
176 |
}
|
177 |
|
178 |
public function successAction()
|
179 |
{
|
180 |
+
/** @var $session Mage_Checkout_Model_Session */
|
181 |
$session = Mage::getSingleton('checkout/session');
|
182 |
+
if (!$session->getLastOrderId() || !$session->getLastQuoteId() || !$session->getLastSuccessQuoteId()) {
|
183 |
$answer = $this->getRequest()->getParams();
|
184 |
Mage::dispatchEvent('robokassa_no_session_data_for_success', $answer);
|
185 |
}
|
189 |
/**
|
190 |
* Send new order email
|
191 |
* @param $order Mage_Sales_Model_Order
|
192 |
+
* @return bool
|
193 |
*/
|
194 |
protected function _sendEmailAfterPaymentSuccess($order)
|
195 |
{
|
196 |
+
if ($order->sendNewOrderEmail()) {
|
197 |
+
$result = true;
|
198 |
+
$order->setEmailSent(true);
|
199 |
+
} else {
|
200 |
+
$result = false;
|
201 |
+
}
|
202 |
+
return $result;
|
203 |
}
|
|
|
204 |
}
|
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.
|
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.3</version>
|
26 |
<descr>
|
27 |
<ru_RU><![CDATA[Платёжный модуль Robokassa. Позволяет использовать сервис приёма платежей Robokassa (robokassa.ru) на вашем Magento сайте.]]>
|
28 |
</ru_RU>
|
app/locale/ru_RU/ET_PaymentRobokassa.csv
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
"You can hire our team to customize the extension. E-mail us on sales@etwebsolutions.com.<br><br>You can see a list of provided services on <a href=""%s"" target=""_blank"">our website</a>.","Вы можете нанять нашу команду для любых работ по модификации модуля. Пишите на адрес sales@etwebsolutions.com.<br><br>Со списком предоставляемых нами услуг вы можете ознакомиться <a href=""%s"" target=""_blank"">на нашем сайте</a>."
|
10 |
"Extension support is available through <a href=""%s"" target=""_blank"">issue tracking system</a>.<br>You can see information freely, but you will have to sign up to open a ticket.<br><br>Please, report all bugs and feature requests that are related to this extension.<br><br>If by some reason you can not submit a question, bug report or feature request to our ticket system, you can write us an email - support@etwebsolutions.com.","Поддержка модуля осуществляется через <a href=""%s"" target=""_blank"">систему отслеживания заданий</a>.<br>Для создания задачи будет необходимо зарегистрироваться. Для просмотра информации регистрация не требуется.<br><br>Пожалуйста, сообщайте нам о найденных ошибках и о своих пожеланиях в рамках этого модуля.<br><br>Если по каким-либо причинам вы не можете размеситить вопрос/сообщение об ошибке/пожелание в списке задач, то можете написать нам по адресу support@etwebsolutions.com."
|
11 |
|
12 |
-
"Payment Robokassa information","Информация о
|
13 |
"Payment Robokassa Options","Настройки модуля Робокасса"
|
14 |
"Settings","Настройки"
|
15 |
"Go to Payment Methods settings section","Перейти к секции настроек Методов Оплаты"
|
@@ -19,7 +19,7 @@
|
|
19 |
"Title","Заголовок"
|
20 |
"Description","Описание"
|
21 |
"Sort order","Порядок сортировки"
|
22 |
-
"Robokassa Gateway options","Настройки соединения платёжным сервисом Робокасса"
|
23 |
"Test Mode","Тестовый режим"
|
24 |
"If Enabled - module will connect Robokassa test server for transactions. This server available only for new merchants (not activated).","Если включен - модуль будет подключаться к тестовому серверу Робокассы для транзакций. Данный сервер доступен для использования только для новых продавцов (непрошедших процедуру активации)."
|
25 |
"Debug Mode","Режим отладки"
|
@@ -60,3 +60,5 @@
|
|
60 |
"Order description on Payment Robokassa website","Описание заказа на сайте платёжного сервиса Робокасса"
|
61 |
|
62 |
"Order will receive this status right after creation. Status will be changed the moment payment is received.","Заказ получит данный статус, как только будет создан. После оплаты заказа статус изменится."
|
|
|
|
9 |
"You can hire our team to customize the extension. E-mail us on sales@etwebsolutions.com.<br><br>You can see a list of provided services on <a href=""%s"" target=""_blank"">our website</a>.","Вы можете нанять нашу команду для любых работ по модификации модуля. Пишите на адрес sales@etwebsolutions.com.<br><br>Со списком предоставляемых нами услуг вы можете ознакомиться <a href=""%s"" target=""_blank"">на нашем сайте</a>."
|
10 |
"Extension support is available through <a href=""%s"" target=""_blank"">issue tracking system</a>.<br>You can see information freely, but you will have to sign up to open a ticket.<br><br>Please, report all bugs and feature requests that are related to this extension.<br><br>If by some reason you can not submit a question, bug report or feature request to our ticket system, you can write us an email - support@etwebsolutions.com.","Поддержка модуля осуществляется через <a href=""%s"" target=""_blank"">систему отслеживания заданий</a>.<br>Для создания задачи будет необходимо зарегистрироваться. Для просмотра информации регистрация не требуется.<br><br>Пожалуйста, сообщайте нам о найденных ошибках и о своих пожеланиях в рамках этого модуля.<br><br>Если по каким-либо причинам вы не можете размеситить вопрос/сообщение об ошибке/пожелание в списке задач, то можете написать нам по адресу support@etwebsolutions.com."
|
11 |
|
12 |
+
"Payment Robokassa information","Информация о платёжном модуле Робокасса"
|
13 |
"Payment Robokassa Options","Настройки модуля Робокасса"
|
14 |
"Settings","Настройки"
|
15 |
"Go to Payment Methods settings section","Перейти к секции настроек Методов Оплаты"
|
19 |
"Title","Заголовок"
|
20 |
"Description","Описание"
|
21 |
"Sort order","Порядок сортировки"
|
22 |
+
"Robokassa Gateway options","Настройки соединения с платёжным сервисом Робокасса"
|
23 |
"Test Mode","Тестовый режим"
|
24 |
"If Enabled - module will connect Robokassa test server for transactions. This server available only for new merchants (not activated).","Если включен - модуль будет подключаться к тестовому серверу Робокассы для транзакций. Данный сервер доступен для использования только для новых продавцов (непрошедших процедуру активации)."
|
25 |
"Debug Mode","Режим отладки"
|
60 |
"Order description on Payment Robokassa website","Описание заказа на сайте платёжного сервиса Робокасса"
|
61 |
|
62 |
"Order will receive this status right after creation. Status will be changed the moment payment is received.","Заказ получит данный статус, как только будет создан. После оплаты заказа статус изменится."
|
63 |
+
"Incorrect answer. No order number.","Неправильный ответ. Нет номера заказа."
|
64 |
+
"No answer data.","Нет данных в ответе."
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ET_PaymentRobokassa</name>
|
4 |
-
<version>1.0.
|
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>2013-
|
14 |
-
<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="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="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ET_PaymentRobokassa</name>
|
4 |
+
<version>1.0.3</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>2013-11-26</date>
|
14 |
+
<time>14:15:19</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="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="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="a7cacaa3eb071b8a9f23d833c9894fda"/></dir><file name="Culture.php" hash="1f549bdc0bcb2dcf53b656bcf2bc4677"/><file name="Paysystem.php" hash="dbe855edb31265e13c389fc5d964fc62"/></dir><dir name="controllers"><file name="GateController.php" hash="885e80c9588e9dc802307819d8436012"/></dir><dir name="etc"><file name="config.xml" hash="f073750fb454c843b40bae704dec617f"/><file name="system.xml" hash="75d61cc3824fbc62e4d89c67b320d4fd"/></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="9df34388c47b662f17b5161e7c3fb242"/></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>
|