Version Notes
1.0.0
Download this release
Release Info
Developer | Magento Core Team |
Extension | Mage_Ogone_Official |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- app/code/core/Mage/Ogone/Helper/Data.php +7 -6
- app/code/core/Mage/Ogone/Model/Api.php +1 -1
- app/code/core/Mage/Ogone/controllers/ApiController.php +6 -5
- app/code/core/Mage/Ogone/etc/config.xml +12 -0
- app/design/frontend/default/default/layout/ogone.xml +12 -0
- app/design/frontend/default/default/template/ogone/form.phtml +6 -8
- app/design/frontend/default/default/template/ogone/placeform.phtml +9 -8
- app/locale/en_US/Mage_Ogone.csv +1 -0
app/code/core/Mage/Ogone/Helper/Data.php
CHANGED
@@ -29,7 +29,8 @@
|
|
29 |
*/
|
30 |
class Mage_Ogone_Helper_Data extends Mage_Core_Helper_Abstract
|
31 |
{
|
32 |
-
|
|
|
33 |
/**
|
34 |
* Crypt Data by SHA1 ctypting algorithm by secret key
|
35 |
*
|
@@ -37,12 +38,12 @@ class Mage_Ogone_Helper_Data extends Mage_Core_Helper_Abstract
|
|
37 |
* @param string $key
|
38 |
* @return hash
|
39 |
*/
|
40 |
-
public function shaCrypt($data, $key='')
|
41 |
{
|
42 |
if (is_array($data)) {
|
43 |
-
return
|
44 |
}if (is_string($data)) {
|
45 |
-
return
|
46 |
} else {
|
47 |
return "";
|
48 |
}
|
@@ -59,9 +60,9 @@ class Mage_Ogone_Helper_Data extends Mage_Core_Helper_Abstract
|
|
59 |
public function shaCryptValidation($data, $hash, $key='')
|
60 |
{
|
61 |
if (is_array($data)) {
|
62 |
-
return (bool)
|
63 |
} elseif (is_string($data)) {
|
64 |
-
return (bool)
|
65 |
} else {
|
66 |
return false;
|
67 |
}
|
29 |
*/
|
30 |
class Mage_Ogone_Helper_Data extends Mage_Core_Helper_Abstract
|
31 |
{
|
32 |
+
const HASH_ALGO = 'sha1';
|
33 |
+
|
34 |
/**
|
35 |
* Crypt Data by SHA1 ctypting algorithm by secret key
|
36 |
*
|
38 |
* @param string $key
|
39 |
* @return hash
|
40 |
*/
|
41 |
+
public function shaCrypt($data, $key = '')
|
42 |
{
|
43 |
if (is_array($data)) {
|
44 |
+
return hash(self::HASH_ALGO, implode("", $data));
|
45 |
}if (is_string($data)) {
|
46 |
+
return hash(self::HASH_ALGO, $data);
|
47 |
} else {
|
48 |
return "";
|
49 |
}
|
60 |
public function shaCryptValidation($data, $hash, $key='')
|
61 |
{
|
62 |
if (is_array($data)) {
|
63 |
+
return (bool)(strtoupper(hash(self::HASH_ALGO, implode("", $data)))== $hash);
|
64 |
} elseif (is_string($data)) {
|
65 |
+
return (bool)(strtoupper(hash(self::HASH_ALGO, $data))== $hash);
|
66 |
} else {
|
67 |
return false;
|
68 |
}
|
app/code/core/Mage/Ogone/Model/Api.php
CHANGED
@@ -39,7 +39,7 @@ class Mage_Ogone_Model_Api extends Mage_Payment_Model_Method_Abstract
|
|
39 |
*/
|
40 |
protected $_isGateway = false;
|
41 |
protected $_canAuthorize = true;
|
42 |
-
protected $_canCapture =
|
43 |
protected $_canCapturePartial = false;
|
44 |
protected $_canRefund = false;
|
45 |
protected $_canVoid = false;
|
39 |
*/
|
40 |
protected $_isGateway = false;
|
41 |
protected $_canAuthorize = true;
|
42 |
+
protected $_canCapture = false;
|
43 |
protected $_canCapturePartial = false;
|
44 |
protected $_canRefund = false;
|
45 |
protected $_canVoid = false;
|
app/code/core/Mage/Ogone/controllers/ApiController.php
CHANGED
@@ -192,7 +192,8 @@ class Mage_Ogone_ApiController extends Mage_Core_Controller_Front_Action
|
|
192 |
$this->_exceptionProcess();
|
193 |
break;
|
194 |
default:
|
195 |
-
|
|
|
196 |
}
|
197 |
}
|
198 |
|
@@ -292,13 +293,13 @@ class Mage_Ogone_ApiController extends Mage_Core_Controller_Front_Action
|
|
292 |
$status = $this->getRequest()->getParam('STATUS');
|
293 |
try {
|
294 |
if ($status == Mage_Ogone_Model_Api::OGONE_AUTH_PROCESSING) {
|
295 |
-
$order->setState(Mage_Sales_Model_Order::
|
296 |
} else {
|
297 |
//to send new order email only when state is pending payment
|
298 |
if ($order->getState()==Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {
|
299 |
$order->sendNewOrderEmail();
|
300 |
}
|
301 |
-
$order->setState(Mage_Sales_Model_Order::
|
302 |
}
|
303 |
$order->save();
|
304 |
$this->_redirect('checkout/onepage/success');
|
@@ -362,14 +363,14 @@ class Mage_Ogone_ApiController extends Mage_Core_Controller_Front_Action
|
|
362 |
$exception = Mage::helper('ogone')->__('Authorization not known: A technical problem arose during authorization process, giving unpredictable result');
|
363 |
break;
|
364 |
default:
|
365 |
-
$exception = '';
|
366 |
}
|
367 |
|
368 |
if (!empty($exception)) {
|
369 |
try{
|
370 |
$this->_getCheckout()->setLastSuccessQuoteId($order->getQuoteId());
|
371 |
$this->_prepareCCInfo($order, $params);
|
372 |
-
$order->getPayment()->setLastTransId($params['PAYID']);
|
373 |
//to send new order email only when state is pending payment
|
374 |
if ($order->getState()==Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {
|
375 |
$order->sendNewOrderEmail();
|
192 |
$this->_exceptionProcess();
|
193 |
break;
|
194 |
default:
|
195 |
+
//all unknown transaction will accept as exceptional
|
196 |
+
$this->_exceptionProcess();
|
197 |
}
|
198 |
}
|
199 |
|
293 |
$status = $this->getRequest()->getParam('STATUS');
|
294 |
try {
|
295 |
if ($status == Mage_Ogone_Model_Api::OGONE_AUTH_PROCESSING) {
|
296 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::WAITING_AUTHORIZATION, Mage::helper('ogone')->__('Authorization Waiting from Ogone'));
|
297 |
} else {
|
298 |
//to send new order email only when state is pending payment
|
299 |
if ($order->getState()==Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {
|
300 |
$order->sendNewOrderEmail();
|
301 |
}
|
302 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::PROCESSED_OGONE_STATUS, Mage::helper('ogone')->__('Processed by Ogone'));
|
303 |
}
|
304 |
$order->save();
|
305 |
$this->_redirect('checkout/onepage/success');
|
363 |
$exception = Mage::helper('ogone')->__('Authorization not known: A technical problem arose during authorization process, giving unpredictable result');
|
364 |
break;
|
365 |
default:
|
366 |
+
$exception = Mage::helper('ogone')->__('Unknown exception');
|
367 |
}
|
368 |
|
369 |
if (!empty($exception)) {
|
370 |
try{
|
371 |
$this->_getCheckout()->setLastSuccessQuoteId($order->getQuoteId());
|
372 |
$this->_prepareCCInfo($order, $params);
|
373 |
+
$order->getPayment()->setLastTransId($params['PAYID']);
|
374 |
//to send new order email only when state is pending payment
|
375 |
if ($order->getState()==Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {
|
376 |
$order->sendNewOrderEmail();
|
app/code/core/Mage/Ogone/etc/config.xml
CHANGED
@@ -79,6 +79,18 @@
|
|
79 |
<processed_ogone translate="label"><label>Processed Ogone Payment</label></processed_ogone>
|
80 |
<waiting_authorozation translate="label"><label>Waiting Authorization</label></waiting_authorozation>
|
81 |
</statuses>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
</order>
|
83 |
</sales>
|
84 |
</global>
|
79 |
<processed_ogone translate="label"><label>Processed Ogone Payment</label></processed_ogone>
|
80 |
<waiting_authorozation translate="label"><label>Waiting Authorization</label></waiting_authorozation>
|
81 |
</statuses>
|
82 |
+
<states>
|
83 |
+
<pending_payment>
|
84 |
+
<statuses>
|
85 |
+
<pending_ogone/>
|
86 |
+
</statuses>
|
87 |
+
</pending_payment>
|
88 |
+
<processing>
|
89 |
+
<statuses>
|
90 |
+
<processed_ogone />
|
91 |
+
</statuses>
|
92 |
+
</processing>
|
93 |
+
</states>
|
94 |
</order>
|
95 |
</sales>
|
96 |
</global>
|
app/design/frontend/default/default/layout/ogone.xml
CHANGED
@@ -29,6 +29,18 @@
|
|
29 |
<ogone_api_paypage>
|
30 |
<remove name="right"/>
|
31 |
<remove name="left"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
<reference name="root">
|
33 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
34 |
</reference>
|
29 |
<ogone_api_paypage>
|
30 |
<remove name="right"/>
|
31 |
<remove name="left"/>
|
32 |
+
<remove name="catalog.topnav"/>
|
33 |
+
<reference name="header">
|
34 |
+
<remove name="top.links"/>
|
35 |
+
<remove name="top.search"/>
|
36 |
+
<remove name="store_language"/>
|
37 |
+
<remove name="top.container"/>
|
38 |
+
</reference>
|
39 |
+
<reference name="footer">
|
40 |
+
<remove name="cms_footer_links"/>
|
41 |
+
<remove name="footer_links"/>
|
42 |
+
<remove name="store_switcher"/>
|
43 |
+
</reference>
|
44 |
<reference name="root">
|
45 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
46 |
</reference>
|
app/design/frontend/default/default/template/ogone/form.phtml
CHANGED
@@ -25,11 +25,9 @@
|
|
25 |
*/
|
26 |
?>
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
<
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
</ul>
|
35 |
-
</fieldset>
|
25 |
*/
|
26 |
?>
|
27 |
|
28 |
+
<?php $_code=$this->getMethodCode() ?>
|
29 |
+
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
30 |
+
<li>
|
31 |
+
<?php echo $this->__('You will be redirected to Ogone website when you place an order.') ?>
|
32 |
+
</li>
|
33 |
+
</ul>
|
|
|
|
app/design/frontend/default/default/template/ogone/placeform.phtml
CHANGED
@@ -25,15 +25,16 @@
|
|
25 |
*/
|
26 |
?>
|
27 |
|
28 |
-
<
|
29 |
-
<form name=
|
30 |
-
<?php if (is_array($this->getFormData())): ?>
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
<?php
|
|
|
|
|
35 |
</form>
|
36 |
-
|
37 |
<script type="text/javascript">
|
38 |
//<![CDATA[
|
39 |
var review = new VarienForm('ogone_review_form', '');
|
25 |
*/
|
26 |
?>
|
27 |
|
28 |
+
<p><strong><?php echo Mage::helper('ogone')->__('Please, wait a moment. This page will transfer your data to Ogone payment gateway in a few seconds.'); ?></strong></p>
|
29 |
+
<form name="ogone" id="ogone_review_form" action="<?php echo $this->getFormAction();?>" method="post" accept-charset="ISO-8859-1">
|
30 |
+
<?php if (is_array($this->getFormData())): ?>
|
31 |
+
<fieldset>
|
32 |
+
<?php foreach ($this->getFormData() as $name => $value) { ?>
|
33 |
+
<input type="hidden" name="<?php echo($name); ?>" value="<?php echo($value); ?>" />
|
34 |
+
<?php }?>
|
35 |
+
</fieldset>
|
36 |
+
<?php endif; ?>
|
37 |
</form>
|
|
|
38 |
<script type="text/javascript">
|
39 |
//<![CDATA[
|
40 |
var review = new VarienForm('ogone_review_form', '');
|
app/locale/en_US/Mage_Ogone.csv
CHANGED
@@ -66,6 +66,7 @@
|
|
66 |
","URL/filename of the logo.
|
67 |
<br />The URL must be absolute and stored on a secure server.
|
68 |
"
|
|
|
69 |
"Verical list","Verical list"
|
70 |
"Waiting Authorization","Waiting Authorization"
|
71 |
"You can arrange the layout/list of the payment methods on Ogone payment page","You can arrange the layout/list of the payment methods on Ogone payment page"
|
66 |
","URL/filename of the logo.
|
67 |
<br />The URL must be absolute and stored on a secure server.
|
68 |
"
|
69 |
+
"Unknown exception","Unknown exception"
|
70 |
"Verical list","Verical list"
|
71 |
"Waiting Authorization","Waiting Authorization"
|
72 |
"You can arrange the layout/list of the payment methods on Ogone payment page","You can arrange the layout/list of the payment methods on Ogone payment page"
|