Version Notes
1.0.0
Download this release
Release Info
Developer | Magento Core Team |
Extension | Mage_Ogone_Official |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/core/Mage/Ogone/Block/Form.php +39 -0
- app/code/core/Mage/Ogone/Block/Info.php +41 -0
- app/code/core/Mage/Ogone/Block/Paypage.php +41 -0
- app/code/core/Mage/Ogone/Block/Placeform.php +90 -0
- app/code/core/Mage/Ogone/Helper/Data.php +70 -0
- app/code/core/Mage/Ogone/Model/Api.php +257 -0
- app/code/core/Mage/Ogone/Model/Api/Debug.php +40 -0
- app/code/core/Mage/Ogone/Model/Config.php +151 -0
- app/code/core/Mage/Ogone/Model/Mysql4/Api/Debug.php +40 -0
- app/code/core/Mage/Ogone/Model/Source/PaymentAction.php +45 -0
- app/code/core/Mage/Ogone/Model/Source/Pmlist.php +45 -0
- app/code/core/Mage/Ogone/Model/Source/Template.php +44 -0
- app/code/core/Mage/Ogone/controllers/ApiController.php +491 -0
- app/code/core/Mage/Ogone/etc/config.xml +112 -0
- app/code/core/Mage/Ogone/etc/system.xml +236 -0
- app/code/core/Mage/Ogone/sql/ogone_setup/mysql4-install-0.0.1.php +46 -0
- app/design/adminhtml/default/default/template/ogone/info.phtml +29 -0
- app/design/frontend/default/default/layout/ogone.xml +47 -0
- app/design/frontend/default/default/template/ogone/form.phtml +35 -0
- app/design/frontend/default/default/template/ogone/info.phtml +27 -0
- app/design/frontend/default/default/template/ogone/paypage.phtml +28 -0
- app/design/frontend/default/default/template/ogone/placeform.phtml +42 -0
- app/etc/modules/Mage_Ogone.xml +39 -0
- app/locale/en_US/Mage_Ogone.csv +75 -0
- package.xml +18 -0
app/code/core/Mage/Ogone/Block/Form.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
|
28 |
+
class Mage_Ogone_Block_Form extends Mage_Payment_Block_Form_Cc
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Init Ofone pay from to use it on frontend
|
32 |
+
*
|
33 |
+
*/
|
34 |
+
protected function _construct()
|
35 |
+
{
|
36 |
+
parent::_construct();
|
37 |
+
$this->setTemplate('ogone/form.phtml');
|
38 |
+
}
|
39 |
+
}
|
app/code/core/Mage/Ogone/Block/Info.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Ogone payment iformation block
|
29 |
+
*/
|
30 |
+
class Mage_Ogone_Block_Info extends Mage_Payment_Block_Info_Cc
|
31 |
+
{
|
32 |
+
/**
|
33 |
+
* Init ogone payment information block to use on admin area
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
protected function _construct()
|
37 |
+
{
|
38 |
+
parent::_construct();
|
39 |
+
$this->setTemplate('ogone/info.phtml');
|
40 |
+
}
|
41 |
+
}
|
app/code/core/Mage/Ogone/Block/Paypage.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
|
28 |
+
class Mage_Ogone_Block_Paypage extends Mage_Core_Block_Template
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Init pay page block
|
32 |
+
*
|
33 |
+
* @return Mage_Ogone_Block_Paypage
|
34 |
+
*/
|
35 |
+
protected function _construct()
|
36 |
+
{
|
37 |
+
parent::_construct();
|
38 |
+
$this->setTemplate('ogone/paypage.phtml');
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
}
|
app/code/core/Mage/Ogone/Block/Placeform.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
|
28 |
+
class Mage_Ogone_Block_Placeform extends Mage_Core_Block_Template
|
29 |
+
{
|
30 |
+
public function __construct()
|
31 |
+
{
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get checkout session namespace
|
36 |
+
*
|
37 |
+
* @return Mage_Checkout_Model_Session
|
38 |
+
*/
|
39 |
+
public function getCheckout()
|
40 |
+
{
|
41 |
+
return Mage::getSingleton('checkout/session');
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Ogone payment APi instance
|
46 |
+
*
|
47 |
+
* @return Mage_Ogone_Model_Api
|
48 |
+
*/
|
49 |
+
protected function _getApi()
|
50 |
+
{
|
51 |
+
return Mage::getSingleton('ogone/api');
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Return order instance with loaded onformation by increment id
|
56 |
+
*
|
57 |
+
* @return Mage_Sales_Model_Order
|
58 |
+
*/
|
59 |
+
protected function _getOrder()
|
60 |
+
{
|
61 |
+
if ($this->getOrder()) {
|
62 |
+
$order = $this->getOrder();
|
63 |
+
} else if ($this->getCheckout()->getLastRealOrderId()) {
|
64 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getCheckout()->getLastRealOrderId());
|
65 |
+
} else {
|
66 |
+
return null;
|
67 |
+
}
|
68 |
+
return $order;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Get Form data by using ogone payment api
|
73 |
+
*
|
74 |
+
* @return array
|
75 |
+
*/
|
76 |
+
public function getFormData()
|
77 |
+
{
|
78 |
+
return $this->_getApi()->getFormFields($this->_getOrder());
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Getting gateway url
|
83 |
+
*
|
84 |
+
* @return string
|
85 |
+
*/
|
86 |
+
public function getFormAction()
|
87 |
+
{
|
88 |
+
return $this->_getApi()->getConfig()->getGatewayPath();
|
89 |
+
}
|
90 |
+
}
|
app/code/core/Mage/Ogone/Helper/Data.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Ogone data helper
|
29 |
+
*/
|
30 |
+
class Mage_Ogone_Helper_Data extends Mage_Core_Helper_Abstract
|
31 |
+
{
|
32 |
+
const CRYPT_ALGORITHM = 'sha1';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Crypt Data by SHA1 ctypting algorithm by secret key
|
36 |
+
*
|
37 |
+
* @param array $data
|
38 |
+
* @param string $key
|
39 |
+
* @return hash
|
40 |
+
*/
|
41 |
+
public function shaCrypt($data, $key='')
|
42 |
+
{
|
43 |
+
if (is_array($data)) {
|
44 |
+
return Zend_Crypt::hash(self::CRYPT_ALGORITHM, implode("", $data));
|
45 |
+
}if (is_string($data)) {
|
46 |
+
return Zend_Crypt::hash(self::CRYPT_ALGORITHM, $data);
|
47 |
+
} else {
|
48 |
+
return "";
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Check hash crypted by SHA1 with existing data
|
54 |
+
*
|
55 |
+
* @param array $data
|
56 |
+
* @param string $hash
|
57 |
+
* @param string $key
|
58 |
+
* @return bool
|
59 |
+
*/
|
60 |
+
public function shaCryptValidation($data, $hash, $key='')
|
61 |
+
{
|
62 |
+
if (is_array($data)) {
|
63 |
+
return (bool) (strtoupper(Zend_Crypt::hash(self::CRYPT_ALGORITHM, implode("", $data)))== $hash);
|
64 |
+
} elseif (is_string($data)) {
|
65 |
+
return (bool) (strtoupper(Zend_Crypt::hash(self::CRYPT_ALGORITHM, $data))== $hash);
|
66 |
+
} else {
|
67 |
+
return false;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
app/code/core/Mage/Ogone/Model/Api.php
ADDED
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Ogone payment method model
|
29 |
+
*/
|
30 |
+
class Mage_Ogone_Model_Api extends Mage_Payment_Model_Method_Abstract
|
31 |
+
{
|
32 |
+
protected $_code = 'ogone';
|
33 |
+
protected $_formBlockType = 'ogone/form';
|
34 |
+
protected $_infoBlockType = 'ogone/info';
|
35 |
+
protected $_config = null;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Availability options
|
39 |
+
*/
|
40 |
+
protected $_isGateway = false;
|
41 |
+
protected $_canAuthorize = true;
|
42 |
+
protected $_canCapture = true;
|
43 |
+
protected $_canCapturePartial = false;
|
44 |
+
protected $_canRefund = false;
|
45 |
+
protected $_canVoid = false;
|
46 |
+
protected $_canUseInternal = false;
|
47 |
+
protected $_canUseCheckout = true;
|
48 |
+
protected $_canUseForMultishipping = false;
|
49 |
+
|
50 |
+
/* Ogone template modes */
|
51 |
+
const TEMPLATE_OGONE = 'ogone';
|
52 |
+
const TEMPLATE_MAGENTO = 'magento';
|
53 |
+
|
54 |
+
/* Ogone payment process statuses */
|
55 |
+
const PENDING_OGONE_STATUS = 'pending_ogone';
|
56 |
+
const CANCEL_OGONE_STATUS = 'cancel_ogone';
|
57 |
+
const DECLINE_OGONE_STATUS = 'decline_ogone';
|
58 |
+
const PROCESSING_OGONE_STATUS = 'processing_ogone';
|
59 |
+
const WAITING_AUTHORIZATION = 'waiting_authorozation';
|
60 |
+
const PROCESSED_OGONE_STATUS = 'processed_ogone';
|
61 |
+
|
62 |
+
/* Ogone responce statuses */
|
63 |
+
const OGONE_PAYMENT_REQUESTED_STATUS = 9;
|
64 |
+
const OGONE_PAYMENT_PROCESSING_STATUS = 91;
|
65 |
+
const OGONE_AUTH_UKNKOWN_STATUS = 52;
|
66 |
+
const OGONE_PAYMENT_UNCERTAIN_STATUS = 92;
|
67 |
+
const OGONE_PAYMENT_INCOMPLETE = 1;
|
68 |
+
const OGONE_AUTH_REFUZED = 2;
|
69 |
+
const OGONE_AUTH_PROCESSING = 51;
|
70 |
+
const OGONE_TECH_PROBLEM = 93;
|
71 |
+
const OGONE_AUTHORIZED = 5;
|
72 |
+
|
73 |
+
/* Layout of the payment method */
|
74 |
+
const PMLIST_HORISONTAL_LEFT = 0;
|
75 |
+
const PMLIST_HORISONTAL = 1;
|
76 |
+
const PMLIST_VERTICAL = 2;
|
77 |
+
|
78 |
+
/* ogone paymen action constant*/
|
79 |
+
const OGONE_AUTHORIZE_ACTION = 'RES';
|
80 |
+
const OGONE_AUTHORIZE_CAPTURE_ACTION = 'SAL';
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Init Ogone Api instance, detup default values
|
84 |
+
*
|
85 |
+
* @return Mage_Ogone_Model_Api
|
86 |
+
*/
|
87 |
+
public function __construct()
|
88 |
+
{
|
89 |
+
$this->_config = Mage::getSingleton('ogone/config');
|
90 |
+
return $this;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Return ogone config instance
|
95 |
+
*
|
96 |
+
* @return Mage_Ogone_Model_Config
|
97 |
+
*/
|
98 |
+
public function getConfig()
|
99 |
+
{
|
100 |
+
return $this->_config;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Return debug flag by storeConfig
|
105 |
+
*
|
106 |
+
* @param int storeId
|
107 |
+
* @return bool
|
108 |
+
*/
|
109 |
+
public function getDebug($storeId=null)
|
110 |
+
{
|
111 |
+
return $this->getConfig()->getConfigData('debug_flag', $storeId);
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Flag witch prevent automatic invoice creation
|
116 |
+
*
|
117 |
+
* @return bool
|
118 |
+
*/
|
119 |
+
public function isInitializeNeeded()
|
120 |
+
{
|
121 |
+
return true;
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Redirect url to ogone submit form
|
126 |
+
*
|
127 |
+
* @return string
|
128 |
+
*/
|
129 |
+
public function getOrderPlaceRedirectUrl()
|
130 |
+
{
|
131 |
+
return Mage::getUrl('ogone/api/placeform', array('_secure' => true));
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Return payment_action value from config area
|
136 |
+
*
|
137 |
+
* @return string
|
138 |
+
*/
|
139 |
+
public function getPaymentAction()
|
140 |
+
{
|
141 |
+
return $this->getConfig()->getConfigData('payment_action');
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Rrepare params array to send it to gateway page via POST
|
146 |
+
*
|
147 |
+
* @param Mage_Sales_Model_Order
|
148 |
+
* @return array
|
149 |
+
*/
|
150 |
+
public function getFormFields($order)
|
151 |
+
{
|
152 |
+
if (empty($order)) {
|
153 |
+
if (!($order = $this->getOrder())) {
|
154 |
+
return array();
|
155 |
+
}
|
156 |
+
}
|
157 |
+
$billingAddress = $order->getBillingAddress();
|
158 |
+
$formFields = array();
|
159 |
+
$formFields['PSPID'] = $this->getConfig()->getPSPID();
|
160 |
+
$formFields['orderID'] = $order->getIncrementId();
|
161 |
+
$formFields['amount'] = round($order->getBaseGrandTotal()*100);
|
162 |
+
$formFields['currency'] = Mage::app()->getStore()->getBaseCurrencyCode();
|
163 |
+
$formFields['language'] = Mage::app()->getLocale()->getLocaleCode();
|
164 |
+
|
165 |
+
$formFields['CN'] = $this->_translate($billingAddress->getFirstname().' '.$billingAddress->getLastname());
|
166 |
+
$formFields['EMAIL'] = $order->getCustomerEmail();
|
167 |
+
$formFields['ownerZIP'] = $billingAddress->getPostcode();
|
168 |
+
$formFields['ownercty'] = $billingAddress->getCountry();
|
169 |
+
$formFields['ownertown']= $this->_translate($billingAddress->getCity());
|
170 |
+
$formFields['COM'] = $this->_translate($this->_getOrderDescription($order));
|
171 |
+
$formFields['ownertelno'] = $billingAddress->getTelephone();
|
172 |
+
$formFields['owneraddress'] = $this->_translate(str_replace("\n", ' ',$billingAddress->getStreet(-1)));
|
173 |
+
|
174 |
+
$paymentAction = $this->_getOgonePaymentOperation();
|
175 |
+
if ($paymentAction ) {
|
176 |
+
$formFields['operation'] = $paymentAction;
|
177 |
+
}
|
178 |
+
|
179 |
+
$secretCode = $this->getConfig()->getShaOutCode();
|
180 |
+
$secretSet = $formFields['orderID'] . $formFields['amount'] . $formFields['currency'] .
|
181 |
+
$formFields['PSPID'] . $paymentAction . $secretCode;
|
182 |
+
|
183 |
+
$formFields['SHASign'] = Mage::helper('ogone')->shaCrypt($secretSet);
|
184 |
+
|
185 |
+
$formFields['homeurl'] = $this->getConfig()->getHomeUrl();
|
186 |
+
$formFields['catalogurl'] = $this->getConfig()->getHomeUrl();
|
187 |
+
$formFields['accepturl'] = $this->getConfig()->getAcceptUrl();
|
188 |
+
$formFields['declineurl'] = $this->getConfig()->getDeclineUrl();
|
189 |
+
$formFields['exceptionurl'] = $this->getConfig()->getExceptionUrl();
|
190 |
+
$formFields['cancelurl'] = $this->getConfig()->getCancelUrl();
|
191 |
+
|
192 |
+
if ($this->getConfig()->getConfigData('template')=='ogone') {
|
193 |
+
$formFields['TP']= '';
|
194 |
+
$formFields['PMListType'] = $this->getConfig()->getConfigData('pmlist');
|
195 |
+
} else {
|
196 |
+
$formFields['TP']= $this->getConfig()->getPayPageTemplate();
|
197 |
+
}
|
198 |
+
$formFields['TITLE'] = $this->_translate($this->getConfig()->getConfigData('html_title'));
|
199 |
+
$formFields['BGCOLOR'] = $this->getConfig()->getConfigData('bgcolor');
|
200 |
+
$formFields['TXTCOLOR'] = $this->getConfig()->getConfigData('txtcolor');
|
201 |
+
$formFields['TBLBGCOLOR'] = $this->getConfig()->getConfigData('tblbgcolor');
|
202 |
+
$formFields['TBLTXTCOLOR'] = $this->getConfig()->getConfigData('tbltxtcolor');
|
203 |
+
$formFields['BUTTONBGCOLOR'] = $this->getConfig()->getConfigData('buttonbgcolor');
|
204 |
+
$formFields['BUTTONTXTCOLOR'] = $this->getConfig()->getConfigData('buttontxtcolor');
|
205 |
+
$formFields['FONTTYPE'] = $this->getConfig()->getConfigData('fonttype');
|
206 |
+
$formFields['LOGO'] = $this->getConfig()->getConfigData('logo');
|
207 |
+
return $formFields;
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* to translate UTF 8 to ISO 8859-1
|
212 |
+
* Ogone system is only compatible with iso-8859-1 and does not (yet) fully support the utf-8
|
213 |
+
*/
|
214 |
+
protected function _translate($text)
|
215 |
+
{
|
216 |
+
return htmlentities(iconv("UTF-8", "ISO-8859-1", $text));
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Get Ogone Payment Action value
|
221 |
+
*
|
222 |
+
* @param string
|
223 |
+
* @return string
|
224 |
+
*/
|
225 |
+
protected function _getOgonePaymentOperation()
|
226 |
+
{
|
227 |
+
$value = $this->getPaymentAction();
|
228 |
+
if ($value==Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE) {
|
229 |
+
$value = Mage_Ogone_Model_Api::OGONE_AUTHORIZE_ACTION;
|
230 |
+
} elseif ($value==Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE) {
|
231 |
+
$value = Mage_Ogone_Model_Api::OGONE_AUTHORIZE_CAPTURE_ACTION;
|
232 |
+
}
|
233 |
+
return $value;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* get formated order description
|
238 |
+
*
|
239 |
+
* @param Mage_Sales_Model_Order
|
240 |
+
* @return string
|
241 |
+
*/
|
242 |
+
protected function _getOrderDescription($order)
|
243 |
+
{
|
244 |
+
$invoiceDesc = '';
|
245 |
+
$lengs = 0;
|
246 |
+
foreach ($order->getAllItems() as $item) {
|
247 |
+
if ($item->getParentItem()) {
|
248 |
+
continue;
|
249 |
+
}
|
250 |
+
if (Mage::helper('core/string')->strlen($invoiceDesc.$item->getName()) > 10000) {
|
251 |
+
break;
|
252 |
+
}
|
253 |
+
$invoiceDesc .= $item->getName() . ', ';
|
254 |
+
}
|
255 |
+
return Mage::helper('core/string')->substr($invoiceDesc, 0, -2);
|
256 |
+
}
|
257 |
+
}
|
app/code/core/Mage/Ogone/Model/Api/Debug.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Ogone debug model
|
29 |
+
*/
|
30 |
+
class Mage_Ogone_Model_Api_Debug extends Mage_Core_Model_Abstract
|
31 |
+
{
|
32 |
+
/**
|
33 |
+
* Init ogone debug model
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
protected function _construct()
|
37 |
+
{
|
38 |
+
$this->_init('ogone/api_debug');
|
39 |
+
}
|
40 |
+
}
|
app/code/core/Mage/Ogone/Model/Config.php
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Config model
|
29 |
+
*/
|
30 |
+
class Mage_Ogone_Model_Config extends Mage_Payment_Model_Config
|
31 |
+
{
|
32 |
+
const OGONE_PAYMENT_PATH = 'payment/ogone/';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Return ogone payment config information
|
36 |
+
*
|
37 |
+
* @param string $path
|
38 |
+
* @param int $storeId
|
39 |
+
* @return Simple_Xml
|
40 |
+
*/
|
41 |
+
public function getConfigData($path, $storeId=null)
|
42 |
+
{
|
43 |
+
if (!empty($path)) {
|
44 |
+
return Mage::getStoreConfig(self::OGONE_PAYMENT_PATH . $path, $storeId);
|
45 |
+
}
|
46 |
+
return false;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Return SHA1-in crypt key from config. Setup on admin place.
|
51 |
+
*
|
52 |
+
* @param int $storeId
|
53 |
+
* @return string
|
54 |
+
*/
|
55 |
+
public function getShaInCode($storeId=null)
|
56 |
+
{
|
57 |
+
return Mage::helper('core')->decrypt($this->getConfigData('secret_key_in', $storeId));
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Return SHA1-out crypt key from config. Setup on admin place.
|
62 |
+
* @param int $storeId
|
63 |
+
* @return string
|
64 |
+
*/
|
65 |
+
public function getShaOutCode($storeId=null)
|
66 |
+
{
|
67 |
+
return Mage::helper('core')->decrypt($this->getConfigData('secret_key_out', $storeId));
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Return gateway path, get from confing. Setup on admin place.
|
72 |
+
*
|
73 |
+
* @param int $storeId
|
74 |
+
* @return string
|
75 |
+
*/
|
76 |
+
public function getGatewayPath($storeId=null)
|
77 |
+
{
|
78 |
+
return $this->getConfigData('ogone_gateway', $storeId);
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Get PSPID, affiliation name in ogone system
|
83 |
+
*
|
84 |
+
* @param int $storeId
|
85 |
+
* @return string
|
86 |
+
*/
|
87 |
+
public function getPSPID($storeId=null)
|
88 |
+
{
|
89 |
+
return $this->getConfigData('pspid', $storeId);
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Get paypage template for magento style templates using
|
94 |
+
*
|
95 |
+
* @return string
|
96 |
+
*/
|
97 |
+
public function getPayPageTemplate()
|
98 |
+
{
|
99 |
+
return Mage::getUrl('ogone/api/paypage');
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Return url which ogone system will use as accept
|
104 |
+
*
|
105 |
+
* @return string
|
106 |
+
*/
|
107 |
+
public function getAcceptUrl()
|
108 |
+
{
|
109 |
+
return Mage::getUrl('ogone/api/accept');
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Return url which ogone system will use as decline url
|
114 |
+
*
|
115 |
+
* @return string
|
116 |
+
*/
|
117 |
+
public function getDeclineUrl()
|
118 |
+
{
|
119 |
+
return Mage::getUrl('ogone/api/decline');
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Return url which ogone system will use as exception url
|
124 |
+
*
|
125 |
+
* @return string
|
126 |
+
*/
|
127 |
+
public function getExceptionUrl()
|
128 |
+
{
|
129 |
+
return Mage::getUrl('ogone/api/exception');
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Return url which ogone system will use as cancel url
|
134 |
+
*
|
135 |
+
* @return string
|
136 |
+
*/
|
137 |
+
public function getCancelUrl()
|
138 |
+
{
|
139 |
+
return Mage::getUrl('ogone/api/cancel');
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Return url which ogone system will use as our magento home url on ogone success page
|
144 |
+
*
|
145 |
+
* @return string
|
146 |
+
*/
|
147 |
+
public function getHomeUrl()
|
148 |
+
{
|
149 |
+
return Mage::getUrl('checkout/cart');
|
150 |
+
}
|
151 |
+
}
|
app/code/core/Mage/Ogone/Model/Mysql4/Api/Debug.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Ogone Debug
|
29 |
+
*/
|
30 |
+
class Mage_Ogone_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract
|
31 |
+
{
|
32 |
+
/**
|
33 |
+
* Init ogone debug resource model
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
protected function _construct()
|
37 |
+
{
|
38 |
+
$this->_init('ogone/api_debug', 'debug_id');
|
39 |
+
}
|
40 |
+
}
|
app/code/core/Mage/Ogone/Model/Source/PaymentAction.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Ogone Payment Action Dropdown source
|
29 |
+
*/
|
30 |
+
class Mage_Ogone_Model_Source_PaymentAction
|
31 |
+
{
|
32 |
+
/**
|
33 |
+
* Prepare payment action list as optional array
|
34 |
+
*
|
35 |
+
* @return array
|
36 |
+
*/
|
37 |
+
public function toOptionArray()
|
38 |
+
{
|
39 |
+
return array(
|
40 |
+
array('value' => '', 'label' => Mage::helper('ogone')->__('Ogone default Operation')),
|
41 |
+
array('value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE, 'label' => Mage::helper('ogone')->__('Authorization')),
|
42 |
+
array('value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE, 'label' => Mage::helper('ogone')->__('Direct Sale')),
|
43 |
+
);
|
44 |
+
}
|
45 |
+
}
|
app/code/core/Mage/Ogone/Model/Source/Pmlist.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Ogone template Action Dropdown source
|
29 |
+
*/
|
30 |
+
class Mage_Ogone_Model_Source_Pmlist
|
31 |
+
{
|
32 |
+
/**
|
33 |
+
* Prepare ogone payment block layout as option array
|
34 |
+
*
|
35 |
+
* @return array
|
36 |
+
*/
|
37 |
+
public function toOptionArray()
|
38 |
+
{
|
39 |
+
return array(
|
40 |
+
array('value' => Mage_Ogone_Model_Api::PMLIST_HORISONTAL_LEFT, 'label' => Mage::helper('ogone')->__('Horizontally grouped logo with group name on left')),
|
41 |
+
array('value' => Mage_Ogone_Model_Api::PMLIST_HORISONTAL, 'label' => Mage::helper('ogone')->__('Horizontally grouped logo with no group name')),
|
42 |
+
array('value' => Mage_Ogone_Model_Api::PMLIST_VERTICAL, 'label' => Mage::helper('ogone')->__('Verical list')),
|
43 |
+
);
|
44 |
+
}
|
45 |
+
}
|
app/code/core/Mage/Ogone/Model/Source/Template.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Ogone template Action Dropdown source
|
29 |
+
*/
|
30 |
+
class Mage_Ogone_Model_Source_Template
|
31 |
+
{
|
32 |
+
/**
|
33 |
+
* Prepare ogone template mode list as option array
|
34 |
+
*
|
35 |
+
* @return array
|
36 |
+
*/
|
37 |
+
public function toOptionArray()
|
38 |
+
{
|
39 |
+
return array(
|
40 |
+
array('value' => Mage_Ogone_Model_Api::TEMPLATE_OGONE, 'label' => Mage::helper('ogone')->__('Ogone')),
|
41 |
+
array('value' => Mage_Ogone_Model_Api::TEMPLATE_MAGENTO, 'label' => Mage::helper('ogone')->__('Magento')),
|
42 |
+
);
|
43 |
+
}
|
44 |
+
}
|
app/code/core/Mage/Ogone/controllers/ApiController.php
ADDED
@@ -0,0 +1,491 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Ogone Api Controller
|
29 |
+
*/
|
30 |
+
class Mage_Ogone_ApiController extends Mage_Core_Controller_Front_Action
|
31 |
+
{
|
32 |
+
/**
|
33 |
+
* Order instance
|
34 |
+
*/
|
35 |
+
protected $_order;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Get checkout session namespace
|
39 |
+
*
|
40 |
+
* @return Mage_Checkout_Model_Session
|
41 |
+
*/
|
42 |
+
protected function _getCheckout()
|
43 |
+
{
|
44 |
+
return Mage::getSingleton('checkout/session');
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Get singleton with Checkout by Ogone Api
|
49 |
+
*
|
50 |
+
* @return Mage_Ogone_Model_Api
|
51 |
+
*/
|
52 |
+
protected function _getApi()
|
53 |
+
{
|
54 |
+
return Mage::getSingleton('ogone/api');
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Return order instance loaded by increment id'
|
59 |
+
*
|
60 |
+
* @return Mage_Sales_Model_Order
|
61 |
+
*/
|
62 |
+
protected function _getOrder()
|
63 |
+
{
|
64 |
+
if (empty($this->_order)) {
|
65 |
+
$orderId = $this->getRequest()->getParam('orderID');
|
66 |
+
$this->_order = Mage::getModel('sales/order');
|
67 |
+
$this->_order->loadByIncrementId($orderId);
|
68 |
+
}
|
69 |
+
return $this->_order;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Validation of incoming Ogone data
|
74 |
+
*
|
75 |
+
* @return bool
|
76 |
+
*/
|
77 |
+
protected function _validateOgoneData()
|
78 |
+
{
|
79 |
+
if ($this->_getApi()->getDebug()) {
|
80 |
+
$debug = Mage::getModel('ogone/api_debug')
|
81 |
+
->setDir('in')
|
82 |
+
->setUrl($this->getRequest()->getPathInfo())
|
83 |
+
->setData('data',http_build_query($this->getRequest()->getParams()))
|
84 |
+
->save();
|
85 |
+
}
|
86 |
+
|
87 |
+
$params = $this->getRequest()->getParams();
|
88 |
+
$secureKey = $this->_getApi()->getConfig()->getShaInCode();
|
89 |
+
$secureSet = $this->_getSHAInSet($params, $secureKey);
|
90 |
+
|
91 |
+
if (Mage::helper('ogone')->shaCryptValidation($secureSet, $params['SHASIGN'])!=true) {
|
92 |
+
$this->_getCheckout()->addError($this->__('Hash is not valid'));
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
|
96 |
+
$order = $this->_getOrder();
|
97 |
+
if (!$order->getId()){
|
98 |
+
$this->_getCheckout()->addError($this->__('Order is not valid'));
|
99 |
+
return false;
|
100 |
+
}
|
101 |
+
|
102 |
+
return true;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Load place from layout to make POST on ogone
|
107 |
+
*/
|
108 |
+
public function placeformAction()
|
109 |
+
{
|
110 |
+
$lastIncrementId = $this->_getCheckout()->getLastRealOrderId();
|
111 |
+
if ($lastIncrementId) {
|
112 |
+
$order = Mage::getModel('sales/order');
|
113 |
+
$order->loadByIncrementId($lastIncrementId);
|
114 |
+
if ($order->getId()) {
|
115 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, Mage_Ogone_Model_Api::PENDING_OGONE_STATUS, Mage::helper('ogone')->__('Start ogone processing'));
|
116 |
+
$order->save();
|
117 |
+
|
118 |
+
if ($this->_getApi()->getDebug()) {
|
119 |
+
$debug = Mage::getModel('ogone/api_debug')
|
120 |
+
->setDir('out')
|
121 |
+
->setUrl($this->getRequest()->getPathInfo())
|
122 |
+
->setData('data', http_build_query($this->_getApi()->getFormFields($order)))
|
123 |
+
->save();
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
$this->_getCheckout()->getQuote()->setIsActive(false)->save();
|
129 |
+
$this->_getCheckout()->setOgoneQuoteId($this->_getCheckout()->getQuoteId());
|
130 |
+
$this->_getCheckout()->setOgoneLastSuccessQuoteId($this->_getCheckout()->getLastSuccessQuoteId());
|
131 |
+
$this->_getCheckout()->clear();
|
132 |
+
|
133 |
+
$this->loadLayout();
|
134 |
+
$this->renderLayout();
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Display our pay page, need to ogone payment with external pay page mode *
|
139 |
+
*/
|
140 |
+
public function paypageAction()
|
141 |
+
{
|
142 |
+
$this->loadLayout();
|
143 |
+
$this->renderLayout();
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Action to control postback data from ogone
|
148 |
+
*
|
149 |
+
*/
|
150 |
+
public function postBackAction()
|
151 |
+
{
|
152 |
+
if (!$this->_validateOgoneData()) {
|
153 |
+
$this->getResponse()->setHeader("Status", "404 Not Found");
|
154 |
+
return false;
|
155 |
+
}
|
156 |
+
|
157 |
+
$this->_ogoneProcess();
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Action to process ogone offline data
|
162 |
+
*
|
163 |
+
*/
|
164 |
+
public function offlineProcessAction()
|
165 |
+
{
|
166 |
+
if (!$this->_validateOgoneData()) {
|
167 |
+
$this->getResponse()->setHeader("Status","404 Not Found");
|
168 |
+
return false;
|
169 |
+
}
|
170 |
+
$this->_ogoneProcess();
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Made offline ogone data processing, depending of incoming statuses
|
175 |
+
*/
|
176 |
+
protected function _ogoneProcess()
|
177 |
+
{
|
178 |
+
$status = $this->getRequest()->getParam('STATUS');
|
179 |
+
switch ($status) {
|
180 |
+
case Mage_Ogone_Model_Api::OGONE_AUTHORIZED :
|
181 |
+
case Mage_Ogone_Model_Api::OGONE_AUTH_PROCESSING:
|
182 |
+
case Mage_Ogone_Model_Api::OGONE_PAYMENT_REQUESTED_STATUS :
|
183 |
+
$this->_acceptProcess();
|
184 |
+
break;
|
185 |
+
case Mage_Ogone_Model_Api::OGONE_AUTH_REFUZED:
|
186 |
+
case Mage_Ogone_Model_Api::OGONE_PAYMENT_INCOMPLETE:
|
187 |
+
case Mage_Ogone_Model_Api::OGONE_TECH_PROBLEM:
|
188 |
+
$this->_declineProcess();
|
189 |
+
break;
|
190 |
+
case Mage_Ogone_Model_Api::OGONE_AUTH_UKNKOWN_STATUS:
|
191 |
+
case Mage_Ogone_Model_Api::OGONE_PAYMENT_UNCERTAIN_STATUS:
|
192 |
+
$this->_exceptionProcess();
|
193 |
+
break;
|
194 |
+
default:
|
195 |
+
$this->_cancelProcess();
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* when payment gateway accept the payment, it will land to here
|
201 |
+
* need to change order status as processed ogone
|
202 |
+
* update transaction id
|
203 |
+
*
|
204 |
+
*/
|
205 |
+
public function acceptAction()
|
206 |
+
{
|
207 |
+
if (!$this->_validateOgoneData()) {
|
208 |
+
$this->_redirect('checkout/cart');
|
209 |
+
return;
|
210 |
+
}
|
211 |
+
$this->_ogoneProcess();
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Process success action by accept url
|
216 |
+
*/
|
217 |
+
protected function _acceptProcess()
|
218 |
+
{
|
219 |
+
$params = $this->getRequest()->getParams();
|
220 |
+
$order = $this->_getOrder();
|
221 |
+
|
222 |
+
$this->_getCheckout()->setLastSuccessQuoteId($order->getQuoteId());
|
223 |
+
|
224 |
+
$this->_prepareCCInfo($order, $params);
|
225 |
+
$order->getPayment()->setLastTransId($params['PAYID']);
|
226 |
+
|
227 |
+
try{
|
228 |
+
if ($this->_getApi()->getPaymentAction()==Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE) {
|
229 |
+
$this->_processDirectSale();
|
230 |
+
} else {
|
231 |
+
$this->_processAuthorize();
|
232 |
+
}
|
233 |
+
}catch(Exception $e) {
|
234 |
+
$this->_getCheckout()->addError(Mage::helper('ogone')->__('Order can\'t save'));
|
235 |
+
$this->_redirect('checkout/cart');
|
236 |
+
return;
|
237 |
+
}
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Process Configured Payment Action: Direct Sale, create invoce if state is Pending
|
242 |
+
*
|
243 |
+
*/
|
244 |
+
protected function _processDirectSale()
|
245 |
+
{
|
246 |
+
$order = $this->_getOrder();
|
247 |
+
$status = $this->getRequest()->getParam('STATUS');
|
248 |
+
try{
|
249 |
+
if ($status == Mage_Ogone_Model_Api::OGONE_AUTH_PROCESSING) {
|
250 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::WAITING_AUTHORIZATION, Mage::helper('ogone')->__('Authorization Waiting from Ogone'));
|
251 |
+
$order->save();
|
252 |
+
}elseif ($order->getState()==Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {
|
253 |
+
if ($status == Mage_Ogone_Model_Api::OGONE_AUTHORIZED) {
|
254 |
+
if ($order->getStatus() != Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {
|
255 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::PROCESSING_OGONE_STATUS, Mage::helper('ogone')->__('Processed by Ogone'));
|
256 |
+
}
|
257 |
+
} else {
|
258 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::PROCESSED_OGONE_STATUS, Mage::helper('ogone')->__('Processed by Ogone'));
|
259 |
+
}
|
260 |
+
|
261 |
+
if (!$order->getInvoiceCollection()->getSize()) {
|
262 |
+
$invoice = $order->prepareInvoice();
|
263 |
+
$invoice->register();
|
264 |
+
$invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID);
|
265 |
+
$invoice->getOrder()->setIsInProcess(true);
|
266 |
+
|
267 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
268 |
+
->addObject($invoice)
|
269 |
+
->addObject($invoice->getOrder())
|
270 |
+
->save();
|
271 |
+
$order->sendNewOrderEmail();
|
272 |
+
}
|
273 |
+
} else {
|
274 |
+
$order->save();
|
275 |
+
}
|
276 |
+
$this->_redirect('checkout/onepage/success');
|
277 |
+
return;
|
278 |
+
} catch (Exception $e) {
|
279 |
+
$this->_getCheckout()->addError(Mage::helper('ogone')->__('Order can\'t save'));
|
280 |
+
$this->_redirect('checkout/cart');
|
281 |
+
return;
|
282 |
+
}
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Process Configured Payment Actions: Authorized, Default operation
|
287 |
+
* just place order
|
288 |
+
*/
|
289 |
+
protected function _processAuthorize()
|
290 |
+
{
|
291 |
+
$order = $this->_getOrder();
|
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::STATE_NEW, Mage_Ogone_Model_Api::WAITING_AUTHORIZATION, Mage::helper('ogone')->__('Authorization Waiting from Ogone'));
|
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::STATE_NEW, Mage_Ogone_Model_Api::PROCESSED_OGONE_STATUS, Mage::helper('ogone')->__('Processed by Ogone'));
|
302 |
+
}
|
303 |
+
$order->save();
|
304 |
+
$this->_redirect('checkout/onepage/success');
|
305 |
+
return;
|
306 |
+
} catch(Exception $e) {
|
307 |
+
$this->_getCheckout()->addError(Mage::helper('ogone')->__('Order can\'t save'));
|
308 |
+
$this->_redirect('checkout/cart');
|
309 |
+
return;
|
310 |
+
}
|
311 |
+
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* We get some CC info from ogone, so we must save it
|
315 |
+
*
|
316 |
+
* @param Mage_Sales_Model_Order $order
|
317 |
+
* @param array $ccInfo
|
318 |
+
*
|
319 |
+
* @return Mage_Ogone_ApiController
|
320 |
+
*/
|
321 |
+
protected function _prepareCCInfo($order, $ccInfo)
|
322 |
+
{
|
323 |
+
$order->getPayment()->setCcOwner($ccInfo['CN']);
|
324 |
+
$order->getPayment()->setCcNumberEnc($ccInfo['CARDNO']);
|
325 |
+
$order->getPayment()->setCcLast4(substr($ccInfo['CARDNO'], -4));
|
326 |
+
$order->getPayment()->setCcExpMonth(substr($ccInfo['ED'], 0, 2));
|
327 |
+
$order->getPayment()->setCcExpYear(substr($ccInfo['ED'], 2, 2));
|
328 |
+
return $this;
|
329 |
+
}
|
330 |
+
|
331 |
+
|
332 |
+
/**
|
333 |
+
* the payment result is uncertain
|
334 |
+
* exception status can be 52 or 92
|
335 |
+
* need to change order status as processing ogone
|
336 |
+
* update transaction id
|
337 |
+
*
|
338 |
+
*/
|
339 |
+
public function exceptionAction()
|
340 |
+
{
|
341 |
+
if (!$this->_validateOgoneData()) {
|
342 |
+
$this->_redirect('checkout/cart');
|
343 |
+
return;
|
344 |
+
}
|
345 |
+
$this->_exceptionProcess();
|
346 |
+
}
|
347 |
+
|
348 |
+
/**
|
349 |
+
* Process exception action by ogone exception url
|
350 |
+
*/
|
351 |
+
public function _exceptionProcess()
|
352 |
+
{
|
353 |
+
$params = $this->getRequest()->getParams();
|
354 |
+
$order = $this->_getOrder();
|
355 |
+
|
356 |
+
$exception = '';
|
357 |
+
switch($params['STATUS']) {
|
358 |
+
case Mage_Ogone_Model_Api::OGONE_PAYMENT_UNCERTAIN_STATUS :
|
359 |
+
$exception = Mage::helper('ogone')->__('Payment uncertain: A technical problem arose during payment process, giving unpredictable result');
|
360 |
+
break;
|
361 |
+
case Mage_Ogone_Model_Api::OGONE_AUTH_UKNKOWN_STATUS :
|
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();
|
376 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::PROCESSING_OGONE_STATUS, $exception);
|
377 |
+
} else {
|
378 |
+
$order->addStatusToHistory(Mage_Ogone_Model_Api::PROCESSING_OGONE_STATUS, $exception);
|
379 |
+
}
|
380 |
+
$order->save();
|
381 |
+
}catch(Exception $e) {
|
382 |
+
$this->_getCheckout()->addError(Mage::helper('ogone')->__('Order can not be save for system reason'));
|
383 |
+
}
|
384 |
+
} else {
|
385 |
+
$this->_getCheckout()->addError(Mage::helper('ogone')->__('Exception not defined'));
|
386 |
+
}
|
387 |
+
|
388 |
+
$this->_redirect('checkout/onepage/success');
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* when payment got decline
|
393 |
+
* need to change order status to cancelled
|
394 |
+
* take the user back to shopping cart
|
395 |
+
*
|
396 |
+
*/
|
397 |
+
public function declineAction()
|
398 |
+
{
|
399 |
+
if (!$this->_validateOgoneData()) {
|
400 |
+
$this->_redirect('checkout/cart');
|
401 |
+
return;
|
402 |
+
}
|
403 |
+
$this->_getCheckout()->setQuoteId($this->_getCheckout()->getOgoneQuoteId());
|
404 |
+
$this->_declineProcess();
|
405 |
+
return $this;
|
406 |
+
}
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Process decline action by ogone decline url
|
410 |
+
*/
|
411 |
+
protected function _declineProcess()
|
412 |
+
{
|
413 |
+
$status = Mage_Ogone_Model_Api::DECLINE_OGONE_STATUS;
|
414 |
+
$comment = Mage::helper('ogone')->__('Declined Order on ogone side');
|
415 |
+
$this->_getCheckout()->addError(Mage::helper('ogone')->__('Payment transaction has been declined.'));
|
416 |
+
$this->_cancelOrder($status, $comment);
|
417 |
+
}
|
418 |
+
|
419 |
+
/**
|
420 |
+
* when user cancel the payment
|
421 |
+
* change order status to cancelled
|
422 |
+
* need to rediect user to shopping cart
|
423 |
+
*
|
424 |
+
* @return Mage_Ogone_ApiController
|
425 |
+
*/
|
426 |
+
public function cancelAction()
|
427 |
+
{
|
428 |
+
if (!$this->_validateOgoneData()) {
|
429 |
+
$this->_redirect('checkout/cart');
|
430 |
+
return;
|
431 |
+
}
|
432 |
+
$this->_getCheckout()->setQuoteId($this->_getCheckout()->getOgoneQuoteId());
|
433 |
+
$this->_cancelProcess();
|
434 |
+
return $this;
|
435 |
+
}
|
436 |
+
|
437 |
+
/**
|
438 |
+
* Process cancel action by cancel url
|
439 |
+
*
|
440 |
+
* @return Mage_Ogone_ApiController
|
441 |
+
*/
|
442 |
+
public function _cancelProcess()
|
443 |
+
{
|
444 |
+
$status = Mage_Ogone_Model_Api::CANCEL_OGONE_STATUS;
|
445 |
+
$comment = Mage::helper('ogone')->__('Order canceled on ogone side');
|
446 |
+
$this->_cancelOrder($status, $comment);
|
447 |
+
return $this;
|
448 |
+
}
|
449 |
+
|
450 |
+
/**
|
451 |
+
* Cancel action, used for decline and cancel processes
|
452 |
+
*
|
453 |
+
* @return Mage_Ogone_ApiController
|
454 |
+
*/
|
455 |
+
protected function _cancelOrder($status, $comment='')
|
456 |
+
{
|
457 |
+
$order = $this->_getOrder();
|
458 |
+
try{
|
459 |
+
$order->cancel();
|
460 |
+
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, $status, $comment);
|
461 |
+
$order->save();
|
462 |
+
}catch(Exception $e) {
|
463 |
+
$this->_getCheckout()->addError(Mage::helper('ogone')->__('Order can not be canceled for system reason'));
|
464 |
+
}
|
465 |
+
|
466 |
+
$this->_redirect('checkout/cart');
|
467 |
+
return $this;
|
468 |
+
}
|
469 |
+
|
470 |
+
/**
|
471 |
+
* Return set of data which is ready for SHA crypt
|
472 |
+
*
|
473 |
+
* @param array $data
|
474 |
+
* @param string $key
|
475 |
+
*
|
476 |
+
* @return string
|
477 |
+
*/
|
478 |
+
protected function _getSHAInSet($params, $key)
|
479 |
+
{
|
480 |
+
return $this->getRequest()->getParam('orderID') .
|
481 |
+
$this->getRequest()->getParam('currency') .
|
482 |
+
$this->getRequest()->getParam('amount') .
|
483 |
+
$this->getRequest()->getParam('PM') .
|
484 |
+
$this->getRequest()->getParam('ACCEPTANCE') .
|
485 |
+
$this->getRequest()->getParam('STATUS') .
|
486 |
+
$this->getRequest()->getParam('CARDNO') .
|
487 |
+
$this->getRequest()->getParam('PAYID') .
|
488 |
+
$this->getRequest()->getParam('NCERROR') .
|
489 |
+
$this->getRequest()->getParam('BRAND') . $key;
|
490 |
+
}
|
491 |
+
}
|
app/code/core/Mage/Ogone/etc/config.xml
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category Mage
|
23 |
+
* @package Mage_Ogone
|
24 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<config>
|
29 |
+
<modules>
|
30 |
+
<Mage_Ogone>
|
31 |
+
<version>0.0.1</version>
|
32 |
+
</Mage_Ogone>
|
33 |
+
</modules>
|
34 |
+
<global>
|
35 |
+
<models>
|
36 |
+
<ogone>
|
37 |
+
<class>Mage_Ogone_Model</class>
|
38 |
+
<resourceModel>ogone_mysql4</resourceModel>
|
39 |
+
</ogone>
|
40 |
+
<ogone_mysql4>
|
41 |
+
<class>Mage_Ogone_Model_Mysql4</class>
|
42 |
+
<entities>
|
43 |
+
<api_debug><table>ogone_api_debug</table></api_debug>
|
44 |
+
</entities>
|
45 |
+
</ogone_mysql4>
|
46 |
+
</models>
|
47 |
+
<resources>
|
48 |
+
<ogone_setup>
|
49 |
+
<setup>
|
50 |
+
<module>Mage_Ogone</module>
|
51 |
+
</setup>
|
52 |
+
</ogone_setup>
|
53 |
+
</resources>
|
54 |
+
<blocks>
|
55 |
+
<ogone>
|
56 |
+
<class>Mage_Ogone_Block</class>
|
57 |
+
</ogone>
|
58 |
+
</blocks>
|
59 |
+
<sales>
|
60 |
+
<order>
|
61 |
+
<statuses>
|
62 |
+
<pending_ogone translate="label"><label>Pending Ogone</label></pending_ogone>
|
63 |
+
<cancel_ogone translate="label"><label>Cancelled Ogone</label></cancel_ogone>
|
64 |
+
<decline_ogone translate="label"><label>Declined Ogone</label></decline_ogone>
|
65 |
+
<processing_ogone translate="label"><label>Processing Ogone Payment</label></processing_ogone>
|
66 |
+
<processed_ogone translate="label"><label>Processed Ogone Payment</label></processed_ogone>
|
67 |
+
<waiting_authorozation translate="label"><label>Waiting Authorization</label></waiting_authorozation>
|
68 |
+
</statuses>
|
69 |
+
</order>
|
70 |
+
</sales>
|
71 |
+
</global>
|
72 |
+
<frontend>
|
73 |
+
<layout>
|
74 |
+
<updates>
|
75 |
+
<ogone>
|
76 |
+
<file>ogone.xml</file>
|
77 |
+
</ogone>
|
78 |
+
</updates>
|
79 |
+
</layout>
|
80 |
+
<secure_url>
|
81 |
+
<ogone_api>/ogone/api</ogone_api>
|
82 |
+
</secure_url>
|
83 |
+
<routers>
|
84 |
+
<ogone>
|
85 |
+
<use>standard</use>
|
86 |
+
<args>
|
87 |
+
<module>Mage_Ogone</module>
|
88 |
+
<frontName>ogone</frontName>
|
89 |
+
</args>
|
90 |
+
</ogone>
|
91 |
+
</routers>
|
92 |
+
</frontend>
|
93 |
+
|
94 |
+
<default>
|
95 |
+
<payment>
|
96 |
+
<ogone>
|
97 |
+
<model>ogone/api</model>
|
98 |
+
<title>Ogone</title>
|
99 |
+
<secret_key backend_model="adminhtml/system_config_backend_encrypted"/>
|
100 |
+
<payment_action>authorize</payment_action>
|
101 |
+
<template>ogone</template>
|
102 |
+
<ogone_gateway>https://secure.ogone.com/ncol/test/orderstandard.asp</ogone_gateway>
|
103 |
+
<pending_ogone>pending_ogone</pending_ogone>
|
104 |
+
<cancel_ogone>cancel_ogone</cancel_ogone>
|
105 |
+
<decline_ogone>decline_ogone</decline_ogone>
|
106 |
+
<processing_ogone>processing_ogone</processing_ogone>
|
107 |
+
<processed_ogone>processed_ogone</processed_ogone>
|
108 |
+
<waiting_authorozation>waiting_authorozation</waiting_authorozation>
|
109 |
+
</ogone>
|
110 |
+
</payment>
|
111 |
+
</default>
|
112 |
+
</config>
|
app/code/core/Mage/Ogone/etc/system.xml
ADDED
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category Mage
|
23 |
+
* @package Mage_Ogone
|
24 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<config>
|
29 |
+
<sections>
|
30 |
+
<payment>
|
31 |
+
<groups>
|
32 |
+
<ogone translate="label,comment" module="ogone">
|
33 |
+
<label>Ogone</label>
|
34 |
+
<comment><![CDATA[<br />
|
35 |
+
<div class="custom-options">
|
36 |
+
<div class="box">
|
37 |
+
<p class="grand-total"><br /><b>Signing up with Ogone</b></p>
|
38 |
+
<p>Please enter the correct post back url and offline processiong url in Ogone configuration</p>
|
39 |
+
<p>post back url example: http://myMagentoStore.com/ogone/api/postBack</p>
|
40 |
+
<p>offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess</p>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
]]></comment>
|
44 |
+
<frontend_type>text</frontend_type>
|
45 |
+
<sort_order>800</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
+
<fields>
|
50 |
+
<active translate="label">
|
51 |
+
<label>Enabled</label>
|
52 |
+
<frontend_type>select</frontend_type>
|
53 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
54 |
+
<sort_order>1</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>0</show_in_store>
|
58 |
+
</active>
|
59 |
+
<debug_flag translate="label">
|
60 |
+
<label>Debug</label>
|
61 |
+
<frontend_type>select</frontend_type>
|
62 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
63 |
+
<sort_order>2</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>0</show_in_store>
|
67 |
+
</debug_flag>
|
68 |
+
<title translate="label">
|
69 |
+
<label>Title</label>
|
70 |
+
<frontend_type>text</frontend_type>
|
71 |
+
<sort_order>3</sort_order>
|
72 |
+
<show_in_default>1</show_in_default>
|
73 |
+
<show_in_website>1</show_in_website>
|
74 |
+
<show_in_store>1</show_in_store>
|
75 |
+
</title>
|
76 |
+
<pspid translate="label">
|
77 |
+
<label>PSPID</label>
|
78 |
+
<frontend_type>text</frontend_type>
|
79 |
+
<comment> PSPID is a case sensitive field</comment>
|
80 |
+
<sort_order>4</sort_order>
|
81 |
+
<show_in_default>1</show_in_default>
|
82 |
+
<show_in_website>1</show_in_website>
|
83 |
+
<show_in_store>0</show_in_store>
|
84 |
+
</pspid>
|
85 |
+
<secret_key_in translate="label comment">
|
86 |
+
<label>SHA Signature (used by Magento)</label>
|
87 |
+
<comment><![CDATA[
|
88 |
+
Use in posting data from Ogone to Magento. <br/>
|
89 |
+
Use in Feedback data checking by Magento
|
90 |
+
]]></comment>
|
91 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
92 |
+
<frontend_type>obscure</frontend_type>
|
93 |
+
<sort_order>5</sort_order>
|
94 |
+
<show_in_default>1</show_in_default>
|
95 |
+
<show_in_website>1</show_in_website>
|
96 |
+
<show_in_store>0</show_in_store>
|
97 |
+
</secret_key_in>
|
98 |
+
<secret_key_out translate="label comment">
|
99 |
+
<label>SHA Signature (used by Ogone)</label>
|
100 |
+
<comment><![CDATA[
|
101 |
+
Use in posting data from Magento to Ogone. <br/>
|
102 |
+
Use in data checking by Ogone before the payment.
|
103 |
+
]]></comment>
|
104 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
105 |
+
<frontend_type>obscure</frontend_type>
|
106 |
+
<sort_order>6</sort_order>
|
107 |
+
<show_in_default>1</show_in_default>
|
108 |
+
<show_in_website>1</show_in_website>
|
109 |
+
<show_in_store>0</show_in_store>
|
110 |
+
</secret_key_out>
|
111 |
+
<ogone_gateway translate="label comment">
|
112 |
+
<label>Gateway URL</label>
|
113 |
+
<frontend_type>text</frontend_type>
|
114 |
+
<comment>For production, replace "test" with "prod" Example: https://secure.ogone.com/ncol/prod/orderstandard.asp</comment>
|
115 |
+
<sort_order>7</sort_order>
|
116 |
+
<show_in_default>1</show_in_default>
|
117 |
+
<show_in_website>1</show_in_website>
|
118 |
+
<show_in_store>0</show_in_store>
|
119 |
+
</ogone_gateway>
|
120 |
+
<payment_action translate="label comment">
|
121 |
+
<label>Payment Action</label>
|
122 |
+
<frontend_type>select</frontend_type>
|
123 |
+
<source_model>ogone/source_paymentAction</source_model>
|
124 |
+
<comment>If you choose "No Operation", Ogone will use default Payment procedure setup in Ogone configuration</comment>
|
125 |
+
<sort_order>8</sort_order>
|
126 |
+
<show_in_default>1</show_in_default>
|
127 |
+
<show_in_website>1</show_in_website>
|
128 |
+
<show_in_store>0</show_in_store>
|
129 |
+
</payment_action>
|
130 |
+
<template translate="label comment">
|
131 |
+
<label>Payment Template</label>
|
132 |
+
<frontend_type>select</frontend_type>
|
133 |
+
<source_model>ogone/source_template</source_model>
|
134 |
+
<comment>If you choose "Ogone Template", you will need to fill in all the following fields.</comment>
|
135 |
+
<sort_order>10</sort_order>
|
136 |
+
<show_in_default>1</show_in_default>
|
137 |
+
<show_in_website>1</show_in_website>
|
138 |
+
<show_in_store>0</show_in_store>
|
139 |
+
</template>
|
140 |
+
<html_title translate="label comment">
|
141 |
+
<label>Title of the Ogone Template</label>
|
142 |
+
<frontend_type>text</frontend_type>
|
143 |
+
<sort_order>11</sort_order>
|
144 |
+
<show_in_default>1</show_in_default>
|
145 |
+
<show_in_website>1</show_in_website>
|
146 |
+
<show_in_store>1</show_in_store>
|
147 |
+
</html_title>
|
148 |
+
<bgcolor translate="label comment">
|
149 |
+
<label>Background color of Ogone Template</label>
|
150 |
+
<frontend_type>text</frontend_type>
|
151 |
+
<comment><![CDATA[e.g: white]]></comment>
|
152 |
+
<sort_order>12</sort_order>
|
153 |
+
<show_in_default>1</show_in_default>
|
154 |
+
<show_in_website>1</show_in_website>
|
155 |
+
<show_in_store>1</show_in_store>
|
156 |
+
</bgcolor>
|
157 |
+
<txtcolor translate="label comment">
|
158 |
+
<label>Text Color of the Ogone Template</label>
|
159 |
+
<frontend_type>text</frontend_type>
|
160 |
+
<comment><![CDATA[e.g: black]]></comment>
|
161 |
+
<sort_order>13</sort_order>
|
162 |
+
<show_in_default>1</show_in_default>
|
163 |
+
<show_in_website>1</show_in_website>
|
164 |
+
<show_in_store>1</show_in_store>
|
165 |
+
</txtcolor>
|
166 |
+
<tblbgcolor translate="label comment">
|
167 |
+
<label>Table background color of the Ogone Template</label>
|
168 |
+
<frontend_type>text</frontend_type>
|
169 |
+
<comment><![CDATA[e.g: white]]></comment>
|
170 |
+
<sort_order>14</sort_order>
|
171 |
+
<show_in_default>1</show_in_default>
|
172 |
+
<show_in_website>1</show_in_website>
|
173 |
+
<show_in_store>1</show_in_store>
|
174 |
+
</tblbgcolor>
|
175 |
+
<tbltxtcolor translate="label comment">
|
176 |
+
<label>Table text color of the Ogone Template</label>
|
177 |
+
<frontend_type>text</frontend_type>
|
178 |
+
<comment><![CDATA[e.g: black]]></comment>
|
179 |
+
<sort_order>15</sort_order>
|
180 |
+
<show_in_default>1</show_in_default>
|
181 |
+
<show_in_website>1</show_in_website>
|
182 |
+
<show_in_store>1</show_in_store>
|
183 |
+
</tbltxtcolor>
|
184 |
+
<buttonbgcolor translate="label">
|
185 |
+
<label>Button background color of the Ogone Template</label>
|
186 |
+
<frontend_type>text</frontend_type>
|
187 |
+
<sort_order>16</sort_order>
|
188 |
+
<show_in_default>1</show_in_default>
|
189 |
+
<show_in_website>1</show_in_website>
|
190 |
+
<show_in_store>1</show_in_store>
|
191 |
+
</buttonbgcolor>
|
192 |
+
<buttontxtcolor translate="label comment">
|
193 |
+
<label>Button text color of the Ogone Template</label>
|
194 |
+
<frontend_type>text</frontend_type>
|
195 |
+
<comment><![CDATA[e.g: white]]></comment>
|
196 |
+
<sort_order>17</sort_order>
|
197 |
+
<show_in_default>1</show_in_default>
|
198 |
+
<show_in_website>1</show_in_website>
|
199 |
+
<show_in_store>1</show_in_store>
|
200 |
+
</buttontxtcolor>
|
201 |
+
<fonttype translate="label comment">
|
202 |
+
<label>Font Family of the Ogone Template</label>
|
203 |
+
<frontend_type>text</frontend_type>
|
204 |
+
<comment><![CDATA[e.g: Verdana]]></comment>
|
205 |
+
<sort_order>18</sort_order>
|
206 |
+
<show_in_default>1</show_in_default>
|
207 |
+
<show_in_website>1</show_in_website>
|
208 |
+
<show_in_store>1</show_in_store>
|
209 |
+
</fonttype>
|
210 |
+
<logo translate="label comment">
|
211 |
+
<label>Logo of the Ogone Template</label>
|
212 |
+
<frontend_type>text</frontend_type>
|
213 |
+
<comment><![CDATA[URL/filename of the logo.
|
214 |
+
<br />The URL must be absolute and stored on a secure server.
|
215 |
+
]]></comment>
|
216 |
+
<sort_order>19</sort_order>
|
217 |
+
<show_in_default>1</show_in_default>
|
218 |
+
<show_in_website>1</show_in_website>
|
219 |
+
<show_in_store>1</show_in_store>
|
220 |
+
</logo>
|
221 |
+
<pmlist translate="label comment">
|
222 |
+
<label>Layout of Payment Methods</label>
|
223 |
+
<frontend_type>select</frontend_type>
|
224 |
+
<source_model>ogone/source_pmlist</source_model>
|
225 |
+
<comment>You can arrange the layout/list of the payment methods on Ogone payment page</comment>
|
226 |
+
<sort_order>20</sort_order>
|
227 |
+
<show_in_default>1</show_in_default>
|
228 |
+
<show_in_website>1</show_in_website>
|
229 |
+
<show_in_store>1</show_in_store>
|
230 |
+
</pmlist>
|
231 |
+
</fields>
|
232 |
+
</ogone>
|
233 |
+
</groups>
|
234 |
+
</payment>
|
235 |
+
</sections>
|
236 |
+
</config>
|
app/code/core/Mage/Ogone/sql/ogone_setup/mysql4-install-0.0.1.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Ogone
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
$installer = $this;
|
28 |
+
/* @var $installer Mage_Core_Model_Mysql4_Setup */
|
29 |
+
|
30 |
+
$installer->startSetup();
|
31 |
+
|
32 |
+
$installer->run("
|
33 |
+
|
34 |
+
DROP TABLE IF EXISTS `{$this->getTable('ogone/api_debug')}`;
|
35 |
+
CREATE TABLE `{$this->getTable('ogone/api_debug')}` (
|
36 |
+
`debug_id` int(10) unsigned NOT NULL auto_increment,
|
37 |
+
`dir` enum('in', 'out'),
|
38 |
+
`debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
39 |
+
`url` varchar(255),
|
40 |
+
`data` text,
|
41 |
+
PRIMARY KEY (`debug_id`)
|
42 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
43 |
+
|
44 |
+
");
|
45 |
+
|
46 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/template/ogone/info.phtml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
|
29 |
+
<?php echo Mage::helper('payment')->__('Payment ID: %s', $this->htmlEscape($this->getInfo()->getLastTransId())) ?><br/>
|
app/design/frontend/default/default/layout/ogone.xml
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package default_default
|
24 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<layout version="0.1.0">
|
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>
|
35 |
+
<reference name="content">
|
36 |
+
<block type="ogone/paypage" name="ogone_paypage" template="ogone/paypage.phtml"/>
|
37 |
+
</reference>
|
38 |
+
</ogone_api_paypage>
|
39 |
+
|
40 |
+
<ogone_api_placeform>
|
41 |
+
<remove name="right"/>
|
42 |
+
<remove name="left"/>
|
43 |
+
<reference name="content">
|
44 |
+
<block type="ogone/placeform" name="ogone_placeform" template="ogone/placeform.phtml"/>
|
45 |
+
</reference>
|
46 |
+
</ogone_api_placeform>
|
47 |
+
</layout>
|
app/design/frontend/default/default/template/ogone/form.phtml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<fieldset class="form-list">
|
29 |
+
<?php $_code=$this->getMethodCode() ?>
|
30 |
+
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
31 |
+
<li>
|
32 |
+
<?php echo $this->__('You will be redirected to Ogone website when you place an order.') ?>
|
33 |
+
</li>
|
34 |
+
</ul>
|
35 |
+
</fieldset>
|
app/design/frontend/default/default/template/ogone/info.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<p><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></p>
|
app/design/frontend/default/default/template/ogone/paypage.phtml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
$$$PAYMENT ZONE$$$
|
app/design/frontend/default/default/template/ogone/placeform.phtml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<b><?php echo Mage::helper('ogone')->__('Please, wait a moment. This page will transfer your data to Ogone payment gateway in a few seconds.'); ?></b>
|
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 |
+
<?php foreach ($this->getFormData() as $name => $value) { ?>
|
32 |
+
<input type="hidden" name="<?php echo($name); ?>" value="<?php echo($value); ?>"/>
|
33 |
+
<?php }?>
|
34 |
+
<?php endif; ?>
|
35 |
+
</form>
|
36 |
+
|
37 |
+
<script type="text/javascript">
|
38 |
+
//<![CDATA[
|
39 |
+
var review = new VarienForm('ogone_review_form', '');
|
40 |
+
window.onload = review.submit();
|
41 |
+
//]]>
|
42 |
+
</script>
|
app/etc/modules/Mage_Ogone.xml
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category Mage
|
23 |
+
* @package Mage_Ogone
|
24 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<config>
|
29 |
+
<modules>
|
30 |
+
<Mage_Ogone>
|
31 |
+
<active>true</active>
|
32 |
+
<codePool>core</codePool>
|
33 |
+
<depends>
|
34 |
+
<Mage_Sales/>
|
35 |
+
<Mage_Payment/>
|
36 |
+
</depends>
|
37 |
+
</Mage_Ogone>
|
38 |
+
</modules>
|
39 |
+
</config>
|
app/locale/en_US/Mage_Ogone.csv
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"
|
2 |
+
Use in posting data from Magento to Ogone. <br/>
|
3 |
+
Use in data checking by Ogone before the payment.
|
4 |
+
","
|
5 |
+
Use in posting data from Magento to Ogone. <br/>
|
6 |
+
Use in data checking by Ogone before the payment.
|
7 |
+
"
|
8 |
+
"
|
9 |
+
Use in posting data from Ogone to Magento. <br/>
|
10 |
+
Use in Feedback data checking by Magento
|
11 |
+
","
|
12 |
+
Use in posting data from Ogone to Magento. <br/>
|
13 |
+
Use in Feedback data checking by Magento
|
14 |
+
"
|
15 |
+
"Authorization","Authorization"
|
16 |
+
"Authorization Waiting from Ogone","Authorization Waiting from Ogone"
|
17 |
+
"Authorization not known: A technical problem arose during authorization process, giving unpredictable result","Authorization not known: A technical problem arose during authorization process, giving unpredictable result"
|
18 |
+
"Background color of Ogone Template","Background color of Ogone Template"
|
19 |
+
"Button background color of the Ogone Template","Button background color of the Ogone Template"
|
20 |
+
"Button text color of the Ogone Template","Button text color of the Ogone Template"
|
21 |
+
"Cancelled Ogone","Cancelled Ogone"
|
22 |
+
"Debug","Debug"
|
23 |
+
"Declined Ogone","Declined Ogone"
|
24 |
+
"Declined Order on ogone side","Declined Order on ogone side"
|
25 |
+
"Direct Sale","Direct Sale"
|
26 |
+
"Enabled","Enabled"
|
27 |
+
"Exception not defined","Exception not defined"
|
28 |
+
"Font Family of the Ogone Template","Font Family of the Ogone Template"
|
29 |
+
"For production, replace ""test"" with ""prod"" Example: https://secure.ogone.com/ncol/prod/orderstandard.asp","For production, replace ""test"" with ""prod"" Example: https://secure.ogone.com/ncol/prod/orderstandard.asp"
|
30 |
+
"Gateway URL","Gateway URL"
|
31 |
+
"Hash is not valid","Hash is not valid"
|
32 |
+
"Horizontally grouped logo with group name on left","Horizontally grouped logo with group name on left"
|
33 |
+
"Horizontally grouped logo with no group name","Horizontally grouped logo with no group name"
|
34 |
+
"If you choose ""No Operation"", Ogone will use default Payment procedure setup in Ogone configuration","If you choose ""No Operation"", Ogone will use default Payment procedure setup in Ogone configuration"
|
35 |
+
"If you choose ""Ogone Template"", you will need to fill in all the following fields.","If you choose ""Ogone Template"", you will need to fill in all the following fields."
|
36 |
+
"Layout of Payment Methods","Layout of Payment Methods"
|
37 |
+
"Logo of the Ogone Template","Logo of the Ogone Template"
|
38 |
+
"Magento","Magento"
|
39 |
+
"Ogone","Ogone"
|
40 |
+
"Ogone default Operation","Ogone default Operation"
|
41 |
+
"Order can not be canceled for system reason","Order can not be canceled for system reason"
|
42 |
+
"Order can not be save for system reason","Order can not be save for system reason"
|
43 |
+
"Order can\'t save","Order can\'t save"
|
44 |
+
"Order canceled on ogone side","Order canceled on ogone side"
|
45 |
+
"Order is not valid","Order is not valid"
|
46 |
+
"PSPID","PSPID"
|
47 |
+
"Payment Action","Payment Action"
|
48 |
+
"Payment Template","Payment Template"
|
49 |
+
"Payment transaction has been declined.","Payment transaction has been declined."
|
50 |
+
"Payment uncertain: A technical problem arose during payment process, giving unpredictable result","Payment uncertain: A technical problem arose during payment process, giving unpredictable result"
|
51 |
+
"Pending Ogone","Pending Ogone"
|
52 |
+
"Please, wait a moment. This page will transfer your data to Ogone payment gateway in a few seconds.","Please, wait a moment. This page will transfer your data to Ogone payment gateway in a few seconds."
|
53 |
+
"Processed Ogone Payment","Processed Ogone Payment"
|
54 |
+
"Processed by Ogone","Processed by Ogone"
|
55 |
+
"Processing Ogone Payment","Processing Ogone Payment"
|
56 |
+
"SHA Signature (used by Magento)","SHA Signature (used by Magento)"
|
57 |
+
"SHA Signature (used by Ogone)","SHA Signature (used by Ogone)"
|
58 |
+
"Start ogone processing","Start ogone processing"
|
59 |
+
"Table background color of the Ogone Template","Table background color of the Ogone Template"
|
60 |
+
"Table text color of the Ogone Template","Table text color of the Ogone Template"
|
61 |
+
"Text Color of the Ogone Template","Text Color of the Ogone Template"
|
62 |
+
"Title","Title"
|
63 |
+
"Title of the Ogone Template","Title of the Ogone Template"
|
64 |
+
"URL/filename of the logo.
|
65 |
+
<br />The URL must be absolute and stored on a secure server.
|
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"
|
72 |
+
"You will be redirected to Ogone website when you place an order.","You will be redirected to Ogone website when you place an order."
|
73 |
+
"e.g: Verdana","e.g: Verdana"
|
74 |
+
"e.g: black","e.g: black"
|
75 |
+
"e.g: white","e.g: white"
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Mage_Ogone_Official</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Official Ogone Payment Services Integration Module</summary>
|
10 |
+
<description>This extension provides Ogone payment services integration.</description>
|
11 |
+
<notes>1.0.0</notes>
|
12 |
+
<authors><author><name>Magento Core</name><user>auto-converted</user><email>core@magentocommerce.com</email></author></authors>
|
13 |
+
<date>2009-10-27</date>
|
14 |
+
<time>00:08:31</time>
|
15 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="ogone"><file name="info.phtml" hash="d0af03c7abe96515605a107251dab0a3"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="ogone.xml" hash="c489bf2d9d09fce7d1582eedda234ed6"/></dir><dir name="template"><dir name="ogone"><file name="form.phtml" hash="240bc31e0711f9684b133b2524941166"/><file name="info.phtml" hash="ab903c6655ff46d650829043d6e81f5f"/><file name="paypage.phtml" hash="296ed4b5132a7005d3ed31cd1b73347d"/><file name="placeform.phtml" hash="d2d53c9795115ab6e9b0b3b69bd9aed6"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mage_Ogone.csv" hash="45acdfd9ebcde71d8c46f08f72d6cb0e"/></dir></target><target name="magecore"><dir name="Mage"><dir name="Ogone"><dir name="Block"><file name="Form.php" hash="15eb7ce7a5896a7804871a0b8f3c9c16"/><file name="Info.php" hash="22bd74fe7a41b3cec71c96b66d67f670"/><file name="Paypage.php" hash="ff0dbec585172249021996c5c0014d91"/><file name="Placeform.php" hash="7275874d00fe5b45e0dcfe570091b6f7"/></dir><dir name="controllers"><file name="ApiController.php" hash="b247b3872d84c69b5067b20ccc266544"/></dir><dir name="etc"><file name="config.xml" hash="3aadd1a81935a9c000810b90bf3c9a1d"/><file name="system.xml" hash="120f9f4b0d8bbaa8d21bacb74b25d77e"/></dir><dir name="Helper"><file name="Data.php" hash="e3d3882a16321a8418c95c2150592382"/></dir><dir name="Model"><dir name="Api"><file name="Debug.php" hash="4da829685b7de0cd3ed6db779d0e096c"/></dir><dir name="Mysql4"><dir name="Api"><file name="Debug.php" hash="076d8c4c6f4db3171f6d8a8ff9fb7124"/></dir></dir><dir name="Source"><file name="PaymentAction.php" hash="3a76a2111b89c37eb1334e4ab7741f65"/><file name="Pmlist.php" hash="4e4ebbc89593f43ebcf56340fbbdcf28"/><file name="Template.php" hash="d095221fa18a418984b0ad858fb9fff6"/></dir><file name="Api.php" hash="87b155f3a9cf9bfef87a49d0d2656ad6"/><file name="Config.php" hash="cb1e4c390bb1d4632389c2e8f0550e2b"/></dir><dir name="sql"><dir name="ogone_setup"><file name="mysql4-install-0.0.1.php" hash="8464b07a01804df808fc7689f316ff77"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Ogone.xml" hash="7834583f679449f99947fbc1752392dd"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.3.2.4</min><max></max></package></required></dependencies>
|
18 |
+
</package>
|