Version Notes
The full details of the transaction, including the billing and delivery information, are sent to the gateway for processing using the Hosted Payment pages.
Download this release
Release Info
Developer | Innovate Payments |
Extension | InnovatePayments |
Version | 1.2.0 |
Comparing to | |
See all releases |
Version 1.2.0
- app/code/community/Innovate/InnovatePayments/Block/Cancel.php +35 -0
- app/code/community/Innovate/InnovatePayments/Block/Failure.php +35 -0
- app/code/community/Innovate/InnovatePayments/Block/Form.php +33 -0
- app/code/community/Innovate/InnovatePayments/Block/Info.php +38 -0
- app/code/community/Innovate/InnovatePayments/Block/Redirect.php +67 -0
- app/code/community/Innovate/InnovatePayments/Block/Success.php +35 -0
- app/code/community/Innovate/InnovatePayments/Helper/Data.php +29 -0
- app/code/community/Innovate/InnovatePayments/Model/Cc.php +333 -0
- app/code/community/Innovate/InnovatePayments/Model/Source/RequestType.php +29 -0
- app/code/community/Innovate/InnovatePayments/controllers/ProcessingController.php +274 -0
- app/code/community/Innovate/InnovatePayments/etc/config.xml +106 -0
- app/code/community/Innovate/InnovatePayments/etc/system.xml +146 -0
- app/design/adminhtml/default/default/template/innovatepayments/info.phtml +27 -0
- app/design/adminhtml/default/default/template/innovatepayments/pdf/info.phtml +21 -0
- app/design/frontend/base/default/layout/innovatepayments.xml +39 -0
- app/design/frontend/base/default/template/innovatepayments/blank.phtml +40 -0
- app/design/frontend/base/default/template/innovatepayments/cancel.phtml +28 -0
- app/design/frontend/base/default/template/innovatepayments/failure.phtml +28 -0
- app/design/frontend/base/default/template/innovatepayments/form.phtml +27 -0
- app/design/frontend/base/default/template/innovatepayments/info.phtml +28 -0
- app/design/frontend/base/default/template/innovatepayments/redirect.phtml +32 -0
- app/etc/modules/Innovate_InnovatePayments.xml +28 -0
- package.xml +20 -0
app/code/community/Innovate/InnovatePayments/Block/Cancel.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category Innovate
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Innovate_InnovatePayments_Block_Cancel extends Mage_Core_Block_Template
|
21 |
+
{
|
22 |
+
protected function _construct()
|
23 |
+
{
|
24 |
+
parent::_construct();
|
25 |
+
$this->setTemplate('innovatepayments/cancel.phtml');
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Get continue shopping url
|
30 |
+
*/
|
31 |
+
public function getContinueShoppingUrl()
|
32 |
+
{
|
33 |
+
return Mage::getUrl('*/*/cancel', array('_nosid' => true));
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Innovate/InnovatePayments/Block/Failure.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category Innovate
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Innovate_InnovatePayments_Block_Failure extends Mage_Core_Block_Template
|
21 |
+
{
|
22 |
+
protected function _construct()
|
23 |
+
{
|
24 |
+
parent::_construct();
|
25 |
+
$this->setTemplate('innovatepayments/failure.phtml');
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Get continue shopping url
|
30 |
+
*/
|
31 |
+
public function getContinueShoppingUrl()
|
32 |
+
{
|
33 |
+
return Mage::getUrl('checkout/cart', array('_nosid' => true));
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Innovate/InnovatePayments/Block/Form.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category Innovate
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
|
20 |
+
|
21 |
+
class Innovate_InnovatePayments_Block_Form extends Mage_Payment_Block_Form
|
22 |
+
{
|
23 |
+
protected function _construct()
|
24 |
+
{
|
25 |
+
parent::_construct();
|
26 |
+
$this->setTemplate('innovatepayments/form.phtml');
|
27 |
+
}
|
28 |
+
|
29 |
+
protected function _getConfig()
|
30 |
+
{
|
31 |
+
return Mage::getSingleton('innovatepayments/config');
|
32 |
+
}
|
33 |
+
}
|
app/code/community/Innovate/InnovatePayments/Block/Info.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category Innovate
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Innovate_InnovatePayments_Block_Info extends Mage_Payment_Block_Info
|
21 |
+
{
|
22 |
+
protected function _construct()
|
23 |
+
{
|
24 |
+
parent::_construct();
|
25 |
+
$this->setTemplate('innovatepayments/info.phtml');
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getMethodCode()
|
29 |
+
{
|
30 |
+
return $this->getInfo()->getMethodInstance()->getCode();
|
31 |
+
}
|
32 |
+
|
33 |
+
public function toPdf()
|
34 |
+
{
|
35 |
+
$this->setTemplate('innovatepayments/pdf/info.phtml');
|
36 |
+
return $this->toHtml();
|
37 |
+
}
|
38 |
+
}
|
app/code/community/Innovate/InnovatePayments/Block/Redirect.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category Innovate
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Innovate_InnovatePayments_Block_Redirect extends Mage_Core_Block_Template
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Return checkout session instance
|
24 |
+
*
|
25 |
+
* @return Mage_Checkout_Model_Session
|
26 |
+
*/
|
27 |
+
protected function _getCheckout()
|
28 |
+
{
|
29 |
+
return Mage::getSingleton('checkout/session');
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Return order instance
|
34 |
+
*
|
35 |
+
* @return Mage_Sales_Model_Order|null
|
36 |
+
*/
|
37 |
+
protected function _getOrder()
|
38 |
+
{
|
39 |
+
if ($this->getOrder()) {
|
40 |
+
return $this->getOrder();
|
41 |
+
} elseif ($orderIncrementId = $this->_getCheckout()->getLastRealOrderId()) {
|
42 |
+
return Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
|
43 |
+
} else {
|
44 |
+
return null;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Get form data
|
50 |
+
*
|
51 |
+
* @return array
|
52 |
+
*/
|
53 |
+
public function getFormData()
|
54 |
+
{
|
55 |
+
return $this->_getOrder()->getPayment()->getMethodInstance()->getFormFields();
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Getting gateway url
|
60 |
+
*
|
61 |
+
* @return string
|
62 |
+
*/
|
63 |
+
public function getFormAction()
|
64 |
+
{
|
65 |
+
return $this->_getOrder()->getPayment()->getMethodInstance()->getUrl();
|
66 |
+
}
|
67 |
+
}
|
app/code/community/Innovate/InnovatePayments/Block/Success.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category Innovate
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Innovate_InnovatePayments_Block_Success extends Mage_Core_Block_Abstract
|
21 |
+
{
|
22 |
+
protected function _toHtml()
|
23 |
+
{
|
24 |
+
$successUrl = Mage::getUrl('*/*/success', array('_nosid' => true));
|
25 |
+
|
26 |
+
$html = '<html>'
|
27 |
+
. '<meta http-equiv="refresh" content="0; URL='.$successUrl.'">'
|
28 |
+
. '<body>'
|
29 |
+
. '<p>' . $this->__('Your payment has been successfully processed by our shop system.') . '</p>'
|
30 |
+
. '<p>' . $this->__('Please click <a href="%s">here</a> if you are not redirected automatically.', $successUrl) . '</p>'
|
31 |
+
. '</body></html>';
|
32 |
+
|
33 |
+
return $html;
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Innovate/InnovatePayments/Helper/Data.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category Innovate
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Innovate_InnovatePayments_Helper_Data extends Mage_Payment_Helper_Data
|
21 |
+
{
|
22 |
+
public function getPendingPaymentStatus()
|
23 |
+
{
|
24 |
+
if (version_compare(Mage::getVersion(), '1.4.0', '<')) {
|
25 |
+
return Mage_Sales_Model_Order::STATE_HOLDED;
|
26 |
+
}
|
27 |
+
return Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
|
28 |
+
}
|
29 |
+
}
|
app/code/community/Innovate/InnovatePayments/Model/Cc.php
ADDED
@@ -0,0 +1,333 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category Innovate
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
|
20 |
+
function innovatepayments_Log($text) {
|
21 |
+
$text=trim($text);
|
22 |
+
$log_fh=fopen('/home/keith/htdocs/log.txt','a');
|
23 |
+
fprintf($log_fh,"%s %s\n",date('d/m/Y H:i:s '),$text);
|
24 |
+
fclose($log_fh);
|
25 |
+
}
|
26 |
+
|
27 |
+
class Innovate_InnovatePayments_Model_Cc extends Mage_Payment_Model_Method_Abstract
|
28 |
+
|
29 |
+
{
|
30 |
+
protected $_code = 'innovatepayments_cc';
|
31 |
+
|
32 |
+
protected $_isGateway = true;
|
33 |
+
protected $_canAuthorize = true;
|
34 |
+
protected $_canCapture = true;
|
35 |
+
protected $_canCapturePartial = false;
|
36 |
+
protected $_canRefund = true;
|
37 |
+
protected $_canRefundInvoicePartial = true;
|
38 |
+
protected $_canVoid = false;
|
39 |
+
protected $_canUseInternal = false;
|
40 |
+
protected $_canUseCheckout = true;
|
41 |
+
protected $_canUseForMultishipping = false;
|
42 |
+
protected $_canSaveCc = false;
|
43 |
+
|
44 |
+
protected $_paymentMethod = 'cc';
|
45 |
+
protected $_defaultLocale = 'en';
|
46 |
+
|
47 |
+
|
48 |
+
protected $_testAdminUrl = 'https://secure.innovatepayments.com/gateway/remote.html';
|
49 |
+
protected $_liveAdminUrl = 'https://secure.innovatepayments.com/gateway/remote.html';
|
50 |
+
|
51 |
+
protected $_formBlockType = 'innovatepayments/form';
|
52 |
+
protected $_infoBlockType = 'innovatepayments/info';
|
53 |
+
|
54 |
+
protected $_order;
|
55 |
+
|
56 |
+
public function getOrder()
|
57 |
+
{
|
58 |
+
if (!$this->_order) {
|
59 |
+
$this->_order = $this->getInfoInstance()->getOrder();
|
60 |
+
}
|
61 |
+
return $this->_order;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function getOrderPlaceRedirectUrl()
|
65 |
+
{
|
66 |
+
return Mage::getUrl('innovatepayments/processing/redirect');
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getPaymentMethodType()
|
70 |
+
{
|
71 |
+
return $this->_paymentMethod;
|
72 |
+
}
|
73 |
+
|
74 |
+
public function getUrl()
|
75 |
+
{
|
76 |
+
return 'https://secure.innovatepayments.com/gateway/index.html';
|
77 |
+
}
|
78 |
+
|
79 |
+
public function getAdminUrl()
|
80 |
+
{
|
81 |
+
return 'https://secure.innovatepayments.com/gateway/remote.html';
|
82 |
+
}
|
83 |
+
|
84 |
+
private function _signData($post_data,$fieldList,$key) {
|
85 |
+
$signatureParams = explode(',', $fieldList);
|
86 |
+
$signatureString=$key;
|
87 |
+
foreach ($signatureParams as $param) {
|
88 |
+
if (array_key_exists($param, $post_data)) {
|
89 |
+
$signatureString .= ':' . $post_data[$param];
|
90 |
+
} else {
|
91 |
+
$signatureString .= ':';
|
92 |
+
}
|
93 |
+
}
|
94 |
+
return sha1($signatureString);
|
95 |
+
}
|
96 |
+
|
97 |
+
private function _buildUrl($part) {
|
98 |
+
$url= Mage::getUrl($part,array('_nosid' => true));
|
99 |
+
$url = trim(str_replace('&', '&', $url));
|
100 |
+
return $url;
|
101 |
+
}
|
102 |
+
|
103 |
+
private function _tidy($value,$remove_accents) {
|
104 |
+
if ($accents>0) {
|
105 |
+
$value=Mage::helper('core')->removeAccents($value);
|
106 |
+
}
|
107 |
+
return trim($value);
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getFormFields()
|
111 |
+
{
|
112 |
+
$securityKey = trim($this->getConfigData('security_key'));
|
113 |
+
if (empty($securityKey)) {
|
114 |
+
$message = 'Secret key not set';
|
115 |
+
Mage::throwException($message);
|
116 |
+
}
|
117 |
+
$price = number_format($this->getOrder()->getGrandTotal(),2,'.','');
|
118 |
+
$currency = $this->getOrder()->getOrderCurrencyCode();
|
119 |
+
$billing = $this->getOrder()->getBillingAddress();
|
120 |
+
$shipping = $this->getOrder()->getShippingAddress();
|
121 |
+
|
122 |
+
$locale = trim(Mage::app()->getLocale()->getLocaleCode());
|
123 |
+
if (empty($locale)) {
|
124 |
+
$locale = trim($this->getDefaultLocale());
|
125 |
+
}
|
126 |
+
$order_id = $this->getOrder()->getRealOrderId();
|
127 |
+
$tran_desc = trim($this->getConfigData('tran_desc'));
|
128 |
+
if (empty($tran_desc)) {
|
129 |
+
$tran_desc = 'Your purchase at ' . Mage::app()->getStore()->getName();
|
130 |
+
}
|
131 |
+
$tran_desc = str_replace('{order}', $order_id, $tran_desc);
|
132 |
+
|
133 |
+
$params = array(
|
134 |
+
'ivp_store' => $this->_tidy($this->getConfigData('store_id'),0),
|
135 |
+
'ivp_source' => $this->_tidy('Magento',0),
|
136 |
+
'ivp_cart' => $this->_tidy($order_id,0),
|
137 |
+
'ivp_test' => ($this->getConfigData('transaction_testmode') == '0') ? '0' : '1',
|
138 |
+
'ivp_timestamp' => '0',
|
139 |
+
'ivp_amount' => $this->_tidy($price,0),
|
140 |
+
'ivp_currency' => $this->_tidy($currency,0),
|
141 |
+
'ivp_desc' => $this->_tidy($tran_desc,0),
|
142 |
+
'ivp_extra' => 'bill,delv,return',
|
143 |
+
'ivp_lang' => $this->_tidy($locale,0),
|
144 |
+
'bill_title' => '',
|
145 |
+
'bill_fname' => $this->_tidy($billing->getFirstname(),0),
|
146 |
+
'bill_sname' => $this->_tidy($billing->getLastname(),0),
|
147 |
+
'bill_addr1' => $this->_tidy($billing->getStreet(1),0),
|
148 |
+
'bill_addr2' => $this->_tidy($billing->getStreet(2),0),
|
149 |
+
'bill_addr3' => $this->_tidy($billing->getStreet(3),0),
|
150 |
+
'bill_city' => $this->_tidy($billing->getCity(),0),
|
151 |
+
'bill_region' => $this->_tidy($billing->getRegion(),0),
|
152 |
+
'bill_zip' => $this->_tidy($billing->getPostcode(),0),
|
153 |
+
'bill_country' => $this->_tidy($billing->getCountry(),0),
|
154 |
+
'bill_email' => $this->_tidy($this->getOrder()->getCustomerEmail(),0),
|
155 |
+
'bill_phone1' => $this->_tidy($billing->getTelephone(),0),
|
156 |
+
'delv_title' => '',
|
157 |
+
'delv_fname' => $this->_tidy($shipping->getFirstname(),0),
|
158 |
+
'delv_sname' => $this->_tidy($shipping->getLastname(),0),
|
159 |
+
'delv_addr1' => $this->_tidy($shipping->getStreet(1),0),
|
160 |
+
'delv_addr2' => $this->_tidy($shipping->getStreet(2),0),
|
161 |
+
'delv_addr3' => $this->_tidy($shipping->getStreet(3),0),
|
162 |
+
'delv_city' => $this->_tidy($shipping->getCity(),0),
|
163 |
+
'delv_region' => $this->_tidy($shipping->getRegion(),0),
|
164 |
+
'delv_zip' => $this->_tidy($shipping->getPostcode(),0),
|
165 |
+
'delv_country' => $this->_tidy($shipping->getCountry(),0),
|
166 |
+
'delv_phone1' => $this->_tidy($shipping->getTelephone(),0),
|
167 |
+
'return_cb_auth' => $this->_buildUrl('innovatepayments/processing/response'),
|
168 |
+
'return_cb_decl' => 'none',
|
169 |
+
'return_cb_can' => $this->_buildUrl('innovatepayments/processing/response'),
|
170 |
+
'return_auth' => 'auto:'.$this->_buildUrl('innovatepayments/processing/success'),
|
171 |
+
'return_can' => 'auto:'.$this->_buildUrl('innovatepayments/processing/cancel'),
|
172 |
+
);
|
173 |
+
|
174 |
+
$params['ivp_signature']=$this->_signData($params,'ivp_store,ivp_source,ivp_amount,ivp_currency,ivp_test,ivp_timestamp,ivp_cart,ivp_desc,ivp_extra',$securityKey);
|
175 |
+
$params['bill_signature']=$this->_signData($params,'bill_title,bill_fname,bill_sname,bill_addr1,bill_addr2,bill_addr3,bill_city,bill_region,bill_country,bill_zip,ivp_signature',$securityKey);
|
176 |
+
$params['delv_signature']=$this->_signData($params,'delv_title,delv_fname,delv_sname,delv_addr1,delv_addr2,delv_addr3,delv_city,delv_region,delv_country,delv_zip,ivp_signature',$securityKey);
|
177 |
+
$params['return_signature']=$this->_signData($params,'return_cb_auth,return_cb_decl,return_cb_can,return_auth,return_can,ivp_signature',$securityKey);
|
178 |
+
|
179 |
+
innovatepayments_Log(print_r($params,true));
|
180 |
+
|
181 |
+
return $params;
|
182 |
+
}
|
183 |
+
|
184 |
+
/*
|
185 |
+
public function void(Varien_Object $payment, $amount)
|
186 |
+
{
|
187 |
+
$transactionId = $payment->getLastTransId();
|
188 |
+
$params = $this->_prepareAdminRequestParams();
|
189 |
+
|
190 |
+
$params['ivp_trantype'] = 'void';
|
191 |
+
$params['ivp_amount'] = $amount;
|
192 |
+
$params['ivp_currency'] = $payment->getOrder()->getOrderCurrencyCode();
|
193 |
+
$params['tran_ref'] = $transactionId;
|
194 |
+
|
195 |
+
$response = $this->processRemoteRequest($params);
|
196 |
+
return $this;
|
197 |
+
}
|
198 |
+
*/
|
199 |
+
|
200 |
+
public function refund(Varien_Object $payment, $amount)
|
201 |
+
{
|
202 |
+
$transactionId = $payment->getLastTransId();
|
203 |
+
$params = $this->_prepareAdminRequestParams();
|
204 |
+
|
205 |
+
$params['ivp_trantype'] = 'refund';
|
206 |
+
$params['ivp_amount'] = $amount;
|
207 |
+
$params['ivp_currency'] = $payment->getOrder()->getOrderCurrencyCode();
|
208 |
+
$params['tran_ref'] = $transactionId;
|
209 |
+
|
210 |
+
$response = $this->processRemoteRequest($params);
|
211 |
+
return $this;
|
212 |
+
}
|
213 |
+
|
214 |
+
public function capture(Varien_Object $payment, $amount)
|
215 |
+
{
|
216 |
+
if (!$this->canCapture()) {
|
217 |
+
return $this;
|
218 |
+
}
|
219 |
+
|
220 |
+
if (Mage::app()->getRequest()->getParam('auth_tranref')) {
|
221 |
+
// Capture is being called from inside response action (autocapture=1)
|
222 |
+
$payment->setStatus(self::STATUS_APPROVED);
|
223 |
+
return $this;
|
224 |
+
}
|
225 |
+
$transactionId = $payment->getLastTransId();
|
226 |
+
$params = $this->_prepareAdminRequestParams();
|
227 |
+
$params['ivp_trantype'] = 'capture';
|
228 |
+
$params['ivp_amount'] = $amount;
|
229 |
+
$params['ivp_currency'] = $payment->getOrder()->getOrderCurrencyCode();
|
230 |
+
$params['tran_ref'] = $transactionId;
|
231 |
+
|
232 |
+
$response = $this->processRemoteRequest($params);
|
233 |
+
$payment->getOrder()->addStatusToHistory($payment->getOrder()->getStatus(), $this->_getHelper()->__('InnovatePayments transaction has been captured.'));
|
234 |
+
return $this;
|
235 |
+
}
|
236 |
+
|
237 |
+
public function canEdit () {
|
238 |
+
return false;
|
239 |
+
}
|
240 |
+
|
241 |
+
public function canManageBillingAgreements () {
|
242 |
+
return false;
|
243 |
+
}
|
244 |
+
|
245 |
+
public function canManageRecurringProfiles () {
|
246 |
+
return false;
|
247 |
+
}
|
248 |
+
|
249 |
+
/*
|
250 |
+
public function canVoid ()
|
251 |
+
{
|
252 |
+
return $this->_remoteEnabled();
|
253 |
+
}
|
254 |
+
*/
|
255 |
+
|
256 |
+
public function canRefund ()
|
257 |
+
{
|
258 |
+
return $this->_remoteEnabled();
|
259 |
+
}
|
260 |
+
|
261 |
+
public function canRefundInvoicePartial()
|
262 |
+
{
|
263 |
+
return $this->_remoteEnabled();
|
264 |
+
}
|
265 |
+
|
266 |
+
public function canRefundPartialPerInvoice()
|
267 |
+
{
|
268 |
+
return $this->canRefundInvoicePartial();
|
269 |
+
}
|
270 |
+
|
271 |
+
public function canCapturePartial()
|
272 |
+
{
|
273 |
+
if (Mage::app()->getFrontController()->getAction()->getFullActionName() != 'adminhtml_sales_order_creditmemo_new'){
|
274 |
+
return false;
|
275 |
+
}
|
276 |
+
return $this->_remoteEnabled();
|
277 |
+
}
|
278 |
+
|
279 |
+
protected function processRemoteRequest($params, $requestTimeout = 60)
|
280 |
+
{
|
281 |
+
try {
|
282 |
+
$client = new Varien_Http_Client();
|
283 |
+
$client->setUri($this->getAdminUrl())
|
284 |
+
->setConfig(array('timeout'=>$requestTimeout,))
|
285 |
+
->setParameterPost($params)
|
286 |
+
->setMethod(Zend_Http_Client::POST);
|
287 |
+
|
288 |
+
$response = $client->request();
|
289 |
+
$responseBody = $response->getBody();
|
290 |
+
|
291 |
+
if (empty($responseBody))
|
292 |
+
Mage::throwException($this->_getHelper()->__('InnovatePayments API failure. The request has not been processed.'));
|
293 |
+
|
294 |
+
} catch (Exception $e) {
|
295 |
+
Mage::throwException($this->_getHelper()->__('InnovatePayments API connection error. The request has not been processed.'));
|
296 |
+
}
|
297 |
+
// create array out of response
|
298 |
+
parse_str($responseBody,$response);
|
299 |
+
if ($response['auth_status']=='A') {
|
300 |
+
return $response;
|
301 |
+
}
|
302 |
+
if (empty($response['auth_message'])) {
|
303 |
+
$err="Invalid response from server.";
|
304 |
+
} else {
|
305 |
+
$err=$response['auth_status'].$response['auth_code'].':'.$response['auth_message'];
|
306 |
+
}
|
307 |
+
Mage::throwException($err);
|
308 |
+
}
|
309 |
+
|
310 |
+
protected function _remoteEnabled() {
|
311 |
+
// Remote connections are only used if automatic capture is not enabled.
|
312 |
+
if ($this->getConfigData('autocapture') == '0') {
|
313 |
+
return 1;
|
314 |
+
}
|
315 |
+
return 0;
|
316 |
+
}
|
317 |
+
|
318 |
+
protected function _prepareAdminRequestParams()
|
319 |
+
{
|
320 |
+
$securityKey = trim($this->getConfigData('security_key'));
|
321 |
+
if (empty($securityKey)) {
|
322 |
+
$message = 'Secret key not set';
|
323 |
+
Mage::throwException('Authorisation password is not set');
|
324 |
+
}
|
325 |
+
$params = array (
|
326 |
+
'ivp_password' => $securityKey,
|
327 |
+
'ivp_store' => $this->getConfigData('store_id'),
|
328 |
+
'ivp_test' =>($this->getConfigData('transaction_testmode') == '0') ? '0' : '1',
|
329 |
+
'ivp_tranclass' => 'ecom',
|
330 |
+
);
|
331 |
+
return $params;
|
332 |
+
}
|
333 |
+
}
|
app/code/community/Innovate/InnovatePayments/Model/Source/RequestType.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category Innovate
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Innovate_InnovatePayments_Model_Source_RequestType
|
21 |
+
{
|
22 |
+
public function toOptionArray()
|
23 |
+
{
|
24 |
+
return array(
|
25 |
+
array('value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE, 'label' => Mage::helper('innovatepayments')->__('PreAuthorisation')),
|
26 |
+
array('value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE, 'label' => Mage::helper('innovatepayments')->__('Authorisation')),
|
27 |
+
);
|
28 |
+
}
|
29 |
+
}
|
app/code/community/Innovate/InnovatePayments/controllers/ProcessingController.php
ADDED
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category Innovate
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Innovate_InnovatePayments_ProcessingController extends Mage_Core_Controller_Front_Action
|
21 |
+
{
|
22 |
+
protected $_successBlockType = 'innovatepayments/success';
|
23 |
+
protected $_failureBlockType = 'innovatepayments/failure';
|
24 |
+
protected $_cancelBlockType = 'innovatepayments/cancel';
|
25 |
+
|
26 |
+
protected $_order = NULL;
|
27 |
+
protected $_paymentInst = NULL;
|
28 |
+
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Get singleton of Checkout Session Model
|
32 |
+
*
|
33 |
+
* @return Mage_Checkout_Model_Session
|
34 |
+
*/
|
35 |
+
protected function _getCheckout()
|
36 |
+
{
|
37 |
+
return Mage::getSingleton('checkout/session');
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* when customer selects InnovatePayments payment method
|
42 |
+
*/
|
43 |
+
public function redirectAction()
|
44 |
+
{
|
45 |
+
try {
|
46 |
+
$session = $this->_getCheckout();
|
47 |
+
$order = Mage::getModel('sales/order');
|
48 |
+
$order->loadByIncrementId($session->getLastRealOrderId());
|
49 |
+
if (!$order->getId()) {
|
50 |
+
Mage::throwException('No order for processing found');
|
51 |
+
}
|
52 |
+
if ($order->getState() != Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {
|
53 |
+
$order->setState(
|
54 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
55 |
+
$this->_getPendingPaymentStatus(),
|
56 |
+
Mage::helper('innovatepayments')->__('Customer was redirected to Innovate Payments.')
|
57 |
+
)->save();
|
58 |
+
}
|
59 |
+
if ($session->getQuoteId() && $session->getLastSuccessQuoteId()) {
|
60 |
+
$session->setInnovatePaymentsQuoteId($session->getQuoteId());
|
61 |
+
$session->setInnovatePaymentsSuccessQuoteId($session->getLastSuccessQuoteId());
|
62 |
+
$session->setInnovatePaymentsRealOrderId($session->getLastRealOrderId());
|
63 |
+
$session->getQuote()->setIsActive(false)->save();
|
64 |
+
$session->clear();
|
65 |
+
}
|
66 |
+
$this->loadLayout();
|
67 |
+
$this->renderLayout();
|
68 |
+
return;
|
69 |
+
} catch (Mage_Core_Exception $e) {
|
70 |
+
$this->_getCheckout()->addError($e->getMessage());
|
71 |
+
} catch(Exception $e) {
|
72 |
+
Mage::logException($e);
|
73 |
+
}
|
74 |
+
$this->_redirect('checkout/cart');
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* InnovatePayments returns POST variables to this action through the callback handler (not customer return)
|
79 |
+
*/
|
80 |
+
public function responseAction()
|
81 |
+
{
|
82 |
+
try {
|
83 |
+
$request = $this->_checkCallbackData();
|
84 |
+
if ($request['auth_status'] == 'A') {
|
85 |
+
$this->_processSale($request);
|
86 |
+
} elseif ($request['auth_status'] == 'H') {
|
87 |
+
$this->_processSale($request);
|
88 |
+
} elseif ($request['auth_status'] == 'C') {
|
89 |
+
$this->_processCancel($request);
|
90 |
+
} else {
|
91 |
+
Mage::throwException('Transaction was not successfull.');
|
92 |
+
}
|
93 |
+
} catch (Mage_Core_Exception $e) {
|
94 |
+
$this->getResponse()->setBody(
|
95 |
+
$this->getLayout()
|
96 |
+
->createBlock($this->_failureBlockType)
|
97 |
+
->setOrder($this->_order)
|
98 |
+
->toHtml()
|
99 |
+
);
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* InnovatePayments return action (after callback)
|
105 |
+
*/
|
106 |
+
public function successAction()
|
107 |
+
{
|
108 |
+
try {
|
109 |
+
$session = $this->_getCheckout();
|
110 |
+
$session->unsInnovatePaymentsRealOrderId();
|
111 |
+
$session->setQuoteId($session->getInnovatePaymentsQuoteId(true));
|
112 |
+
$session->setLastSuccessQuoteId($session->getInnovatePaymentsSuccessQuoteId(true));
|
113 |
+
$this->_redirect('checkout/onepage/success');
|
114 |
+
return;
|
115 |
+
} catch (Mage_Core_Exception $e) {
|
116 |
+
$this->_getCheckout()->addError($e->getMessage());
|
117 |
+
} catch(Exception $e) {
|
118 |
+
Mage::logException($e);
|
119 |
+
}
|
120 |
+
$this->_redirect('checkout/cart');
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* InnovatePayments return action
|
125 |
+
*/
|
126 |
+
public function cancelAction()
|
127 |
+
{
|
128 |
+
// set quote to active
|
129 |
+
$session = $this->_getCheckout();
|
130 |
+
if ($quoteId = $session->getInnovatePaymentsQuoteId()) {
|
131 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId);
|
132 |
+
if ($quote->getId()) {
|
133 |
+
$quote->setIsActive(true)->save();
|
134 |
+
$session->setQuoteId($quoteId);
|
135 |
+
}
|
136 |
+
}
|
137 |
+
$session->addError(Mage::helper('innovatepayments')->__('The order has been canceled.'));
|
138 |
+
$this->_redirect('checkout/cart');
|
139 |
+
}
|
140 |
+
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Checking POST variables.
|
144 |
+
* Creating invoice if payment was successfull or cancel order if payment was declined
|
145 |
+
*/
|
146 |
+
protected function _checkCallbackData()
|
147 |
+
{
|
148 |
+
// Check request type
|
149 |
+
if (!$this->getRequest()->isPost()) {
|
150 |
+
Mage::throwException('Wrong request type.');
|
151 |
+
}
|
152 |
+
// Validate request ip is Innovate Payments
|
153 |
+
$helper = Mage::helper('core/http');
|
154 |
+
if (method_exists($helper, 'getRemoteAddr')) {
|
155 |
+
$remoteAddr = $helper->getRemoteAddr();
|
156 |
+
} else {
|
157 |
+
$request = $this->getRequest()->getServer();
|
158 |
+
$remoteAddr = $request['REMOTE_ADDR'];
|
159 |
+
}
|
160 |
+
$connection_allowed=false;
|
161 |
+
$ip_conf=Mage::getStoreConfig('payment/innovatepayments_cc/server_ip');
|
162 |
+
if (empty($ip_conf)) {
|
163 |
+
$ip_conf="91.75.72.164, 91.75.72.165, 91.75.72.166";
|
164 |
+
}
|
165 |
+
$ip_list=explode(',',$ip_conf);
|
166 |
+
foreach ($ip_list as $ip_check) {
|
167 |
+
if (strcmp(trim($ip_check),$remoteAddr)==0) {
|
168 |
+
$connection_allowed=true;
|
169 |
+
}
|
170 |
+
}
|
171 |
+
if (!$connection_allowed) {
|
172 |
+
Mage::throwException('IP '.$remoteAddr.' can\'t be validated as Innovate Payments.');
|
173 |
+
}
|
174 |
+
// Get request variables
|
175 |
+
$request = $this->getRequest()->getPost();
|
176 |
+
if (empty($request)) {
|
177 |
+
Mage::throwException('Request doesn\'t contain POST elements.');
|
178 |
+
}
|
179 |
+
// Validate data hash check
|
180 |
+
$fieldList='auth_status,auth_code,auth_message,auth_tranref,auth_cvv,auth_avs,card_code,card_desc,cart_id,cart_desc,cart_currency,cart_amount,tran_currency,tran_amount,tran_cust_ip';
|
181 |
+
$signatureParams = explode(',', $fieldList);
|
182 |
+
$signatureString=Mage::getStoreConfig('payment/innovatepayments_cc/security_key');
|
183 |
+
foreach ($signatureParams as $param) {
|
184 |
+
if (array_key_exists($param, $request)) {
|
185 |
+
$signatureString .= ':' . $request[$param];
|
186 |
+
} else {
|
187 |
+
$signatureString .= ':';
|
188 |
+
}
|
189 |
+
}
|
190 |
+
$hash_check=sha1($signatureString);
|
191 |
+
if (strcasecmp($request['auth_hash'],$hash_check)!=0) {
|
192 |
+
// Hash check does not match. Data may of been tampered with.
|
193 |
+
Mage::throwException('Callback data security check failed');
|
194 |
+
}
|
195 |
+
// Check order id
|
196 |
+
if (empty($request['cart_id']) || strlen($request['cart_id']) > 50) {
|
197 |
+
Mage::throwException('Missing or invalid order ID');
|
198 |
+
}
|
199 |
+
|
200 |
+
// Load order for further validation
|
201 |
+
$this->_order = Mage::getModel('sales/order')->loadByIncrementId($request['cart_id']);
|
202 |
+
if (!$this->_order->getId()) {
|
203 |
+
Mage::throwException('Order not found');
|
204 |
+
}
|
205 |
+
$this->_paymentInst = $this->_order->getPayment()->getMethodInstance();
|
206 |
+
return $request;
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Process success response
|
211 |
+
*/
|
212 |
+
protected function _processSale($request)
|
213 |
+
{
|
214 |
+
// save transaction information
|
215 |
+
$this->_order->getPayment()
|
216 |
+
->setTransactionId($request['auth_tranref'])
|
217 |
+
->setLastTransId($request['auth_tranref'])
|
218 |
+
->setCcAvsStatus($request['auth_avs']);
|
219 |
+
|
220 |
+
$additional_data = $this->_order->getPayment()->getAdditionalData();
|
221 |
+
$additional_data .= ($additional_data ? "<br/>\n" : '') . $request['card_desc'];
|
222 |
+
$this->_order->getPayment()->setAdditionalData($additional_data);
|
223 |
+
if (Mage::getStoreConfigFlag('payment/innovatepayments_cc/autocapture')) {
|
224 |
+
if ($this->_order->canInvoice()) {
|
225 |
+
$invoice = $this->_order->prepareInvoice();
|
226 |
+
$invoice->register()->capture();
|
227 |
+
Mage::getModel('core/resource_transaction')
|
228 |
+
->addObject($invoice)
|
229 |
+
->addObject($invoice->getOrder())
|
230 |
+
->save();
|
231 |
+
}
|
232 |
+
$this->_order->addStatusToHistory($this->_paymentInst->getConfigData('order_status'), Mage::helper('innovatepayments')->__('The transaction has been authorised and captured by Innovate Payments.'));
|
233 |
+
} else {
|
234 |
+
$this->_order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $this->_paymentInst->getConfigData('order_status'), Mage::helper('innovatepayments')->__('The amount has been authorised by Innovate Payments. Capture is required to complete the transaction.'));
|
235 |
+
}
|
236 |
+
|
237 |
+
$this->_order->sendNewOrderEmail();
|
238 |
+
$this->_order->setEmailSent(true);
|
239 |
+
|
240 |
+
$this->_order->save();
|
241 |
+
|
242 |
+
$this->getResponse()->setBody(
|
243 |
+
$this->getLayout()
|
244 |
+
->createBlock($this->_successBlockType)
|
245 |
+
->setOrder($this->_order)
|
246 |
+
->toHtml()
|
247 |
+
);
|
248 |
+
}
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Process success response
|
252 |
+
*/
|
253 |
+
protected function _processCancel($request)
|
254 |
+
{
|
255 |
+
// cancel order
|
256 |
+
if ($this->_order->canCancel()) {
|
257 |
+
$this->_order->cancel();
|
258 |
+
$this->_order->addStatusToHistory(Mage_Sales_Model_Order::STATE_CANCELED, Mage::helper('innovatepayments')->__('Payment was canceled'));
|
259 |
+
$this->_order->save();
|
260 |
+
}
|
261 |
+
|
262 |
+
$this->getResponse()->setBody(
|
263 |
+
$this->getLayout()
|
264 |
+
->createBlock($this->_cancelBlockType)
|
265 |
+
->setOrder($this->_order)
|
266 |
+
->toHtml()
|
267 |
+
);
|
268 |
+
}
|
269 |
+
|
270 |
+
protected function _getPendingPaymentStatus()
|
271 |
+
{
|
272 |
+
return Mage::helper('innovatepayments')->getPendingPaymentStatus();
|
273 |
+
}
|
274 |
+
}
|
app/code/community/Innovate/InnovatePayments/etc/config.xml
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Innovate
|
17 |
+
* @package Innovate_InnovatePayments
|
18 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
19 |
+
*/
|
20 |
+
-->
|
21 |
+
<config>
|
22 |
+
<modules>
|
23 |
+
<Innovate_InnovatePayments>
|
24 |
+
<version>0.1.0</version>
|
25 |
+
</Innovate_InnovatePayments>
|
26 |
+
</modules>
|
27 |
+
|
28 |
+
<global>
|
29 |
+
<models>
|
30 |
+
<innovatepayments>
|
31 |
+
<class>Innovate_InnovatePayments_Model</class>
|
32 |
+
</innovatepayments>
|
33 |
+
</models>
|
34 |
+
<helpers>
|
35 |
+
<innovatepayments>
|
36 |
+
<class>Innovate_InnovatePayments_Helper</class>
|
37 |
+
</innovatepayments>
|
38 |
+
</helpers>
|
39 |
+
<resources>
|
40 |
+
<innovatepayments_setup>
|
41 |
+
<setup>
|
42 |
+
<module>Innovate_InnovatePayments</module>
|
43 |
+
</setup>
|
44 |
+
<connection>
|
45 |
+
<use>core_setup</use>
|
46 |
+
</connection>
|
47 |
+
</innovatepayments_setup>
|
48 |
+
<innovatepayments_write>
|
49 |
+
<connection>
|
50 |
+
<use>core_write</use>
|
51 |
+
</connection>
|
52 |
+
</innovatepayments_write>
|
53 |
+
<innovatepayments_read>
|
54 |
+
<connection>
|
55 |
+
<use>core_read</use>
|
56 |
+
</connection>
|
57 |
+
</innovatepayments_read>
|
58 |
+
</resources>
|
59 |
+
<blocks>
|
60 |
+
<innovatepayments><class>Innovate_InnovatePayments_Block</class></innovatepayments>
|
61 |
+
</blocks>
|
62 |
+
<payment>
|
63 |
+
<url>http://www.innovatepayments.com/</url>
|
64 |
+
</payment>
|
65 |
+
</global>
|
66 |
+
|
67 |
+
<frontend>
|
68 |
+
<secure_url>
|
69 |
+
<innovatepayments_processing>/innovatepayments/processing</innovatepayments_processing>
|
70 |
+
</secure_url>
|
71 |
+
<routers>
|
72 |
+
<innovatepayments>
|
73 |
+
<use>standard</use>
|
74 |
+
<args>
|
75 |
+
<module>Innovate_InnovatePayments</module>
|
76 |
+
<frontName>innovatepayments</frontName>
|
77 |
+
</args>
|
78 |
+
</innovatepayments>
|
79 |
+
</routers>
|
80 |
+
<layout>
|
81 |
+
<updates>
|
82 |
+
<innovatepayments>
|
83 |
+
<file>innovatepayments.xml</file>
|
84 |
+
</innovatepayments>
|
85 |
+
</updates>
|
86 |
+
</layout>
|
87 |
+
</frontend>
|
88 |
+
|
89 |
+
<default>
|
90 |
+
<payment>
|
91 |
+
<innovatepayments_cc>
|
92 |
+
<active>0</active>
|
93 |
+
<model>innovatepayments/cc</model>
|
94 |
+
<order_status>1</order_status>
|
95 |
+
<title>Credit Card (InnovatePayments)</title>
|
96 |
+
<allowspecific>0</allowspecific>
|
97 |
+
<transaction_testmode>1</transaction_testmode>
|
98 |
+
<autocapture>1</autocapture>
|
99 |
+
<order_status>processing</order_status>
|
100 |
+
<payment_action>authorize</payment_action>
|
101 |
+
<server_ip>91.75.72.164, 91.75.72.165, 91.75.72.166</server_ip>
|
102 |
+
<tran_desc>Your order from StoreName</tran_desc>
|
103 |
+
</innovatepayments_cc>
|
104 |
+
</payment>
|
105 |
+
</default>
|
106 |
+
</config>
|
app/code/community/Innovate/InnovatePayments/etc/system.xml
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Innovate
|
17 |
+
* @package Innovate_InnovatePayments
|
18 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
19 |
+
*/
|
20 |
+
-->
|
21 |
+
<config>
|
22 |
+
<sections>
|
23 |
+
<payment>
|
24 |
+
<groups>
|
25 |
+
<innovatepayments_cc translate="label" module="innovatepayments">
|
26 |
+
<label>InnovatePayments Credit Card</label>
|
27 |
+
<frontend_type>text</frontend_type>
|
28 |
+
<sort_order>1</sort_order>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>0</show_in_store>
|
32 |
+
<comment><![CDATA[<a href="http://www.innovatepayments.com/apply.php" target="_blank">Click here to apply for an InnovatePayments account</a>]]></comment>
|
33 |
+
<fields>
|
34 |
+
<active translate="label">
|
35 |
+
<label>Enabled</label>
|
36 |
+
<frontend_type>select</frontend_type>
|
37 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
38 |
+
<sort_order>10</sort_order>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>0</show_in_store>
|
42 |
+
</active>
|
43 |
+
<order_status translate="label">
|
44 |
+
<label>New order status</label>
|
45 |
+
<frontend_type>select</frontend_type>
|
46 |
+
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
47 |
+
<sort_order>20</sort_order>
|
48 |
+
<show_in_default>1</show_in_default>
|
49 |
+
<show_in_website>1</show_in_website>
|
50 |
+
<show_in_store>0</show_in_store>
|
51 |
+
</order_status>
|
52 |
+
<title translate="label">
|
53 |
+
<label>Title</label>
|
54 |
+
<frontend_type>text</frontend_type>
|
55 |
+
<sort_order>30</sort_order>
|
56 |
+
<show_in_default>1</show_in_default>
|
57 |
+
<show_in_website>1</show_in_website>
|
58 |
+
<show_in_store>0</show_in_store>
|
59 |
+
</title>
|
60 |
+
<allowspecific translate="label">
|
61 |
+
<label>Payment to applicable countries</label>
|
62 |
+
<frontend_type>allowspecific</frontend_type>
|
63 |
+
<sort_order>40</sort_order>
|
64 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<show_in_website>1</show_in_website>
|
67 |
+
<show_in_store>1</show_in_store>
|
68 |
+
</allowspecific>
|
69 |
+
<specificcountry translate="label">
|
70 |
+
<label>Payment to Specific countries</label>
|
71 |
+
<frontend_type>multiselect</frontend_type>
|
72 |
+
<sort_order>50</sort_order>
|
73 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
</specificcountry>
|
78 |
+
<store_id translate="label">
|
79 |
+
<label>Store ID</label>
|
80 |
+
<frontend_type>text</frontend_type>
|
81 |
+
<sort_order>60</sort_order>
|
82 |
+
<show_in_default>1</show_in_default>
|
83 |
+
<show_in_website>1</show_in_website>
|
84 |
+
<show_in_store>0</show_in_store>
|
85 |
+
</store_id>
|
86 |
+
<security_key translate="label,comment">
|
87 |
+
<label>Secret Key</label>
|
88 |
+
<comment>Must match the key used in the store configuration. Key type must be sha1.</comment>
|
89 |
+
<frontend_type>text</frontend_type>
|
90 |
+
<sort_order>70</sort_order>
|
91 |
+
<show_in_default>1</show_in_default>
|
92 |
+
<show_in_website>1</show_in_website>
|
93 |
+
<show_in_store>0</show_in_store>
|
94 |
+
</security_key>
|
95 |
+
<tran_desc translate="label,comment">
|
96 |
+
<label>Transaction Description</label>
|
97 |
+
<comment>Set to the description you want to appear on the InnovatePayments gateway.</comment>
|
98 |
+
<frontend_type>text</frontend_type>
|
99 |
+
<sort_order>71</sort_order>
|
100 |
+
<show_in_default>1</show_in_default>
|
101 |
+
<show_in_website>1</show_in_website>
|
102 |
+
<show_in_store>0</show_in_store>
|
103 |
+
</tran_desc>
|
104 |
+
<transaction_testmode translate="label">
|
105 |
+
<label>Test Mode</label>
|
106 |
+
<frontend_type>select</frontend_type>
|
107 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
108 |
+
<sort_order>80</sort_order>
|
109 |
+
<show_in_default>1</show_in_default>
|
110 |
+
<show_in_website>1</show_in_website>
|
111 |
+
<show_in_store>0</show_in_store>
|
112 |
+
</transaction_testmode>
|
113 |
+
<autocapture translate="label">
|
114 |
+
<label>Automatic Capture</label>
|
115 |
+
<comment>If this is set to 'No' then you will need to manually capture each order to recieve payment. This must match the auto-capture setting within Innovate Payments.</comment>
|
116 |
+
<frontend_type>select</frontend_type>
|
117 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
118 |
+
<sort_order>90</sort_order>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
<show_in_store>0</show_in_store>
|
122 |
+
</autocapture>
|
123 |
+
<auth_password translate="label,comment">
|
124 |
+
<label>Authorisation password</label>
|
125 |
+
<comment>Required for manual capture requests. This is the same password as is used for remote connections, not the secret key used for the hosted payment pages.</comment>
|
126 |
+
<frontend_type>text</frontend_type>
|
127 |
+
<sort_order>100</sort_order>
|
128 |
+
<show_in_default>1</show_in_default>
|
129 |
+
<show_in_website>1</show_in_website>
|
130 |
+
<show_in_store>0</show_in_store>
|
131 |
+
</auth_password>
|
132 |
+
<server_ip translate="label,comment">
|
133 |
+
<label>Server IP list </label>
|
134 |
+
<comment>List of the InnovatePayment server IP addresses to verify callback requests.</comment>
|
135 |
+
<frontend_type>text</frontend_type>
|
136 |
+
<sort_order>110</sort_order>
|
137 |
+
<show_in_default>1</show_in_default>
|
138 |
+
<show_in_website>1</show_in_website>
|
139 |
+
<show_in_store>0</show_in_store>
|
140 |
+
</server_ip>
|
141 |
+
</fields>
|
142 |
+
</innovatepayments_cc>
|
143 |
+
</groups>
|
144 |
+
</payment>
|
145 |
+
</sections>
|
146 |
+
</config>
|
app/design/adminhtml/default/default/template/innovatepayments/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 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 |
+
* @category design_default
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<?php
|
21 |
+
echo $this->getMethod()->getTitle() . '<br/>';
|
22 |
+
if ($this->getInfo()->getLastTransId() == '') {
|
23 |
+
echo Mage::helper('innovatepayments')->__('Payment has not been processed yet.') . '<br/>';
|
24 |
+
} else {
|
25 |
+
echo Mage::helper('innovatepayments')->__('InnovatePayments Transaction ID: %s', $this->htmlEscape($this->getInfo()->getLastTransId())) . '<br/>';
|
26 |
+
}
|
27 |
+
?>
|
app/design/adminhtml/default/default/template/innovatepayments/pdf/info.phtml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category design_default
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<?php echo $this->getMethod()->getTitle() ?>
|
21 |
+
|
app/design/frontend/base/default/layout/innovatepayments.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 Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category design_default
|
17 |
+
* @package Innovate InnovatePayments
|
18 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
19 |
+
*/
|
20 |
+
|
21 |
+
-->
|
22 |
+
<layout version="0.1.0">
|
23 |
+
<innovatepayments_processing_failure>
|
24 |
+
<reference name="root">
|
25 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
26 |
+
</reference>
|
27 |
+
<reference name="content">
|
28 |
+
<block type="innovatepayments/failure" name="innovatepayments_failure" template="innovatepayments/failure.phtml" />
|
29 |
+
</reference>
|
30 |
+
</innovatepayments_processing_failure>
|
31 |
+
<innovatepayments_processing_redirect>
|
32 |
+
<reference name="root">
|
33 |
+
<action method="setTemplate"><template>innovatepayments/blank.phtml</template></action>
|
34 |
+
</reference>
|
35 |
+
<reference name="content">
|
36 |
+
<block type="innovatepayments/redirect" name="innovatepayments_redirect" template="innovatepayments/redirect.phtml" />
|
37 |
+
</reference>
|
38 |
+
</innovatepayments_processing_redirect>
|
39 |
+
</layout>
|
app/design/frontend/base/default/template/innovatepayments/blank.phtml
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 |
+
* @category design_default
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
21 |
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
|
22 |
+
<head>
|
23 |
+
<title>Innovate Payments</title>
|
24 |
+
<style>
|
25 |
+
html {
|
26 |
+
font-size: 100%; /* IE trick to allow proper resizing of text */
|
27 |
+
}
|
28 |
+
body {
|
29 |
+
margin: 20px 0 0 0;
|
30 |
+
text-align: left;
|
31 |
+
font-family:"Helvetica Neue", Arial, Helvetica, sans-serif; /* 1em is now 12px at 96ppi. */
|
32 |
+
font-size:12px;
|
33 |
+
background-color: #ffffff;
|
34 |
+
color: #606060;
|
35 |
+
}
|
36 |
+
</style>
|
37 |
+
</head>
|
38 |
+
<body><center><?php echo $this->getChildHtml('content') ?></center><br>
|
39 |
+
</body>
|
40 |
+
</html>
|
app/design/frontend/base/default/template/innovatepayments/cancel.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 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 |
+
* @category design_default
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<html>
|
21 |
+
<meta http-equiv="refresh" content="0; URL=<?php echo $this->getContinueShoppingUrl()?>">
|
22 |
+
<body>
|
23 |
+
<div class="page-head">
|
24 |
+
<h3><?php echo Mage::helper('innovatepayments')->__('Payment was canceled') ?></h3>
|
25 |
+
</div>
|
26 |
+
<p><?php echo Mage::helper('innovatepayments')->__('Please <a href="%s">continue shopping</a>.', $this->getContinueShoppingUrl()) ?></p>
|
27 |
+
</body>
|
28 |
+
</html>
|
app/design/frontend/base/default/template/innovatepayments/failure.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 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 |
+
* @category design_default
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<html>
|
21 |
+
<meta http-equiv="refresh" content="0; URL=<?php echo $this->getContinueShoppingUrl()?>">
|
22 |
+
<body>
|
23 |
+
<div class="page-head">
|
24 |
+
<h3><?php echo Mage::helper('innovatepayments')->__('Error occurred') ?></h3>
|
25 |
+
</div>
|
26 |
+
<p><?php echo Mage::helper('innovatepayments')->__('Please <a href="%s">continue shopping</a>.', $this->getContinueShoppingUrl()) ?></p>
|
27 |
+
</body>
|
28 |
+
</html>
|
app/design/frontend/base/default/template/innovatepayments/form.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 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 |
+
* @category design_default
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<fieldset class="form-list">
|
21 |
+
<?php $_code=$this->getMethodCode() ?>
|
22 |
+
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
23 |
+
<li>
|
24 |
+
<?php echo Mage::helper('innovatepayments')->__('Details will be taken using the Innovate Payments gateway when you place an order.') ?>
|
25 |
+
</li>
|
26 |
+
</ul>
|
27 |
+
</fieldset>
|
app/design/frontend/base/default/template/innovatepayments/info.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 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 |
+
* @category design_default
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<?php
|
21 |
+
echo $this->getMethod()->getTitle() . '<br/>';
|
22 |
+
if ($this->getInfo()->getLastTransId() == '') {
|
23 |
+
echo '<em>' . Mage::helper('innovatepayments')->__('Details will be taken using the Innovate Payments gateway when you place an order.') . '</em>';
|
24 |
+
} else {
|
25 |
+
echo Mage::helper('innovatepayments')->__('Credit Card Type: %s', $this->htmlEscape($this->getInfo()->getCcType())) . '<br/>';
|
26 |
+
echo Mage::helper('innovatepayments')->__('InnovatePayments Transaction ID: %s', $this->htmlEscape($this->getInfo()->getLastTransId())) . '<br/>';
|
27 |
+
}
|
28 |
+
?>
|
app/design/frontend/base/default/template/innovatepayments/redirect.phtml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @category design_default
|
16 |
+
* @package Innovate_InnovatePayments
|
17 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
18 |
+
*/
|
19 |
+
?>
|
20 |
+
<b><?php echo Mage::helper('innovatepayments')->__('You will now be transferred to Innovate Payments to complete the transaction.'); ?></b>
|
21 |
+
<form name="innovate_form" id="innovate_form" action="<?php echo $this->getFormAction();?>" method="POST">
|
22 |
+
<?php foreach ($this->getFormData() as $name => $value): ?>
|
23 |
+
<input type="hidden" name="<?php echo $name; ?>" <?php if (!is_null($value)) { echo 'value="'.htmlspecialchars($value). '"'; } ?> />
|
24 |
+
<?php endforeach; ?>
|
25 |
+
</form>
|
26 |
+
|
27 |
+
<script type="text/javascript">
|
28 |
+
//<![CDATA[
|
29 |
+
var paymentform = document.getElementById('innovate_form');
|
30 |
+
window.onload = paymentform.submit();
|
31 |
+
//]]>
|
32 |
+
</script>
|
app/etc/modules/Innovate_InnovatePayments.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Innovate
|
17 |
+
* @package Innovate_InnovatePayments
|
18 |
+
* @copyright Copyright (c) 2011 Innovate Payments (http://www.innovatepayments.com/)
|
19 |
+
*/
|
20 |
+
-->
|
21 |
+
<config>
|
22 |
+
<modules>
|
23 |
+
<Innovate_InnovatePayments>
|
24 |
+
<active>true</active>
|
25 |
+
<codePool>community</codePool>
|
26 |
+
</Innovate_InnovatePayments>
|
27 |
+
</modules>
|
28 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>InnovatePayments</name>
|
4 |
+
<version>1.2.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Add the Innovate Payments Gateway as a supported payment method.</summary>
|
10 |
+
<description>This extension will allow you to use the Innovate Payments Gateway to process orders from your store.</description>
|
11 |
+
<notes>The full details of the transaction, including the billing and delivery information, are sent to the gateway for processing using the Hosted Payment pages.
|
12 |
+

|
13 |
+
</notes>
|
14 |
+
<authors><author><name>Innovate Payments</name><user>innopay</user><email>support@innovatepayments.com</email></author></authors>
|
15 |
+
<date>2012-06-16</date>
|
16 |
+
<time>15:06:36</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Innovate"><dir name="InnovatePayments"><dir name="Block"><file name="Cancel.php" hash="0c6315ec2414c0c5b332d3b2211fdc41"/><file name="Failure.php" hash="5c016b0c48406bc21a49560220cfa88d"/><file name="Form.php" hash="a91945ba5dc0c9d9da118a809f136f7c"/><file name="Info.php" hash="560ca34f80f08e0f333cfe32ef9ccdbd"/><file name="Redirect.php" hash="8b66e3068ac2caf7c7095c0f4644ade9"/><file name="Success.php" hash="9a78eefe30c4ca361a5169c0d157e39a"/></dir><dir name="Helper"><file name="Data.php" hash="50501bf1afa3461d94f27bed16b828b0"/></dir><dir name="Model"><file name="Cc.php" hash="e9496806adf6f6d4753666c8de4944d5"/><dir name="Source"><file name="RequestType.php" hash="1782ce00c256f5d2483e4d39d079d521"/></dir></dir><dir name="controllers"><file name="ProcessingController.php" hash="776a8774704dbb0e5b4eac4be7ddc4b9"/></dir><dir name="etc"><file name="config.xml" hash="08b59203abb1bfbc91987997a6cc9e70"/><file name="system.xml" hash="7603389f75a2a668b38b0087b9897540"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="innovatepayments.xml" hash="899282c045188750cdb0a26e32bef854"/></dir><dir name="template"><dir name="innovatepayments"><file name="blank.phtml" hash="f41b2c40b289f90460380b269d8889f4"/><file name="cancel.phtml" hash="f1da4d782fb5adb701911f2f83a94934"/><file name="failure.phtml" hash="5b86357569ed153b766cdade25234d31"/><file name="form.phtml" hash="8dfa67e66faa865bb8454034d379c124"/><file name="info.phtml" hash="24ae8cd54f8dca95c8a4cf88f7678f7f"/><file name="redirect.phtml" hash="e498ede8c08ba5a44f80aa03f9d84ebd"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="innovatepayments"><file name="info.phtml" hash="4913c1db96c6019d2e25f03b3b0b3359"/><dir name="pdf"><file name="info.phtml" hash="b44d58e88b30a95051f576f2abb0e040"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Innovate_InnovatePayments.xml" hash="3f7ad0b6f40c6cf0f90486b79d2bdbce"/></dir></target></contents>
|
18 |
+
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
+
</package>
|