Version Notes
Download this release
Release Info
Developer | Fontis |
Extension | Fontis_EwayAu |
Version | 1.3.0 |
Comparing to | |
See all releases |
Code changes from version 1.2.5 to 1.3.0
- app/code/community/Fontis/EwayAu/Block/Cc/Form.php +27 -0
- app/code/community/Fontis/EwayAu/Block/{Info.php → Cc/Info.php} +10 -11
- app/code/community/Fontis/EwayAu/Block/Failure.php +39 -0
- app/code/community/Fontis/EwayAu/Block/Form.php +11 -10
- app/code/community/Fontis/EwayAu/Block/Redirect.php +70 -0
- app/code/community/Fontis/EwayAu/Block/Secure/Failure.php +6 -25
- app/code/community/Fontis/EwayAu/Block/Secure/Form.php +8 -12
- app/code/community/Fontis/EwayAu/Block/Secure/Redirect.php +34 -25
- app/code/community/Fontis/EwayAu/Block/Shared/Failure.php +8 -21
- app/code/community/Fontis/EwayAu/Block/Shared/Form.php +8 -12
- app/code/community/Fontis/EwayAu/Block/Shared/Redirect.php +34 -26
- app/code/community/Fontis/EwayAu/Block/System/Config/Test/Login.php +72 -0
- app/code/community/Fontis/EwayAu/Block/System/Config/Test/Login/Token.php +27 -0
- app/code/community/Fontis/EwayAu/Controller/Abstract.php +25 -23
- app/code/community/Fontis/EwayAu/Helper/Data.php +45 -7
- app/code/community/Fontis/EwayAu/Helper/Token.php +114 -0
- app/code/community/Fontis/EwayAu/LICENSE.txt +48 -0
- app/code/community/Fontis/EwayAu/Model/Direct.php +443 -171
- app/code/community/Fontis/EwayAu/Model/Sales/Object.php +44 -0
- app/code/community/Fontis/EwayAu/Model/Secure.php +6 -8
- app/code/community/Fontis/EwayAu/Model/Shared.php +77 -50
- app/code/community/Fontis/EwayAu/Model/Source/Cctype.php +7 -7
- app/code/community/Fontis/EwayAu/Model/Source/PaymentAction.php +38 -0
- app/code/community/Fontis/EwayAu/Model/Token.php +470 -0
- app/code/community/Fontis/EwayAu/Model/Token/Request.php +198 -0
- app/code/community/Fontis/EwayAu/Model/Token/Request/Data.php +337 -0
- app/code/community/Fontis/EwayAu/Model/Token/Response.php +63 -0
- app/code/community/Fontis/EwayAu/Model/Token/Response/CreateCustomer.php +35 -0
- app/code/community/Fontis/EwayAu/Model/Token/Response/ProcessPayment.php +37 -0
- app/code/community/Fontis/EwayAu/Model/Token/Response/QueryCustomerByReference.php +37 -0
- app/code/community/Fontis/EwayAu/Model/Token/Response/UpdateCustomer.php +34 -0
- app/code/community/Fontis/EwayAu/controllers/SecureController.php +7 -8
- app/code/community/Fontis/EwayAu/controllers/SharedController.php +7 -5
- app/code/community/Fontis/EwayAu/controllers/System/Config/Test/LoginController.php +81 -0
- app/code/community/Fontis/EwayAu/etc/config.xml +43 -11
- app/code/community/Fontis/EwayAu/etc/system.xml +215 -55
- app/code/community/Fontis/EwayAu/sql/eway_setup/mysql4-install-0.1.0.php +5 -8
- app/design/adminhtml/default/default/template/fontis/ewayau/cc/form.phtml +88 -0
- app/design/adminhtml/default/default/template/fontis/ewayau/cc/info.phtml +30 -0
- app/design/adminhtml/default/default/template/fontis/ewayau/cc/pdf/info.phtml +33 -0
- app/design/adminhtml/default/default/template/fontis/ewayau/form.phtml +0 -78
- app/design/adminhtml/default/default/template/fontis/ewayau/info.phtml +0 -26
- app/design/adminhtml/default/default/template/fontis/ewayau/pdf/info.phtml +0 -29
- app/design/adminhtml/default/default/template/fontis/ewayau/test/login.phtml +55 -0
- app/design/frontend/base/default/template/fontis/ewayau/cc/form.phtml +85 -0
- app/design/frontend/base/default/template/fontis/ewayau/cc/info.phtml +26 -0
- app/design/frontend/base/default/template/fontis/ewayau/failure.phtml +25 -0
- app/design/frontend/{default/default/template/fontis/ewayau/shared → base/default/template/fontis/ewayau/secure}/form.phtml +8 -10
- app/design/frontend/{default/default/template/fontis/ewayau/secure → base/default/template/fontis/ewayau/shared}/form.phtml +8 -10
- app/design/frontend/default/default/layout/fontis_ewayau.xml +0 -45
- app/design/frontend/default/default/template/fontis/ewayau/form.phtml +0 -86
- app/design/frontend/default/default/template/fontis/ewayau/info.phtml +0 -30
- app/design/frontend/default/default/template/fontis/ewayau/secure/failure.phtml +0 -27
- app/design/frontend/default/default/template/fontis/ewayau/shared/failure.phtml +0 -27
- app/etc/modules/Fontis_EwayAu.xml +5 -7
- app/locale/en_AU/Fontis_EwayAu.csv +38 -0
- app/locale/en_US/Fontis_EwayAu.csv +1 -1
- package.xml +9 -9
- skin/adminhtml/default/default/fontis/ewayau/css/styles.css +35 -0
app/code/community/Fontis/EwayAu/Block/Cc/Form.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Fontis_EwayAu_Block_Cc_Form extends Mage_Payment_Block_Form_Cc
|
21 |
+
{
|
22 |
+
protected function _construct()
|
23 |
+
{
|
24 |
+
parent::_construct();
|
25 |
+
$this->setTemplate('fontis/ewayau/cc/form.phtml');
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Fontis/EwayAu/Block/{Info.php → Cc/Info.php}
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,30 +8,29 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
-
class
|
24 |
{
|
25 |
protected function _construct()
|
26 |
{
|
27 |
parent::_construct();
|
28 |
-
$this->setTemplate('fontis/ewayau/info.phtml');
|
29 |
}
|
30 |
|
|
|
|
|
|
|
31 |
public function toPdf()
|
32 |
{
|
33 |
-
$this->setTemplate('fontis/ewayau/pdf/info.phtml');
|
34 |
return $this->toHtml();
|
35 |
}
|
36 |
-
|
37 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
20 |
+
class Fontis_EwayAu_Block_Cc_Info extends Mage_Payment_Block_Info_Cc
|
21 |
{
|
22 |
protected function _construct()
|
23 |
{
|
24 |
parent::_construct();
|
25 |
+
$this->setTemplate('fontis/ewayau/cc/info.phtml');
|
26 |
}
|
27 |
|
28 |
+
/**
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
public function toPdf()
|
32 |
{
|
33 |
+
$this->setTemplate('fontis/ewayau/cc/pdf/info.phtml');
|
34 |
return $this->toHtml();
|
35 |
}
|
|
|
36 |
}
|
app/code/community/Fontis/EwayAu/Block/Failure.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
|
20 |
+
abstract class Fontis_EwayAu_Block_Failure extends Mage_Core_Block_Template
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* @return string
|
24 |
+
*/
|
25 |
+
public function getErrorMessage()
|
26 |
+
{
|
27 |
+
$msg = Mage::getSingleton('checkout/session')->getEwayErrorMessage();
|
28 |
+
Mage::getSingleton('checkout/session')->unsEwayErrorMessage();
|
29 |
+
return $msg;
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @return string
|
34 |
+
*/
|
35 |
+
public function getContinueShoppingUrl()
|
36 |
+
{
|
37 |
+
return Mage::helper('checkout')->getCartUrl();
|
38 |
+
}
|
39 |
+
}
|
app/code/community/Fontis/EwayAu/Block/Form.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,24 +8,25 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
-
class Fontis_EwayAu_Block_Form extends
|
24 |
{
|
|
|
|
|
|
|
|
|
|
|
25 |
protected function _construct()
|
26 |
{
|
27 |
parent::_construct();
|
28 |
-
$this->setTemplate('fontis/ewayau/
|
29 |
}
|
30 |
-
|
31 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
20 |
+
class Fontis_EwayAu_Block_Form extends Mage_Payment_Block_Form
|
21 |
{
|
22 |
+
/**
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
protected $_formTemplate;
|
26 |
+
|
27 |
protected function _construct()
|
28 |
{
|
29 |
parent::_construct();
|
30 |
+
$this->setTemplate('fontis/ewayau/' . $this->_formTemplate);
|
31 |
}
|
|
|
32 |
}
|
app/code/community/Fontis/EwayAu/Block/Redirect.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
13 |
+
*
|
14 |
+
* @category Fontis
|
15 |
+
* @package Fontis_EwayAu
|
16 |
+
* @author Chris Norton
|
17 |
+
* @author Matthew Gamble
|
18 |
+
* @copyright Copyright (c) 2014 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 |
+
/**
|
23 |
+
* @method Mage_Sales_Model_Order getOrder()
|
24 |
+
*/
|
25 |
+
abstract class Fontis_EwayAu_Block_Redirect extends Mage_Core_Block_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
protected $_formId;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @var string
|
34 |
+
*/
|
35 |
+
protected $_redirectlabel;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @return string
|
39 |
+
*/
|
40 |
+
protected function _toHtml()
|
41 |
+
{
|
42 |
+
$form = new Varien_Data_Form();
|
43 |
+
$form->setAction($this->getRedirectUrl())
|
44 |
+
->setId($this->_formId)
|
45 |
+
->setName($this->_formId)
|
46 |
+
->setMethod('POST')
|
47 |
+
->setUseContainer(true);
|
48 |
+
foreach ($this->getFormData() as $field => $value) {
|
49 |
+
$form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
|
50 |
+
}
|
51 |
+
|
52 |
+
$html = '<html><body>';
|
53 |
+
$html.= $this->__('You will be redirected to %s in a few seconds.', $this->_redirectlabel);
|
54 |
+
$html.= $form->toHtml();
|
55 |
+
$html.= '<script type="text/javascript">document.getElementById("' . $this->_formId . '").submit();</script>';
|
56 |
+
$html.= '</body></html>';
|
57 |
+
|
58 |
+
return $html;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* @return string
|
63 |
+
*/
|
64 |
+
abstract protected function getRedirectUrl();
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @return array
|
68 |
+
*/
|
69 |
+
abstract protected function getFormData();
|
70 |
+
}
|
app/code/community/Fontis/EwayAu/Block/Secure/Failure.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,35 +8,16 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
-
class Fontis_EwayAu_Block_Secure_Failure extends
|
24 |
{
|
25 |
-
|
26 |
-
* Return Error message
|
27 |
-
*
|
28 |
-
* @return string
|
29 |
-
*/
|
30 |
-
public function getErrorMessage ()
|
31 |
-
{
|
32 |
-
return Mage::getSingleton('checkout/session')->getEwayErrorMessage();
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Get continue shopping url
|
37 |
-
*/
|
38 |
-
public function getContinueShoppingUrl()
|
39 |
-
{
|
40 |
-
return Mage::getUrl('checkout/cart');
|
41 |
-
}
|
42 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
20 |
+
class Fontis_EwayAu_Block_Secure_Failure extends Fontis_EwayAu_Block_Failure
|
21 |
{
|
22 |
+
// Concrete version of the abstract class.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
app/code/community/Fontis/EwayAu/Block/Secure/Form.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,23 +8,19 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
class Fontis_EwayAu_Block_Secure_Form extends Mage_Payment_Block_Form
|
24 |
{
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
}
|
30 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
20 |
class Fontis_EwayAu_Block_Secure_Form extends Mage_Payment_Block_Form
|
21 |
{
|
22 |
+
/**
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
protected $_formTemplate = 'secure/form.phtml';
|
|
|
26 |
}
|
app/code/community/Fontis/EwayAu/Block/Secure/Redirect.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,39 +8,48 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
-
class Fontis_EwayAu_Block_Secure_Redirect extends
|
24 |
{
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
{
|
27 |
-
|
|
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
|
37 |
-
}
|
38 |
-
$html = '<html><body>';
|
39 |
-
$html.= $this->__('You will be redirected to eWAY 3D-Secure in a few seconds.');
|
40 |
-
$html.= $form->toHtml();
|
41 |
-
$html.= '<script type="text/javascript">document.getElementById("ewayau_secure_checkout").submit();</script>';
|
42 |
-
$html.= '</body></html>';
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
20 |
+
class Fontis_EwayAu_Block_Secure_Redirect extends Fontis_EwayAu_Block_Redirect
|
21 |
{
|
22 |
+
/**
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
protected $_formId = 'eway_secure_checkout';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
protected $_redirectlabel = 'eWAY 3D-Secure';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @return Fontis_EwayAu_Model_Secure
|
34 |
+
*/
|
35 |
+
protected function getMethodInstance()
|
36 |
{
|
37 |
+
return $this->getOrder()->getPayment()->getMethodInstance();
|
38 |
+
}
|
39 |
|
40 |
+
/**
|
41 |
+
* @return string
|
42 |
+
*/
|
43 |
+
protected function getRedirectUrl()
|
44 |
+
{
|
45 |
+
return $this->getMethodInstance()->getEwaySecureUrl();
|
46 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
/**
|
49 |
+
* @return array
|
50 |
+
*/
|
51 |
+
protected function getFormData()
|
52 |
+
{
|
53 |
+
return $this->getMethodInstance()->getFormFields();
|
54 |
}
|
55 |
}
|
app/code/community/Fontis/EwayAu/Block/Shared/Failure.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,37 +8,24 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
-
class Fontis_EwayAu_Block_Shared_Failure extends
|
24 |
{
|
25 |
/**
|
26 |
-
*
|
27 |
-
*
|
28 |
-
* @return string
|
29 |
*/
|
30 |
-
public function getErrorMessage
|
31 |
{
|
32 |
-
$msg =
|
33 |
Mage::getSingleton('checkout/session')->unsEwayErrorMessage();
|
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 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
20 |
+
class Fontis_EwayAu_Block_Shared_Failure extends Fontis_EwayAu_Block_Failure
|
21 |
{
|
22 |
/**
|
23 |
+
* @return string
|
|
|
|
|
24 |
*/
|
25 |
+
public function getErrorMessage()
|
26 |
{
|
27 |
+
$msg = parent::getErrorMessage();
|
28 |
Mage::getSingleton('checkout/session')->unsEwayErrorMessage();
|
29 |
return $msg;
|
30 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
app/code/community/Fontis/EwayAu/Block/Shared/Form.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,23 +8,19 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
class Fontis_EwayAu_Block_Shared_Form extends Mage_Payment_Block_Form
|
24 |
{
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
}
|
30 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
20 |
class Fontis_EwayAu_Block_Shared_Form extends Mage_Payment_Block_Form
|
21 |
{
|
22 |
+
/**
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
protected $_formTemplate = 'shared/form.phtml';
|
|
|
26 |
}
|
app/code/community/Fontis/EwayAu/Block/Shared/Redirect.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,40 +8,48 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
-
class Fontis_EwayAu_Block_Shared_Redirect extends
|
24 |
{
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
44 |
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
20 |
+
class Fontis_EwayAu_Block_Shared_Redirect extends Fontis_EwayAu_Block_Redirect
|
21 |
{
|
22 |
+
/**
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
protected $_formId = 'ewayau_shared_checkout';
|
26 |
|
27 |
+
/**
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
protected $_redirectlabel = 'eWAY';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @return Fontis_EwayAu_Model_Shared
|
34 |
+
*/
|
35 |
+
protected function getMethodInstance()
|
36 |
+
{
|
37 |
+
return $this->getOrder()->getPayment()->getMethodInstance();
|
38 |
+
}
|
39 |
|
40 |
+
/**
|
41 |
+
* @return string
|
42 |
+
*/
|
43 |
+
protected function getRedirectUrl()
|
44 |
+
{
|
45 |
+
return $this->getMethodInstance()->getEwaySharedUrl();
|
46 |
+
}
|
47 |
|
48 |
+
/**
|
49 |
+
* @return array
|
50 |
+
*/
|
51 |
+
protected function getFormData()
|
52 |
+
{
|
53 |
+
return $this->getMethodInstance()->getFormFields();
|
54 |
}
|
55 |
}
|
app/code/community/Fontis/EwayAu/Block/System/Config/Test/Login.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
|
20 |
+
abstract class Fontis_EwayAu_Block_System_Config_Test_Login extends Mage_Adminhtml_Block_System_Config_Form_Field
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
protected $_method;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Prepares the layout for the login test button
|
29 |
+
*
|
30 |
+
* Sets the template to use the one to generate the test button markup
|
31 |
+
*
|
32 |
+
* @return Fontis_EwayAu_Block_System_Config_Test_Login
|
33 |
+
*/
|
34 |
+
protected function _prepareLayout()
|
35 |
+
{
|
36 |
+
parent::_prepareLayout();
|
37 |
+
$this->setTemplate('fontis/ewayau/test/login.phtml');
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Generates the Html content for the test button
|
44 |
+
*
|
45 |
+
* This is called by core magento and needs to be here otherwise the button will not generate
|
46 |
+
*
|
47 |
+
* @param Varien_Data_Form_Element_Abstract $element The Magento form element (in this case the button)
|
48 |
+
* @return string The Html content
|
49 |
+
*/
|
50 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
51 |
+
{
|
52 |
+
return $this->_toHtml();
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Returns the URL that will hit the controller that handles testing the eWay API
|
57 |
+
*
|
58 |
+
* @return string The URL of the test controller
|
59 |
+
*/
|
60 |
+
public function getTestUrl()
|
61 |
+
{
|
62 |
+
return Mage::getSingleton('adminhtml/url')->getUrl('*/system_config_test_login/test' . ucfirst($this->_method));
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @return string
|
67 |
+
*/
|
68 |
+
public function getMethod()
|
69 |
+
{
|
70 |
+
return $this->_method;
|
71 |
+
}
|
72 |
+
}
|
app/code/community/Fontis/EwayAu/Block/System/Config/Test/Login/Token.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Fontis_EwayAu_Block_System_Config_Test_Login_Token extends Fontis_EwayAu_Block_System_Config_Test_Login
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var string
|
25 |
+
*/
|
26 |
+
protected $_method = 'token';
|
27 |
+
}
|
app/code/community/Fontis/EwayAu/Controller/Abstract.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,34 +8,34 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
abstract class Fontis_EwayAu_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 |
*
|
@@ -47,7 +47,7 @@ abstract class Fontis_EwayAu_Controller_Abstract extends Mage_Core_Controller_Fr
|
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
-
*
|
51 |
*/
|
52 |
public function redirectAction()
|
53 |
{
|
@@ -55,6 +55,7 @@ abstract class Fontis_EwayAu_Controller_Abstract extends Mage_Core_Controller_Fr
|
|
55 |
$session->setEwayQuoteId($session->getQuoteId());
|
56 |
$session->setEwayRealOrderId($session->getLastRealOrderId());
|
57 |
|
|
|
58 |
$order = Mage::getModel('sales/order');
|
59 |
$order->loadByIncrementId($session->getLastRealOrderId());
|
60 |
$order->addStatusToHistory($order->getStatus(), Mage::helper('ewayau')->__('Customer was redirected to eWAY.'));
|
@@ -73,7 +74,7 @@ abstract class Fontis_EwayAu_Controller_Abstract extends Mage_Core_Controller_Fr
|
|
73 |
/**
|
74 |
* eWay returns POST variables to this action
|
75 |
*/
|
76 |
-
public function
|
77 |
{
|
78 |
$status = $this->_checkReturnedPost();
|
79 |
|
@@ -83,9 +84,10 @@ abstract class Fontis_EwayAu_Controller_Abstract extends Mage_Core_Controller_Fr
|
|
83 |
$session->setQuoteId($session->getEwayQuoteId(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 |
|
@@ -98,7 +100,6 @@ abstract class Fontis_EwayAu_Controller_Abstract extends Mage_Core_Controller_Fr
|
|
98 |
|
99 |
/**
|
100 |
* Display failure page if error
|
101 |
-
*
|
102 |
*/
|
103 |
public function failureAction()
|
104 |
{
|
@@ -121,17 +122,20 @@ abstract class Fontis_EwayAu_Controller_Abstract extends Mage_Core_Controller_Fr
|
|
121 |
{
|
122 |
if (!$this->getRequest()->isPost()) {
|
123 |
$this->norouteAction();
|
124 |
-
return;
|
125 |
}
|
|
|
126 |
$status = true;
|
127 |
$response = $this->getRequest()->getPost();
|
|
|
128 |
|
129 |
-
if ($
|
130 |
-
|
131 |
$this->norouteAction();
|
132 |
-
return;
|
133 |
}
|
134 |
|
|
|
135 |
$order = Mage::getModel('sales/order');
|
136 |
$order->loadByIncrementId($response['ewayTrxnNumber']);
|
137 |
|
@@ -139,7 +143,6 @@ abstract class Fontis_EwayAu_Controller_Abstract extends Mage_Core_Controller_Fr
|
|
139 |
$paymentInst->setResponse($response);
|
140 |
|
141 |
if ($paymentInst->parseResponse()) {
|
142 |
-
|
143 |
if ($order->canInvoice()) {
|
144 |
$invoice = $order->prepareInvoice();
|
145 |
$invoice->register()->capture();
|
@@ -158,12 +161,11 @@ abstract class Fontis_EwayAu_Controller_Abstract extends Mage_Core_Controller_Fr
|
|
158 |
$order->cancel();
|
159 |
$order->addStatusToHistory($order->getStatus(), Mage::helper('ewayau')->__('Customer was rejected by eWAY'));
|
160 |
$status = false;
|
161 |
-
$
|
162 |
}
|
163 |
|
164 |
$order->save();
|
165 |
|
166 |
return $status;
|
167 |
}
|
168 |
-
|
169 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
13 |
*
|
14 |
* @category Fontis
|
15 |
* @package Fontis_EwayAu
|
16 |
+
* @author Chris Norton
|
17 |
+
* @author Matthew Gamble
|
18 |
+
* @copyright Copyright (c) 2014 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 |
abstract class Fontis_EwayAu_Controller_Abstract extends Mage_Core_Controller_Front_Action
|
23 |
{
|
24 |
+
/**
|
25 |
+
* Redirect Block
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
protected $_redirectBlockType;
|
30 |
+
|
31 |
protected function _expireAjax()
|
32 |
{
|
33 |
if (!$this->getCheckout()->getQuote()->hasItems()) {
|
34 |
+
$this->getResponse()->setHeader('HTTP/1.1', '403 Session Expired');
|
35 |
exit;
|
36 |
}
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
/**
|
40 |
* Get singleton of Checkout Session Model
|
41 |
*
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
+
* When customer selects eWay payment method
|
51 |
*/
|
52 |
public function redirectAction()
|
53 |
{
|
55 |
$session->setEwayQuoteId($session->getQuoteId());
|
56 |
$session->setEwayRealOrderId($session->getLastRealOrderId());
|
57 |
|
58 |
+
/** @var $order Mage_Sales_Model_Order */
|
59 |
$order = Mage::getModel('sales/order');
|
60 |
$order->loadByIncrementId($session->getLastRealOrderId());
|
61 |
$order->addStatusToHistory($order->getStatus(), Mage::helper('ewayau')->__('Customer was redirected to eWAY.'));
|
74 |
/**
|
75 |
* eWay returns POST variables to this action
|
76 |
*/
|
77 |
+
public function successAction()
|
78 |
{
|
79 |
$status = $this->_checkReturnedPost();
|
80 |
|
84 |
$session->setQuoteId($session->getEwayQuoteId(true));
|
85 |
$session->getQuote()->setIsActive(false)->save();
|
86 |
|
87 |
+
/** @var $order Mage_Sales_Model_Order */
|
88 |
$order = Mage::getModel('sales/order');
|
89 |
$order->load($this->getCheckout()->getLastOrderId());
|
90 |
+
if ($order->getId()) {
|
91 |
$order->sendNewOrderEmail();
|
92 |
}
|
93 |
|
100 |
|
101 |
/**
|
102 |
* Display failure page if error
|
|
|
103 |
*/
|
104 |
public function failureAction()
|
105 |
{
|
122 |
{
|
123 |
if (!$this->getRequest()->isPost()) {
|
124 |
$this->norouteAction();
|
125 |
+
return false;
|
126 |
}
|
127 |
+
|
128 |
$status = true;
|
129 |
$response = $this->getRequest()->getPost();
|
130 |
+
$checkout = $this->getCheckout();
|
131 |
|
132 |
+
if ($checkout->getEwayRealOrderId() != $response['ewayTrxnNumber'] ||
|
133 |
+
$checkout->getEwayRealOrderId() != Mage::helper('core')->decrypt($response['eWAYoption2'])) {
|
134 |
$this->norouteAction();
|
135 |
+
return false;
|
136 |
}
|
137 |
|
138 |
+
/** @var $order Mage_Sales_Model_Order */
|
139 |
$order = Mage::getModel('sales/order');
|
140 |
$order->loadByIncrementId($response['ewayTrxnNumber']);
|
141 |
|
143 |
$paymentInst->setResponse($response);
|
144 |
|
145 |
if ($paymentInst->parseResponse()) {
|
|
|
146 |
if ($order->canInvoice()) {
|
147 |
$invoice = $order->prepareInvoice();
|
148 |
$invoice->register()->capture();
|
161 |
$order->cancel();
|
162 |
$order->addStatusToHistory($order->getStatus(), Mage::helper('ewayau')->__('Customer was rejected by eWAY'));
|
163 |
$status = false;
|
164 |
+
$checkout->setEwayErrorMessage($response['eWAYresponseText']);
|
165 |
}
|
166 |
|
167 |
$order->save();
|
168 |
|
169 |
return $status;
|
170 |
}
|
|
|
171 |
}
|
app/code/community/Fontis/EwayAu/Helper/Data.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,19 +8,57 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
class Fontis_EwayAu_Helper_Data extends Mage_Core_Helper_Abstract
|
24 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
20 |
class Fontis_EwayAu_Helper_Data extends Mage_Core_Helper_Abstract
|
21 |
{
|
22 |
+
const DEFAULT_TIMEOUT = 30;
|
23 |
+
|
24 |
+
const ERROR_MSG_DONOTHONOUR = '05,do not honour';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @param Mage_Sales_Model_Order_Address $billing
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
public function getOrderAddressString($billing)
|
31 |
+
{
|
32 |
+
$address = clone $billing;
|
33 |
+
$address->unsFirstname();
|
34 |
+
$address->unsLastname();
|
35 |
+
$address->unsPostcode();
|
36 |
+
|
37 |
+
// Strip blank lines from the address
|
38 |
+
$tmpAddress = preg_replace('/^\n+|^[\t\s]*\n+/m', '', trim($address->format('text')));
|
39 |
+
return str_replace("\n", ' ', $tmpAddress);
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @param Fontis_EwayAu_Model_Sales_Object $salesObject
|
44 |
+
* @param int $limit Soft maximum limit on description length.
|
45 |
+
* @return string
|
46 |
+
*/
|
47 |
+
public function getInvoiceDescription($salesObject, $limit = 255)
|
48 |
+
{
|
49 |
+
/** @var $stringHelper Mage_Core_Helper_String */
|
50 |
+
$stringHelper = Mage::helper('core/string');
|
51 |
|
52 |
+
$invoiceDesc = '';
|
53 |
+
foreach ($salesObject->getAllItems() as $item) {
|
54 |
+
if ($item->getParentItem()) {
|
55 |
+
continue;
|
56 |
+
}
|
57 |
+
if ($stringHelper->strlen($invoiceDesc . $item->getName()) > $limit) {
|
58 |
+
break;
|
59 |
+
}
|
60 |
+
$invoiceDesc .= $item->getName() . ', ';
|
61 |
+
}
|
62 |
+
return $stringHelper->substr($invoiceDesc, 0, -2);
|
63 |
+
}
|
64 |
}
|
app/code/community/Fontis/EwayAu/Helper/Token.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Fontis_EwayAu_Helper_Token extends Mage_Core_Helper_Data
|
22 |
+
{
|
23 |
+
const CUSTOMER_ID_FIELD = 'ewayau_token_customer_id';
|
24 |
+
|
25 |
+
const LOG_FILE = 'ewayau_token.log';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @param int $storeId
|
29 |
+
* @return bool
|
30 |
+
*/
|
31 |
+
public function isLogEnabled($storeId = null)
|
32 |
+
{
|
33 |
+
return Mage::getStoreConfigFlag('payment/ewayau_token/debug', $storeId);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @param string $message
|
38 |
+
*/
|
39 |
+
public function logMessage($message, $data = null)
|
40 |
+
{
|
41 |
+
if ($this->isLogEnabled() === true) {
|
42 |
+
if ($data !== null) {
|
43 |
+
$message = Zend_Debug::dump($data, $message, false);
|
44 |
+
}
|
45 |
+
Mage::log($message, null, self::LOG_FILE);
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @return string
|
51 |
+
*/
|
52 |
+
public function getCustomerId()
|
53 |
+
{
|
54 |
+
return Mage::getSingleton("checkout/session")->getData(self::CUSTOMER_ID_FIELD);
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @param string $customerId
|
59 |
+
*/
|
60 |
+
public function setCustomerId($customerId)
|
61 |
+
{
|
62 |
+
return Mage::getSingleton("checkout/session")->setData(self::CUSTOMER_ID_FIELD, $customerId);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @return Mage_Checkout_Model_Session
|
67 |
+
*/
|
68 |
+
public function clearCustomerId()
|
69 |
+
{
|
70 |
+
return Mage::getSingleton("checkout/session")->unsetData(self::CUSTOMER_ID_FIELD);
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Verify if the partially eWAY returned credit card number matches inputted value.
|
75 |
+
*
|
76 |
+
* @param string $new
|
77 |
+
* @param string $stored
|
78 |
+
* @return bool
|
79 |
+
*/
|
80 |
+
public function hasCreditCardNumberChanged($new, $stored)
|
81 |
+
{
|
82 |
+
if (strstr($stored, 'XXXXXX')) {
|
83 |
+
$numbersToValidate = explode('XXXXXX', $stored);
|
84 |
+
|
85 |
+
$newFirstSix = substr($new, 0, 6);
|
86 |
+
$newLastFour = substr($new, -4);
|
87 |
+
|
88 |
+
if ($numbersToValidate[0] == $newFirstSix && $numbersToValidate[1] == $newLastFour) {
|
89 |
+
return false;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
return true;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* @param int $month
|
98 |
+
* @param int $year
|
99 |
+
* @return bool
|
100 |
+
*/
|
101 |
+
public function hasCreditCardExpired($month, $year)
|
102 |
+
{
|
103 |
+
/** @var $dateModel Mage_Core_Model_Date */
|
104 |
+
$dateModel = Mage::getModel('core/date');
|
105 |
+
$currentDate = (int) $dateModel->gmtTimestamp();
|
106 |
+
$cardExpiry = (int) $dateModel->gmtTimestamp(mktime(0, 0, 0, $month, $year));
|
107 |
+
|
108 |
+
if ($currentDate > $cardExpiry) {
|
109 |
+
return true;
|
110 |
+
}
|
111 |
+
|
112 |
+
return false;
|
113 |
+
}
|
114 |
+
}
|
app/code/community/Fontis/EwayAu/LICENSE.txt
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Open Software License ("OSL") v. 3.0
|
2 |
+
====================================
|
3 |
+
|
4 |
+
This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
|
5 |
+
|
6 |
+
Licensed under the Open Software License version 3.0
|
7 |
+
|
8 |
+
1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
|
9 |
+
|
10 |
+
a) to reproduce the Original Work in copies, either alone or as part of a collective work;
|
11 |
+
|
12 |
+
b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
|
13 |
+
|
14 |
+
c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
|
15 |
+
|
16 |
+
d) to perform the Original Work publicly; and
|
17 |
+
|
18 |
+
e) to display the Original Work publicly.
|
19 |
+
|
20 |
+
2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
|
21 |
+
|
22 |
+
3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
|
23 |
+
|
24 |
+
4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
|
25 |
+
|
26 |
+
5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
|
27 |
+
|
28 |
+
6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
|
29 |
+
|
30 |
+
7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
|
31 |
+
|
32 |
+
8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
|
33 |
+
|
34 |
+
9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
|
35 |
+
|
36 |
+
10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
|
37 |
+
|
38 |
+
11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
|
39 |
+
|
40 |
+
12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
|
41 |
+
|
42 |
+
13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
|
43 |
+
|
44 |
+
14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
45 |
+
|
46 |
+
15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
|
47 |
+
|
48 |
+
16. Modification of This License. This License is Copyright (c) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
|
app/code/community/Fontis/EwayAu/Model/Direct.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,64 +8,148 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
|
|
|
|
|
|
|
|
23 |
class Fontis_EwayAu_Model_Direct extends Mage_Payment_Model_Method_Cc
|
24 |
{
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
protected $_isGateway = true;
|
28 |
-
protected $_canAuthorize =
|
29 |
protected $_canCapture = true;
|
30 |
protected $_canCapturePartial = false;
|
31 |
protected $_canRefund = true;
|
32 |
-
protected $
|
|
|
33 |
protected $_canUseInternal = true;
|
34 |
protected $_canUseCheckout = true;
|
35 |
protected $_canUseForMultishipping = true;
|
36 |
protected $_canSaveCc = false;
|
37 |
|
38 |
-
protected $_formBlockType = 'ewayau/
|
39 |
-
protected $_infoBlockType = 'ewayau/
|
40 |
|
41 |
/**
|
42 |
-
*
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
45 |
*/
|
46 |
-
|
47 |
{
|
48 |
-
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
-
* Get
|
53 |
*
|
54 |
* @return string
|
55 |
*/
|
56 |
public function getApiGatewayUrl()
|
57 |
{
|
58 |
-
if(
|
59 |
-
return
|
60 |
} else {
|
61 |
-
if($this->
|
62 |
-
return
|
63 |
} else {
|
64 |
-
return
|
65 |
}
|
66 |
}
|
67 |
}
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
/**
|
70 |
* Get Customer Id
|
71 |
*
|
@@ -73,7 +157,7 @@ class Fontis_EwayAu_Model_Direct extends Mage_Payment_Model_Method_Cc
|
|
73 |
*/
|
74 |
public function getCustomerId()
|
75 |
{
|
76 |
-
return
|
77 |
}
|
78 |
|
79 |
/**
|
@@ -83,81 +167,193 @@ class Fontis_EwayAu_Model_Direct extends Mage_Payment_Model_Method_Cc
|
|
83 |
*/
|
84 |
public function getAcceptedCurrency()
|
85 |
{
|
86 |
-
return
|
87 |
}
|
88 |
-
|
|
|
|
|
|
|
89 |
public function getRefundPassword()
|
90 |
{
|
91 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
94 |
public function validate()
|
95 |
{
|
96 |
parent::validate();
|
|
|
97 |
$paymentInfo = $this->getInfoInstance();
|
98 |
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
99 |
-
$
|
100 |
} else {
|
101 |
-
$
|
102 |
}
|
103 |
-
if ($
|
104 |
-
Mage::throwException(
|
105 |
}
|
106 |
return $this;
|
107 |
}
|
108 |
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
{
|
111 |
-
|
112 |
-
->
|
|
|
|
|
|
|
113 |
|
114 |
-
$result = $this->
|
115 |
|
116 |
if ($result === false) {
|
117 |
-
$
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
120 |
} else {
|
121 |
-
|
122 |
}
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
} else {
|
125 |
if ($result['ewayTrxnStatus'] === 'True') {
|
126 |
-
$payment->setStatus(
|
127 |
-
|
128 |
-
|
|
|
|
|
129 |
Mage::throwException($result['ewayTrxnError']);
|
130 |
}
|
131 |
}
|
132 |
return $this;
|
133 |
}
|
134 |
|
|
|
|
|
|
|
|
|
135 |
public function cancel(Varien_Object $payment)
|
136 |
{
|
137 |
-
$payment->setStatus(
|
138 |
return $this;
|
139 |
}
|
140 |
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
142 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
$this->setAmount($amount)->setPayment($payment);
|
144 |
-
|
145 |
-
$result = $this->callDoRefund();
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
} else {
|
152 |
-
|
153 |
}
|
154 |
-
Mage::throwException($message);
|
155 |
}
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
Mage::throwException($result['ewayTrxnError']);
|
162 |
}
|
163 |
}
|
@@ -165,154 +361,181 @@ class Fontis_EwayAu_Model_Direct extends Mage_Payment_Model_Method_Cc
|
|
165 |
}
|
166 |
|
167 |
/**
|
168 |
-
*
|
169 |
-
*
|
170 |
-
* @
|
171 |
*/
|
172 |
-
|
173 |
{
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
foreach ($payment->getOrder()->getAllItems() as $item) {
|
180 |
-
if ($item->getParentItem()) {
|
181 |
-
continue;
|
182 |
-
}
|
183 |
-
if (Mage::helper('core/string')->strlen($invoiceDesc.$item->getName()) > 10000) {
|
184 |
-
break;
|
185 |
}
|
186 |
-
|
187 |
-
|
188 |
-
$invoiceDesc = Mage::helper('core/string')->substr($invoiceDesc, 0, -2);
|
189 |
-
|
190 |
-
$address = clone $billing;
|
191 |
-
$address->unsFirstname();
|
192 |
-
$address->unsLastname();
|
193 |
-
$address->unsPostcode();
|
194 |
-
$formatedAddress = '';
|
195 |
-
$tmpAddress = explode(' ', str_replace("\n", ' ', trim($address->format('text'))));
|
196 |
-
foreach ($tmpAddress as $part) {
|
197 |
-
if (strlen($part) > 0) $formatedAddress .= $part . ' ';
|
198 |
}
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
// Build the XML request
|
201 |
$xml = new SimpleXMLElement('<ewaygateway></ewaygateway>');
|
202 |
-
|
203 |
-
$xml->addChild('
|
204 |
-
$xml->addChild('
|
205 |
-
$xml->addChild('
|
206 |
-
$xml->addChild('
|
207 |
-
$xml->addChild('
|
208 |
-
$xml->addChild('
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
$xml->addChild('ewayTrxnNumber', '');
|
210 |
-
|
211 |
-
$xml->addChild('ewayCustomerFirstName', str_replace('&', '&', trim( $billing->getFirstname() ) ) );
|
212 |
-
$xml->addChild('ewayCustomerLastName', str_replace('&', '&', trim( $billing->getLastname() ) ) );
|
213 |
-
$xml->addChild('ewayCustomerEmail', str_replace('&', '&', trim($payment->getOrder()->getCustomerEmail() ) ) );
|
214 |
-
$xml->addChild('ewayCustomerAddress', str_replace('&', '&', trim($formatedAddress) ) );
|
215 |
-
$xml->addChild('ewayCustomerPostcode', str_replace('&', '&', trim($billing->getPostcode()) ) );
|
216 |
-
$xml->addChild('ewayCustomerInvoiceRef', $payment->getOrder()->getRealOrderId());
|
217 |
-
|
218 |
-
if ($this->getUseccv()) {
|
219 |
-
$xml->addChild('ewayCVN', $payment->getCcCid() );
|
220 |
-
}
|
221 |
-
|
222 |
$xml->addChild('ewayOption1', '');
|
223 |
$xml->addChild('ewayOption2', '');
|
224 |
$xml->addChild('ewayOption3', '');
|
225 |
|
226 |
-
|
227 |
-
|
228 |
-
$resultArr = $this->call( $xml->asXML() );
|
229 |
-
|
230 |
-
if ($resultArr === false) {
|
231 |
-
return false;
|
232 |
}
|
233 |
|
234 |
-
return $
|
235 |
-
|
236 |
}
|
237 |
-
|
238 |
/**
|
239 |
-
*
|
240 |
-
*
|
241 |
-
* @return
|
242 |
*/
|
243 |
-
|
244 |
{
|
245 |
-
$
|
246 |
-
$
|
247 |
-
|
248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
$xml->addChild('ewayCustomerID', $this->getCustomerId());
|
251 |
-
$xml->addChild('ewayTotalAmount', $this->
|
|
|
252 |
$xml->addChild('ewayCardExpiryMonth', $payment->getCcExpMonth());
|
253 |
-
$xml->addChild('ewayCardExpiryYear',
|
254 |
-
|
255 |
-
$xml->addChild('ewayRefundPassword', $this->getRefundPassword());
|
256 |
-
|
257 |
$xml->addChild('ewayOption1', '');
|
258 |
$xml->addChild('ewayOption2', '');
|
259 |
$xml->addChild('ewayOption3', '');
|
260 |
-
|
261 |
-
$http = new Varien_Http_Adapter_Curl();
|
262 |
-
$config = array('timeout' => 30);
|
263 |
|
264 |
-
$
|
265 |
-
$http->write(Zend_Http_Client::POST, 'https://www.eway.com.au/gateway/xmlpaymentrefund.asp', '1.1', array(), $xml->asXML());
|
266 |
-
$response = $http->read();
|
267 |
|
268 |
-
|
269 |
-
$
|
|
|
270 |
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
|
|
|
|
|
|
|
|
279 |
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
));
|
284 |
-
return false;
|
285 |
-
}
|
286 |
|
287 |
-
|
288 |
-
$this->unsError();
|
289 |
-
return $resultArr;
|
290 |
-
}
|
291 |
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
|
298 |
-
$this->
|
299 |
|
300 |
-
|
|
|
301 |
}
|
302 |
|
303 |
/**
|
304 |
-
* Send
|
305 |
*
|
306 |
* @param string $xml
|
307 |
-
* @
|
|
|
308 |
*/
|
309 |
-
|
310 |
{
|
311 |
$http = new Varien_Http_Adapter_Curl();
|
312 |
-
$config = array('timeout' =>
|
313 |
|
314 |
$http->setConfig($config);
|
315 |
-
$http->write(Zend_Http_Client::POST, $
|
316 |
$response = $http->read();
|
317 |
|
318 |
$response = preg_split('/^\r?$/m', $response, 2);
|
@@ -321,15 +544,15 @@ class Fontis_EwayAu_Model_Direct extends Mage_Payment_Model_Method_Cc
|
|
321 |
if ($http->getErrno()) {
|
322 |
$http->close();
|
323 |
$this->setError(array(
|
324 |
-
'message' => $http->getError()
|
325 |
));
|
326 |
return false;
|
327 |
}
|
328 |
$http->close();
|
329 |
|
330 |
-
if
|
331 |
$this->setError(array(
|
332 |
-
'message' => 'Invalid response from gateway.'
|
333 |
));
|
334 |
return false;
|
335 |
}
|
@@ -341,7 +564,7 @@ class Fontis_EwayAu_Model_Direct extends Mage_Payment_Model_Method_Cc
|
|
341 |
|
342 |
if (isset($parsedResArr['ewayTrxnError'])) {
|
343 |
$this->setError(array(
|
344 |
-
'message' => $parsedResArr['ewayTrxnError']
|
345 |
));
|
346 |
}
|
347 |
|
@@ -349,24 +572,73 @@ class Fontis_EwayAu_Model_Direct extends Mage_Payment_Model_Method_Cc
|
|
349 |
}
|
350 |
|
351 |
/**
|
352 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
353 |
*
|
354 |
* @param string $xmlResponse
|
355 |
* @return array
|
356 |
*/
|
357 |
-
|
358 |
{
|
359 |
$xmlObj = simplexml_load_string($xmlResponse);
|
360 |
|
361 |
-
if($xmlObj === false) {
|
362 |
return false;
|
363 |
}
|
364 |
|
365 |
$newResArr = array();
|
366 |
foreach ($xmlObj as $key => $val) {
|
367 |
-
$newResArr[$key] = (string)$val;
|
368 |
}
|
369 |
|
370 |
return $newResArr;
|
371 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
13 |
*
|
14 |
* @category Fontis
|
15 |
* @package Fontis_EwayAu
|
16 |
+
* @author Chris Norton
|
17 |
+
* @author Matthew Gamble
|
18 |
+
* @copyright Copyright (c) 2014 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 |
+
/**
|
23 |
+
* @method Fontis_EwayAu_Model_Direct setError(array $errorDetails)
|
24 |
+
* @method array getError()
|
25 |
+
*/
|
26 |
class Fontis_EwayAu_Model_Direct extends Mage_Payment_Model_Method_Cc
|
27 |
{
|
28 |
+
const GATEWAY_URL_MAIN = 'https://www.eway.com.au/gateway/xmlpayment.asp';
|
29 |
+
const GATEWAY_URL_CVN = 'https://www.eway.com.au/gateway_cvn/xmlpayment.asp';
|
30 |
+
const GATEWAY_URL_TEST = 'https://www.eway.com.au/gateway/xmltest/testpage.asp';
|
31 |
+
|
32 |
+
const REFUND_URL_MAIN = 'https://www.eway.com.au/gateway/xmlpaymentrefund.asp';
|
33 |
+
const REFUND_URL_TEST = 'https://www.eway.com.au/gateway/xmltest/refund_test.asp';
|
34 |
+
|
35 |
+
const PREAUTH_PAYMENT_URL_MAIN = 'https://www.eway.com.au/gateway/xmlauth.asp';
|
36 |
+
const PREAUTH_PAYMENT_URL_CVN = 'https://www.eway.com.au/gateway_cvn/xmlauth.asp';
|
37 |
+
const PREAUTH_PAYMENT_URL_MAIN_TEST = 'https://www.eway.com.au/gateway/xmltest/authtestpage.asp';
|
38 |
+
const PREAUTH_PAYMENT_URL_CVN_TEST = 'https://www.eway.com.au/gateway_cvn/authtestpage.asp';
|
39 |
+
|
40 |
+
const PREAUTH_COMPLETE_URL_MAIN = 'https://www.eway.com.au/gateway/xmlauthcomplete.asp';
|
41 |
+
const PREAUTH_COMPLETE_URL_TEST = 'https://www.eway.com.au/gateway/xmltest/authcompletetestpage.asp';
|
42 |
+
|
43 |
+
const PREAUTH_VOID_URL_MAIN = 'https://www.eway.com.au/gateway/xmlauthvoid.asp';
|
44 |
+
const PREAUTH_VOID_URL_TEST = 'https://www.eway.com.au/gateway/xmltest/authvoidtestpage.asp';
|
45 |
+
|
46 |
+
protected $_code = 'ewayau_direct';
|
47 |
|
48 |
protected $_isGateway = true;
|
49 |
+
protected $_canAuthorize = true;
|
50 |
protected $_canCapture = true;
|
51 |
protected $_canCapturePartial = false;
|
52 |
protected $_canRefund = true;
|
53 |
+
protected $_canRefundInvoicePartial = true;
|
54 |
+
protected $_canVoid = true;
|
55 |
protected $_canUseInternal = true;
|
56 |
protected $_canUseCheckout = true;
|
57 |
protected $_canUseForMultishipping = true;
|
58 |
protected $_canSaveCc = false;
|
59 |
|
60 |
+
protected $_formBlockType = 'ewayau/cc_form';
|
61 |
+
protected $_infoBlockType = 'ewayau/cc_info';
|
62 |
|
63 |
/**
|
64 |
+
* @var Fontis_EwayAu_Helper_Data
|
65 |
+
*/
|
66 |
+
protected $_ewayHelper = null;
|
67 |
+
|
68 |
+
/**
|
69 |
+
* @return Fontis_EwayAu_Helper_Data
|
70 |
*/
|
71 |
+
protected function getEwayHelper()
|
72 |
{
|
73 |
+
if ($this->_ewayHelper === null) {
|
74 |
+
$this->_ewayHelper = Mage::helper('ewayau');
|
75 |
+
}
|
76 |
+
return $this->_ewayHelper;
|
77 |
}
|
78 |
|
79 |
/**
|
80 |
+
* Get API URL of eWAY Direct payment
|
81 |
*
|
82 |
* @return string
|
83 |
*/
|
84 |
public function getApiGatewayUrl()
|
85 |
{
|
86 |
+
if ($this->getConfigData('test_gateway')) {
|
87 |
+
return self::GATEWAY_URL_TEST;
|
88 |
} else {
|
89 |
+
if ($this->hasVerification()) {
|
90 |
+
return self::GATEWAY_URL_CVN;
|
91 |
} else {
|
92 |
+
return self::GATEWAY_URL_MAIN;
|
93 |
}
|
94 |
}
|
95 |
}
|
96 |
|
97 |
+
/**
|
98 |
+
* @return string
|
99 |
+
*/
|
100 |
+
public function getApiRefundUrl()
|
101 |
+
{
|
102 |
+
if ($this->getConfigData('test_gateway')) {
|
103 |
+
return self::REFUND_URL_TEST;
|
104 |
+
} else {
|
105 |
+
return self::REFUND_URL_MAIN;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* @return string
|
111 |
+
*/
|
112 |
+
public function getApiPreAuthPaymentUrl()
|
113 |
+
{
|
114 |
+
if ($this->getConfigData('test_gateway')) {
|
115 |
+
if ($this->hasVerification()) {
|
116 |
+
return self::PREAUTH_PAYMENT_URL_CVN_TEST;
|
117 |
+
} else {
|
118 |
+
return self::PREAUTH_PAYMENT_URL_MAIN_TEST;
|
119 |
+
}
|
120 |
+
} else {
|
121 |
+
if ($this->hasVerification()) {
|
122 |
+
return self::PREAUTH_PAYMENT_URL_CVN;
|
123 |
+
} else {
|
124 |
+
return self::PREAUTH_PAYMENT_URL_MAIN;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* @return string
|
131 |
+
*/
|
132 |
+
public function getApiPreAuthCompleteUrl()
|
133 |
+
{
|
134 |
+
if ($this->getConfigData('test_gateway')) {
|
135 |
+
return self::PREAUTH_COMPLETE_URL_TEST;
|
136 |
+
} else {
|
137 |
+
return self::PREAUTH_COMPLETE_URL_MAIN;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* @return string
|
143 |
+
*/
|
144 |
+
public function getApiPreAuthVoidUrl()
|
145 |
+
{
|
146 |
+
if ($this->getConfigData('test_gateway')) {
|
147 |
+
return self::PREAUTH_VOID_URL_TEST;
|
148 |
+
} else {
|
149 |
+
return self::PREAUTH_VOID_URL_MAIN;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
/**
|
154 |
* Get Customer Id
|
155 |
*
|
157 |
*/
|
158 |
public function getCustomerId()
|
159 |
{
|
160 |
+
return $this->getConfigData('customer_id');
|
161 |
}
|
162 |
|
163 |
/**
|
167 |
*/
|
168 |
public function getAcceptedCurrency()
|
169 |
{
|
170 |
+
return $this->getConfigData('currency');
|
171 |
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* @return string
|
175 |
+
*/
|
176 |
public function getRefundPassword()
|
177 |
{
|
178 |
+
return $this->getConfigData('refund_password');
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* @return bool
|
183 |
+
*/
|
184 |
+
public function canCapture()
|
185 |
+
{
|
186 |
+
if ($this->_isPreauthorizeCapture($this->getInfoInstance())) {
|
187 |
+
return true;
|
188 |
+
} elseif ($this->getConfigPaymentAction() === Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE) {
|
189 |
+
return $this->_canCapture;
|
190 |
+
} else {
|
191 |
+
return false;
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
197 |
+
* @return bool
|
198 |
+
*/
|
199 |
+
protected function _isPreauthorizeCapture($payment)
|
200 |
+
{
|
201 |
+
$lastTransaction = $payment->getTransaction($payment->getLastTransId());
|
202 |
+
if ($lastTransaction && $lastTransaction->getTxnType() == Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH) {
|
203 |
+
return true;
|
204 |
+
}
|
205 |
+
|
206 |
+
return false;
|
207 |
}
|
208 |
|
209 |
+
/**
|
210 |
+
* @return Fontis_EwayAu_Model_Direct
|
211 |
+
* @throws Mage_Core_Exception
|
212 |
+
*/
|
213 |
public function validate()
|
214 |
{
|
215 |
parent::validate();
|
216 |
+
|
217 |
$paymentInfo = $this->getInfoInstance();
|
218 |
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
219 |
+
$currencyCode = $paymentInfo->getOrder()->getBaseCurrencyCode();
|
220 |
} else {
|
221 |
+
$currencyCode = $paymentInfo->getQuote()->getBaseCurrencyCode();
|
222 |
}
|
223 |
+
if ($currencyCode != $this->getAcceptedCurrency()) {
|
224 |
+
Mage::throwException($this->getEwayHelper()->__('Selected currency code (%s) is not compatible with eWAY', $currencyCode));
|
225 |
}
|
226 |
return $this;
|
227 |
}
|
228 |
|
229 |
+
/**
|
230 |
+
* @param Varien_Object $payment
|
231 |
+
* @param float $amount
|
232 |
+
* @return Fontis_EwayAu_Model_Direct
|
233 |
+
* @throws Mage_Core_Exception
|
234 |
+
*/
|
235 |
+
public function authorize(Varien_Object $payment, $amount)
|
236 |
{
|
237 |
+
if ($amount <= 0) {
|
238 |
+
Mage::throwException($this->getEwayHelper()->__('Invalid amount for authorization.'));
|
239 |
+
}
|
240 |
+
|
241 |
+
$this->setAmount($amount)->setPayment($payment);
|
242 |
|
243 |
+
$result = $this->callDoAuthorisationPaymentRequest($payment, $amount);
|
244 |
|
245 |
if ($result === false) {
|
246 |
+
$this->processError($this->getError(), 'payment');
|
247 |
+
} else {
|
248 |
+
if ($result['ewayTrxnStatus'] === 'True') {
|
249 |
+
$payment->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_APPROVED)
|
250 |
+
->setTransactionId($result['ewayTrxnNumber'])
|
251 |
+
->setLastTransId($result['ewayTrxnNumber'])
|
252 |
+
->setIsTransactionClosed(0);
|
253 |
} else {
|
254 |
+
Mage::throwException($result['ewayTrxnError']);
|
255 |
}
|
256 |
+
}
|
257 |
+
return $this;
|
258 |
+
}
|
259 |
+
|
260 |
+
/**
|
261 |
+
* @param Varien_Object $payment
|
262 |
+
* @param float $amount
|
263 |
+
* @return Fontis_EwayAu_Model_Direct
|
264 |
+
* @throws Mage_Core_Exception
|
265 |
+
*/
|
266 |
+
public function capture(Varien_Object $payment, $amount)
|
267 |
+
{
|
268 |
+
if ($amount <= 0) {
|
269 |
+
Mage::throwException($this->getEwayHelper()->__('Invalid amount for authorization.'));
|
270 |
+
}
|
271 |
+
|
272 |
+
$this->setAmount($amount)->setPayment($payment);
|
273 |
+
|
274 |
+
if ($this->_isPreauthorizeCapture($payment)) {
|
275 |
+
$result = $this->callDoCompleteAuthorisedPayment($payment, $amount);
|
276 |
+
} else {
|
277 |
+
$result = $this->callDoDirectPayment($payment, $amount);
|
278 |
+
}
|
279 |
+
|
280 |
+
if ($result === false) {
|
281 |
+
$this->processError($this->getError(), 'payment');
|
282 |
} else {
|
283 |
if ($result['ewayTrxnStatus'] === 'True') {
|
284 |
+
$payment->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_SUCCESS)
|
285 |
+
->setLastTransId($result['ewayTrxnNumber'])
|
286 |
+
->setTransactionId($result['ewayTrxnNumber'])
|
287 |
+
->setIsTransactionClosed(1);
|
288 |
+
} else {
|
289 |
Mage::throwException($result['ewayTrxnError']);
|
290 |
}
|
291 |
}
|
292 |
return $this;
|
293 |
}
|
294 |
|
295 |
+
/**
|
296 |
+
* @param Varien_Object $payment
|
297 |
+
* @return Fontis_EwayAu_Model_Direct
|
298 |
+
*/
|
299 |
public function cancel(Varien_Object $payment)
|
300 |
{
|
301 |
+
$payment->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_DECLINED);
|
302 |
return $this;
|
303 |
}
|
304 |
|
305 |
+
/**
|
306 |
+
* @param Varien_Object $payment
|
307 |
+
* @return Fontis_EwayAu_Model_Direct
|
308 |
+
* @throws Mage_Core_Exception
|
309 |
+
*/
|
310 |
+
public function void(Varien_Object $payment)
|
311 |
{
|
312 |
+
if (!$this->_isPreauthorizeCapture($payment)) {
|
313 |
+
Mage::throwException($this->_getHelper()->__('Void action is not available.'));
|
314 |
+
}
|
315 |
+
|
316 |
+
$amount = $payment->getAmountAuthorized();
|
317 |
+
|
318 |
$this->setAmount($amount)->setPayment($payment);
|
|
|
|
|
319 |
|
320 |
+
$result = $this->callDoVoidAuthorisedPayment($payment, $amount);
|
321 |
+
|
322 |
+
if ($result === false) {
|
323 |
+
$this->processError($this->getError(), 'refund');
|
324 |
+
} else {
|
325 |
+
if ($result['ewayTrxnStatus'] === 'True' && $result['ewayReturnAmount'] == $this->getFormattedAmount($amount)) {
|
326 |
+
$payment
|
327 |
+
->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_VOID)
|
328 |
+
->setLastTransId($result['ewayTrxnNumber'])
|
329 |
+
->setIsTransactionClosed(1);
|
330 |
+
;
|
331 |
} else {
|
332 |
+
Mage::throwException($result['ewayTrxnError']);
|
333 |
}
|
|
|
334 |
}
|
335 |
+
return $this;
|
336 |
+
}
|
337 |
+
|
338 |
+
/**
|
339 |
+
* @param Varien_Object $payment
|
340 |
+
* @param float $amount
|
341 |
+
* @return Fontis_EwayAu_Model_Direct
|
342 |
+
* @throws Mage_Core_Exception
|
343 |
+
*/
|
344 |
+
public function refund(Varien_Object $payment, $amount)
|
345 |
+
{
|
346 |
+
$this->setAmount($amount)->setPayment($payment);
|
347 |
+
|
348 |
+
$result = $this->callDoRefund($payment, $amount);
|
349 |
+
|
350 |
+
if ($result === false) {
|
351 |
+
$this->processError($this->getError(), 'refund');
|
352 |
+
} else {
|
353 |
+
if ($result['ewayTrxnStatus'] === 'True' && $result['ewayReturnAmount'] == $this->getFormattedAmount($amount)) {
|
354 |
+
$payment->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_APPROVED)
|
355 |
+
->setLastTransId($result['ewayTrxnNumber']);
|
356 |
+
} else {
|
357 |
Mage::throwException($result['ewayTrxnError']);
|
358 |
}
|
359 |
}
|
361 |
}
|
362 |
|
363 |
/**
|
364 |
+
* @param array $error
|
365 |
+
* @param string $action payment, refund, etc
|
366 |
+
* @throws Mage_Core_Exception
|
367 |
*/
|
368 |
+
protected function processError($error, $action)
|
369 |
{
|
370 |
+
if (isset($error['message'])) {
|
371 |
+
if (stristr($error['message'], Fontis_EwayAu_Helper_Data::ERROR_MSG_DONOTHONOUR)) {
|
372 |
+
$message = $this->getEwayHelper()->__("There has been an error processing your $action: Your credit card details are invalid.");
|
373 |
+
} else {
|
374 |
+
$message = $this->getEwayHelper()->__("There has been an error processing your $action. ") . $error['message'];
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
}
|
376 |
+
} else {
|
377 |
+
$message = $this->getEwayHelper()->__("There has been an error processing your $action. Please try later or contact us for help.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
}
|
379 |
+
Mage::throwException($message);
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Get the Simple XML objected used for pre-auth and capture payment transactions.
|
384 |
+
*
|
385 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
386 |
+
* @param float $amount
|
387 |
+
* @return SimpleXMLElement
|
388 |
+
*/
|
389 |
+
protected function getPaymentXmlObject($payment, $amount)
|
390 |
+
{
|
391 |
+
$order = $payment->getOrder();
|
392 |
+
$billing = $order->getBillingAddress();
|
393 |
+
$formattedAddress = $this->getEwayHelper()->getOrderAddressString($billing);
|
394 |
+
$invoiceDesc = $this->getEwayHelper()->getInvoiceDescription($order);
|
395 |
+
|
396 |
// Build the XML request
|
397 |
$xml = new SimpleXMLElement('<ewaygateway></ewaygateway>');
|
398 |
+
$xml->addChild('ewayCustomerID', $this->getCustomerId());
|
399 |
+
$xml->addChild('ewayTotalAmount', $this->getFormattedAmount($amount));
|
400 |
+
$xml->addChild('ewayCustomerFirstName', str_replace('&', '&', trim($billing->getFirstname())));
|
401 |
+
$xml->addChild('ewayCustomerLastName', str_replace('&', '&', trim($billing->getLastname())));
|
402 |
+
$xml->addChild('ewayCustomerEmail', str_replace('&', '&', trim($order->getCustomerEmail())));
|
403 |
+
$xml->addChild('ewayCustomerAddress', str_replace('&', '&', trim($formattedAddress)));
|
404 |
+
$xml->addChild('ewayCustomerPostcode', str_replace('&', '&', trim($billing->getPostcode())));
|
405 |
+
$xml->addChild('ewayCustomerInvoiceDescription', str_replace('&', '&', trim($invoiceDesc)));
|
406 |
+
$xml->addChild('ewayCustomerInvoiceRef', '');
|
407 |
+
$xml->addChild('ewayCardHoldersName', str_replace('&', '&', $payment->getCcOwner()));
|
408 |
+
$xml->addChild('ewayCardNumber', $payment->getCcNumber());
|
409 |
+
$xml->addChild('ewayCardExpiryMonth', $payment->getCcExpMonth());
|
410 |
+
$xml->addChild('ewayCardExpiryYear', substr($payment->getCcExpYear(), 2, 2));
|
411 |
$xml->addChild('ewayTrxnNumber', '');
|
412 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
$xml->addChild('ewayOption1', '');
|
414 |
$xml->addChild('ewayOption2', '');
|
415 |
$xml->addChild('ewayOption3', '');
|
416 |
|
417 |
+
if ($this->hasVerification()) {
|
418 |
+
$xml->addChild('ewayCVN', $payment->getCcCid());
|
|
|
|
|
|
|
|
|
419 |
}
|
420 |
|
421 |
+
return $xml;
|
|
|
422 |
}
|
423 |
+
|
424 |
/**
|
425 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
426 |
+
* @param float $amount
|
427 |
+
* @return array|false
|
428 |
*/
|
429 |
+
protected function callDoDirectPayment($payment, $amount)
|
430 |
{
|
431 |
+
$xml = $this->getPaymentXmlObject($payment, $amount);
|
432 |
+
$url = $this->getApiGatewayUrl();
|
433 |
+
|
434 |
+
// Convert to string before sending to the gateway
|
435 |
+
return $this->call($xml->asXML(), $url);
|
436 |
+
}
|
437 |
+
|
438 |
+
/**
|
439 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
440 |
+
* @param float $amount
|
441 |
+
* @return array|false
|
442 |
+
*/
|
443 |
+
protected function callDoAuthorisationPaymentRequest($payment, $amount)
|
444 |
+
{
|
445 |
+
$xml = $this->getPaymentXmlObject($payment, $amount);
|
446 |
+
$url = $this->getApiPreAuthPaymentUrl();
|
447 |
|
448 |
+
// Convert to string before sending to the gateway
|
449 |
+
return $this->call($xml->asXML(), $url);
|
450 |
+
}
|
451 |
+
|
452 |
+
/**
|
453 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
454 |
+
* @param float $amount
|
455 |
+
* @return array|false
|
456 |
+
*/
|
457 |
+
protected function callDoCompleteAuthorisedPayment($payment, $amount)
|
458 |
+
{
|
459 |
+
// Build the XML request
|
460 |
+
$xml = new SimpleXMLElement('<ewaygateway></ewaygateway>');
|
461 |
$xml->addChild('ewayCustomerID', $this->getCustomerId());
|
462 |
+
$xml->addChild('ewayTotalAmount', $this->getFormattedAmount($amount));
|
463 |
+
$xml->addChild('ewayAuthTrxnNumber', $payment->getLastTransId());
|
464 |
$xml->addChild('ewayCardExpiryMonth', $payment->getCcExpMonth());
|
465 |
+
$xml->addChild('ewayCardExpiryYear', $payment->getCcExpYear());
|
466 |
+
|
|
|
|
|
467 |
$xml->addChild('ewayOption1', '');
|
468 |
$xml->addChild('ewayOption2', '');
|
469 |
$xml->addChild('ewayOption3', '');
|
|
|
|
|
|
|
470 |
|
471 |
+
$url = $this->getApiPreAuthCompleteUrl();
|
|
|
|
|
472 |
|
473 |
+
// Convert to string before sending to the gateway
|
474 |
+
return $this->call($xml->asXML(), $url);
|
475 |
+
}
|
476 |
|
477 |
+
/**
|
478 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
479 |
+
* @param float $amount
|
480 |
+
* @return array|false
|
481 |
+
*/
|
482 |
+
protected function callDoVoidAuthorisedPayment($payment, $amount)
|
483 |
+
{
|
484 |
+
// Build the XML request
|
485 |
+
$xml = new SimpleXMLElement('<ewaygateway></ewaygateway>');
|
486 |
+
$xml->addChild('ewayCustomerID', $this->getCustomerId());
|
487 |
+
$xml->addChild('ewayTotalAmount', $this->getFormattedAmount($amount));
|
488 |
+
$xml->addChild('ewayAuthTrxnNumber', $this->getOriginalTransactionId($payment->getLastTransId()));
|
489 |
|
490 |
+
$xml->addChild('ewayOption1', '');
|
491 |
+
$xml->addChild('ewayOption2', '');
|
492 |
+
$xml->addChild('ewayOption3', '');
|
|
|
|
|
|
|
493 |
|
494 |
+
$url = $this->getApiPreAuthVoidUrl();
|
|
|
|
|
|
|
495 |
|
496 |
+
// Convert to string before sending to the gateway
|
497 |
+
return $this->call($xml->asXML(), $url);
|
498 |
+
}
|
499 |
+
|
500 |
+
/**
|
501 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
502 |
+
* @param float $amount
|
503 |
+
* @return array|false
|
504 |
+
*/
|
505 |
+
protected function callDoRefund($payment, $amount)
|
506 |
+
{
|
507 |
+
// Build the XML request
|
508 |
+
$xml = new SimpleXMLElement('<ewaygateway></ewaygateway>');
|
509 |
+
$xml->addChild('ewayCustomerID', $this->getCustomerId());
|
510 |
+
$xml->addChild('ewayTotalAmount', $this->getFormattedAmount($amount));
|
511 |
+
$xml->addChild('ewayCardExpiryMonth', $payment->getCcExpMonth());
|
512 |
+
$xml->addChild('ewayCardExpiryYear', substr($payment->getCcExpYear(), 2, 2));
|
513 |
+
$xml->addChild('ewayOriginalTrxnNumber', $this->getOriginalTransactionId($payment->getLastTransId()));
|
514 |
+
$xml->addChild('ewayRefundPassword', $this->getRefundPassword());
|
515 |
+
|
516 |
+
$xml->addChild('ewayOption1', '');
|
517 |
+
$xml->addChild('ewayOption2', '');
|
518 |
|
519 |
+
$url = $this->getApiRefundUrl();
|
520 |
|
521 |
+
// Convert to string before sending to the gateway
|
522 |
+
return $this->call($xml->asXML(), $url);
|
523 |
}
|
524 |
|
525 |
/**
|
526 |
+
* Send parameters to eWay gateway.
|
527 |
*
|
528 |
* @param string $xml
|
529 |
+
* @param string $url
|
530 |
+
* @return array|false
|
531 |
*/
|
532 |
+
protected function call($xml, $url)
|
533 |
{
|
534 |
$http = new Varien_Http_Adapter_Curl();
|
535 |
+
$config = array('timeout' => Fontis_EwayAu_Helper_Data::DEFAULT_TIMEOUT);
|
536 |
|
537 |
$http->setConfig($config);
|
538 |
+
$http->write(Zend_Http_Client::POST, $url, Zend_Http_Client::HTTP_1, array(), $xml);
|
539 |
$response = $http->read();
|
540 |
|
541 |
$response = preg_split('/^\r?$/m', $response, 2);
|
544 |
if ($http->getErrno()) {
|
545 |
$http->close();
|
546 |
$this->setError(array(
|
547 |
+
'message' => $http->getErrno() . ' - ' . $http->getError(),
|
548 |
));
|
549 |
return false;
|
550 |
}
|
551 |
$http->close();
|
552 |
|
553 |
+
if (($parsedResArr = $this->parseXmlResponse($response)) === false) {
|
554 |
$this->setError(array(
|
555 |
+
'message' => 'Invalid response from gateway.',
|
556 |
));
|
557 |
return false;
|
558 |
}
|
564 |
|
565 |
if (isset($parsedResArr['ewayTrxnError'])) {
|
566 |
$this->setError(array(
|
567 |
+
'message' => $parsedResArr['ewayTrxnError'],
|
568 |
));
|
569 |
}
|
570 |
|
572 |
}
|
573 |
|
574 |
/**
|
575 |
+
* @param float $amount
|
576 |
+
* @return float
|
577 |
+
*/
|
578 |
+
protected function getFormattedAmount($amount)
|
579 |
+
{
|
580 |
+
return $amount * 100;
|
581 |
+
}
|
582 |
+
|
583 |
+
/**
|
584 |
+
* Get Transaction ID that can be used with eWAY API calls.
|
585 |
+
* Remove payment action appended by Magento to the end of transaction ID.
|
586 |
+
*
|
587 |
+
* @param string $transactionId
|
588 |
+
* @return string
|
589 |
+
*/
|
590 |
+
protected function getOriginalTransactionId($transactionId)
|
591 |
+
{
|
592 |
+
if (strstr($transactionId, '-')) {
|
593 |
+
$transactionData = explode('-', $transactionId);
|
594 |
+
return $transactionData[0];
|
595 |
+
}
|
596 |
+
|
597 |
+
return $transactionId;
|
598 |
+
}
|
599 |
+
|
600 |
+
/**
|
601 |
+
* Parse response of gateway
|
602 |
*
|
603 |
* @param string $xmlResponse
|
604 |
* @return array
|
605 |
*/
|
606 |
+
protected function parseXmlResponse($xmlResponse)
|
607 |
{
|
608 |
$xmlObj = simplexml_load_string($xmlResponse);
|
609 |
|
610 |
+
if ($xmlObj === false) {
|
611 |
return false;
|
612 |
}
|
613 |
|
614 |
$newResArr = array();
|
615 |
foreach ($xmlObj as $key => $val) {
|
616 |
+
$newResArr[$key] = (string) $val;
|
617 |
}
|
618 |
|
619 |
return $newResArr;
|
620 |
}
|
621 |
+
|
622 |
+
/**
|
623 |
+
* Check if invoice email can be sent, and send it.
|
624 |
+
*
|
625 |
+
* @param Mage_Sales_Model_Order_Invoice $invoice
|
626 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
627 |
+
* @return Fontis_EwayAu_Model_Direct
|
628 |
+
*/
|
629 |
+
public function processInvoice($invoice, $payment)
|
630 |
+
{
|
631 |
+
parent::processInvoice($invoice, $payment);
|
632 |
+
|
633 |
+
try {
|
634 |
+
$storeId = $invoice->getOrder()->getStoreId();
|
635 |
+
if (Mage::helper('sales')->canSendNewInvoiceEmail($storeId)) {
|
636 |
+
$invoice->save();
|
637 |
+
$invoice->sendEmail();
|
638 |
+
}
|
639 |
+
} catch (Exception $e) {
|
640 |
+
Mage::logException($e);
|
641 |
+
}
|
642 |
+
return $this;
|
643 |
+
}
|
644 |
}
|
app/code/community/Fontis/EwayAu/Model/Sales/Object.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Informal interface for Mage_Sales_Model_Order and Mage_Sales_Model_Quote
|
22 |
+
*/
|
23 |
+
interface Fontis_EwayAu_Model_Sales_Object
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* @return array
|
27 |
+
*/
|
28 |
+
public function getAllItems();
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @return Mage_Customer_Model_Address_Abstract
|
32 |
+
*/
|
33 |
+
public function getBillingAddress();
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function getBaseCurrencyCode();
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @return string
|
42 |
+
*/
|
43 |
+
public function getId();
|
44 |
+
}
|
app/code/community/Fontis/EwayAu/Model/Secure.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,21 +8,20 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
class Fontis_EwayAu_Model_Secure extends Fontis_EwayAu_Model_Shared
|
24 |
{
|
25 |
-
protected $_code
|
26 |
|
27 |
protected $_formBlockType = 'ewayau/secure_form';
|
28 |
protected $_paymentMethod = 'secure';
|
@@ -34,10 +33,9 @@ class Fontis_EwayAu_Model_Secure extends Fontis_EwayAu_Model_Shared
|
|
34 |
*/
|
35 |
public function getEwaySecureUrl()
|
36 |
{
|
37 |
-
if (!$url =
|
38 |
$url = 'https://www.eway.com.au/gateway_3d/payment.asp';
|
39 |
}
|
40 |
return $url;
|
41 |
}
|
42 |
-
|
43 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
13 |
*
|
14 |
* @category Fontis
|
15 |
* @package Fontis_EwayAu
|
16 |
+
* @author Chris Norton
|
17 |
+
* @author Matthew Gamble
|
18 |
+
* @copyright Copyright (c) 2014 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 |
class Fontis_EwayAu_Model_Secure extends Fontis_EwayAu_Model_Shared
|
23 |
{
|
24 |
+
protected $_code = 'ewayau_secure';
|
25 |
|
26 |
protected $_formBlockType = 'ewayau/secure_form';
|
27 |
protected $_paymentMethod = 'secure';
|
33 |
*/
|
34 |
public function getEwaySecureUrl()
|
35 |
{
|
36 |
+
if (!$url = $this->getConfigData('api_url')) {
|
37 |
$url = 'https://www.eway.com.au/gateway_3d/payment.asp';
|
38 |
}
|
39 |
return $url;
|
40 |
}
|
|
|
41 |
}
|
app/code/community/Fontis/EwayAu/Model/Shared.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,21 +8,22 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
class Fontis_EwayAu_Model_Shared extends Mage_Payment_Model_Method_Abstract
|
24 |
{
|
25 |
-
|
|
|
|
|
26 |
|
27 |
protected $_isGateway = false;
|
28 |
protected $_canAuthorize = false;
|
@@ -37,7 +38,26 @@ class Fontis_EwayAu_Model_Shared extends Mage_Payment_Model_Method_Abstract
|
|
37 |
protected $_formBlockType = 'ewayau/shared_form';
|
38 |
protected $_paymentMethod = 'shared';
|
39 |
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
/**
|
43 |
* Get order model
|
@@ -46,22 +66,22 @@ class Fontis_EwayAu_Model_Shared extends Mage_Payment_Model_Method_Abstract
|
|
46 |
*/
|
47 |
public function getOrder()
|
48 |
{
|
49 |
-
if (
|
50 |
$paymentInfo = $this->getInfoInstance();
|
51 |
-
$
|
52 |
-
|
53 |
}
|
54 |
return $this->_order;
|
55 |
}
|
56 |
|
57 |
/**
|
58 |
-
* Get Customer
|
59 |
*
|
60 |
* @return string
|
61 |
*/
|
62 |
public function getCustomerId()
|
63 |
{
|
64 |
-
return
|
65 |
}
|
66 |
|
67 |
/**
|
@@ -71,76 +91,74 @@ class Fontis_EwayAu_Model_Shared extends Mage_Payment_Model_Method_Abstract
|
|
71 |
*/
|
72 |
public function getAcceptedCurrency()
|
73 |
{
|
74 |
-
return
|
75 |
}
|
76 |
|
|
|
|
|
|
|
|
|
77 |
public function validate()
|
78 |
{
|
79 |
parent::validate();
|
|
|
80 |
$paymentInfo = $this->getInfoInstance();
|
81 |
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
82 |
-
$
|
83 |
} else {
|
84 |
-
$
|
85 |
}
|
86 |
-
if ($
|
87 |
-
Mage::throwException(
|
88 |
}
|
89 |
return $this;
|
90 |
}
|
91 |
|
|
|
|
|
|
|
92 |
public function getOrderPlaceRedirectUrl()
|
93 |
{
|
94 |
$url = Mage::getUrl('ewayau/' . $this->_paymentMethod . '/redirect');
|
95 |
-
if(!$url) {
|
96 |
-
$url =
|
97 |
}
|
98 |
return $url;
|
99 |
}
|
100 |
|
101 |
/**
|
102 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
*
|
104 |
* @return array
|
105 |
*/
|
106 |
public function getFormFields()
|
107 |
{
|
108 |
-
$
|
109 |
-
$
|
110 |
-
$
|
111 |
-
$
|
112 |
-
|
113 |
-
if ($item->getParentItem()) {
|
114 |
-
continue;
|
115 |
-
}
|
116 |
-
if (Mage::helper('core/string')->strlen($invoiceDesc.$item->getName()) > 10000) {
|
117 |
-
break;
|
118 |
-
}
|
119 |
-
$invoiceDesc .= $item->getName() . ', ';
|
120 |
-
}
|
121 |
-
$invoiceDesc = Mage::helper('core/string')->substr($invoiceDesc, 0, -2);
|
122 |
-
|
123 |
-
$address = clone $billing;
|
124 |
-
$address->unsFirstname();
|
125 |
-
$address->unsLastname();
|
126 |
-
$address->unsPostcode();
|
127 |
-
$formatedAddress = '';
|
128 |
-
$tmpAddress = explode(' ', str_replace("\n", ' ', trim($address->format('text'))));
|
129 |
-
foreach ($tmpAddress as $part) {
|
130 |
-
if (strlen($part) > 0) $formatedAddress .= $part . ' ';
|
131 |
-
}
|
132 |
$paymentInfo = $this->getInfoInstance();
|
|
|
133 |
$fieldsArr['ewayCustomerID'] = $this->getCustomerId();
|
134 |
-
$fieldsArr['ewayTotalAmount'] = ($this->getOrder()->getBaseGrandTotal()*100);
|
135 |
$fieldsArr['ewayCustomerFirstName'] = $billing->getFirstname();
|
136 |
$fieldsArr['ewayCustomerLastName'] = $billing->getLastname();
|
137 |
$fieldsArr['ewayCustomerEmail'] = $this->getOrder()->getCustomerEmail();
|
138 |
-
$fieldsArr['ewayCustomerAddress'] = trim($
|
139 |
$fieldsArr['ewayCustomerPostcode'] = $billing->getPostcode();
|
140 |
$fieldsArr['ewayCustomerInvoiceDescription'] = $invoiceDesc;
|
141 |
$fieldsArr['ewaySiteTitle'] = Mage::app()->getStore()->getName();
|
142 |
$fieldsArr['ewayAutoRedirect'] = 1;
|
143 |
-
$fieldsArr['ewayURL'] =
|
144 |
$fieldsArr['ewayCustomerInvoiceRef'] = $paymentInfo->getOrder()->getRealOrderId();
|
145 |
$fieldsArr['ewayTrxnNumber'] = $paymentInfo->getOrder()->getRealOrderId();
|
146 |
$fieldsArr['ewayOption1'] = '';
|
@@ -157,7 +175,7 @@ class Fontis_EwayAu_Model_Shared extends Mage_Payment_Model_Method_Abstract
|
|
157 |
*/
|
158 |
public function getEwaySharedUrl()
|
159 |
{
|
160 |
-
if (!$url =
|
161 |
$url = 'https://www.eway.com.au/gateway/payment.asp';
|
162 |
}
|
163 |
return $url;
|
@@ -170,9 +188,14 @@ class Fontis_EwayAu_Model_Shared extends Mage_Payment_Model_Method_Abstract
|
|
170 |
*/
|
171 |
public function getDebug()
|
172 |
{
|
173 |
-
return
|
174 |
}
|
175 |
|
|
|
|
|
|
|
|
|
|
|
176 |
public function capture(Varien_Object $payment, $amount)
|
177 |
{
|
178 |
$payment->setStatus(self::STATUS_APPROVED)
|
@@ -181,6 +204,10 @@ class Fontis_EwayAu_Model_Shared extends Mage_Payment_Model_Method_Abstract
|
|
181 |
return $this;
|
182 |
}
|
183 |
|
|
|
|
|
|
|
|
|
184 |
public function cancel(Varien_Object $payment)
|
185 |
{
|
186 |
$payment->setStatus(self::STATUS_DECLINED)
|
@@ -190,7 +217,7 @@ class Fontis_EwayAu_Model_Shared extends Mage_Payment_Model_Method_Abstract
|
|
190 |
}
|
191 |
|
192 |
/**
|
193 |
-
*
|
194 |
*
|
195 |
* @return bool
|
196 |
*/
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
13 |
*
|
14 |
* @category Fontis
|
15 |
* @package Fontis_EwayAu
|
16 |
+
* @author Chris Norton
|
17 |
+
* @author Matthew Gamble
|
18 |
+
* @copyright Copyright (c) 2014 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 |
class Fontis_EwayAu_Model_Shared extends Mage_Payment_Model_Method_Abstract
|
23 |
{
|
24 |
+
const DEFAULT_REDIRECT_URL = 'https://www.eway.com.au/gateway/payment.asp';
|
25 |
+
|
26 |
+
protected $_code = 'ewayau_shared';
|
27 |
|
28 |
protected $_isGateway = false;
|
29 |
protected $_canAuthorize = false;
|
38 |
protected $_formBlockType = 'ewayau/shared_form';
|
39 |
protected $_paymentMethod = 'shared';
|
40 |
|
41 |
+
/**
|
42 |
+
* @var Mage_Sales_Model_Order
|
43 |
+
*/
|
44 |
+
protected $_order = null;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @var Fontis_EwayAu_Helper_Data
|
48 |
+
*/
|
49 |
+
protected $_ewayHelper = null;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @return Fontis_EwayAu_Helper_Data
|
53 |
+
*/
|
54 |
+
protected function getEwayHelper()
|
55 |
+
{
|
56 |
+
if ($this->_ewayHelper === null) {
|
57 |
+
$this->_ewayHelper = Mage::helper('ewayau');
|
58 |
+
}
|
59 |
+
return $this->_ewayHelper;
|
60 |
+
}
|
61 |
|
62 |
/**
|
63 |
* Get order model
|
66 |
*/
|
67 |
public function getOrder()
|
68 |
{
|
69 |
+
if ($this->_order === null) {
|
70 |
$paymentInfo = $this->getInfoInstance();
|
71 |
+
$orderId = $paymentInfo->getOrder()->getRealOrderId();
|
72 |
+
$this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
73 |
}
|
74 |
return $this->_order;
|
75 |
}
|
76 |
|
77 |
/**
|
78 |
+
* Get Customer ID
|
79 |
*
|
80 |
* @return string
|
81 |
*/
|
82 |
public function getCustomerId()
|
83 |
{
|
84 |
+
return $this->getConfigData('customer_id');
|
85 |
}
|
86 |
|
87 |
/**
|
91 |
*/
|
92 |
public function getAcceptedCurrency()
|
93 |
{
|
94 |
+
return $this->getConfigData('currency');
|
95 |
}
|
96 |
|
97 |
+
/**
|
98 |
+
* @return Fontis_EwayAu_Model_Shared
|
99 |
+
* @throws Mage_Core_Exception
|
100 |
+
*/
|
101 |
public function validate()
|
102 |
{
|
103 |
parent::validate();
|
104 |
+
|
105 |
$paymentInfo = $this->getInfoInstance();
|
106 |
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
107 |
+
$currencyCode = $paymentInfo->getOrder()->getBaseCurrencyCode();
|
108 |
} else {
|
109 |
+
$currencyCode = $paymentInfo->getQuote()->getBaseCurrencyCode();
|
110 |
}
|
111 |
+
if ($currencyCode != $this->getAcceptedCurrency()) {
|
112 |
+
Mage::throwException($this->getEwayHelper()->__('Selected currency code (%s) is not compatible with eWAY', $currencyCode));
|
113 |
}
|
114 |
return $this;
|
115 |
}
|
116 |
|
117 |
+
/**
|
118 |
+
* @return string
|
119 |
+
*/
|
120 |
public function getOrderPlaceRedirectUrl()
|
121 |
{
|
122 |
$url = Mage::getUrl('ewayau/' . $this->_paymentMethod . '/redirect');
|
123 |
+
if (!$url) {
|
124 |
+
$url = self::DEFAULT_REDIRECT_URL;
|
125 |
}
|
126 |
return $url;
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
+
* @return string
|
131 |
+
*/
|
132 |
+
public function getOrderReturnSuccessUrl()
|
133 |
+
{
|
134 |
+
return Mage::getUrl('ewayau/' . $this->_paymentMethod . '/success', array('_secure' => true));
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Prepare parameters array to send it to gateway page via POST
|
139 |
*
|
140 |
* @return array
|
141 |
*/
|
142 |
public function getFormFields()
|
143 |
{
|
144 |
+
$order = $this->getOrder();
|
145 |
+
$billing = $order->getBillingAddress();
|
146 |
+
$formattedAddress = $this->getEwayHelper()->getOrderAddressString($billing);
|
147 |
+
$invoiceDesc = $this->getEwayHelper()->getInvoiceDescription($order, 10000);
|
148 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
$paymentInfo = $this->getInfoInstance();
|
150 |
+
$fieldsArr = array();
|
151 |
$fieldsArr['ewayCustomerID'] = $this->getCustomerId();
|
152 |
+
$fieldsArr['ewayTotalAmount'] = ($this->getOrder()->getBaseGrandTotal() * 100);
|
153 |
$fieldsArr['ewayCustomerFirstName'] = $billing->getFirstname();
|
154 |
$fieldsArr['ewayCustomerLastName'] = $billing->getLastname();
|
155 |
$fieldsArr['ewayCustomerEmail'] = $this->getOrder()->getCustomerEmail();
|
156 |
+
$fieldsArr['ewayCustomerAddress'] = trim($formattedAddress);
|
157 |
$fieldsArr['ewayCustomerPostcode'] = $billing->getPostcode();
|
158 |
$fieldsArr['ewayCustomerInvoiceDescription'] = $invoiceDesc;
|
159 |
$fieldsArr['ewaySiteTitle'] = Mage::app()->getStore()->getName();
|
160 |
$fieldsArr['ewayAutoRedirect'] = 1;
|
161 |
+
$fieldsArr['ewayURL'] = $this->getOrderReturnSuccessUrl();
|
162 |
$fieldsArr['ewayCustomerInvoiceRef'] = $paymentInfo->getOrder()->getRealOrderId();
|
163 |
$fieldsArr['ewayTrxnNumber'] = $paymentInfo->getOrder()->getRealOrderId();
|
164 |
$fieldsArr['ewayOption1'] = '';
|
175 |
*/
|
176 |
public function getEwaySharedUrl()
|
177 |
{
|
178 |
+
if (!$url = $this->getConfigData('api_url')) {
|
179 |
$url = 'https://www.eway.com.au/gateway/payment.asp';
|
180 |
}
|
181 |
return $url;
|
188 |
*/
|
189 |
public function getDebug()
|
190 |
{
|
191 |
+
return $this->getConfigData('debug_flag');
|
192 |
}
|
193 |
|
194 |
+
/**
|
195 |
+
* @param Varien_Object $payment
|
196 |
+
* @param float $amount
|
197 |
+
* @return Fontis_EwayAu_Model_Shared
|
198 |
+
*/
|
199 |
public function capture(Varien_Object $payment, $amount)
|
200 |
{
|
201 |
$payment->setStatus(self::STATUS_APPROVED)
|
204 |
return $this;
|
205 |
}
|
206 |
|
207 |
+
/**
|
208 |
+
* @param Varien_Object $payment
|
209 |
+
* @return Fontis_EwayAu_Model_Shared
|
210 |
+
*/
|
211 |
public function cancel(Varien_Object $payment)
|
212 |
{
|
213 |
$payment->setStatus(self::STATUS_DECLINED)
|
217 |
}
|
218 |
|
219 |
/**
|
220 |
+
* Parse response POST array from gateway page and return payment status
|
221 |
*
|
222 |
* @return bool
|
223 |
*/
|
app/code/community/Fontis/EwayAu/Model/Source/Cctype.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,20 +8,20 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
class Fontis_EwayAu_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype
|
24 |
{
|
|
|
|
|
|
|
25 |
public function getAllowedTypes()
|
26 |
{
|
27 |
return array('VI', 'MC', 'AE', 'DICL', 'JCB');
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
20 |
class Fontis_EwayAu_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype
|
21 |
{
|
22 |
+
/**
|
23 |
+
* @return array
|
24 |
+
*/
|
25 |
public function getAllowedTypes()
|
26 |
{
|
27 |
return array('VI', 'MC', 'AE', 'DICL', 'JCB');
|
app/code/community/Fontis/EwayAu/Model/Source/PaymentAction.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Fontis_EwayAu_Model_Source_PaymentAction
|
21 |
+
{
|
22 |
+
public function toOptionArray()
|
23 |
+
{
|
24 |
+
/** @var $helper Fontis_EwayAu_Helper_Data */
|
25 |
+
$helper = Mage::helper('ewayau');
|
26 |
+
|
27 |
+
return array(
|
28 |
+
array(
|
29 |
+
'value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE,
|
30 |
+
'label' => $helper->__('Authorize Only')
|
31 |
+
),
|
32 |
+
array(
|
33 |
+
'value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE,
|
34 |
+
'label' => $helper->__('Authorize and Capture')
|
35 |
+
),
|
36 |
+
);
|
37 |
+
}
|
38 |
+
}
|
app/code/community/Fontis/EwayAu/Model/Token.php
ADDED
@@ -0,0 +1,470 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Fontis_EwayAu_Model_Token extends Mage_Payment_Model_Method_Cc
|
22 |
+
{
|
23 |
+
const GATEWAY_URL_MAIN = 'https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx';
|
24 |
+
const GATEWAY_URL_TEST = 'https://www.eway.com.au/gateway/ManagedPaymentService/test/managedcreditcardpayment.asmx';
|
25 |
+
|
26 |
+
protected $_code = 'ewayau_token';
|
27 |
+
|
28 |
+
protected $_isGateway = true;
|
29 |
+
protected $_canAuthorize = false;
|
30 |
+
protected $_canCapture = true;
|
31 |
+
protected $_canCapturePartial = false;
|
32 |
+
protected $_canRefund = false;
|
33 |
+
protected $_canVoid = false;
|
34 |
+
protected $_canUseInternal = true;
|
35 |
+
protected $_canUseCheckout = false;
|
36 |
+
protected $_canUseForMultishipping = true;
|
37 |
+
protected $_canSaveCc = false;
|
38 |
+
|
39 |
+
protected $_formBlockType = 'ewayau/cc_form';
|
40 |
+
protected $_infoBlockType = 'ewayau/cc_info';
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @var array
|
44 |
+
*/
|
45 |
+
protected $_soapClassMap = array(
|
46 |
+
'CreateCustomerResponse' => 'ewayau/token_response_createCustomer',
|
47 |
+
'UpdateCustomerResponse' => 'ewayau/token_response_updateCustomer',
|
48 |
+
'QueryCustomerByReferenceResult' => 'ewayau/token_response_queryCustomerByReference',
|
49 |
+
'CreditCard' => 'varien/object',
|
50 |
+
'ProcessPaymentResponse' => 'ewayau/token_response_processPayment',
|
51 |
+
'CCPaymentResponse' => 'varien/object',
|
52 |
+
);
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @var Fontis_EwayAu_Model_Token_Request
|
56 |
+
*/
|
57 |
+
protected $_request = null;
|
58 |
+
|
59 |
+
/**
|
60 |
+
* @var Fontis_EwayAu_Model_Token_Request_Data
|
61 |
+
*/
|
62 |
+
protected $_requestData = null;
|
63 |
+
|
64 |
+
/**
|
65 |
+
* @var Fontis_EwayAu_Helper_Token
|
66 |
+
*/
|
67 |
+
protected $_tokenHelper = null;
|
68 |
+
|
69 |
+
public function __construct()
|
70 |
+
{
|
71 |
+
parent::__construct();
|
72 |
+
$this->_soapClassMap = array_map(array(Mage::getConfig(), 'getModelClassName'), $this->_soapClassMap);
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @return Fontis_EwayAu_Helper_Token
|
77 |
+
*/
|
78 |
+
protected function getTokenHelper()
|
79 |
+
{
|
80 |
+
if ($this->_tokenHelper === null) {
|
81 |
+
$this->_tokenHelper = Mage::helper('ewayau/token');
|
82 |
+
}
|
83 |
+
|
84 |
+
return $this->_tokenHelper;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* @param bool $testGateway
|
89 |
+
* @return string
|
90 |
+
*/
|
91 |
+
public function getApiGatewayUrl($testGateway = null)
|
92 |
+
{
|
93 |
+
if ($testGateway !== null) {
|
94 |
+
if ($testGateway === true) {
|
95 |
+
return self::GATEWAY_URL_TEST;
|
96 |
+
} else {
|
97 |
+
return self::GATEWAY_URL_MAIN;
|
98 |
+
}
|
99 |
+
} elseif ($this->getConfigData('test_gateway', $this->getStoreId())) {
|
100 |
+
return self::GATEWAY_URL_TEST;
|
101 |
+
} else {
|
102 |
+
return self::GATEWAY_URL_MAIN;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* @return int
|
108 |
+
*/
|
109 |
+
public function getStoreId()
|
110 |
+
{
|
111 |
+
if (Mage::registry('payment_store')) {
|
112 |
+
return Mage::registry('payment_store');
|
113 |
+
}
|
114 |
+
|
115 |
+
$store = $this->getStore();
|
116 |
+
$storeId = false;
|
117 |
+
if ($store && is_object($store) && $store->getId()) {
|
118 |
+
$storeId = $store->getId();
|
119 |
+
Mage::register('payment_store', $storeId);
|
120 |
+
}
|
121 |
+
|
122 |
+
if (!$storeId) {
|
123 |
+
$storeId = Mage::app()->getStore()->getId();
|
124 |
+
}
|
125 |
+
|
126 |
+
return $storeId;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Get the eWAY Customer Id
|
131 |
+
*
|
132 |
+
* @return string
|
133 |
+
*/
|
134 |
+
public function getCustomerId()
|
135 |
+
{
|
136 |
+
return $this->getConfigData('customer_id', $this->getStoreId());
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Get the eWAY Business Center username.
|
141 |
+
*
|
142 |
+
* @return string
|
143 |
+
*/
|
144 |
+
public function getUsername()
|
145 |
+
{
|
146 |
+
return $this->getConfigData('username', $this->getStoreId());
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Get the eWAY Business Center password.
|
151 |
+
*
|
152 |
+
* @return string
|
153 |
+
*/
|
154 |
+
public function getPassword()
|
155 |
+
{
|
156 |
+
return $this->getConfigData('password', $this->getStoreId());
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Get the currency that accepted by eWAY account
|
161 |
+
*
|
162 |
+
* @return string
|
163 |
+
*/
|
164 |
+
public function getAcceptedCurrency()
|
165 |
+
{
|
166 |
+
return $this->getConfigData('currency', $this->getStoreId());
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Determine if this payment method can be shown as an option on checkout payment page.
|
171 |
+
*
|
172 |
+
* @return bool
|
173 |
+
*/
|
174 |
+
public function canUseCheckout()
|
175 |
+
{
|
176 |
+
return $this->getConfigData('show_in_checkout', $this->getStoreId());
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* @return Fontis_EwayAu_Model_Token
|
181 |
+
* @throws Mage_Core_Exception
|
182 |
+
*/
|
183 |
+
public function validate()
|
184 |
+
{
|
185 |
+
parent::validate();
|
186 |
+
|
187 |
+
$paymentInfo = $this->getInfoInstance();
|
188 |
+
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
189 |
+
$currencyCode = $paymentInfo->getOrder()->getBaseCurrencyCode();
|
190 |
+
} else {
|
191 |
+
$currencyCode = $paymentInfo->getQuote()->getBaseCurrencyCode();
|
192 |
+
}
|
193 |
+
if ($currencyCode != $this->getAcceptedCurrency()) {
|
194 |
+
Mage::throwException($this->getTokenHelper()->__('Selected currency code (%s) is not compatible with eWAY', $currencyCode));
|
195 |
+
}
|
196 |
+
return $this;
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Assign data to info model instance
|
201 |
+
*
|
202 |
+
* @param array|Varien_Object $paymentData
|
203 |
+
* @return Fontis_EwayAu_Model_Token
|
204 |
+
*/
|
205 |
+
public function assignData($paymentData)
|
206 |
+
{
|
207 |
+
parent::assignData($paymentData);
|
208 |
+
|
209 |
+
if (is_array($paymentData)) {
|
210 |
+
$paymentData = new Varien_Object($paymentData);
|
211 |
+
}
|
212 |
+
|
213 |
+
$tokenHelper = $this->getTokenHelper();
|
214 |
+
$customerId = $tokenHelper->getCustomerId();
|
215 |
+
|
216 |
+
// If customer credit card data has already been stored on eWAY recently skip.
|
217 |
+
if (!$customerId) {
|
218 |
+
// Determine if customer credit card data already exists on eWAY
|
219 |
+
try {
|
220 |
+
$query = $this->queryCustomerByReference();
|
221 |
+
|
222 |
+
// Check if customer data requires update
|
223 |
+
if ($query->isRequestSuccessful()) {
|
224 |
+
$updateResponse = $this->updateCustomer($paymentData, $query->getProcessedResponse());
|
225 |
+
|
226 |
+
if ($updateResponse === false) {
|
227 |
+
$tokenHelper->logMessage('Unable to update eWAY token customer.');
|
228 |
+
Mage::throwException('An error occurred during the checkout process.');
|
229 |
+
}
|
230 |
+
} else {
|
231 |
+
$createResponse = $this->createCustomer($paymentData);
|
232 |
+
|
233 |
+
if (!$createResponse->isRequestSuccessful()) {
|
234 |
+
$tokenHelper->logMessage('Unable to create eWAY token customer.');
|
235 |
+
Mage::throwException('An error occurred during the checkout process.');
|
236 |
+
}
|
237 |
+
}
|
238 |
+
} catch (Exception $e) {
|
239 |
+
$tokenHelper->logMessage($e->getMessage());
|
240 |
+
Mage::throwException($e->getMessage());
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
return $this;
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* @param Varien_Object $payment
|
249 |
+
* @param float $amount
|
250 |
+
* @return Fontis_EwayAu_Model_Token
|
251 |
+
*/
|
252 |
+
public function capture(Varien_Object $paymentData, $amount)
|
253 |
+
{
|
254 |
+
$this->setAmount($amount)->setPayment($paymentData);
|
255 |
+
|
256 |
+
$result = $this->processPayment($paymentData);
|
257 |
+
if ($result->isRequestSuccessful() === false) {
|
258 |
+
if ($errorMsg = $result->getEwayTrxnError()) {
|
259 |
+
if (stristr($errorMsg, Fontis_EwayAu_Helper_Data::ERROR_MSG_DONOTHONOUR)) {
|
260 |
+
$message = $this->getTokenHelper()->__('An error has occurred while processing your payment: Your credit card details are invalid.');
|
261 |
+
} else {
|
262 |
+
$message = $this->getTokenHelper()->__('An error has occurred while processing your payment. ') . $errorMsg;
|
263 |
+
}
|
264 |
+
} else {
|
265 |
+
$message = $this->getTokenHelper()->__('An error has occurred while processing your payment. Please try later or contact us for help.');
|
266 |
+
}
|
267 |
+
Mage::throwException($message);
|
268 |
+
} else {
|
269 |
+
$paymentData->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_APPROVED)->setLastTransId($result->getEwayTrxnNumber());
|
270 |
+
// Clear set eWAY token customer ID on customer's session
|
271 |
+
$this->getTokenHelper()->clearCustomerId();
|
272 |
+
}
|
273 |
+
|
274 |
+
return $this;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Cancel the current transaction payment being processed.
|
279 |
+
*
|
280 |
+
* @param Varien_Object $payment
|
281 |
+
* @return Fontis_EwayAu_Model_Token
|
282 |
+
*/
|
283 |
+
public function cancel(Varien_Object $payment)
|
284 |
+
{
|
285 |
+
$payment->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_DECLINED);
|
286 |
+
return $this;
|
287 |
+
}
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Get the request model.
|
291 |
+
*
|
292 |
+
* @return Fontis_EwayAu_Model_Token_Request
|
293 |
+
*/
|
294 |
+
public function getRequest()
|
295 |
+
{
|
296 |
+
if ($this->_request === null) {
|
297 |
+
$endpoint = $this->getApiGatewayUrl();
|
298 |
+
$this->_request = Mage::getModel('ewayau/token_request', array(
|
299 |
+
'wsdl' => $endpoint . '?WSDL',
|
300 |
+
'endpoint' => $endpoint,
|
301 |
+
'header' => array(
|
302 |
+
'eWAYCustomerID' => $this->getCustomerId(),
|
303 |
+
'Username' => $this->getUsername(),
|
304 |
+
'Password' => $this->getPassword(),
|
305 |
+
),
|
306 |
+
'soap_options' => array(
|
307 |
+
'exceptions' => false,
|
308 |
+
'trace' => (bool) $this->getDebugFlag(),
|
309 |
+
'soap_version' => SOAP_1_2,
|
310 |
+
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP,
|
311 |
+
'classmap' => $this->_soapClassMap,
|
312 |
+
),
|
313 |
+
));
|
314 |
+
}
|
315 |
+
|
316 |
+
return $this->_request;
|
317 |
+
}
|
318 |
+
|
319 |
+
/**
|
320 |
+
* @param string $method
|
321 |
+
* @param Varien_Object $paymentData
|
322 |
+
* @return Fontis_EwayAu_Model_Token_Request_Data
|
323 |
+
*/
|
324 |
+
public function getRequestData($method, $paymentData = null)
|
325 |
+
{
|
326 |
+
if ($this->_requestData === null) {
|
327 |
+
if (empty($paymentData)) {
|
328 |
+
$paymentData = $this->getPayment();
|
329 |
+
}
|
330 |
+
|
331 |
+
/** @var $salesObject Fontis_EwayAu_Model_Sales_Object */
|
332 |
+
$paymentInfo = $this->getInfoInstance();
|
333 |
+
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
334 |
+
$salesObject = $paymentInfo->getOrder();
|
335 |
+
} else {
|
336 |
+
$salesObject = $paymentInfo->getQuote();
|
337 |
+
}
|
338 |
+
|
339 |
+
if (!$salesObject) {
|
340 |
+
Mage::throwException($this->getTokenHelper()->__('An error has occurred while processing your payment. Please try later or contact us for help.'));
|
341 |
+
}
|
342 |
+
|
343 |
+
$tokenData = array(
|
344 |
+
'payment_data' => $paymentData,
|
345 |
+
'billing' => $salesObject->getBillingAddress(),
|
346 |
+
'sales_object' => $salesObject,
|
347 |
+
'amount' => $this->getAmount(),
|
348 |
+
'method' => $method,
|
349 |
+
);
|
350 |
+
|
351 |
+
$this->_requestData = Mage::getModel('ewayau/token_request_data', $tokenData);
|
352 |
+
}
|
353 |
+
|
354 |
+
$this->_requestData->setMethod($method);
|
355 |
+
if (!empty($paymentData)) {
|
356 |
+
$this->_requestData->setPaymentData($paymentData);
|
357 |
+
}
|
358 |
+
|
359 |
+
return $this->_requestData;
|
360 |
+
}
|
361 |
+
|
362 |
+
/**
|
363 |
+
* @param Varien_Object $paymentData
|
364 |
+
* @return Fontis_EwayAu_Model_Token_Response_CreateCustomer
|
365 |
+
*/
|
366 |
+
public function createCustomer($paymentData)
|
367 |
+
{
|
368 |
+
$soapMethod = Fontis_EwayAu_Model_Token_Request::CREATE_CUSTOMER;
|
369 |
+
$data = $this->getRequestData($soapMethod, $paymentData);
|
370 |
+
$response = $this->getRequest()->execute($soapMethod, $data->getCreateCustomerArray());
|
371 |
+
if ($response instanceof Fontis_EwayAu_Model_Token_Response) {
|
372 |
+
$response->process();
|
373 |
+
}
|
374 |
+
return $response;
|
375 |
+
}
|
376 |
+
|
377 |
+
/**
|
378 |
+
* @return Fontis_EwayAu_Model_Token_Response_QueryCustomerByReference
|
379 |
+
*/
|
380 |
+
public function queryCustomerByReference()
|
381 |
+
{
|
382 |
+
$soapMethod = Fontis_EwayAu_Model_Token_Request::QUERY_CUSTOMER_BY_REFERENCE;
|
383 |
+
$data = $this->getRequestData($soapMethod);
|
384 |
+
$response = $this->getRequest()->execute($soapMethod, $data->getQueryCustomerByReferenceArray());
|
385 |
+
if ($response instanceof Fontis_EwayAu_Model_Token_Response) {
|
386 |
+
$response->process();
|
387 |
+
} else {
|
388 |
+
// If the customer doesn't exist, an instance of SoapFault will be returned instead.
|
389 |
+
// This is unhelpful, as determining whether or not a customer already exists should
|
390 |
+
// not result in an error, and also because we already have our own logic to determine
|
391 |
+
// whether or not a request was successful.
|
392 |
+
// To get around this, just return an empty instance of the appropriate object. This
|
393 |
+
// will default to the request being unsuccessful, which is what we want in this case.
|
394 |
+
$response = Mage::getModel('ewayau/token_response_queryCustomerByReference');
|
395 |
+
}
|
396 |
+
return $response;
|
397 |
+
}
|
398 |
+
|
399 |
+
/**
|
400 |
+
* @param Varien_Object $paymentData
|
401 |
+
* @return Fontis_EwayAu_Model_Token_Response_ProcessPayment
|
402 |
+
*/
|
403 |
+
public function processPayment($paymentData)
|
404 |
+
{
|
405 |
+
$soapMethod = Fontis_EwayAu_Model_Token_Request::PROCESS_PAYMENT;
|
406 |
+
$data = $this->getRequestData($soapMethod, $paymentData);
|
407 |
+
$response = $this->getRequest()->execute($soapMethod, $data->getProcessPaymentArray());
|
408 |
+
if ($response instanceof Fontis_EwayAu_Model_Token_Response) {
|
409 |
+
$response->process();
|
410 |
+
}
|
411 |
+
return $response;
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Update eWAY token customer record.
|
416 |
+
*
|
417 |
+
* @param Varien_Object $paymentData
|
418 |
+
* @param Varien_Object $storedData
|
419 |
+
* @return bool
|
420 |
+
*/
|
421 |
+
public function updateCustomer($paymentData, $storedData = null)
|
422 |
+
{
|
423 |
+
$soapMethod = Fontis_EwayAu_Model_Token_Request::UPDATE_CUSTOMER;
|
424 |
+
$data = $this->getRequestData($soapMethod, $paymentData);
|
425 |
+
|
426 |
+
if (isset($storedData)) {
|
427 |
+
$newCustomerData = $data->getUpdateCustomerArray();
|
428 |
+
$cardExpired = true;
|
429 |
+
|
430 |
+
if (isset($newCustomerData['CCExpiryMonth']) && isset($newCustomerData['CCExpiryYear'])) {
|
431 |
+
$cardExpired = $this->getTokenHelper()->hasCreditCardExpired(
|
432 |
+
$newCustomerData['CCExpiryMonth'],
|
433 |
+
$newCustomerData['CCExpiryYear']
|
434 |
+
);
|
435 |
+
|
436 |
+
unset($newCustomerData['CCExpiryMonth']);
|
437 |
+
unset($newCustomerData['CCExpiryYear']);
|
438 |
+
}
|
439 |
+
|
440 |
+
if (!$cardExpired) {
|
441 |
+
$changeFound = false;
|
442 |
+
$usedFields = $data->getUsedCustomerFields();
|
443 |
+
|
444 |
+
foreach ($usedFields as $field) {
|
445 |
+
$storedDataField = $storedData->__get($field);
|
446 |
+
if (!isset($newCustomerData[$field]) && !empty($storedDataField)) {
|
447 |
+
$changeFound = true;
|
448 |
+
break;
|
449 |
+
} elseif ($field == 'CCNumber' && $this->getTokenHelper()->hasCreditCardNumberChanged($newCustomerData[$field], $storedDataField)) {
|
450 |
+
$changeFound = true;
|
451 |
+
break;
|
452 |
+
} elseif ($newCustomerData[$field] != $storedDataField) {
|
453 |
+
$changeFound = true;
|
454 |
+
break;
|
455 |
+
}
|
456 |
+
}
|
457 |
+
|
458 |
+
if ($changeFound === false) {
|
459 |
+
return false;
|
460 |
+
}
|
461 |
+
}
|
462 |
+
}
|
463 |
+
|
464 |
+
$response = $this->getRequest()->execute($soapMethod, $data->getUpdateCustomerArray());
|
465 |
+
if ($response instanceof Fontis_EwayAu_Model_Token_Response) {
|
466 |
+
$response->process();
|
467 |
+
}
|
468 |
+
return $response->isRequestSuccessful();
|
469 |
+
}
|
470 |
+
}
|
app/code/community/Fontis/EwayAu/Model/Token/Request.php
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Fontis_EwayAu_Model_Token_Request
|
22 |
+
{
|
23 |
+
// Soap API method names
|
24 |
+
const CREATE_CUSTOMER = 'CreateCustomer';
|
25 |
+
const UPDATE_CUSTOMER = 'UpdateCustomer';
|
26 |
+
const QUERY_CUSTOMER_BY_REFERENCE = 'QueryCustomerByReference';
|
27 |
+
const PROCESS_PAYMENT = 'ProcessPayment';
|
28 |
+
|
29 |
+
const SOAP_NAMESPACE = 'https://www.eway.com.au/gateway/managedpayment';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @var SoapClient
|
33 |
+
*/
|
34 |
+
protected $_client = null;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @var string
|
38 |
+
*/
|
39 |
+
protected $_endpoint = null;
|
40 |
+
|
41 |
+
protected $_header = array();
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @var Fontis_EwayAu_Helper_Token
|
45 |
+
*/
|
46 |
+
protected $_tokenHelper = null;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* @param array $options
|
50 |
+
*/
|
51 |
+
public function __construct($options = array())
|
52 |
+
{
|
53 |
+
if (!isset($options['wsdl']) && !is_string($options['wsdl'])) {
|
54 |
+
Mage::throwException('Invalid payment gateway endpoint');
|
55 |
+
}
|
56 |
+
|
57 |
+
if ($this->validateHeader($options['header'])) {
|
58 |
+
$this->_header = $options['header'];
|
59 |
+
}
|
60 |
+
|
61 |
+
if (isset($options['endpoint']) && is_string($options['endpoint'])) {
|
62 |
+
$this->_endpoint = $options['endpoint'];
|
63 |
+
}
|
64 |
+
|
65 |
+
$soapOptions = array();
|
66 |
+
if (isset($options['soap_options']) && is_array($options['soap_options'])) {
|
67 |
+
$soapOptions = $options['soap_options'];
|
68 |
+
}
|
69 |
+
|
70 |
+
$this->_client = new SoapClient($options['wsdl'], $soapOptions);
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* @return Fontis_EwayAu_Helper_Token
|
75 |
+
*/
|
76 |
+
protected function getTokenHelper()
|
77 |
+
{
|
78 |
+
if ($this->_tokenHelper === null) {
|
79 |
+
$this->_tokenHelper = Mage::helper('ewayau/token');
|
80 |
+
}
|
81 |
+
|
82 |
+
return $this->_tokenHelper;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Perform eWAY token payments API request.
|
87 |
+
*
|
88 |
+
* @param string $soapMethod
|
89 |
+
* @param array $data
|
90 |
+
* @return Fontis_EwayAu_Model_Token_Response|SoapFault
|
91 |
+
* @throws Mage_Core_Exception
|
92 |
+
*/
|
93 |
+
public function execute($soapMethod, $data)
|
94 |
+
{
|
95 |
+
if (empty($data)) {
|
96 |
+
Mage::throwException('Invalid checkout information.');
|
97 |
+
}
|
98 |
+
|
99 |
+
$this->getTokenHelper()->logMessage('request', $data);
|
100 |
+
$this->getTokenHelper()->logMessage('header', $this->_header);
|
101 |
+
|
102 |
+
$client = $this->getClient();
|
103 |
+
|
104 |
+
try {
|
105 |
+
$response = $client->__soapCall(
|
106 |
+
$soapMethod,
|
107 |
+
array($data),
|
108 |
+
array(
|
109 |
+
'location' => $this->getEndpoint(),
|
110 |
+
),
|
111 |
+
$this->getSoapHeader()
|
112 |
+
);
|
113 |
+
} catch (Exception $e) {
|
114 |
+
$this->getTokenHelper()->logMessage($e->getMessage());
|
115 |
+
Mage::throwException('There was an error when attempting to process your checkout request.');
|
116 |
+
}
|
117 |
+
|
118 |
+
return $response;
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Get eWAY token payment endpoint URL.
|
123 |
+
*
|
124 |
+
* @return bool|string
|
125 |
+
*/
|
126 |
+
public function getEndpoint()
|
127 |
+
{
|
128 |
+
return $this->_endpoint;
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Get the Client object.
|
133 |
+
*
|
134 |
+
* @return SoapClient
|
135 |
+
*/
|
136 |
+
public function getClient()
|
137 |
+
{
|
138 |
+
return $this->_client;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Get the raw header array.
|
143 |
+
*
|
144 |
+
* @return array
|
145 |
+
*/
|
146 |
+
public function getHeader()
|
147 |
+
{
|
148 |
+
return $this->_header;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Get the SOAP header used to perform a request on the eWAY token payments API.
|
153 |
+
*
|
154 |
+
* @return SoapHeader
|
155 |
+
*/
|
156 |
+
public function getSoapHeader()
|
157 |
+
{
|
158 |
+
$data = $this->getHeader();
|
159 |
+
$namespace = self::SOAP_NAMESPACE;
|
160 |
+
|
161 |
+
return new SoapHeader(
|
162 |
+
$namespace,
|
163 |
+
'eWAYHeader',
|
164 |
+
new SoapVar($data, SOAP_ENC_OBJECT, 'eWAYHeader', $namespace)
|
165 |
+
);
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Determine if the SOAP header data is valid.
|
170 |
+
*
|
171 |
+
* @param array $header
|
172 |
+
* @return bool
|
173 |
+
*/
|
174 |
+
public function validateHeader($header = array())
|
175 |
+
{
|
176 |
+
if (empty($header)) {
|
177 |
+
$header = $this->getHeader();
|
178 |
+
}
|
179 |
+
|
180 |
+
if (!is_array($header)) {
|
181 |
+
Mage::throwException('Invalid request header format.');
|
182 |
+
}
|
183 |
+
|
184 |
+
if (!isset($header['eWAYCustomerID']) && !strlen($header['eWAYCustomerID']) <= 8) {
|
185 |
+
Mage::throwException('Invalid eWAY customer ID.');
|
186 |
+
}
|
187 |
+
|
188 |
+
if (!isset($header['Username']) && !strlen($header['Username']) <= 100) {
|
189 |
+
Mage::throwException('Invalid eWAY username.');
|
190 |
+
}
|
191 |
+
|
192 |
+
if (!isset($header['Password']) && !strlen($header['Password']) <= 50) {
|
193 |
+
Mage::throwException('Invalid eWAY password.');
|
194 |
+
}
|
195 |
+
|
196 |
+
return true;
|
197 |
+
}
|
198 |
+
}
|
app/code/community/Fontis/EwayAu/Model/Token/Request/Data.php
ADDED
@@ -0,0 +1,337 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Fontis_EwayAu_Model_Token_Request_Data extends Varien_Object
|
22 |
+
{
|
23 |
+
const EWAY_CUSTOMER_ID_FIELD = 'managedCustomerID';
|
24 |
+
|
25 |
+
const DEFAULT_CUSTOMER_TITLE = 'Mr.';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
protected $_method = null;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @var Varien_Object
|
34 |
+
*/
|
35 |
+
protected $_paymentData = null;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @var Mage_Customer_Model_Address_Abstract
|
39 |
+
*/
|
40 |
+
protected $_billing = null;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @var Fontis_EwayAu_Model_Sales_Object
|
44 |
+
*/
|
45 |
+
protected $_salesObject = null;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @var int
|
49 |
+
*/
|
50 |
+
protected $_amount = 0;
|
51 |
+
|
52 |
+
public function __construct($data = array())
|
53 |
+
{
|
54 |
+
if (!isset($data['method'])) {
|
55 |
+
Mage::throwException('Checkout request is invalid.');
|
56 |
+
}
|
57 |
+
|
58 |
+
$this->_method = $data['method'];
|
59 |
+
|
60 |
+
if (!isset($data['sales_object'])) {
|
61 |
+
Mage::throwException('Order information is invalid.');
|
62 |
+
}
|
63 |
+
|
64 |
+
$this->_salesObject = $data['sales_object'];
|
65 |
+
|
66 |
+
if (!isset($data['payment_data']) && $this->isPaymentTransaction()) {
|
67 |
+
Mage::throwException('Payment data is invalid.');
|
68 |
+
} elseif (isset($data['payment_data'])) {
|
69 |
+
$this->_paymentData = $data['payment_data'];
|
70 |
+
}
|
71 |
+
|
72 |
+
if (!isset($data['billing'])) {
|
73 |
+
Mage::throwException('Billing information is invalid.');
|
74 |
+
}
|
75 |
+
|
76 |
+
$this->_billing = $data['billing'];
|
77 |
+
|
78 |
+
if (isset($data['amount'])) {
|
79 |
+
$this->setAmount($data['amount']);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* @param string $method
|
85 |
+
*/
|
86 |
+
public function setMethod($method)
|
87 |
+
{
|
88 |
+
$this->_method = $method;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* @return string
|
93 |
+
*/
|
94 |
+
public function getMethod()
|
95 |
+
{
|
96 |
+
return $this->_method;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @param Varien_Object $paymentData
|
101 |
+
*/
|
102 |
+
public function setPaymentData($paymentData)
|
103 |
+
{
|
104 |
+
$this->_paymentData = $paymentData;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* @return Varien_Object
|
109 |
+
*/
|
110 |
+
public function getPaymentData()
|
111 |
+
{
|
112 |
+
return $this->_paymentData;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* @return Fontis_EwayAu_Model_Sales_Object
|
117 |
+
*/
|
118 |
+
public function getSalesObject()
|
119 |
+
{
|
120 |
+
return $this->_salesObject;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* @param float $amount
|
125 |
+
* @return int
|
126 |
+
*/
|
127 |
+
public function setAmount($amount)
|
128 |
+
{
|
129 |
+
$this->_amount = (int) bcmul($amount, 100);
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* @return int
|
134 |
+
*/
|
135 |
+
public function getAmount()
|
136 |
+
{
|
137 |
+
return $this->_amount;
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* @return Mage_Customer_Model_Address_Abstract
|
142 |
+
*/
|
143 |
+
public function getBilling()
|
144 |
+
{
|
145 |
+
return $this->_billing;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* @return bool
|
150 |
+
*/
|
151 |
+
public function isPaymentTransaction()
|
152 |
+
{
|
153 |
+
$method = $this->getMethod();
|
154 |
+
$paymentRequests = array(
|
155 |
+
Fontis_EwayAu_Model_Token_Request::PROCESS_PAYMENT,
|
156 |
+
);
|
157 |
+
|
158 |
+
if (in_array($method, $paymentRequests)) {
|
159 |
+
return true;
|
160 |
+
}
|
161 |
+
|
162 |
+
return false;
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Returns the eWAY customer ID for the customer.
|
167 |
+
*
|
168 |
+
* @return int
|
169 |
+
*/
|
170 |
+
public function getCustomerId()
|
171 |
+
{
|
172 |
+
return Mage::helper('ewayau/token')->getCustomerId();
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* @return string[]
|
177 |
+
*/
|
178 |
+
public function getValidCustomerTitles()
|
179 |
+
{
|
180 |
+
return array('Mr.', 'Ms.', 'Mrs.', 'Miss', 'Dr.', 'Sir.', 'Prof.');
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* @param string $title
|
185 |
+
* @return bool
|
186 |
+
*/
|
187 |
+
public function validCustomerTitle($title)
|
188 |
+
{
|
189 |
+
if (in_array($title, $this->getValidCustomerTitles())) {
|
190 |
+
return true;
|
191 |
+
} else {
|
192 |
+
return false;
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Returns the quote/order ID, used as the merchant reference when passing data to eWAY.
|
198 |
+
*
|
199 |
+
* @return string
|
200 |
+
*/
|
201 |
+
public function getCustomerRef()
|
202 |
+
{
|
203 |
+
return $this->getSalesObject()->getId();
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* @return string
|
208 |
+
*/
|
209 |
+
public function getFormattedAddress()
|
210 |
+
{
|
211 |
+
$address = '';
|
212 |
+
$billing = $this->getBilling();
|
213 |
+
$addressLines = $billing->getStreet();
|
214 |
+
|
215 |
+
if (!empty($addressLines)) {
|
216 |
+
foreach ($addressLines as $line) {
|
217 |
+
$address .= trim(str_replace("\n", ' ', $line)) . ' ';
|
218 |
+
}
|
219 |
+
}
|
220 |
+
|
221 |
+
return trim($address);
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* @return array
|
226 |
+
*/
|
227 |
+
public function getUsedCustomerFields()
|
228 |
+
{
|
229 |
+
return array(
|
230 |
+
'Title', 'FirstName', 'LastName', 'Email', 'Country',
|
231 |
+
'CCNameOnCard', 'CCExpiryMonth', 'CCExpiryYear', 'CCNumber',
|
232 |
+
);
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* @return array
|
237 |
+
*/
|
238 |
+
public function createCustomerDataArray()
|
239 |
+
{
|
240 |
+
$requestData = array();
|
241 |
+
$billing = $this->getBilling();
|
242 |
+
$paymentData = $this->getPaymentData();
|
243 |
+
|
244 |
+
$title = $billing->getPrefix();
|
245 |
+
|
246 |
+
if (empty($title)) {
|
247 |
+
$title = self::DEFAULT_CUSTOMER_TITLE;
|
248 |
+
} elseif (!$this->validCustomerTitle($title)) {
|
249 |
+
if ($this->validCustomerTitle($title . '.')) {
|
250 |
+
$title = $title . '.';
|
251 |
+
} else {
|
252 |
+
$title = self::DEFAULT_CUSTOMER_TITLE;
|
253 |
+
}
|
254 |
+
}
|
255 |
+
|
256 |
+
$requestData['Title'] = $title;
|
257 |
+
$requestData['FirstName'] = $billing->getFirstname();
|
258 |
+
$requestData['LastName'] = $billing->getLastname();
|
259 |
+
$requestData['Email'] = '';
|
260 |
+
$requestData['Address'] = '';
|
261 |
+
$requestData['Suburb'] = '';
|
262 |
+
$requestData['State'] = '';
|
263 |
+
$requestData['PostCode'] = '';
|
264 |
+
// eWAY expects the country code to be lowercase
|
265 |
+
$requestData['Country'] = strtolower($billing->getCountryId());
|
266 |
+
// API call will not work if these fields are not specified.
|
267 |
+
$requestData['Company'] = '';
|
268 |
+
$requestData['JobDesc'] = '';
|
269 |
+
$requestData['Phone'] = '';
|
270 |
+
$requestData['Mobile'] = '';
|
271 |
+
$requestData['Fax'] = '';
|
272 |
+
$requestData['Comments'] = '';
|
273 |
+
$requestData['URL'] = '';
|
274 |
+
$requestData['CustomerRef'] = $this->getCustomerRef();
|
275 |
+
|
276 |
+
$requestData['CCNumber'] = $paymentData->getCcNumber();
|
277 |
+
$requestData['CCNameOnCard'] = $paymentData->getCcOwner();
|
278 |
+
$requestData['CCExpiryMonth'] = $paymentData->getCcExpMonth();
|
279 |
+
|
280 |
+
$ccYear = $paymentData->getCcExpYear();
|
281 |
+
if (strlen($ccYear) > 2) {
|
282 |
+
// Assume the four digits were entered for the year, and take the last two.
|
283 |
+
// eg. convert '2014' to '14'
|
284 |
+
$ccYear = substr($paymentData->getCcExpYear(), -2);
|
285 |
+
}
|
286 |
+
|
287 |
+
$requestData['CCExpiryYear'] = $ccYear;
|
288 |
+
|
289 |
+
return $requestData;
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* @return array
|
294 |
+
*/
|
295 |
+
public function getCreateCustomerArray()
|
296 |
+
{
|
297 |
+
return $this->createCustomerDataArray();
|
298 |
+
}
|
299 |
+
|
300 |
+
/**
|
301 |
+
* @return array
|
302 |
+
*/
|
303 |
+
public function getUpdateCustomerArray()
|
304 |
+
{
|
305 |
+
$requestArray = $this->createCustomerDataArray();
|
306 |
+
$requestArray[self::EWAY_CUSTOMER_ID_FIELD] = $this->getCustomerId();
|
307 |
+
|
308 |
+
return $requestArray;
|
309 |
+
}
|
310 |
+
|
311 |
+
/**
|
312 |
+
* @return array
|
313 |
+
*/
|
314 |
+
public function getQueryCustomerByReferenceArray()
|
315 |
+
{
|
316 |
+
return array('CustomerReference' => $this->getCustomerRef());
|
317 |
+
}
|
318 |
+
|
319 |
+
/**
|
320 |
+
* @return array
|
321 |
+
*/
|
322 |
+
public function getProcessPaymentArray()
|
323 |
+
{
|
324 |
+
$customerId = $this->getCustomerId();
|
325 |
+
|
326 |
+
if (!$customerId) {
|
327 |
+
Mage::throwException('Unable to process payment.');
|
328 |
+
}
|
329 |
+
|
330 |
+
return array(
|
331 |
+
self::EWAY_CUSTOMER_ID_FIELD => $customerId,
|
332 |
+
'amount' => $this->getAmount(),
|
333 |
+
'invoiceReference' => $this->getSalesObject()->getIncrementId(), // Only present on the order object
|
334 |
+
'invoiceDescription' => Mage::helper('ewayau')->getInvoiceDescription($this->getSalesObject()),
|
335 |
+
);
|
336 |
+
}
|
337 |
+
}
|
app/code/community/Fontis/EwayAu/Model/Token/Response.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
abstract class Fontis_EwayAu_Model_Token_Response extends Varien_Object
|
22 |
+
{
|
23 |
+
const CUSTOMER_ID_FIELD = 'ManagedCustomerID';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var bool
|
27 |
+
*/
|
28 |
+
protected $_isRequestSuccessful = false;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @var Fontis_EwayAu_Helper_Token
|
32 |
+
*/
|
33 |
+
protected $_tokenHelper = null;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @return bool
|
37 |
+
*/
|
38 |
+
public function process()
|
39 |
+
{
|
40 |
+
$this->getTokenHelper()->logMessage(get_class($this), $this->getData());
|
41 |
+
return $this->_isRequestSuccessful;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @return Fontis_EwayAu_Helper_Token
|
46 |
+
*/
|
47 |
+
protected function getTokenHelper()
|
48 |
+
{
|
49 |
+
if ($this->_tokenHelper === null) {
|
50 |
+
$this->_tokenHelper = Mage::helper('ewayau/token');
|
51 |
+
}
|
52 |
+
|
53 |
+
return $this->_tokenHelper;
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @return bool
|
58 |
+
*/
|
59 |
+
public function isRequestSuccessful()
|
60 |
+
{
|
61 |
+
return $this->_isRequestSuccessful;
|
62 |
+
}
|
63 |
+
}
|
app/code/community/Fontis/EwayAu/Model/Token/Response/CreateCustomer.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Fontis_EwayAu_Model_Token_Response_CreateCustomer extends Fontis_EwayAu_Model_Token_Response
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @return bool
|
25 |
+
*/
|
26 |
+
public function process()
|
27 |
+
{
|
28 |
+
if ($customerId = $this->getCreateCustomerResult()) {
|
29 |
+
$this->_isRequestSuccessful = true;
|
30 |
+
$this->getTokenHelper()->setCustomerId($customerId);
|
31 |
+
}
|
32 |
+
|
33 |
+
return parent::process();
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Fontis/EwayAu/Model/Token/Response/ProcessPayment.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Fontis_EwayAu_Model_Token_Response_ProcessPayment extends Fontis_EwayAu_Model_Token_Response
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @return bool
|
25 |
+
*/
|
26 |
+
public function process()
|
27 |
+
{
|
28 |
+
if ($result = $this->getEwayResponse()) {
|
29 |
+
if ($result->getEwayTrxnStatus() === "True") {
|
30 |
+
$this->_isRequestSuccessful = true;
|
31 |
+
}
|
32 |
+
$this->_data = $result->getData();
|
33 |
+
}
|
34 |
+
|
35 |
+
return parent::process();
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Fontis/EwayAu/Model/Token/Response/QueryCustomerByReference.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Fontis_EwayAu_Model_Token_Response_QueryCustomerByReference extends Fontis_EwayAu_Model_Token_Response
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @return bool
|
25 |
+
*/
|
26 |
+
public function process()
|
27 |
+
{
|
28 |
+
if ($result = $this->getQueryCustomerByReferenceResult()) {
|
29 |
+
$customerId = $result->getManagedCustomerId();
|
30 |
+
$this->_isRequestSuccessful = true;
|
31 |
+
$this->getTokenHelper()->setCustomerId($customerId);
|
32 |
+
$this->_data = $result->getData();
|
33 |
+
}
|
34 |
+
|
35 |
+
return parent::process();
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Fontis/EwayAu/Model/Token/Response/UpdateCustomer.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Fontis_EwayAu_Model_Token_Response_UpdateCustomer extends Fontis_EwayAu_Model_Token_Response
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @return bool
|
25 |
+
*/
|
26 |
+
public function process()
|
27 |
+
{
|
28 |
+
if ($customerId = $this->getUpdateCustomerResult()) {
|
29 |
+
$this->_isRequestSuccessful = true;
|
30 |
+
}
|
31 |
+
|
32 |
+
return parent::process();
|
33 |
+
}
|
34 |
+
}
|
app/code/community/Fontis/EwayAu/controllers/SecureController.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,22 +8,21 @@
|
|
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 |
-
* @
|
|
|
|
|
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 Fontis_EwayAu_SecureController extends Fontis_EwayAu_Controller_Abstract
|
27 |
{
|
|
|
|
|
|
|
28 |
protected $_redirectBlockType = 'ewayau/secure_redirect';
|
29 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
13 |
*
|
14 |
* @category Fontis
|
15 |
* @package Fontis_EwayAu
|
16 |
+
* @author Chris Norton
|
17 |
+
* @author Matthew Gamble
|
18 |
+
* @copyright Copyright (c) 2014 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 |
class Fontis_EwayAu_SecureController extends Fontis_EwayAu_Controller_Abstract
|
23 |
{
|
24 |
+
/**
|
25 |
+
* @var string
|
26 |
+
*/
|
27 |
protected $_redirectBlockType = 'ewayau/secure_redirect';
|
28 |
}
|
app/code/community/Fontis/EwayAu/controllers/SharedController.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,19 +8,21 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
class Fontis_EwayAu_SharedController extends Fontis_EwayAu_Controller_Abstract
|
24 |
{
|
|
|
|
|
|
|
25 |
protected $_redirectBlockType = 'ewayau/shared_redirect';
|
26 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
13 |
*
|
14 |
* @category Fontis
|
15 |
* @package Fontis_EwayAu
|
16 |
+
* @author Chris Norton
|
17 |
+
* @author Matthew Gamble
|
18 |
+
* @copyright Copyright (c) 2014 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 |
class Fontis_EwayAu_SharedController extends Fontis_EwayAu_Controller_Abstract
|
23 |
{
|
24 |
+
/**
|
25 |
+
* @var string
|
26 |
+
*/
|
27 |
protected $_redirectBlockType = 'ewayau/shared_redirect';
|
28 |
}
|
app/code/community/Fontis/EwayAu/controllers/System/Config/Test/LoginController.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Fontis_EwayAu_System_Config_Test_LoginController extends Mage_Adminhtml_Controller_Action
|
21 |
+
{
|
22 |
+
const ERR_LOGIN_FAILED = 'Login failed';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Tests if the credentials present in the admin panel fields are valid. This doesn't
|
26 |
+
* check the saved values from config but instead uses whatever it typed into the fields
|
27 |
+
* at the time the button is pressed.
|
28 |
+
* This will use the eWay API set up in the extension, ie: it will take into account test
|
29 |
+
* mode if that is set to be on.
|
30 |
+
*/
|
31 |
+
public function testTokenAction()
|
32 |
+
{
|
33 |
+
// Set up the SOAP object with the eway credentials in the admin panel fields.
|
34 |
+
$postData = $this->getRequest()->getPost();
|
35 |
+
|
36 |
+
$testGateway = $postData['test_gateway'] ? true : false;
|
37 |
+
$endpoint = Mage::getModel('ewayau/token')->getApiGatewayUrl($testGateway);
|
38 |
+
|
39 |
+
$request = Mage::getModel('ewayau/token_request', array(
|
40 |
+
'wsdl' => $endpoint . '?WSDL',
|
41 |
+
'endpoint' => $endpoint,
|
42 |
+
'header' => array(
|
43 |
+
'eWAYCustomerID' => $postData['customer_id'],
|
44 |
+
'Username' => $postData['username'],
|
45 |
+
'Password' => $postData['password'],
|
46 |
+
),
|
47 |
+
'soap_options' => array(
|
48 |
+
'exceptions' => false,
|
49 |
+
'soap_version' => SOAP_1_2,
|
50 |
+
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP
|
51 |
+
)
|
52 |
+
));
|
53 |
+
|
54 |
+
// Test the API using QueryCustomer. If it fails to login (ie: incorrect credentials) it will return
|
55 |
+
// the string "Login failed" as part of the exception. In other cases it will either succeed (if customer ID
|
56 |
+
// 1 exists or return an exception that doesn't include "Login failed".
|
57 |
+
try {
|
58 |
+
$return = $request->execute('QueryCustomer', '1');
|
59 |
+
echo $this->processTokenResponse($return);
|
60 |
+
} catch (Exception $e) {
|
61 |
+
echo $this->processTokenResponse($e);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @param object $responseObject
|
67 |
+
* @return int
|
68 |
+
*/
|
69 |
+
protected function processTokenResponse($responseObject)
|
70 |
+
{
|
71 |
+
if ($responseObject instanceof Exception) {
|
72 |
+
if (strpos($responseObject->getMessage(), self::ERR_LOGIN_FAILED) === false) {
|
73 |
+
return 1;
|
74 |
+
} else {
|
75 |
+
return 0;
|
76 |
+
}
|
77 |
+
} else {
|
78 |
+
return 1;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
app/code/community/Fontis/EwayAu/etc/config.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
* Fontis eWAY Australia
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
@@ -9,22 +9,19 @@
|
|
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 Fontis_EwayAu
|
20 |
-
* @
|
|
|
|
|
21 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
*/
|
23 |
-->
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Fontis_EwayAu>
|
27 |
-
<version>1.
|
28 |
</Fontis_EwayAu>
|
29 |
</modules>
|
30 |
<global>
|
@@ -59,7 +56,9 @@
|
|
59 |
</ewayau_read>
|
60 |
</resources>
|
61 |
<blocks>
|
62 |
-
<ewayau
|
|
|
|
|
63 |
</blocks>
|
64 |
<payment>
|
65 |
<cc>
|
@@ -80,7 +79,7 @@
|
|
80 |
</global>
|
81 |
<frontend>
|
82 |
<secure_url>
|
83 |
-
<ewayau_shared>/ewayau
|
84 |
</secure_url>
|
85 |
<routers>
|
86 |
<ewayau>
|
@@ -103,12 +102,19 @@
|
|
103 |
<layout>
|
104 |
<updates>
|
105 |
<ewayau>
|
106 |
-
<file>
|
107 |
</ewayau>
|
108 |
</updates>
|
109 |
</layout>
|
110 |
</frontend>
|
111 |
<adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
<translate>
|
113 |
<modules>
|
114 |
<Fontis_EwayAu>
|
@@ -149,6 +155,32 @@
|
|
149 |
<order_status>processing</order_status>
|
150 |
<allowspecific>0</allowspecific>
|
151 |
</ewayau_secure>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
</payment>
|
153 |
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
+
* Fontis eWAY Australia Extension
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
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 |
*
|
13 |
* @category Fontis
|
14 |
* @package Fontis_EwayAu
|
15 |
+
* @author Chris Norton
|
16 |
+
* @author Matthew Gamble
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
-->
|
21 |
<config>
|
22 |
<modules>
|
23 |
<Fontis_EwayAu>
|
24 |
+
<version>1.3.0</version>
|
25 |
</Fontis_EwayAu>
|
26 |
</modules>
|
27 |
<global>
|
56 |
</ewayau_read>
|
57 |
</resources>
|
58 |
<blocks>
|
59 |
+
<ewayau>
|
60 |
+
<class>Fontis_EwayAu_Block</class>
|
61 |
+
</ewayau>
|
62 |
</blocks>
|
63 |
<payment>
|
64 |
<cc>
|
79 |
</global>
|
80 |
<frontend>
|
81 |
<secure_url>
|
82 |
+
<ewayau_shared>/ewayau</ewayau_shared>
|
83 |
</secure_url>
|
84 |
<routers>
|
85 |
<ewayau>
|
102 |
<layout>
|
103 |
<updates>
|
104 |
<ewayau>
|
105 |
+
<file>fontis/ewayau.xml</file>
|
106 |
</ewayau>
|
107 |
</updates>
|
108 |
</layout>
|
109 |
</frontend>
|
110 |
<adminhtml>
|
111 |
+
<layout>
|
112 |
+
<updates>
|
113 |
+
<ewayau>
|
114 |
+
<file>fontis/ewayau.xml</file>
|
115 |
+
</ewayau>
|
116 |
+
</updates>
|
117 |
+
</layout>
|
118 |
<translate>
|
119 |
<modules>
|
120 |
<Fontis_EwayAu>
|
155 |
<order_status>processing</order_status>
|
156 |
<allowspecific>0</allowspecific>
|
157 |
</ewayau_secure>
|
158 |
+
<ewayau_token>
|
159 |
+
<customer_id backend_model="adminhtml/system_config_backend_encrypted"/>
|
160 |
+
<username backend_model="adminhtml/system_config_backend_encrypted"/>
|
161 |
+
<password backend_model="adminhtml/system_config_backend_encrypted"/>
|
162 |
+
<currency>AUD</currency>
|
163 |
+
<payment_action>authorize_capture</payment_action>
|
164 |
+
<model>ewayau/token</model>
|
165 |
+
<title>eWAY Token</title>
|
166 |
+
<show_in_checkout>0</show_in_checkout>
|
167 |
+
<order_status>processing</order_status>
|
168 |
+
<cctypes>AE,VI,MC,DICL,JCB</cctypes>
|
169 |
+
<allowspecific>0</allowspecific>
|
170 |
+
<test_gateway>0</test_gateway>
|
171 |
+
<debug>0</debug>
|
172 |
+
</ewayau_token>
|
173 |
</payment>
|
174 |
</default>
|
175 |
+
<admin>
|
176 |
+
<routers>
|
177 |
+
<adminhtml>
|
178 |
+
<args>
|
179 |
+
<modules>
|
180 |
+
<ewayau before="Mage_Adminhtml">Fontis_EwayAu</ewayau>
|
181 |
+
</modules>
|
182 |
+
</args>
|
183 |
+
</adminhtml>
|
184 |
+
</routers>
|
185 |
+
</admin>
|
186 |
</config>
|
app/code/community/Fontis/EwayAu/etc/system.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
* Fontis eWAY Australia
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
@@ -9,15 +9,12 @@
|
|
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 Fontis_EwayAu
|
20 |
-
* @
|
|
|
|
|
21 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
*/
|
23 |
-->
|
@@ -31,7 +28,7 @@
|
|
31 |
<sort_order>201</sort_order>
|
32 |
<show_in_default>1</show_in_default>
|
33 |
<show_in_website>1</show_in_website>
|
34 |
-
<show_in_store>
|
35 |
<fields>
|
36 |
<active translate="label">
|
37 |
<label>Enabled</label>
|
@@ -40,7 +37,7 @@
|
|
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>
|
44 |
</active>
|
45 |
<title translate="label">
|
46 |
<label>Title</label>
|
@@ -48,7 +45,7 @@
|
|
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>
|
52 |
</title>
|
53 |
<customer_id translate="label">
|
54 |
<label>Customer ID</label>
|
@@ -57,7 +54,7 @@
|
|
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>
|
61 |
</customer_id>
|
62 |
<refund_password translate="label">
|
63 |
<label>Refund Password</label>
|
@@ -66,7 +63,7 @@
|
|
66 |
<sort_order>40</sort_order>
|
67 |
<show_in_default>1</show_in_default>
|
68 |
<show_in_website>1</show_in_website>
|
69 |
-
<show_in_store>
|
70 |
</refund_password>
|
71 |
<currency translate="label">
|
72 |
<label>Accepted currency</label>
|
@@ -75,17 +72,26 @@
|
|
75 |
<sort_order>50</sort_order>
|
76 |
<show_in_default>1</show_in_default>
|
77 |
<show_in_website>1</show_in_website>
|
78 |
-
<show_in_store>
|
79 |
</currency>
|
80 |
<test_gateway translate="label">
|
81 |
<label>Use test gateway</label>
|
82 |
<frontend_type>select</frontend_type>
|
83 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
84 |
-
<sort_order>
|
85 |
<show_in_default>1</show_in_default>
|
86 |
<show_in_website>1</show_in_website>
|
87 |
-
<show_in_store>
|
88 |
</test_gateway>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
<order_status translate="label">
|
90 |
<label>New order status</label>
|
91 |
<frontend_type>select</frontend_type>
|
@@ -93,7 +99,7 @@
|
|
93 |
<sort_order>80</sort_order>
|
94 |
<show_in_default>1</show_in_default>
|
95 |
<show_in_website>1</show_in_website>
|
96 |
-
<show_in_store>
|
97 |
</order_status>
|
98 |
<cctypes translate="label">
|
99 |
<label>Credit Card Types</label>
|
@@ -102,7 +108,7 @@
|
|
102 |
<sort_order>90</sort_order>
|
103 |
<show_in_default>1</show_in_default>
|
104 |
<show_in_website>1</show_in_website>
|
105 |
-
<show_in_store>
|
106 |
</cctypes>
|
107 |
<useccv translate="label">
|
108 |
<label>Credit Card Verification</label>
|
@@ -111,7 +117,7 @@
|
|
111 |
<sort_order>100</sort_order>
|
112 |
<show_in_default>1</show_in_default>
|
113 |
<show_in_website>1</show_in_website>
|
114 |
-
<show_in_store>
|
115 |
</useccv>
|
116 |
<allowspecific translate="label">
|
117 |
<label>Payment from applicable countries</label>
|
@@ -125,7 +131,7 @@
|
|
125 |
<specificcountry translate="label">
|
126 |
<label>Payment from Specific countries</label>
|
127 |
<frontend_type>multiselect</frontend_type>
|
128 |
-
<sort_order>
|
129 |
<source_model>adminhtml/system_config_source_country</source_model>
|
130 |
<show_in_default>1</show_in_default>
|
131 |
<show_in_website>1</show_in_website>
|
@@ -134,10 +140,10 @@
|
|
134 |
<sort_order translate="label">
|
135 |
<label>Sort order</label>
|
136 |
<frontend_type>text</frontend_type>
|
137 |
-
<sort_order>
|
138 |
<show_in_default>1</show_in_default>
|
139 |
<show_in_website>1</show_in_website>
|
140 |
-
<show_in_store>
|
141 |
</sort_order>
|
142 |
</fields>
|
143 |
</ewayau_direct>
|
@@ -147,64 +153,64 @@
|
|
147 |
<sort_order>202</sort_order>
|
148 |
<show_in_default>1</show_in_default>
|
149 |
<show_in_website>1</show_in_website>
|
150 |
-
<show_in_store>
|
151 |
<fields>
|
152 |
<active translate="label">
|
153 |
<label>Enabled</label>
|
154 |
<frontend_type>select</frontend_type>
|
155 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
156 |
-
<sort_order>
|
157 |
<show_in_default>1</show_in_default>
|
158 |
<show_in_website>1</show_in_website>
|
159 |
-
<show_in_store>
|
160 |
</active>
|
161 |
<title translate="label">
|
162 |
<label>Title</label>
|
163 |
<frontend_type>text</frontend_type>
|
164 |
-
<sort_order>
|
165 |
<show_in_default>1</show_in_default>
|
166 |
<show_in_website>1</show_in_website>
|
167 |
-
<show_in_store>
|
168 |
</title>
|
169 |
<customer_id translate="label">
|
170 |
<label>Customer ID</label>
|
171 |
<frontend_type>text</frontend_type>
|
172 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
173 |
-
<sort_order>
|
174 |
<show_in_default>1</show_in_default>
|
175 |
<show_in_website>1</show_in_website>
|
176 |
-
<show_in_store>
|
177 |
</customer_id>
|
178 |
<currency translate="label">
|
179 |
<label>Accepted currency</label>
|
180 |
<frontend_type>select</frontend_type>
|
181 |
<source_model>adminhtml/system_config_source_currency</source_model>
|
182 |
-
<sort_order>
|
183 |
<show_in_default>1</show_in_default>
|
184 |
<show_in_website>1</show_in_website>
|
185 |
-
<show_in_store>
|
186 |
</currency>
|
187 |
<api_url translate="label">
|
188 |
<label>API Gateway URL</label>
|
189 |
<frontend_type>text</frontend_type>
|
190 |
-
<sort_order>
|
191 |
<show_in_default>1</show_in_default>
|
192 |
<show_in_website>1</show_in_website>
|
193 |
-
<show_in_store>
|
194 |
</api_url>
|
195 |
<order_status translate="label">
|
196 |
<label>New order status</label>
|
197 |
<frontend_type>select</frontend_type>
|
198 |
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
199 |
-
<sort_order>
|
200 |
<show_in_default>1</show_in_default>
|
201 |
<show_in_website>1</show_in_website>
|
202 |
-
<show_in_store>
|
203 |
</order_status>
|
204 |
<allowspecific translate="label">
|
205 |
<label>Payment from applicable countries</label>
|
206 |
<frontend_type>allowspecific</frontend_type>
|
207 |
-
<sort_order>
|
208 |
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
209 |
<show_in_default>1</show_in_default>
|
210 |
<show_in_website>1</show_in_website>
|
@@ -213,7 +219,7 @@
|
|
213 |
<specificcountry translate="label">
|
214 |
<label>Payment from Specific countries</label>
|
215 |
<frontend_type>multiselect</frontend_type>
|
216 |
-
<sort_order>
|
217 |
<source_model>adminhtml/system_config_source_country</source_model>
|
218 |
<show_in_default>1</show_in_default>
|
219 |
<show_in_website>1</show_in_website>
|
@@ -222,10 +228,10 @@
|
|
222 |
<sort_order translate="label">
|
223 |
<label>Sort order</label>
|
224 |
<frontend_type>text</frontend_type>
|
225 |
-
<sort_order>
|
226 |
<show_in_default>1</show_in_default>
|
227 |
<show_in_website>1</show_in_website>
|
228 |
-
<show_in_store>
|
229 |
</sort_order>
|
230 |
</fields>
|
231 |
</ewayau_shared>
|
@@ -235,64 +241,64 @@
|
|
235 |
<sort_order>203</sort_order>
|
236 |
<show_in_default>1</show_in_default>
|
237 |
<show_in_website>1</show_in_website>
|
238 |
-
<show_in_store>
|
239 |
<fields>
|
240 |
<active translate="label">
|
241 |
<label>Enabled</label>
|
242 |
<frontend_type>select</frontend_type>
|
243 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
244 |
-
<sort_order>
|
245 |
<show_in_default>1</show_in_default>
|
246 |
<show_in_website>1</show_in_website>
|
247 |
-
<show_in_store>
|
248 |
</active>
|
249 |
<title translate="label">
|
250 |
<label>Title</label>
|
251 |
<frontend_type>text</frontend_type>
|
252 |
-
<sort_order>
|
253 |
<show_in_default>1</show_in_default>
|
254 |
<show_in_website>1</show_in_website>
|
255 |
-
<show_in_store>
|
256 |
</title>
|
257 |
<customer_id translate="label">
|
258 |
<label>Customer ID</label>
|
259 |
<frontend_type>text</frontend_type>
|
260 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
261 |
-
<sort_order>
|
262 |
<show_in_default>1</show_in_default>
|
263 |
<show_in_website>1</show_in_website>
|
264 |
-
<show_in_store>
|
265 |
</customer_id>
|
266 |
<currency translate="label">
|
267 |
<label>Accepted currency</label>
|
268 |
<frontend_type>select</frontend_type>
|
269 |
<source_model>adminhtml/system_config_source_currency</source_model>
|
270 |
-
<sort_order>
|
271 |
<show_in_default>1</show_in_default>
|
272 |
<show_in_website>1</show_in_website>
|
273 |
-
<show_in_store>
|
274 |
</currency>
|
275 |
<api_url translate="label">
|
276 |
<label>API Gateway URL</label>
|
277 |
<frontend_type>text</frontend_type>
|
278 |
-
<sort_order>
|
279 |
<show_in_default>1</show_in_default>
|
280 |
<show_in_website>1</show_in_website>
|
281 |
-
<show_in_store>
|
282 |
</api_url>
|
283 |
<order_status translate="label">
|
284 |
<label>New order status</label>
|
285 |
<frontend_type>select</frontend_type>
|
286 |
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
287 |
-
<sort_order>
|
288 |
<show_in_default>1</show_in_default>
|
289 |
<show_in_website>1</show_in_website>
|
290 |
-
<show_in_store>
|
291 |
</order_status>
|
292 |
<allowspecific translate="label">
|
293 |
<label>Payment from applicable countries</label>
|
294 |
<frontend_type>allowspecific</frontend_type>
|
295 |
-
<sort_order>
|
296 |
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
297 |
<show_in_default>1</show_in_default>
|
298 |
<show_in_website>1</show_in_website>
|
@@ -301,7 +307,7 @@
|
|
301 |
<specificcountry translate="label">
|
302 |
<label>Payment from Specific countries</label>
|
303 |
<frontend_type>multiselect</frontend_type>
|
304 |
-
<sort_order>
|
305 |
<source_model>adminhtml/system_config_source_country</source_model>
|
306 |
<show_in_default>1</show_in_default>
|
307 |
<show_in_website>1</show_in_website>
|
@@ -310,13 +316,167 @@
|
|
310 |
<sort_order translate="label">
|
311 |
<label>Sort order</label>
|
312 |
<frontend_type>text</frontend_type>
|
313 |
-
<sort_order>
|
314 |
<show_in_default>1</show_in_default>
|
315 |
<show_in_website>1</show_in_website>
|
316 |
-
<show_in_store>
|
317 |
</sort_order>
|
318 |
</fields>
|
319 |
</ewayau_secure>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
</groups>
|
321 |
</payment>
|
322 |
</sections>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
+
* Fontis eWAY Australia Extension
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
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 |
*
|
13 |
* @category Fontis
|
14 |
* @package Fontis_EwayAu
|
15 |
+
* @author Chris Norton
|
16 |
+
* @author Matthew Gamble
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
-->
|
28 |
<sort_order>201</sort_order>
|
29 |
<show_in_default>1</show_in_default>
|
30 |
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>1</show_in_store>
|
32 |
<fields>
|
33 |
<active translate="label">
|
34 |
<label>Enabled</label>
|
37 |
<sort_order>10</sort_order>
|
38 |
<show_in_default>1</show_in_default>
|
39 |
<show_in_website>1</show_in_website>
|
40 |
+
<show_in_store>1</show_in_store>
|
41 |
</active>
|
42 |
<title translate="label">
|
43 |
<label>Title</label>
|
45 |
<sort_order>20</sort_order>
|
46 |
<show_in_default>1</show_in_default>
|
47 |
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
</title>
|
50 |
<customer_id translate="label">
|
51 |
<label>Customer ID</label>
|
54 |
<sort_order>30</sort_order>
|
55 |
<show_in_default>1</show_in_default>
|
56 |
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
</customer_id>
|
59 |
<refund_password translate="label">
|
60 |
<label>Refund Password</label>
|
63 |
<sort_order>40</sort_order>
|
64 |
<show_in_default>1</show_in_default>
|
65 |
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
</refund_password>
|
68 |
<currency translate="label">
|
69 |
<label>Accepted currency</label>
|
72 |
<sort_order>50</sort_order>
|
73 |
<show_in_default>1</show_in_default>
|
74 |
<show_in_website>1</show_in_website>
|
75 |
+
<show_in_store>1</show_in_store>
|
76 |
</currency>
|
77 |
<test_gateway translate="label">
|
78 |
<label>Use test gateway</label>
|
79 |
<frontend_type>select</frontend_type>
|
80 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
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>1</show_in_store>
|
85 |
</test_gateway>
|
86 |
+
<payment_action translate="label">
|
87 |
+
<label>Payment Action</label>
|
88 |
+
<frontend_type>select</frontend_type>
|
89 |
+
<source_model>ewayau/source_paymentAction</source_model>
|
90 |
+
<sort_order>70</sort_order>
|
91 |
+
<show_in_default>1</show_in_default>
|
92 |
+
<show_in_website>1</show_in_website>
|
93 |
+
<show_in_store>1</show_in_store>
|
94 |
+
</payment_action>
|
95 |
<order_status translate="label">
|
96 |
<label>New order status</label>
|
97 |
<frontend_type>select</frontend_type>
|
99 |
<sort_order>80</sort_order>
|
100 |
<show_in_default>1</show_in_default>
|
101 |
<show_in_website>1</show_in_website>
|
102 |
+
<show_in_store>1</show_in_store>
|
103 |
</order_status>
|
104 |
<cctypes translate="label">
|
105 |
<label>Credit Card Types</label>
|
108 |
<sort_order>90</sort_order>
|
109 |
<show_in_default>1</show_in_default>
|
110 |
<show_in_website>1</show_in_website>
|
111 |
+
<show_in_store>1</show_in_store>
|
112 |
</cctypes>
|
113 |
<useccv translate="label">
|
114 |
<label>Credit Card Verification</label>
|
117 |
<sort_order>100</sort_order>
|
118 |
<show_in_default>1</show_in_default>
|
119 |
<show_in_website>1</show_in_website>
|
120 |
+
<show_in_store>1</show_in_store>
|
121 |
</useccv>
|
122 |
<allowspecific translate="label">
|
123 |
<label>Payment from applicable countries</label>
|
131 |
<specificcountry translate="label">
|
132 |
<label>Payment from Specific countries</label>
|
133 |
<frontend_type>multiselect</frontend_type>
|
134 |
+
<sort_order>120</sort_order>
|
135 |
<source_model>adminhtml/system_config_source_country</source_model>
|
136 |
<show_in_default>1</show_in_default>
|
137 |
<show_in_website>1</show_in_website>
|
140 |
<sort_order translate="label">
|
141 |
<label>Sort order</label>
|
142 |
<frontend_type>text</frontend_type>
|
143 |
+
<sort_order>130</sort_order>
|
144 |
<show_in_default>1</show_in_default>
|
145 |
<show_in_website>1</show_in_website>
|
146 |
+
<show_in_store>1</show_in_store>
|
147 |
</sort_order>
|
148 |
</fields>
|
149 |
</ewayau_direct>
|
153 |
<sort_order>202</sort_order>
|
154 |
<show_in_default>1</show_in_default>
|
155 |
<show_in_website>1</show_in_website>
|
156 |
+
<show_in_store>1</show_in_store>
|
157 |
<fields>
|
158 |
<active translate="label">
|
159 |
<label>Enabled</label>
|
160 |
<frontend_type>select</frontend_type>
|
161 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
162 |
+
<sort_order>10</sort_order>
|
163 |
<show_in_default>1</show_in_default>
|
164 |
<show_in_website>1</show_in_website>
|
165 |
+
<show_in_store>1</show_in_store>
|
166 |
</active>
|
167 |
<title translate="label">
|
168 |
<label>Title</label>
|
169 |
<frontend_type>text</frontend_type>
|
170 |
+
<sort_order>20</sort_order>
|
171 |
<show_in_default>1</show_in_default>
|
172 |
<show_in_website>1</show_in_website>
|
173 |
+
<show_in_store>1</show_in_store>
|
174 |
</title>
|
175 |
<customer_id translate="label">
|
176 |
<label>Customer ID</label>
|
177 |
<frontend_type>text</frontend_type>
|
178 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
179 |
+
<sort_order>30</sort_order>
|
180 |
<show_in_default>1</show_in_default>
|
181 |
<show_in_website>1</show_in_website>
|
182 |
+
<show_in_store>1</show_in_store>
|
183 |
</customer_id>
|
184 |
<currency translate="label">
|
185 |
<label>Accepted currency</label>
|
186 |
<frontend_type>select</frontend_type>
|
187 |
<source_model>adminhtml/system_config_source_currency</source_model>
|
188 |
+
<sort_order>40</sort_order>
|
189 |
<show_in_default>1</show_in_default>
|
190 |
<show_in_website>1</show_in_website>
|
191 |
+
<show_in_store>1</show_in_store>
|
192 |
</currency>
|
193 |
<api_url translate="label">
|
194 |
<label>API Gateway URL</label>
|
195 |
<frontend_type>text</frontend_type>
|
196 |
+
<sort_order>50</sort_order>
|
197 |
<show_in_default>1</show_in_default>
|
198 |
<show_in_website>1</show_in_website>
|
199 |
+
<show_in_store>1</show_in_store>
|
200 |
</api_url>
|
201 |
<order_status translate="label">
|
202 |
<label>New order status</label>
|
203 |
<frontend_type>select</frontend_type>
|
204 |
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
205 |
+
<sort_order>60</sort_order>
|
206 |
<show_in_default>1</show_in_default>
|
207 |
<show_in_website>1</show_in_website>
|
208 |
+
<show_in_store>1</show_in_store>
|
209 |
</order_status>
|
210 |
<allowspecific translate="label">
|
211 |
<label>Payment from applicable countries</label>
|
212 |
<frontend_type>allowspecific</frontend_type>
|
213 |
+
<sort_order>70</sort_order>
|
214 |
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
215 |
<show_in_default>1</show_in_default>
|
216 |
<show_in_website>1</show_in_website>
|
219 |
<specificcountry translate="label">
|
220 |
<label>Payment from Specific countries</label>
|
221 |
<frontend_type>multiselect</frontend_type>
|
222 |
+
<sort_order>80</sort_order>
|
223 |
<source_model>adminhtml/system_config_source_country</source_model>
|
224 |
<show_in_default>1</show_in_default>
|
225 |
<show_in_website>1</show_in_website>
|
228 |
<sort_order translate="label">
|
229 |
<label>Sort order</label>
|
230 |
<frontend_type>text</frontend_type>
|
231 |
+
<sort_order>100</sort_order>
|
232 |
<show_in_default>1</show_in_default>
|
233 |
<show_in_website>1</show_in_website>
|
234 |
+
<show_in_store>1</show_in_store>
|
235 |
</sort_order>
|
236 |
</fields>
|
237 |
</ewayau_shared>
|
241 |
<sort_order>203</sort_order>
|
242 |
<show_in_default>1</show_in_default>
|
243 |
<show_in_website>1</show_in_website>
|
244 |
+
<show_in_store>1</show_in_store>
|
245 |
<fields>
|
246 |
<active translate="label">
|
247 |
<label>Enabled</label>
|
248 |
<frontend_type>select</frontend_type>
|
249 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
250 |
+
<sort_order>10</sort_order>
|
251 |
<show_in_default>1</show_in_default>
|
252 |
<show_in_website>1</show_in_website>
|
253 |
+
<show_in_store>1</show_in_store>
|
254 |
</active>
|
255 |
<title translate="label">
|
256 |
<label>Title</label>
|
257 |
<frontend_type>text</frontend_type>
|
258 |
+
<sort_order>20</sort_order>
|
259 |
<show_in_default>1</show_in_default>
|
260 |
<show_in_website>1</show_in_website>
|
261 |
+
<show_in_store>1</show_in_store>
|
262 |
</title>
|
263 |
<customer_id translate="label">
|
264 |
<label>Customer ID</label>
|
265 |
<frontend_type>text</frontend_type>
|
266 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
267 |
+
<sort_order>30</sort_order>
|
268 |
<show_in_default>1</show_in_default>
|
269 |
<show_in_website>1</show_in_website>
|
270 |
+
<show_in_store>1</show_in_store>
|
271 |
</customer_id>
|
272 |
<currency translate="label">
|
273 |
<label>Accepted currency</label>
|
274 |
<frontend_type>select</frontend_type>
|
275 |
<source_model>adminhtml/system_config_source_currency</source_model>
|
276 |
+
<sort_order>40</sort_order>
|
277 |
<show_in_default>1</show_in_default>
|
278 |
<show_in_website>1</show_in_website>
|
279 |
+
<show_in_store>1</show_in_store>
|
280 |
</currency>
|
281 |
<api_url translate="label">
|
282 |
<label>API Gateway URL</label>
|
283 |
<frontend_type>text</frontend_type>
|
284 |
+
<sort_order>50</sort_order>
|
285 |
<show_in_default>1</show_in_default>
|
286 |
<show_in_website>1</show_in_website>
|
287 |
+
<show_in_store>1</show_in_store>
|
288 |
</api_url>
|
289 |
<order_status translate="label">
|
290 |
<label>New order status</label>
|
291 |
<frontend_type>select</frontend_type>
|
292 |
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
293 |
+
<sort_order>60</sort_order>
|
294 |
<show_in_default>1</show_in_default>
|
295 |
<show_in_website>1</show_in_website>
|
296 |
+
<show_in_store>1</show_in_store>
|
297 |
</order_status>
|
298 |
<allowspecific translate="label">
|
299 |
<label>Payment from applicable countries</label>
|
300 |
<frontend_type>allowspecific</frontend_type>
|
301 |
+
<sort_order>70</sort_order>
|
302 |
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
303 |
<show_in_default>1</show_in_default>
|
304 |
<show_in_website>1</show_in_website>
|
307 |
<specificcountry translate="label">
|
308 |
<label>Payment from Specific countries</label>
|
309 |
<frontend_type>multiselect</frontend_type>
|
310 |
+
<sort_order>80</sort_order>
|
311 |
<source_model>adminhtml/system_config_source_country</source_model>
|
312 |
<show_in_default>1</show_in_default>
|
313 |
<show_in_website>1</show_in_website>
|
316 |
<sort_order translate="label">
|
317 |
<label>Sort order</label>
|
318 |
<frontend_type>text</frontend_type>
|
319 |
+
<sort_order>90</sort_order>
|
320 |
<show_in_default>1</show_in_default>
|
321 |
<show_in_website>1</show_in_website>
|
322 |
+
<show_in_store>1</show_in_store>
|
323 |
</sort_order>
|
324 |
</fields>
|
325 |
</ewayau_secure>
|
326 |
+
<ewayau_token translate="label" module="ewayau">
|
327 |
+
<label>eWAY AU Token</label>
|
328 |
+
<frontend_type>text</frontend_type>
|
329 |
+
<sort_order>204</sort_order>
|
330 |
+
<show_in_default>1</show_in_default>
|
331 |
+
<show_in_website>1</show_in_website>
|
332 |
+
<show_in_store>1</show_in_store>
|
333 |
+
<fields>
|
334 |
+
<active translate="label">
|
335 |
+
<label>Enabled</label>
|
336 |
+
<frontend_type>select</frontend_type>
|
337 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
338 |
+
<sort_order>10</sort_order>
|
339 |
+
<show_in_default>1</show_in_default>
|
340 |
+
<show_in_website>1</show_in_website>
|
341 |
+
<show_in_store>1</show_in_store>
|
342 |
+
</active>
|
343 |
+
<title translate="label">
|
344 |
+
<label>Title</label>
|
345 |
+
<frontend_type>text</frontend_type>
|
346 |
+
<sort_order>20</sort_order>
|
347 |
+
<show_in_default>1</show_in_default>
|
348 |
+
<show_in_website>1</show_in_website>
|
349 |
+
<show_in_store>1</show_in_store>
|
350 |
+
</title>
|
351 |
+
<show_in_checkout translate="label">
|
352 |
+
<label>Display Method</label>
|
353 |
+
<frontend_type>select</frontend_type>
|
354 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
355 |
+
<sort_order>30</sort_order>
|
356 |
+
<show_in_default>1</show_in_default>
|
357 |
+
<show_in_website>1</show_in_website>
|
358 |
+
<show_in_store>1</show_in_store>
|
359 |
+
<comment>Display payment method as an option on the checkout page.</comment>
|
360 |
+
</show_in_checkout>
|
361 |
+
<customer_id translate="label">
|
362 |
+
<label>Customer ID</label>
|
363 |
+
<frontend_type>text</frontend_type>
|
364 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
365 |
+
<sort_order>40</sort_order>
|
366 |
+
<show_in_default>1</show_in_default>
|
367 |
+
<show_in_website>1</show_in_website>
|
368 |
+
<show_in_store>1</show_in_store>
|
369 |
+
</customer_id>
|
370 |
+
<username translate="label">
|
371 |
+
<label>Username</label>
|
372 |
+
<frontend_type>text</frontend_type>
|
373 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
374 |
+
<sort_order>50</sort_order>
|
375 |
+
<show_in_default>1</show_in_default>
|
376 |
+
<show_in_website>1</show_in_website>
|
377 |
+
<show_in_store>1</show_in_store>
|
378 |
+
<comment>Your username which is used to login to MYeWAY Business Center.</comment>
|
379 |
+
</username>
|
380 |
+
<password translate="label">
|
381 |
+
<label>Password</label>
|
382 |
+
<frontend_type>text</frontend_type>
|
383 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
384 |
+
<sort_order>60</sort_order>
|
385 |
+
<show_in_default>1</show_in_default>
|
386 |
+
<show_in_website>1</show_in_website>
|
387 |
+
<show_in_store>1</show_in_store>
|
388 |
+
<comment>Your eWAY API Password.</comment>
|
389 |
+
</password>
|
390 |
+
<test_login>
|
391 |
+
<frontend_model>ewayau/system_config_test_login_token</frontend_model>
|
392 |
+
<sort_order>61</sort_order>
|
393 |
+
<show_in_default>1</show_in_default>
|
394 |
+
<show_in_website>1</show_in_website>
|
395 |
+
<show_in_store>1</show_in_store>
|
396 |
+
</test_login>
|
397 |
+
<currency translate="label">
|
398 |
+
<label>Accepted currency</label>
|
399 |
+
<frontend_type>select</frontend_type>
|
400 |
+
<source_model>adminhtml/system_config_source_currency</source_model>
|
401 |
+
<sort_order>70</sort_order>
|
402 |
+
<show_in_default>1</show_in_default>
|
403 |
+
<show_in_website>1</show_in_website>
|
404 |
+
<show_in_store>1</show_in_store>
|
405 |
+
</currency>
|
406 |
+
<test_gateway translate="label">
|
407 |
+
<label>Use test gateway</label>
|
408 |
+
<frontend_type>select</frontend_type>
|
409 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
410 |
+
<sort_order>80</sort_order>
|
411 |
+
<show_in_default>1</show_in_default>
|
412 |
+
<show_in_website>1</show_in_website>
|
413 |
+
<show_in_store>1</show_in_store>
|
414 |
+
</test_gateway>
|
415 |
+
<debug translate="label">
|
416 |
+
<label>Debug model</label>
|
417 |
+
<frontend_type>select</frontend_type>
|
418 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
419 |
+
<sort_order>90</sort_order>
|
420 |
+
<show_in_default>1</show_in_default>
|
421 |
+
<show_in_website>1</show_in_website>
|
422 |
+
<show_in_store>1</show_in_store>
|
423 |
+
</debug>
|
424 |
+
<order_status translate="label">
|
425 |
+
<label>New order status</label>
|
426 |
+
<frontend_type>select</frontend_type>
|
427 |
+
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
428 |
+
<sort_order>100</sort_order>
|
429 |
+
<show_in_default>1</show_in_default>
|
430 |
+
<show_in_website>1</show_in_website>
|
431 |
+
<show_in_store>1</show_in_store>
|
432 |
+
</order_status>
|
433 |
+
<cctypes translate="label">
|
434 |
+
<label>Credit Card Types</label>
|
435 |
+
<frontend_type>multiselect</frontend_type>
|
436 |
+
<source_model>ewayau/source_cctype</source_model>
|
437 |
+
<sort_order>110</sort_order>
|
438 |
+
<show_in_default>1</show_in_default>
|
439 |
+
<show_in_website>1</show_in_website>
|
440 |
+
<show_in_store>1</show_in_store>
|
441 |
+
</cctypes>
|
442 |
+
<!-- @todo implement ccv payment option -->
|
443 |
+
<!--useccv translate="label">
|
444 |
+
<label>Credit Card Verification</label>
|
445 |
+
<frontend_type>select</frontend_type>
|
446 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
447 |
+
<sort_order>120</sort_order>
|
448 |
+
<show_in_default>1</show_in_default>
|
449 |
+
<show_in_website>1</show_in_website>
|
450 |
+
<show_in_store>1</show_in_store>
|
451 |
+
</useccv-->
|
452 |
+
<allowspecific translate="label">
|
453 |
+
<label>Payment from applicable countries</label>
|
454 |
+
<frontend_type>allowspecific</frontend_type>
|
455 |
+
<sort_order>130</sort_order>
|
456 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
457 |
+
<show_in_default>1</show_in_default>
|
458 |
+
<show_in_website>1</show_in_website>
|
459 |
+
<show_in_store>1</show_in_store>
|
460 |
+
</allowspecific>
|
461 |
+
<specificcountry translate="label">
|
462 |
+
<label>Payment from Specific countries</label>
|
463 |
+
<frontend_type>multiselect</frontend_type>
|
464 |
+
<sort_order>140</sort_order>
|
465 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
466 |
+
<show_in_default>1</show_in_default>
|
467 |
+
<show_in_website>1</show_in_website>
|
468 |
+
<show_in_store>1</show_in_store>
|
469 |
+
</specificcountry>
|
470 |
+
<sort_order translate="label">
|
471 |
+
<label>Sort order</label>
|
472 |
+
<frontend_type>text</frontend_type>
|
473 |
+
<sort_order>150</sort_order>
|
474 |
+
<show_in_default>1</show_in_default>
|
475 |
+
<show_in_website>1</show_in_website>
|
476 |
+
<show_in_store>1</show_in_store>
|
477 |
+
</sort_order>
|
478 |
+
</fields>
|
479 |
+
</ewayau_token>
|
480 |
</groups>
|
481 |
</payment>
|
482 |
</sections>
|
app/code/community/Fontis/EwayAu/sql/eway_setup/mysql4-install-0.1.0.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,15 +8,14 @@
|
|
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 |
-
* @
|
|
|
|
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
@@ -25,7 +24,6 @@ $installer = $this;
|
|
25 |
$installer->startSetup();
|
26 |
|
27 |
$installer->run("
|
28 |
-
|
29 |
-- DROP TABLE IF EXISTS `{$this->getTable('ewayau/api_debug')}`;
|
30 |
CREATE TABLE `{$this->getTable('eway/api_debug')}` (
|
31 |
`debug_id` int(10) unsigned NOT NULL auto_increment,
|
@@ -35,7 +33,6 @@ CREATE TABLE `{$this->getTable('eway/api_debug')}` (
|
|
35 |
PRIMARY KEY (`debug_id`),
|
36 |
KEY `debug_at` (`debug_at`)
|
37 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
38 |
-
|
39 |
-
");
|
40 |
|
41 |
$installer->endSetup();
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* Original code copyright (c) 2008 Irubin Consulting Inc. DBA Varien
|
13 |
*
|
14 |
* @category Fontis
|
15 |
* @package Fontis_EwayAu
|
16 |
+
* @author Chris Norton
|
17 |
+
* @author Matthew Gamble
|
18 |
+
* @copyright Copyright (c) 2014 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 |
|
24 |
$installer->startSetup();
|
25 |
|
26 |
$installer->run("
|
|
|
27 |
-- DROP TABLE IF EXISTS `{$this->getTable('ewayau/api_debug')}`;
|
28 |
CREATE TABLE `{$this->getTable('eway/api_debug')}` (
|
29 |
`debug_id` int(10) unsigned NOT NULL auto_increment,
|
33 |
PRIMARY KEY (`debug_id`),
|
34 |
KEY `debug_at` (`debug_at`)
|
35 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
36 |
+
");
|
|
|
37 |
|
38 |
$installer->endSetup();
|
app/design/adminhtml/default/default/template/fontis/ewayau/cc/form.phtml
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
?>
|
21 |
+
|
22 |
+
<?php
|
23 |
+
$code = $this->getMethodCode();
|
24 |
+
/** @var $paymentHelper Mage_Payment_Helper_Data */
|
25 |
+
$paymentHelper = Mage::helper('payment');
|
26 |
+
?>
|
27 |
+
|
28 |
+
<script type="text/javascript">
|
29 |
+
Validation.creditCartTypes.JCB = [new RegExp('^(35[0-9]{14}|(2131|1800)[0-9]{11})$'), new RegExp('^([0-9]{3})?$'), true];
|
30 |
+
Validation.creditCartTypes.DICL = [new RegExp('^((300|305)[0-9]{11}|36[0-9]{12}|55[0-9]{14})$'), new RegExp('^([0-9]{3})?$'), false];
|
31 |
+
</script>
|
32 |
+
|
33 |
+
<ul id="payment_form_<?php echo $code; ?>" style="display:none">
|
34 |
+
<li>
|
35 |
+
<div class="input-box">
|
36 |
+
<label for="<?php echo $code ?>_cc_owner"><?php echo $paymentHelper->__('Name on Card'); ?> <span class="required">*</span></label>
|
37 |
+
<br/>
|
38 |
+
<input type="text" title="<?php echo $paymentHelper->__('Name on Card'); ?>" class="required-entry input-text" id="<?php echo $code; ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->getInfoData('cc_owner'); ?>"/>
|
39 |
+
</div>
|
40 |
+
</li>
|
41 |
+
<li>
|
42 |
+
<div class="input-box">
|
43 |
+
<label for="<?php echo $code; ?>_cc_type"><?php echo $paymentHelper->__('Credit Card Type'); ?> <span class="required">*</span></label>
|
44 |
+
<br/>
|
45 |
+
<select id="<?php echo $code; ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
|
46 |
+
<?php $ccType = $this->getInfoData('cc_type') ?>
|
47 |
+
<option value=""></option>
|
48 |
+
<?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
|
49 |
+
<option value="<?php echo $typeCode; ?>" <?php if ($typeCode == $ccType): ?>selected="selected"<?php endif; ?>><?php echo $typeName; ?></option>
|
50 |
+
<?php endforeach ?>
|
51 |
+
</select>
|
52 |
+
</div>
|
53 |
+
</li>
|
54 |
+
<li>
|
55 |
+
<div class="input-box">
|
56 |
+
<label for="<?php echo $code ?>_cc_number"><?php echo $paymentHelper->__('Credit Card Number'); ?> <span class="required">*</span></label>
|
57 |
+
<br/>
|
58 |
+
<input type="text" id="<?php echo $code; ?>_cc_number" name="payment[cc_number]" title="<?php echo $paymentHelper->__('Credit Card Number'); ?>" class="input-text validate-cc-number" value="<?php echo $this->getInfoData('cc_number'); ?>"/>
|
59 |
+
</div>
|
60 |
+
</li>
|
61 |
+
<li>
|
62 |
+
<div class="input-box">
|
63 |
+
<label for="<?php echo $code; ?>_expiration"><?php echo $paymentHelper->__('Expiration Date'); ?> <span class="required">*</span></label>
|
64 |
+
<br/>
|
65 |
+
<select id="<?php echo $code; ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="required-entry">
|
66 |
+
<?php $ccExpMonth = $this->getInfoData('cc_exp_month'); ?>
|
67 |
+
<?php foreach ($this->getCcMonths() as $k => $v): ?>
|
68 |
+
<option value="<?php echo $k; ?>" <?php if ($k == $ccExpMonth): ?>selected="selected"<?php endif; ?>><?php echo $v; ?></option>
|
69 |
+
<?php endforeach ?>
|
70 |
+
</select>
|
71 |
+
|
72 |
+
<?php $ccExpYear = $this->getInfoData('cc_exp_year'); ?>
|
73 |
+
<select id="<?php echo $code; ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
|
74 |
+
<?php foreach ($this->getCcYears() as $k => $v): ?>
|
75 |
+
<option value="<?php echo $k ? $k : '' ?>" <?php if ($k == $ccExpYear): ?>selected="selected"<?php endif; ?>><?php echo $v; ?></option>
|
76 |
+
<?php endforeach ?>
|
77 |
+
</select>
|
78 |
+
</div>
|
79 |
+
</li>
|
80 |
+
<?php if($this->hasVerification()): ?>
|
81 |
+
<li>
|
82 |
+
<div class="input-box">
|
83 |
+
<label for="<?php echo $code ?>_cc_cid"><?php echo $paymentHelper->__('Card Verification Number'); ?> <span class="required">*</span></label><br/>
|
84 |
+
<input type="text" title="<?php echo $paymentHelper->__('Card Verification Number'); ?>" class="required-entry input-text validate-cc-cvn" id="<?php echo $code; ?>_cc_cid" name="payment[cc_cid]" style="width:5em;" value="<?php echo $this->getInfoData('cc_cid'); ?>"/>
|
85 |
+
</div>
|
86 |
+
</li>
|
87 |
+
<?php endif; ?>
|
88 |
+
</ul>
|
app/design/adminhtml/default/default/template/fontis/ewayau/cc/info.phtml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
?>
|
21 |
+
<?php
|
22 |
+
/** @var $paymentHelper Mage_Payment_Helper_Data */
|
23 |
+
$paymentHelper = Mage::helper('payment');
|
24 |
+
$info = $this->getInfo();
|
25 |
+
|
26 |
+
echo $paymentHelper->__('Name on the Card: %s', $this->escapeHtml($info->getCcOwner())) . '<br/>';
|
27 |
+
echo $paymentHelper->__('Credit Card Type: %s', $this->escapeHtml($this->getCcTypeName())) . '<br/>';
|
28 |
+
echo $paymentHelper->__('Credit Card Number: xxxx-%s', $this->escapeHtml($info->getCcLast4())) . '<br/>';
|
29 |
+
echo $paymentHelper->__('Expiration Date: %s/%s', $this->escapeHtml($this->getCcExpMonth()), $this->escapeHtml($info->getCcExpYear()));
|
30 |
+
?>
|
app/design/adminhtml/default/default/template/fontis/ewayau/cc/pdf/info.phtml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
?>
|
21 |
+
<?php
|
22 |
+
/** @var $paymentHelper Mage_Payment_Helper_Data */
|
23 |
+
$paymentHelper = Mage::helper('payment');
|
24 |
+
$info = $this->getInfo();
|
25 |
+
?>
|
26 |
+
|
27 |
+
<?php echo $paymentHelper->__('Name on the Card: %s', $this->escapeHtml($info->getCcOwner())); ?>
|
28 |
+
{{pdf_row_separator}}
|
29 |
+
<?php echo $paymentHelper->__('Credit Card Type: %s', $this->escapeHtml($this->getCcTypeName())); ?>
|
30 |
+
{{pdf_row_separator}}
|
31 |
+
<?php echo $paymentHelper->__('Credit Card Number: xxxx-%s', $this->escapeHtml($info->getCcLast4())); ?>
|
32 |
+
{{pdf_row_separator}}
|
33 |
+
<?php echo $paymentHelper->__('Expiration Date: %s/%s', $this->escapeHtml($this->getCcExpMonth()), $this->escapeHtml($info->getCcExpYear())); ?>
|
app/design/adminhtml/default/default/template/fontis/ewayau/form.phtml
DELETED
@@ -1,78 +0,0 @@
|
|
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 |
-
<?php $_code=$this->getMethodCode() ?>
|
24 |
-
<script type="text/javascript">
|
25 |
-
Validation.creditCartTypes.JCB = [new RegExp('^(35[0-9]{14}|(2131|1800)[0-9]{11})$'), new RegExp('^([0-9]{3})?$'), true];
|
26 |
-
Validation.creditCartTypes.DICL = [new RegExp('^((300|305)[0-9]{11}|36[0-9]{12}|55[0-9]{14})$'), new RegExp('^([0-9]{3})?$'), false];
|
27 |
-
</script>
|
28 |
-
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
29 |
-
<li>
|
30 |
-
<div class="input-box">
|
31 |
-
<label for="<?php echo $_code ?>_cc_owner"><?php echo Mage::helper('payment')->__('Name on Card') ?> <span class="required">*</span></label><br/>
|
32 |
-
<input type="text" title="<?php echo Mage::helper('payment')->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->getInfoData('cc_owner') ?>"/>
|
33 |
-
</div>
|
34 |
-
</li>
|
35 |
-
<li>
|
36 |
-
<div class="input-box">
|
37 |
-
<label for="<?php echo $_code ?>_cc_type"><?php echo Mage::helper('payment')->__('Credit Card Type') ?> <span class="required">*</span></label><br/>
|
38 |
-
<select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
|
39 |
-
<?php $_ccType = $this->getInfoData('cc_type') ?>
|
40 |
-
<option value=""></option>
|
41 |
-
<?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
|
42 |
-
<option value="<?php echo $_typeCode ?>" <?php if($_typeCode==$_ccType): ?>selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
|
43 |
-
<?php endforeach ?>
|
44 |
-
</select>
|
45 |
-
</div>
|
46 |
-
</li>
|
47 |
-
<li>
|
48 |
-
<div class="input-box">
|
49 |
-
<label for="<?php echo $_code ?>_cc_number"><?php echo Mage::helper('payment')->__('Credit Card Number') ?> <span class="required">*</span></label><br/>
|
50 |
-
<input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo Mage::helper('payment')->__('Credit Card Number') ?>" class="input-text validate-cc-number" value="<?php echo $this->getInfoData('cc_number')?>"/>
|
51 |
-
</div>
|
52 |
-
</li>
|
53 |
-
<li>
|
54 |
-
<div class="input-box">
|
55 |
-
<label for="<?php echo $_code ?>_expiration"><?php echo Mage::helper('payment')->__('Expiration Date') ?> <span class="required">*</span></label><br/>
|
56 |
-
<select id="<?php echo $_code ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="required-entry">
|
57 |
-
<?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
|
58 |
-
<?php foreach ($this->getCcMonths() as $k=>$v): ?>
|
59 |
-
<option value="<?php echo $k ?>" <?php if($k==$_ccExpMonth): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
|
60 |
-
<?php endforeach ?>
|
61 |
-
</select>
|
62 |
-
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
63 |
-
<select id="<?php echo $_code ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
|
64 |
-
<?php foreach ($this->getCcYears() as $k=>$v): ?>
|
65 |
-
<option value="<?php echo $k ? $k : '' ?>" <?php if($k==$_ccExpYear): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
|
66 |
-
<?php endforeach ?>
|
67 |
-
</select>
|
68 |
-
</div>
|
69 |
-
</li>
|
70 |
-
<?php if($this->hasVerification()): ?>
|
71 |
-
<li>
|
72 |
-
<div class="input-box">
|
73 |
-
<label for="<?php echo $_code ?>_cc_cid"><?php echo Mage::helper('payment')->__('Card Verification Number') ?> <span class="required">*</span></label><br/>
|
74 |
-
<input type="text" title="<?php echo Mage::helper('payment')->__('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="<?php echo $this->getInfoData('cc_cid')?>"/>
|
75 |
-
</div>
|
76 |
-
</li>
|
77 |
-
<?php endif; ?>
|
78 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/fontis/ewayau/info.phtml
DELETED
@@ -1,26 +0,0 @@
|
|
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 |
-
<?php echo Mage::helper('payment')->__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?><br/>
|
24 |
-
<?php echo Mage::helper('payment')->__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?><br/>
|
25 |
-
<?php echo Mage::helper('payment')->__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?><br/>
|
26 |
-
<?php echo Mage::helper('payment')->__('Expiration Date: %s/%s', $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/fontis/ewayau/pdf/info.phtml
DELETED
@@ -1,29 +0,0 @@
|
|
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 |
-
<?php echo Mage::helper('payment')->__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?>
|
24 |
-
{{pdf_row_separator}}
|
25 |
-
<?php echo Mage::helper('payment')->__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?>
|
26 |
-
{{pdf_row_separator}}
|
27 |
-
<?php echo Mage::helper('payment')->__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?>
|
28 |
-
{{pdf_row_separator}}
|
29 |
-
<?php echo Mage::helper('payment')->__('Expiration Date: %s/%s', $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/fontis/ewayau/test/login.phtml
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
?>
|
21 |
+
<?php /** @var $this Fontis_Ewayau_Block_System_Config_Test_Login */ ?>
|
22 |
+
<?php // This template will need further generalisation before it could be used by all eWay methods. ?>
|
23 |
+
<?php $fieldPrefix = 'payment_ewayau_' . $this->getMethod(); ?>
|
24 |
+
|
25 |
+
<button onclick="javascript:testLogin();" type="button" id="<?php echo $fieldPrefix; ?>_test_login_button">
|
26 |
+
<span><?php echo $this->__("Test Login"); ?></span>
|
27 |
+
</button>
|
28 |
+
<span id="<?php echo $fieldPrefix; ?>_test_login_result" class="test_result_icon"></span>
|
29 |
+
|
30 |
+
<script type="text/javascript">
|
31 |
+
var $testResult = $('<?php echo $fieldPrefix; ?>_test_login_result');
|
32 |
+
function testLogin() {
|
33 |
+
var data = {
|
34 |
+
customer_id: $('<?php echo $fieldPrefix; ?>_customer_id').value,
|
35 |
+
username: $('<?php echo $fieldPrefix; ?>_username').value,
|
36 |
+
password: $('<?php echo $fieldPrefix; ?>_password').value,
|
37 |
+
test_gateway: $('<?php echo $fieldPrefix; ?>_test_gateway').value
|
38 |
+
};
|
39 |
+
|
40 |
+
new Ajax.Request('<?php echo $this->getTestUrl(); ?>', {
|
41 |
+
parameters: data,
|
42 |
+
onSuccess: function(response) {
|
43 |
+
response = response.responseText;
|
44 |
+
if (response == 1) {
|
45 |
+
$testResult.addClassName('success');
|
46 |
+
$testResult.removeClassName('failure');
|
47 |
+
} else {
|
48 |
+
$testResult.addClassName('failure');
|
49 |
+
$testResult.removeClassName('success');
|
50 |
+
}
|
51 |
+
}
|
52 |
+
});
|
53 |
+
return false;
|
54 |
+
}
|
55 |
+
</script>
|
app/design/frontend/base/default/template/fontis/ewayau/cc/form.phtml
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
?>
|
21 |
+
<script type="text/javascript">
|
22 |
+
Validation.creditCartTypes.JCB = [new RegExp('^(35[0-9]{14}|(2131|1800)[0-9]{11})$'), new RegExp('^([0-9]{3})?$'), true];
|
23 |
+
Validation.creditCartTypes.DICL = [new RegExp('^((300|305)[0-9]{11}|36[0-9]{12}|55[0-9]{14})$'), new RegExp('^([0-9]{3})?$'), false];
|
24 |
+
</script>
|
25 |
+
<fieldset class="form-list">
|
26 |
+
<?php $code = $this->getMethodCode(); ?>
|
27 |
+
<ul id="payment_form_<?php echo $code; ?>" style="display:none">
|
28 |
+
<li>
|
29 |
+
<div class="input-box">
|
30 |
+
<label for="<?php echo $code; ?>_cc_owner"><?php echo $this->__('Name on Card') ?> <span class="required">*</span></label><br/>
|
31 |
+
<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')) ?>"/>
|
32 |
+
</div>
|
33 |
+
</li>
|
34 |
+
<li>
|
35 |
+
<div class="input-box">
|
36 |
+
<label for="<?php echo $code; ?>_cc_type"><?php echo $this->__('Credit Card Type') ?> <span class="required">*</span></label><br />
|
37 |
+
<select id="<?php echo $code; ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
|
38 |
+
<option value="">--<?php echo $this->__('Please Select') ?>--</option>
|
39 |
+
<?php $_ccType = $this->getInfoData('cc_type') ?>
|
40 |
+
<?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
|
41 |
+
<option value="<?php echo $typeCode ?>" <?php if ($typeCode == $_ccType): ?>selected="selected"<?php endif ?>><?php echo $typeName; ?></option>
|
42 |
+
<?php endforeach ?>
|
43 |
+
</select>
|
44 |
+
</div>
|
45 |
+
</li>
|
46 |
+
<li>
|
47 |
+
<div class="input-box">
|
48 |
+
<label for="<?php echo $code; ?>_cc_number"><?php echo $this->__('Credit Card Number') ?> <span class="required">*</span></label><br/>
|
49 |
+
<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="" />
|
50 |
+
</div>
|
51 |
+
</li>
|
52 |
+
<li>
|
53 |
+
<div class="input-box">
|
54 |
+
<label for="<?php echo $code; ?>_expiration"><?php echo $this->__('Expiration Date') ?> <span class="required">*</span></label><br />
|
55 |
+
<div class="v-fix">
|
56 |
+
<?php $ccExpMonth = $this->getInfoData('cc_exp_month') ?>
|
57 |
+
<select id="<?php echo $code; ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="required-entry">
|
58 |
+
<?php foreach ($this->getCcMonths() as $k=>$v): ?>
|
59 |
+
<option value="<?php echo $k ? $k : '' ?>" <?php if ($k == $ccExpMonth): ?>selected="selected"<?php endif; ?>><?php echo $v; ?></option>
|
60 |
+
<?php endforeach ?>
|
61 |
+
</select>
|
62 |
+
</div>
|
63 |
+
|
64 |
+
<div class="v-fix" style="padding-left:5px;">
|
65 |
+
<?php $ccExpYear = $this->getInfoData('cc_exp_year'); ?>
|
66 |
+
<select id="<?php echo $code; ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
|
67 |
+
<?php foreach ($this->getCcYears() as $k => $v): ?>
|
68 |
+
<option value="<?php echo $k?$k:'' ?>" <?php if ($k == $ccExpYear): ?>selected="selected"<?php endif; ?>><?php echo $v; ?></option>
|
69 |
+
<?php endforeach; ?>
|
70 |
+
</select>
|
71 |
+
</div>
|
72 |
+
</div>
|
73 |
+
</li>
|
74 |
+
<?php if ($this->hasVerification()): ?>
|
75 |
+
<li>
|
76 |
+
<div class="input-box">
|
77 |
+
<label for="<?php echo $code; ?>_cc_cid"><?php echo $this->__('Card Verification Number'); ?> <span class="required">*</span></label><br />
|
78 |
+
<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>
|
79 |
+
|
80 |
+
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?'); ?></a>
|
81 |
+
</div>
|
82 |
+
</li>
|
83 |
+
<?php endif; ?>
|
84 |
+
</ul>
|
85 |
+
</fieldset>
|
app/design/frontend/base/default/template/fontis/ewayau/cc/info.phtml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
?>
|
21 |
+
<?php if ($info = $this->getInfo()): ?>
|
22 |
+
<?php echo $this->__('Name on the Card: %s', $this->escapeHtml($info->getCcOwner())) ?><br />
|
23 |
+
<?php echo $this->__('Credit Card Type: %s', $this->escapeHtml($this->getCcTypeName())) ?><br />
|
24 |
+
<?php echo $this->__('Credit Card Number: xxxx-%s', $this->escapeHtml($info->getCcLast4())) ?><br />
|
25 |
+
<?php echo $this->__('Expiration Date: %s/%s', $this->escapeHtml($this->getCcExpMonth()), $this->escapeHtml($info->getCcExpYear())) ?>
|
26 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/fontis/ewayau/failure.phtml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis eWAY 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 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
?>
|
21 |
+
<div class="page-head">
|
22 |
+
<h3><?php echo $this->__('Error occurred'); ?></h3>
|
23 |
+
</div>
|
24 |
+
<p><?php echo $this->getErrorMessage(); ?>.</p>
|
25 |
+
<p><?php echo $this->__('Please <a href="%s">continue shopping</a>.', $this->getContinueShoppingUrl()); ?></p>
|
app/design/frontend/{default/default/template/fontis/ewayau/shared → base/default/template/fontis/ewayau/secure}/form.phtml
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,23 +8,21 @@
|
|
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 |
-
* @
|
|
|
|
|
|
|
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 $
|
25 |
-
<ul id="payment_form_<?php echo $
|
26 |
<li>
|
27 |
-
<?php echo $this->__('You will be redirected to eWAY website when you place an order.') ?>
|
28 |
</li>
|
29 |
</ul>
|
30 |
</fieldset>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
?>
|
21 |
<fieldset class="form-list">
|
22 |
+
<?php $code = $this->getMethodCode(); ?>
|
23 |
+
<ul id="payment_form_<?php echo $code; ?>" style="display:none">
|
24 |
<li>
|
25 |
+
<?php echo $this->__('You will be redirected to eWAY 3D-Secure website when you place an order.'); ?>
|
26 |
</li>
|
27 |
</ul>
|
28 |
</fieldset>
|
app/design/frontend/{default/default/template/fontis/ewayau/secure → base/default/template/fontis/ewayau/shared}/form.phtml
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Fontis eWAY Australia
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -8,23 +8,21 @@
|
|
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 |
-
* @
|
|
|
|
|
|
|
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 $
|
25 |
-
<ul id="payment_form_<?php echo $
|
26 |
<li>
|
27 |
-
<?php echo $this->__('You will be redirected to eWAY
|
28 |
</li>
|
29 |
</ul>
|
30 |
</fieldset>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis eWAY Australia Extension
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_EwayAu
|
14 |
+
* @author Chris Norton
|
15 |
+
* @author Matthew Gamble
|
16 |
+
* @author Ron Carr
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
?>
|
21 |
<fieldset class="form-list">
|
22 |
+
<?php $code = $this->getMethodCode(); ?>
|
23 |
+
<ul id="payment_form_<?php echo $code; ?>" style="display:none">
|
24 |
<li>
|
25 |
+
<?php echo $this->__('You will be redirected to eWAY website when you place an order.'); ?>
|
26 |
</li>
|
27 |
</ul>
|
28 |
</fieldset>
|
app/design/frontend/default/default/layout/fontis_ewayau.xml
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* Fontis eWAY Australia 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 Fontis_EwayAu
|
20 |
-
* @copyright Copyright (c) 2010 Fontis (http://www.fontis.com.au)
|
21 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
-
*/
|
23 |
-
-->
|
24 |
-
|
25 |
-
<layout version="0.1.0">
|
26 |
-
|
27 |
-
<ewayau_shared_failure>
|
28 |
-
<reference name="root">
|
29 |
-
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
30 |
-
</reference>
|
31 |
-
<reference name="content">
|
32 |
-
<block type="ewayau/shared_failure" name="ewayau_shared_failure" template="fontis/ewayau/shared/failure.phtml"></block>
|
33 |
-
</reference>
|
34 |
-
</ewayau_shared_failure>
|
35 |
-
|
36 |
-
<ewayau_secure_failure>
|
37 |
-
<reference name="root">
|
38 |
-
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
39 |
-
</reference>
|
40 |
-
<reference name="content">
|
41 |
-
<block type="ewayau/secure_failure" name="ewayau_secure_failure" template="fontis/ewayau/secure/failure.phtml"></block>
|
42 |
-
</reference>
|
43 |
-
</ewayau_secure_failure>
|
44 |
-
|
45 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/fontis/ewayau/form.phtml
DELETED
@@ -1,86 +0,0 @@
|
|
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 |
-
<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/fontis/ewayau/info.phtml
DELETED
@@ -1,30 +0,0 @@
|
|
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 |
-
<?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/fontis/ewayau/secure/failure.phtml
DELETED
@@ -1,27 +0,0 @@
|
|
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 |
-
<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/fontis/ewayau/shared/failure.phtml
DELETED
@@ -1,27 +0,0 @@
|
|
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 |
-
<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/Fontis_EwayAu.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
* Fontis eWAY Australia
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
@@ -9,15 +9,13 @@
|
|
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 Fontis_EwayAu
|
20 |
-
* @
|
|
|
|
|
|
|
21 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
*/
|
23 |
-->
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
+
* Fontis eWAY Australia Extension
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
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 |
*
|
13 |
* @category Fontis
|
14 |
* @package Fontis_EwayAu
|
15 |
+
* @author Chris Norton
|
16 |
+
* @author Matthew Gamble
|
17 |
+
* @author Ron Carr
|
18 |
+
* @copyright Copyright (c) 2014 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 |
-->
|
app/locale/en_AU/Fontis_EwayAu.csv
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"API Gateway URL","API Gateway URL"
|
2 |
+
"Accepted currency","Accepted currency"
|
3 |
+
"Card Verification Number","Card Verification Number"
|
4 |
+
"Credit Card Number","Credit Card Number"
|
5 |
+
"Credit Card Number: xxxx-%s","Credit Card Number: xxxx-%s"
|
6 |
+
"Credit Card Type","Credit Card Type"
|
7 |
+
"Credit Card Type: %s","Credit Card Type: %s"
|
8 |
+
"Credit Card Types","Credit Card Types"
|
9 |
+
"Credit Card Verification","Credit Card Verification"
|
10 |
+
"Customer ID","Customer ID"
|
11 |
+
"Customer successfully returned from eWAY","Customer successfully returned from eWAY"
|
12 |
+
"Customer was redirected to eWAY.","Customer was redirected to eWAY."
|
13 |
+
"Customer was rejected by eWAY","Customer was rejected by eWAY"
|
14 |
+
"Debug Flag","Debug Flag"
|
15 |
+
"Enabled","Enabled"
|
16 |
+
"Error occurred","Error occurred"
|
17 |
+
"Expiration Date","Expiration Date"
|
18 |
+
"Expiration Date: %s/%s","Expiration Date: %s/%s"
|
19 |
+
"Name on Card","Name on Card"
|
20 |
+
"Name on the Card: %s","Name on the Card: %s"
|
21 |
+
"New order status","New order status"
|
22 |
+
"Payment from Specific countries","Payment from Specific countries"
|
23 |
+
"Payment from applicable countries","Payment from applicable countries"
|
24 |
+
"Please <a href=""%s"">continue shopping</a>.","Please <a href=""%s"">continue shopping</a>."
|
25 |
+
"Please Select","Please Select"
|
26 |
+
"Selected currency code (","Selected currency code ("
|
27 |
+
"Sort order","Sort order"
|
28 |
+
"There has been an error processing your payment.","There has been an error processing your payment."
|
29 |
+
"There has been an error processing your payment. Please try later or contact us for help.","There has been an error processing your payment. Please try later or contact us for help."
|
30 |
+
"Title","Title"
|
31 |
+
"What is this?","What is this?"
|
32 |
+
"You will be redirected to eWAY 3D-Secure in a few seconds.","You will be redirected to eWAY 3D-Secure in a few seconds."
|
33 |
+
"You will be redirected to eWAY 3D-Secure website when you place an order.","You will be redirected to eWAY 3D-Secure website when you place an order."
|
34 |
+
"You will be redirected to eWAY in a few seconds.","You will be redirected to eWAY in a few seconds."
|
35 |
+
"You will be redirected to eWAY website when you place an order.","You will be redirected to eWAY website when you place an order."
|
36 |
+
"eWAY 3D-Secure","eWAY 3D-Secure"
|
37 |
+
"eWAY Direct","eWAY Direct"
|
38 |
+
"eWAY Shared","eWAY Shared"
|
app/locale/en_US/Fontis_EwayAu.csv
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
"Customer was rejected by eWAY","Customer was rejected by eWAY"
|
14 |
"Debug Flag","Debug Flag"
|
15 |
"Enabled","Enabled"
|
16 |
-
"Error
|
17 |
"Expiration Date","Expiration Date"
|
18 |
"Expiration Date: %s/%s","Expiration Date: %s/%s"
|
19 |
"Name on Card","Name on Card"
|
13 |
"Customer was rejected by eWAY","Customer was rejected by eWAY"
|
14 |
"Debug Flag","Debug Flag"
|
15 |
"Enabled","Enabled"
|
16 |
+
"Error occurred","Error occured"
|
17 |
"Expiration Date","Expiration Date"
|
18 |
"Expiration Date: %s/%s","Expiration Date: %s/%s"
|
19 |
"Name on Card","Name on Card"
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fontis_EwayAu</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
11 |
-
<notes
|
12 |
-
<authors><author><name>Fontis</name><user>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Fontis"><dir name="EwayAu"><dir name="Block"><file name="Form.php" hash="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fontis_EwayAu</name>
|
4 |
+
<version>1.3.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>This extension uses the eWAY Australia payment gateway for credit card processing.</summary>
|
10 |
+
<description>This extension uses the eWAY Australia payment gateway for credit card processing.</description>
|
11 |
+
<notes></notes>
|
12 |
+
<authors><author><name>Fontis</name><user>magento</user><email>magento@fontis.com.au</email></author></authors>
|
13 |
+
<date>2014-10-21</date>
|
14 |
+
<time>07:48:55</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Fontis"><dir name="EwayAu"><dir name="Block"><dir name="Cc"><file name="Form.php" hash="57234316e0cef27ca9dc2f30f7481468"/><file name="Info.php" hash="5d78397d1835c27b9086d30f5045b112"/></dir><file name="Failure.php" hash="7ef2187be76fa8678c0b93849c81d387"/><file name="Form.php" hash="3c8a7af831a90306a01e168fe80053fb"/><file name="Redirect.php" hash="3cc5b297911527a85f481dd6db11677f"/><dir name="Secure"><file name="Failure.php" hash="9e78c00e38f823e9fb4c1cb1104430d0"/><file name="Form.php" hash="e41dca9448b549f8156736ebeab39696"/><file name="Redirect.php" hash="a61752d7788ddd627ebb3fbd2118a6e2"/></dir><dir name="Shared"><file name="Failure.php" hash="cb01c6a8a37e6d8ba07bf11fea6459f4"/><file name="Form.php" hash="dd8cc3e3709a70fd065d95460fe4a1a4"/><file name="Redirect.php" hash="8e6c67f33de8427d44398763a9bef69f"/></dir><dir name="System"><dir name="Config"><dir name="Test"><dir name="Login"><file name="Token.php" hash="d611871b0fa486770e43ea6f4fd7d8ac"/></dir><file name="Login.php" hash="f804bd9d73f9d5c9e7f7d436a0b99d0a"/></dir></dir></dir></dir><dir name="Controller"><file name="Abstract.php" hash="b6f1572981f5a1815af2e3b9d57d5e36"/></dir><dir name="Helper"><file name="Data.php" hash="691efa9df7c27ad823a4f63d27f0eefb"/><file name="Token.php" hash="06f4908c567a53591717ce05d36aebe8"/></dir><file name="LICENSE.txt" hash="ee9b10e9ed246951201f537dbf986bd7"/><dir name="Model"><file name="Direct.php" hash="27f32a4e81e9eb860af46779d436b0b2"/><dir name="Sales"><file name="Object.php" hash="9b1ffad27c52c995e3441f1529bd0879"/></dir><file name="Secure.php" hash="7438428fae3dee6299b69dc387f29170"/><file name="Shared.php" hash="435fda2422e90bae74954bc1e15bb8ba"/><dir name="Source"><file name="Cctype.php" hash="5c6b49d02bdc705610d3d42c21bb0eb9"/><file name="PaymentAction.php" hash="0ccebdfb15a51b74384902a262725fb3"/></dir><dir name="Token"><dir name="Request"><file name="Data.php" hash="aed9689f94015270ada9de5617b3ac35"/></dir><file name="Request.php" hash="fd8384cc62b3b23856c3be467f57ec3a"/><dir name="Response"><file name="CreateCustomer.php" hash="25bcd71b951412fecf6aa15819d2c867"/><file name="ProcessPayment.php" hash="30b1a9f8fead1e106683d95bc939742b"/><file name="QueryCustomerByReference.php" hash="cb67a6c6194137c5cb874ba5d8298d12"/><file name="UpdateCustomer.php" hash="d9beb0eddee8b647da28bcdbb4f84ec1"/></dir><file name="Response.php" hash="78cafac600eb121e6261a6cd76bc12fa"/></dir><file name="Token.php" hash="f64ee49334587fa3f7e3984fde829641"/></dir><dir name="controllers"><file name="SecureController.php" hash="2325d18e1fee95577b6c82c40acfa220"/><file name="SharedController.php" hash="f1916e9008dcfc44e5b13c9324c057a5"/><dir name="System"><dir name="Config"><dir name="Test"><file name="LoginController.php" hash="7bb9d8ce21eb25407270908dcb072352"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="2b6476695557d602664b17a02b7e6da1"/><file name="system.xml" hash="c42c27d1fb9e244be36cf70a38fe1a34"/></dir><dir name="sql"><dir name="eway_setup"><file name="mysql4-install-0.1.0.php" hash="22c7d8e8a69fd050928bc1fcbd6cfc1c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="fontis"><dir name="ewayau"><dir name="cc"><file name="form.phtml" hash="783ac1d6760d885522e987b8354b800e"/><file name="info.phtml" hash="1e7b77cc9eb93fa227bed371c17fa0eb"/><dir name="pdf"><file name="info.phtml" hash="f3dcfedb6695407faeb166def29e3e5e"/></dir></dir><dir name="test"><file name="login.phtml" hash="f7038a79bda8e9b822af6d809323b75d"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="fontis_ewayau.xml" hash=""/></dir><dir name="template"><dir name="fontis"><dir name="ewayau"><dir name="cc"><file name="form.phtml" hash="74e813a801b9ffcb7041be8043e413b1"/><file name="info.phtml" hash="c41dc75df49a28a6a542c92e96b1b7cc"/></dir><file name="failure.phtml" hash="d145d12c7bfafe2a0de118a48842a8ee"/><dir name="secure"><file name="form.phtml" hash="a50d182cc109362f2a11b2fe81f7da5d"/></dir><dir name="shared"><file name="form.phtml" hash="dd21cb58b3344358a86b6a45c97df080"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Fontis_EwayAu.xml" hash="d1fc2b9deb74062b37975545350e8cf4"/></dir></target><target name="magelocale"><dir name="en_AU"><file name="Fontis_EwayAu.csv" hash="43a8cc203c5c510feec00036a374b6bb"/></dir><dir name="en_US"><file name="Fontis_EwayAu.csv" hash="64d1c53fa4cae100a1fc8a01e7568574"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="fontis"><dir name="ewayau"><dir name="css"><file name="styles.css" hash="4ae456e2d8a299492b95cf7c8e5d7421"/></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
skin/adminhtml/default/default/fontis/ewayau/css/styles.css
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Fontis eWAY Australia Extension
|
3 |
+
*
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @category Fontis
|
12 |
+
* @package Fontis_EwayAu
|
13 |
+
* @author Chris Norton
|
14 |
+
* @author Matthew Gamble
|
15 |
+
* @author Ron Carr
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
|
20 |
+
.test_result_icon {
|
21 |
+
color: transparent;
|
22 |
+
width: 20px;
|
23 |
+
height: 20px;
|
24 |
+
vertical-align: middle;
|
25 |
+
}
|
26 |
+
|
27 |
+
.test_result_icon.success {
|
28 |
+
background: url(../../../images/success_msg_icon.gif) no-repeat;
|
29 |
+
display: inline-block;
|
30 |
+
}
|
31 |
+
|
32 |
+
.test_result_icon.failure {
|
33 |
+
background: url(../../../images/error_msg_icon.gif) no-repeat;
|
34 |
+
display: inline-block;
|
35 |
+
}
|