Version Notes
Extension provides the ability for merchants to process through the CardConnect Gateway.
Download this release
Release Info
Developer | Team FireGento |
Extension | CardconnectCcgateway |
Version | 1.0.7 |
Comparing to | |
See all releases |
Code changes from version 1.0.6.1 to 1.0.7
- app/code/community/Cardconnect/Ccgateway/Adminhtml/Model/System/Config/Source/Checkouttype.php +48 -48
- app/code/community/Cardconnect/Ccgateway/Adminhtml/Model/System/Config/Source/Transaction.php +48 -48
- app/code/community/Cardconnect/Ccgateway/Block/Addcard.php +59 -59
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Customer/Data.php +118 -118
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Customer/Edit/Tab/Account.php +293 -293
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Creditmemo/Create/Form.php +55 -55
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Creditmemo/Create/Items.php +195 -195
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Creditmemo/View/Form.php +55 -55
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/Create/Form.php +56 -56
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/Create/Items.php +59 -59
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/View/Form.php +55 -55
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Shipment/Create/Form.php +55 -55
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Shipment/View/Form.php +55 -55
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/View/Tab/Info.php +50 -50
- app/code/community/Cardconnect/Ccgateway/Block/Cardmanagement.php +199 -199
- app/code/community/Cardconnect/Ccgateway/Block/Form.php +240 -240
- app/code/community/Cardconnect/Ccgateway/Block/Info.php +94 -94
- app/code/community/Cardconnect/Ccgateway/Block/Onepage/Billing.php +26 -26
- app/code/community/Cardconnect/Ccgateway/Block/Redirect.php +77 -77
- app/code/community/Cardconnect/Ccgateway/Helper/Data.php +46 -0
- app/code/community/Cardconnect/Ccgateway/Model/Cardconnect/Resp.php +40 -40
- app/code/community/Cardconnect/Ccgateway/Model/Cardconnect/Wallet.php +40 -40
- app/code/community/Cardconnect/Ccgateway/Model/Observer.php +95 -95
- app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Resp.php +38 -38
- app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Resp/Collection.php +40 -40
- app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Wallet.php +38 -38
- app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Wallet/Collection.php +40 -40
- app/code/community/Cardconnect/Ccgateway/Model/Standard.php +12 -49
- app/code/community/Cardconnect/Ccgateway/Model/cardconnect_webservice.php +548 -496
- app/code/community/Cardconnect/Ccgateway/blocks/billing.phtml +217 -217
- app/code/community/Cardconnect/Ccgateway/blocks/creditmemo/create/form.phtml +103 -103
- app/code/community/Cardconnect/Ccgateway/blocks/creditmemo/view/form.phtml +104 -104
- app/code/community/Cardconnect/Ccgateway/blocks/info.phtml +148 -148
- app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/form.phtml +132 -132
- app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/items.phtml +209 -209
- app/code/community/Cardconnect/Ccgateway/blocks/invoice/view/form.phtml +101 -101
- app/code/community/Cardconnect/Ccgateway/blocks/shipment/create/form.phtml +120 -120
- app/code/community/Cardconnect/Ccgateway/blocks/shipment/view/form.phtml +123 -123
- app/code/community/Cardconnect/Ccgateway/controllers/Adminhtml/Sales/Order/CreateController.php +177 -177
- app/code/community/Cardconnect/Ccgateway/controllers/Adminhtml/Sales/OrderController.php +99 -99
- app/code/community/Cardconnect/Ccgateway/controllers/CardmanagementController.php +181 -180
- app/code/community/Cardconnect/Ccgateway/etc/config.xml +1 -1
- app/code/community/Cardconnect/Ccgateway/sql/cardconnect_ccgateway_setup/install-1.0.0.php +136 -136
- app/design/adminhtml/default/default/layout/ccgateway.xml +43 -43
- app/design/adminhtml/default/default/template/ccgateway/form.phtml +121 -120
- app/design/adminhtml/default/default/template/ccgateway/info.phtml +141 -141
- app/design/frontend/base/default/layout/ccgateway.xml +87 -87
- app/design/frontend/base/default/template/ccgateway/blank.phtml +40 -40
- app/design/frontend/base/default/template/ccgateway/cardmanagement/editcard.phtml +266 -268
- app/design/frontend/base/default/template/ccgateway/cardmanagement/index.phtml +189 -189
- app/design/frontend/base/default/template/ccgateway/cardmanagement/new.phtml +237 -236
- app/design/frontend/base/default/template/ccgateway/form.phtml +317 -316
- app/design/frontend/base/default/template/ccgateway/info.phtml +41 -41
- js/cardconnect/ccgateway.js +446 -445
- package.xml +4 -4
- skin/frontend/base/default/css/cardconnect.css +420 -420
app/code/community/Cardconnect/Ccgateway/Adminhtml/Model/System/Config/Source/Checkouttype.php
CHANGED
@@ -1,49 +1,49 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @brief Defines the checkout type supported by CardConnect.
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
* */
|
14 |
-
|
15 |
-
/**
|
16 |
-
Magento
|
17 |
-
*
|
18 |
-
NOTICE OF LICENSE
|
19 |
-
*
|
20 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
21 |
-
that is bundled with this package in the file LICENSE.txt.
|
22 |
-
It is also available through the world-wide-web at this URL:
|
23 |
-
http://opensource.org/licenses/osl-3.0.php
|
24 |
-
If you did not receive a copy of the license and are unable to
|
25 |
-
obtain it through the world-wide-web, please send an email
|
26 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
-
*
|
28 |
-
@category Cardconnect
|
29 |
-
@package Cardconnect_Ccgateway
|
30 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
-
*/
|
33 |
-
class Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_checkouttype {
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Checkout transaction type
|
37 |
-
*
|
38 |
-
* @return array
|
39 |
-
*/
|
40 |
-
public function toOptionArray() {
|
41 |
-
return array(
|
42 |
-
array('value' => 'tokenized_post', 'label' => Mage::helper('adminhtml')->__('Tokenized Post')),
|
43 |
-
array('value' => 'payment_page', 'label' => Mage::helper('adminhtml')->__('Hosted Payment Page'))
|
44 |
-
);
|
45 |
-
}
|
46 |
-
|
47 |
-
}
|
48 |
-
|
49 |
Â
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @brief Defines the checkout type supported by CardConnect.
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
* */
|
14 |
+
|
15 |
+
/**
|
16 |
+
Magento
|
17 |
+
*
|
18 |
+
NOTICE OF LICENSE
|
19 |
+
*
|
20 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
21 |
+
that is bundled with this package in the file LICENSE.txt.
|
22 |
+
It is also available through the world-wide-web at this URL:
|
23 |
+
http://opensource.org/licenses/osl-3.0.php
|
24 |
+
If you did not receive a copy of the license and are unable to
|
25 |
+
obtain it through the world-wide-web, please send an email
|
26 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
+
*
|
28 |
+
@category Cardconnect
|
29 |
+
@package Cardconnect_Ccgateway
|
30 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
+
*/
|
33 |
+
class Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_checkouttype {
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Checkout transaction type
|
37 |
+
*
|
38 |
+
* @return array
|
39 |
+
*/
|
40 |
+
public function toOptionArray() {
|
41 |
+
return array(
|
42 |
+
array('value' => 'tokenized_post', 'label' => Mage::helper('adminhtml')->__('Tokenized Post')),
|
43 |
+
array('value' => 'payment_page', 'label' => Mage::helper('adminhtml')->__('Hosted Payment Page'))
|
44 |
+
);
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
Â
?>
|
app/code/community/Cardconnect/Ccgateway/Adminhtml/Model/System/Config/Source/Transaction.php
CHANGED
@@ -1,49 +1,49 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the checkout transaction type supported by CardConnect.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_transaction {
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Checkout transaction type
|
37 |
-
*
|
38 |
-
* @return array
|
39 |
-
*/
|
40 |
-
public function toOptionArray() {
|
41 |
-
return array(
|
42 |
-
array('value' => 'authorize', 'label' => Mage::helper('adminhtml')->__('Authorize Only')),
|
43 |
-
array('value' => 'authorize_capture', 'label' => Mage::helper('adminhtml')->__('Authorize and Capture'))
|
44 |
-
);
|
45 |
-
}
|
46 |
-
|
47 |
-
}
|
48 |
-
|
49 |
Â
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the checkout transaction type supported by CardConnect.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_transaction {
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Checkout transaction type
|
37 |
+
*
|
38 |
+
* @return array
|
39 |
+
*/
|
40 |
+
public function toOptionArray() {
|
41 |
+
return array(
|
42 |
+
array('value' => 'authorize', 'label' => Mage::helper('adminhtml')->__('Authorize Only')),
|
43 |
+
array('value' => 'authorize_capture', 'label' => Mage::helper('adminhtml')->__('Authorize and Capture'))
|
44 |
+
);
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
Â
?>
|
app/code/community/Cardconnect/Ccgateway/Block/Addcard.php
CHANGED
@@ -1,59 +1,59 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @brief Defines the class for Payment information Block Frontend (Tokenize Post)
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
* */
|
14 |
-
|
15 |
-
/**
|
16 |
-
Magento
|
17 |
-
*
|
18 |
-
NOTICE OF LICENSE
|
19 |
-
*
|
20 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
21 |
-
that is bundled with this package in the file LICENSE.txt.
|
22 |
-
It is also available through the world-wide-web at this URL:
|
23 |
-
http://opensource.org/licenses/osl-3.0.php
|
24 |
-
If you did not receive a copy of the license and are unable to
|
25 |
-
obtain it through the world-wide-web, please send an email
|
26 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
-
*
|
28 |
-
@category Cardconnect
|
29 |
-
@package Cardconnect_Ccgateway
|
30 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
-
*/
|
33 |
-
class Cardconnect_Ccgateway_Block_Form extends Mage_Core_Block_Template{
|
34 |
-
|
35 |
-
protected function _construct() {
|
36 |
-
parent::_construct();
|
37 |
-
$this->setTemplate('ccgateway/cardmanagement/new.phtml');
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Retrieve field value data from payment info object
|
44 |
-
*
|
45 |
-
* @param string $field
|
46 |
-
* @return mixed
|
47 |
-
*/
|
48 |
-
public function getInfoData($field)
|
49 |
-
{
|
50 |
-
return $this->escapeHtml($this->getMethod()->getInfoInstance()->getData($field));
|
51 |
-
}
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @brief Defines the class for Payment information Block Frontend (Tokenize Post)
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
* */
|
14 |
+
|
15 |
+
/**
|
16 |
+
Magento
|
17 |
+
*
|
18 |
+
NOTICE OF LICENSE
|
19 |
+
*
|
20 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
21 |
+
that is bundled with this package in the file LICENSE.txt.
|
22 |
+
It is also available through the world-wide-web at this URL:
|
23 |
+
http://opensource.org/licenses/osl-3.0.php
|
24 |
+
If you did not receive a copy of the license and are unable to
|
25 |
+
obtain it through the world-wide-web, please send an email
|
26 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
+
*
|
28 |
+
@category Cardconnect
|
29 |
+
@package Cardconnect_Ccgateway
|
30 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
+
*/
|
33 |
+
class Cardconnect_Ccgateway_Block_Form extends Mage_Core_Block_Template{
|
34 |
+
|
35 |
+
protected function _construct() {
|
36 |
+
parent::_construct();
|
37 |
+
$this->setTemplate('ccgateway/cardmanagement/new.phtml');
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Retrieve field value data from payment info object
|
44 |
+
*
|
45 |
+
* @param string $field
|
46 |
+
* @return mixed
|
47 |
+
*/
|
48 |
+
public function getInfoData($field)
|
49 |
+
{
|
50 |
+
return $this->escapeHtml($this->getMethod()->getInfoInstance()->getData($field));
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
|
59 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Customer/Data.php
CHANGED
@@ -1,119 +1,119 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the class representing CardConnect Token Managment block shows in Customer Account Admin Block
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
* */
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Customer_Data extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Render block
|
36 |
-
*
|
37 |
-
* @param Varien_Data_Form_Element_Abstract $element
|
38 |
-
* @return string
|
39 |
-
*/
|
40 |
-
public function render(Varien_Data_Form_Element_Abstract $element) {
|
41 |
-
$customer = Mage::registry('current_customer');
|
42 |
-
$requestUrl = Mage::getUrl('ccgateway/payment/deletewallet',array('_secure'=>true));
|
43 |
-
|
44 |
-
$html = '';
|
45 |
-
$tokens = $this->getCcCustomerToken();
|
46 |
-
|
47 |
-
if (count($tokens)!=0) {
|
48 |
-
$html .="<tr>";
|
49 |
-
$html .= "<th>Card Alias</th>";
|
50 |
-
$html .="<th></th>";
|
51 |
-
$html .= "<th>Card Number</th>";
|
52 |
-
$html .="<th></th>";
|
53 |
-
$html .="<th>Operation</td></th>";
|
54 |
-
|
55 |
-
$i = 1;
|
56 |
-
foreach ($tokens as $data) {
|
57 |
-
|
58 |
-
$html .= "<tr>";
|
59 |
-
$html .= "<td>".$data->getData('CC_CARD_NAME') . "</td>";
|
60 |
-
$html .= '<td><input type="hidden" id="customer_id_' . $i . '" value="' . $customer->getId() . '"></td>';
|
61 |
-
$html .= "<td>".substr_replace($data->getData('CC_MASK'), str_repeat("X", 12), 0, 12) . "</td>";
|
62 |
-
$html .= '<td><input type="hidden" id="token_num_' . $i . '" value="' . $data->getData('CC_ID') . '"></td>';
|
63 |
-
$html .= '<td><button id="card_delete" title="Delete"';
|
64 |
-
$html .= ' onclick="deleteCardDataController(' . $i . ', \'' . $requestUrl . '\')" type="button" class="submit" >Delete</button></td></tr>';
|
65 |
-
|
66 |
-
$i++;
|
67 |
-
}
|
68 |
-
} else {
|
69 |
-
$html .="<tr><th>No Card Available</th></tr>";
|
70 |
-
}
|
71 |
-
|
72 |
-
return $html;
|
73 |
-
}
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Returns Profile Data for Card Managment
|
80 |
-
*
|
81 |
-
* @return string
|
82 |
-
*/
|
83 |
-
public function getCcCustomerToken() {
|
84 |
-
|
85 |
-
$customer = Mage::registry('current_customer');
|
86 |
-
|
87 |
-
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_wallet')->getCollection()
|
88 |
-
->addFieldToFilter('CC_USER_ID', array('eq' => $customer->getId()))
|
89 |
-
->addFieldToSelect("*")
|
90 |
-
->setOrder('CC_CREATED', 'DESC');
|
91 |
-
|
92 |
-
return $collection;
|
93 |
-
}
|
94 |
-
|
95 |
-
}
|
96 |
-
?>
|
97 |
-
<script type="text/javascript">
|
98 |
-
|
99 |
-
function deleteCardDataController(rowNum, requestUrl) {
|
100 |
-
|
101 |
-
var tokenNumberId = "token_num_" + rowNum;
|
102 |
-
var customerId = "customer_id_" + rowNum;
|
103 |
-
var delId = document.getElementById(tokenNumberId).value;
|
104 |
-
var customerId = document.getElementById(customerId).value;
|
105 |
-
|
106 |
-
var data = {"cc_id": delId, "customerId": customerId};
|
107 |
-
|
108 |
-
new Ajax.Request(requestUrl, {
|
109 |
-
method: 'Post',
|
110 |
-
parameters: data,
|
111 |
-
onComplete: function (transport) {
|
112 |
-
alert(transport.responseText); //return false;
|
113 |
-
window.location.reload();
|
114 |
-
}
|
115 |
-
});
|
116 |
-
|
117 |
-
}
|
118 |
-
|
119 |
Â
</script>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the class representing CardConnect Token Managment block shows in Customer Account Admin Block
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
* */
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Customer_Data extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Render block
|
36 |
+
*
|
37 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
38 |
+
* @return string
|
39 |
+
*/
|
40 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
41 |
+
$customer = Mage::registry('current_customer');
|
42 |
+
$requestUrl = Mage::getUrl('ccgateway/payment/deletewallet',array('_secure'=>true));
|
43 |
+
|
44 |
+
$html = '';
|
45 |
+
$tokens = $this->getCcCustomerToken();
|
46 |
+
|
47 |
+
if (count($tokens)!=0) {
|
48 |
+
$html .="<tr>";
|
49 |
+
$html .= "<th>Card Alias</th>";
|
50 |
+
$html .="<th></th>";
|
51 |
+
$html .= "<th>Card Number</th>";
|
52 |
+
$html .="<th></th>";
|
53 |
+
$html .="<th>Operation</td></th>";
|
54 |
+
|
55 |
+
$i = 1;
|
56 |
+
foreach ($tokens as $data) {
|
57 |
+
|
58 |
+
$html .= "<tr>";
|
59 |
+
$html .= "<td>".$data->getData('CC_CARD_NAME') . "</td>";
|
60 |
+
$html .= '<td><input type="hidden" id="customer_id_' . $i . '" value="' . $customer->getId() . '"></td>';
|
61 |
+
$html .= "<td>".substr_replace($data->getData('CC_MASK'), str_repeat("X", 12), 0, 12) . "</td>";
|
62 |
+
$html .= '<td><input type="hidden" id="token_num_' . $i . '" value="' . $data->getData('CC_ID') . '"></td>';
|
63 |
+
$html .= '<td><button id="card_delete" title="Delete"';
|
64 |
+
$html .= ' onclick="deleteCardDataController(' . $i . ', \'' . $requestUrl . '\')" type="button" class="submit" >Delete</button></td></tr>';
|
65 |
+
|
66 |
+
$i++;
|
67 |
+
}
|
68 |
+
} else {
|
69 |
+
$html .="<tr><th>No Card Available</th></tr>";
|
70 |
+
}
|
71 |
+
|
72 |
+
return $html;
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Returns Profile Data for Card Managment
|
80 |
+
*
|
81 |
+
* @return string
|
82 |
+
*/
|
83 |
+
public function getCcCustomerToken() {
|
84 |
+
|
85 |
+
$customer = Mage::registry('current_customer');
|
86 |
+
|
87 |
+
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_wallet')->getCollection()
|
88 |
+
->addFieldToFilter('CC_USER_ID', array('eq' => $customer->getId()))
|
89 |
+
->addFieldToSelect("*")
|
90 |
+
->setOrder('CC_CREATED', 'DESC');
|
91 |
+
|
92 |
+
return $collection;
|
93 |
+
}
|
94 |
+
|
95 |
+
}
|
96 |
+
?>
|
97 |
+
<script type="text/javascript">
|
98 |
+
|
99 |
+
function deleteCardDataController(rowNum, requestUrl) {
|
100 |
+
|
101 |
+
var tokenNumberId = "token_num_" + rowNum;
|
102 |
+
var customerId = "customer_id_" + rowNum;
|
103 |
+
var delId = document.getElementById(tokenNumberId).value;
|
104 |
+
var customerId = document.getElementById(customerId).value;
|
105 |
+
|
106 |
+
var data = {"cc_id": delId, "customerId": customerId};
|
107 |
+
|
108 |
+
new Ajax.Request(requestUrl, {
|
109 |
+
method: 'Post',
|
110 |
+
parameters: data,
|
111 |
+
onComplete: function (transport) {
|
112 |
+
alert(transport.responseText); //return false;
|
113 |
+
window.location.reload();
|
114 |
+
}
|
115 |
+
});
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
Â
</script>
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Customer/Edit/Tab/Account.php
CHANGED
@@ -1,293 +1,293 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @brief Defines the class representing CardConnect Token Managment in Customer Account form block
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
* */
|
14 |
-
|
15 |
-
/**
|
16 |
-
Magento
|
17 |
-
*
|
18 |
-
NOTICE OF LICENSE
|
19 |
-
*
|
20 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
21 |
-
that is bundled with this package in the file LICENSE.txt.
|
22 |
-
It is also available through the world-wide-web at this URL:
|
23 |
-
http://opensource.org/licenses/osl-3.0.php
|
24 |
-
If you did not receive a copy of the license and are unable to
|
25 |
-
obtain it through the world-wide-web, please send an email
|
26 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
-
*
|
28 |
-
@category Cardconnect
|
29 |
-
@package Cardconnect_Ccgateway
|
30 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
-
*/
|
33 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Customer_Edit_Tab_Account extends Mage_Adminhtml_Block_Customer_Edit_Tab_Account {
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Initialize block
|
37 |
-
*/
|
38 |
-
public function __construct() {
|
39 |
-
parent::__construct();
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Initialize form
|
44 |
-
*
|
45 |
-
* @return Mage_Adminhtml_Block_Customer_Edit_Tab_Account
|
46 |
-
*/
|
47 |
-
public function initForm() {
|
48 |
-
$form = new Varien_Data_Form();
|
49 |
-
$form->setHtmlIdPrefix('_account');
|
50 |
-
$form->setFieldNameSuffix('account');
|
51 |
-
|
52 |
-
$customer = Mage::registry('current_customer');
|
53 |
-
|
54 |
-
/** @var $customerForm Mage_Customer_Model_Form */
|
55 |
-
$customerForm = Mage::getModel('customer/form');
|
56 |
-
$customerForm->setEntity($customer)
|
57 |
-
->setFormCode('adminhtml_customer')
|
58 |
-
->initDefaultValues();
|
59 |
-
|
60 |
-
$fieldset = $form->addFieldset('base_fieldset', array(
|
61 |
-
'legend' => Mage::helper('customer')->__('Account Information')
|
62 |
-
));
|
63 |
-
|
64 |
-
$attributes = $customerForm->getAttributes();
|
65 |
-
foreach ($attributes as $attribute) {
|
66 |
-
/* @var $attribute Mage_Eav_Model_Entity_Attribute */
|
67 |
-
$attribute->setFrontendLabel(Mage::helper('customer')->__($attribute->getFrontend()->getLabel()));
|
68 |
-
$attribute->unsIsVisible();
|
69 |
-
}
|
70 |
-
|
71 |
-
$disableAutoGroupChangeAttributeName = 'disable_auto_group_change';
|
72 |
-
$this->_setFieldset($attributes, $fieldset, array($disableAutoGroupChangeAttributeName));
|
73 |
-
|
74 |
-
$form->getElement('group_id')->setRenderer($this->getLayout()
|
75 |
-
->createBlock('adminhtml/customer_edit_renderer_attribute_group')
|
76 |
-
->setDisableAutoGroupChangeAttribute($customerForm->getAttribute($disableAutoGroupChangeAttributeName))
|
77 |
-
->setDisableAutoGroupChangeAttributeValue($customer->getData($disableAutoGroupChangeAttributeName)));
|
78 |
-
|
79 |
-
if ($customer->getId()) {
|
80 |
-
$form->getElement('website_id')->setDisabled('disabled');
|
81 |
-
$form->getElement('created_in')->setDisabled('disabled');
|
82 |
-
} else {
|
83 |
-
$fieldset->removeField('created_in');
|
84 |
-
$form->getElement('website_id')->addClass('validate-website-has-store');
|
85 |
-
|
86 |
-
$websites = array();
|
87 |
-
foreach (Mage::app()->getWebsites(true) as $website) {
|
88 |
-
$websites[$website->getId()] = !is_null($website->getDefaultStore());
|
89 |
-
}
|
90 |
-
$prefix = $form->getHtmlIdPrefix();
|
91 |
-
|
92 |
-
$form->getElement('website_id')->setAfterElementHtml(
|
93 |
-
'<script type="text/javascript">'
|
94 |
-
. "
|
95 |
-
var {$prefix}_websites = " . Mage::helper('core')->jsonEncode($websites) . ";
|
96 |
-
Validation.add(
|
97 |
-
'validate-website-has-store',
|
98 |
-
'" . Mage::helper('customer')->__('Please select a website which contains store view') . "',
|
99 |
-
function(v, elem){
|
100 |
-
return {$prefix}_websites[elem.value] == true;
|
101 |
-
}
|
102 |
-
);
|
103 |
-
Element.observe('{$prefix}website_id', 'change', function(){
|
104 |
-
Validation.validate($('{$prefix}website_id'))
|
105 |
-
}.bind($('{$prefix}website_id')));
|
106 |
-
"
|
107 |
-
. '</script>'
|
108 |
-
);
|
109 |
-
}
|
110 |
-
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
|
111 |
-
$form->getElement('website_id')->setRenderer($renderer);
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
$customerStoreId = null;
|
116 |
-
if ($customer->getId()) {
|
117 |
-
$customerStoreId = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId();
|
118 |
-
}
|
119 |
-
|
120 |
-
$prefixElement = $form->getElement('prefix');
|
121 |
-
if ($prefixElement) {
|
122 |
-
$prefixOptions = $this->helper('customer')->getNamePrefixOptions($customerStoreId);
|
123 |
-
if (!empty($prefixOptions)) {
|
124 |
-
$fieldset->removeField($prefixElement->getId());
|
125 |
-
$prefixField = $fieldset->addField($prefixElement->getId(), 'select', $prefixElement->getData(), $form->getElement('group_id')->getId()
|
126 |
-
);
|
127 |
-
$prefixField->setValues($prefixOptions);
|
128 |
-
if ($customer->getId()) {
|
129 |
-
$prefixField->addElementValues($customer->getPrefix());
|
130 |
-
}
|
131 |
-
}
|
132 |
-
}
|
133 |
-
|
134 |
-
$suffixElement = $form->getElement('suffix');
|
135 |
-
if ($suffixElement) {
|
136 |
-
$suffixOptions = $this->helper('customer')->getNameSuffixOptions($customerStoreId);
|
137 |
-
if (!empty($suffixOptions)) {
|
138 |
-
$fieldset->removeField($suffixElement->getId());
|
139 |
-
$suffixField = $fieldset->addField($suffixElement->getId(), 'select', $suffixElement->getData(), $form->getElement('lastname')->getId()
|
140 |
-
);
|
141 |
-
$suffixField->setValues($suffixOptions);
|
142 |
-
if ($customer->getId()) {
|
143 |
-
$suffixField->addElementValues($customer->getSuffix());
|
144 |
-
}
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
if ($customer->getId()) {
|
149 |
-
if (!$customer->isReadonly()) {
|
150 |
-
// Add password management fieldset
|
151 |
-
$newFieldset = $form->addFieldset(
|
152 |
-
'password_fieldset', array('legend' => Mage::helper('customer')->__('Password Management'))
|
153 |
-
);
|
154 |
-
// New customer password
|
155 |
-
$field = $newFieldset->addField('new_password', 'text', array(
|
156 |
-
'label' => Mage::helper('customer')->__('New Password'),
|
157 |
-
'name' => 'new_password',
|
158 |
-
'class' => 'validate-new-password'
|
159 |
-
)
|
160 |
-
);
|
161 |
-
$field->setRenderer($this->getLayout()->createBlock('adminhtml/customer_edit_renderer_newpass'));
|
162 |
-
|
163 |
-
// Prepare customer confirmation control (only for existing customers)
|
164 |
-
$confirmationKey = $customer->getConfirmation();
|
165 |
-
if ($confirmationKey || $customer->isConfirmationRequired()) {
|
166 |
-
$confirmationAttribute = $customer->getAttribute('confirmation');
|
167 |
-
if (!$confirmationKey) {
|
168 |
-
$confirmationKey = $customer->getRandomConfirmationKey();
|
169 |
-
}
|
170 |
-
$element = $fieldset->addField('confirmation', 'select', array(
|
171 |
-
'name' => 'confirmation',
|
172 |
-
'label' => Mage::helper('customer')->__($confirmationAttribute->getFrontendLabel()),
|
173 |
-
))->setEntityAttribute($confirmationAttribute)
|
174 |
-
->setValues(array('' => 'Confirmed', $confirmationKey => 'Not confirmed'));
|
175 |
-
|
176 |
-
// Prepare send welcome email checkbox if customer is not confirmed
|
177 |
-
// no need to add it, if website ID is empty
|
178 |
-
if ($customer->getConfirmation() && $customer->getWebsiteId()) {
|
179 |
-
$fieldset->addField('sendemail', 'checkbox', array(
|
180 |
-
'name' => 'sendemail',
|
181 |
-
'label' => Mage::helper('customer')->__('Send Welcome Email after Confirmation')
|
182 |
-
));
|
183 |
-
$customer->setData('sendemail', '1');
|
184 |
-
}
|
185 |
-
}
|
186 |
-
}
|
187 |
-
} else {
|
188 |
-
$newFieldset = $form->addFieldset(
|
189 |
-
'password_fieldset', array('legend' => Mage::helper('customer')->__('Password Management'))
|
190 |
-
);
|
191 |
-
$field = $newFieldset->addField('password', 'text', array(
|
192 |
-
'label' => Mage::helper('customer')->__('Password'),
|
193 |
-
'class' => 'input-text required-entry validate-password',
|
194 |
-
'name' => 'password',
|
195 |
-
'required' => true
|
196 |
-
)
|
197 |
-
);
|
198 |
-
$field->setRenderer($this->getLayout()->createBlock('adminhtml/customer_edit_renderer_newpass'));
|
199 |
-
|
200 |
-
// Prepare send welcome email checkbox
|
201 |
-
$fieldset->addField('sendemail', 'checkbox', array(
|
202 |
-
'label' => Mage::helper('customer')->__('Send Welcome Email'),
|
203 |
-
'name' => 'sendemail',
|
204 |
-
'id' => 'sendemail',
|
205 |
-
));
|
206 |
-
$customer->setData('sendemail', '1');
|
207 |
-
if (!Mage::app()->isSingleStoreMode()) {
|
208 |
-
$fieldset->addField('sendemail_store_id', 'select', array(
|
209 |
-
'label' => $this->helper('customer')->__('Send From'),
|
210 |
-
'name' => 'sendemail_store_id',
|
211 |
-
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()
|
212 |
-
));
|
213 |
-
}
|
214 |
-
}
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
// Make sendemail and sendmail_store_id disabled if website_id has empty value
|
220 |
-
$isSingleMode = Mage::app()->isSingleStoreMode();
|
221 |
-
$sendEmailId = $isSingleMode ? 'sendemail' : 'sendemail_store_id';
|
222 |
-
$sendEmail = $form->getElement($sendEmailId);
|
223 |
-
|
224 |
-
$prefix = $form->getHtmlIdPrefix();
|
225 |
-
if ($sendEmail) {
|
226 |
-
$_disableStoreField = '';
|
227 |
-
if (!$isSingleMode) {
|
228 |
-
$_disableStoreField = "$('{$prefix}sendemail_store_id').disabled=(''==this.value || '0'==this.value);";
|
229 |
-
}
|
230 |
-
$sendEmail->setAfterElementHtml(
|
231 |
-
'<script type="text/javascript">'
|
232 |
-
. "
|
233 |
-
$('{$prefix}website_id').disableSendemail = function() {
|
234 |
-
$('{$prefix}sendemail').disabled = ('' == this.value || '0' == this.value);" .
|
235 |
-
$_disableStoreField
|
236 |
-
. "}.bind($('{$prefix}website_id'));
|
237 |
-
Event.observe('{$prefix}website_id', 'change', $('{$prefix}website_id').disableSendemail);
|
238 |
-
$('{$prefix}website_id').disableSendemail();
|
239 |
-
"
|
240 |
-
. '</script>'
|
241 |
-
);
|
242 |
-
}
|
243 |
-
|
244 |
-
|
245 |
-
if ($customer->getId()) {
|
246 |
-
// Add Card Data Management
|
247 |
-
$newFieldset = $form->addFieldset(
|
248 |
-
'token_fieldset', array('legend' => Mage::helper('customer')->__('Card Management'))
|
249 |
-
);
|
250 |
-
// New customer password
|
251 |
-
$field = $newFieldset->addField('card_data_message', 'hidden', array(
|
252 |
-
'label' => Mage::helper('customer')->__(''),
|
253 |
-
'name' => 'new_password',
|
254 |
-
'class' => 'validate-new-password'
|
255 |
-
)
|
256 |
-
);
|
257 |
-
|
258 |
-
$field->setRenderer($this->getLayout()->createBlock('ccgateway/adminhtml_customer_data'));
|
259 |
-
}
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
if ($customer->isReadonly()) {
|
267 |
-
foreach ($customer->getAttributes() as $attribute) {
|
268 |
-
$element = $form->getElement($attribute->getAttributeCode());
|
269 |
-
if ($element) {
|
270 |
-
$element->setReadonly(true, true);
|
271 |
-
}
|
272 |
-
}
|
273 |
-
}
|
274 |
-
|
275 |
-
$form->setValues($customer->getData());
|
276 |
-
$this->setForm($form);
|
277 |
-
return $this;
|
278 |
-
}
|
279 |
-
|
280 |
-
/**
|
281 |
-
* Return predefined additional element types
|
282 |
-
*
|
283 |
-
* @return array
|
284 |
-
*/
|
285 |
-
protected function _getAdditionalElementTypes() {
|
286 |
-
return array(
|
287 |
-
'file' => Mage::getConfig()->getBlockClassName('adminhtml/customer_form_element_file'),
|
288 |
-
'image' => Mage::getConfig()->getBlockClassName('adminhtml/customer_form_element_image'),
|
289 |
-
'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/customer_form_element_boolean'),
|
290 |
-
);
|
291 |
-
}
|
292 |
-
|
293 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @brief Defines the class representing CardConnect Token Managment in Customer Account form block
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
* */
|
14 |
+
|
15 |
+
/**
|
16 |
+
Magento
|
17 |
+
*
|
18 |
+
NOTICE OF LICENSE
|
19 |
+
*
|
20 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
21 |
+
that is bundled with this package in the file LICENSE.txt.
|
22 |
+
It is also available through the world-wide-web at this URL:
|
23 |
+
http://opensource.org/licenses/osl-3.0.php
|
24 |
+
If you did not receive a copy of the license and are unable to
|
25 |
+
obtain it through the world-wide-web, please send an email
|
26 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
+
*
|
28 |
+
@category Cardconnect
|
29 |
+
@package Cardconnect_Ccgateway
|
30 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
+
*/
|
33 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Customer_Edit_Tab_Account extends Mage_Adminhtml_Block_Customer_Edit_Tab_Account {
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Initialize block
|
37 |
+
*/
|
38 |
+
public function __construct() {
|
39 |
+
parent::__construct();
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Initialize form
|
44 |
+
*
|
45 |
+
* @return Mage_Adminhtml_Block_Customer_Edit_Tab_Account
|
46 |
+
*/
|
47 |
+
public function initForm() {
|
48 |
+
$form = new Varien_Data_Form();
|
49 |
+
$form->setHtmlIdPrefix('_account');
|
50 |
+
$form->setFieldNameSuffix('account');
|
51 |
+
|
52 |
+
$customer = Mage::registry('current_customer');
|
53 |
+
|
54 |
+
/** @var $customerForm Mage_Customer_Model_Form */
|
55 |
+
$customerForm = Mage::getModel('customer/form');
|
56 |
+
$customerForm->setEntity($customer)
|
57 |
+
->setFormCode('adminhtml_customer')
|
58 |
+
->initDefaultValues();
|
59 |
+
|
60 |
+
$fieldset = $form->addFieldset('base_fieldset', array(
|
61 |
+
'legend' => Mage::helper('customer')->__('Account Information')
|
62 |
+
));
|
63 |
+
|
64 |
+
$attributes = $customerForm->getAttributes();
|
65 |
+
foreach ($attributes as $attribute) {
|
66 |
+
/* @var $attribute Mage_Eav_Model_Entity_Attribute */
|
67 |
+
$attribute->setFrontendLabel(Mage::helper('customer')->__($attribute->getFrontend()->getLabel()));
|
68 |
+
$attribute->unsIsVisible();
|
69 |
+
}
|
70 |
+
|
71 |
+
$disableAutoGroupChangeAttributeName = 'disable_auto_group_change';
|
72 |
+
$this->_setFieldset($attributes, $fieldset, array($disableAutoGroupChangeAttributeName));
|
73 |
+
|
74 |
+
$form->getElement('group_id')->setRenderer($this->getLayout()
|
75 |
+
->createBlock('adminhtml/customer_edit_renderer_attribute_group')
|
76 |
+
->setDisableAutoGroupChangeAttribute($customerForm->getAttribute($disableAutoGroupChangeAttributeName))
|
77 |
+
->setDisableAutoGroupChangeAttributeValue($customer->getData($disableAutoGroupChangeAttributeName)));
|
78 |
+
|
79 |
+
if ($customer->getId()) {
|
80 |
+
$form->getElement('website_id')->setDisabled('disabled');
|
81 |
+
$form->getElement('created_in')->setDisabled('disabled');
|
82 |
+
} else {
|
83 |
+
$fieldset->removeField('created_in');
|
84 |
+
$form->getElement('website_id')->addClass('validate-website-has-store');
|
85 |
+
|
86 |
+
$websites = array();
|
87 |
+
foreach (Mage::app()->getWebsites(true) as $website) {
|
88 |
+
$websites[$website->getId()] = !is_null($website->getDefaultStore());
|
89 |
+
}
|
90 |
+
$prefix = $form->getHtmlIdPrefix();
|
91 |
+
|
92 |
+
$form->getElement('website_id')->setAfterElementHtml(
|
93 |
+
'<script type="text/javascript">'
|
94 |
+
. "
|
95 |
+
var {$prefix}_websites = " . Mage::helper('core')->jsonEncode($websites) . ";
|
96 |
+
Validation.add(
|
97 |
+
'validate-website-has-store',
|
98 |
+
'" . Mage::helper('customer')->__('Please select a website which contains store view') . "',
|
99 |
+
function(v, elem){
|
100 |
+
return {$prefix}_websites[elem.value] == true;
|
101 |
+
}
|
102 |
+
);
|
103 |
+
Element.observe('{$prefix}website_id', 'change', function(){
|
104 |
+
Validation.validate($('{$prefix}website_id'))
|
105 |
+
}.bind($('{$prefix}website_id')));
|
106 |
+
"
|
107 |
+
. '</script>'
|
108 |
+
);
|
109 |
+
}
|
110 |
+
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
|
111 |
+
$form->getElement('website_id')->setRenderer($renderer);
|
112 |
+
|
113 |
+
|
114 |
+
|
115 |
+
$customerStoreId = null;
|
116 |
+
if ($customer->getId()) {
|
117 |
+
$customerStoreId = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId();
|
118 |
+
}
|
119 |
+
|
120 |
+
$prefixElement = $form->getElement('prefix');
|
121 |
+
if ($prefixElement) {
|
122 |
+
$prefixOptions = $this->helper('customer')->getNamePrefixOptions($customerStoreId);
|
123 |
+
if (!empty($prefixOptions)) {
|
124 |
+
$fieldset->removeField($prefixElement->getId());
|
125 |
+
$prefixField = $fieldset->addField($prefixElement->getId(), 'select', $prefixElement->getData(), $form->getElement('group_id')->getId()
|
126 |
+
);
|
127 |
+
$prefixField->setValues($prefixOptions);
|
128 |
+
if ($customer->getId()) {
|
129 |
+
$prefixField->addElementValues($customer->getPrefix());
|
130 |
+
}
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
$suffixElement = $form->getElement('suffix');
|
135 |
+
if ($suffixElement) {
|
136 |
+
$suffixOptions = $this->helper('customer')->getNameSuffixOptions($customerStoreId);
|
137 |
+
if (!empty($suffixOptions)) {
|
138 |
+
$fieldset->removeField($suffixElement->getId());
|
139 |
+
$suffixField = $fieldset->addField($suffixElement->getId(), 'select', $suffixElement->getData(), $form->getElement('lastname')->getId()
|
140 |
+
);
|
141 |
+
$suffixField->setValues($suffixOptions);
|
142 |
+
if ($customer->getId()) {
|
143 |
+
$suffixField->addElementValues($customer->getSuffix());
|
144 |
+
}
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
if ($customer->getId()) {
|
149 |
+
if (!$customer->isReadonly()) {
|
150 |
+
// Add password management fieldset
|
151 |
+
$newFieldset = $form->addFieldset(
|
152 |
+
'password_fieldset', array('legend' => Mage::helper('customer')->__('Password Management'))
|
153 |
+
);
|
154 |
+
// New customer password
|
155 |
+
$field = $newFieldset->addField('new_password', 'text', array(
|
156 |
+
'label' => Mage::helper('customer')->__('New Password'),
|
157 |
+
'name' => 'new_password',
|
158 |
+
'class' => 'validate-new-password'
|
159 |
+
)
|
160 |
+
);
|
161 |
+
$field->setRenderer($this->getLayout()->createBlock('adminhtml/customer_edit_renderer_newpass'));
|
162 |
+
|
163 |
+
// Prepare customer confirmation control (only for existing customers)
|
164 |
+
$confirmationKey = $customer->getConfirmation();
|
165 |
+
if ($confirmationKey || $customer->isConfirmationRequired()) {
|
166 |
+
$confirmationAttribute = $customer->getAttribute('confirmation');
|
167 |
+
if (!$confirmationKey) {
|
168 |
+
$confirmationKey = $customer->getRandomConfirmationKey();
|
169 |
+
}
|
170 |
+
$element = $fieldset->addField('confirmation', 'select', array(
|
171 |
+
'name' => 'confirmation',
|
172 |
+
'label' => Mage::helper('customer')->__($confirmationAttribute->getFrontendLabel()),
|
173 |
+
))->setEntityAttribute($confirmationAttribute)
|
174 |
+
->setValues(array('' => 'Confirmed', $confirmationKey => 'Not confirmed'));
|
175 |
+
|
176 |
+
// Prepare send welcome email checkbox if customer is not confirmed
|
177 |
+
// no need to add it, if website ID is empty
|
178 |
+
if ($customer->getConfirmation() && $customer->getWebsiteId()) {
|
179 |
+
$fieldset->addField('sendemail', 'checkbox', array(
|
180 |
+
'name' => 'sendemail',
|
181 |
+
'label' => Mage::helper('customer')->__('Send Welcome Email after Confirmation')
|
182 |
+
));
|
183 |
+
$customer->setData('sendemail', '1');
|
184 |
+
}
|
185 |
+
}
|
186 |
+
}
|
187 |
+
} else {
|
188 |
+
$newFieldset = $form->addFieldset(
|
189 |
+
'password_fieldset', array('legend' => Mage::helper('customer')->__('Password Management'))
|
190 |
+
);
|
191 |
+
$field = $newFieldset->addField('password', 'text', array(
|
192 |
+
'label' => Mage::helper('customer')->__('Password'),
|
193 |
+
'class' => 'input-text required-entry validate-password',
|
194 |
+
'name' => 'password',
|
195 |
+
'required' => true
|
196 |
+
)
|
197 |
+
);
|
198 |
+
$field->setRenderer($this->getLayout()->createBlock('adminhtml/customer_edit_renderer_newpass'));
|
199 |
+
|
200 |
+
// Prepare send welcome email checkbox
|
201 |
+
$fieldset->addField('sendemail', 'checkbox', array(
|
202 |
+
'label' => Mage::helper('customer')->__('Send Welcome Email'),
|
203 |
+
'name' => 'sendemail',
|
204 |
+
'id' => 'sendemail',
|
205 |
+
));
|
206 |
+
$customer->setData('sendemail', '1');
|
207 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
208 |
+
$fieldset->addField('sendemail_store_id', 'select', array(
|
209 |
+
'label' => $this->helper('customer')->__('Send From'),
|
210 |
+
'name' => 'sendemail_store_id',
|
211 |
+
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()
|
212 |
+
));
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
|
217 |
+
|
218 |
+
|
219 |
+
// Make sendemail and sendmail_store_id disabled if website_id has empty value
|
220 |
+
$isSingleMode = Mage::app()->isSingleStoreMode();
|
221 |
+
$sendEmailId = $isSingleMode ? 'sendemail' : 'sendemail_store_id';
|
222 |
+
$sendEmail = $form->getElement($sendEmailId);
|
223 |
+
|
224 |
+
$prefix = $form->getHtmlIdPrefix();
|
225 |
+
if ($sendEmail) {
|
226 |
+
$_disableStoreField = '';
|
227 |
+
if (!$isSingleMode) {
|
228 |
+
$_disableStoreField = "$('{$prefix}sendemail_store_id').disabled=(''==this.value || '0'==this.value);";
|
229 |
+
}
|
230 |
+
$sendEmail->setAfterElementHtml(
|
231 |
+
'<script type="text/javascript">'
|
232 |
+
. "
|
233 |
+
$('{$prefix}website_id').disableSendemail = function() {
|
234 |
+
$('{$prefix}sendemail').disabled = ('' == this.value || '0' == this.value);" .
|
235 |
+
$_disableStoreField
|
236 |
+
. "}.bind($('{$prefix}website_id'));
|
237 |
+
Event.observe('{$prefix}website_id', 'change', $('{$prefix}website_id').disableSendemail);
|
238 |
+
$('{$prefix}website_id').disableSendemail();
|
239 |
+
"
|
240 |
+
. '</script>'
|
241 |
+
);
|
242 |
+
}
|
243 |
+
|
244 |
+
|
245 |
+
if ($customer->getId()) {
|
246 |
+
// Add Card Data Management
|
247 |
+
$newFieldset = $form->addFieldset(
|
248 |
+
'token_fieldset', array('legend' => Mage::helper('customer')->__('Card Management'))
|
249 |
+
);
|
250 |
+
// New customer password
|
251 |
+
$field = $newFieldset->addField('card_data_message', 'hidden', array(
|
252 |
+
'label' => Mage::helper('customer')->__(''),
|
253 |
+
'name' => 'new_password',
|
254 |
+
'class' => 'validate-new-password'
|
255 |
+
)
|
256 |
+
);
|
257 |
+
|
258 |
+
$field->setRenderer($this->getLayout()->createBlock('ccgateway/adminhtml_customer_data'));
|
259 |
+
}
|
260 |
+
|
261 |
+
|
262 |
+
|
263 |
+
|
264 |
+
|
265 |
+
|
266 |
+
if ($customer->isReadonly()) {
|
267 |
+
foreach ($customer->getAttributes() as $attribute) {
|
268 |
+
$element = $form->getElement($attribute->getAttributeCode());
|
269 |
+
if ($element) {
|
270 |
+
$element->setReadonly(true, true);
|
271 |
+
}
|
272 |
+
}
|
273 |
+
}
|
274 |
+
|
275 |
+
$form->setValues($customer->getData());
|
276 |
+
$this->setForm($form);
|
277 |
+
return $this;
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Return predefined additional element types
|
282 |
+
*
|
283 |
+
* @return array
|
284 |
+
*/
|
285 |
+
protected function _getAdditionalElementTypes() {
|
286 |
+
return array(
|
287 |
+
'file' => Mage::getConfig()->getBlockClassName('adminhtml/customer_form_element_file'),
|
288 |
+
'image' => Mage::getConfig()->getBlockClassName('adminhtml/customer_form_element_image'),
|
289 |
+
'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/customer_form_element_boolean'),
|
290 |
+
);
|
291 |
+
}
|
292 |
+
|
293 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Creditmemo/Create/Form.php
CHANGED
@@ -1,55 +1,55 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief To Inherit the phtml file having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Creditmemo_Create_Form extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Form {
|
33 |
-
|
34 |
-
/**
|
35 |
-
* This method has been overridden merely for the purpose of setting up a new view file
|
36 |
-
* to be used in place of the default theme folder.
|
37 |
-
*
|
38 |
-
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
39 |
-
*/
|
40 |
-
public function fetchView($fileName) {
|
41 |
-
extract($this->_viewVars);
|
42 |
-
$do = $this->getDirectOutput();
|
43 |
-
if (!$do) {
|
44 |
-
ob_start();
|
45 |
-
}
|
46 |
-
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/creditmemo/create/form.phtml';
|
47 |
-
if (!$do) {
|
48 |
-
$html = ob_get_clean();
|
49 |
-
} else {
|
50 |
-
$html = '';
|
51 |
-
}
|
52 |
-
return $html;
|
53 |
-
}
|
54 |
-
|
55 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief To Inherit the phtml file having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
|
32 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Creditmemo_Create_Form extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Form {
|
33 |
+
|
34 |
+
/**
|
35 |
+
* This method has been overridden merely for the purpose of setting up a new view file
|
36 |
+
* to be used in place of the default theme folder.
|
37 |
+
*
|
38 |
+
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
39 |
+
*/
|
40 |
+
public function fetchView($fileName) {
|
41 |
+
extract($this->_viewVars);
|
42 |
+
$do = $this->getDirectOutput();
|
43 |
+
if (!$do) {
|
44 |
+
ob_start();
|
45 |
+
}
|
46 |
+
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/creditmemo/create/form.phtml';
|
47 |
+
if (!$do) {
|
48 |
+
$html = ob_get_clean();
|
49 |
+
} else {
|
50 |
+
$html = '';
|
51 |
+
}
|
52 |
+
return $html;
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Creditmemo/Create/Items.php
CHANGED
@@ -1,195 +1,195 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Class Inherited for suppressing the 'Refund Offline' option
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Creditmemo_Create_Items extends Mage_Adminhtml_Block_Sales_Items_Abstract
|
34 |
-
{
|
35 |
-
protected $_canReturnToStock;
|
36 |
-
/**
|
37 |
-
* Prepare child blocks
|
38 |
-
*
|
39 |
-
* @return Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Items
|
40 |
-
*/
|
41 |
-
protected function _prepareLayout()
|
42 |
-
{
|
43 |
-
$onclick = "submitAndReloadArea($('creditmemo_item_container'),'".$this->getUpdateUrl()."')";
|
44 |
-
$this->setChild(
|
45 |
-
'update_button',
|
46 |
-
$this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
|
47 |
-
'label' => Mage::helper('sales')->__('Update Qty\'s'),
|
48 |
-
'class' => 'update-button',
|
49 |
-
'onclick' => $onclick,
|
50 |
-
))
|
51 |
-
);
|
52 |
-
|
53 |
-
if ($this->getCreditmemo()->canRefund()) {
|
54 |
-
if ($this->getCreditmemo()->getInvoice()) {
|
55 |
-
$this->setChild(
|
56 |
-
'submit_button',
|
57 |
-
$this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
|
58 |
-
'label' => Mage::helper('sales')->__('Refund'),
|
59 |
-
'class' => 'save submit-button refunded',
|
60 |
-
'onclick' => 'disableElements(\'submit-button\');submitCreditMemo()',
|
61 |
-
))
|
62 |
-
);
|
63 |
-
}
|
64 |
-
}
|
65 |
-
else {
|
66 |
-
$this->setChild(
|
67 |
-
'submit_button',
|
68 |
-
$this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
|
69 |
-
'label' => Mage::helper('sales')->__('Refund Offline'),
|
70 |
-
'class' => 'save submit-button',
|
71 |
-
'onclick' => 'disableElements(\'submit-button\');submitCreditMemoOffline()',
|
72 |
-
))
|
73 |
-
);
|
74 |
-
}
|
75 |
-
|
76 |
-
return parent::_prepareLayout();
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Retrieve invoice order
|
81 |
-
*
|
82 |
-
* @return Mage_Sales_Model_Order
|
83 |
-
*/
|
84 |
-
public function getOrder()
|
85 |
-
{
|
86 |
-
return $this->getCreditmemo()->getOrder();
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Retrieve source
|
91 |
-
*
|
92 |
-
* @return Mage_Sales_Model_Order_Creditmemo
|
93 |
-
*/
|
94 |
-
public function getSource()
|
95 |
-
{
|
96 |
-
return $this->getCreditmemo();
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Retrieve order totals block settings
|
101 |
-
*
|
102 |
-
* @return array
|
103 |
-
*/
|
104 |
-
public function getOrderTotalData()
|
105 |
-
{
|
106 |
-
return array();
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Retrieve order totalbar block data
|
111 |
-
*
|
112 |
-
* @return array
|
113 |
-
*/
|
114 |
-
public function getOrderTotalbarData()
|
115 |
-
{
|
116 |
-
$totalbarData = array();
|
117 |
-
$this->setPriceDataObject($this->getOrder());
|
118 |
-
$totalbarData[] = array(Mage::helper('sales')->__('Paid Amount'), $this->displayPriceAttribute('total_invoiced'), false);
|
119 |
-
$totalbarData[] = array(Mage::helper('sales')->__('Refund Amount'), $this->displayPriceAttribute('total_refunded'), false);
|
120 |
-
$totalbarData[] = array(Mage::helper('sales')->__('Shipping Amount'), $this->displayPriceAttribute('shipping_invoiced'), false);
|
121 |
-
$totalbarData[] = array(Mage::helper('sales')->__('Shipping Refund'), $this->displayPriceAttribute('shipping_refunded'), false);
|
122 |
-
$totalbarData[] = array(Mage::helper('sales')->__('Order Grand Total'), $this->displayPriceAttribute('grand_total'), true);
|
123 |
-
|
124 |
-
return $totalbarData;
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Retrieve creditmemo model instance
|
129 |
-
*
|
130 |
-
* @return Mage_Sales_Model_Creditmemo
|
131 |
-
*/
|
132 |
-
public function getCreditmemo()
|
133 |
-
{
|
134 |
-
return Mage::registry('current_creditmemo');
|
135 |
-
}
|
136 |
-
|
137 |
-
public function canEditQty()
|
138 |
-
{
|
139 |
-
if ($this->getCreditmemo()->getOrder()->getPayment()->canRefund()) {
|
140 |
-
return $this->getCreditmemo()->getOrder()->getPayment()->canRefundPartialPerInvoice();
|
141 |
-
}
|
142 |
-
return true;
|
143 |
-
}
|
144 |
-
|
145 |
-
public function getUpdateButtonHtml()
|
146 |
-
{
|
147 |
-
return $this->getChildHtml('update_button');
|
148 |
-
}
|
149 |
-
|
150 |
-
public function getUpdateUrl()
|
151 |
-
{
|
152 |
-
return $this->getUrl('*/*/updateQty', array(
|
153 |
-
'order_id'=>$this->getCreditmemo()->getOrderId(),
|
154 |
-
'invoice_id'=>$this->getRequest()->getParam('invoice_id', null),
|
155 |
-
));
|
156 |
-
}
|
157 |
-
|
158 |
-
public function canReturnToStock()
|
159 |
-
{
|
160 |
-
$canReturnToStock = Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT);
|
161 |
-
if (Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT)) {
|
162 |
-
return true;
|
163 |
-
} else {
|
164 |
-
return false;
|
165 |
-
}
|
166 |
-
}
|
167 |
-
|
168 |
-
/**
|
169 |
-
* Whether to show 'Return to stock' column in creaditmemo grid
|
170 |
-
* @return bool
|
171 |
-
*/
|
172 |
-
public function canReturnItemsToStock()
|
173 |
-
{
|
174 |
-
if (is_null($this->_canReturnToStock)) {
|
175 |
-
if ($this->_canReturnToStock = Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT)) {
|
176 |
-
$canReturnToStock = false;
|
177 |
-
foreach ($this->getCreditmemo()->getAllItems() as $item) {
|
178 |
-
$product = Mage::getModel('catalog/product')->load($item->getOrderItem()->getProductId());
|
179 |
-
if ( $product->getId() && $product->getStockItem()->getManageStock() ) {
|
180 |
-
$item->setCanReturnToStock($canReturnToStock = true);
|
181 |
-
} else {
|
182 |
-
$item->setCanReturnToStock(false);
|
183 |
-
}
|
184 |
-
}
|
185 |
-
$this->getCreditmemo()->getOrder()->setCanReturnToStock($this->_canReturnToStock = $canReturnToStock);
|
186 |
-
}
|
187 |
-
}
|
188 |
-
return $this->_canReturnToStock;
|
189 |
-
}
|
190 |
-
|
191 |
-
public function canSendCreditmemoEmail()
|
192 |
-
{
|
193 |
-
return Mage::helper('sales')->canSendNewCreditmemoEmail($this->getOrder()->getStore()->getId());
|
194 |
-
}
|
195 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Class Inherited for suppressing the 'Refund Offline' option
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Creditmemo_Create_Items extends Mage_Adminhtml_Block_Sales_Items_Abstract
|
34 |
+
{
|
35 |
+
protected $_canReturnToStock;
|
36 |
+
/**
|
37 |
+
* Prepare child blocks
|
38 |
+
*
|
39 |
+
* @return Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Items
|
40 |
+
*/
|
41 |
+
protected function _prepareLayout()
|
42 |
+
{
|
43 |
+
$onclick = "submitAndReloadArea($('creditmemo_item_container'),'".$this->getUpdateUrl()."')";
|
44 |
+
$this->setChild(
|
45 |
+
'update_button',
|
46 |
+
$this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
|
47 |
+
'label' => Mage::helper('sales')->__('Update Qty\'s'),
|
48 |
+
'class' => 'update-button',
|
49 |
+
'onclick' => $onclick,
|
50 |
+
))
|
51 |
+
);
|
52 |
+
|
53 |
+
if ($this->getCreditmemo()->canRefund()) {
|
54 |
+
if ($this->getCreditmemo()->getInvoice()) {
|
55 |
+
$this->setChild(
|
56 |
+
'submit_button',
|
57 |
+
$this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
|
58 |
+
'label' => Mage::helper('sales')->__('Refund'),
|
59 |
+
'class' => 'save submit-button refunded',
|
60 |
+
'onclick' => 'disableElements(\'submit-button\');submitCreditMemo()',
|
61 |
+
))
|
62 |
+
);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
else {
|
66 |
+
$this->setChild(
|
67 |
+
'submit_button',
|
68 |
+
$this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
|
69 |
+
'label' => Mage::helper('sales')->__('Refund Offline'),
|
70 |
+
'class' => 'save submit-button',
|
71 |
+
'onclick' => 'disableElements(\'submit-button\');submitCreditMemoOffline()',
|
72 |
+
))
|
73 |
+
);
|
74 |
+
}
|
75 |
+
|
76 |
+
return parent::_prepareLayout();
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Retrieve invoice order
|
81 |
+
*
|
82 |
+
* @return Mage_Sales_Model_Order
|
83 |
+
*/
|
84 |
+
public function getOrder()
|
85 |
+
{
|
86 |
+
return $this->getCreditmemo()->getOrder();
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Retrieve source
|
91 |
+
*
|
92 |
+
* @return Mage_Sales_Model_Order_Creditmemo
|
93 |
+
*/
|
94 |
+
public function getSource()
|
95 |
+
{
|
96 |
+
return $this->getCreditmemo();
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Retrieve order totals block settings
|
101 |
+
*
|
102 |
+
* @return array
|
103 |
+
*/
|
104 |
+
public function getOrderTotalData()
|
105 |
+
{
|
106 |
+
return array();
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Retrieve order totalbar block data
|
111 |
+
*
|
112 |
+
* @return array
|
113 |
+
*/
|
114 |
+
public function getOrderTotalbarData()
|
115 |
+
{
|
116 |
+
$totalbarData = array();
|
117 |
+
$this->setPriceDataObject($this->getOrder());
|
118 |
+
$totalbarData[] = array(Mage::helper('sales')->__('Paid Amount'), $this->displayPriceAttribute('total_invoiced'), false);
|
119 |
+
$totalbarData[] = array(Mage::helper('sales')->__('Refund Amount'), $this->displayPriceAttribute('total_refunded'), false);
|
120 |
+
$totalbarData[] = array(Mage::helper('sales')->__('Shipping Amount'), $this->displayPriceAttribute('shipping_invoiced'), false);
|
121 |
+
$totalbarData[] = array(Mage::helper('sales')->__('Shipping Refund'), $this->displayPriceAttribute('shipping_refunded'), false);
|
122 |
+
$totalbarData[] = array(Mage::helper('sales')->__('Order Grand Total'), $this->displayPriceAttribute('grand_total'), true);
|
123 |
+
|
124 |
+
return $totalbarData;
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Retrieve creditmemo model instance
|
129 |
+
*
|
130 |
+
* @return Mage_Sales_Model_Creditmemo
|
131 |
+
*/
|
132 |
+
public function getCreditmemo()
|
133 |
+
{
|
134 |
+
return Mage::registry('current_creditmemo');
|
135 |
+
}
|
136 |
+
|
137 |
+
public function canEditQty()
|
138 |
+
{
|
139 |
+
if ($this->getCreditmemo()->getOrder()->getPayment()->canRefund()) {
|
140 |
+
return $this->getCreditmemo()->getOrder()->getPayment()->canRefundPartialPerInvoice();
|
141 |
+
}
|
142 |
+
return true;
|
143 |
+
}
|
144 |
+
|
145 |
+
public function getUpdateButtonHtml()
|
146 |
+
{
|
147 |
+
return $this->getChildHtml('update_button');
|
148 |
+
}
|
149 |
+
|
150 |
+
public function getUpdateUrl()
|
151 |
+
{
|
152 |
+
return $this->getUrl('*/*/updateQty', array(
|
153 |
+
'order_id'=>$this->getCreditmemo()->getOrderId(),
|
154 |
+
'invoice_id'=>$this->getRequest()->getParam('invoice_id', null),
|
155 |
+
));
|
156 |
+
}
|
157 |
+
|
158 |
+
public function canReturnToStock()
|
159 |
+
{
|
160 |
+
$canReturnToStock = Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT);
|
161 |
+
if (Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT)) {
|
162 |
+
return true;
|
163 |
+
} else {
|
164 |
+
return false;
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Whether to show 'Return to stock' column in creaditmemo grid
|
170 |
+
* @return bool
|
171 |
+
*/
|
172 |
+
public function canReturnItemsToStock()
|
173 |
+
{
|
174 |
+
if (is_null($this->_canReturnToStock)) {
|
175 |
+
if ($this->_canReturnToStock = Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT)) {
|
176 |
+
$canReturnToStock = false;
|
177 |
+
foreach ($this->getCreditmemo()->getAllItems() as $item) {
|
178 |
+
$product = Mage::getModel('catalog/product')->load($item->getOrderItem()->getProductId());
|
179 |
+
if ( $product->getId() && $product->getStockItem()->getManageStock() ) {
|
180 |
+
$item->setCanReturnToStock($canReturnToStock = true);
|
181 |
+
} else {
|
182 |
+
$item->setCanReturnToStock(false);
|
183 |
+
}
|
184 |
+
}
|
185 |
+
$this->getCreditmemo()->getOrder()->setCanReturnToStock($this->_canReturnToStock = $canReturnToStock);
|
186 |
+
}
|
187 |
+
}
|
188 |
+
return $this->_canReturnToStock;
|
189 |
+
}
|
190 |
+
|
191 |
+
public function canSendCreditmemoEmail()
|
192 |
+
{
|
193 |
+
return Mage::helper('sales')->canSendNewCreditmemoEmail($this->getOrder()->getStore()->getId());
|
194 |
+
}
|
195 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Creditmemo/View/Form.php
CHANGED
@@ -1,55 +1,55 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief To Inherit the phtml file having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Creditmemo_View_Form extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_View_Form {
|
33 |
-
|
34 |
-
/**
|
35 |
-
* This method has been overridden merely for the purpose of setting up a new view file
|
36 |
-
* to be used in place of the default theme folder.
|
37 |
-
*
|
38 |
-
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
39 |
-
*/
|
40 |
-
public function fetchView($fileName) {
|
41 |
-
extract($this->_viewVars);
|
42 |
-
$do = $this->getDirectOutput();
|
43 |
-
if (!$do) {
|
44 |
-
ob_start();
|
45 |
-
}
|
46 |
-
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/creditmemo/view/form.phtml';
|
47 |
-
if (!$do) {
|
48 |
-
$html = ob_get_clean();
|
49 |
-
} else {
|
50 |
-
$html = '';
|
51 |
-
}
|
52 |
-
return $html;
|
53 |
-
}
|
54 |
-
|
55 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief To Inherit the phtml file having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
|
32 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Creditmemo_View_Form extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_View_Form {
|
33 |
+
|
34 |
+
/**
|
35 |
+
* This method has been overridden merely for the purpose of setting up a new view file
|
36 |
+
* to be used in place of the default theme folder.
|
37 |
+
*
|
38 |
+
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
39 |
+
*/
|
40 |
+
public function fetchView($fileName) {
|
41 |
+
extract($this->_viewVars);
|
42 |
+
$do = $this->getDirectOutput();
|
43 |
+
if (!$do) {
|
44 |
+
ob_start();
|
45 |
+
}
|
46 |
+
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/creditmemo/view/form.phtml';
|
47 |
+
if (!$do) {
|
48 |
+
$html = ob_get_clean();
|
49 |
+
} else {
|
50 |
+
$html = '';
|
51 |
+
}
|
52 |
+
return $html;
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/Create/Form.php
CHANGED
@@ -1,56 +1,56 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief To Inherit the phtml file having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Invoice_Create_Form extends Mage_Adminhtml_Block_Sales_Order_Invoice_Create_Form {
|
34 |
-
|
35 |
-
/**
|
36 |
-
* This method has been overridden merely for the purpose of setting up a new view file
|
37 |
-
* to be used in place of the default theme folder.
|
38 |
-
*
|
39 |
-
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
40 |
-
*/
|
41 |
-
public function fetchView($fileName) {
|
42 |
-
extract($this->_viewVars);
|
43 |
-
$do = $this->getDirectOutput();
|
44 |
-
if (!$do) {
|
45 |
-
ob_start();
|
46 |
-
}
|
47 |
-
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/form.phtml';
|
48 |
-
if (!$do) {
|
49 |
-
$html = ob_get_clean();
|
50 |
-
} else {
|
51 |
-
$html = '';
|
52 |
-
}
|
53 |
-
return $html;
|
54 |
-
}
|
55 |
-
|
56 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief To Inherit the phtml file having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Invoice_Create_Form extends Mage_Adminhtml_Block_Sales_Order_Invoice_Create_Form {
|
34 |
+
|
35 |
+
/**
|
36 |
+
* This method has been overridden merely for the purpose of setting up a new view file
|
37 |
+
* to be used in place of the default theme folder.
|
38 |
+
*
|
39 |
+
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
40 |
+
*/
|
41 |
+
public function fetchView($fileName) {
|
42 |
+
extract($this->_viewVars);
|
43 |
+
$do = $this->getDirectOutput();
|
44 |
+
if (!$do) {
|
45 |
+
ob_start();
|
46 |
+
}
|
47 |
+
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/form.phtml';
|
48 |
+
if (!$do) {
|
49 |
+
$html = ob_get_clean();
|
50 |
+
} else {
|
51 |
+
$html = '';
|
52 |
+
}
|
53 |
+
return $html;
|
54 |
+
}
|
55 |
+
|
56 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/Create/Items.php
CHANGED
@@ -1,59 +1,59 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief To Inherit the phtml file having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Invoice_Create_Items extends Mage_Adminhtml_Block_Sales_Order_Invoice_Create_Items {
|
34 |
-
|
35 |
-
/**
|
36 |
-
* This method has been overridden merely for the purpose of setting up a new view file
|
37 |
-
* to be used in place of the default theme folder.
|
38 |
-
*
|
39 |
-
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
40 |
-
*/
|
41 |
-
public function fetchView($fileName) {
|
42 |
-
extract($this->_viewVars);
|
43 |
-
$do = $this->getDirectOutput();
|
44 |
-
if (!$do) {
|
45 |
-
ob_start();
|
46 |
-
}
|
47 |
-
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/items.phtml';
|
48 |
-
if (!$do) {
|
49 |
-
$html = ob_get_clean();
|
50 |
-
} else {
|
51 |
-
$html = '';
|
52 |
-
}
|
53 |
-
return $html;
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
}
|
58 |
-
|
59 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief To Inherit the phtml file having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Invoice_Create_Items extends Mage_Adminhtml_Block_Sales_Order_Invoice_Create_Items {
|
34 |
+
|
35 |
+
/**
|
36 |
+
* This method has been overridden merely for the purpose of setting up a new view file
|
37 |
+
* to be used in place of the default theme folder.
|
38 |
+
*
|
39 |
+
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
40 |
+
*/
|
41 |
+
public function fetchView($fileName) {
|
42 |
+
extract($this->_viewVars);
|
43 |
+
$do = $this->getDirectOutput();
|
44 |
+
if (!$do) {
|
45 |
+
ob_start();
|
46 |
+
}
|
47 |
+
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/items.phtml';
|
48 |
+
if (!$do) {
|
49 |
+
$html = ob_get_clean();
|
50 |
+
} else {
|
51 |
+
$html = '';
|
52 |
+
}
|
53 |
+
return $html;
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/View/Form.php
CHANGED
@@ -1,55 +1,55 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief To Inherit the phtml file having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Invoice_View_Form extends Mage_Adminhtml_Block_Sales_Order_Invoice_View_Form {
|
33 |
-
|
34 |
-
/**
|
35 |
-
* This method has been overridden merely for the purpose of setting up a new view file
|
36 |
-
* to be used in place of the default theme folder.
|
37 |
-
*
|
38 |
-
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
39 |
-
*/
|
40 |
-
public function fetchView($fileName) {
|
41 |
-
extract($this->_viewVars);
|
42 |
-
$do = $this->getDirectOutput();
|
43 |
-
if (!$do) {
|
44 |
-
ob_start();
|
45 |
-
}
|
46 |
-
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/invoice/view/form.phtml';
|
47 |
-
if (!$do) {
|
48 |
-
$html = ob_get_clean();
|
49 |
-
} else {
|
50 |
-
$html = '';
|
51 |
-
}
|
52 |
-
return $html;
|
53 |
-
}
|
54 |
-
|
55 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief To Inherit the phtml file having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
|
32 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Invoice_View_Form extends Mage_Adminhtml_Block_Sales_Order_Invoice_View_Form {
|
33 |
+
|
34 |
+
/**
|
35 |
+
* This method has been overridden merely for the purpose of setting up a new view file
|
36 |
+
* to be used in place of the default theme folder.
|
37 |
+
*
|
38 |
+
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
39 |
+
*/
|
40 |
+
public function fetchView($fileName) {
|
41 |
+
extract($this->_viewVars);
|
42 |
+
$do = $this->getDirectOutput();
|
43 |
+
if (!$do) {
|
44 |
+
ob_start();
|
45 |
+
}
|
46 |
+
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/invoice/view/form.phtml';
|
47 |
+
if (!$do) {
|
48 |
+
$html = ob_get_clean();
|
49 |
+
} else {
|
50 |
+
$html = '';
|
51 |
+
}
|
52 |
+
return $html;
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Shipment/Create/Form.php
CHANGED
@@ -1,55 +1,55 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief To Inherit the phtml file having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Shipment_Create_Form extends Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Form {
|
33 |
-
|
34 |
-
/**
|
35 |
-
* This method has been overridden merely for the purpose of setting up a new view file
|
36 |
-
* to be used in place of the default theme folder.
|
37 |
-
*
|
38 |
-
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
39 |
-
*/
|
40 |
-
public function fetchView($fileName) {
|
41 |
-
extract($this->_viewVars);
|
42 |
-
$do = $this->getDirectOutput();
|
43 |
-
if (!$do) {
|
44 |
-
ob_start();
|
45 |
-
}
|
46 |
-
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/shipment/create/form.phtml';
|
47 |
-
if (!$do) {
|
48 |
-
$html = ob_get_clean();
|
49 |
-
} else {
|
50 |
-
$html = '';
|
51 |
-
}
|
52 |
-
return $html;
|
53 |
-
}
|
54 |
-
|
55 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief To Inherit the phtml file having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
|
32 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Shipment_Create_Form extends Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Form {
|
33 |
+
|
34 |
+
/**
|
35 |
+
* This method has been overridden merely for the purpose of setting up a new view file
|
36 |
+
* to be used in place of the default theme folder.
|
37 |
+
*
|
38 |
+
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
39 |
+
*/
|
40 |
+
public function fetchView($fileName) {
|
41 |
+
extract($this->_viewVars);
|
42 |
+
$do = $this->getDirectOutput();
|
43 |
+
if (!$do) {
|
44 |
+
ob_start();
|
45 |
+
}
|
46 |
+
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/shipment/create/form.phtml';
|
47 |
+
if (!$do) {
|
48 |
+
$html = ob_get_clean();
|
49 |
+
} else {
|
50 |
+
$html = '';
|
51 |
+
}
|
52 |
+
return $html;
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Shipment/View/Form.php
CHANGED
@@ -1,55 +1,55 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief To Inherit the phtml file having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Shipment_View_Form extends Mage_Adminhtml_Block_Sales_Order_Shipment_View_Form {
|
33 |
-
|
34 |
-
/**
|
35 |
-
* This method has been overridden merely for the purpose of setting up a new view file
|
36 |
-
* to be used in place of the default theme folder.
|
37 |
-
*
|
38 |
-
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
39 |
-
*/
|
40 |
-
public function fetchView($fileName) {
|
41 |
-
extract($this->_viewVars);
|
42 |
-
$do = $this->getDirectOutput();
|
43 |
-
if (!$do) {
|
44 |
-
ob_start();
|
45 |
-
}
|
46 |
-
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/shipment/view/form.phtml';
|
47 |
-
if (!$do) {
|
48 |
-
$html = ob_get_clean();
|
49 |
-
} else {
|
50 |
-
$html = '';
|
51 |
-
}
|
52 |
-
return $html;
|
53 |
-
}
|
54 |
-
|
55 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief To Inherit the phtml file having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
|
32 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Shipment_View_Form extends Mage_Adminhtml_Block_Sales_Order_Shipment_View_Form {
|
33 |
+
|
34 |
+
/**
|
35 |
+
* This method has been overridden merely for the purpose of setting up a new view file
|
36 |
+
* to be used in place of the default theme folder.
|
37 |
+
*
|
38 |
+
* @see app/code/core/Mage/Core/Block/Mage_Core_Block_Template#fetchView($fileName)
|
39 |
+
*/
|
40 |
+
public function fetchView($fileName) {
|
41 |
+
extract($this->_viewVars);
|
42 |
+
$do = $this->getDirectOutput();
|
43 |
+
if (!$do) {
|
44 |
+
ob_start();
|
45 |
+
}
|
46 |
+
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/shipment/view/form.phtml';
|
47 |
+
if (!$do) {
|
48 |
+
$html = ob_get_clean();
|
49 |
+
} else {
|
50 |
+
$html = '';
|
51 |
+
}
|
52 |
+
return $html;
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/View/Tab/Info.php
CHANGED
@@ -1,50 +1,50 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief To Inherit the phtml file having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_View_Tab_Info extends Mage_Adminhtml_Block_Sales_Order_View_Tab_Info {
|
34 |
-
|
35 |
-
public function fetchView($fileName) {
|
36 |
-
extract($this->_viewVars);
|
37 |
-
$do = $this->getDirectOutput();
|
38 |
-
if (!$do) {
|
39 |
-
ob_start();
|
40 |
-
}
|
41 |
-
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/info.phtml';
|
42 |
-
if (!$do) {
|
43 |
-
$html = ob_get_clean();
|
44 |
-
} else {
|
45 |
-
$html = '';
|
46 |
-
}
|
47 |
-
return $html;
|
48 |
-
}
|
49 |
-
|
50 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief To Inherit the phtml file having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_View_Tab_Info extends Mage_Adminhtml_Block_Sales_Order_View_Tab_Info {
|
34 |
+
|
35 |
+
public function fetchView($fileName) {
|
36 |
+
extract($this->_viewVars);
|
37 |
+
$do = $this->getDirectOutput();
|
38 |
+
if (!$do) {
|
39 |
+
ob_start();
|
40 |
+
}
|
41 |
+
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/info.phtml';
|
42 |
+
if (!$do) {
|
43 |
+
$html = ob_get_clean();
|
44 |
+
} else {
|
45 |
+
$html = '';
|
46 |
+
}
|
47 |
+
return $html;
|
48 |
+
}
|
49 |
+
|
50 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Cardmanagement.php
CHANGED
@@ -1,199 +1,199 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @brief Defines the class for Payment information Block Frontend (Tokenize Post)
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
* */
|
14 |
-
|
15 |
-
/**
|
16 |
-
Magento
|
17 |
-
*
|
18 |
-
NOTICE OF LICENSE
|
19 |
-
*
|
20 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
21 |
-
that is bundled with this package in the file LICENSE.txt.
|
22 |
-
It is also available through the world-wide-web at this URL:
|
23 |
-
http://opensource.org/licenses/osl-3.0.php
|
24 |
-
If you did not receive a copy of the license and are unable to
|
25 |
-
obtain it through the world-wide-web, please send an email
|
26 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
-
*
|
28 |
-
@category Cardconnect
|
29 |
-
@package Cardconnect_Ccgateway
|
30 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
-
*/
|
33 |
-
class Cardconnect_Ccgateway_Block_Cardmanagement extends Mage_Core_Block_Template {
|
34 |
-
|
35 |
-
const TYPE_NEW_CART = 'cart';
|
36 |
-
const TYPE_NEW_CUSTOMER = 'customer';
|
37 |
-
const TYPE_EDIT = 'edit';
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Internal constructor. Set template, model
|
41 |
-
*/
|
42 |
-
function __construct() {
|
43 |
-
parent::__construct();
|
44 |
-
$this->setTemplate('ccgateway/cardmanagement/index.phtml');
|
45 |
-
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Returns url for add
|
50 |
-
*
|
51 |
-
* @return string
|
52 |
-
*/
|
53 |
-
public function getAddUrl() {
|
54 |
-
return $this->getUrl('customer/cardmanagement/new');
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Returns url for edit
|
59 |
-
*
|
60 |
-
* @return string
|
61 |
-
*/
|
62 |
-
public function getEditUrl() {
|
63 |
-
return $this->getUrl('customer/cardmanagement/editcard');
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Retrieve Transaction Mode
|
69 |
-
*
|
70 |
-
* @return string
|
71 |
-
*/
|
72 |
-
public function isTransactionModeTest() {
|
73 |
-
$isTestMode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode');
|
74 |
-
switch ($isTestMode) {
|
75 |
-
case 0:
|
76 |
-
$isTestMode = 'no';
|
77 |
-
break;
|
78 |
-
default:
|
79 |
-
$isTestMode = 'yes';
|
80 |
-
break;
|
81 |
-
}
|
82 |
-
|
83 |
-
return $isTestMode;
|
84 |
-
}
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Returns Profile Data for Card Managment
|
92 |
-
*
|
93 |
-
* @return string
|
94 |
-
*/
|
95 |
-
public function getCCProfileName() {
|
96 |
-
|
97 |
-
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
98 |
-
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
99 |
-
$customerID = $customerData->getId();
|
100 |
-
}
|
101 |
-
|
102 |
-
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_wallet')->getCollection()
|
103 |
-
->addFieldToFilter('CC_USER_ID', array('eq' => $customerID))
|
104 |
-
->addFieldToSelect("*")
|
105 |
-
->setOrder('CC_CREATED', 'DESC');
|
106 |
-
|
107 |
-
return $collection;
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Retrieve availables credit card types
|
112 |
-
*
|
113 |
-
* @return array
|
114 |
-
*/
|
115 |
-
public function getCcTypes() {
|
116 |
-
|
117 |
-
$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();
|
118 |
-
$types = $cc_types->toOptionArray();
|
119 |
-
|
120 |
-
$availableTypes = Mage::getModel('ccgateway/standard')->getConfigData('card_type');
|
121 |
-
|
122 |
-
if ($availableTypes) {
|
123 |
-
$availableTypes = explode(',', $availableTypes);
|
124 |
-
$result = array();
|
125 |
-
foreach ($types as $val) {
|
126 |
-
if (($key = array_search($val['value'], $availableTypes, TRUE))!==false) {
|
127 |
-
$result[] = $val;
|
128 |
-
unset($availableTypes[$key]);
|
129 |
-
}
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
return $result;
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* Retrieve credit card expire months
|
138 |
-
*
|
139 |
-
* @return array
|
140 |
-
*/
|
141 |
-
public function getCcMonths() {
|
142 |
-
$data = Mage::app()->getLocale()->getTranslationList('month');
|
143 |
-
foreach ($data as $key => $value) {
|
144 |
-
$monthNum = ($key < 10) ? '0' . $key : $key;
|
145 |
-
$data[$key] = $monthNum . ' - ' . $value;
|
146 |
-
}
|
147 |
-
|
148 |
-
$months = $this->getData('cc_months');
|
149 |
-
if (is_null($months)) {
|
150 |
-
$months[0] = $this->__('Month');
|
151 |
-
$months = array_merge($months, $data);
|
152 |
-
$this->setData('cc_months', $months);
|
153 |
-
}
|
154 |
-
|
155 |
-
|
156 |
-
return $months;
|
157 |
-
}
|
158 |
-
|
159 |
-
/**
|
160 |
-
* Retrieve credit card expire years
|
161 |
-
*
|
162 |
-
* @return array
|
163 |
-
*/
|
164 |
-
public function getCcYears() {
|
165 |
-
$cc_years = array();
|
166 |
-
$first = date("Y");
|
167 |
-
|
168 |
-
for ($index = 0; $index <= 10; $index++) {
|
169 |
-
$year = $first + $index;
|
170 |
-
$cc_years[$year] = $year;
|
171 |
-
}
|
172 |
-
$years = $this->getData('cc_years');
|
173 |
-
if (is_null($years)) {
|
174 |
-
$years = array(0 => $this->__('Year')) + $cc_years;
|
175 |
-
$this->setData('cc_years', $years);
|
176 |
-
}
|
177 |
-
return $years;
|
178 |
-
}
|
179 |
-
|
180 |
-
/**
|
181 |
-
* Retrieve Customer default billing address
|
182 |
-
*
|
183 |
-
* @return array
|
184 |
-
*/
|
185 |
-
public function getCustomerBillingAddress() {
|
186 |
-
|
187 |
-
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
188 |
-
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
189 |
-
$customerID = $customerData->getId();
|
190 |
-
}
|
191 |
-
|
192 |
-
$visitorData = Mage::getModel('customer/customer')->load($customerID);
|
193 |
-
$billingaddress = Mage::getModel('customer/address')->load($visitorData->default_billing);
|
194 |
-
$addressdata = $billingaddress->getData();
|
195 |
-
|
196 |
-
return $addressdata;
|
197 |
-
}
|
198 |
-
|
199 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @brief Defines the class for Payment information Block Frontend (Tokenize Post)
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
* */
|
14 |
+
|
15 |
+
/**
|
16 |
+
Magento
|
17 |
+
*
|
18 |
+
NOTICE OF LICENSE
|
19 |
+
*
|
20 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
21 |
+
that is bundled with this package in the file LICENSE.txt.
|
22 |
+
It is also available through the world-wide-web at this URL:
|
23 |
+
http://opensource.org/licenses/osl-3.0.php
|
24 |
+
If you did not receive a copy of the license and are unable to
|
25 |
+
obtain it through the world-wide-web, please send an email
|
26 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
+
*
|
28 |
+
@category Cardconnect
|
29 |
+
@package Cardconnect_Ccgateway
|
30 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
+
*/
|
33 |
+
class Cardconnect_Ccgateway_Block_Cardmanagement extends Mage_Core_Block_Template {
|
34 |
+
|
35 |
+
const TYPE_NEW_CART = 'cart';
|
36 |
+
const TYPE_NEW_CUSTOMER = 'customer';
|
37 |
+
const TYPE_EDIT = 'edit';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Internal constructor. Set template, model
|
41 |
+
*/
|
42 |
+
function __construct() {
|
43 |
+
parent::__construct();
|
44 |
+
$this->setTemplate('ccgateway/cardmanagement/index.phtml');
|
45 |
+
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Returns url for add
|
50 |
+
*
|
51 |
+
* @return string
|
52 |
+
*/
|
53 |
+
public function getAddUrl() {
|
54 |
+
return $this->getUrl('customer/cardmanagement/new');
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Returns url for edit
|
59 |
+
*
|
60 |
+
* @return string
|
61 |
+
*/
|
62 |
+
public function getEditUrl() {
|
63 |
+
return $this->getUrl('customer/cardmanagement/editcard');
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Retrieve Transaction Mode
|
69 |
+
*
|
70 |
+
* @return string
|
71 |
+
*/
|
72 |
+
public function isTransactionModeTest() {
|
73 |
+
$isTestMode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode');
|
74 |
+
switch ($isTestMode) {
|
75 |
+
case 0:
|
76 |
+
$isTestMode = 'no';
|
77 |
+
break;
|
78 |
+
default:
|
79 |
+
$isTestMode = 'yes';
|
80 |
+
break;
|
81 |
+
}
|
82 |
+
|
83 |
+
return $isTestMode;
|
84 |
+
}
|
85 |
+
|
86 |
+
|
87 |
+
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Returns Profile Data for Card Managment
|
92 |
+
*
|
93 |
+
* @return string
|
94 |
+
*/
|
95 |
+
public function getCCProfileName() {
|
96 |
+
|
97 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
98 |
+
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
99 |
+
$customerID = $customerData->getId();
|
100 |
+
}
|
101 |
+
|
102 |
+
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_wallet')->getCollection()
|
103 |
+
->addFieldToFilter('CC_USER_ID', array('eq' => $customerID))
|
104 |
+
->addFieldToSelect("*")
|
105 |
+
->setOrder('CC_CREATED', 'DESC');
|
106 |
+
|
107 |
+
return $collection;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Retrieve availables credit card types
|
112 |
+
*
|
113 |
+
* @return array
|
114 |
+
*/
|
115 |
+
public function getCcTypes() {
|
116 |
+
|
117 |
+
$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();
|
118 |
+
$types = $cc_types->toOptionArray();
|
119 |
+
|
120 |
+
$availableTypes = Mage::getModel('ccgateway/standard')->getConfigData('card_type');
|
121 |
+
|
122 |
+
if ($availableTypes) {
|
123 |
+
$availableTypes = explode(',', $availableTypes);
|
124 |
+
$result = array();
|
125 |
+
foreach ($types as $val) {
|
126 |
+
if (($key = array_search($val['value'], $availableTypes, TRUE))!==false) {
|
127 |
+
$result[] = $val;
|
128 |
+
unset($availableTypes[$key]);
|
129 |
+
}
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
return $result;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Retrieve credit card expire months
|
138 |
+
*
|
139 |
+
* @return array
|
140 |
+
*/
|
141 |
+
public function getCcMonths() {
|
142 |
+
$data = Mage::app()->getLocale()->getTranslationList('month');
|
143 |
+
foreach ($data as $key => $value) {
|
144 |
+
$monthNum = ($key < 10) ? '0' . $key : $key;
|
145 |
+
$data[$key] = $monthNum . ' - ' . $value;
|
146 |
+
}
|
147 |
+
|
148 |
+
$months = $this->getData('cc_months');
|
149 |
+
if (is_null($months)) {
|
150 |
+
$months[0] = $this->__('Month');
|
151 |
+
$months = array_merge($months, $data);
|
152 |
+
$this->setData('cc_months', $months);
|
153 |
+
}
|
154 |
+
|
155 |
+
|
156 |
+
return $months;
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Retrieve credit card expire years
|
161 |
+
*
|
162 |
+
* @return array
|
163 |
+
*/
|
164 |
+
public function getCcYears() {
|
165 |
+
$cc_years = array();
|
166 |
+
$first = date("Y");
|
167 |
+
|
168 |
+
for ($index = 0; $index <= 10; $index++) {
|
169 |
+
$year = $first + $index;
|
170 |
+
$cc_years[$year] = $year;
|
171 |
+
}
|
172 |
+
$years = $this->getData('cc_years');
|
173 |
+
if (is_null($years)) {
|
174 |
+
$years = array(0 => $this->__('Year')) + $cc_years;
|
175 |
+
$this->setData('cc_years', $years);
|
176 |
+
}
|
177 |
+
return $years;
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Retrieve Customer default billing address
|
182 |
+
*
|
183 |
+
* @return array
|
184 |
+
*/
|
185 |
+
public function getCustomerBillingAddress() {
|
186 |
+
|
187 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
188 |
+
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
189 |
+
$customerID = $customerData->getId();
|
190 |
+
}
|
191 |
+
|
192 |
+
$visitorData = Mage::getModel('customer/customer')->load($customerID);
|
193 |
+
$billingaddress = Mage::getModel('customer/address')->load($visitorData->default_billing);
|
194 |
+
$addressdata = $billingaddress->getData();
|
195 |
+
|
196 |
+
return $addressdata;
|
197 |
+
}
|
198 |
+
|
199 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Form.php
CHANGED
@@ -1,240 +1,240 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @brief Defines the class for Payment information Block Frontend (Tokenize Post)
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
* */
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Magento
|
17 |
-
*
|
18 |
-
* NOTICE OF LICENSE
|
19 |
-
*
|
20 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
21 |
-
* that is bundled with this package in the file LICENSE.txt.
|
22 |
-
* It is also available through the world-wide-web at this URL:
|
23 |
-
* http://opensource.org/licenses/osl-3.0.php
|
24 |
-
* If you did not receive a copy of the license and are unable to
|
25 |
-
* obtain it through the world-wide-web, please send an email
|
26 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
-
*
|
28 |
-
* @category Cardconnect
|
29 |
-
* @package Cardconnect_Ccgateway
|
30 |
-
* @copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
-
*/
|
33 |
-
class Cardconnect_Ccgateway_Block_Form extends Mage_Payment_Block_Form
|
34 |
-
{
|
35 |
-
|
36 |
-
protected function _construct()
|
37 |
-
{
|
38 |
-
if(Mage::getModel('ccgateway/standard')->getConfigData('active')==1){
|
39 |
-
parent::_construct();
|
40 |
-
$this->setTemplate('ccgateway/form.phtml');
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Retrieve Transaction Type
|
46 |
-
*
|
47 |
-
* @return string
|
48 |
-
*/
|
49 |
-
public function getCheckoutType(){
|
50 |
-
|
51 |
-
$checkoutType = Mage::getModel('ccgateway/standard')->getConfigData('checkout_type');
|
52 |
-
|
53 |
-
return $checkoutType;
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Retrieve Transaction Mode
|
58 |
-
*
|
59 |
-
* @return string
|
60 |
-
*/
|
61 |
-
public function isTransactionModeTest()
|
62 |
-
{
|
63 |
-
$isTestMode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode');
|
64 |
-
switch ($isTestMode) {
|
65 |
-
case 0:
|
66 |
-
$isTestMode = 'no';
|
67 |
-
break;
|
68 |
-
default:
|
69 |
-
$isTestMode = 'yes';
|
70 |
-
break;
|
71 |
-
}
|
72 |
-
|
73 |
-
return $isTestMode;
|
74 |
-
}
|
75 |
-
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Retrieve field value data from payment info object
|
79 |
-
*
|
80 |
-
* @param string $field
|
81 |
-
* @return mixed
|
82 |
-
*/
|
83 |
-
public function getInfoData($field)
|
84 |
-
{
|
85 |
-
return $this->escapeHtml($this->getMethod()->getInfoInstance()->getData($field));
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Retrieve availables credit card types
|
90 |
-
*
|
91 |
-
* @return array
|
92 |
-
*/
|
93 |
-
public function getCcTypes()
|
94 |
-
{
|
95 |
-
$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();
|
96 |
-
$types = $cc_types->toOptionArray();
|
97 |
-
|
98 |
-
$availableTypes = Mage::getModel('ccgateway/standard')->getConfigData('card_type');
|
99 |
-
|
100 |
-
if ($availableTypes) {
|
101 |
-
$availableTypes = explode(',', $availableTypes);
|
102 |
-
$result = array();
|
103 |
-
foreach ($types as $val) {
|
104 |
-
if (($key = array_search($val['value'], $availableTypes, TRUE)) !== false) {
|
105 |
-
$result[] = $val;
|
106 |
-
unset($availableTypes[$key]);
|
107 |
-
}
|
108 |
-
}
|
109 |
-
}
|
110 |
-
|
111 |
-
return $result;
|
112 |
-
}
|
113 |
-
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Retrieve credit card expire months
|
117 |
-
*
|
118 |
-
* @return array
|
119 |
-
*/
|
120 |
-
public function getCcMonths()
|
121 |
-
{
|
122 |
-
$data = Mage::app()->getLocale()->getTranslationList('month');
|
123 |
-
foreach ($data as $key => $value) {
|
124 |
-
$monthNum = ($key < 10) ? '0' . $key : $key;
|
125 |
-
$data[$key] = $monthNum . ' - ' . $value;
|
126 |
-
}
|
127 |
-
|
128 |
-
$months = $this->getData('cc_months');
|
129 |
-
if (is_null($months)) {
|
130 |
-
$months[0] = $this->__('Month');
|
131 |
-
$months = array_merge($months, $data);
|
132 |
-
$this->setData('cc_months', $months);
|
133 |
-
}
|
134 |
-
|
135 |
-
|
136 |
-
return $months;
|
137 |
-
}
|
138 |
-
|
139 |
-
/**
|
140 |
-
* Retrieve credit card expire years
|
141 |
-
*
|
142 |
-
* @return array
|
143 |
-
*/
|
144 |
-
public function getCcYears()
|
145 |
-
{
|
146 |
-
$cc_years = array();
|
147 |
-
$first = date("Y");
|
148 |
-
|
149 |
-
for ($index = 0; $index <= 10; $index++) {
|
150 |
-
$year = $first + $index;
|
151 |
-
$cc_years[$year] = $year;
|
152 |
-
}
|
153 |
-
$years = $this->getData('cc_years');
|
154 |
-
if (is_null($years)) {
|
155 |
-
$years = array(0 => $this->__('Year')) + $cc_years;
|
156 |
-
$this->setData('cc_years', $years);
|
157 |
-
}
|
158 |
-
return $years;
|
159 |
-
}
|
160 |
-
|
161 |
-
public function getCCProfileName()
|
162 |
-
{
|
163 |
-
|
164 |
-
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
165 |
-
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
166 |
-
$customerID = $customerData->getId();
|
167 |
-
}
|
168 |
-
|
169 |
-
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_wallet')->getCollection()
|
170 |
-
->addFieldToFilter('CC_USER_ID', array('eq' => $customerID))
|
171 |
-
->addFieldToSelect("CC_PROFILEID")
|
172 |
-
->addFieldToSelect("CC_CARD_NAME");
|
173 |
-
|
174 |
-
return $collection;
|
175 |
-
}
|
176 |
-
|
177 |
-
public function getDefaultCCProfileId()
|
178 |
-
{
|
179 |
-
|
180 |
-
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
181 |
-
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
182 |
-
$customerID = $customerData->getId();
|
183 |
-
}
|
184 |
-
|
185 |
-
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_wallet')->getCollection()
|
186 |
-
->addFieldToFilter('CC_USER_ID', array('eq' => $customerID))
|
187 |
-
->addFieldToFilter('CC_DEFAULT_CARD', array('eq' => 'Y'))
|
188 |
-
->addFieldToSelect("CC_PROFILEID");
|
189 |
-
|
190 |
-
foreach ($collection as $data) {
|
191 |
-
$ccProfileId = $data->getData('CC_PROFILEID');
|
192 |
-
}
|
193 |
-
|
194 |
-
if (!empty($ccProfileId)) {
|
195 |
-
$resp = Mage::getModel('ccgateway/standard')->getProfileWebServiceCheckout($ccProfileId);
|
196 |
-
|
197 |
-
if(@$resp['resptext'] == "CardConnect_Error"){
|
198 |
-
$response = "CardConnect_Error";
|
199 |
-
}else{
|
200 |
-
$response = json_decode($resp, true);
|
201 |
-
if(isset($response[0]['resptext'])){
|
202 |
-
$response = "CardConnect_Error";
|
203 |
-
}else{
|
204 |
-
$response = json_decode($resp, true);
|
205 |
-
}
|
206 |
-
}
|
207 |
-
} else {
|
208 |
-
$myLogMessage = "CC Get Default Profile Service : ". __FILE__ . " @ " . __LINE__ ." "."Customer doesn't have default profile in wallet.";
|
209 |
-
Mage::log($myLogMessage, Zend_Log::ERR , "cc.log" );
|
210 |
-
}
|
211 |
-
|
212 |
-
return $response;
|
213 |
-
}
|
214 |
-
|
215 |
-
public function hasCCProfile()
|
216 |
-
{
|
217 |
-
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
218 |
-
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
219 |
-
$customerID = $customerData->getId();
|
220 |
-
$ccProfileId = "";
|
221 |
-
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_wallet')->getCollection()
|
222 |
-
->addFieldToFilter('CC_USER_ID', array('eq' => $customerID))
|
223 |
-
->addFieldToSelect("CC_PROFILEID");
|
224 |
-
foreach ($collection as $data) {
|
225 |
-
$ccProfileId = $data->getData('CC_PROFILEID');
|
226 |
-
}
|
227 |
-
|
228 |
-
if ($ccProfileId != null) {
|
229 |
-
$msg = true;
|
230 |
-
} else {
|
231 |
-
$msg = false;
|
232 |
-
}
|
233 |
-
} else {
|
234 |
-
$msg = false;
|
235 |
-
}
|
236 |
-
|
237 |
-
return $msg;
|
238 |
-
}
|
239 |
-
|
240 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @brief Defines the class for Payment information Block Frontend (Tokenize Post)
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
* */
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Magento
|
17 |
+
*
|
18 |
+
* NOTICE OF LICENSE
|
19 |
+
*
|
20 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
21 |
+
* that is bundled with this package in the file LICENSE.txt.
|
22 |
+
* It is also available through the world-wide-web at this URL:
|
23 |
+
* http://opensource.org/licenses/osl-3.0.php
|
24 |
+
* If you did not receive a copy of the license and are unable to
|
25 |
+
* obtain it through the world-wide-web, please send an email
|
26 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
+
*
|
28 |
+
* @category Cardconnect
|
29 |
+
* @package Cardconnect_Ccgateway
|
30 |
+
* @copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
+
*/
|
33 |
+
class Cardconnect_Ccgateway_Block_Form extends Mage_Payment_Block_Form
|
34 |
+
{
|
35 |
+
|
36 |
+
protected function _construct()
|
37 |
+
{
|
38 |
+
if(Mage::getModel('ccgateway/standard')->getConfigData('active')==1){
|
39 |
+
parent::_construct();
|
40 |
+
$this->setTemplate('ccgateway/form.phtml');
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Retrieve Transaction Type
|
46 |
+
*
|
47 |
+
* @return string
|
48 |
+
*/
|
49 |
+
public function getCheckoutType(){
|
50 |
+
|
51 |
+
$checkoutType = Mage::getModel('ccgateway/standard')->getConfigData('checkout_type');
|
52 |
+
|
53 |
+
return $checkoutType;
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Retrieve Transaction Mode
|
58 |
+
*
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
public function isTransactionModeTest()
|
62 |
+
{
|
63 |
+
$isTestMode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode');
|
64 |
+
switch ($isTestMode) {
|
65 |
+
case 0:
|
66 |
+
$isTestMode = 'no';
|
67 |
+
break;
|
68 |
+
default:
|
69 |
+
$isTestMode = 'yes';
|
70 |
+
break;
|
71 |
+
}
|
72 |
+
|
73 |
+
return $isTestMode;
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Retrieve field value data from payment info object
|
79 |
+
*
|
80 |
+
* @param string $field
|
81 |
+
* @return mixed
|
82 |
+
*/
|
83 |
+
public function getInfoData($field)
|
84 |
+
{
|
85 |
+
return $this->escapeHtml($this->getMethod()->getInfoInstance()->getData($field));
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Retrieve availables credit card types
|
90 |
+
*
|
91 |
+
* @return array
|
92 |
+
*/
|
93 |
+
public function getCcTypes()
|
94 |
+
{
|
95 |
+
$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();
|
96 |
+
$types = $cc_types->toOptionArray();
|
97 |
+
|
98 |
+
$availableTypes = Mage::getModel('ccgateway/standard')->getConfigData('card_type');
|
99 |
+
|
100 |
+
if ($availableTypes) {
|
101 |
+
$availableTypes = explode(',', $availableTypes);
|
102 |
+
$result = array();
|
103 |
+
foreach ($types as $val) {
|
104 |
+
if (($key = array_search($val['value'], $availableTypes, TRUE)) !== false) {
|
105 |
+
$result[] = $val;
|
106 |
+
unset($availableTypes[$key]);
|
107 |
+
}
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
return $result;
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Retrieve credit card expire months
|
117 |
+
*
|
118 |
+
* @return array
|
119 |
+
*/
|
120 |
+
public function getCcMonths()
|
121 |
+
{
|
122 |
+
$data = Mage::app()->getLocale()->getTranslationList('month');
|
123 |
+
foreach ($data as $key => $value) {
|
124 |
+
$monthNum = ($key < 10) ? '0' . $key : $key;
|
125 |
+
$data[$key] = $monthNum . ' - ' . $value;
|
126 |
+
}
|
127 |
+
|
128 |
+
$months = $this->getData('cc_months');
|
129 |
+
if (is_null($months)) {
|
130 |
+
$months[0] = $this->__('Month');
|
131 |
+
$months = array_merge($months, $data);
|
132 |
+
$this->setData('cc_months', $months);
|
133 |
+
}
|
134 |
+
|
135 |
+
|
136 |
+
return $months;
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Retrieve credit card expire years
|
141 |
+
*
|
142 |
+
* @return array
|
143 |
+
*/
|
144 |
+
public function getCcYears()
|
145 |
+
{
|
146 |
+
$cc_years = array();
|
147 |
+
$first = date("Y");
|
148 |
+
|
149 |
+
for ($index = 0; $index <= 10; $index++) {
|
150 |
+
$year = $first + $index;
|
151 |
+
$cc_years[$year] = $year;
|
152 |
+
}
|
153 |
+
$years = $this->getData('cc_years');
|
154 |
+
if (is_null($years)) {
|
155 |
+
$years = array(0 => $this->__('Year')) + $cc_years;
|
156 |
+
$this->setData('cc_years', $years);
|
157 |
+
}
|
158 |
+
return $years;
|
159 |
+
}
|
160 |
+
|
161 |
+
public function getCCProfileName()
|
162 |
+
{
|
163 |
+
|
164 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
165 |
+
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
166 |
+
$customerID = $customerData->getId();
|
167 |
+
}
|
168 |
+
|
169 |
+
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_wallet')->getCollection()
|
170 |
+
->addFieldToFilter('CC_USER_ID', array('eq' => $customerID))
|
171 |
+
->addFieldToSelect("CC_PROFILEID")
|
172 |
+
->addFieldToSelect("CC_CARD_NAME");
|
173 |
+
|
174 |
+
return $collection;
|
175 |
+
}
|
176 |
+
|
177 |
+
public function getDefaultCCProfileId()
|
178 |
+
{
|
179 |
+
|
180 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
181 |
+
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
182 |
+
$customerID = $customerData->getId();
|
183 |
+
}
|
184 |
+
|
185 |
+
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_wallet')->getCollection()
|
186 |
+
->addFieldToFilter('CC_USER_ID', array('eq' => $customerID))
|
187 |
+
->addFieldToFilter('CC_DEFAULT_CARD', array('eq' => 'Y'))
|
188 |
+
->addFieldToSelect("CC_PROFILEID");
|
189 |
+
|
190 |
+
foreach ($collection as $data) {
|
191 |
+
$ccProfileId = $data->getData('CC_PROFILEID');
|
192 |
+
}
|
193 |
+
|
194 |
+
if (!empty($ccProfileId)) {
|
195 |
+
$resp = Mage::getModel('ccgateway/standard')->getProfileWebServiceCheckout($ccProfileId);
|
196 |
+
|
197 |
+
if(@$resp['resptext'] == "CardConnect_Error"){
|
198 |
+
$response = "CardConnect_Error";
|
199 |
+
}else{
|
200 |
+
$response = json_decode($resp, true);
|
201 |
+
if(isset($response[0]['resptext'])){
|
202 |
+
$response = "CardConnect_Error";
|
203 |
+
}else{
|
204 |
+
$response = json_decode($resp, true);
|
205 |
+
}
|
206 |
+
}
|
207 |
+
} else {
|
208 |
+
$myLogMessage = "CC Get Default Profile Service : ". __FILE__ . " @ " . __LINE__ ." "."Customer doesn't have default profile in wallet.";
|
209 |
+
Mage::log($myLogMessage, Zend_Log::ERR , "cc.log" );
|
210 |
+
}
|
211 |
+
|
212 |
+
return $response;
|
213 |
+
}
|
214 |
+
|
215 |
+
public function hasCCProfile()
|
216 |
+
{
|
217 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
218 |
+
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
219 |
+
$customerID = $customerData->getId();
|
220 |
+
$ccProfileId = "";
|
221 |
+
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_wallet')->getCollection()
|
222 |
+
->addFieldToFilter('CC_USER_ID', array('eq' => $customerID))
|
223 |
+
->addFieldToSelect("CC_PROFILEID");
|
224 |
+
foreach ($collection as $data) {
|
225 |
+
$ccProfileId = $data->getData('CC_PROFILEID');
|
226 |
+
}
|
227 |
+
|
228 |
+
if ($ccProfileId != null) {
|
229 |
+
$msg = true;
|
230 |
+
} else {
|
231 |
+
$msg = false;
|
232 |
+
}
|
233 |
+
} else {
|
234 |
+
$msg = false;
|
235 |
+
}
|
236 |
+
|
237 |
+
return $msg;
|
238 |
+
}
|
239 |
+
|
240 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Info.php
CHANGED
@@ -1,94 +1,94 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the class representing CardConnect Payment information
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Block_Info extends Mage_Payment_Block_Info {
|
34 |
-
|
35 |
-
protected function _construct() {
|
36 |
-
parent::_construct();
|
37 |
-
$this->setTemplate('ccgateway/info.phtml');
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
public function getMethodCode()
|
42 |
-
{
|
43 |
-
return $this->getInfo()->getMethodInstance()->getCode();
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
public function getCurrentOrderId() {
|
48 |
-
$info = $this->getInfo();
|
49 |
-
if ($info instanceof Mage_Sales_Model_Order_Payment) {
|
50 |
-
$order = $info->getOrder();
|
51 |
-
$currentOrderId = $order->getData('increment_id');
|
52 |
-
}
|
53 |
-
|
54 |
-
return $currentOrderId;
|
55 |
-
}
|
56 |
-
|
57 |
-
public function getPaymentResponseData() {
|
58 |
-
$currentOrderId = $this->getCurrentOrderId();
|
59 |
-
|
60 |
-
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_resp')->getCollection()
|
61 |
-
->addFieldToFilter('CC_ORDERID', array('eq' => $currentOrderId))
|
62 |
-
->addFieldToSelect("*");
|
63 |
-
|
64 |
-
return $collection;
|
65 |
-
}
|
66 |
-
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Retrieve payment info model
|
70 |
-
*
|
71 |
-
* @return Mage_Payment_Model_Info
|
72 |
-
*/
|
73 |
-
public function getPaymentInfo()
|
74 |
-
{
|
75 |
-
$info = Mage::getSingleton('checkout/session')->getQuote()->getPayment();
|
76 |
-
if ($info->getMethod()) {
|
77 |
-
return $info;
|
78 |
-
}
|
79 |
-
return false;
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Retrieve Transaction Type
|
84 |
-
*
|
85 |
-
* @return string
|
86 |
-
*/
|
87 |
-
public function getCheckoutType(){
|
88 |
-
$checkoutType = Mage::getModel('ccgateway/standard')->getConfigData('checkout_type');
|
89 |
-
|
90 |
-
return $checkoutType;
|
91 |
-
}
|
92 |
-
|
93 |
-
|
94 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the class representing CardConnect Payment information
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Block_Info extends Mage_Payment_Block_Info {
|
34 |
+
|
35 |
+
protected function _construct() {
|
36 |
+
parent::_construct();
|
37 |
+
$this->setTemplate('ccgateway/info.phtml');
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
public function getMethodCode()
|
42 |
+
{
|
43 |
+
return $this->getInfo()->getMethodInstance()->getCode();
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
public function getCurrentOrderId() {
|
48 |
+
$info = $this->getInfo();
|
49 |
+
if ($info instanceof Mage_Sales_Model_Order_Payment) {
|
50 |
+
$order = $info->getOrder();
|
51 |
+
$currentOrderId = $order->getData('increment_id');
|
52 |
+
}
|
53 |
+
|
54 |
+
return $currentOrderId;
|
55 |
+
}
|
56 |
+
|
57 |
+
public function getPaymentResponseData() {
|
58 |
+
$currentOrderId = $this->getCurrentOrderId();
|
59 |
+
|
60 |
+
$collection = Mage::getModel('cardconnect_ccgateway/cardconnect_resp')->getCollection()
|
61 |
+
->addFieldToFilter('CC_ORDERID', array('eq' => $currentOrderId))
|
62 |
+
->addFieldToSelect("*");
|
63 |
+
|
64 |
+
return $collection;
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Retrieve payment info model
|
70 |
+
*
|
71 |
+
* @return Mage_Payment_Model_Info
|
72 |
+
*/
|
73 |
+
public function getPaymentInfo()
|
74 |
+
{
|
75 |
+
$info = Mage::getSingleton('checkout/session')->getQuote()->getPayment();
|
76 |
+
if ($info->getMethod()) {
|
77 |
+
return $info;
|
78 |
+
}
|
79 |
+
return false;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Retrieve Transaction Type
|
84 |
+
*
|
85 |
+
* @return string
|
86 |
+
*/
|
87 |
+
public function getCheckoutType(){
|
88 |
+
$checkoutType = Mage::getModel('ccgateway/standard')->getConfigData('checkout_type');
|
89 |
+
|
90 |
+
return $checkoutType;
|
91 |
+
}
|
92 |
+
|
93 |
+
|
94 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Onepage/Billing.php
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* To change this license header, choose License Headers in Project Properties.
|
5 |
-
* To change this template file, choose Tools | Templates
|
6 |
-
* and open the template in the editor.
|
7 |
-
*/
|
8 |
-
|
9 |
-
class Cardconnect_Ccgateway_Block_Onepage_Billing extends Mage_Checkout_Block_Onepage_Billing {
|
10 |
-
|
11 |
-
public function fetchView($fileName) {
|
12 |
-
extract($this->_viewVars);
|
13 |
-
$do = $this->getDirectOutput();
|
14 |
-
if (!$do) {
|
15 |
-
ob_start();
|
16 |
-
}
|
17 |
-
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/billing.phtml';
|
18 |
-
if (!$do) {
|
19 |
-
$html = ob_get_clean();
|
20 |
-
} else {
|
21 |
-
$html = '';
|
22 |
-
}
|
23 |
-
return $html;
|
24 |
-
}
|
25 |
-
|
26 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* To change this license header, choose License Headers in Project Properties.
|
5 |
+
* To change this template file, choose Tools | Templates
|
6 |
+
* and open the template in the editor.
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Cardconnect_Ccgateway_Block_Onepage_Billing extends Mage_Checkout_Block_Onepage_Billing {
|
10 |
+
|
11 |
+
public function fetchView($fileName) {
|
12 |
+
extract($this->_viewVars);
|
13 |
+
$do = $this->getDirectOutput();
|
14 |
+
if (!$do) {
|
15 |
+
ob_start();
|
16 |
+
}
|
17 |
+
include getcwd() . '/app/code/community/Cardconnect/Ccgateway/blocks/billing.phtml';
|
18 |
+
if (!$do) {
|
19 |
+
$html = ob_get_clean();
|
20 |
+
} else {
|
21 |
+
$html = '';
|
22 |
+
}
|
23 |
+
return $html;
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Block/Redirect.php
CHANGED
@@ -1,77 +1,77 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the class representing get checkout data for CardConnect payment page
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Block_Redirect extends Mage_Core_Block_Template {
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Return checkout session instance
|
37 |
-
*
|
38 |
-
* @return Mage_Checkout_Model_Session
|
39 |
-
*/
|
40 |
-
protected function _getCheckout() {
|
41 |
-
return Mage::getSingleton('checkout/session');
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Return order instance
|
46 |
-
*
|
47 |
-
* @return Mage_Sales_Model_Order|null
|
48 |
-
*/
|
49 |
-
protected function _getOrder() {
|
50 |
-
if ($this->getOrder()) {
|
51 |
-
return $this->getOrder();
|
52 |
-
} elseif ($orderIncrementId = $this->_getCheckout()->getLastRealOrderId()) {
|
53 |
-
return Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
|
54 |
-
} else {
|
55 |
-
return null;
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Get form data
|
61 |
-
*
|
62 |
-
* @return array
|
63 |
-
*/
|
64 |
-
public function getFormData() {
|
65 |
-
return $this->_getOrder()->getPayment()->getMethodInstance()->getFormFields();
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Getting gateway url
|
70 |
-
*
|
71 |
-
* @return string
|
72 |
-
*/
|
73 |
-
public function getFormAction() {
|
74 |
-
return $this->_getOrder()->getPayment()->getMethodInstance()->getUrl();
|
75 |
-
}
|
76 |
-
|
77 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the class representing get checkout data for CardConnect payment page
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Block_Redirect extends Mage_Core_Block_Template {
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Return checkout session instance
|
37 |
+
*
|
38 |
+
* @return Mage_Checkout_Model_Session
|
39 |
+
*/
|
40 |
+
protected function _getCheckout() {
|
41 |
+
return Mage::getSingleton('checkout/session');
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Return order instance
|
46 |
+
*
|
47 |
+
* @return Mage_Sales_Model_Order|null
|
48 |
+
*/
|
49 |
+
protected function _getOrder() {
|
50 |
+
if ($this->getOrder()) {
|
51 |
+
return $this->getOrder();
|
52 |
+
} elseif ($orderIncrementId = $this->_getCheckout()->getLastRealOrderId()) {
|
53 |
+
return Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
|
54 |
+
} else {
|
55 |
+
return null;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Get form data
|
61 |
+
*
|
62 |
+
* @return array
|
63 |
+
*/
|
64 |
+
public function getFormData() {
|
65 |
+
return $this->_getOrder()->getPayment()->getMethodInstance()->getFormFields();
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Getting gateway url
|
70 |
+
*
|
71 |
+
* @return string
|
72 |
+
*/
|
73 |
+
public function getFormAction() {
|
74 |
+
return $this->_getOrder()->getPayment()->getMethodInstance()->getUrl();
|
75 |
+
}
|
76 |
+
|
77 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Helper/Data.php
CHANGED
@@ -86,6 +86,52 @@ class Cardconnect_Ccgateway_Helper_Data extends Mage_Payment_Helper_Data {
|
|
86 |
Â
}
|
87 |
Â
}
|
88 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
89 |
Â
public function matchResponseError($respErrorCode){
|
90 |
Â
|
91 |
Â
$errorList = array("PPS11" => "Invalid card",
|
86 |
Â
}
|
87 |
Â
}
|
88 |
Â
|
89 |
+
/**
|
90 |
+
* Get Frontend Id
|
91 |
+
*/
|
92 |
+
public function getFrontendId(){
|
93 |
+
$frontendId = 'Magento';
|
94 |
+
|
95 |
+
return $frontendId;
|
96 |
+
}
|
97 |
+
|
98 |
+
public function getSiteName(){
|
99 |
+
$ccsite = Mage::getModel('ccgateway/standard')->getConfigData('site_name');
|
100 |
+
|
101 |
+
return $ccsite;
|
102 |
+
}
|
103 |
+
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Retrive CardConnect method
|
107 |
+
*
|
108 |
+
* @return object
|
109 |
+
*/
|
110 |
+
public function getCardConnectWebService($order = "")
|
111 |
+
{
|
112 |
+
|
113 |
+
if (!empty($order)) {
|
114 |
+
$username = Mage::getModel('ccgateway/standard')->getConfigData('username', $order->getStoreId());
|
115 |
+
$merchid = Mage::getModel('ccgateway/standard')->getConfigData('merchant', $order->getStoreId());
|
116 |
+
$cc_password = Mage::getModel('ccgateway/standard')->getConfigData('password', $order->getStoreId());
|
117 |
+
$testmode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode', $order->getStoreId());
|
118 |
+
$ccsite = Mage::getModel('ccgateway/standard')->getConfigData('site_name', $order->getStoreId());
|
119 |
+
} else {
|
120 |
+
$username = Mage::getModel('ccgateway/standard')->getConfigData('username');
|
121 |
+
$merchid = Mage::getModel('ccgateway/standard')->getConfigData('merchant');
|
122 |
+
$cc_password = Mage::getModel('ccgateway/standard')->getConfigData('password');
|
123 |
+
$testmode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode');
|
124 |
+
$ccsite = Mage::getModel('ccgateway/standard')->getConfigData('site_name');
|
125 |
+
}
|
126 |
+
$frontendid = $this->getFrontendId();
|
127 |
+
$keyLocation = Mage::getModel('ccgateway/standard')->getKeysLocation();
|
128 |
+
|
129 |
+
$cc = new CardConnectWebService($testmode, $ccsite, $frontendid, $username, $cc_password, $merchid, $keyLocation);
|
130 |
+
|
131 |
+
return $cc;
|
132 |
+
}
|
133 |
+
|
134 |
+
|
135 |
Â
public function matchResponseError($respErrorCode){
|
136 |
Â
|
137 |
Â
$errorList = array("PPS11" => "Invalid card",
|
app/code/community/Cardconnect/Ccgateway/Model/Cardconnect/Resp.php
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the model class for representing CardConnect response
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Model_Cardconnect_Resp extends Mage_Core_Model_Abstract {
|
34 |
-
|
35 |
-
public function _construct() {
|
36 |
-
parent::_construct();
|
37 |
-
$this->_init('cardconnect_ccgateway/cardconnect_resp');
|
38 |
-
}
|
39 |
-
|
40 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the model class for representing CardConnect response
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Model_Cardconnect_Resp extends Mage_Core_Model_Abstract {
|
34 |
+
|
35 |
+
public function _construct() {
|
36 |
+
parent::_construct();
|
37 |
+
$this->_init('cardconnect_ccgateway/cardconnect_resp');
|
38 |
+
}
|
39 |
+
|
40 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Model/Cardconnect/Wallet.php
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the model class for representing CardConnect Wallet
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Model_Cardconnect_Wallet extends Mage_Core_Model_Abstract {
|
34 |
-
|
35 |
-
public function _construct() {
|
36 |
-
parent::_construct();
|
37 |
-
$this->_init('cardconnect_ccgateway/cardconnect_wallet');
|
38 |
-
}
|
39 |
-
|
40 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the model class for representing CardConnect Wallet
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Model_Cardconnect_Wallet extends Mage_Core_Model_Abstract {
|
34 |
+
|
35 |
+
public function _construct() {
|
36 |
+
parent::_construct();
|
37 |
+
$this->_init('cardconnect_ccgateway/cardconnect_wallet');
|
38 |
+
}
|
39 |
+
|
40 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Model/Observer.php
CHANGED
@@ -1,95 +1,95 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @brief Defines the observer method for savePaymentAction to implement Create Profile Web Service
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
* */
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Magento
|
17 |
-
*
|
18 |
-
* NOTICE OF LICENSE
|
19 |
-
*
|
20 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
21 |
-
* that is bundled with this package in the file LICENSE.txt.
|
22 |
-
* It is also available through the world-wide-web at this URL:
|
23 |
-
* http://opensource.org/licenses/osl-3.0.php
|
24 |
-
* If you did not receive a copy of the license and are unable to
|
25 |
-
* obtain it through the world-wide-web, please send an email
|
26 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
-
*
|
28 |
-
* @category Cardconnect
|
29 |
-
* @package Cardconnect_Ccgateway
|
30 |
-
* @copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
-
*/
|
33 |
-
class Cardconnect_Ccgateway_Model_Observer
|
34 |
-
{
|
35 |
-
|
36 |
-
|
37 |
-
public function savePaymentAction()
|
38 |
-
{
|
39 |
-
|
40 |
-
$data = Mage::app()->getFrontController()->getRequest()->getParams();
|
41 |
-
|
42 |
-
// Call function Create Profile webservices
|
43 |
-
// if customer wish to save card for future use
|
44 |
-
if (isset($data['payment']['cc_wallet']) && $data['payment']['cc_wallet'] == "checked") {
|
45 |
-
Mage::getModel('ccgateway/standard')->createProfileService($data['payment']);
|
46 |
-
}
|
47 |
-
|
48 |
-
return;
|
49 |
-
}
|
50 |
-
|
51 |
-
public function implementOrderStatus($event)
|
52 |
-
{
|
53 |
-
$order = $event->getOrder();
|
54 |
-
|
55 |
-
$checkout_trans = Mage::getModel('ccgateway/standard')->getConfigData('checkout_trans', $order->getStoreId());
|
56 |
-
if ($checkout_trans == "authorize_capture") {
|
57 |
-
if ($this->_getPaymentMethod($order) == 'ccgateway') {
|
58 |
-
if ($order->canInvoice())
|
59 |
-
$this->_processOrderStatus($order);
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
return $this;
|
64 |
-
}
|
65 |
-
|
66 |
-
private function _getPaymentMethod($order)
|
67 |
-
{
|
68 |
-
return $order->getPayment()->getMethodInstance()->getCode();
|
69 |
-
}
|
70 |
-
|
71 |
-
private function _processOrderStatus($order)
|
72 |
-
{
|
73 |
-
$invoice = $order->prepareInvoice();
|
74 |
-
$invoice->register()->capture();
|
75 |
-
Mage::getModel('core/resource_transaction')
|
76 |
-
->addObject($invoice)
|
77 |
-
->addObject($invoice->getOrder())
|
78 |
-
->save();
|
79 |
-
|
80 |
-
$invoice->sendEmail(true, '');
|
81 |
-
$this->_changeOrderStatus($order);
|
82 |
-
return true;
|
83 |
-
}
|
84 |
-
|
85 |
-
private function _changeOrderStatus($order)
|
86 |
-
{
|
87 |
-
$statusMessage = '';
|
88 |
-
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
|
89 |
-
$order->save();
|
90 |
-
}
|
91 |
-
|
92 |
-
|
93 |
-
}
|
94 |
-
|
95 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @brief Defines the observer method for savePaymentAction to implement Create Profile Web Service
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
* */
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Magento
|
17 |
+
*
|
18 |
+
* NOTICE OF LICENSE
|
19 |
+
*
|
20 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
21 |
+
* that is bundled with this package in the file LICENSE.txt.
|
22 |
+
* It is also available through the world-wide-web at this URL:
|
23 |
+
* http://opensource.org/licenses/osl-3.0.php
|
24 |
+
* If you did not receive a copy of the license and are unable to
|
25 |
+
* obtain it through the world-wide-web, please send an email
|
26 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
27 |
+
*
|
28 |
+
* @category Cardconnect
|
29 |
+
* @package Cardconnect_Ccgateway
|
30 |
+
* @copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
31 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
32 |
+
*/
|
33 |
+
class Cardconnect_Ccgateway_Model_Observer
|
34 |
+
{
|
35 |
+
|
36 |
+
|
37 |
+
public function savePaymentAction()
|
38 |
+
{
|
39 |
+
|
40 |
+
$data = Mage::app()->getFrontController()->getRequest()->getParams();
|
41 |
+
|
42 |
+
// Call function Create Profile webservices
|
43 |
+
// if customer wish to save card for future use
|
44 |
+
if (isset($data['payment']['cc_wallet']) && $data['payment']['cc_wallet'] == "checked") {
|
45 |
+
Mage::getModel('ccgateway/standard')->createProfileService($data['payment']);
|
46 |
+
}
|
47 |
+
|
48 |
+
return;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function implementOrderStatus($event)
|
52 |
+
{
|
53 |
+
$order = $event->getOrder();
|
54 |
+
|
55 |
+
$checkout_trans = Mage::getModel('ccgateway/standard')->getConfigData('checkout_trans', $order->getStoreId());
|
56 |
+
if ($checkout_trans == "authorize_capture") {
|
57 |
+
if ($this->_getPaymentMethod($order) == 'ccgateway') {
|
58 |
+
if ($order->canInvoice())
|
59 |
+
$this->_processOrderStatus($order);
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
return $this;
|
64 |
+
}
|
65 |
+
|
66 |
+
private function _getPaymentMethod($order)
|
67 |
+
{
|
68 |
+
return $order->getPayment()->getMethodInstance()->getCode();
|
69 |
+
}
|
70 |
+
|
71 |
+
private function _processOrderStatus($order)
|
72 |
+
{
|
73 |
+
$invoice = $order->prepareInvoice();
|
74 |
+
$invoice->register()->capture();
|
75 |
+
Mage::getModel('core/resource_transaction')
|
76 |
+
->addObject($invoice)
|
77 |
+
->addObject($invoice->getOrder())
|
78 |
+
->save();
|
79 |
+
|
80 |
+
$invoice->sendEmail(true, '');
|
81 |
+
$this->_changeOrderStatus($order);
|
82 |
+
return true;
|
83 |
+
}
|
84 |
+
|
85 |
+
private function _changeOrderStatus($order)
|
86 |
+
{
|
87 |
+
$statusMessage = '';
|
88 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
|
89 |
+
$order->save();
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
}
|
94 |
+
|
95 |
+
|
app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Resp.php
CHANGED
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the model resource class for representing CardConnect response
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Cardconnect_Ccgateway_Model_Resource_Cardconnect_Resp extends Mage_Core_Model_Resource_Db_Abstract {
|
33 |
-
|
34 |
-
public function _construct() {
|
35 |
-
$this->_init('cardconnect_ccgateway/cardconnect_resp', 'CC_ID');
|
36 |
-
}
|
37 |
-
|
38 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the model resource class for representing CardConnect response
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
|
32 |
+
class Cardconnect_Ccgateway_Model_Resource_Cardconnect_Resp extends Mage_Core_Model_Resource_Db_Abstract {
|
33 |
+
|
34 |
+
public function _construct() {
|
35 |
+
$this->_init('cardconnect_ccgateway/cardconnect_resp', 'CC_ID');
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Resp/Collection.php
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the model collection class
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Model_Resource_Cardconnect_Resp_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract {
|
34 |
-
|
35 |
-
public function _construct() {
|
36 |
-
$this->_init('cardconnect_ccgateway/cardconnect_resp');
|
37 |
-
}
|
38 |
-
|
39 |
-
}
|
40 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the model collection class
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Model_Resource_Cardconnect_Resp_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract {
|
34 |
+
|
35 |
+
public function _construct() {
|
36 |
+
$this->_init('cardconnect_ccgateway/cardconnect_resp');
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
40 |
+
|
app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Wallet.php
CHANGED
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the model resource class for representing CardConnect Wallet
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Cardconnect_Ccgateway_Model_Resource_Cardconnect_Wallet extends Mage_Core_Model_Resource_Db_Abstract {
|
33 |
-
|
34 |
-
public function _construct() {
|
35 |
-
$this->_init('cardconnect_ccgateway/cardconnect_wallet', 'CC_ID');
|
36 |
-
}
|
37 |
-
|
38 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the model resource class for representing CardConnect Wallet
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
|
32 |
+
class Cardconnect_Ccgateway_Model_Resource_Cardconnect_Wallet extends Mage_Core_Model_Resource_Db_Abstract {
|
33 |
+
|
34 |
+
public function _construct() {
|
35 |
+
$this->_init('cardconnect_ccgateway/cardconnect_wallet', 'CC_ID');
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Wallet/Collection.php
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the model collection class
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Cardconnect_Ccgateway_Model_Resource_Cardconnect_Wallet_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract {
|
34 |
-
|
35 |
-
public function _construct() {
|
36 |
-
$this->_init('cardconnect_ccgateway/cardconnect_wallet');
|
37 |
-
}
|
38 |
-
|
39 |
-
}
|
40 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the model collection class
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
class Cardconnect_Ccgateway_Model_Resource_Cardconnect_Wallet_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract {
|
34 |
+
|
35 |
+
public function _construct() {
|
36 |
+
$this->_init('cardconnect_ccgateway/cardconnect_wallet');
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
40 |
+
|
app/code/community/Cardconnect/Ccgateway/Model/Standard.php
CHANGED
@@ -294,9 +294,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
294 |
Â
public function authService($order, $authAmount = "", $status = "") {
|
295 |
Â
|
296 |
Â
$orderId = $order->getIncrementId();
|
297 |
-
$username = $this->getConfigData('username' , $order->getStoreId());
|
298 |
Â
$merchid = $this->getConfigData('merchant' , $order->getStoreId());
|
299 |
-
$cc_password = $this->getConfigData('password', $order->getStoreId());
|
300 |
Â
|
301 |
Â
if (empty($status)) {
|
302 |
Â
$ccOwner = Mage::getSingleton('core/session')->getCcOwner();
|
@@ -372,8 +370,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
372 |
Â
'tokenize' => 'Y');
|
373 |
Â
}
|
374 |
Â
|
375 |
-
$cc =
|
376 |
-
|
377 |
Â
$resp = $cc->authService($param);
|
378 |
Â
|
379 |
Â
if (empty($status)) {
|
@@ -450,12 +447,9 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
450 |
Â
$retref = $this->getRetrefReferenceNumber($orderId);
|
451 |
Â
$authCode = $this->getAuthCode($orderId);
|
452 |
Â
$checkout_trans = $this->getPaymentTransactionType();
|
453 |
-
$username = $this->getConfigData('username' , $payment->getOrder()->getStoreId());
|
454 |
Â
$merchid = $this->getConfigData('merchant' , $payment->getOrder()->getStoreId());
|
455 |
-
$cc_password = $this->getConfigData('password', $payment->getOrder()->getStoreId());
|
456 |
-
|
457 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
458 |
Â
|
Â
|
|
459 |
Â
|
460 |
Â
if ($fullAuthorizedAmount == $amount) {
|
461 |
Â
$resp = $cc->captureService($retref, $authCode, $amount, $orderId);
|
@@ -530,11 +524,8 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
530 |
Â
$amount = number_format($amount, 2);
|
531 |
Â
}
|
532 |
Â
$amount = str_replace(",", "", $amount);
|
533 |
-
$username = $this->getConfigData('username' , $order->getStoreId());
|
534 |
-
$merchid = $this->getConfigData('merchant' , $order->getStoreId());
|
535 |
-
$cc_password = $this->getConfigData('password', $order->getStoreId());
|
536 |
Â
|
537 |
-
$cc =
|
538 |
Â
$resp = $cc->voidService($retref, $amount);
|
539 |
Â
|
540 |
Â
if ($resp != "") {
|
@@ -594,11 +585,8 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
594 |
Â
$order = $payment->getOrder();
|
595 |
Â
$orderId = $order->increment_id;
|
596 |
Â
$retref = $this->getRetrefReferenceNumber($orderId, "Refund");
|
597 |
-
$username = $this->getConfigData('username' , $payment->getOrder()->getStoreId());
|
598 |
-
$merchid = $this->getConfigData('merchant' , $payment->getOrder()->getStoreId());
|
599 |
-
$cc_password = $this->getConfigData('password', $payment->getOrder()->getStoreId());
|
600 |
Â
|
601 |
-
$cc =
|
602 |
Â
|
603 |
Â
$resp = $cc->inquireService($retref);
|
604 |
Â
$response = json_decode($resp, true);
|
@@ -625,9 +613,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
625 |
Â
$order = $payment->getOrder();
|
626 |
Â
$orderId = $order->increment_id;
|
627 |
Â
$retref = $this->getRetrefReferenceNumber($orderId, "Refund");
|
628 |
-
$username = $this->getConfigData('username' , $payment->getOrder()->getStoreId());
|
629 |
Â
$merchid = $this->getConfigData('merchant' , $payment->getOrder()->getStoreId());
|
630 |
-
$cc_password = $this->getConfigData('password', $payment->getOrder()->getStoreId());
|
631 |
Â
|
632 |
Â
if ($amount <= 0) {
|
633 |
Â
Mage::throwException(Mage::helper('ccgateway')->__('Invalid amount for refund.'));
|
@@ -639,8 +625,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
639 |
Â
|
640 |
Â
$amount = str_replace(",", "", $amount);
|
641 |
Â
|
642 |
-
$cc =
|
643 |
-
|
644 |
Â
$resp = $cc->refundService($retref, $amount);
|
645 |
Â
|
646 |
Â
if ($resp != "") {
|
@@ -678,8 +663,6 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
678 |
Â
$order = Mage::getModel('sales/order');
|
679 |
Â
$order->loadByIncrementId($orderId);
|
680 |
Â
$responseData = $this->getResponseDataByOrderId($orderId);
|
681 |
-
$username = $this->getConfigData('username' , $order->getStoreId());
|
682 |
-
$merchid = $this->getConfigData('merchant' , $order->getStoreId());
|
683 |
Â
$cc_password = $this->getConfigData('password', $order->getStoreId());
|
684 |
Â
|
685 |
Â
|
@@ -696,9 +679,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
696 |
Â
$order_amount = $data->getData('CC_AMT');
|
697 |
Â
$setlstat = $data->getData('CC_SETLSTAT');
|
698 |
Â
|
699 |
-
|
700 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
701 |
-
|
702 |
Â
$resp = $cc->inquireService($retref);
|
703 |
Â
$response = json_decode($resp, true);
|
704 |
Â
if (!empty($response)) {
|
@@ -767,10 +748,6 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
767 |
Â
// Create Profile webservices
|
768 |
Â
function createProfileService($paymentInformation) {
|
769 |
Â
|
770 |
-
$username = $this->getConfigData('username');
|
771 |
-
$merchid = $this->getConfigData('merchant');
|
772 |
-
$cc_password = $this->getConfigData('password');
|
773 |
-
|
774 |
Â
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
775 |
Â
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
776 |
Â
$ccUserId = $customerData->getId();
|
@@ -798,8 +775,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
798 |
Â
'postal' => $paymentInformation['cc_postcode']
|
799 |
Â
);
|
800 |
Â
|
801 |
-
$cc =
|
802 |
-
|
803 |
Â
$resp = $cc->createProfileService($profrequest);
|
804 |
Â
|
805 |
Â
if ($resp != "") {
|
@@ -829,16 +805,12 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
829 |
Â
// Function for Get Profile webservices
|
830 |
Â
function getProfileWebService($profileId, $cc_id) {
|
831 |
Â
|
832 |
-
$
|
833 |
-
$merchid = $this->getConfigData('merchant');
|
834 |
-
$cc_password = $this->getConfigData('password');
|
835 |
Â
|
836 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
837 |
Â
$resp = $cc->getProfileService($profileId);
|
838 |
Â
if (!empty($resp) && $cc_id != "") {
|
839 |
Â
$resource = Mage::getSingleton('core/resource');
|
840 |
Â
$readConnection = $resource->getConnection('core_read');
|
841 |
-
$writeConnection = $resource->getConnection('core_write');
|
842 |
Â
$getTable = $resource->getTableName('cardconnect_wallet');
|
843 |
Â
|
844 |
Â
$selQry = "SELECT CC_CARD_NAME FROM {$getTable} WHERE CC_ID=" . $cc_id;
|
@@ -858,11 +830,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
858 |
Â
// Function for Get Profile webservices Checkout
|
859 |
Â
function getProfileWebServiceCheckout($profileId) {
|
860 |
Â
|
861 |
-
$
|
862 |
-
$merchid = $this->getConfigData('merchant');
|
863 |
-
$cc_password = $this->getConfigData('password');
|
864 |
-
|
865 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
866 |
Â
$resp = $cc->getProfileService($profileId);
|
867 |
Â
if (empty($resp)) {
|
868 |
Â
$myLogMessage = "CC Get Profile Service : ". __FILE__ . " @ " . __LINE__ ." ".$cc->getLastErrorMessage();
|
@@ -877,10 +845,6 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
877 |
Â
|
878 |
Â
function deleteWalletDataService($profileRowId, $ccUserId= "") {
|
879 |
Â
|
880 |
-
$username = $this->getConfigData('username');
|
881 |
-
$merchid = $this->getConfigData('merchant');
|
882 |
-
$cc_password = $this->getConfigData('password');
|
883 |
-
|
884 |
Â
if(empty($ccUserId)){
|
885 |
Â
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
886 |
Â
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
@@ -900,7 +864,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
900 |
Â
|
901 |
Â
|
902 |
Â
if (!empty($tokenNum)) {
|
903 |
-
$cc =
|
904 |
Â
$resp = $cc->deleteProfileService($ccProfileId);
|
905 |
Â
|
906 |
Â
if (!empty($resp)) {
|
@@ -972,8 +936,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
972 |
Â
);
|
973 |
Â
|
974 |
Â
|
975 |
-
$cc =
|
976 |
-
|
977 |
Â
$resp = $cc->createProfileService($profrequest);
|
978 |
Â
if ($resp != "") {
|
979 |
Â
$response = json_decode($resp, true);
|
@@ -987,7 +950,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
987 |
Â
$response = "Profile Updated";
|
988 |
Â
} else {
|
989 |
Â
$errorMessage = "There is some problem in update profile. Due to " . $response['resptext'];
|
990 |
-
Mage::log($errorMessage, Zend_Log::ERR);
|
991 |
Â
}
|
992 |
Â
} else {
|
993 |
Â
$myLogMessage = "CC Update Profile Service : ". __FILE__ . " @ " . __LINE__ ." ".$cc->getLastErrorMessage();
|
294 |
Â
public function authService($order, $authAmount = "", $status = "") {
|
295 |
Â
|
296 |
Â
$orderId = $order->getIncrementId();
|
Â
|
|
297 |
Â
$merchid = $this->getConfigData('merchant' , $order->getStoreId());
|
Â
|
|
298 |
Â
|
299 |
Â
if (empty($status)) {
|
300 |
Â
$ccOwner = Mage::getSingleton('core/session')->getCcOwner();
|
370 |
Â
'tokenize' => 'Y');
|
371 |
Â
}
|
372 |
Â
|
373 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService($order);
|
Â
|
|
374 |
Â
$resp = $cc->authService($param);
|
375 |
Â
|
376 |
Â
if (empty($status)) {
|
447 |
Â
$retref = $this->getRetrefReferenceNumber($orderId);
|
448 |
Â
$authCode = $this->getAuthCode($orderId);
|
449 |
Â
$checkout_trans = $this->getPaymentTransactionType();
|
Â
|
|
450 |
Â
$merchid = $this->getConfigData('merchant' , $payment->getOrder()->getStoreId());
|
Â
|
|
Â
|
|
Â
|
|
451 |
Â
|
452 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService($order);
|
453 |
Â
|
454 |
Â
if ($fullAuthorizedAmount == $amount) {
|
455 |
Â
$resp = $cc->captureService($retref, $authCode, $amount, $orderId);
|
524 |
Â
$amount = number_format($amount, 2);
|
525 |
Â
}
|
526 |
Â
$amount = str_replace(",", "", $amount);
|
Â
|
|
Â
|
|
Â
|
|
527 |
Â
|
528 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService($order);
|
529 |
Â
$resp = $cc->voidService($retref, $amount);
|
530 |
Â
|
531 |
Â
if ($resp != "") {
|
585 |
Â
$order = $payment->getOrder();
|
586 |
Â
$orderId = $order->increment_id;
|
587 |
Â
$retref = $this->getRetrefReferenceNumber($orderId, "Refund");
|
Â
|
|
Â
|
|
Â
|
|
588 |
Â
|
589 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService($order);
|
590 |
Â
|
591 |
Â
$resp = $cc->inquireService($retref);
|
592 |
Â
$response = json_decode($resp, true);
|
613 |
Â
$order = $payment->getOrder();
|
614 |
Â
$orderId = $order->increment_id;
|
615 |
Â
$retref = $this->getRetrefReferenceNumber($orderId, "Refund");
|
Â
|
|
616 |
Â
$merchid = $this->getConfigData('merchant' , $payment->getOrder()->getStoreId());
|
Â
|
|
617 |
Â
|
618 |
Â
if ($amount <= 0) {
|
619 |
Â
Mage::throwException(Mage::helper('ccgateway')->__('Invalid amount for refund.'));
|
625 |
Â
|
626 |
Â
$amount = str_replace(",", "", $amount);
|
627 |
Â
|
628 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService($order);
|
Â
|
|
629 |
Â
$resp = $cc->refundService($retref, $amount);
|
630 |
Â
|
631 |
Â
if ($resp != "") {
|
663 |
Â
$order = Mage::getModel('sales/order');
|
664 |
Â
$order->loadByIncrementId($orderId);
|
665 |
Â
$responseData = $this->getResponseDataByOrderId($orderId);
|
Â
|
|
Â
|
|
666 |
Â
$cc_password = $this->getConfigData('password', $order->getStoreId());
|
667 |
Â
|
668 |
Â
|
679 |
Â
$order_amount = $data->getData('CC_AMT');
|
680 |
Â
$setlstat = $data->getData('CC_SETLSTAT');
|
681 |
Â
|
682 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService($order);
|
Â
|
|
Â
|
|
683 |
Â
$resp = $cc->inquireService($retref);
|
684 |
Â
$response = json_decode($resp, true);
|
685 |
Â
if (!empty($response)) {
|
748 |
Â
// Create Profile webservices
|
749 |
Â
function createProfileService($paymentInformation) {
|
750 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
751 |
Â
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
752 |
Â
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
753 |
Â
$ccUserId = $customerData->getId();
|
775 |
Â
'postal' => $paymentInformation['cc_postcode']
|
776 |
Â
);
|
777 |
Â
|
778 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService();
|
Â
|
|
779 |
Â
$resp = $cc->createProfileService($profrequest);
|
780 |
Â
|
781 |
Â
if ($resp != "") {
|
805 |
Â
// Function for Get Profile webservices
|
806 |
Â
function getProfileWebService($profileId, $cc_id) {
|
807 |
Â
|
808 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService();
|
Â
|
|
Â
|
|
809 |
Â
|
Â
|
|
810 |
Â
$resp = $cc->getProfileService($profileId);
|
811 |
Â
if (!empty($resp) && $cc_id != "") {
|
812 |
Â
$resource = Mage::getSingleton('core/resource');
|
813 |
Â
$readConnection = $resource->getConnection('core_read');
|
Â
|
|
814 |
Â
$getTable = $resource->getTableName('cardconnect_wallet');
|
815 |
Â
|
816 |
Â
$selQry = "SELECT CC_CARD_NAME FROM {$getTable} WHERE CC_ID=" . $cc_id;
|
830 |
Â
// Function for Get Profile webservices Checkout
|
831 |
Â
function getProfileWebServiceCheckout($profileId) {
|
832 |
Â
|
833 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService();
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
834 |
Â
$resp = $cc->getProfileService($profileId);
|
835 |
Â
if (empty($resp)) {
|
836 |
Â
$myLogMessage = "CC Get Profile Service : ". __FILE__ . " @ " . __LINE__ ." ".$cc->getLastErrorMessage();
|
845 |
Â
|
846 |
Â
function deleteWalletDataService($profileRowId, $ccUserId= "") {
|
847 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
848 |
Â
if(empty($ccUserId)){
|
849 |
Â
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
850 |
Â
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
864 |
Â
|
865 |
Â
|
866 |
Â
if (!empty($tokenNum)) {
|
867 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService();
|
868 |
Â
$resp = $cc->deleteProfileService($ccProfileId);
|
869 |
Â
|
870 |
Â
if (!empty($resp)) {
|
936 |
Â
);
|
937 |
Â
|
938 |
Â
|
939 |
+
$cc = Mage::helper('ccgateway')->getCardConnectWebService();
|
Â
|
|
940 |
Â
$resp = $cc->createProfileService($profrequest);
|
941 |
Â
if ($resp != "") {
|
942 |
Â
$response = json_decode($resp, true);
|
950 |
Â
$response = "Profile Updated";
|
951 |
Â
} else {
|
952 |
Â
$errorMessage = "There is some problem in update profile. Due to " . $response['resptext'];
|
953 |
+
Mage::log($errorMessage, Zend_Log::ERR, "cc.log");
|
954 |
Â
}
|
955 |
Â
} else {
|
956 |
Â
$myLogMessage = "CC Update Profile Service : ". __FILE__ . " @ " . __LINE__ ." ".$cc->getLastErrorMessage();
|
app/code/community/Cardconnect/Ccgateway/Model/cardconnect_webservice.php
CHANGED
@@ -1,496 +1,548 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the class representing CardConnect Payments
|
4 |
-
* @category CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @license GPL v2, please see LICENSE.txt
|
8 |
-
* @access public
|
9 |
-
* @version $Id: $
|
10 |
-
*
|
11 |
-
**/
|
12 |
-
/*
|
13 |
-
This program is free software; you can redistribute it and/or modify
|
14 |
-
it under the terms of the GNU General Public License as published by
|
15 |
-
the Free Software Foundation; either version 2 of the License, or
|
16 |
-
(at your option) any later version.
|
17 |
-
|
18 |
-
This program is distributed in the hope that it will be useful,
|
19 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
-
GNU General Public License for more details.
|
22 |
-
|
23 |
-
You should have received a copy of the GNU General Public License
|
24 |
-
along with this program; if not, write to the Free Software
|
25 |
-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
26 |
-
*/
|
27 |
-
|
28 |
-
/**
|
29 |
-
* CardConnect REST API Wrapper Class
|
30 |
-
*
|
31 |
-
* @package CardConnect
|
32 |
-
* @category Library
|
33 |
-
* @author CardConnect
|
34 |
-
*
|
35 |
-
*/
|
36 |
-
class CardConnectWebService
|
37 |
-
{
|
38 |
-
var $userName;
|
39 |
-
var $passWord;
|
40 |
-
var $restUrl;
|
41 |
-
var $merchantId;
|
42 |
-
var $lasterror;
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
$
|
111 |
-
$
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
'
|
168 |
-
'
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
*
|
222 |
-
*
|
223 |
-
*
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
'
|
232 |
-
'
|
233 |
-
'
|
234 |
-
|
235 |
-
|
236 |
-
$response = $this->sendTransactionToGateway('
|
237 |
-
return $response;
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Function:
|
242 |
-
* Description: Implementation of
|
243 |
-
* Parameters:
|
244 |
-
* @param $cc_retref "Retrieval reference number"
|
245 |
-
* @
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
'
|
252 |
-
|
253 |
-
|
254 |
-
$
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
*
|
267 |
-
*
|
268 |
-
*
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
*
|
286 |
-
*
|
287 |
-
*
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
'
|
295 |
-
'
|
296 |
-
'
|
297 |
-
'
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
);
|
307 |
-
|
308 |
-
$response
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
*
|
314 |
-
*
|
315 |
-
*
|
316 |
-
* @param $
|
317 |
-
* @
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
'
|
349 |
-
'
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
$
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
"
|
428 |
-
"
|
429 |
-
"
|
430 |
-
"
|
431 |
-
"
|
432 |
-
"
|
433 |
-
"
|
434 |
-
"
|
435 |
-
"
|
436 |
-
"
|
437 |
-
"
|
438 |
-
"
|
439 |
-
"
|
440 |
-
"
|
441 |
-
"
|
442 |
-
"
|
443 |
-
"
|
444 |
-
"
|
445 |
-
"
|
446 |
-
"
|
447 |
-
"
|
448 |
-
"
|
449 |
-
"
|
450 |
-
"
|
451 |
-
"
|
452 |
-
"
|
453 |
-
"
|
454 |
-
"
|
455 |
-
"
|
456 |
-
"
|
457 |
-
"
|
458 |
-
"
|
459 |
-
"
|
460 |
-
"
|
461 |
-
"
|
462 |
-
"
|
463 |
-
"
|
464 |
-
"
|
465 |
-
"
|
466 |
-
"
|
467 |
-
"
|
468 |
-
"
|
469 |
-
"
|
470 |
-
"
|
471 |
-
"
|
472 |
-
"
|
473 |
-
"
|
474 |
-
"
|
475 |
-
"
|
476 |
-
"
|
477 |
-
"
|
478 |
-
"
|
479 |
-
"
|
480 |
-
"
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the class representing CardConnect Payments
|
4 |
+
* @category CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @license GPL v2, please see LICENSE.txt
|
8 |
+
* @access public
|
9 |
+
* @version $Id: $
|
10 |
+
*
|
11 |
+
**/
|
12 |
+
/*
|
13 |
+
This program is free software; you can redistribute it and/or modify
|
14 |
+
it under the terms of the GNU General Public License as published by
|
15 |
+
the Free Software Foundation; either version 2 of the License, or
|
16 |
+
(at your option) any later version.
|
17 |
+
|
18 |
+
This program is distributed in the hope that it will be useful,
|
19 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
+
GNU General Public License for more details.
|
22 |
+
|
23 |
+
You should have received a copy of the GNU General Public License
|
24 |
+
along with this program; if not, write to the Free Software
|
25 |
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
26 |
+
*/
|
27 |
+
|
28 |
+
/**
|
29 |
+
* CardConnect REST API Wrapper Class
|
30 |
+
*
|
31 |
+
* @package CardConnect
|
32 |
+
* @category Library
|
33 |
+
* @author CardConnect
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
class CardConnectWebService
|
37 |
+
{
|
38 |
+
var $userName;
|
39 |
+
var $passWord;
|
40 |
+
var $restUrl;
|
41 |
+
var $merchantId;
|
42 |
+
var $lasterror;
|
43 |
+
var $testMode;
|
44 |
+
var $ccSite;
|
45 |
+
var $frontEndID;
|
46 |
+
var $testTemplateUrl;
|
47 |
+
var $prodTemplateUrl;
|
48 |
+
|
49 |
+
function CardConnectWebService($testmode, $ccsite, $frontendid, $username, $password, $merchantId, $keys_location)
|
50 |
+
{
|
51 |
+
$this->userName = $username;
|
52 |
+
$this->passWord = $password;
|
53 |
+
$this->merchantId = $merchantId;
|
54 |
+
$this->keys_location = $keys_location;
|
55 |
+
$this->testMode = $testmode;
|
56 |
+
$this->ccSite = $ccsite;
|
57 |
+
$this->frontEndID = $frontendid;
|
58 |
+
$this->testTemplateUrl = 'https://[SITE].prinpay.com:6443/cardconnect/rest/';
|
59 |
+
$this->prodTemplateUrl = 'https://[SITE].prinpay.com:8443/cardconnect/rest/';
|
60 |
+
|
61 |
+
if (!empty($this->ccSite)) {
|
62 |
+
if ($testmode === 'No' || $testmode === 1) {
|
63 |
+
// replace sitename in $prodTemplateUrl
|
64 |
+
$this->restUrl = str_ireplace("[SITE]", $this->ccSite, $this->prodTemplateUrl);
|
65 |
+
error_log("Modified Production URL " . $this->restUrl);
|
66 |
+
} else {
|
67 |
+
$this->restUrl = str_ireplace("[SITE]", $this->ccSite, $this->testTemplateUrl);
|
68 |
+
error_log("Modified Test URL " . $this->restUrl);
|
69 |
+
}
|
70 |
+
} else {
|
71 |
+
$mymessage = "CC: ccSite name is empty ";
|
72 |
+
error_log("CC Error : " . $mymessage . " Last Error Message : " . $this->getLastErrorMessage());
|
73 |
+
$this->restUrl = "";
|
74 |
+
}
|
75 |
+
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Function: getLastErrorMessage
|
80 |
+
* Description: Return the last curl error encountered while executing web services
|
81 |
+
*/
|
82 |
+
public function getLastErrorMessage()
|
83 |
+
{
|
84 |
+
return $this->lasterror;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Function: sendTransactionToGateway
|
89 |
+
* Description: Send web service request to payment gateway
|
90 |
+
* Parameters:
|
91 |
+
* @param $service "accept service name (auth, capture, refund, void, inquire)"
|
92 |
+
* @param $parameters "input of web service request data"
|
93 |
+
* @return $result returns JSON encoded string to the appropriate Service
|
94 |
+
*/
|
95 |
+
public function sendTransactionToGateway($service, $parameters)
|
96 |
+
{
|
97 |
+
$url = $this->restUrl;
|
98 |
+
$postString = "";
|
99 |
+
|
100 |
+
if ($service == 'inquire') {
|
101 |
+
$method = 'GET';
|
102 |
+
$url = $url . $service . "/" . $parameters;
|
103 |
+
} elseif ($service == 'CP') {
|
104 |
+
$method = 'GET';
|
105 |
+
$url = $url . "?" . $parameters;
|
106 |
+
} elseif ($service == 'getprofile') {
|
107 |
+
$method = 'GET';
|
108 |
+
$url = $url . "profile" . "/" . $parameters;
|
109 |
+
} elseif ($service == 'deleteprofile') {
|
110 |
+
$method = 'DELETE';
|
111 |
+
$url = $url . "profile" . "/" . $parameters;
|
112 |
+
} else {
|
113 |
+
$method = 'PUT';
|
114 |
+
$url = $url . $service;
|
115 |
+
$postString = json_encode($parameters);
|
116 |
+
}
|
117 |
+
|
118 |
+
$headers = array("Content-Type: application/json", "Accept: application/json");
|
119 |
+
|
120 |
+
if (function_exists('curl_init')) {
|
121 |
+
$curl = curl_init();
|
122 |
+
curl_setopt($curl, CURLOPT_URL, $url);
|
123 |
+
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
124 |
+
curl_setopt($curl, CURLOPT_HEADER, 0);
|
125 |
+
curl_setopt($curl, CURLOPT_USERPWD, $this->userName . ":" . $this->passWord);
|
126 |
+
curl_setopt($curl, CURLOPT_CAINFO, $this->keys_location . "cacert.pem");
|
127 |
+
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
|
128 |
+
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
|
129 |
+
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
130 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
131 |
+
curl_setopt($curl, CURLOPT_COOKIESESSION, 1);
|
132 |
+
curl_setopt($curl, CURLOPT_POSTFIELDS, $postString);
|
133 |
+
|
134 |
+
$result = curl_exec($curl);
|
135 |
+
$info = curl_getinfo($curl);
|
136 |
+
$curlerrno = curl_errno($curl);
|
137 |
+
$curlerrdesc = curl_error($curl);
|
138 |
+
|
139 |
+
curl_close($curl);
|
140 |
+
|
141 |
+
if ($info['http_code'] != "200") {
|
142 |
+
$this->lasterror = "ERROR ";
|
143 |
+
if (!empty($info['http_code']))
|
144 |
+
$this->lasterror = $this->lasterror . ":http=" . $info['http_code'];
|
145 |
+
if ($curlerrno != 0)
|
146 |
+
$this->lasterror = $this->lasterror . ":errno=" . $curlerrno . ":errdesc=" . $curlerrdesc;
|
147 |
+
if (!empty($result))
|
148 |
+
$this->lasterror = $this->lasterror . ":result=" . $result;
|
149 |
+
$result = "";
|
150 |
+
}
|
151 |
+
return $result;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Function: authService
|
157 |
+
* Description: Implementation of auth web service request
|
158 |
+
* Parameters:
|
159 |
+
* @param $authrequest "Accept auth request array"
|
160 |
+
* @return $response "Returns JSON encoded string of auth service response"
|
161 |
+
*/
|
162 |
+
public function authService($authrequest)
|
163 |
+
{
|
164 |
+
|
165 |
+
if (!empty($authrequest['profileid'])) {
|
166 |
+
$param = array(
|
167 |
+
'merchid' => $this->merchantId,
|
168 |
+
'profile' => $authrequest['profileid'],
|
169 |
+
'orderid' => $authrequest['order_id'],
|
170 |
+
'amount' => $authrequest['currency_value'],
|
171 |
+
'ecomind' => $authrequest['ecomind'],
|
172 |
+
'cvv2' => $authrequest['cvv_val'],
|
173 |
+
'capture' => $authrequest['capture'],
|
174 |
+
//'ccSite' => $this->ccSite,
|
175 |
+
'frontendid' => $this->frontEndID);
|
176 |
+
|
177 |
+
$response = $this->sendTransactionToGateway('auth', $param);
|
178 |
+
} else {
|
179 |
+
if (!empty($authrequest['acc_num'])) {
|
180 |
+
$param = array(
|
181 |
+
'merchid' => $this->merchantId,
|
182 |
+
'accttype' => $authrequest['acc_type'],
|
183 |
+
'orderid' => $authrequest['order_id'],
|
184 |
+
'account' => $authrequest['acc_num'],
|
185 |
+
'expiry' => $authrequest['expirydt'],
|
186 |
+
'amount' => $authrequest['currency_value'],
|
187 |
+
'currency' => $authrequest['currency'],
|
188 |
+
'name' => $authrequest['cc_owner'],
|
189 |
+
'address' => $authrequest['billing_street_address'],
|
190 |
+
'city' => $authrequest['billing_city'],
|
191 |
+
'region' => $authrequest['billing_state'],
|
192 |
+
'country' => $authrequest['billing_country'],
|
193 |
+
'postal' => $authrequest['billing_postcode'],
|
194 |
+
'ecomind' => $authrequest['ecomind'],
|
195 |
+
'cvv2' => $authrequest['cvv_val'],
|
196 |
+
'track' => null,
|
197 |
+
'tokenize' => 'Y',
|
198 |
+
'capture' => $authrequest['capture'],
|
199 |
+
//'ccSite' => $this->ccSite,
|
200 |
+
'frontendid' => $this->frontEndID);
|
201 |
+
|
202 |
+
$response = $this->sendTransactionToGateway('auth', $param);
|
203 |
+
|
204 |
+
} else {
|
205 |
+
$mymessage = "CC: Account number is empty ";
|
206 |
+
error_log("CC Error : " . $mymessage . " Last Error Message : " . $this->getLastErrorMessage());
|
207 |
+
$response = '';
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
return $response;
|
212 |
+
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Function: captureService
|
217 |
+
* Description: Implementation of capture web service request
|
218 |
+
* Parameters:
|
219 |
+
* @param $cc_retref "Retrieval reference number"
|
220 |
+
* @param $cc_authcode "Authorization number"
|
221 |
+
* @param $currency_value "Amount"
|
222 |
+
* @param $order_id "Order Id"
|
223 |
+
* @return $response "Returns JSON encoded string of capture service response"
|
224 |
+
*/
|
225 |
+
public function captureService($cc_retref, $cc_authcode = null, $currency_value = null, $order_id = null)
|
226 |
+
{
|
227 |
+
$param = array(
|
228 |
+
'retref' => $cc_retref,
|
229 |
+
'merchid' => $this->merchantId,
|
230 |
+
'authcode' => $cc_authcode,
|
231 |
+
'amount' => $currency_value,
|
232 |
+
'invoiceid' => $order_id,
|
233 |
+
//'ccSite' => $this->ccSite,
|
234 |
+
'frontendid' => $this->frontEndID);
|
235 |
+
|
236 |
+
$response = $this->sendTransactionToGateway('capture', $param);
|
237 |
+
return $response;
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Function: voidService
|
242 |
+
* Description: Implementation of void web service request
|
243 |
+
* Parameters:
|
244 |
+
* @param $cc_retref "Retrieval reference number"
|
245 |
+
* @param $currency_value "Amount"
|
246 |
+
* @return $response "Returns JSON encoded string of void service response"
|
247 |
+
*/
|
248 |
+
public function voidService($cc_retref, $currency_value = null)
|
249 |
+
{
|
250 |
+
$param = array(
|
251 |
+
'retref' => $cc_retref,
|
252 |
+
'merchid' => $this->merchantId,
|
253 |
+
'amount' => $currency_value,
|
254 |
+
//'ccSite' => $this->ccSite,
|
255 |
+
'frontendid' => $this->frontEndID
|
256 |
+
);
|
257 |
+
|
258 |
+
$response = $this->sendTransactionToGateway('void', $param);
|
259 |
+
return $response;
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Function: refundService
|
264 |
+
* Description: Implementation of refund web service request
|
265 |
+
* Parameters:
|
266 |
+
* @param $cc_retref "Retrieval reference number"
|
267 |
+
* @param $currency_value "Amount"
|
268 |
+
* @return $response "Returns JSON encoded string of refund service response"
|
269 |
+
*/
|
270 |
+
public function refundService($cc_retref, $currency_value = null)
|
271 |
+
{
|
272 |
+
$param = array(
|
273 |
+
'retref' => $cc_retref,
|
274 |
+
'merchid' => $this->merchantId,
|
275 |
+
'amount' => $currency_value,
|
276 |
+
//'ccSite' => $this->ccSite,
|
277 |
+
'frontendid' => $this->frontEndID
|
278 |
+
);
|
279 |
+
|
280 |
+
$response = $this->sendTransactionToGateway('refund', $param);
|
281 |
+
return $response;
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Function: inquireService
|
286 |
+
* Description: Implementation of inquire web service request
|
287 |
+
* Parameters:
|
288 |
+
* @param $cc_retref "Retrieval reference number"
|
289 |
+
* @return $response "Returns JSON encoded string of inquire service response"
|
290 |
+
*/
|
291 |
+
public function inquireService($cc_retref)
|
292 |
+
{
|
293 |
+
$param = array(
|
294 |
+
'retref' => $cc_retref,
|
295 |
+
'merchid' => $this->merchantId
|
296 |
+
/*'ccSite' => $this->ccSite,
|
297 |
+
'frontendid' => $this->frontEndID*/
|
298 |
+
);
|
299 |
+
|
300 |
+
$postString = '';
|
301 |
+
|
302 |
+
foreach ($param as $key => $value) {
|
303 |
+
$postString .= urlencode(utf8_encode(trim($value))) . '/';
|
304 |
+
}
|
305 |
+
|
306 |
+
$postString = substr($postString, 0, -1);
|
307 |
+
$response = $this->sendTransactionToGateway('inquire', $postString);
|
308 |
+
return $response;
|
309 |
+
}
|
310 |
+
|
311 |
+
/**
|
312 |
+
* Function: cardPurgeService
|
313 |
+
* Description: Implementation of Purge web service request to delete token
|
314 |
+
* Parameters:
|
315 |
+
* @param $tokenNum "token number, $action, $type"
|
316 |
+
* @param $action "CardSecure action"
|
317 |
+
* @param $type "Type of request/response format"
|
318 |
+
* @return $response "Returns XML encoded string of purge service response"
|
319 |
+
*/
|
320 |
+
public function cardPurgeService($action, $type, $tokenNum)
|
321 |
+
{
|
322 |
+
$postString = "action=" . $action . "&type=" . $type . "&data=" . $tokenNum;
|
323 |
+
|
324 |
+
$response = $this->sendTransactionToGateway('CP', $postString);
|
325 |
+
return $response;
|
326 |
+
}
|
327 |
+
|
328 |
+
/**
|
329 |
+
* Function: createProfileService
|
330 |
+
* Description: Implementation of profile web service request
|
331 |
+
* Parameters:
|
332 |
+
* @param $profrequest "Accept profile request array"
|
333 |
+
* @return $response "Returns JSON encoded string of create/update profile service response"
|
334 |
+
*/
|
335 |
+
public function createProfileService($profrequest)
|
336 |
+
{
|
337 |
+
$param = array(
|
338 |
+
'defaultacct' => $profrequest['defaultacct'],
|
339 |
+
'profile' => $profrequest['profile'],
|
340 |
+
'profileupdate' => $profrequest['profileupdate'],
|
341 |
+
'account' => $profrequest['account'],
|
342 |
+
'accttype' => $profrequest['accttype'],
|
343 |
+
'expiry' => $profrequest['expiry'],
|
344 |
+
'name' => $profrequest['name'],
|
345 |
+
'address' => $profrequest['address'],
|
346 |
+
'city' => $profrequest['city'],
|
347 |
+
'region' => $profrequest['region'],
|
348 |
+
'country' => $profrequest['country'],
|
349 |
+
'phone' => $profrequest['phone'],
|
350 |
+
'postal' => $profrequest['postal'],
|
351 |
+
'merchid' => $this->merchantId
|
352 |
+
/*'ccSite' => $this->ccSite,
|
353 |
+
'frontendid' => $this->frontEndID*/
|
354 |
+
);
|
355 |
+
|
356 |
+
$response = $this->sendTransactionToGateway('profile', $param);
|
357 |
+
return $response;
|
358 |
+
}
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Function: getProfileService
|
362 |
+
* Description: Implementation of profile web service request
|
363 |
+
* Parameters:
|
364 |
+
* @param $profileid "accept profileid to display account details"
|
365 |
+
* @return $response "returns JSON encoded string of get profile service response"
|
366 |
+
*/
|
367 |
+
public function getProfileService($profileid, $acctid = "")
|
368 |
+
{
|
369 |
+
$param = array(
|
370 |
+
'profileid' => $profileid,
|
371 |
+
'acctid' => $acctid,
|
372 |
+
'merchid' => $this->merchantId
|
373 |
+
/*'ccSite' => $this->ccSite,
|
374 |
+
'frontendid' => $this->frontEndID*/
|
375 |
+
);
|
376 |
+
|
377 |
+
$postString = '';
|
378 |
+
foreach ($param as $key => $value) {
|
379 |
+
$postString .= urlencode(utf8_encode(trim($value))) . '/';
|
380 |
+
}
|
381 |
+
|
382 |
+
$postString = substr($postString, 0, -1);
|
383 |
+
$response = $this->sendTransactionToGateway('getprofile', $postString);
|
384 |
+
return $response;
|
385 |
+
|
386 |
+
}
|
387 |
+
|
388 |
+
/**
|
389 |
+
* Function: deleteProfileService
|
390 |
+
* Description: Implementation of profile web service request
|
391 |
+
* Parameters:
|
392 |
+
* @param Accept profileid
|
393 |
+
* @return Returns JSON encoded string of delete profile service response
|
394 |
+
*/
|
395 |
+
public function deleteProfileService($profileid)
|
396 |
+
{
|
397 |
+
$param = array(
|
398 |
+
'profileid' => $profileid,
|
399 |
+
'merchid' => $this->merchantId
|
400 |
+
/*'ccSite' => $this->ccSite,
|
401 |
+
'frontendid' => $this->frontEndID*/
|
402 |
+
);
|
403 |
+
|
404 |
+
$postString = '';
|
405 |
+
|
406 |
+
foreach ($param as $key => $value) {
|
407 |
+
$postString .= urlencode(utf8_encode(trim($value))) . '//';
|
408 |
+
}
|
409 |
+
|
410 |
+
$postString = substr($postString, 0, -2);
|
411 |
+
$response = $this->sendTransactionToGateway('deleteprofile', $postString);
|
412 |
+
return $response;
|
413 |
+
|
414 |
+
}
|
415 |
+
|
416 |
+
|
417 |
+
/**
|
418 |
+
* Function: getCCErrorMessage
|
419 |
+
* Description: Function to return proper CardConnect Error messages
|
420 |
+
* Parameters:
|
421 |
+
* @param $respError "response processor and response code"
|
422 |
+
* @return $message "returns Error message response"
|
423 |
+
*/
|
424 |
+
public function getCCErrorMessage($respError)
|
425 |
+
{
|
426 |
+
$errorList = array(
|
427 |
+
"PPS11" => "Invalid card",
|
428 |
+
"PPS12" => "Invalid track",
|
429 |
+
"PPS13" => "Bad card check digit",
|
430 |
+
"PPS14" => "Non-numeric CVV",
|
431 |
+
"PPS15" => "Non-numeric expiry",
|
432 |
+
"PPS16" => "Card expired",
|
433 |
+
"PPS17" => "Invalid zip",
|
434 |
+
"PPS19" => "CardDefense Decline",
|
435 |
+
"PPS23" => "No auth queue",
|
436 |
+
"PPS31" => "Invalid currency",
|
437 |
+
"PPS32" => "Wrong currency for merch",
|
438 |
+
"PPS33" => "Unknown card type",
|
439 |
+
"PPS35" => "No postal code",
|
440 |
+
"PPS37" => "CVV mismatch",
|
441 |
+
"PPS41" => "Below min amount",
|
442 |
+
"PPS42" => "Above max amount",
|
443 |
+
"PPS43" => "Invalid amount",
|
444 |
+
"PPS61" => "Line down",
|
445 |
+
"PPS62" => "Timed out",
|
446 |
+
"PPS91" => "No TokenSecure",
|
447 |
+
"PPS92" => "No Merchant table",
|
448 |
+
"PPS93" => "No Database",
|
449 |
+
"FNOR05" => "Do not honor",
|
450 |
+
"FNOR12" => "Invalid transaction",
|
451 |
+
"FNOR13" => "Invalid amount",
|
452 |
+
"FNOR14" => "Invalid card number",
|
453 |
+
"FNOR28" => "Please retry",
|
454 |
+
"FNOR51" => "Declined",
|
455 |
+
"FNOR54" => "Wrong expiration",
|
456 |
+
"FNOR61" => "Exceeds withdrawal limit",
|
457 |
+
"FNOR63" => "Service not allowed",
|
458 |
+
"FNOR89" => "Invalid Term ID",
|
459 |
+
"FNORC2" => "CVV decline",
|
460 |
+
"FNORN3" => "Invalid Account",
|
461 |
+
"FNORNU" => "Insufficient funds",
|
462 |
+
"MNS04" => "Pick up card",
|
463 |
+
"MNS05" => "Do not honor",
|
464 |
+
"MNS07" => "Suspected fraud",
|
465 |
+
"MNS13" => "Invalid amount",
|
466 |
+
"MNS14" => "Invalid card number",
|
467 |
+
"MNS15" => "No such card issuer",
|
468 |
+
"MNS19" => "Re-enter transaction",
|
469 |
+
"MNS34" => "Suspected fraud",
|
470 |
+
"MNS41" => "Card reported lost",
|
471 |
+
"MNS43" => "Card reported stolen",
|
472 |
+
"MNS51" => "Insufficient funds",
|
473 |
+
"MNS54" => "Wrong expiration",
|
474 |
+
"MNS65" => "Activity limit exceeded",
|
475 |
+
"MNS82" => "CVV incorrect",
|
476 |
+
"MNS99" => "Decline",
|
477 |
+
"PMT000" => "System Down",
|
478 |
+
"PMT200" => "Auth network down",
|
479 |
+
"PMT201" => "Invalid CC number",
|
480 |
+
"PMT202" => "Bad amount",
|
481 |
+
"PMT203" => "Zero amount",
|
482 |
+
"PMT233" => "Card does not match type",
|
483 |
+
"PMT238" => "Invalid currency",
|
484 |
+
"PMT239" => "Invalid card for merchant",
|
485 |
+
"PMT243" => "Invalid Level 3 field",
|
486 |
+
"PMT302" => "Insufficient funds",
|
487 |
+
"PMT303" => "Processor decline",
|
488 |
+
"PMT304" => "Invalid card",
|
489 |
+
"PMT501" => "Pickup card",
|
490 |
+
"PMT502" => "Card reported lost",
|
491 |
+
"PMT503" => "Fraud",
|
492 |
+
"PMT521" => "Insufficient funds",
|
493 |
+
"PMT522" => "Card expired",
|
494 |
+
"PMT530" => "Do not honor",
|
495 |
+
"PMT531" => "CVV mismatch",
|
496 |
+
"PMT591" => "Invalid card number",
|
497 |
+
"PMT592" => "Bad amount",
|
498 |
+
"PMT605" => "Invalid expiry date",
|
499 |
+
"PMT607" => "Invalid amount",
|
500 |
+
"PMT903" => "Invalid expiry",
|
501 |
+
"PMT904" => "Card not active",
|
502 |
+
"VPS04" => "Pick up card",
|
503 |
+
"VPS05" => "Do not honor",
|
504 |
+
"VPS07" => "Suspected fraud",
|
505 |
+
"VPS13" => "Invalid amount",
|
506 |
+
"VPS14" => "Invalid card number",
|
507 |
+
"VPS19" => "Re-enter transaction",
|
508 |
+
"VPS23" => "Bad fee amount",
|
509 |
+
"VPS28" => "File temporarily unavailable",
|
510 |
+
"VPS34" => "Suspected fraud",
|
511 |
+
"VPS41" => "Card reported lost",
|
512 |
+
"VPS43" => "Card reported stolen",
|
513 |
+
"VPS51" => "Insufficient funds",
|
514 |
+
"VPS54" => "Wrong expiration",
|
515 |
+
"VPS61" => "Exceeds withdrawal limit",
|
516 |
+
"VPS65" => "Activity limit exceeded",
|
517 |
+
"VPS82" => "CVV incorrect",
|
518 |
+
"VPS96" => "System malfunction",
|
519 |
+
"VPSN7" => "CVV mismatch",
|
520 |
+
"AMEX100" => "Decline",
|
521 |
+
"AMEX101" => "Expired card",
|
522 |
+
"AMEX103" => "CID failed",
|
523 |
+
"AMEX105" => "Card cancelled",
|
524 |
+
"AMEX110" => "Invalid amount",
|
525 |
+
"AMEX111" => "Invalid card",
|
526 |
+
"AMEX122" => "Invalid CID",
|
527 |
+
"AMEX182" => "Try later",
|
528 |
+
"AMEX200" => "Pick up card",
|
529 |
+
"PSTR02" => "Declined",
|
530 |
+
"PSTR06" => "AVS_Declined",
|
531 |
+
"PSTR07" => "CCVS_Declined",
|
532 |
+
"PSTR08" => "Expired"
|
533 |
+
|
534 |
+
);
|
535 |
+
|
536 |
+
if (array_key_exists($respError, $errorList)) {
|
537 |
+
$message = $errorList[$respError];
|
538 |
+
} else {
|
539 |
+
$message = "Your payment is unable to process, call customer service";
|
540 |
+
}
|
541 |
+
|
542 |
+
return $message;
|
543 |
+
}
|
544 |
+
|
545 |
+
|
546 |
+
}
|
547 |
+
|
548 |
+
?>
|
app/code/community/Cardconnect/Ccgateway/blocks/billing.phtml
CHANGED
@@ -1,217 +1,217 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/afl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category design
|
22 |
-
* @package base_default
|
23 |
-
* @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
|
24 |
-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
-
*/
|
26 |
-
?>
|
27 |
-
<form id="co-billing-form" action="">
|
28 |
-
<fieldset>
|
29 |
-
<ul class="form-list">
|
30 |
-
<?php if ($this->customerHasAddresses()): ?>
|
31 |
-
|
32 |
-
<li class="wide">
|
33 |
-
<label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
|
34 |
-
<div class="input-box">
|
35 |
-
<?php echo $this->getAddressesHtmlSelect('billing') ?>
|
36 |
-
</div>
|
37 |
-
</li>
|
38 |
-
<?php endif; ?>
|
39 |
-
<li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
|
40 |
-
<fieldset>
|
41 |
-
<input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
|
42 |
-
<ul>
|
43 |
-
<li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
|
44 |
-
<li class="fields">
|
45 |
-
<div class="field">
|
46 |
-
<label for="billing:company"><?php echo $this->__('Company') ?></label>
|
47 |
-
<div class="input-box">
|
48 |
-
<input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
|
49 |
-
</div>
|
50 |
-
</div>
|
51 |
-
<?php if(!$this->isCustomerLoggedIn()): ?>
|
52 |
-
<div class="field">
|
53 |
-
<label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
54 |
-
<div class="input-box">
|
55 |
-
<input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->escapeHtml($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
|
56 |
-
</div>
|
57 |
-
</div>
|
58 |
-
<?php endif; ?>
|
59 |
-
</li>
|
60 |
-
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
61 |
-
<li class="wide">
|
62 |
-
<label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
63 |
-
<div class="input-box">
|
64 |
-
<input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
65 |
-
</div>
|
66 |
-
</li>
|
67 |
-
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
68 |
-
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
69 |
-
<li class="wide">
|
70 |
-
<div class="input-box">
|
71 |
-
<input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
72 |
-
</div>
|
73 |
-
</li>
|
74 |
-
<?php endfor; ?>
|
75 |
-
<?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
76 |
-
<li class="wide">
|
77 |
-
<label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label>
|
78 |
-
<div class="input-box">
|
79 |
-
<input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
|
80 |
-
</div>
|
81 |
-
</li>
|
82 |
-
<?php endif; ?>
|
83 |
-
<li class="fields">
|
84 |
-
<div class="field">
|
85 |
-
<label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
86 |
-
<div class="input-box">
|
87 |
-
<input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="billing:city" />
|
88 |
-
</div>
|
89 |
-
</div>
|
90 |
-
<div class="field">
|
91 |
-
<label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
92 |
-
<div class="input-box">
|
93 |
-
<select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
94 |
-
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
95 |
-
</select>
|
96 |
-
<script type="text/javascript">
|
97 |
-
//<![CDATA[
|
98 |
-
$('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
99 |
-
//]]>
|
100 |
-
</script>
|
101 |
-
<input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
|
102 |
-
</div>
|
103 |
-
</div>
|
104 |
-
</li>
|
105 |
-
<li class="fields">
|
106 |
-
<div class="field">
|
107 |
-
<label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
108 |
-
<div class="input-box">
|
109 |
-
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
|
110 |
-
</div>
|
111 |
-
</div>
|
112 |
-
<div class="field">
|
113 |
-
<label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
114 |
-
<div class="input-box">
|
115 |
-
<?php echo $this->getCountryHtmlSelect('billing') ?>
|
116 |
-
</div>
|
117 |
-
</div>
|
118 |
-
</li>
|
119 |
-
<li class="fields">
|
120 |
-
<div class="field">
|
121 |
-
<label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
122 |
-
<div class="input-box">
|
123 |
-
<input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
|
124 |
-
</div>
|
125 |
-
</div>
|
126 |
-
<div class="field">
|
127 |
-
<label for="billing:fax"><?php echo $this->__('Fax') ?></label>
|
128 |
-
<div class="input-box">
|
129 |
-
<input type="text" name="billing[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="billing:fax" />
|
130 |
-
</div>
|
131 |
-
</div>
|
132 |
-
</li>
|
133 |
-
<?php if(!$this->isCustomerLoggedIn()): ?>
|
134 |
-
|
135 |
-
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
|
136 |
-
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
137 |
-
<?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
|
138 |
-
<li class="fields">
|
139 |
-
<?php if ($_dob->isEnabled()): ?>
|
140 |
-
<div class="field">
|
141 |
-
<?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
142 |
-
</div>
|
143 |
-
<?php endif; ?>
|
144 |
-
<?php if ($_gender->isEnabled()): ?>
|
145 |
-
<div class="field">
|
146 |
-
<?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
147 |
-
</div>
|
148 |
-
<?php endif ?>
|
149 |
-
</li>
|
150 |
-
<?php endif ?>
|
151 |
-
|
152 |
-
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
|
153 |
-
<?php if ($_taxvat->isEnabled()): ?>
|
154 |
-
<li>
|
155 |
-
<?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
156 |
-
</li>
|
157 |
-
<?php endif ?>
|
158 |
-
|
159 |
-
<li class="fields" id="register-customer-password">
|
160 |
-
<div class="field">
|
161 |
-
<label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
162 |
-
<div class="input-box">
|
163 |
-
<input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
|
164 |
-
</div>
|
165 |
-
</div>
|
166 |
-
<div class="field">
|
167 |
-
<label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
|
168 |
-
<div class="input-box">
|
169 |
-
<input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
|
170 |
-
</div>
|
171 |
-
</div>
|
172 |
-
</li>
|
173 |
-
<?php endif; ?>
|
174 |
-
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
175 |
-
<li class="control">
|
176 |
-
<input type="checkbox" name="billing[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="billing:save_in_address_book" onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
|
177 |
-
</li>
|
178 |
-
<?php else:?>
|
179 |
-
<li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
|
180 |
-
<?php endif; ?>
|
181 |
-
<?php echo $this->getChildHtml('form.additional.info'); ?>
|
182 |
-
</ul>
|
183 |
-
</fieldset>
|
184 |
-
</li>
|
185 |
-
<?php /* Extensions placeholder */ ?>
|
186 |
-
<?php echo $this->getChildHtml('checkout.onepage.billing.extra')?>
|
187 |
-
<?php if ($this->canShip()): ?>
|
188 |
-
<li class="control">
|
189 |
-
<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to this address') ?>" onclick="$('shipping:same_as_billing').checked = true;" class="radio" /><label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label></li>
|
190 |
-
<li class="control">
|
191 |
-
<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to different address') ?>" onclick="$('shipping:same_as_billing').checked = false;" class="radio" /><label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
|
192 |
-
</li>
|
193 |
-
<?php endif; ?>
|
194 |
-
</ul>
|
195 |
-
<?php if (!$this->canShip()): ?>
|
196 |
-
<input type="hidden" name="billing[use_for_shipping]" value="1" />
|
197 |
-
<?php endif; ?>
|
198 |
-
<div class="buttons-set" id="billing-buttons-container">
|
199 |
-
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
200 |
-
<button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
|
201 |
-
<span class="please-wait" id="billing-please-wait" style="display:none;">
|
202 |
-
<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
|
203 |
-
</span>
|
204 |
-
</div>
|
205 |
-
</fieldset>
|
206 |
-
</form>
|
207 |
-
<script type="text/javascript">
|
208 |
-
//<![CDATA[
|
209 |
-
var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
|
210 |
-
var billingForm = new VarienForm('co-billing-form');
|
211 |
-
|
212 |
-
//billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
|
213 |
-
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
|
214 |
-
|
215 |
-
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
|
216 |
-
//]]>
|
217 |
-
</script>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<form id="co-billing-form" action="">
|
28 |
+
<fieldset>
|
29 |
+
<ul class="form-list">
|
30 |
+
<?php if ($this->customerHasAddresses()): ?>
|
31 |
+
|
32 |
+
<li class="wide">
|
33 |
+
<label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
|
34 |
+
<div class="input-box">
|
35 |
+
<?php echo $this->getAddressesHtmlSelect('billing') ?>
|
36 |
+
</div>
|
37 |
+
</li>
|
38 |
+
<?php endif; ?>
|
39 |
+
<li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
|
40 |
+
<fieldset>
|
41 |
+
<input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
|
42 |
+
<ul>
|
43 |
+
<li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
|
44 |
+
<li class="fields">
|
45 |
+
<div class="field">
|
46 |
+
<label for="billing:company"><?php echo $this->__('Company') ?></label>
|
47 |
+
<div class="input-box">
|
48 |
+
<input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
52 |
+
<div class="field">
|
53 |
+
<label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
54 |
+
<div class="input-box">
|
55 |
+
<input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->escapeHtml($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
<?php endif; ?>
|
59 |
+
</li>
|
60 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
61 |
+
<li class="wide">
|
62 |
+
<label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
63 |
+
<div class="input-box">
|
64 |
+
<input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
65 |
+
</div>
|
66 |
+
</li>
|
67 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
68 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
69 |
+
<li class="wide">
|
70 |
+
<div class="input-box">
|
71 |
+
<input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
72 |
+
</div>
|
73 |
+
</li>
|
74 |
+
<?php endfor; ?>
|
75 |
+
<?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
76 |
+
<li class="wide">
|
77 |
+
<label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label>
|
78 |
+
<div class="input-box">
|
79 |
+
<input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
|
80 |
+
</div>
|
81 |
+
</li>
|
82 |
+
<?php endif; ?>
|
83 |
+
<li class="fields">
|
84 |
+
<div class="field">
|
85 |
+
<label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
86 |
+
<div class="input-box">
|
87 |
+
<input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="billing:city" />
|
88 |
+
</div>
|
89 |
+
</div>
|
90 |
+
<div class="field">
|
91 |
+
<label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
92 |
+
<div class="input-box">
|
93 |
+
<select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
94 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
95 |
+
</select>
|
96 |
+
<script type="text/javascript">
|
97 |
+
//<![CDATA[
|
98 |
+
$('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
99 |
+
//]]>
|
100 |
+
</script>
|
101 |
+
<input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
</li>
|
105 |
+
<li class="fields">
|
106 |
+
<div class="field">
|
107 |
+
<label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
108 |
+
<div class="input-box">
|
109 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
|
110 |
+
</div>
|
111 |
+
</div>
|
112 |
+
<div class="field">
|
113 |
+
<label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
114 |
+
<div class="input-box">
|
115 |
+
<?php echo $this->getCountryHtmlSelect('billing') ?>
|
116 |
+
</div>
|
117 |
+
</div>
|
118 |
+
</li>
|
119 |
+
<li class="fields">
|
120 |
+
<div class="field">
|
121 |
+
<label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
122 |
+
<div class="input-box">
|
123 |
+
<input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
|
124 |
+
</div>
|
125 |
+
</div>
|
126 |
+
<div class="field">
|
127 |
+
<label for="billing:fax"><?php echo $this->__('Fax') ?></label>
|
128 |
+
<div class="input-box">
|
129 |
+
<input type="text" name="billing[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="billing:fax" />
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
</li>
|
133 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
134 |
+
|
135 |
+
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
|
136 |
+
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
137 |
+
<?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
|
138 |
+
<li class="fields">
|
139 |
+
<?php if ($_dob->isEnabled()): ?>
|
140 |
+
<div class="field">
|
141 |
+
<?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
142 |
+
</div>
|
143 |
+
<?php endif; ?>
|
144 |
+
<?php if ($_gender->isEnabled()): ?>
|
145 |
+
<div class="field">
|
146 |
+
<?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
147 |
+
</div>
|
148 |
+
<?php endif ?>
|
149 |
+
</li>
|
150 |
+
<?php endif ?>
|
151 |
+
|
152 |
+
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
|
153 |
+
<?php if ($_taxvat->isEnabled()): ?>
|
154 |
+
<li>
|
155 |
+
<?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
156 |
+
</li>
|
157 |
+
<?php endif ?>
|
158 |
+
|
159 |
+
<li class="fields" id="register-customer-password">
|
160 |
+
<div class="field">
|
161 |
+
<label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
162 |
+
<div class="input-box">
|
163 |
+
<input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
<div class="field">
|
167 |
+
<label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
|
168 |
+
<div class="input-box">
|
169 |
+
<input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
|
170 |
+
</div>
|
171 |
+
</div>
|
172 |
+
</li>
|
173 |
+
<?php endif; ?>
|
174 |
+
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
175 |
+
<li class="control">
|
176 |
+
<input type="checkbox" name="billing[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="billing:save_in_address_book" onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
|
177 |
+
</li>
|
178 |
+
<?php else:?>
|
179 |
+
<li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
|
180 |
+
<?php endif; ?>
|
181 |
+
<?php echo $this->getChildHtml('form.additional.info'); ?>
|
182 |
+
</ul>
|
183 |
+
</fieldset>
|
184 |
+
</li>
|
185 |
+
<?php /* Extensions placeholder */ ?>
|
186 |
+
<?php echo $this->getChildHtml('checkout.onepage.billing.extra')?>
|
187 |
+
<?php if ($this->canShip()): ?>
|
188 |
+
<li class="control">
|
189 |
+
<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to this address') ?>" onclick="$('shipping:same_as_billing').checked = true;" class="radio" /><label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label></li>
|
190 |
+
<li class="control">
|
191 |
+
<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to different address') ?>" onclick="$('shipping:same_as_billing').checked = false;" class="radio" /><label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
|
192 |
+
</li>
|
193 |
+
<?php endif; ?>
|
194 |
+
</ul>
|
195 |
+
<?php if (!$this->canShip()): ?>
|
196 |
+
<input type="hidden" name="billing[use_for_shipping]" value="1" />
|
197 |
+
<?php endif; ?>
|
198 |
+
<div class="buttons-set" id="billing-buttons-container">
|
199 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
200 |
+
<button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
|
201 |
+
<span class="please-wait" id="billing-please-wait" style="display:none;">
|
202 |
+
<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
|
203 |
+
</span>
|
204 |
+
</div>
|
205 |
+
</fieldset>
|
206 |
+
</form>
|
207 |
+
<script type="text/javascript">
|
208 |
+
//<![CDATA[
|
209 |
+
var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
|
210 |
+
var billingForm = new VarienForm('co-billing-form');
|
211 |
+
|
212 |
+
//billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
|
213 |
+
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
|
214 |
+
|
215 |
+
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
|
216 |
+
//]]>
|
217 |
+
</script>
|
app/code/community/Cardconnect/Ccgateway/blocks/creditmemo/create/form.phtml
CHANGED
@@ -1,103 +1,103 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Inherited for having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
?>
|
34 |
-
|
35 |
-
<form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
|
36 |
-
<?php echo $this->getBlockHtml('formkey') ?>
|
37 |
-
<?php $_order = $this->getCreditmemo()->getOrder() ?>
|
38 |
-
<?php echo $this->getChildHtml('order_info') ?>
|
39 |
-
|
40 |
-
<?php if (!$_order->getIsVirtual()): ?>
|
41 |
-
<div class="box-left" style="width:100%">
|
42 |
-
<?php else: ?>
|
43 |
-
<div class="box-right">
|
44 |
-
<?php endif; ?>
|
45 |
-
|
46 |
-
</div>
|
47 |
-
|
48 |
-
<!--Payment Information-->
|
49 |
-
<div class="entry-edit" style="float: left;">
|
50 |
-
<div class="entry-edit-head">
|
51 |
-
<h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
|
52 |
-
</div>
|
53 |
-
<fieldset>
|
54 |
-
<div><?php echo $this->getChildHtml('order_payment') ?></div>
|
55 |
-
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
56 |
-
<?php /* if ($this->getCreditmemo()->canRefund()): ?>
|
57 |
-
<input type="checkbox" name="creditmemo[do_refund]" id="creditmemo_do_refund" value="1" checked/>
|
58 |
-
<label for="creditmemo_do_refund" class="normal"><?php echo Mage::helper('sales')->__('Refund Amount') ?></label>
|
59 |
-
<?php endif; */ ?>
|
60 |
-
</fieldset>
|
61 |
-
</div>
|
62 |
-
<!--Payment Information end-->
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
<?php if (!$_order->getIsVirtual()): ?>
|
68 |
-
<div class="box-right" style="width:100%">
|
69 |
-
<!--Shipping Address-->
|
70 |
-
<div class="entry-edit">
|
71 |
-
<div class="entry-edit-head">
|
72 |
-
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping Information') ?></h4>
|
73 |
-
</div>
|
74 |
-
<fieldset>
|
75 |
-
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
76 |
-
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
77 |
-
|
78 |
-
<?php if ($this->helper('tax')->displaySalesPriceInclTax($this->getSource()->getStoreId())): ?>
|
79 |
-
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
80 |
-
<?php else: ?>
|
81 |
-
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
82 |
-
<?php endif; ?>
|
83 |
-
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
84 |
-
|
85 |
-
<?php echo $_excl; ?>
|
86 |
-
<?php if ($this->helper('tax')->displaySalesBothPrices($this->getSource()->getStoreId()) && $_incl != $_excl): ?>
|
87 |
-
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
88 |
-
<?php endif; ?>
|
89 |
-
</fieldset>
|
90 |
-
</div>
|
91 |
-
</div>
|
92 |
-
<?php endif; ?>
|
93 |
-
<div class="clear"></div>
|
94 |
-
|
95 |
-
<div class="entry-edit">
|
96 |
-
<div class="entry-edit-head">
|
97 |
-
<h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items to Refund') ?></h4>
|
98 |
-
</div>
|
99 |
-
</div>
|
100 |
-
<div id="creditmemo_item_container">
|
101 |
-
<?php echo $this->getChildHtml('order_items') ?>
|
102 |
-
</div>
|
103 |
-
</form>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Inherited for having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
?>
|
34 |
+
|
35 |
+
<form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
|
36 |
+
<?php echo $this->getBlockHtml('formkey') ?>
|
37 |
+
<?php $_order = $this->getCreditmemo()->getOrder() ?>
|
38 |
+
<?php echo $this->getChildHtml('order_info') ?>
|
39 |
+
|
40 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
41 |
+
<div class="box-left" style="width:100%">
|
42 |
+
<?php else: ?>
|
43 |
+
<div class="box-right">
|
44 |
+
<?php endif; ?>
|
45 |
+
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<!--Payment Information-->
|
49 |
+
<div class="entry-edit" style="float: left;">
|
50 |
+
<div class="entry-edit-head">
|
51 |
+
<h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
|
52 |
+
</div>
|
53 |
+
<fieldset>
|
54 |
+
<div><?php echo $this->getChildHtml('order_payment') ?></div>
|
55 |
+
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
56 |
+
<?php /* if ($this->getCreditmemo()->canRefund()): ?>
|
57 |
+
<input type="checkbox" name="creditmemo[do_refund]" id="creditmemo_do_refund" value="1" checked/>
|
58 |
+
<label for="creditmemo_do_refund" class="normal"><?php echo Mage::helper('sales')->__('Refund Amount') ?></label>
|
59 |
+
<?php endif; */ ?>
|
60 |
+
</fieldset>
|
61 |
+
</div>
|
62 |
+
<!--Payment Information end-->
|
63 |
+
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
68 |
+
<div class="box-right" style="width:100%">
|
69 |
+
<!--Shipping Address-->
|
70 |
+
<div class="entry-edit">
|
71 |
+
<div class="entry-edit-head">
|
72 |
+
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping Information') ?></h4>
|
73 |
+
</div>
|
74 |
+
<fieldset>
|
75 |
+
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
76 |
+
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
77 |
+
|
78 |
+
<?php if ($this->helper('tax')->displaySalesPriceInclTax($this->getSource()->getStoreId())): ?>
|
79 |
+
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
80 |
+
<?php else: ?>
|
81 |
+
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
82 |
+
<?php endif; ?>
|
83 |
+
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
84 |
+
|
85 |
+
<?php echo $_excl; ?>
|
86 |
+
<?php if ($this->helper('tax')->displaySalesBothPrices($this->getSource()->getStoreId()) && $_incl != $_excl): ?>
|
87 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
88 |
+
<?php endif; ?>
|
89 |
+
</fieldset>
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
<?php endif; ?>
|
93 |
+
<div class="clear"></div>
|
94 |
+
|
95 |
+
<div class="entry-edit">
|
96 |
+
<div class="entry-edit-head">
|
97 |
+
<h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items to Refund') ?></h4>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
<div id="creditmemo_item_container">
|
101 |
+
<?php echo $this->getChildHtml('order_items') ?>
|
102 |
+
</div>
|
103 |
+
</form>
|
app/code/community/Cardconnect/Ccgateway/blocks/creditmemo/view/form.phtml
CHANGED
@@ -1,104 +1,104 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Inherited for having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
?>
|
33 |
-
|
34 |
-
<?php $_order = $this->getCreditmemo()->getOrder() ?>
|
35 |
-
<?php echo $this->getChildHtml('order_info') ?>
|
36 |
-
<?php if (!$_order->getIsVirtual()): ?>
|
37 |
-
<div class="box-left" style="width:100%">
|
38 |
-
<?php else: ?>
|
39 |
-
<div class="box-right">
|
40 |
-
<?php endif; ?>
|
41 |
-
<!--Payment Information-->
|
42 |
-
<div class="entry-edit">
|
43 |
-
<div class="entry-edit-head">
|
44 |
-
<h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
|
45 |
-
</div>
|
46 |
-
<fieldset>
|
47 |
-
<div><?php echo $this->getChildHtml('order_payment') ?></div>
|
48 |
-
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
49 |
-
</fieldset>
|
50 |
-
</div>
|
51 |
-
</div>
|
52 |
-
<?php if (!$_order->getIsVirtual()): ?>
|
53 |
-
<div class="box-right" style="width:100%">
|
54 |
-
<!--Shipping Address-->
|
55 |
-
<div class="entry-edit">
|
56 |
-
<div class="entry-edit-head">
|
57 |
-
<h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping Information') ?></h4>
|
58 |
-
</div>
|
59 |
-
<fieldset>
|
60 |
-
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
61 |
-
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
62 |
-
|
63 |
-
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
64 |
-
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
65 |
-
<?php else: ?>
|
66 |
-
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
67 |
-
<?php endif; ?>
|
68 |
-
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
69 |
-
|
70 |
-
<?php echo $_excl; ?>
|
71 |
-
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
72 |
-
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
73 |
-
<?php endif; ?>
|
74 |
-
</fieldset>
|
75 |
-
</div>
|
76 |
-
</div>
|
77 |
-
<?php endif; ?>
|
78 |
-
<div class="clear"></div>
|
79 |
-
<?php $_items = $this->getCreditmemo()->getAllItems() ?>
|
80 |
-
<div class="entry-edit">
|
81 |
-
<div class="entry-edit-head">
|
82 |
-
<h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Refunded') ?></h4>
|
83 |
-
</div>
|
84 |
-
</div>
|
85 |
-
<?php if (count($_items)): ?>
|
86 |
-
<div id="creditmemo_items_container">
|
87 |
-
<?php echo $this->getChildHtml('creditmemo_items') ?>
|
88 |
-
</div>
|
89 |
-
<?php else: ?>
|
90 |
-
<div class="entry-edit">
|
91 |
-
<fieldset><center><?php echo $this->helper('sales')->__('No Items') ?></center></fieldset>
|
92 |
-
</div>
|
93 |
-
<?php endif; ?>
|
94 |
-
<br />
|
95 |
-
<div class="box-left entry-edit">
|
96 |
-
<div class="entry-edit-head"><h4><?php echo $this->__('Credit Memo History') ?></h4></div>
|
97 |
-
<fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
|
98 |
-
</div>
|
99 |
-
|
100 |
-
<div class="box-right entry-edit" id="history_form">
|
101 |
-
<div class="entry-edit-head"><h4><?php echo $this->__('Credit Memo Totals') ?></h4></div>
|
102 |
-
<div class="order-totals"><?php echo $this->getChildHtml('creditmemo_totals') ?></div>
|
103 |
-
</div>
|
104 |
-
<div class="clear"></div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Inherited for having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
?>
|
33 |
+
|
34 |
+
<?php $_order = $this->getCreditmemo()->getOrder() ?>
|
35 |
+
<?php echo $this->getChildHtml('order_info') ?>
|
36 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
37 |
+
<div class="box-left" style="width:100%">
|
38 |
+
<?php else: ?>
|
39 |
+
<div class="box-right">
|
40 |
+
<?php endif; ?>
|
41 |
+
<!--Payment Information-->
|
42 |
+
<div class="entry-edit">
|
43 |
+
<div class="entry-edit-head">
|
44 |
+
<h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
|
45 |
+
</div>
|
46 |
+
<fieldset>
|
47 |
+
<div><?php echo $this->getChildHtml('order_payment') ?></div>
|
48 |
+
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
49 |
+
</fieldset>
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
53 |
+
<div class="box-right" style="width:100%">
|
54 |
+
<!--Shipping Address-->
|
55 |
+
<div class="entry-edit">
|
56 |
+
<div class="entry-edit-head">
|
57 |
+
<h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping Information') ?></h4>
|
58 |
+
</div>
|
59 |
+
<fieldset>
|
60 |
+
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
61 |
+
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
62 |
+
|
63 |
+
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
64 |
+
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
65 |
+
<?php else: ?>
|
66 |
+
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
67 |
+
<?php endif; ?>
|
68 |
+
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
69 |
+
|
70 |
+
<?php echo $_excl; ?>
|
71 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
72 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
73 |
+
<?php endif; ?>
|
74 |
+
</fieldset>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
<?php endif; ?>
|
78 |
+
<div class="clear"></div>
|
79 |
+
<?php $_items = $this->getCreditmemo()->getAllItems() ?>
|
80 |
+
<div class="entry-edit">
|
81 |
+
<div class="entry-edit-head">
|
82 |
+
<h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Refunded') ?></h4>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
<?php if (count($_items)): ?>
|
86 |
+
<div id="creditmemo_items_container">
|
87 |
+
<?php echo $this->getChildHtml('creditmemo_items') ?>
|
88 |
+
</div>
|
89 |
+
<?php else: ?>
|
90 |
+
<div class="entry-edit">
|
91 |
+
<fieldset><center><?php echo $this->helper('sales')->__('No Items') ?></center></fieldset>
|
92 |
+
</div>
|
93 |
+
<?php endif; ?>
|
94 |
+
<br />
|
95 |
+
<div class="box-left entry-edit">
|
96 |
+
<div class="entry-edit-head"><h4><?php echo $this->__('Credit Memo History') ?></h4></div>
|
97 |
+
<fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
|
98 |
+
</div>
|
99 |
+
|
100 |
+
<div class="box-right entry-edit" id="history_form">
|
101 |
+
<div class="entry-edit-head"><h4><?php echo $this->__('Credit Memo Totals') ?></h4></div>
|
102 |
+
<div class="order-totals"><?php echo $this->getChildHtml('creditmemo_totals') ?></div>
|
103 |
+
</div>
|
104 |
+
<div class="clear"></div>
|
app/code/community/Cardconnect/Ccgateway/blocks/info.phtml
CHANGED
@@ -1,148 +1,148 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Inherited for having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
* */
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
<?php /** @var $this Mage_Adminhtml_Block_Sales_Order_View_Tab_Info */ ?>
|
33 |
-
<?php $_order = $this->getOrder() ?>
|
34 |
-
<div>
|
35 |
-
<div id="order-messages">
|
36 |
-
<?php echo $this->getChildHtml('order_messages') ?>
|
37 |
-
</div>
|
38 |
-
<?php echo $this->getChildHtml('order_info') ?>
|
39 |
-
<input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
|
40 |
-
<?php if ($_order->getIsVirtual()): ?>
|
41 |
-
<div class="box-right">
|
42 |
-
<?php else: ?>
|
43 |
-
<div class="box-left">
|
44 |
-
<?php endif; ?>
|
45 |
-
|
46 |
-
</div>
|
47 |
-
|
48 |
-
|
49 |
-
<!--Payment Method-->
|
50 |
-
<div class="entry-edit" style="float: left;">
|
51 |
-
<div class="entry-edit-head">
|
52 |
-
<h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
|
53 |
-
</div>
|
54 |
-
<fieldset>
|
55 |
-
<div><?php echo $this->getPaymentHtml() ?></div>
|
56 |
-
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
57 |
-
</fieldset>
|
58 |
-
</div>
|
59 |
-
<!--Payment Method End-->
|
60 |
-
|
61 |
-
|
62 |
-
<div class="clear"></div>
|
63 |
-
<?php echo $this->getGiftOptionsHtml() ?>
|
64 |
-
<div class="clear"></div>
|
65 |
-
<div class="entry-edit">
|
66 |
-
<div class="entry-edit-head">
|
67 |
-
<h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
|
68 |
-
</div>
|
69 |
-
</div>
|
70 |
-
<?php echo $this->getItemsHtml() ?>
|
71 |
-
<div class="clear"></div>
|
72 |
-
|
73 |
-
|
74 |
-
<?php if (!$_order->getIsVirtual()): ?>
|
75 |
-
<div class="box-right">
|
76 |
-
<!--Shipping Method-->
|
77 |
-
<div class="entry-edit">
|
78 |
-
<div class="entry-edit-head">
|
79 |
-
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping & Handling Information') ?></h4>
|
80 |
-
</div>
|
81 |
-
<fieldset>
|
82 |
-
<?php if ($_order->getTracksCollection()->count()) : ?>
|
83 |
-
<a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>', 'trackorder', 'width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a>
|
84 |
-
<br/>
|
85 |
-
<?php endif; ?>
|
86 |
-
<?php if ($_order->getShippingDescription()): ?>
|
87 |
-
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
88 |
-
|
89 |
-
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
90 |
-
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
91 |
-
<?php else: ?>
|
92 |
-
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
93 |
-
<?php endif; ?>
|
94 |
-
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
95 |
-
|
96 |
-
<?php echo $_excl; ?>
|
97 |
-
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
98 |
-
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
99 |
-
<?php endif; ?>
|
100 |
-
<?php else: ?>
|
101 |
-
<?php echo $this->helper('sales')->__('No shipping information available'); ?>
|
102 |
-
<?php endif; ?>
|
103 |
-
</fieldset>
|
104 |
-
</div>
|
105 |
-
</div>
|
106 |
-
<?php endif; ?>
|
107 |
-
|
108 |
-
<div class="box-left">
|
109 |
-
<div class="entry-edit">
|
110 |
-
<div class="entry-edit-head">
|
111 |
-
<h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
|
112 |
-
</div>
|
113 |
-
<fieldset><?php echo $this->getChildHtml('order_history') ?></fieldset>
|
114 |
-
</div>
|
115 |
-
</div>
|
116 |
-
<div class="box-right entry-edit">
|
117 |
-
<div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
|
118 |
-
<div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
|
119 |
-
</div>
|
120 |
-
<div class="clear"></div>
|
121 |
-
</div>
|
122 |
-
|
123 |
-
<?php echo $this->getChildHtml('popup_window'); ?>
|
124 |
-
<script type="text/javascript">
|
125 |
-
//<![CDATA[
|
126 |
-
/**
|
127 |
-
* Retrieve gift options tooltip content
|
128 |
-
*/
|
129 |
-
function getGiftOptionsTooltipContent(itemId) {
|
130 |
-
var contentLines = [];
|
131 |
-
var headerLine = null;
|
132 |
-
var contentLine = null;
|
133 |
-
|
134 |
-
$$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function(element) {
|
135 |
-
if (element.down(0)) {
|
136 |
-
headerLine = element.down(0).innerHTML;
|
137 |
-
contentLine = element.down(0).next().innerHTML;
|
138 |
-
if (contentLine.length > 30) {
|
139 |
-
contentLine = contentLine.slice(0, 30) + '...';
|
140 |
-
}
|
141 |
-
contentLines.push(headerLine + ' ' + contentLine);
|
142 |
-
}
|
143 |
-
});
|
144 |
-
return contentLines.join('<br/>');
|
145 |
-
}
|
146 |
-
giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
|
147 |
-
//]]>
|
148 |
-
</script>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Inherited for having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
* */
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<?php /** @var $this Mage_Adminhtml_Block_Sales_Order_View_Tab_Info */ ?>
|
33 |
+
<?php $_order = $this->getOrder() ?>
|
34 |
+
<div>
|
35 |
+
<div id="order-messages">
|
36 |
+
<?php echo $this->getChildHtml('order_messages') ?>
|
37 |
+
</div>
|
38 |
+
<?php echo $this->getChildHtml('order_info') ?>
|
39 |
+
<input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
|
40 |
+
<?php if ($_order->getIsVirtual()): ?>
|
41 |
+
<div class="box-right">
|
42 |
+
<?php else: ?>
|
43 |
+
<div class="box-left">
|
44 |
+
<?php endif; ?>
|
45 |
+
|
46 |
+
</div>
|
47 |
+
|
48 |
+
|
49 |
+
<!--Payment Method-->
|
50 |
+
<div class="entry-edit" style="float: left;">
|
51 |
+
<div class="entry-edit-head">
|
52 |
+
<h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
|
53 |
+
</div>
|
54 |
+
<fieldset>
|
55 |
+
<div><?php echo $this->getPaymentHtml() ?></div>
|
56 |
+
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
57 |
+
</fieldset>
|
58 |
+
</div>
|
59 |
+
<!--Payment Method End-->
|
60 |
+
|
61 |
+
|
62 |
+
<div class="clear"></div>
|
63 |
+
<?php echo $this->getGiftOptionsHtml() ?>
|
64 |
+
<div class="clear"></div>
|
65 |
+
<div class="entry-edit">
|
66 |
+
<div class="entry-edit-head">
|
67 |
+
<h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
|
68 |
+
</div>
|
69 |
+
</div>
|
70 |
+
<?php echo $this->getItemsHtml() ?>
|
71 |
+
<div class="clear"></div>
|
72 |
+
|
73 |
+
|
74 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
75 |
+
<div class="box-right">
|
76 |
+
<!--Shipping Method-->
|
77 |
+
<div class="entry-edit">
|
78 |
+
<div class="entry-edit-head">
|
79 |
+
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping & Handling Information') ?></h4>
|
80 |
+
</div>
|
81 |
+
<fieldset>
|
82 |
+
<?php if ($_order->getTracksCollection()->count()) : ?>
|
83 |
+
<a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>', 'trackorder', 'width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a>
|
84 |
+
<br/>
|
85 |
+
<?php endif; ?>
|
86 |
+
<?php if ($_order->getShippingDescription()): ?>
|
87 |
+
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
88 |
+
|
89 |
+
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
90 |
+
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
91 |
+
<?php else: ?>
|
92 |
+
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
93 |
+
<?php endif; ?>
|
94 |
+
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
95 |
+
|
96 |
+
<?php echo $_excl; ?>
|
97 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
98 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
99 |
+
<?php endif; ?>
|
100 |
+
<?php else: ?>
|
101 |
+
<?php echo $this->helper('sales')->__('No shipping information available'); ?>
|
102 |
+
<?php endif; ?>
|
103 |
+
</fieldset>
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
<?php endif; ?>
|
107 |
+
|
108 |
+
<div class="box-left">
|
109 |
+
<div class="entry-edit">
|
110 |
+
<div class="entry-edit-head">
|
111 |
+
<h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
|
112 |
+
</div>
|
113 |
+
<fieldset><?php echo $this->getChildHtml('order_history') ?></fieldset>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
<div class="box-right entry-edit">
|
117 |
+
<div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
|
118 |
+
<div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
|
119 |
+
</div>
|
120 |
+
<div class="clear"></div>
|
121 |
+
</div>
|
122 |
+
|
123 |
+
<?php echo $this->getChildHtml('popup_window'); ?>
|
124 |
+
<script type="text/javascript">
|
125 |
+
//<![CDATA[
|
126 |
+
/**
|
127 |
+
* Retrieve gift options tooltip content
|
128 |
+
*/
|
129 |
+
function getGiftOptionsTooltipContent(itemId) {
|
130 |
+
var contentLines = [];
|
131 |
+
var headerLine = null;
|
132 |
+
var contentLine = null;
|
133 |
+
|
134 |
+
$$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function(element) {
|
135 |
+
if (element.down(0)) {
|
136 |
+
headerLine = element.down(0).innerHTML;
|
137 |
+
contentLine = element.down(0).next().innerHTML;
|
138 |
+
if (contentLine.length > 30) {
|
139 |
+
contentLine = contentLine.slice(0, 30) + '...';
|
140 |
+
}
|
141 |
+
contentLines.push(headerLine + ' ' + contentLine);
|
142 |
+
}
|
143 |
+
});
|
144 |
+
return contentLines.join('<br/>');
|
145 |
+
}
|
146 |
+
giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
|
147 |
+
//]]>
|
148 |
+
</script>
|
app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/form.phtml
CHANGED
@@ -1,132 +1,132 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Inherited for having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
?>
|
33 |
-
<form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
|
34 |
-
<?php echo $this->getBlockHtml('formkey') ?>
|
35 |
-
<?php $_order = $this->getInvoice()->getOrder() ?>
|
36 |
-
<?php echo $this->getChildHtml('order_info') ?>
|
37 |
-
<?php if (!$_order->getIsVirtual()): ?>
|
38 |
-
<div class="box-left" style="width:100%">
|
39 |
-
<?php else: ?>
|
40 |
-
<div class="box-right">
|
41 |
-
<?php endif; ?>
|
42 |
-
|
43 |
-
|
44 |
-
</div>
|
45 |
-
<!-- Payment info -->
|
46 |
-
<div class="entry-edit" style="float: left;" >
|
47 |
-
<div class="entry-edit-head">
|
48 |
-
<h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
|
49 |
-
</div>
|
50 |
-
<fieldset>
|
51 |
-
<div><?php echo $this->getChildHtml('order_payment') ?></div>
|
52 |
-
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
53 |
-
</fieldset>
|
54 |
-
</div>
|
55 |
-
|
56 |
-
<!-- Payment info closed -->
|
57 |
-
|
58 |
-
<?php if (!$_order->getIsVirtual()): ?>
|
59 |
-
<div class="box-right" style="width:100%">
|
60 |
-
<!--Shipping Address-->
|
61 |
-
<div class="entry-edit">
|
62 |
-
<div class="entry-edit-head">
|
63 |
-
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping Information') ?></h4>
|
64 |
-
</div>
|
65 |
-
<fieldset>
|
66 |
-
<div>
|
67 |
-
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
68 |
-
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
69 |
-
|
70 |
-
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
71 |
-
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
72 |
-
<?php else: ?>
|
73 |
-
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
74 |
-
<?php endif; ?>
|
75 |
-
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
76 |
-
|
77 |
-
<?php echo $_excl; ?>
|
78 |
-
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
79 |
-
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
80 |
-
<?php endif; ?>
|
81 |
-
</div>
|
82 |
-
<?php if ($this->canCreateShipment() && $this->canShipPartiallyItem()): ?>
|
83 |
-
<p class="nm">
|
84 |
-
<label for="invoice_do_shipment" class="normal"><?php echo Mage::helper('sales')->__('Create Shipment') ?></label>
|
85 |
-
<input type="checkbox" name="invoice[do_shipment]" id="invoice_do_shipment" value="1" <?php echo $this->hasInvoiceShipmentTypeMismatch() ? ' disabled="disabled"' : '' ?> />
|
86 |
-
</p>
|
87 |
-
<?php if ($this->hasInvoiceShipmentTypeMismatch()): ?>
|
88 |
-
<small><?php echo $this->__('Some items in this order have different invoice and shipment types. You can create shipment only after the invoice is created.') ?></small>
|
89 |
-
<?php endif; ?>
|
90 |
-
<?php endif; ?>
|
91 |
-
<div id="tracking" style="display:none;"><?php echo $this->getChildHtml('tracking', false) ?></div>
|
92 |
-
</fieldset>
|
93 |
-
</div>
|
94 |
-
</div>
|
95 |
-
<?php endif; ?>
|
96 |
-
<div class="clear"></div>
|
97 |
-
|
98 |
-
<div class="entry-edit">
|
99 |
-
<div class="entry-edit-head">
|
100 |
-
<?php
|
101 |
-
$_itemsGridLabel = $this->getForcedShipmentCreate() ? 'Items to Invoice and Ship' : 'Items to Invoice';
|
102 |
-
?>
|
103 |
-
<h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('%s', $_itemsGridLabel) ?></h4>
|
104 |
-
</div>
|
105 |
-
</div>
|
106 |
-
<div id="invoice_item_container">
|
107 |
-
<?php echo $this->getChildHtml('order_items') ?>
|
108 |
-
</div>
|
109 |
-
</form>
|
110 |
-
<script type="text/javascript">
|
111 |
-
//<![CDATA[
|
112 |
-
var createShipment = $('invoice_do_shipment');
|
113 |
-
if (createShipment) {
|
114 |
-
createShipment.observe('click', function(e) {
|
115 |
-
if (createShipment.checked) {
|
116 |
-
document.getElementById('tracking').style.display = 'block';
|
117 |
-
} else {
|
118 |
-
document.getElementById('tracking').style.display = 'none'
|
119 |
-
}
|
120 |
-
})
|
121 |
-
}
|
122 |
-
|
123 |
-
/*forced creating of shipment*/
|
124 |
-
var forcedShipmentCreate = <?php echo $this->getForcedShipmentCreate() ?>;
|
125 |
-
var shipmentElement = $('invoice_do_shipment');
|
126 |
-
if (forcedShipmentCreate && shipmentElement) {
|
127 |
-
shipmentElement.checked = true;
|
128 |
-
shipmentElement.disabled = true;
|
129 |
-
document.getElementById('tracking').style.display = 'block';
|
130 |
-
}
|
131 |
-
//]]>
|
132 |
-
</script>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Inherited for having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
?>
|
33 |
+
<form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
|
34 |
+
<?php echo $this->getBlockHtml('formkey') ?>
|
35 |
+
<?php $_order = $this->getInvoice()->getOrder() ?>
|
36 |
+
<?php echo $this->getChildHtml('order_info') ?>
|
37 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
38 |
+
<div class="box-left" style="width:100%">
|
39 |
+
<?php else: ?>
|
40 |
+
<div class="box-right">
|
41 |
+
<?php endif; ?>
|
42 |
+
|
43 |
+
|
44 |
+
</div>
|
45 |
+
<!-- Payment info -->
|
46 |
+
<div class="entry-edit" style="float: left;" >
|
47 |
+
<div class="entry-edit-head">
|
48 |
+
<h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
|
49 |
+
</div>
|
50 |
+
<fieldset>
|
51 |
+
<div><?php echo $this->getChildHtml('order_payment') ?></div>
|
52 |
+
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
53 |
+
</fieldset>
|
54 |
+
</div>
|
55 |
+
|
56 |
+
<!-- Payment info closed -->
|
57 |
+
|
58 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
59 |
+
<div class="box-right" style="width:100%">
|
60 |
+
<!--Shipping Address-->
|
61 |
+
<div class="entry-edit">
|
62 |
+
<div class="entry-edit-head">
|
63 |
+
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping Information') ?></h4>
|
64 |
+
</div>
|
65 |
+
<fieldset>
|
66 |
+
<div>
|
67 |
+
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
68 |
+
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
69 |
+
|
70 |
+
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
71 |
+
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
72 |
+
<?php else: ?>
|
73 |
+
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
74 |
+
<?php endif; ?>
|
75 |
+
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
76 |
+
|
77 |
+
<?php echo $_excl; ?>
|
78 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
79 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
80 |
+
<?php endif; ?>
|
81 |
+
</div>
|
82 |
+
<?php if ($this->canCreateShipment() && $this->canShipPartiallyItem()): ?>
|
83 |
+
<p class="nm">
|
84 |
+
<label for="invoice_do_shipment" class="normal"><?php echo Mage::helper('sales')->__('Create Shipment') ?></label>
|
85 |
+
<input type="checkbox" name="invoice[do_shipment]" id="invoice_do_shipment" value="1" <?php echo $this->hasInvoiceShipmentTypeMismatch() ? ' disabled="disabled"' : '' ?> />
|
86 |
+
</p>
|
87 |
+
<?php if ($this->hasInvoiceShipmentTypeMismatch()): ?>
|
88 |
+
<small><?php echo $this->__('Some items in this order have different invoice and shipment types. You can create shipment only after the invoice is created.') ?></small>
|
89 |
+
<?php endif; ?>
|
90 |
+
<?php endif; ?>
|
91 |
+
<div id="tracking" style="display:none;"><?php echo $this->getChildHtml('tracking', false) ?></div>
|
92 |
+
</fieldset>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
<?php endif; ?>
|
96 |
+
<div class="clear"></div>
|
97 |
+
|
98 |
+
<div class="entry-edit">
|
99 |
+
<div class="entry-edit-head">
|
100 |
+
<?php
|
101 |
+
$_itemsGridLabel = $this->getForcedShipmentCreate() ? 'Items to Invoice and Ship' : 'Items to Invoice';
|
102 |
+
?>
|
103 |
+
<h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('%s', $_itemsGridLabel) ?></h4>
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
<div id="invoice_item_container">
|
107 |
+
<?php echo $this->getChildHtml('order_items') ?>
|
108 |
+
</div>
|
109 |
+
</form>
|
110 |
+
<script type="text/javascript">
|
111 |
+
//<![CDATA[
|
112 |
+
var createShipment = $('invoice_do_shipment');
|
113 |
+
if (createShipment) {
|
114 |
+
createShipment.observe('click', function(e) {
|
115 |
+
if (createShipment.checked) {
|
116 |
+
document.getElementById('tracking').style.display = 'block';
|
117 |
+
} else {
|
118 |
+
document.getElementById('tracking').style.display = 'none'
|
119 |
+
}
|
120 |
+
})
|
121 |
+
}
|
122 |
+
|
123 |
+
/*forced creating of shipment*/
|
124 |
+
var forcedShipmentCreate = <?php echo $this->getForcedShipmentCreate() ?>;
|
125 |
+
var shipmentElement = $('invoice_do_shipment');
|
126 |
+
if (forcedShipmentCreate && shipmentElement) {
|
127 |
+
shipmentElement.checked = true;
|
128 |
+
shipmentElement.disabled = true;
|
129 |
+
document.getElementById('tracking').style.display = 'block';
|
130 |
+
}
|
131 |
+
//]]>
|
132 |
+
</script>
|
app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/items.phtml
CHANGED
@@ -1,209 +1,209 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Inherited for having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
?>
|
33 |
-
<div class="grid np">
|
34 |
-
<div class="hor-scroll">
|
35 |
-
<table cellspacing="0" class="data order-tables">
|
36 |
-
<col />
|
37 |
-
<col width="1" />
|
38 |
-
<col width="1" />
|
39 |
-
<col width="1" />
|
40 |
-
<col width="1" />
|
41 |
-
<col width="1" />
|
42 |
-
<col width="1" />
|
43 |
-
<col width="1" />
|
44 |
-
<thead>
|
45 |
-
<tr class="headings">
|
46 |
-
<th><?php echo Mage::helper('sales')->__('Product') ?></th>
|
47 |
-
<th><?php echo Mage::helper('sales')->__('Price') ?></th>
|
48 |
-
<th class="a-center"><?php echo Mage::helper('sales')->__('Qty') ?></th>
|
49 |
-
<th><span class="nobr"><?php echo Mage::helper('sales')->__('Qty to Invoice') ?></span></th>
|
50 |
-
<th><?php echo Mage::helper('sales')->__('Subtotal') ?></th>
|
51 |
-
<th><span class="nobr"><?php echo Mage::helper('sales')->__('Tax Amount') ?></span></th>
|
52 |
-
<th><span class="nobr"><?php echo Mage::helper('sales')->__('Discount Amount') ?></span></th>
|
53 |
-
<th class="last"><span class="nobr"><?php echo Mage::helper('sales')->__('Row Total') ?></span></th>
|
54 |
-
</tr>
|
55 |
-
</thead>
|
56 |
-
<?php if ($this->canEditQty()): ?>
|
57 |
-
<tfoot>
|
58 |
-
<tr>
|
59 |
-
<td colspan="2"> </td>
|
60 |
-
<td colspan="3" class="a-center"><?php echo $this->getUpdateButtonHtml() ?></td>
|
61 |
-
<td colspan="3"> </td>
|
62 |
-
</tr>
|
63 |
-
</tfoot>
|
64 |
-
<?php endif; ?>
|
65 |
-
<?php $_items = $this->getInvoice()->getAllItems() ?>
|
66 |
-
<?php $_i=0;foreach ($_items as $_item): ?>
|
67 |
-
<?php if ($_item->getOrderItem()->getParentItem()) continue; else $_i++; ?>
|
68 |
-
<tbody class="<?php echo $_i%2?'even':'odd' ?>">
|
69 |
-
<?php echo $this->getItemHtml($_item) ?>
|
70 |
-
<?php echo $this->getItemExtraInfoHtml($_item->getOrderItem()) ?>
|
71 |
-
</tbody>
|
72 |
-
<?php endforeach; ?>
|
73 |
-
</table>
|
74 |
-
</div>
|
75 |
-
</div>
|
76 |
-
<br />
|
77 |
-
<div class="clear"></div>
|
78 |
-
<?php echo $this->getChildHtml('order_totalbar') ?>
|
79 |
-
<div class="clear"></div>
|
80 |
-
|
81 |
-
<div class="box-left entry-edit">
|
82 |
-
<div class="entry-edit-head"><h4><?php echo $this->__('Invoice History') ?></h4></div>
|
83 |
-
<fieldset>
|
84 |
-
<div id="history_form" class="order-history-form">
|
85 |
-
<span class="field-row">
|
86 |
-
<label class="normal" for="invoice_comment_text"><?php echo Mage::helper('sales')->__('Invoice Comments') ?></label>
|
87 |
-
<textarea id="invoice_comment_text" name="invoice[comment_text]" rows="3" cols="5" style="height:10em; width:98%;"><?php echo $this->getInvoice()->getCommentText(); ?></textarea>
|
88 |
-
</span>
|
89 |
-
<div class="clear"></div>
|
90 |
-
</div>
|
91 |
-
</fieldset>
|
92 |
-
</div>
|
93 |
-
|
94 |
-
|
95 |
-
<div class="box-right entry-edit" id="invoice_totals">
|
96 |
-
<div class="entry-edit-head"><h4><?php echo $this->__('Invoice Totals') ?></h4></div>
|
97 |
-
<div class="order-totals">
|
98 |
-
<?php echo $this->getChildHtml('invoice_totals') ?>
|
99 |
-
<div class="order-totals-bottom">
|
100 |
-
<div class="divider"></div>
|
101 |
-
<?php if ($this->isCaptureAllowed()): ?>
|
102 |
-
<?php if ($this->canCapture()):?>
|
103 |
-
<p>
|
104 |
-
<!--
|
105 |
-
<label for="invoice_do_capture" class="normal"><?php echo Mage::helper('sales')->__('Capture Amount') ?></label>
|
106 |
-
<input type="checkbox" name="invoice[do_capture]" id="invoice_do_capture" value="1" checked/>
|
107 |
-
-->
|
108 |
-
<label for="invoice_do_capture" class="normal"><?php echo Mage::helper('sales')->__('Amount') ?></label>
|
109 |
-
<select name="invoice[capture_case]">
|
110 |
-
<option value="online"><?php echo Mage::helper('sales')->__('Capture Online') ?></option>
|
111 |
-
<!--<option value="offline"><?php echo Mage::helper('sales')->__('Capture Offline') ?></option>-->
|
112 |
-
<option value="not_capture"><?php echo Mage::helper('sales')->__('Not Capture') ?></option>
|
113 |
-
</select>
|
114 |
-
</p>
|
115 |
-
<?php elseif ($this->isGatewayUsed()):?>
|
116 |
-
<input type="hidden" name="invoice[capture_case]" value="offline"/>
|
117 |
-
<p><?php echo Mage::helper('sales')->__('Invoice will be created without communication with payment gateway.') ?></p>
|
118 |
-
<?php endif?>
|
119 |
-
<?php endif; ?>
|
120 |
-
<p>
|
121 |
-
<label class="normal" for="notify_customer"><?php echo Mage::helper('sales')->__('Append Comments') ?></label>
|
122 |
-
<input id="notify_customer" name="invoice[comment_customer_notify]" value="1" type="checkbox" />
|
123 |
-
</p>
|
124 |
-
<?php if ($this->canSendInvoiceEmail()): ?>
|
125 |
-
<p>
|
126 |
-
<label class="normal" for="send_email"><?php echo Mage::helper('sales')->__('Email Copy of Invoice') ?></label>
|
127 |
-
<input id="send_email" name="invoice[send_email]" value="1" type="checkbox" />
|
128 |
-
</p>
|
129 |
-
<?php endif; ?>
|
130 |
-
<div class="a-right">
|
131 |
-
<?php echo $this->getChildHtml('submit_button') ?>
|
132 |
-
</div>
|
133 |
-
</div>
|
134 |
-
</div>
|
135 |
-
</div>
|
136 |
-
|
137 |
-
<div class="clear"></div>
|
138 |
-
|
139 |
-
<table class="order-info-foot" cellpadding="10" cellspacing="0" width="100%">
|
140 |
-
<tbody>
|
141 |
-
<tr>
|
142 |
-
<td class="section">
|
143 |
-
<table id="comments_block" cellpadding="0" width="100%">
|
144 |
-
<tbody>
|
145 |
-
<tr>
|
146 |
-
<td style="padding-right:30px; width:50%;"> </td>
|
147 |
-
<td> </td>
|
148 |
-
</tr>
|
149 |
-
</tbody>
|
150 |
-
</table>
|
151 |
-
</td>
|
152 |
-
<td class="document-totals section"> </td>
|
153 |
-
</tr>
|
154 |
-
</tbody>
|
155 |
-
</table>
|
156 |
-
|
157 |
-
<script type="text/javascript">
|
158 |
-
//<![CDATA[
|
159 |
-
var submitButtons = $$('.submit-button');
|
160 |
-
var updateButtons = $$('.update-button');
|
161 |
-
var enableSubmitButtons = <?php echo (int) !$this->getDisableSubmitButton() ?>;
|
162 |
-
var fields = $$('.qty-input');
|
163 |
-
|
164 |
-
updateButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
|
165 |
-
|
166 |
-
for(var i=0;i<fields.length;i++){
|
167 |
-
fields[i].observe('change', checkButtonsRelation)
|
168 |
-
fields[i].baseValue = fields[i].value;
|
169 |
-
}
|
170 |
-
|
171 |
-
function checkButtonsRelation() {
|
172 |
-
var hasChanges = false;
|
173 |
-
fields.each(function (elem) {
|
174 |
-
if (elem.baseValue != elem.value) {
|
175 |
-
hasChanges = true;
|
176 |
-
}
|
177 |
-
}.bind(this));
|
178 |
-
if (hasChanges) {
|
179 |
-
submitButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
|
180 |
-
updateButtons.each(function (elem) {elem.disabled=false;elem.removeClassName('disabled');});
|
181 |
-
}
|
182 |
-
else {
|
183 |
-
if (enableSubmitButtons) {
|
184 |
-
submitButtons.each(function (elem) {elem.disabled=false;elem.removeClassName('disabled');});
|
185 |
-
}
|
186 |
-
updateButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
|
187 |
-
}
|
188 |
-
}
|
189 |
-
|
190 |
-
var sendEmailCheckbox = $('send_email');
|
191 |
-
if (sendEmailCheckbox) {
|
192 |
-
var notifyCustomerCheckbox = $('notify_customer');
|
193 |
-
var invoiceCommentText = $('invoice_comment_text');
|
194 |
-
Event.observe(sendEmailCheckbox, 'change', bindSendEmail);
|
195 |
-
bindSendEmail();
|
196 |
-
}
|
197 |
-
function bindSendEmail()
|
198 |
-
{
|
199 |
-
if (sendEmailCheckbox.checked == true) {
|
200 |
-
notifyCustomerCheckbox.disabled = false;
|
201 |
-
//invoiceCommentText.disabled = false;
|
202 |
-
}
|
203 |
-
else {
|
204 |
-
notifyCustomerCheckbox.disabled = true;
|
205 |
-
//invoiceCommentText.disabled = true;
|
206 |
-
}
|
207 |
-
}
|
208 |
-
//]]>
|
209 |
-
</script>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Inherited for having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
?>
|
33 |
+
<div class="grid np">
|
34 |
+
<div class="hor-scroll">
|
35 |
+
<table cellspacing="0" class="data order-tables">
|
36 |
+
<col />
|
37 |
+
<col width="1" />
|
38 |
+
<col width="1" />
|
39 |
+
<col width="1" />
|
40 |
+
<col width="1" />
|
41 |
+
<col width="1" />
|
42 |
+
<col width="1" />
|
43 |
+
<col width="1" />
|
44 |
+
<thead>
|
45 |
+
<tr class="headings">
|
46 |
+
<th><?php echo Mage::helper('sales')->__('Product') ?></th>
|
47 |
+
<th><?php echo Mage::helper('sales')->__('Price') ?></th>
|
48 |
+
<th class="a-center"><?php echo Mage::helper('sales')->__('Qty') ?></th>
|
49 |
+
<th><span class="nobr"><?php echo Mage::helper('sales')->__('Qty to Invoice') ?></span></th>
|
50 |
+
<th><?php echo Mage::helper('sales')->__('Subtotal') ?></th>
|
51 |
+
<th><span class="nobr"><?php echo Mage::helper('sales')->__('Tax Amount') ?></span></th>
|
52 |
+
<th><span class="nobr"><?php echo Mage::helper('sales')->__('Discount Amount') ?></span></th>
|
53 |
+
<th class="last"><span class="nobr"><?php echo Mage::helper('sales')->__('Row Total') ?></span></th>
|
54 |
+
</tr>
|
55 |
+
</thead>
|
56 |
+
<?php if ($this->canEditQty()): ?>
|
57 |
+
<tfoot>
|
58 |
+
<tr>
|
59 |
+
<td colspan="2"> </td>
|
60 |
+
<td colspan="3" class="a-center"><?php echo $this->getUpdateButtonHtml() ?></td>
|
61 |
+
<td colspan="3"> </td>
|
62 |
+
</tr>
|
63 |
+
</tfoot>
|
64 |
+
<?php endif; ?>
|
65 |
+
<?php $_items = $this->getInvoice()->getAllItems() ?>
|
66 |
+
<?php $_i=0;foreach ($_items as $_item): ?>
|
67 |
+
<?php if ($_item->getOrderItem()->getParentItem()) continue; else $_i++; ?>
|
68 |
+
<tbody class="<?php echo $_i%2?'even':'odd' ?>">
|
69 |
+
<?php echo $this->getItemHtml($_item) ?>
|
70 |
+
<?php echo $this->getItemExtraInfoHtml($_item->getOrderItem()) ?>
|
71 |
+
</tbody>
|
72 |
+
<?php endforeach; ?>
|
73 |
+
</table>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
<br />
|
77 |
+
<div class="clear"></div>
|
78 |
+
<?php echo $this->getChildHtml('order_totalbar') ?>
|
79 |
+
<div class="clear"></div>
|
80 |
+
|
81 |
+
<div class="box-left entry-edit">
|
82 |
+
<div class="entry-edit-head"><h4><?php echo $this->__('Invoice History') ?></h4></div>
|
83 |
+
<fieldset>
|
84 |
+
<div id="history_form" class="order-history-form">
|
85 |
+
<span class="field-row">
|
86 |
+
<label class="normal" for="invoice_comment_text"><?php echo Mage::helper('sales')->__('Invoice Comments') ?></label>
|
87 |
+
<textarea id="invoice_comment_text" name="invoice[comment_text]" rows="3" cols="5" style="height:10em; width:98%;"><?php echo $this->getInvoice()->getCommentText(); ?></textarea>
|
88 |
+
</span>
|
89 |
+
<div class="clear"></div>
|
90 |
+
</div>
|
91 |
+
</fieldset>
|
92 |
+
</div>
|
93 |
+
|
94 |
+
|
95 |
+
<div class="box-right entry-edit" id="invoice_totals">
|
96 |
+
<div class="entry-edit-head"><h4><?php echo $this->__('Invoice Totals') ?></h4></div>
|
97 |
+
<div class="order-totals">
|
98 |
+
<?php echo $this->getChildHtml('invoice_totals') ?>
|
99 |
+
<div class="order-totals-bottom">
|
100 |
+
<div class="divider"></div>
|
101 |
+
<?php if ($this->isCaptureAllowed()): ?>
|
102 |
+
<?php if ($this->canCapture()):?>
|
103 |
+
<p>
|
104 |
+
<!--
|
105 |
+
<label for="invoice_do_capture" class="normal"><?php echo Mage::helper('sales')->__('Capture Amount') ?></label>
|
106 |
+
<input type="checkbox" name="invoice[do_capture]" id="invoice_do_capture" value="1" checked/>
|
107 |
+
-->
|
108 |
+
<label for="invoice_do_capture" class="normal"><?php echo Mage::helper('sales')->__('Amount') ?></label>
|
109 |
+
<select name="invoice[capture_case]">
|
110 |
+
<option value="online"><?php echo Mage::helper('sales')->__('Capture Online') ?></option>
|
111 |
+
<!--<option value="offline"><?php echo Mage::helper('sales')->__('Capture Offline') ?></option>-->
|
112 |
+
<option value="not_capture"><?php echo Mage::helper('sales')->__('Not Capture') ?></option>
|
113 |
+
</select>
|
114 |
+
</p>
|
115 |
+
<?php elseif ($this->isGatewayUsed()):?>
|
116 |
+
<input type="hidden" name="invoice[capture_case]" value="offline"/>
|
117 |
+
<p><?php echo Mage::helper('sales')->__('Invoice will be created without communication with payment gateway.') ?></p>
|
118 |
+
<?php endif?>
|
119 |
+
<?php endif; ?>
|
120 |
+
<p>
|
121 |
+
<label class="normal" for="notify_customer"><?php echo Mage::helper('sales')->__('Append Comments') ?></label>
|
122 |
+
<input id="notify_customer" name="invoice[comment_customer_notify]" value="1" type="checkbox" />
|
123 |
+
</p>
|
124 |
+
<?php if ($this->canSendInvoiceEmail()): ?>
|
125 |
+
<p>
|
126 |
+
<label class="normal" for="send_email"><?php echo Mage::helper('sales')->__('Email Copy of Invoice') ?></label>
|
127 |
+
<input id="send_email" name="invoice[send_email]" value="1" type="checkbox" />
|
128 |
+
</p>
|
129 |
+
<?php endif; ?>
|
130 |
+
<div class="a-right">
|
131 |
+
<?php echo $this->getChildHtml('submit_button') ?>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
</div>
|
135 |
+
</div>
|
136 |
+
|
137 |
+
<div class="clear"></div>
|
138 |
+
|
139 |
+
<table class="order-info-foot" cellpadding="10" cellspacing="0" width="100%">
|
140 |
+
<tbody>
|
141 |
+
<tr>
|
142 |
+
<td class="section">
|
143 |
+
<table id="comments_block" cellpadding="0" width="100%">
|
144 |
+
<tbody>
|
145 |
+
<tr>
|
146 |
+
<td style="padding-right:30px; width:50%;"> </td>
|
147 |
+
<td> </td>
|
148 |
+
</tr>
|
149 |
+
</tbody>
|
150 |
+
</table>
|
151 |
+
</td>
|
152 |
+
<td class="document-totals section"> </td>
|
153 |
+
</tr>
|
154 |
+
</tbody>
|
155 |
+
</table>
|
156 |
+
|
157 |
+
<script type="text/javascript">
|
158 |
+
//<![CDATA[
|
159 |
+
var submitButtons = $$('.submit-button');
|
160 |
+
var updateButtons = $$('.update-button');
|
161 |
+
var enableSubmitButtons = <?php echo (int) !$this->getDisableSubmitButton() ?>;
|
162 |
+
var fields = $$('.qty-input');
|
163 |
+
|
164 |
+
updateButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
|
165 |
+
|
166 |
+
for(var i=0;i<fields.length;i++){
|
167 |
+
fields[i].observe('change', checkButtonsRelation)
|
168 |
+
fields[i].baseValue = fields[i].value;
|
169 |
+
}
|
170 |
+
|
171 |
+
function checkButtonsRelation() {
|
172 |
+
var hasChanges = false;
|
173 |
+
fields.each(function (elem) {
|
174 |
+
if (elem.baseValue != elem.value) {
|
175 |
+
hasChanges = true;
|
176 |
+
}
|
177 |
+
}.bind(this));
|
178 |
+
if (hasChanges) {
|
179 |
+
submitButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
|
180 |
+
updateButtons.each(function (elem) {elem.disabled=false;elem.removeClassName('disabled');});
|
181 |
+
}
|
182 |
+
else {
|
183 |
+
if (enableSubmitButtons) {
|
184 |
+
submitButtons.each(function (elem) {elem.disabled=false;elem.removeClassName('disabled');});
|
185 |
+
}
|
186 |
+
updateButtons.each(function (elem) {elem.disabled=true;elem.addClassName('disabled');});
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
var sendEmailCheckbox = $('send_email');
|
191 |
+
if (sendEmailCheckbox) {
|
192 |
+
var notifyCustomerCheckbox = $('notify_customer');
|
193 |
+
var invoiceCommentText = $('invoice_comment_text');
|
194 |
+
Event.observe(sendEmailCheckbox, 'change', bindSendEmail);
|
195 |
+
bindSendEmail();
|
196 |
+
}
|
197 |
+
function bindSendEmail()
|
198 |
+
{
|
199 |
+
if (sendEmailCheckbox.checked == true) {
|
200 |
+
notifyCustomerCheckbox.disabled = false;
|
201 |
+
//invoiceCommentText.disabled = false;
|
202 |
+
}
|
203 |
+
else {
|
204 |
+
notifyCustomerCheckbox.disabled = true;
|
205 |
+
//invoiceCommentText.disabled = true;
|
206 |
+
}
|
207 |
+
}
|
208 |
+
//]]>
|
209 |
+
</script>
|
app/code/community/Cardconnect/Ccgateway/blocks/invoice/view/form.phtml
CHANGED
@@ -1,101 +1,101 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Inherited for having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
?>
|
33 |
-
|
34 |
-
<?php $_invoice = $this->getInvoice() ?>
|
35 |
-
<?php $_order = $_invoice->getOrder() ?>
|
36 |
-
<?php echo $this->getChildHtml('order_info') ?>
|
37 |
-
<?php if (!$_order->getIsVirtual()): ?>
|
38 |
-
<div class="box-left" style="width:100%">
|
39 |
-
<?php else: ?>
|
40 |
-
<div class="box-right">
|
41 |
-
<?php endif; ?>
|
42 |
-
<!--Payment info-->
|
43 |
-
|
44 |
-
</div>
|
45 |
-
<div class="entry-edit" style="float: left;">
|
46 |
-
<div class="entry-edit-head">
|
47 |
-
<h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
|
48 |
-
</div>
|
49 |
-
<fieldset>
|
50 |
-
<div><?php echo $this->getChildHtml('order_payment') ?></div>
|
51 |
-
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
52 |
-
</fieldset>
|
53 |
-
</div>
|
54 |
-
<?php if (!$_order->getIsVirtual()): ?>
|
55 |
-
<div class="box-right" style="width:100%">
|
56 |
-
<!--Shipping Address-->
|
57 |
-
<div class="entry-edit">
|
58 |
-
<div class="entry-edit-head">
|
59 |
-
<h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping Information') ?></h4>
|
60 |
-
</div>
|
61 |
-
<fieldset>
|
62 |
-
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
63 |
-
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
64 |
-
|
65 |
-
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
66 |
-
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
67 |
-
<?php else: ?>
|
68 |
-
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
69 |
-
<?php endif; ?>
|
70 |
-
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
71 |
-
|
72 |
-
<?php echo $_excl; ?>
|
73 |
-
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
74 |
-
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
75 |
-
<?php endif; ?>
|
76 |
-
<div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
|
77 |
-
</fieldset>
|
78 |
-
</div>
|
79 |
-
<?php endif; ?>
|
80 |
-
</div>
|
81 |
-
<div class="clear"></div>
|
82 |
-
|
83 |
-
<div class="entry-edit">
|
84 |
-
<div class="entry-edit-head">
|
85 |
-
<h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Invoiced') ?></h4>
|
86 |
-
</div>
|
87 |
-
<div id="invoice_item_container">
|
88 |
-
<?php echo $this->getChildHtml('invoice_items') ?>
|
89 |
-
</div>
|
90 |
-
</div>
|
91 |
-
|
92 |
-
<div class="box-left entry-edit">
|
93 |
-
<div class="entry-edit-head"><h4><?php echo $this->__('Invoice History') ?></h4></div>
|
94 |
-
<fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
|
95 |
-
</div>
|
96 |
-
|
97 |
-
<div class="box-right entry-edit" id="history_form">
|
98 |
-
<div class="entry-edit-head"><h4><?php echo $this->__('Invoice Totals') ?></h4></div>
|
99 |
-
<div class="order-totals"><?php echo $this->getChildHtml('invoice_totals') ?></div>
|
100 |
-
</div>
|
101 |
-
<div class="clear"></div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Inherited for having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
?>
|
33 |
+
|
34 |
+
<?php $_invoice = $this->getInvoice() ?>
|
35 |
+
<?php $_order = $_invoice->getOrder() ?>
|
36 |
+
<?php echo $this->getChildHtml('order_info') ?>
|
37 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
38 |
+
<div class="box-left" style="width:100%">
|
39 |
+
<?php else: ?>
|
40 |
+
<div class="box-right">
|
41 |
+
<?php endif; ?>
|
42 |
+
<!--Payment info-->
|
43 |
+
|
44 |
+
</div>
|
45 |
+
<div class="entry-edit" style="float: left;">
|
46 |
+
<div class="entry-edit-head">
|
47 |
+
<h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
|
48 |
+
</div>
|
49 |
+
<fieldset>
|
50 |
+
<div><?php echo $this->getChildHtml('order_payment') ?></div>
|
51 |
+
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
52 |
+
</fieldset>
|
53 |
+
</div>
|
54 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
55 |
+
<div class="box-right" style="width:100%">
|
56 |
+
<!--Shipping Address-->
|
57 |
+
<div class="entry-edit">
|
58 |
+
<div class="entry-edit-head">
|
59 |
+
<h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping Information') ?></h4>
|
60 |
+
</div>
|
61 |
+
<fieldset>
|
62 |
+
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
63 |
+
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
64 |
+
|
65 |
+
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
66 |
+
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
67 |
+
<?php else: ?>
|
68 |
+
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
69 |
+
<?php endif; ?>
|
70 |
+
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
71 |
+
|
72 |
+
<?php echo $_excl; ?>
|
73 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
74 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
75 |
+
<?php endif; ?>
|
76 |
+
<div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
|
77 |
+
</fieldset>
|
78 |
+
</div>
|
79 |
+
<?php endif; ?>
|
80 |
+
</div>
|
81 |
+
<div class="clear"></div>
|
82 |
+
|
83 |
+
<div class="entry-edit">
|
84 |
+
<div class="entry-edit-head">
|
85 |
+
<h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Invoiced') ?></h4>
|
86 |
+
</div>
|
87 |
+
<div id="invoice_item_container">
|
88 |
+
<?php echo $this->getChildHtml('invoice_items') ?>
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
+
|
92 |
+
<div class="box-left entry-edit">
|
93 |
+
<div class="entry-edit-head"><h4><?php echo $this->__('Invoice History') ?></h4></div>
|
94 |
+
<fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
|
95 |
+
</div>
|
96 |
+
|
97 |
+
<div class="box-right entry-edit" id="history_form">
|
98 |
+
<div class="entry-edit-head"><h4><?php echo $this->__('Invoice Totals') ?></h4></div>
|
99 |
+
<div class="order-totals"><?php echo $this->getChildHtml('invoice_totals') ?></div>
|
100 |
+
</div>
|
101 |
+
<div class="clear"></div>
|
app/code/community/Cardconnect/Ccgateway/blocks/shipment/create/form.phtml
CHANGED
@@ -1,120 +1,120 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Inherited for having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
* */
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
<form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
|
33 |
-
<?php echo $this->getBlockHtml('formkey') ?>
|
34 |
-
<?php $_order = $this->getShipment()->getOrder() ?>
|
35 |
-
<?php echo $this->getChildHtml('order_info') ?>
|
36 |
-
|
37 |
-
|
38 |
-
<div class="box-left" style="width:100%">
|
39 |
-
<!--Billing Address-->
|
40 |
-
<div class="entry-edit">
|
41 |
-
<div class="entry-edit-head">
|
42 |
-
<h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
|
43 |
-
</div>
|
44 |
-
<fieldset>
|
45 |
-
<div><?php echo $this->getPaymentHtml() ?></div>
|
46 |
-
<div><?php echo Mage::helper('sales')->__('The order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
47 |
-
</fieldset>
|
48 |
-
</div>
|
49 |
-
</div>
|
50 |
-
<div class="box-right" style="width:100%">
|
51 |
-
<!--Shipping Address-->
|
52 |
-
<div class="entry-edit">
|
53 |
-
<div class="entry-edit-head">
|
54 |
-
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping Information') ?></h4>
|
55 |
-
</div>
|
56 |
-
<fieldset>
|
57 |
-
<div>
|
58 |
-
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
59 |
-
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
60 |
-
|
61 |
-
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
62 |
-
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
63 |
-
<?php else: ?>
|
64 |
-
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
65 |
-
<?php endif; ?>
|
66 |
-
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
67 |
-
|
68 |
-
<?php echo $_excl; ?>
|
69 |
-
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
70 |
-
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
71 |
-
<?php endif; ?>
|
72 |
-
</div>
|
73 |
-
<div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
|
74 |
-
</fieldset>
|
75 |
-
</div>
|
76 |
-
</div>
|
77 |
-
<div class="clear"></div>
|
78 |
-
|
79 |
-
<div class="entry-edit">
|
80 |
-
<div class="entry-edit-head">
|
81 |
-
<h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items to Ship') ?></h4>
|
82 |
-
</div>
|
83 |
-
</div>
|
84 |
-
<div id="ship_items_container">
|
85 |
-
<?php echo $this->getItemsHtml() ?>
|
86 |
-
</div>
|
87 |
-
</form>
|
88 |
-
<?php echo $this->getChildHtml('shipment_packaging') ?>
|
89 |
-
<script type="text/javascript">
|
90 |
-
//<![CDATA[
|
91 |
-
document.observe("dom:loaded", function() {
|
92 |
-
setTimeout(function() {
|
93 |
-
packaging.setConfirmPackagingCallback(function() {
|
94 |
-
packaging.setParamsCreateLabelRequest($('edit_form').serialize(true));
|
95 |
-
packaging.sendCreateLabelRequest();
|
96 |
-
});
|
97 |
-
packaging.setLabelCreatedCallback(function(response) {
|
98 |
-
setLocation("<?php
|
99 |
-
echo $this->getUrl(
|
100 |
-
'*/sales_order/view', array('order_id' => $this->getShipment()->getOrderId())
|
101 |
-
);
|
102 |
-
?>");
|
103 |
-
});
|
104 |
-
packaging.setCancelCallback(function() {
|
105 |
-
packaging.cleanPackages();
|
106 |
-
$('create_shipping_label').checked = false;
|
107 |
-
toggleCreateLabelCheckbox();
|
108 |
-
});
|
109 |
-
packaging.setItemQtyCallback(function(itemId) {
|
110 |
-
var item = $$('[name="shipment[items][' + itemId + ']"]')[0];
|
111 |
-
if (item && !isNaN(item.value)) {
|
112 |
-
return item.value;
|
113 |
-
}
|
114 |
-
});
|
115 |
-
}, 500);
|
116 |
-
});
|
117 |
-
|
118 |
-
editForm = new varienForm('edit_form');
|
119 |
-
//]]>
|
120 |
-
</script>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Inherited for having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
* */
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
|
33 |
+
<?php echo $this->getBlockHtml('formkey') ?>
|
34 |
+
<?php $_order = $this->getShipment()->getOrder() ?>
|
35 |
+
<?php echo $this->getChildHtml('order_info') ?>
|
36 |
+
|
37 |
+
|
38 |
+
<div class="box-left" style="width:100%">
|
39 |
+
<!--Billing Address-->
|
40 |
+
<div class="entry-edit">
|
41 |
+
<div class="entry-edit-head">
|
42 |
+
<h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
|
43 |
+
</div>
|
44 |
+
<fieldset>
|
45 |
+
<div><?php echo $this->getPaymentHtml() ?></div>
|
46 |
+
<div><?php echo Mage::helper('sales')->__('The order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
47 |
+
</fieldset>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
<div class="box-right" style="width:100%">
|
51 |
+
<!--Shipping Address-->
|
52 |
+
<div class="entry-edit">
|
53 |
+
<div class="entry-edit-head">
|
54 |
+
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping Information') ?></h4>
|
55 |
+
</div>
|
56 |
+
<fieldset>
|
57 |
+
<div>
|
58 |
+
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
59 |
+
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
60 |
+
|
61 |
+
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
62 |
+
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
63 |
+
<?php else: ?>
|
64 |
+
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
65 |
+
<?php endif; ?>
|
66 |
+
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
67 |
+
|
68 |
+
<?php echo $_excl; ?>
|
69 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
70 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
71 |
+
<?php endif; ?>
|
72 |
+
</div>
|
73 |
+
<div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
|
74 |
+
</fieldset>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
<div class="clear"></div>
|
78 |
+
|
79 |
+
<div class="entry-edit">
|
80 |
+
<div class="entry-edit-head">
|
81 |
+
<h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items to Ship') ?></h4>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
<div id="ship_items_container">
|
85 |
+
<?php echo $this->getItemsHtml() ?>
|
86 |
+
</div>
|
87 |
+
</form>
|
88 |
+
<?php echo $this->getChildHtml('shipment_packaging') ?>
|
89 |
+
<script type="text/javascript">
|
90 |
+
//<![CDATA[
|
91 |
+
document.observe("dom:loaded", function() {
|
92 |
+
setTimeout(function() {
|
93 |
+
packaging.setConfirmPackagingCallback(function() {
|
94 |
+
packaging.setParamsCreateLabelRequest($('edit_form').serialize(true));
|
95 |
+
packaging.sendCreateLabelRequest();
|
96 |
+
});
|
97 |
+
packaging.setLabelCreatedCallback(function(response) {
|
98 |
+
setLocation("<?php
|
99 |
+
echo $this->getUrl(
|
100 |
+
'*/sales_order/view', array('order_id' => $this->getShipment()->getOrderId())
|
101 |
+
);
|
102 |
+
?>");
|
103 |
+
});
|
104 |
+
packaging.setCancelCallback(function() {
|
105 |
+
packaging.cleanPackages();
|
106 |
+
$('create_shipping_label').checked = false;
|
107 |
+
toggleCreateLabelCheckbox();
|
108 |
+
});
|
109 |
+
packaging.setItemQtyCallback(function(itemId) {
|
110 |
+
var item = $$('[name="shipment[items][' + itemId + ']"]')[0];
|
111 |
+
if (item && !isNaN(item.value)) {
|
112 |
+
return item.value;
|
113 |
+
}
|
114 |
+
});
|
115 |
+
}, 500);
|
116 |
+
});
|
117 |
+
|
118 |
+
editForm = new varienForm('edit_form');
|
119 |
+
//]]>
|
120 |
+
</script>
|
app/code/community/Cardconnect/Ccgateway/blocks/shipment/view/form.phtml
CHANGED
@@ -1,123 +1,123 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Inherited for having additonal info.
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
* */
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
<?php $_order = $this->getShipment()->getOrder() ?>
|
33 |
-
<?php echo $this->getChildHtml('order_info') ?>
|
34 |
-
|
35 |
-
<div class="box-left" style="width:100%">
|
36 |
-
<!--Billing Address-->
|
37 |
-
<div class="entry-edit">
|
38 |
-
<div class="entry-edit-head">
|
39 |
-
<h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
|
40 |
-
</div>
|
41 |
-
<fieldset>
|
42 |
-
<div><?php echo $this->getChildHtml('order_payment') ?></div>
|
43 |
-
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
44 |
-
</fieldset>
|
45 |
-
</div>
|
46 |
-
</div>
|
47 |
-
<div class="box-right" style="width:100%">
|
48 |
-
<!--Shipping Address-->
|
49 |
-
<div class="entry-edit">
|
50 |
-
<div class="entry-edit-head">
|
51 |
-
<h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping and Tracking Information') ?></h4>
|
52 |
-
</div>
|
53 |
-
<fieldset>
|
54 |
-
<div>
|
55 |
-
<?php if ($this->getShipment()->getTracksCollection()->count()): ?>
|
56 |
-
<a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($this->getShipment()) ?>', 'trackshipment', 'width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track this shipment') ?>"><?php echo $this->__('Track this shipment') ?></a>
|
57 |
-
<br/>
|
58 |
-
<?php endif; ?>
|
59 |
-
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
60 |
-
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
61 |
-
|
62 |
-
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
63 |
-
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
64 |
-
<?php else: ?>
|
65 |
-
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
66 |
-
<?php endif; ?>
|
67 |
-
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
68 |
-
|
69 |
-
<?php echo $_excl; ?>
|
70 |
-
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
71 |
-
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
72 |
-
<?php endif; ?>
|
73 |
-
</div>
|
74 |
-
<?php if ($this->canCreateShippingLabel()): ?>
|
75 |
-
<div style="text-align: center; margin: 10px 0;">
|
76 |
-
<?php echo $this->getCreateLabelButton() ?>
|
77 |
-
<?php if ($this->getShipment()->getShippingLabel()): ?>
|
78 |
-
<?php echo $this->getPrintLabelButton() ?>
|
79 |
-
<?php endif ?>
|
80 |
-
<?php if ($this->getShipment()->getPackages()): ?>
|
81 |
-
<?php echo $this->getShowPackagesButton() ?>
|
82 |
-
<?php endif ?>
|
83 |
-
</div>
|
84 |
-
<?php endif ?>
|
85 |
-
<div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
|
86 |
-
</fieldset>
|
87 |
-
<?php echo $this->getChildHtml('shipment_packaging') ?>
|
88 |
-
<script type="text/javascript">
|
89 |
-
//<![CDATA[
|
90 |
-
document.observe("dom:loaded", function() {
|
91 |
-
setTimeout(function() {
|
92 |
-
packaging.setConfirmPackagingCallback(function() {
|
93 |
-
packaging.sendCreateLabelRequest();
|
94 |
-
});
|
95 |
-
packaging.setLabelCreatedCallback(function(response) {
|
96 |
-
setLocation("<?php
|
97 |
-
echo $this->getUrl(
|
98 |
-
'*/sales_order_shipment/view', array('shipment_id' => $this->getShipment()->getId())
|
99 |
-
);
|
100 |
-
?>");
|
101 |
-
});
|
102 |
-
}, 500);
|
103 |
-
});
|
104 |
-
//]]>
|
105 |
-
</script>
|
106 |
-
</div>
|
107 |
-
</div>
|
108 |
-
<div class="clear"></div>
|
109 |
-
|
110 |
-
<div class="entry-edit">
|
111 |
-
<div class="entry-edit-head">
|
112 |
-
<h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Shipped') ?></h4>
|
113 |
-
</div>
|
114 |
-
</div>
|
115 |
-
|
116 |
-
<?php echo $this->getChildHtml('shipment_items') ?>
|
117 |
-
<?php echo $this->getChildHtml('shipment_packed') ?>
|
118 |
-
|
119 |
-
<div class="box-left entry-edit">
|
120 |
-
<div class="entry-edit-head"><h4><?php echo $this->__('Shipment History') ?></h4></div>
|
121 |
-
<fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
|
122 |
-
</div>
|
123 |
-
<div class="clear"></div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Inherited for having additonal info.
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
* */
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<?php $_order = $this->getShipment()->getOrder() ?>
|
33 |
+
<?php echo $this->getChildHtml('order_info') ?>
|
34 |
+
|
35 |
+
<div class="box-left" style="width:100%">
|
36 |
+
<!--Billing Address-->
|
37 |
+
<div class="entry-edit">
|
38 |
+
<div class="entry-edit-head">
|
39 |
+
<h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
|
40 |
+
</div>
|
41 |
+
<fieldset>
|
42 |
+
<div><?php echo $this->getChildHtml('order_payment') ?></div>
|
43 |
+
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
44 |
+
</fieldset>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
<div class="box-right" style="width:100%">
|
48 |
+
<!--Shipping Address-->
|
49 |
+
<div class="entry-edit">
|
50 |
+
<div class="entry-edit-head">
|
51 |
+
<h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping and Tracking Information') ?></h4>
|
52 |
+
</div>
|
53 |
+
<fieldset>
|
54 |
+
<div>
|
55 |
+
<?php if ($this->getShipment()->getTracksCollection()->count()): ?>
|
56 |
+
<a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($this->getShipment()) ?>', 'trackshipment', 'width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track this shipment') ?>"><?php echo $this->__('Track this shipment') ?></a>
|
57 |
+
<br/>
|
58 |
+
<?php endif; ?>
|
59 |
+
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
60 |
+
<?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
|
61 |
+
|
62 |
+
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
63 |
+
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
64 |
+
<?php else: ?>
|
65 |
+
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
66 |
+
<?php endif; ?>
|
67 |
+
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
68 |
+
|
69 |
+
<?php echo $_excl; ?>
|
70 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
71 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
72 |
+
<?php endif; ?>
|
73 |
+
</div>
|
74 |
+
<?php if ($this->canCreateShippingLabel()): ?>
|
75 |
+
<div style="text-align: center; margin: 10px 0;">
|
76 |
+
<?php echo $this->getCreateLabelButton() ?>
|
77 |
+
<?php if ($this->getShipment()->getShippingLabel()): ?>
|
78 |
+
<?php echo $this->getPrintLabelButton() ?>
|
79 |
+
<?php endif ?>
|
80 |
+
<?php if ($this->getShipment()->getPackages()): ?>
|
81 |
+
<?php echo $this->getShowPackagesButton() ?>
|
82 |
+
<?php endif ?>
|
83 |
+
</div>
|
84 |
+
<?php endif ?>
|
85 |
+
<div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
|
86 |
+
</fieldset>
|
87 |
+
<?php echo $this->getChildHtml('shipment_packaging') ?>
|
88 |
+
<script type="text/javascript">
|
89 |
+
//<![CDATA[
|
90 |
+
document.observe("dom:loaded", function() {
|
91 |
+
setTimeout(function() {
|
92 |
+
packaging.setConfirmPackagingCallback(function() {
|
93 |
+
packaging.sendCreateLabelRequest();
|
94 |
+
});
|
95 |
+
packaging.setLabelCreatedCallback(function(response) {
|
96 |
+
setLocation("<?php
|
97 |
+
echo $this->getUrl(
|
98 |
+
'*/sales_order_shipment/view', array('shipment_id' => $this->getShipment()->getId())
|
99 |
+
);
|
100 |
+
?>");
|
101 |
+
});
|
102 |
+
}, 500);
|
103 |
+
});
|
104 |
+
//]]>
|
105 |
+
</script>
|
106 |
+
</div>
|
107 |
+
</div>
|
108 |
+
<div class="clear"></div>
|
109 |
+
|
110 |
+
<div class="entry-edit">
|
111 |
+
<div class="entry-edit-head">
|
112 |
+
<h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Shipped') ?></h4>
|
113 |
+
</div>
|
114 |
+
</div>
|
115 |
+
|
116 |
+
<?php echo $this->getChildHtml('shipment_items') ?>
|
117 |
+
<?php echo $this->getChildHtml('shipment_packed') ?>
|
118 |
+
|
119 |
+
<div class="box-left entry-edit">
|
120 |
+
<div class="entry-edit-head"><h4><?php echo $this->__('Shipment History') ?></h4></div>
|
121 |
+
<fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
|
122 |
+
</div>
|
123 |
+
<div class="clear"></div>
|
app/code/community/Cardconnect/Ccgateway/controllers/Adminhtml/Sales/Order/CreateController.php
CHANGED
@@ -1,177 +1,177 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @brief Defines the Reorder function
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
* */
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
include_once("Mage/Adminhtml/controllers/Sales/Order/CreateController.php");
|
33 |
-
|
34 |
-
class Cardconnect_Ccgateway_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Sales_Order_CreateController {
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Additional initialization
|
38 |
-
*
|
39 |
-
*/
|
40 |
-
protected function _construct() {
|
41 |
-
$this->setUsedModuleName('Mage_Sales');
|
42 |
-
|
43 |
-
// During order creation in the backend admin has ability to add any products to order
|
44 |
-
Mage::helper('catalog/product')->setSkipSaleableCheck(true);
|
45 |
-
}
|
46 |
-
|
47 |
-
public function reorderAction() {
|
48 |
-
|
49 |
-
$this->_getSession()->clear();
|
50 |
-
$orderId = $this->getRequest()->getParam('order_id');
|
51 |
-
$order = Mage::getModel('sales/order')->load($orderId);
|
52 |
-
if (!Mage::helper('sales/reorder')->canReorder($order)) {
|
53 |
-
return $this->_forward('noRoute');
|
54 |
-
}
|
55 |
-
|
56 |
-
if ($order->getId()) {
|
57 |
-
$order->setReordered(true);
|
58 |
-
$this->_getSession()->setUseOldShippingMethod(true);
|
59 |
-
$this->_getOrderCreateModel()->initFromOrder($order);
|
60 |
-
|
61 |
-
$this->_redirect('*/*');
|
62 |
-
} else {
|
63 |
-
$this->_redirect('*/sales_order/');
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Saving quote and create order
|
69 |
-
*/
|
70 |
-
public function saveAction() {
|
71 |
-
try {
|
72 |
-
$this->_processActionData('save');
|
73 |
-
$paymentData = $this->getRequest()->getPost('payment');
|
74 |
-
|
75 |
-
if ($paymentData) {
|
76 |
-
$paymentData['checks'] = Mage_Payment_Model_Method_Abstract::CHECK_USE_INTERNAL | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_COUNTRY | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_CURRENCY | Mage_Payment_Model_Method_Abstract::CHECK_ORDER_TOTAL_MIN_MAX | Mage_Payment_Model_Method_Abstract::CHECK_ZERO_TOTAL;
|
77 |
-
$this->_getOrderCreateModel()->setPaymentData($paymentData);
|
78 |
-
$this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentData);
|
79 |
-
}
|
80 |
-
|
81 |
-
|
82 |
-
$order = $this->_getOrderCreateModel()
|
83 |
-
->setIsValidate(true)
|
84 |
-
->importPostData($this->getRequest()->getPost('order'))
|
85 |
-
->createOrder();
|
86 |
-
|
87 |
-
/* Check Payment Method for Authorization on Reorder */
|
88 |
-
$payment_method_code = $order->getPayment()->getMethodInstance()->getCode();
|
89 |
-
$this->_getSession()->clear();
|
90 |
-
|
91 |
-
// make payment if payment method is ccgateway
|
92 |
-
if (!empty($order) && $payment_method_code == "ccgateway") {
|
93 |
-
$this->makeCcPayment($order);
|
94 |
-
}
|
95 |
-
|
96 |
-
|
97 |
-
if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
|
98 |
-
$this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
|
99 |
-
} else {
|
100 |
-
$this->_redirect('*/sales_order/index');
|
101 |
-
}
|
102 |
-
} catch (Mage_Payment_Model_Info_Exception $e) {
|
103 |
-
$this->_getOrderCreateModel()->saveQuote();
|
104 |
-
$message = $e->getMessage();
|
105 |
-
if (!empty($message)) {
|
106 |
-
$this->_getSession()->addError($message);
|
107 |
-
}
|
108 |
-
$this->_redirect('*/*/');
|
109 |
-
} catch (Mage_Core_Exception $e) {
|
110 |
-
$message = $e->getMessage();
|
111 |
-
if (!empty($message)) {
|
112 |
-
$this->_getSession()->addError($message);
|
113 |
-
}
|
114 |
-
$this->_redirect('*/*/');
|
115 |
-
} catch (Exception $e) {
|
116 |
-
$this->_getSession()->addException($e, $this->__('Order saving error: %s', $e->getMessage()));
|
117 |
-
$this->_redirect('*/*/');
|
118 |
-
}
|
119 |
-
}
|
120 |
-
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Call authorization service and check AVS, CVV fails check
|
124 |
-
*/
|
125 |
-
|
126 |
-
protected function makeCcPayment($order){
|
127 |
-
$amount = number_format($order->getBaseGrandTotal(), 2, '.', '');
|
128 |
-
$response = Mage::getModel('ccgateway/standard')->authService($order, $amount, "authFull");
|
129 |
-
$errorStat = $response['respproc'] . $response['respcode'];
|
130 |
-
|
131 |
-
if($response['resptext']=="CardConnect_Error"){
|
132 |
-
// Cancel the order if authorization service fails
|
133 |
-
Mage::helper('ccgateway')->cancelCcOrder($order);
|
134 |
-
$errorMsg = Mage::helper('ccgateway')->matchResponseError($errorStat);
|
135 |
-
// Set custom order status
|
136 |
-
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, 'cardconnect_reject', $errorMsg)->save();
|
137 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('ccgateway')->__('We are unable to perform the requested action, please contact customer service.'));
|
138 |
-
}else{
|
139 |
-
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, 'cardconnect_processing', 'Gateway has authorized the payment.');
|
140 |
-
$autoVoidStatus = Mage::helper('ccgateway')->checkAutoVoidStatus($order, $response['avsresp'], $response['cvvresp']);
|
141 |
-
if (($autoVoidStatus["STATUS_AVS"] && $autoVoidStatus["STATUS_CVV"]) == false) {
|
142 |
-
$voidResponse = Mage::getModel('ccgateway/standard')->voidService($order);
|
143 |
-
if($voidResponse['respcode'] == '00' ){
|
144 |
-
// Cancel the order if Auto void success
|
145 |
-
Mage::helper('ccgateway')->cancelCcOrder($order);
|
146 |
-
|
147 |
-
$errorMsg = "";
|
148 |
-
if ($autoVoidStatus["STATUS_ERROR"] == "CVV") {
|
149 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('ccgateway')->__('Error - Invalid cvv , Please check cvv information,which is entered on payment page.'));
|
150 |
-
$errorMsg = "CVV does not match.";
|
151 |
-
$myLogMessage = "CC Admin Authorization : ". __FILE__ . " @ " . __LINE__ ." Auto voided the transaction Due to CVV NO MATCH";
|
152 |
-
Mage::log($myLogMessage, Zend_Log::ERR , "cc.log" );
|
153 |
-
} elseif ($autoVoidStatus["STATUS_ERROR"] == "AVS") {
|
154 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('ccgateway')->__('Error - Please check billing information , try again.'));
|
155 |
-
$errorMsg = "AVS does not match.";
|
156 |
-
$myLogMessage = "CC Admin Authorization : ". __FILE__ . " @ " . __LINE__ ." Auto voided the transaction Due to AVS NO MATCH";
|
157 |
-
Mage::log($myLogMessage, Zend_Log::ERR , "cc.log" );
|
158 |
-
} else {
|
159 |
-
$errorMsg = Mage::helper('ccgateway')->matchResponseError($errorStat);
|
160 |
-
$myLogMessage = "CC Admin Authorization : ". __FILE__ . " @ " . __LINE__ ." ".$errorStat . " :- " . $errorMsg;
|
161 |
-
Mage::log($myLogMessage, Zend_Log::ERR , "cc.log" );
|
162 |
-
}
|
163 |
-
}
|
164 |
-
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, 'cardconnect_reject', $errorMsg)->save();
|
165 |
-
|
166 |
-
}else{
|
167 |
-
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The order has been created.'));
|
168 |
-
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, 'cardconnect_processing', "Successfully order placed via CardConnect.")->save();
|
169 |
-
}
|
170 |
-
|
171 |
-
}
|
172 |
-
|
173 |
-
}
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @brief Defines the Reorder function
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
* */
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
include_once("Mage/Adminhtml/controllers/Sales/Order/CreateController.php");
|
33 |
+
|
34 |
+
class Cardconnect_Ccgateway_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Sales_Order_CreateController {
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Additional initialization
|
38 |
+
*
|
39 |
+
*/
|
40 |
+
protected function _construct() {
|
41 |
+
$this->setUsedModuleName('Mage_Sales');
|
42 |
+
|
43 |
+
// During order creation in the backend admin has ability to add any products to order
|
44 |
+
Mage::helper('catalog/product')->setSkipSaleableCheck(true);
|
45 |
+
}
|
46 |
+
|
47 |
+
public function reorderAction() {
|
48 |
+
|
49 |
+
$this->_getSession()->clear();
|
50 |
+
$orderId = $this->getRequest()->getParam('order_id');
|
51 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
52 |
+
if (!Mage::helper('sales/reorder')->canReorder($order)) {
|
53 |
+
return $this->_forward('noRoute');
|
54 |
+
}
|
55 |
+
|
56 |
+
if ($order->getId()) {
|
57 |
+
$order->setReordered(true);
|
58 |
+
$this->_getSession()->setUseOldShippingMethod(true);
|
59 |
+
$this->_getOrderCreateModel()->initFromOrder($order);
|
60 |
+
|
61 |
+
$this->_redirect('*/*');
|
62 |
+
} else {
|
63 |
+
$this->_redirect('*/sales_order/');
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Saving quote and create order
|
69 |
+
*/
|
70 |
+
public function saveAction() {
|
71 |
+
try {
|
72 |
+
$this->_processActionData('save');
|
73 |
+
$paymentData = $this->getRequest()->getPost('payment');
|
74 |
+
|
75 |
+
if ($paymentData) {
|
76 |
+
$paymentData['checks'] = Mage_Payment_Model_Method_Abstract::CHECK_USE_INTERNAL | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_COUNTRY | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_CURRENCY | Mage_Payment_Model_Method_Abstract::CHECK_ORDER_TOTAL_MIN_MAX | Mage_Payment_Model_Method_Abstract::CHECK_ZERO_TOTAL;
|
77 |
+
$this->_getOrderCreateModel()->setPaymentData($paymentData);
|
78 |
+
$this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentData);
|
79 |
+
}
|
80 |
+
|
81 |
+
|
82 |
+
$order = $this->_getOrderCreateModel()
|
83 |
+
->setIsValidate(true)
|
84 |
+
->importPostData($this->getRequest()->getPost('order'))
|
85 |
+
->createOrder();
|
86 |
+
|
87 |
+
/* Check Payment Method for Authorization on Reorder */
|
88 |
+
$payment_method_code = $order->getPayment()->getMethodInstance()->getCode();
|
89 |
+
$this->_getSession()->clear();
|
90 |
+
|
91 |
+
// make payment if payment method is ccgateway
|
92 |
+
if (!empty($order) && $payment_method_code == "ccgateway") {
|
93 |
+
$this->makeCcPayment($order);
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
|
98 |
+
$this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
|
99 |
+
} else {
|
100 |
+
$this->_redirect('*/sales_order/index');
|
101 |
+
}
|
102 |
+
} catch (Mage_Payment_Model_Info_Exception $e) {
|
103 |
+
$this->_getOrderCreateModel()->saveQuote();
|
104 |
+
$message = $e->getMessage();
|
105 |
+
if (!empty($message)) {
|
106 |
+
$this->_getSession()->addError($message);
|
107 |
+
}
|
108 |
+
$this->_redirect('*/*/');
|
109 |
+
} catch (Mage_Core_Exception $e) {
|
110 |
+
$message = $e->getMessage();
|
111 |
+
if (!empty($message)) {
|
112 |
+
$this->_getSession()->addError($message);
|
113 |
+
}
|
114 |
+
$this->_redirect('*/*/');
|
115 |
+
} catch (Exception $e) {
|
116 |
+
$this->_getSession()->addException($e, $this->__('Order saving error: %s', $e->getMessage()));
|
117 |
+
$this->_redirect('*/*/');
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Call authorization service and check AVS, CVV fails check
|
124 |
+
*/
|
125 |
+
|
126 |
+
protected function makeCcPayment($order){
|
127 |
+
$amount = number_format($order->getBaseGrandTotal(), 2, '.', '');
|
128 |
+
$response = Mage::getModel('ccgateway/standard')->authService($order, $amount, "authFull");
|
129 |
+
$errorStat = $response['respproc'] . $response['respcode'];
|
130 |
+
|
131 |
+
if($response['resptext']=="CardConnect_Error"){
|
132 |
+
// Cancel the order if authorization service fails
|
133 |
+
Mage::helper('ccgateway')->cancelCcOrder($order);
|
134 |
+
$errorMsg = Mage::helper('ccgateway')->matchResponseError($errorStat);
|
135 |
+
// Set custom order status
|
136 |
+
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, 'cardconnect_reject', $errorMsg)->save();
|
137 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('ccgateway')->__('We are unable to perform the requested action, please contact customer service.'));
|
138 |
+
}else{
|
139 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, 'cardconnect_processing', 'Gateway has authorized the payment.');
|
140 |
+
$autoVoidStatus = Mage::helper('ccgateway')->checkAutoVoidStatus($order, $response['avsresp'], $response['cvvresp']);
|
141 |
+
if (($autoVoidStatus["STATUS_AVS"] && $autoVoidStatus["STATUS_CVV"]) == false) {
|
142 |
+
$voidResponse = Mage::getModel('ccgateway/standard')->voidService($order);
|
143 |
+
if($voidResponse['respcode'] == '00' ){
|
144 |
+
// Cancel the order if Auto void success
|
145 |
+
Mage::helper('ccgateway')->cancelCcOrder($order);
|
146 |
+
|
147 |
+
$errorMsg = "";
|
148 |
+
if ($autoVoidStatus["STATUS_ERROR"] == "CVV") {
|
149 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('ccgateway')->__('Error - Invalid cvv , Please check cvv information,which is entered on payment page.'));
|
150 |
+
$errorMsg = "CVV does not match.";
|
151 |
+
$myLogMessage = "CC Admin Authorization : ". __FILE__ . " @ " . __LINE__ ." Auto voided the transaction Due to CVV NO MATCH";
|
152 |
+
Mage::log($myLogMessage, Zend_Log::ERR , "cc.log" );
|
153 |
+
} elseif ($autoVoidStatus["STATUS_ERROR"] == "AVS") {
|
154 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('ccgateway')->__('Error - Please check billing information , try again.'));
|
155 |
+
$errorMsg = "AVS does not match.";
|
156 |
+
$myLogMessage = "CC Admin Authorization : ". __FILE__ . " @ " . __LINE__ ." Auto voided the transaction Due to AVS NO MATCH";
|
157 |
+
Mage::log($myLogMessage, Zend_Log::ERR , "cc.log" );
|
158 |
+
} else {
|
159 |
+
$errorMsg = Mage::helper('ccgateway')->matchResponseError($errorStat);
|
160 |
+
$myLogMessage = "CC Admin Authorization : ". __FILE__ . " @ " . __LINE__ ." ".$errorStat . " :- " . $errorMsg;
|
161 |
+
Mage::log($myLogMessage, Zend_Log::ERR , "cc.log" );
|
162 |
+
}
|
163 |
+
}
|
164 |
+
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, 'cardconnect_reject', $errorMsg)->save();
|
165 |
+
|
166 |
+
}else{
|
167 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The order has been created.'));
|
168 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, 'cardconnect_processing', "Successfully order placed via CardConnect.")->save();
|
169 |
+
}
|
170 |
+
|
171 |
+
}
|
172 |
+
|
173 |
+
}
|
174 |
+
|
175 |
+
|
176 |
+
|
177 |
+
}
|
app/code/community/Cardconnect/Ccgateway/controllers/Adminhtml/Sales/OrderController.php
CHANGED
@@ -1,99 +1,99 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @brief Defines the void on cancel function
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
* */
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
|
34 |
-
require_once 'Mage/Adminhtml/controllers/Sales/OrderController.php';
|
35 |
-
|
36 |
-
class Cardconnect_Ccgateway_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController {
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Array of actions which can be processed without secret key validation
|
40 |
-
*
|
41 |
-
* @var array
|
42 |
-
*/
|
43 |
-
protected $_publicActions = array('view', 'index');
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Additional initialization
|
47 |
-
*
|
48 |
-
*/
|
49 |
-
protected function _construct() {
|
50 |
-
$this->setUsedModuleName('Mage_Sales');
|
51 |
-
}
|
52 |
-
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Cancel order
|
56 |
-
*/
|
57 |
-
public function cancelAction()
|
58 |
-
{
|
59 |
-
if ($order = $this->_initOrder()) {
|
60 |
-
try {
|
61 |
-
|
62 |
-
// Check CardConnect Void status
|
63 |
-
$voidStatus = Mage::getModel('ccgateway/standard')->getVoidStatus($order);
|
64 |
-
if($voidStatus==true){
|
65 |
-
// Checking if payment method is CardConnect then void service will call.
|
66 |
-
$payment_method_code = $order->getPayment()->getMethodInstance()->getCode();
|
67 |
-
if ($payment_method_code == "ccgateway") {
|
68 |
-
$voidResponse = Mage::getModel('ccgateway/standard')->voidService($order);
|
69 |
-
if($voidResponse['respcode'] == '00' ){
|
70 |
-
$order->cancel()->save();
|
71 |
-
$this->_getSession()->addSuccess(
|
72 |
-
$this->__('The order has been cancelled.')
|
73 |
-
);
|
74 |
-
}else{
|
75 |
-
$myLogMessage = "CC Void : ". __FILE__ . " @ " . __LINE__ ." ".$voidResponse['respcode']." => ".$voidResponse['resptext'];
|
76 |
-
Mage::log($myLogMessage, Zend_Log::ERR , "cc.log" );
|
77 |
-
}
|
78 |
-
}else{
|
79 |
-
$order->cancel()->save();
|
80 |
-
$this->_getSession()->addSuccess(
|
81 |
-
$this->__('The order has been cancelled.')
|
82 |
-
);
|
83 |
-
}
|
84 |
-
}else{
|
85 |
-
$this->_getSession()->addError($this->__('Order is already invoiced. Cancel is not allowed on invoiced order.'));
|
86 |
-
Mage::log("Unable to perform full void. Order is already Captured, full void is not allowed on after capture.");
|
87 |
-
}
|
88 |
-
} catch (Mage_Core_Exception $e) {
|
89 |
-
$this->_getSession()->addError($e->getMessage());
|
90 |
-
} catch (Exception $e) {
|
91 |
-
$this->_getSession()->addError($this->__('The order has not been cancelled.'));
|
92 |
-
Mage::logException($e);
|
93 |
-
}
|
94 |
-
$this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
|
99 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @brief Defines the void on cancel function
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
* */
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
|
34 |
+
require_once 'Mage/Adminhtml/controllers/Sales/OrderController.php';
|
35 |
+
|
36 |
+
class Cardconnect_Ccgateway_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController {
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Array of actions which can be processed without secret key validation
|
40 |
+
*
|
41 |
+
* @var array
|
42 |
+
*/
|
43 |
+
protected $_publicActions = array('view', 'index');
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Additional initialization
|
47 |
+
*
|
48 |
+
*/
|
49 |
+
protected function _construct() {
|
50 |
+
$this->setUsedModuleName('Mage_Sales');
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Cancel order
|
56 |
+
*/
|
57 |
+
public function cancelAction()
|
58 |
+
{
|
59 |
+
if ($order = $this->_initOrder()) {
|
60 |
+
try {
|
61 |
+
|
62 |
+
// Check CardConnect Void status
|
63 |
+
$voidStatus = Mage::getModel('ccgateway/standard')->getVoidStatus($order);
|
64 |
+
if($voidStatus==true){
|
65 |
+
// Checking if payment method is CardConnect then void service will call.
|
66 |
+
$payment_method_code = $order->getPayment()->getMethodInstance()->getCode();
|
67 |
+
if ($payment_method_code == "ccgateway") {
|
68 |
+
$voidResponse = Mage::getModel('ccgateway/standard')->voidService($order);
|
69 |
+
if($voidResponse['respcode'] == '00' ){
|
70 |
+
$order->cancel()->save();
|
71 |
+
$this->_getSession()->addSuccess(
|
72 |
+
$this->__('The order has been cancelled.')
|
73 |
+
);
|
74 |
+
}else{
|
75 |
+
$myLogMessage = "CC Void : ". __FILE__ . " @ " . __LINE__ ." ".$voidResponse['respcode']." => ".$voidResponse['resptext'];
|
76 |
+
Mage::log($myLogMessage, Zend_Log::ERR , "cc.log" );
|
77 |
+
}
|
78 |
+
}else{
|
79 |
+
$order->cancel()->save();
|
80 |
+
$this->_getSession()->addSuccess(
|
81 |
+
$this->__('The order has been cancelled.')
|
82 |
+
);
|
83 |
+
}
|
84 |
+
}else{
|
85 |
+
$this->_getSession()->addError($this->__('Order is already invoiced. Cancel is not allowed on invoiced order.'));
|
86 |
+
Mage::log("Unable to perform full void. Order is already Captured, full void is not allowed on after capture.");
|
87 |
+
}
|
88 |
+
} catch (Mage_Core_Exception $e) {
|
89 |
+
$this->_getSession()->addError($e->getMessage());
|
90 |
+
} catch (Exception $e) {
|
91 |
+
$this->_getSession()->addError($this->__('The order has not been cancelled.'));
|
92 |
+
Mage::logException($e);
|
93 |
+
}
|
94 |
+
$this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
|
99 |
+
}
|
app/code/community/Cardconnect/Ccgateway/controllers/CardmanagementController.php
CHANGED
@@ -1,180 +1,181 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @brief Defines the Credit Card Management function
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
* */
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
require_once Mage::getModuleDir('controllers', 'Mage_Customer').DS.'AccountController.php';
|
34 |
-
|
35 |
-
class Cardconnect_Ccgateway_CardmanagementController extends Mage_Customer_AccountController {
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Index action. List of cards.
|
39 |
-
*/
|
40 |
-
public function indexAction() {
|
41 |
-
$this->loadLayout();
|
42 |
-
$this->_initMessages();
|
43 |
-
$this->renderLayout();
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Init layout messages, add page title
|
48 |
-
*/
|
49 |
-
protected function _initMessages() {
|
50 |
-
$this->_initLayoutMessages('customer/session');
|
51 |
-
$this->getLayout()->getBlock('head')->setTitle($this->__('Card Management'));
|
52 |
-
$this->getLayout()->getBlock('ccgateway/walletcard_index');
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Add new card action
|
57 |
-
*/
|
58 |
-
public function newAction() {
|
59 |
-
|
60 |
-
$this->loadLayout();
|
61 |
-
$this->_initMessages();
|
62 |
-
$this->getLayout()->getBlock('customer_walletcard_management')->setTemplate('ccgateway/cardmanagement/new.phtml');
|
63 |
-
|
64 |
-
$this->renderLayout();
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Save payment ajax action
|
69 |
-
*
|
70 |
-
* Sets either redirect or a JSON response
|
71 |
-
*/
|
72 |
-
public function savePaymentAction() {
|
73 |
-
|
74 |
-
try {
|
75 |
-
$data = $this->getRequest()->getPost('addcard', array());
|
76 |
-
|
77 |
-
// Call function Create Profile webservices
|
78 |
-
$response = Mage::getModel('ccgateway/standard')->createProfileService($data);
|
79 |
-
if ($response['resptext'] == "Profile Saved") {
|
80 |
-
Mage::getSingleton('core/session')->addSuccess("Card has been added successfully.");
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
$
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
$
|
103 |
-
$writeConnection = $resource->getConnection('core_write');
|
104 |
-
$getTable = $resource->getTableName('cardconnect_wallet');
|
105 |
-
|
106 |
-
/* Query to first update the CC_DEFAULT_CARD in cardconnect_wallet table */
|
107 |
-
$updQry = "UPDATE {$getTable} SET CC_DEFAULT_CARD='N' WHERE CC_USER_ID=" . $ccUserId . " AND CC_DEFAULT_CARD='Y'";
|
108 |
-
$writeConnection->query($updQry);
|
109 |
-
|
110 |
-
/* Query to make selected card as Default payment card */
|
111 |
-
$makeDafault = "UPDATE {$getTable} SET CC_DEFAULT_CARD='Y' WHERE CC_USER_ID=" . $ccUserId . " AND CC_ID=" . $walletId;
|
112 |
-
$writeConnection->query($makeDafault);
|
113 |
-
$success_msg = "Wallet Updated Successfully";
|
114 |
-
echo $success_msg;
|
115 |
-
exit;
|
116 |
-
}
|
117 |
-
|
118 |
-
/**
|
119 |
-
* To delete wallet profile
|
120 |
-
*/
|
121 |
-
public function deletewalletAction() {
|
122 |
-
|
123 |
-
$walletid = $this->getRequest()->getParam('cc_id');
|
124 |
-
$response = Mage::getModel('ccgateway/standard')->deleteWalletDataService($walletid);
|
125 |
-
|
126 |
-
echo $response;
|
127 |
-
exit;
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Edit card action
|
132 |
-
*/
|
133 |
-
public function editcardAction() {
|
134 |
-
|
135 |
-
$this->loadLayout();
|
136 |
-
$this->_initMessages();
|
137 |
-
$
|
138 |
-
$this->
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
*
|
144 |
-
*
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
'
|
153 |
-
'
|
154 |
-
'
|
155 |
-
'
|
156 |
-
'
|
157 |
-
'
|
158 |
-
'
|
159 |
-
'
|
160 |
-
'
|
161 |
-
'
|
162 |
-
'
|
163 |
-
'
|
164 |
-
'
|
165 |
-
'
|
166 |
-
'
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
if ($response == "Profile Updated") {
|
172 |
-
Mage::getSingleton('core/session')->addSuccess("Card has been updated successfully.");
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
}
|
179 |
-
|
180 |
-
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @brief Defines the Credit Card Management function
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
* */
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
require_once Mage::getModuleDir('controllers', 'Mage_Customer').DS.'AccountController.php';
|
34 |
+
|
35 |
+
class Cardconnect_Ccgateway_CardmanagementController extends Mage_Customer_AccountController {
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Index action. List of cards.
|
39 |
+
*/
|
40 |
+
public function indexAction() {
|
41 |
+
$this->loadLayout();
|
42 |
+
$this->_initMessages();
|
43 |
+
$this->renderLayout();
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Init layout messages, add page title
|
48 |
+
*/
|
49 |
+
protected function _initMessages() {
|
50 |
+
$this->_initLayoutMessages('customer/session');
|
51 |
+
$this->getLayout()->getBlock('head')->setTitle($this->__('Card Management'));
|
52 |
+
$this->getLayout()->getBlock('ccgateway/walletcard_index');
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Add new card action
|
57 |
+
*/
|
58 |
+
public function newAction() {
|
59 |
+
|
60 |
+
$this->loadLayout();
|
61 |
+
$this->_initMessages();
|
62 |
+
$this->getLayout()->getBlock('customer_walletcard_management')->setTemplate('ccgateway/cardmanagement/new.phtml');
|
63 |
+
|
64 |
+
$this->renderLayout();
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Save payment ajax action
|
69 |
+
*
|
70 |
+
* Sets either redirect or a JSON response
|
71 |
+
*/
|
72 |
+
public function savePaymentAction() {
|
73 |
+
|
74 |
+
try {
|
75 |
+
$data = $this->getRequest()->getPost('addcard', array());
|
76 |
+
|
77 |
+
// Call function Create Profile webservices
|
78 |
+
$response = Mage::getModel('ccgateway/standard')->createProfileService($data);
|
79 |
+
if ($response['resptext'] == "Profile Saved") {
|
80 |
+
Mage::getSingleton('core/session')->addSuccess("Card has been added successfully.");
|
81 |
+
}else{
|
82 |
+
Mage::getSingleton('core/session')->addError(Mage::helper('ccgateway')->__("Unable to perform add card. Please, retry."));
|
83 |
+
}
|
84 |
+
$this->_redirect('customer/cardmanagement');
|
85 |
+
} catch (Exception $e) {
|
86 |
+
Mage::logException($e);
|
87 |
+
throw new Exception("Unable to perform add card. Please, retry.");
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Function to make default payment from Card Management Grid
|
93 |
+
*/
|
94 |
+
public function makedefaultpaymentAction() {
|
95 |
+
$walletId = $this->getRequest()->getParam('id');
|
96 |
+
|
97 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
98 |
+
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
99 |
+
$ccUserId = $customerData->getId();
|
100 |
+
}
|
101 |
+
|
102 |
+
$resource = Mage::getSingleton('core/resource');
|
103 |
+
$writeConnection = $resource->getConnection('core_write');
|
104 |
+
$getTable = $resource->getTableName('cardconnect_wallet');
|
105 |
+
|
106 |
+
/* Query to first update the CC_DEFAULT_CARD in cardconnect_wallet table */
|
107 |
+
$updQry = "UPDATE {$getTable} SET CC_DEFAULT_CARD='N' WHERE CC_USER_ID=" . $ccUserId . " AND CC_DEFAULT_CARD='Y'";
|
108 |
+
$writeConnection->query($updQry);
|
109 |
+
|
110 |
+
/* Query to make selected card as Default payment card */
|
111 |
+
$makeDafault = "UPDATE {$getTable} SET CC_DEFAULT_CARD='Y' WHERE CC_USER_ID=" . $ccUserId . " AND CC_ID=" . $walletId;
|
112 |
+
$writeConnection->query($makeDafault);
|
113 |
+
$success_msg = "Wallet Updated Successfully";
|
114 |
+
echo $success_msg;
|
115 |
+
exit;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* To delete wallet profile
|
120 |
+
*/
|
121 |
+
public function deletewalletAction() {
|
122 |
+
|
123 |
+
$walletid = $this->getRequest()->getParam('cc_id');
|
124 |
+
$response = Mage::getModel('ccgateway/standard')->deleteWalletDataService($walletid);
|
125 |
+
|
126 |
+
echo $response;
|
127 |
+
exit;
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Edit card action
|
132 |
+
*/
|
133 |
+
public function editcardAction() {
|
134 |
+
|
135 |
+
$this->loadLayout();
|
136 |
+
$this->_initMessages();
|
137 |
+
$this->getLayout()->getBlock('customer_walletcard_management')->setTemplate('ccgateway/cardmanagement/editcard.phtml');
|
138 |
+
$this->renderLayout();
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Save payment ajax action
|
143 |
+
*
|
144 |
+
* Sets either redirect or a JSON response
|
145 |
+
*/
|
146 |
+
public function updateprofileAction() {
|
147 |
+
|
148 |
+
$data = $this->getRequest()->getPost('editcard', array());
|
149 |
+
|
150 |
+
$param = array(
|
151 |
+
'cc_profile_name' => $data['cc_profile_name'],
|
152 |
+
'wallet_id' => $data['wallet_id'],
|
153 |
+
'defaultacct' => 'Y',
|
154 |
+
'profile' => addslashes($data['profile'] . '/1'),
|
155 |
+
'profileupdate' => 'Y',
|
156 |
+
'cc_number' => $data['cc_number'],
|
157 |
+
'cc_type' => $data['cc_type'],
|
158 |
+
'cc_exp_month' => $data['cc_exp_month'],
|
159 |
+
'cc_exp_year' => $data['cc_exp_year'],
|
160 |
+
'cc_owner' => $data['cc_owner'],
|
161 |
+
'cc_street' => $data['cc_street'],
|
162 |
+
'cc_city' => $data['cc_city'],
|
163 |
+
'cc_region' => $data['cc_region'],
|
164 |
+
'cc_country' => $data['cc_country'],
|
165 |
+
'cc_telephone' => $data['cc_telephone'],
|
166 |
+
'cc_postcode' => $data['cc_postcode']);
|
167 |
+
|
168 |
+
// Call function Create Profile webservices
|
169 |
+
$response = Mage::getModel('ccgateway/standard')->updateProfileService($param);
|
170 |
+
Mage::log($response, Zend_Log::ERR, "cc.log");
|
171 |
+
if ($response == "Profile Updated") {
|
172 |
+
Mage::getSingleton('core/session')->addSuccess("Card has been updated successfully.");
|
173 |
+
} else {
|
174 |
+
Mage::getSingleton('core/session')->addError(Mage::helper('ccgateway')->__("Unable to perform update. Please, retry."));
|
175 |
+
}
|
176 |
+
$this->_redirect('customer/cardmanagement');
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
}
|
app/code/community/Cardconnect/Ccgateway/etc/config.xml
CHANGED
@@ -35,7 +35,7 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
35 |
Â
<config>
|
36 |
Â
<modules>
|
37 |
Â
<Cardconnect_Ccgateway>
|
38 |
-
<version>1.0.
|
39 |
Â
</Cardconnect_Ccgateway>
|
40 |
Â
</modules>
|
41 |
Â
<global>
|
35 |
Â
<config>
|
36 |
Â
<modules>
|
37 |
Â
<Cardconnect_Ccgateway>
|
38 |
+
<version>1.0.7</version>
|
39 |
Â
</Cardconnect_Ccgateway>
|
40 |
Â
</modules>
|
41 |
Â
<global>
|
app/code/community/Cardconnect/Ccgateway/sql/cardconnect_ccgateway_setup/install-1.0.0.php
CHANGED
@@ -1,136 +1,136 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @brief Create CardConnect response table and create custom order status in database
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
* */
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
$installer = $this;
|
33 |
-
$installer->startSetup();
|
34 |
-
$installer->run("
|
35 |
-
|
36 |
-
DROP TABLE IF EXISTS {$this->getTable('cardconnect_resp')};
|
37 |
-
CREATE TABLE {$this->getTable('cardconnect_resp')} (
|
38 |
-
`CC_ID` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
39 |
-
`CC_ACTION` VARCHAR(50),
|
40 |
-
`CC_RETREF` VARCHAR(50),
|
41 |
-
`CC_AMT` DECIMAL(14,2),
|
42 |
-
`CC_AUTHCODE` VARCHAR(6),
|
43 |
-
`CC_ORDERID` BIGINT,
|
44 |
-
`CC_TOKEN` BIGINT,
|
45 |
-
`CC_MERCHID` BIGINT,
|
46 |
-
`CC_RESPSTAT` CHAR(1),
|
47 |
-
`CC_RESPCODE` CHAR(3),
|
48 |
-
`CC_RESPTEXT` VARCHAR(50),
|
49 |
-
`CC_RESPPROC` CHAR(4),
|
50 |
-
`CC_AVSRESP` VARCHAR(2),
|
51 |
-
`CC_CVVRESP` CHAR(1),
|
52 |
-
`CC_SETLSTAT` VARCHAR(50),
|
53 |
-
`CC_VOIDED` VARCHAR(50),
|
54 |
-
`CC_CREATED` DATETIME
|
55 |
-
|
56 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
57 |
-
|
58 |
-
CREATE INDEX CC_ORDERID_INDEX ON {$this->getTable('cardconnect_resp')} ( CC_ORDERID);
|
59 |
-
CREATE INDEX CC_RETREF_INDEX ON {$this->getTable('cardconnect_resp')} ( CC_RETREF);
|
60 |
-
|
61 |
-
");
|
62 |
-
|
63 |
-
// Set custom order status in sales_order_status table
|
64 |
-
|
65 |
-
$statusTable = $installer->getTable('sales/order_status');
|
66 |
-
$statusStateTable = $installer->getTable('sales/order_status_state');
|
67 |
-
|
68 |
-
|
69 |
-
// Delete if order status exist
|
70 |
-
$installer->run('
|
71 |
-
delete from ' . $statusTable . ' where status = "cardconnect_capture";
|
72 |
-
delete from ' . $statusTable . ' where status = "cardconnect_void";
|
73 |
-
delete from ' . $statusTable . ' where status = "cardconnect_refund";
|
74 |
-
delete from ' . $statusTable . ' where status = "cardconnect_reject";
|
75 |
-
delete from ' . $statusTable . ' where status = "cardconnect_txn_settled";
|
76 |
-
delete from ' . $statusTable . ' where status = "cardconnect_processing";
|
77 |
-
');
|
78 |
-
|
79 |
-
// Insert status
|
80 |
-
$installer->getConnection()->insertArray(
|
81 |
-
$statusTable, array(
|
82 |
-
'status',
|
83 |
-
'label'
|
84 |
-
), array(
|
85 |
-
array('status' => 'cardconnect_capture', 'label' => 'CardConnect Capture'),
|
86 |
-
array('status' => 'cardconnect_void', 'label' => 'CardConnect Void'),
|
87 |
-
array('status' => 'cardconnect_refund', 'label' => 'CardConnect Refund'),
|
88 |
-
array('status' => 'cardconnect_reject', 'label' => 'CardConnect Rejected'),
|
89 |
-
array('status' => 'cardconnect_txn_settled', 'label' => 'CardConnect Txn Settled'),
|
90 |
-
array('status' => 'cardconnect_processing', 'label' => 'CardConnect Processing')
|
91 |
-
)
|
92 |
-
);
|
93 |
-
|
94 |
-
|
95 |
-
// Insert states and mapping of statuses to states
|
96 |
-
$installer->getConnection()->insertArray(
|
97 |
-
$statusStateTable,
|
98 |
-
array(
|
99 |
-
'status',
|
100 |
-
'state',
|
101 |
-
'is_default'
|
102 |
-
),
|
103 |
-
array(
|
104 |
-
array(
|
105 |
-
'status' => 'cardconnect_refund',
|
106 |
-
'state' => 'refunded',
|
107 |
-
'is_default' => 1
|
108 |
-
)
|
109 |
-
)
|
110 |
-
);
|
111 |
-
|
112 |
-
|
113 |
-
$installer->run("
|
114 |
-
DROP TABLE IF EXISTS {$this->getTable('cardconnect_wallet')};
|
115 |
-
CREATE TABLE {$this->getTable('cardconnect_wallet')} (
|
116 |
-
`CC_ID` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
117 |
-
`CC_USER_ID` BIGINT NOT NULL COMMENT 'Customer Id',
|
118 |
-
`CC_PROFILEID` VARCHAR(50) NOT NULL COMMENT 'CC Profile Id',
|
119 |
-
`CC_ACCTID` BIGINT NOT NULL,
|
120 |
-
`CC_MASK` VARCHAR(50),
|
121 |
-
`CC_CARD_NAME` VARCHAR(50) COMMENT 'Alias',
|
122 |
-
`CC_DEFAULT_CARD` ENUM('Y','N') DEFAULT 'N',
|
123 |
-
`CC_CREATED` DATETIME
|
124 |
-
|
125 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
126 |
-
|
127 |
-
CREATE INDEX CC_USER_ID_INDEX ON {$this->getTable('cardconnect_wallet')} (CC_USER_ID);
|
128 |
-
CREATE INDEX CC_PROFILEID_INDEX ON {$this->getTable('cardconnect_wallet')} (CC_PROFILEID);
|
129 |
-
CREATE INDEX CC_ACCTID_INDEX ON {$this->getTable('cardconnect_wallet')} (CC_ACCTID);
|
130 |
-
|
131 |
-
");
|
132 |
-
|
133 |
-
|
134 |
-
$installer->endSetup();
|
135 |
-
|
136 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @brief Create CardConnect response table and create custom order status in database
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
* */
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
$installer = $this;
|
33 |
+
$installer->startSetup();
|
34 |
+
$installer->run("
|
35 |
+
|
36 |
+
DROP TABLE IF EXISTS {$this->getTable('cardconnect_resp')};
|
37 |
+
CREATE TABLE {$this->getTable('cardconnect_resp')} (
|
38 |
+
`CC_ID` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
39 |
+
`CC_ACTION` VARCHAR(50),
|
40 |
+
`CC_RETREF` VARCHAR(50),
|
41 |
+
`CC_AMT` DECIMAL(14,2),
|
42 |
+
`CC_AUTHCODE` VARCHAR(6),
|
43 |
+
`CC_ORDERID` BIGINT,
|
44 |
+
`CC_TOKEN` BIGINT,
|
45 |
+
`CC_MERCHID` BIGINT,
|
46 |
+
`CC_RESPSTAT` CHAR(1),
|
47 |
+
`CC_RESPCODE` CHAR(3),
|
48 |
+
`CC_RESPTEXT` VARCHAR(50),
|
49 |
+
`CC_RESPPROC` CHAR(4),
|
50 |
+
`CC_AVSRESP` VARCHAR(2),
|
51 |
+
`CC_CVVRESP` CHAR(1),
|
52 |
+
`CC_SETLSTAT` VARCHAR(50),
|
53 |
+
`CC_VOIDED` VARCHAR(50),
|
54 |
+
`CC_CREATED` DATETIME
|
55 |
+
|
56 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
57 |
+
|
58 |
+
CREATE INDEX CC_ORDERID_INDEX ON {$this->getTable('cardconnect_resp')} ( CC_ORDERID);
|
59 |
+
CREATE INDEX CC_RETREF_INDEX ON {$this->getTable('cardconnect_resp')} ( CC_RETREF);
|
60 |
+
|
61 |
+
");
|
62 |
+
|
63 |
+
// Set custom order status in sales_order_status table
|
64 |
+
|
65 |
+
$statusTable = $installer->getTable('sales/order_status');
|
66 |
+
$statusStateTable = $installer->getTable('sales/order_status_state');
|
67 |
+
|
68 |
+
|
69 |
+
// Delete if order status exist
|
70 |
+
$installer->run('
|
71 |
+
delete from ' . $statusTable . ' where status = "cardconnect_capture";
|
72 |
+
delete from ' . $statusTable . ' where status = "cardconnect_void";
|
73 |
+
delete from ' . $statusTable . ' where status = "cardconnect_refund";
|
74 |
+
delete from ' . $statusTable . ' where status = "cardconnect_reject";
|
75 |
+
delete from ' . $statusTable . ' where status = "cardconnect_txn_settled";
|
76 |
+
delete from ' . $statusTable . ' where status = "cardconnect_processing";
|
77 |
+
');
|
78 |
+
|
79 |
+
// Insert status
|
80 |
+
$installer->getConnection()->insertArray(
|
81 |
+
$statusTable, array(
|
82 |
+
'status',
|
83 |
+
'label'
|
84 |
+
), array(
|
85 |
+
array('status' => 'cardconnect_capture', 'label' => 'CardConnect Capture'),
|
86 |
+
array('status' => 'cardconnect_void', 'label' => 'CardConnect Void'),
|
87 |
+
array('status' => 'cardconnect_refund', 'label' => 'CardConnect Refund'),
|
88 |
+
array('status' => 'cardconnect_reject', 'label' => 'CardConnect Rejected'),
|
89 |
+
array('status' => 'cardconnect_txn_settled', 'label' => 'CardConnect Txn Settled'),
|
90 |
+
array('status' => 'cardconnect_processing', 'label' => 'CardConnect Processing')
|
91 |
+
)
|
92 |
+
);
|
93 |
+
|
94 |
+
|
95 |
+
// Insert states and mapping of statuses to states
|
96 |
+
$installer->getConnection()->insertArray(
|
97 |
+
$statusStateTable,
|
98 |
+
array(
|
99 |
+
'status',
|
100 |
+
'state',
|
101 |
+
'is_default'
|
102 |
+
),
|
103 |
+
array(
|
104 |
+
array(
|
105 |
+
'status' => 'cardconnect_refund',
|
106 |
+
'state' => 'refunded',
|
107 |
+
'is_default' => 1
|
108 |
+
)
|
109 |
+
)
|
110 |
+
);
|
111 |
+
|
112 |
+
|
113 |
+
$installer->run("
|
114 |
+
DROP TABLE IF EXISTS {$this->getTable('cardconnect_wallet')};
|
115 |
+
CREATE TABLE {$this->getTable('cardconnect_wallet')} (
|
116 |
+
`CC_ID` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
117 |
+
`CC_USER_ID` BIGINT NOT NULL COMMENT 'Customer Id',
|
118 |
+
`CC_PROFILEID` VARCHAR(50) NOT NULL COMMENT 'CC Profile Id',
|
119 |
+
`CC_ACCTID` BIGINT NOT NULL,
|
120 |
+
`CC_MASK` VARCHAR(50),
|
121 |
+
`CC_CARD_NAME` VARCHAR(50) COMMENT 'Alias',
|
122 |
+
`CC_DEFAULT_CARD` ENUM('Y','N') DEFAULT 'N',
|
123 |
+
`CC_CREATED` DATETIME
|
124 |
+
|
125 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
126 |
+
|
127 |
+
CREATE INDEX CC_USER_ID_INDEX ON {$this->getTable('cardconnect_wallet')} (CC_USER_ID);
|
128 |
+
CREATE INDEX CC_PROFILEID_INDEX ON {$this->getTable('cardconnect_wallet')} (CC_PROFILEID);
|
129 |
+
CREATE INDEX CC_ACCTID_INDEX ON {$this->getTable('cardconnect_wallet')} (CC_ACCTID);
|
130 |
+
|
131 |
+
");
|
132 |
+
|
133 |
+
|
134 |
+
$installer->endSetup();
|
135 |
+
|
136 |
+
|
app/design/adminhtml/default/default/layout/ccgateway.xml
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* @brief To Add Js file in Admin
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
**/
|
14 |
-
|
15 |
-
|
16 |
-
/**
|
17 |
-
Magento
|
18 |
-
*
|
19 |
-
NOTICE OF LICENSE
|
20 |
-
*
|
21 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
22 |
-
that is bundled with this package in the file LICENSE.txt.
|
23 |
-
It is also available through the world-wide-web at this URL:
|
24 |
-
http://opensource.org/licenses/osl-3.0.php
|
25 |
-
If you did not receive a copy of the license and are unable to
|
26 |
-
obtain it through the world-wide-web, please send an email
|
27 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
28 |
-
*
|
29 |
-
@category Cardconnect
|
30 |
-
@package Cardconnect_Ccgateway
|
31 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
32 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
33 |
-
*/
|
34 |
-
-->
|
35 |
-
|
36 |
-
<layout version="0.1.0">
|
37 |
-
<adminhtml_sales_order_create_index>
|
38 |
-
<reference name="head">
|
39 |
-
<action method="addJs"><script>cardconnect/ccgateway.js</script></action>
|
40 |
-
</reference>
|
41 |
-
</adminhtml_sales_order_create_index>
|
42 |
-
</layout>
|
43 |
-
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @brief To Add Js file in Admin
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
**/
|
14 |
+
|
15 |
+
|
16 |
+
/**
|
17 |
+
Magento
|
18 |
+
*
|
19 |
+
NOTICE OF LICENSE
|
20 |
+
*
|
21 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
22 |
+
that is bundled with this package in the file LICENSE.txt.
|
23 |
+
It is also available through the world-wide-web at this URL:
|
24 |
+
http://opensource.org/licenses/osl-3.0.php
|
25 |
+
If you did not receive a copy of the license and are unable to
|
26 |
+
obtain it through the world-wide-web, please send an email
|
27 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
28 |
+
*
|
29 |
+
@category Cardconnect
|
30 |
+
@package Cardconnect_Ccgateway
|
31 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
32 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
33 |
+
*/
|
34 |
+
-->
|
35 |
+
|
36 |
+
<layout version="0.1.0">
|
37 |
+
<adminhtml_sales_order_create_index>
|
38 |
+
<reference name="head">
|
39 |
+
<action method="addJs"><script>cardconnect/ccgateway.js</script></action>
|
40 |
+
</reference>
|
41 |
+
</adminhtml_sales_order_create_index>
|
42 |
+
</layout>
|
43 |
+
|
app/design/adminhtml/default/default/template/ccgateway/form.phtml
CHANGED
@@ -1,120 +1,121 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the html for show Payment Information Block on Reorder
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
* */
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
<style>
|
33 |
-
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px; display:none;}
|
34 |
-
.loader{position:absolute; top:80%; left:50%;}
|
35 |
-
</style>
|
36 |
-
<fieldset class="form-list">
|
37 |
-
<?php $_code = $this->getMethodCode();
|
38 |
-
$isTestMode = $this->isTransactionModeTest();
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
<
|
50 |
-
<
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
<
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
<?php
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
<
|
71 |
-
|
72 |
-
<input type="
|
73 |
-
<
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
<div id="
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
<
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
<?php
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
<
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the html for show Payment Information Block on Reorder
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
* */
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<style>
|
33 |
+
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px; display:none;}
|
34 |
+
.loader{position:absolute; top:80%; left:50%;}
|
35 |
+
</style>
|
36 |
+
<fieldset class="form-list">
|
37 |
+
<?php $_code = $this->getMethodCode();
|
38 |
+
$isTestMode = $this->isTransactionModeTest();
|
39 |
+
$siteName = Mage::helper('ccgateway')->getSiteName();
|
40 |
+
?>
|
41 |
+
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
42 |
+
<?php if ($this->getCheckoutType() == "payment_page") { ?>
|
43 |
+
<li>
|
44 |
+
<?php echo Mage::helper('ccgateway')->__('You will be redirected to CardConnect website when you place an order.') ?>
|
45 |
+
</li>
|
46 |
+
<?php } else { ?>
|
47 |
+
|
48 |
+
<li>
|
49 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
50 |
+
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
51 |
+
<div class="input-box">
|
52 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->escapeHtml($this->getInfoData('cc_owner')) ?>" />
|
53 |
+
</div>
|
54 |
+
</li>
|
55 |
+
<li>
|
56 |
+
<label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
57 |
+
<div class="input-box">
|
58 |
+
|
59 |
+
<select id="ccgateway_cc_type" name="payment[cc_type]" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry validate-select" onchange="resetcardinfo();">
|
60 |
+
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
61 |
+
<?php $_ccType = $this->getInfoData('cc_type'); ?>
|
62 |
+
<?php foreach ($this->getCcTypes() as $ccType): ?>
|
63 |
+
<option value="<?php echo $ccType['value']; ?>"<?php if ($ccType['value'] == $_ccType): ?> selected="selected"<?php endif ?>><?php echo $ccType['label']; ?></option>
|
64 |
+
<?php endforeach ?>
|
65 |
+
</select>
|
66 |
+
</div>
|
67 |
+
</li>
|
68 |
+
|
69 |
+
<li>
|
70 |
+
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
71 |
+
<div class="input-box">
|
72 |
+
<input type="text" onchange="valid_credit_card(value, '<?php echo $isTestMode; ?>', '<?php echo $siteName; ?>')" onkeypress="javascript:return validate(event , 'ccgateway_cc_number_org'); blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="payment[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="<?php if($this->getInfoData('cc_number')){ echo substr_replace($this->getInfoData('cc_number'), str_repeat('*', 12), 0, 12); } ?>" />
|
73 |
+
<input type="hidden" id="<?php // echo $_code ?>ccgateway_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text" value="<?php echo $this->getInfoData('cc_number')?>" />
|
74 |
+
<div class="validation-advice" id="testError" style="display: none;"></div>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
</li>
|
78 |
+
<li><div id="response"></div></li>
|
79 |
+
<div id="fade" style="display:none;">
|
80 |
+
<div id="loading_box" class="loader"></div>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<li>
|
84 |
+
<label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
|
85 |
+
<div class="input-box">
|
86 |
+
<div class="v-fix">
|
87 |
+
<select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
|
88 |
+
<?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
|
89 |
+
<?php foreach ($this->getCcMonths() as $k => $v): ?>
|
90 |
+
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
91 |
+
<?php endforeach ?>
|
92 |
+
</select>
|
93 |
+
</div>
|
94 |
+
<div class="v-fix">
|
95 |
+
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
96 |
+
<select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
|
97 |
+
<?php foreach ($this->getCcYears() as $k => $v): ?>
|
98 |
+
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
99 |
+
<?php endforeach ?>
|
100 |
+
</select>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
</div>
|
104 |
+
</li>
|
105 |
+
<li>
|
106 |
+
<label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
|
107 |
+
<div class="input-box">
|
108 |
+
<div class="v-fix">
|
109 |
+
<input type="text" onkeypress="javascript:return validate(event , 'ccgateway_cc_cid' ); blockNonNumbers(this, event, false, false)" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry" id="ccgateway_cc_cid" name="payment[cc_cid]" value="<?php echo $this->getInfoData('cc_cid') ?>" />
|
110 |
+
</div>
|
111 |
+
<!-- <a href="#" class="cvv-what-is-this"><?php // echo $this->__('What is this?') ?></a> -->
|
112 |
+
</div>
|
113 |
+
</li>
|
114 |
+
|
115 |
+
<?php echo $this->getChildHtml() ?>
|
116 |
+
<?php } ?>
|
117 |
+
|
118 |
+
</ul>
|
119 |
+
|
120 |
+
</fieldset>
|
121 |
+
|
app/design/adminhtml/default/default/template/ccgateway/info.phtml
CHANGED
@@ -1,141 +1,141 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Representing CardConnect Payment information in admin
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
|
33 |
-
if ($info = $this->getInfo()) {
|
34 |
-
?>
|
35 |
-
|
36 |
-
<style type="text/css">
|
37 |
-
th{ text-align: center; vertical-align: middle;}
|
38 |
-
</style>
|
39 |
-
|
40 |
-
<div class="grid np">
|
41 |
-
<div class="hor-scroll">
|
42 |
-
<table cellspacing="0" class="data order-tables">
|
43 |
-
<thead>
|
44 |
-
<tr class="headings">
|
45 |
-
<th><span class="nobr"><?php echo $this->helper('sales')->__('Order Id') ?></span></th>
|
46 |
-
<th><span class="nobr"><?php echo $this->helper('sales')->__('Action') ?></span></th>
|
47 |
-
<th><span class="nobr"><?php echo $this->helper('sales')->__('Retrieval') ?><br/>Reference Number</span></th>
|
48 |
-
<th class="a-center"><?php echo $this->helper('sales')->__('Response') ?><br/>Status</th>
|
49 |
-
<th><span class="nobr"><?php echo $this->helper('sales')->__('Response Code') ?></span></th>
|
50 |
-
<th><span class="nobr"><?php echo $this->helper('sales')->__('Response ') ?><br/>Text</span></th>
|
51 |
-
<th><span class="nobr"><?php echo $this->helper('sales')->__('Response ') ?><br/>Processor</span></th>
|
52 |
-
<th><span class="nobr"><?php echo $this->helper('sales')->__('Authorization') ?><br/>Code</span></th>
|
53 |
-
<th><span class="nobr"><?php echo $this->helper('sales')->__('Authorization') ?><br/>Date</span></th>
|
54 |
-
<th><span class="nobr"><?php echo $this->helper('sales')->__('Avs Result') ?></span></th>
|
55 |
-
<th><span class="nobr"><?php echo $this->helper('sales')->__('Cvv Result') ?></span></th>
|
56 |
-
<th class="last"><span class="nobr"><?php echo $this->helper('sales')->__('Order Amount') ?></span></th>
|
57 |
-
</tr>
|
58 |
-
</thead>
|
59 |
-
<tbody>
|
60 |
-
|
61 |
-
<?php
|
62 |
-
|
63 |
-
$responseData = $this->getPaymentResponseData();
|
64 |
-
|
65 |
-
foreach ($responseData as $data) {
|
66 |
-
$orderId = $data->getData('CC_ORDERID');
|
67 |
-
$ccAction = $data->getData('CC_ACTION');
|
68 |
-
$retrefRefrenceNumber = $data->getData('CC_RETREF');
|
69 |
-
$responseStatus = $data->getData('CC_RESPSTAT');
|
70 |
-
$responseProcessor = $data->getData('CC_RESPPROC');
|
71 |
-
$responseCode = $data->getData('CC_RESPCODE');
|
72 |
-
$responseText = $data->getData('CC_RESPTEXT');
|
73 |
-
$authDesc = $data->getData('CC_AUTHCODE');
|
74 |
-
$avsResp = $data->getData('CC_AVSRESP');
|
75 |
-
$cvvResp = $data->getData('CC_CVVRESP');
|
76 |
-
$amount = $data->getData('CC_AMT');
|
77 |
-
$authDate = $data->getData('CC_CREATED');
|
78 |
-
|
79 |
-
if (strpos($ccAction, '_')) {
|
80 |
-
$ccAction = str_replace("_", " and ", $ccAction);
|
81 |
-
}
|
82 |
-
if(empty($responseStatus)) { $responseStatus = "N/A"; }
|
83 |
-
if(empty($responseProcessor)) { $responseProcessor = "N/A"; }
|
84 |
-
if(empty($responseCode)) { $responseCode = "N/A"; }
|
85 |
-
if(empty($authDesc)) { $authDesc = "N/A"; }
|
86 |
-
if(empty($avsResp)) { $avsResp = "N/A"; }
|
87 |
-
if(empty($cvvResp)) { $cvvResp = "N/A"; }
|
88 |
-
// $authDate = Mage::getModel('core/date')->date('d/m/Y H:i:s', strtotime($authDate));
|
89 |
-
$authDate = Mage::helper('core')->formatTime($authDate, 'short', TRUE);
|
90 |
-
?>
|
91 |
-
<tr>
|
92 |
-
<td><?php echo $orderId; ?></td>
|
93 |
-
<td><?php echo ucfirst($ccAction); ?></td>
|
94 |
-
<td><?php echo $retrefRefrenceNumber; ?></td>
|
95 |
-
<td><?php echo $responseStatus; ?></td>
|
96 |
-
<td><?php echo $responseCode; ?></td>
|
97 |
-
<td><?php echo $responseText; ?></td>
|
98 |
-
<td><?php echo $responseProcessor; ?></td>
|
99 |
-
<td><?php echo $authDesc; ?></td>
|
100 |
-
<td><?php echo $authDate; ?></td>
|
101 |
-
<td><?php echo $avsResp; ?></td>
|
102 |
-
<td><?php echo $cvvResp; ?></td>
|
103 |
-
<td><?php echo $amount; ?></td>
|
104 |
-
</tr>
|
105 |
-
|
106 |
-
|
107 |
-
<?php
|
108 |
-
}
|
109 |
-
?>
|
110 |
-
|
111 |
-
|
112 |
-
</tbody>
|
113 |
-
|
114 |
-
</table>
|
115 |
-
</div>
|
116 |
-
</div>
|
117 |
-
|
118 |
-
<br />
|
119 |
-
<button id="id_inquire" title="Inquire" onclick="callInquireController();" type="button" class="submit" ><span><span><span>Inquire</span></span></span></button>
|
120 |
-
<br />
|
121 |
-
<?php
|
122 |
-
}
|
123 |
-
if(!empty($orderId)){
|
124 |
-
?>
|
125 |
-
|
126 |
-
<script type="text/javascript">
|
127 |
-
|
128 |
-
|
129 |
-
function callInquireController(){
|
130 |
-
|
131 |
-
new Ajax.Request("<?php echo $this->getUrl('ccgateway/payment/inquire') ?>", {
|
132 |
-
method: 'Post',
|
133 |
-
parameters: {orderId:<?php echo $orderId; ?>},
|
134 |
-
onComplete: function(transport) {
|
135 |
-
alert(transport.responseText);
|
136 |
-
window.location.reload();
|
137 |
-
}
|
138 |
-
});
|
139 |
-
}
|
140 |
-
</script>
|
141 |
-
<?php } ?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Representing CardConnect Payment information in admin
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
|
33 |
+
if ($info = $this->getInfo()) {
|
34 |
+
?>
|
35 |
+
|
36 |
+
<style type="text/css">
|
37 |
+
th{ text-align: center; vertical-align: middle;}
|
38 |
+
</style>
|
39 |
+
|
40 |
+
<div class="grid np">
|
41 |
+
<div class="hor-scroll">
|
42 |
+
<table cellspacing="0" class="data order-tables">
|
43 |
+
<thead>
|
44 |
+
<tr class="headings">
|
45 |
+
<th><span class="nobr"><?php echo $this->helper('sales')->__('Order Id') ?></span></th>
|
46 |
+
<th><span class="nobr"><?php echo $this->helper('sales')->__('Action') ?></span></th>
|
47 |
+
<th><span class="nobr"><?php echo $this->helper('sales')->__('Retrieval') ?><br/>Reference Number</span></th>
|
48 |
+
<th class="a-center"><?php echo $this->helper('sales')->__('Response') ?><br/>Status</th>
|
49 |
+
<th><span class="nobr"><?php echo $this->helper('sales')->__('Response Code') ?></span></th>
|
50 |
+
<th><span class="nobr"><?php echo $this->helper('sales')->__('Response ') ?><br/>Text</span></th>
|
51 |
+
<th><span class="nobr"><?php echo $this->helper('sales')->__('Response ') ?><br/>Processor</span></th>
|
52 |
+
<th><span class="nobr"><?php echo $this->helper('sales')->__('Authorization') ?><br/>Code</span></th>
|
53 |
+
<th><span class="nobr"><?php echo $this->helper('sales')->__('Authorization') ?><br/>Date</span></th>
|
54 |
+
<th><span class="nobr"><?php echo $this->helper('sales')->__('Avs Result') ?></span></th>
|
55 |
+
<th><span class="nobr"><?php echo $this->helper('sales')->__('Cvv Result') ?></span></th>
|
56 |
+
<th class="last"><span class="nobr"><?php echo $this->helper('sales')->__('Order Amount') ?></span></th>
|
57 |
+
</tr>
|
58 |
+
</thead>
|
59 |
+
<tbody>
|
60 |
+
|
61 |
+
<?php
|
62 |
+
|
63 |
+
$responseData = $this->getPaymentResponseData();
|
64 |
+
|
65 |
+
foreach ($responseData as $data) {
|
66 |
+
$orderId = $data->getData('CC_ORDERID');
|
67 |
+
$ccAction = $data->getData('CC_ACTION');
|
68 |
+
$retrefRefrenceNumber = $data->getData('CC_RETREF');
|
69 |
+
$responseStatus = $data->getData('CC_RESPSTAT');
|
70 |
+
$responseProcessor = $data->getData('CC_RESPPROC');
|
71 |
+
$responseCode = $data->getData('CC_RESPCODE');
|
72 |
+
$responseText = $data->getData('CC_RESPTEXT');
|
73 |
+
$authDesc = $data->getData('CC_AUTHCODE');
|
74 |
+
$avsResp = $data->getData('CC_AVSRESP');
|
75 |
+
$cvvResp = $data->getData('CC_CVVRESP');
|
76 |
+
$amount = $data->getData('CC_AMT');
|
77 |
+
$authDate = $data->getData('CC_CREATED');
|
78 |
+
|
79 |
+
if (strpos($ccAction, '_')) {
|
80 |
+
$ccAction = str_replace("_", " and ", $ccAction);
|
81 |
+
}
|
82 |
+
if(empty($responseStatus)) { $responseStatus = "N/A"; }
|
83 |
+
if(empty($responseProcessor)) { $responseProcessor = "N/A"; }
|
84 |
+
if(empty($responseCode)) { $responseCode = "N/A"; }
|
85 |
+
if(empty($authDesc)) { $authDesc = "N/A"; }
|
86 |
+
if(empty($avsResp)) { $avsResp = "N/A"; }
|
87 |
+
if(empty($cvvResp)) { $cvvResp = "N/A"; }
|
88 |
+
// $authDate = Mage::getModel('core/date')->date('d/m/Y H:i:s', strtotime($authDate));
|
89 |
+
$authDate = Mage::helper('core')->formatTime($authDate, 'short', TRUE);
|
90 |
+
?>
|
91 |
+
<tr>
|
92 |
+
<td><?php echo $orderId; ?></td>
|
93 |
+
<td><?php echo ucfirst($ccAction); ?></td>
|
94 |
+
<td><?php echo $retrefRefrenceNumber; ?></td>
|
95 |
+
<td><?php echo $responseStatus; ?></td>
|
96 |
+
<td><?php echo $responseCode; ?></td>
|
97 |
+
<td><?php echo $responseText; ?></td>
|
98 |
+
<td><?php echo $responseProcessor; ?></td>
|
99 |
+
<td><?php echo $authDesc; ?></td>
|
100 |
+
<td><?php echo $authDate; ?></td>
|
101 |
+
<td><?php echo $avsResp; ?></td>
|
102 |
+
<td><?php echo $cvvResp; ?></td>
|
103 |
+
<td><?php echo $amount; ?></td>
|
104 |
+
</tr>
|
105 |
+
|
106 |
+
|
107 |
+
<?php
|
108 |
+
}
|
109 |
+
?>
|
110 |
+
|
111 |
+
|
112 |
+
</tbody>
|
113 |
+
|
114 |
+
</table>
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
|
118 |
+
<br />
|
119 |
+
<button id="id_inquire" title="Inquire" onclick="callInquireController();" type="button" class="submit" ><span><span><span>Inquire</span></span></span></button>
|
120 |
+
<br />
|
121 |
+
<?php
|
122 |
+
}
|
123 |
+
if(!empty($orderId)){
|
124 |
+
?>
|
125 |
+
|
126 |
+
<script type="text/javascript">
|
127 |
+
|
128 |
+
|
129 |
+
function callInquireController(){
|
130 |
+
|
131 |
+
new Ajax.Request("<?php echo $this->getUrl('ccgateway/payment/inquire') ?>", {
|
132 |
+
method: 'Post',
|
133 |
+
parameters: {orderId:<?php echo $orderId; ?>},
|
134 |
+
onComplete: function(transport) {
|
135 |
+
alert(transport.responseText);
|
136 |
+
window.location.reload();
|
137 |
+
}
|
138 |
+
});
|
139 |
+
}
|
140 |
+
</script>
|
141 |
+
<?php } ?>
|
app/design/frontend/base/default/layout/ccgateway.xml
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* @brief To redirect to CardConnect payment page
|
5 |
-
* @category Magento CardConnect Payment Module
|
6 |
-
* @author CardConnect
|
7 |
-
* @copyright Portions copyright 2014 CardConnect
|
8 |
-
* @copyright Portions copyright Magento 2014
|
9 |
-
* @license GPL v2, please see LICENSE.txt
|
10 |
-
* @access public
|
11 |
-
* @version $Id: $
|
12 |
-
*
|
13 |
-
**/
|
14 |
-
|
15 |
-
|
16 |
-
/**
|
17 |
-
Magento
|
18 |
-
*
|
19 |
-
NOTICE OF LICENSE
|
20 |
-
*
|
21 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
22 |
-
that is bundled with this package in the file LICENSE.txt.
|
23 |
-
It is also available through the world-wide-web at this URL:
|
24 |
-
http://opensource.org/licenses/osl-3.0.php
|
25 |
-
If you did not receive a copy of the license and are unable to
|
26 |
-
obtain it through the world-wide-web, please send an email
|
27 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
28 |
-
*
|
29 |
-
@category Cardconnect
|
30 |
-
@package Cardconnect_Ccgateway
|
31 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
32 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
33 |
-
*/
|
34 |
-
-->
|
35 |
-
|
36 |
-
<layout version="0.1.0">
|
37 |
-
<ccgateway_payment_redirect>
|
38 |
-
<reference name="root">
|
39 |
-
<action method="setTemplate">
|
40 |
-
<template>ccgateway/blank.phtml</template>
|
41 |
-
</action>
|
42 |
-
</reference>
|
43 |
-
<reference name="content">
|
44 |
-
<block type="ccgateway/redirect" name="ccgateway_redirect" template="ccgateway/redirect.phtml" />
|
45 |
-
</reference>
|
46 |
-
</ccgateway_payment_redirect>
|
47 |
-
|
48 |
-
<default>
|
49 |
-
<reference name="head">
|
50 |
-
<action method="addJs">
|
51 |
-
<script>cardconnect/ccgateway.js</script>
|
52 |
-
</action>
|
53 |
-
</reference>
|
54 |
-
</default>
|
55 |
-
|
56 |
-
<customer_account translate="label">
|
57 |
-
<reference name="customer_account_navigation">
|
58 |
-
<action method="addLink">
|
59 |
-
<name>Card Management</name>
|
60 |
-
<path>customer/cardmanagement/</path>
|
61 |
-
<label>Card Management</label>
|
62 |
-
</action>
|
63 |
-
</reference>
|
64 |
-
</customer_account>
|
65 |
-
|
66 |
-
<customer_cardmanagement_index>
|
67 |
-
<update handle="customer_account"/>
|
68 |
-
<reference name="my.account.wrapper">
|
69 |
-
<block type="ccgateway/cardmanagement" name="customer_walletcard_management" template="ccgateway/cardmanagement/index.phtml" />
|
70 |
-
</reference>
|
71 |
-
</customer_cardmanagement_index>
|
72 |
-
|
73 |
-
<customer_cardmanagement_new>
|
74 |
-
<update handle="customer_account"/>
|
75 |
-
<reference name="my.account.wrapper">
|
76 |
-
<block type="ccgateway/cardmanagement" name="customer_walletcard_management" template="ccgateway/cardmanagement/new.phtml" />
|
77 |
-
</reference>
|
78 |
-
</customer_cardmanagement_new>
|
79 |
-
|
80 |
-
<customer_cardmanagement_editcard>
|
81 |
-
<update handle="customer_account"/>
|
82 |
-
<reference name="my.account.wrapper">
|
83 |
-
<block type="ccgateway/cardmanagement" name="customer_walletcard_management" template="ccgateway/cardmanagement/editcard.phtml" />
|
84 |
-
</reference>
|
85 |
-
</customer_cardmanagement_editcard>
|
86 |
-
</layout>
|
87 |
-
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @brief To redirect to CardConnect payment page
|
5 |
+
* @category Magento CardConnect Payment Module
|
6 |
+
* @author CardConnect
|
7 |
+
* @copyright Portions copyright 2014 CardConnect
|
8 |
+
* @copyright Portions copyright Magento 2014
|
9 |
+
* @license GPL v2, please see LICENSE.txt
|
10 |
+
* @access public
|
11 |
+
* @version $Id: $
|
12 |
+
*
|
13 |
+
**/
|
14 |
+
|
15 |
+
|
16 |
+
/**
|
17 |
+
Magento
|
18 |
+
*
|
19 |
+
NOTICE OF LICENSE
|
20 |
+
*
|
21 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
22 |
+
that is bundled with this package in the file LICENSE.txt.
|
23 |
+
It is also available through the world-wide-web at this URL:
|
24 |
+
http://opensource.org/licenses/osl-3.0.php
|
25 |
+
If you did not receive a copy of the license and are unable to
|
26 |
+
obtain it through the world-wide-web, please send an email
|
27 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
28 |
+
*
|
29 |
+
@category Cardconnect
|
30 |
+
@package Cardconnect_Ccgateway
|
31 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
32 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
33 |
+
*/
|
34 |
+
-->
|
35 |
+
|
36 |
+
<layout version="0.1.0">
|
37 |
+
<ccgateway_payment_redirect>
|
38 |
+
<reference name="root">
|
39 |
+
<action method="setTemplate">
|
40 |
+
<template>ccgateway/blank.phtml</template>
|
41 |
+
</action>
|
42 |
+
</reference>
|
43 |
+
<reference name="content">
|
44 |
+
<block type="ccgateway/redirect" name="ccgateway_redirect" template="ccgateway/redirect.phtml" />
|
45 |
+
</reference>
|
46 |
+
</ccgateway_payment_redirect>
|
47 |
+
|
48 |
+
<default>
|
49 |
+
<reference name="head">
|
50 |
+
<action method="addJs">
|
51 |
+
<script>cardconnect/ccgateway.js</script>
|
52 |
+
</action>
|
53 |
+
</reference>
|
54 |
+
</default>
|
55 |
+
|
56 |
+
<customer_account translate="label">
|
57 |
+
<reference name="customer_account_navigation">
|
58 |
+
<action method="addLink">
|
59 |
+
<name>Card Management</name>
|
60 |
+
<path>customer/cardmanagement/</path>
|
61 |
+
<label>Card Management</label>
|
62 |
+
</action>
|
63 |
+
</reference>
|
64 |
+
</customer_account>
|
65 |
+
|
66 |
+
<customer_cardmanagement_index>
|
67 |
+
<update handle="customer_account"/>
|
68 |
+
<reference name="my.account.wrapper">
|
69 |
+
<block type="ccgateway/cardmanagement" name="customer_walletcard_management" template="ccgateway/cardmanagement/index.phtml" />
|
70 |
+
</reference>
|
71 |
+
</customer_cardmanagement_index>
|
72 |
+
|
73 |
+
<customer_cardmanagement_new>
|
74 |
+
<update handle="customer_account"/>
|
75 |
+
<reference name="my.account.wrapper">
|
76 |
+
<block type="ccgateway/cardmanagement" name="customer_walletcard_management" template="ccgateway/cardmanagement/new.phtml" />
|
77 |
+
</reference>
|
78 |
+
</customer_cardmanagement_new>
|
79 |
+
|
80 |
+
<customer_cardmanagement_editcard>
|
81 |
+
<update handle="customer_account"/>
|
82 |
+
<reference name="my.account.wrapper">
|
83 |
+
<block type="ccgateway/cardmanagement" name="customer_walletcard_management" template="ccgateway/cardmanagement/editcard.phtml" />
|
84 |
+
</reference>
|
85 |
+
</customer_cardmanagement_editcard>
|
86 |
+
</layout>
|
87 |
+
|
app/design/frontend/base/default/template/ccgateway/blank.phtml
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the html for show content
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
?>
|
33 |
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
34 |
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
|
35 |
-
<head>
|
36 |
-
</head>
|
37 |
-
<body>
|
38 |
-
<?php echo $this->getChildHtml('content') ?>
|
39 |
-
</body>
|
40 |
-
</html>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the html for show content
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
?>
|
33 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
34 |
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
|
35 |
+
<head>
|
36 |
+
</head>
|
37 |
+
<body>
|
38 |
+
<?php echo $this->getChildHtml('content') ?>
|
39 |
+
</body>
|
40 |
+
</html>
|
app/design/frontend/base/default/template/ccgateway/cardmanagement/editcard.phtml
CHANGED
@@ -1,268 +1,266 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the html for show Credit Card Dashbord
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
* */
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
|
33 |
-
|
34 |
-
<script>
|
35 |
-
|
36 |
-
document.observe("dom:loaded", function () {
|
37 |
-
|
38 |
-
|
39 |
-
var profile = "<?php echo $this->getRequest()->getParam('pid'); ?>";
|
40 |
-
var cid = "<?php echo $this->getRequest()->getParam('cardid'); ?>";
|
41 |
-
|
42 |
-
new Ajax.Request(requestUrl, {
|
43 |
-
|
44 |
-
method: 'Post',
|
45 |
-
parameters: {profile: profile, cc_id: cid},
|
46 |
-
requestHeaders: {Accept: 'application/json'},
|
47 |
-
onComplete: function (transport) {
|
48 |
-
|
49 |
-
|
50 |
-
if(response[0].resptext == "CardConnect_Error"){
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
<
|
101 |
-
</div>
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
<
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
<?php
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
<
|
146 |
-
|
147 |
-
<input type="
|
148 |
-
|
149 |
-
<input type="hidden" id="
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
<li
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
<?php
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
<?php
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
</form>
|
268 |
-
</fieldset>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the html for show Credit Card Dashbord
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
* */
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
|
33 |
+
|
34 |
+
<script>
|
35 |
+
|
36 |
+
document.observe("dom:loaded", function () {
|
37 |
+
|
38 |
+
var requestUrl = "<?php echo Mage::getUrl('ccgateway/payment/getprofiledataedit',array('_secure'=>true)); ?>";
|
39 |
+
var profile = "<?php echo $this->getRequest()->getParam('pid'); ?>";
|
40 |
+
var cid = "<?php echo $this->getRequest()->getParam('cardid'); ?>";
|
41 |
+
|
42 |
+
new Ajax.Request(requestUrl, {
|
43 |
+
onCreate : startLoading,
|
44 |
+
method: 'Post',
|
45 |
+
parameters: {profile: profile, cc_id: cid},
|
46 |
+
requestHeaders: {Accept: 'application/json'},
|
47 |
+
onComplete: function (transport) {
|
48 |
+
response = transport.responseText.evalJSON();
|
49 |
+
|
50 |
+
if(response[0].resptext == "CardConnect_Error"){
|
51 |
+
|
52 |
+
document.getElementById("customCheck").style.display = "block";
|
53 |
+
}else{
|
54 |
+
document.getElementById("customCheck").style.display = "none";
|
55 |
+
var preResp = "************";
|
56 |
+
var maskToken = response[0].token.substr(12);
|
57 |
+
var month = response[0].expiry.substr(0, 2);
|
58 |
+
month = month.replace(/^0+/, '');
|
59 |
+
var year = response[0].expiry.substr(2, 4);
|
60 |
+
|
61 |
+
document.getElementById("_cc_alias").value = response[1];
|
62 |
+
document.getElementById("ccgateway_cc_number_org").value = preResp + maskToken;
|
63 |
+
document.getElementById("ccgateway_cc_number").value = response[0].token;
|
64 |
+
document.getElementById("ccgateway_cc_profile").value = profile;
|
65 |
+
document.getElementById("ccgateway_cc_wallet_id").value = cid;
|
66 |
+
document.getElementById("ccgateway_cc_type").value = response[0].accttype;
|
67 |
+
document.getElementById("_cc_owner").value = response[0].name;
|
68 |
+
document.getElementById("ccgateway_expiration").value = month;
|
69 |
+
document.getElementById("ccgateway_expiration_yr").value = "20" + year;
|
70 |
+
document.getElementById("_cc_street").value = response[0].address;
|
71 |
+
document.getElementById("_cc_city").value = response[0].city;
|
72 |
+
document.getElementById("_cc_region").value = response[0].region;
|
73 |
+
document.getElementById("_cc_country").value = response[0].country;
|
74 |
+
document.getElementById("_cc_postcode").value = response[0].postal;
|
75 |
+
document.getElementById("_cc_telephone").value = response[0].phone;
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
stopLoading();
|
80 |
+
}
|
81 |
+
});
|
82 |
+
});
|
83 |
+
</script>
|
84 |
+
<style>
|
85 |
+
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px;}
|
86 |
+
.loader{position:absolute; top:80%; left:50%;}
|
87 |
+
</style>
|
88 |
+
|
89 |
+
<div id="customCheck" style="display: none;">
|
90 |
+
<ul class="message">
|
91 |
+
<li class="validation-advice"><ul><li><span>We are unable to perform the requested action, please contact customer service.</span></li></ul></li>
|
92 |
+
</ul>
|
93 |
+
</div>
|
94 |
+
|
95 |
+
<div class="page-title title-buttons">
|
96 |
+
<h1 onclick="getAlert();"><?php echo $this->__('Edit Card Form') ?></h1>
|
97 |
+
<button type="button" title="<?php echo $this->__('Go Back') ?>" class="button" onclick="window.location = '<?php echo $this->getUrl('customer/cardmanagement/') ?>';"><span><span><?php echo $this->__('Go Back') ?></span></span></button>
|
98 |
+
</div>
|
99 |
+
<div id="fade" style="display:none;">
|
100 |
+
<div id="loading_box" class="loader"></div>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<fieldset class="form-list">
|
104 |
+
<form id="editcard" name="editcard" method="post" action="<?php echo Mage::getUrl('ccgateway/cardmanagement/updateprofile',array('_secure'=>true)); ?>" onload="callGetProfileWebserviceController(<?php echo $this->getUrl('ccgateway/payment/getprofiledata'); ?>",profile);">
|
105 |
+
<?php
|
106 |
+
$_code = $this->getMethodCode();
|
107 |
+
$isTestMode = $this->isTransactionModeTest();
|
108 |
+
$siteName = Mage::helper('ccgateway')->getSiteName();
|
109 |
+
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
110 |
+
$billingAddress = $quote->getBillingAddress();
|
111 |
+
?>
|
112 |
+
<ul id="add_new_card_form_<?php echo $_code ?>" style="display:block">
|
113 |
+
|
114 |
+
<li>
|
115 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
116 |
+
<label for="<?php echo $_code ?>_cc_alias" class="required"><em>*</em><?php echo $this->__('Alias') ?></label>
|
117 |
+
<div class="input-box">
|
118 |
+
<input type="text" title="<?php echo $this->__('Alias') ?>" class="input-text required-entry validate-alphanum" id="<?php echo $_code ?>_cc_alias" name="editcard[cc_profile_name]" value="" required/>
|
119 |
+
</div>
|
120 |
+
</li>
|
121 |
+
<li>
|
122 |
+
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
123 |
+
<div class="input-box">
|
124 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="editcard[cc_owner]" value="" required />
|
125 |
+
</div>
|
126 |
+
</li>
|
127 |
+
<li>
|
128 |
+
<label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
129 |
+
<div class="input-box">
|
130 |
+
<select id="<?php echo $_code ?>ccgateway_cc_type" name='editcard[cc_type]' onchange="javascript:return resetcardinfo();" title="<?php echo $this->__('Credit Card Type') ?>" required >
|
131 |
+
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
132 |
+
<?php $_ccType = $this->getInfoData('cc_type'); ?>
|
133 |
+
<?php foreach ($this->getCcTypes() as $ccType): ?>
|
134 |
+
<option value="<?php echo $ccType['value']; ?>" ><?php echo $ccType['label']; ?></option>
|
135 |
+
<?php endforeach ?>
|
136 |
+
</select>
|
137 |
+
|
138 |
+
</div>
|
139 |
+
</li>
|
140 |
+
|
141 |
+
<li>
|
142 |
+
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
143 |
+
<div class="input-box">
|
144 |
+
|
145 |
+
<input type="text" onchange="valid_credit_card(value, '<?php echo $isTestMode; ?>', '<?php echo $siteName; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
|
146 |
+
blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="editcard[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="" required />
|
147 |
+
<input type="hidden" id="ccgateway_cc_number" name="editcard[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text" value="" required />
|
148 |
+
<input type="hidden" id="ccgateway_cc_profile" name="editcard[profile]" title="<?php echo $this->__('Customer Profile') ?>" class="input-text" value="" required />
|
149 |
+
<input type="hidden" id="ccgateway_cc_wallet_id" name="editcard[wallet_id]" title="<?php echo $this->__('Card wallet id') ?>" class="input-text" value="" required />
|
150 |
+
<div class="validation-advice" id="testError" style="display: none;"></div>
|
151 |
+
</div>
|
152 |
+
|
153 |
+
</li>
|
154 |
+
<li><div id="response"></div></li>
|
155 |
+
|
156 |
+
<li>
|
157 |
+
<label for="ccgateway_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
|
158 |
+
<div class="input-box">
|
159 |
+
<div class="v-fix">
|
160 |
+
<select id="ccgateway_expiration" name='editcard[cc_exp_month]' class="month validate-cc-exp required-entry" style="width: 150px;" required >
|
161 |
+
<?php foreach ($this->getCcMonths() as $k => $v): ?>
|
162 |
+
<option value="<?php echo $k ? $k : '' ?>"<?php #if ($k == $_ccExpMonth): ?> selected="selected"<?php #endif ?>><?php echo $v ?></option>
|
163 |
+
<?php endforeach ?>
|
164 |
+
</select>
|
165 |
+
</div>
|
166 |
+
<div class="v-fix">
|
167 |
+
<select id="ccgateway_expiration_yr" name='editcard[cc_exp_year]' class="year required-entry" style="width: 150px;" required >
|
168 |
+
<?php foreach ($this->getCcYears() as $k => $v): ?>
|
169 |
+
<option value="<?php echo $k ? $k : '' ?>"<?php #if ($k == $_ccExpYear): ?> selected="selected"<?php #endif ?>><?php echo $v ?></option>
|
170 |
+
<?php endforeach ?>
|
171 |
+
</select>
|
172 |
+
</div>
|
173 |
+
|
174 |
+
</div>
|
175 |
+
</li>
|
176 |
+
|
177 |
+
<div id="save_card" style="display:block;">
|
178 |
+
<li>
|
179 |
+
<label for="<?php echo $_code ?>_cc_street" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
180 |
+
<div class="input-box">
|
181 |
+
<input type="text" title="<?php echo $this->__('Street Address') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_street" name="editcard[cc_street]" value="" required />
|
182 |
+
</div>
|
183 |
+
</li>
|
184 |
+
<li>
|
185 |
+
<label for="<?php echo $_code ?>_cc_city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
186 |
+
<div class="input-box">
|
187 |
+
<input type="text" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_city" name="editcard[cc_city]" value="" required />
|
188 |
+
</div>
|
189 |
+
</li>
|
190 |
+
|
191 |
+
<li>
|
192 |
+
|
193 |
+
<label for="<?php echo $_code ?>_cc_region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
194 |
+
<div class="input-box">
|
195 |
+
<?php $regionCollection = Mage::getModel('directory/region_api')->items("US"); ?>
|
196 |
+
<select name='editcard[cc_region]' id='<?php echo $_code ?>_cc_region' required>
|
197 |
+
<option>Please select region, state or province</option>
|
198 |
+
<?php
|
199 |
+
foreach ($regionCollection as $region) {
|
200 |
+
?>
|
201 |
+
<option value="<?php echo $region['name'] ?>" <?php
|
202 |
+
if ($billingAddress->getRegion() == $region['name']) {
|
203 |
+
echo 'selected="selected"';
|
204 |
+
}
|
205 |
+
?> ><?php echo $region['name'] ?></option>
|
206 |
+
<?php
|
207 |
+
}
|
208 |
+
?>
|
209 |
+
|
210 |
+
</select>
|
211 |
+
</div>
|
212 |
+
|
213 |
+
</li>
|
214 |
+
|
215 |
+
<li>
|
216 |
+
<div class="field">
|
217 |
+
<label for="<?php echo $_code ?>_cc_country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
218 |
+
<div class="input-box">
|
219 |
+
<?php
|
220 |
+
$_countries = Mage::getResourceModel('directory/country_collection')
|
221 |
+
->loadData()
|
222 |
+
->toOptionArray(false)
|
223 |
+
?>
|
224 |
+
<?php if (count($_countries) > 0): ?>
|
225 |
+
<select name="editcard[cc_country]" id="<?php echo $_code ?>_cc_country" required>
|
226 |
+
<option value="">-- Please Select --</option>
|
227 |
+
<?php foreach ($_countries as $_country): ?>
|
228 |
+
<option value="<?php echo $_country['value'] ?>" <?php
|
229 |
+
if ($billingAddress->getCountryId() == $_country['value']) {
|
230 |
+
echo 'selected="selected"';
|
231 |
+
}
|
232 |
+
?>>
|
233 |
+
<?php echo $_country['label'] ?>
|
234 |
+
</option>
|
235 |
+
<?php endforeach; ?>
|
236 |
+
</select>
|
237 |
+
<?php endif; ?>
|
238 |
+
|
239 |
+
</div>
|
240 |
+
</div>
|
241 |
+
</li>
|
242 |
+
|
243 |
+
<li>
|
244 |
+
<label for="<?php echo $_code ?>_cc_postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
245 |
+
<div class="input-box">
|
246 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_postcode" name="editcard[cc_postcode]" value="" required />
|
247 |
+
</div>
|
248 |
+
</li>
|
249 |
+
<li>
|
250 |
+
<label for="<?php echo $_code ?>_cc_telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
251 |
+
<div class="input-box">
|
252 |
+
<input type="text" title="<?php echo $this->__('telephone') ?>" class="input-text required-entry" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
|
253 |
+
blockNonNumbers(this, event, false, false)" maxlength="10" id="<?php echo $_code ?>_cc_telephone" name="editcard[cc_telephone]" value="" required />
|
254 |
+
</div>
|
255 |
+
</li>
|
256 |
+
|
257 |
+
<button id="editcardbutton" class="button" style="margin-top: 10px;" type="submit" title="<?php echo $this->__('Update') ?>" class="button" onclick="<?php #echo $this->getUrl('ccgateway/cardmanagement/savecard'); ?>"><span><span><?php echo $this->__('Update') ?></span></span></button>
|
258 |
+
|
259 |
+
</div>
|
260 |
+
|
261 |
+
|
262 |
+
<?php echo $this->getChildHtml() ?>
|
263 |
+
|
264 |
+
</ul>
|
265 |
+
</form>
|
266 |
+
</fieldset>
|
Â
|
|
Â
|
app/design/frontend/base/default/template/ccgateway/cardmanagement/index.phtml
CHANGED
@@ -1,189 +1,189 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the html for show Credit Card Dashbord
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
* */
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
<style>
|
33 |
-
#t_head_row{
|
34 |
-
background-color: #3399CC !important;
|
35 |
-
text-align: center;
|
36 |
-
color: #fff;
|
37 |
-
}
|
38 |
-
#t_content_row{
|
39 |
-
text-align: left;
|
40 |
-
}
|
41 |
-
#t_content_row td{
|
42 |
-
padding-left: 10px;
|
43 |
-
}
|
44 |
-
#text_link{
|
45 |
-
color:#3399CC;
|
46 |
-
cursor: pointer;
|
47 |
-
}
|
48 |
-
#text_link:hover{
|
49 |
-
text-decoration: underline;
|
50 |
-
}
|
51 |
-
|
52 |
-
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px; display:none;}
|
53 |
-
.loader{position:absolute; top:80%; left:50%;}
|
54 |
-
</style>
|
55 |
-
|
56 |
-
|
57 |
-
<script>
|
58 |
-
function makeDefaultPayment(defaultId, value, id) {
|
59 |
-
|
60 |
-
var loadurl = '<?php echo Mage::getUrl('ccgateway/cardmanagement/makedefaultpayment',array('_secure'=>true)); ?>';
|
61 |
-
//Element.show('loadingmask');
|
62 |
-
new Ajax.Request(loadurl, {
|
63 |
-
onCreate : startLoading,
|
64 |
-
method: 'post',
|
65 |
-
parameters: "defaultId=" + defaultId + "&value=" + value + "&id=" + id,
|
66 |
-
onComplete: function (transport) {
|
67 |
-
document.getElementById('success-msg').style.display = "block";
|
68 |
-
document.getElementById('success-msg').innerHTML = transport.responseText;
|
69 |
-
stopLoading();
|
70 |
-
window.location.reload(100000);
|
71 |
-
}
|
72 |
-
});
|
73 |
-
}
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
function confirm_del(delId) {
|
78 |
-
|
79 |
-
var loc = document.getElementById('cardListGrid');
|
80 |
-
var conf = confirm("Are you sure to delete this?");
|
81 |
-
if (conf == true) {
|
82 |
-
var loadurl = '<?php echo Mage::getUrl('ccgateway/cardmanagement/deletewallet',array('_secure'=>true)); ?>';
|
83 |
-
|
84 |
-
new Ajax.Request(loadurl, {
|
85 |
-
onCreate : startLoading,
|
86 |
-
method: 'post',
|
87 |
-
parameters: "cc_id=" + delId,
|
88 |
-
onComplete: function (transport) {
|
89 |
-
alert(transport.responseText); //return false;
|
90 |
-
stopLoading();
|
91 |
-
document.getElementById('success-msg').style.display = "";
|
92 |
-
$('success-msg').innerHTML = transport.responseText;
|
93 |
-
window.location.reload();
|
94 |
-
}
|
95 |
-
});
|
96 |
-
} else {
|
97 |
-
alert('You cancelled to delete.');
|
98 |
-
}
|
99 |
-
}
|
100 |
-
|
101 |
-
|
102 |
-
var loaded = false;
|
103 |
-
function startLoading() {
|
104 |
-
loaded = false;
|
105 |
-
window.setTimeout('showLoadingImage()', 500);
|
106 |
-
}
|
107 |
-
|
108 |
-
function showLoadingImage() {
|
109 |
-
document.getElementById('fade').style.display ="block";
|
110 |
-
var el = document.getElementById("loading_box");
|
111 |
-
if (el && !loaded) {
|
112 |
-
|
113 |
-
el.innerHTML = '<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif'); ?>" alt="Loading...">';
|
114 |
-
new Effect.Appear('loading_box');
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
function stopLoading() {
|
119 |
-
document.getElementById('fade').style.display ="none";
|
120 |
-
Element.hide('loading_box');
|
121 |
-
loaded = true;
|
122 |
-
}
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
</script>
|
127 |
-
|
128 |
-
<div id="fade">
|
129 |
-
<div id="loading_box" class="loader"></div>
|
130 |
-
</div>
|
131 |
-
|
132 |
-
<div id="success-msg" style="display:none;">
|
133 |
-
<ul class="messages">
|
134 |
-
<li class="success-msg">
|
135 |
-
<ul class="success-msg">
|
136 |
-
<li><strong>Wallet Profile has been updated.</strong></li>
|
137 |
-
</ul>
|
138 |
-
</li>
|
139 |
-
</ul>
|
140 |
-
|
141 |
-
</div>
|
142 |
-
|
143 |
-
<div class="page-title title-buttons">
|
144 |
-
<h1><?php echo $this->__('Card Management') ?></h1>
|
145 |
-
<button type="button" title="<?php echo $this->__('Add New Card') ?>" class="button" onclick="window.location = '<?php echo $this->getAddUrl() ?>';"><span><span><?php echo $this->__('Add New Card') ?></span></span></button>
|
146 |
-
</div>
|
147 |
-
<div id="cardManagementGrid">
|
148 |
-
<table cellpadding="2" cellspacing="1" border="1" name="cardListGrid" id="cardListGrid" width="100%">
|
149 |
-
<?php $walletProfile = $this->getCCProfileName();
|
150 |
-
if (count($walletProfile) != 0) {
|
151 |
-
?>
|
152 |
-
<tr id="t_head_row">
|
153 |
-
<td>#</td>
|
154 |
-
<td>Card Name</td>
|
155 |
-
<td>Card Number</td>
|
156 |
-
<td>Action</td>
|
157 |
-
<td>Default</td>
|
158 |
-
</tr>
|
159 |
-
<?php
|
160 |
-
$i = 1;
|
161 |
-
foreach ($walletProfile as $val => $data) {
|
162 |
-
?>
|
163 |
-
<tr id="t_content_row">
|
164 |
-
<td><?php echo $i; ?></td>
|
165 |
-
<td><?php echo ucfirst($data['CC_CARD_NAME']); ?></td>
|
166 |
-
<td><?php echo substr_replace($data['CC_MASK'], '************', 0, 12); ?></td>
|
167 |
-
<td>
|
168 |
-
<a href="<?php echo $this->getEditUrl() . "?cardid=" . $data['CC_ID'] . "&pid=" . $data['CC_PROFILEID']; ?>">Edit</a>
|
169 |
-
<span id="text_link" <?php if ($data['CC_DEFAULT_CARD'] == 'Y' && count($walletProfile) !=1) { ?> style="display:none;" <?php } ?> onclick="confirm_del(<?php echo $data['CC_ID']; ?>);">Delete</span>
|
170 |
-
|
171 |
-
</td>
|
172 |
-
<td><input type="radio" name="defaultPaymentCard" id="defaultPaymentCard_<?php echo $i; ?>" onclick="javascript:makeDefaultPayment(this.id, this.value, <?php echo $data['CC_ID']; ?>);" <?php if ($data['CC_DEFAULT_CARD'] == 'Y') { ?> checked="checked" <?php } ?>value="<?php echo $data['CC_DEFAULT_CARD']; ?>" /> <?php // echo $data['CC_PROFILEID']; ?></td>
|
173 |
-
</tr>
|
174 |
-
<?php
|
175 |
-
$i++;
|
176 |
-
}
|
177 |
-
}else{
|
178 |
-
?>
|
179 |
-
<div>
|
180 |
-
<strong>No Card Found.</strong>
|
181 |
-
</div>
|
182 |
-
|
183 |
-
<?php } ?>
|
184 |
-
</table>
|
185 |
-
</div>
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the html for show Credit Card Dashbord
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
* */
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<style>
|
33 |
+
#t_head_row{
|
34 |
+
background-color: #3399CC !important;
|
35 |
+
text-align: center;
|
36 |
+
color: #fff;
|
37 |
+
}
|
38 |
+
#t_content_row{
|
39 |
+
text-align: left;
|
40 |
+
}
|
41 |
+
#t_content_row td{
|
42 |
+
padding-left: 10px;
|
43 |
+
}
|
44 |
+
#text_link{
|
45 |
+
color:#3399CC;
|
46 |
+
cursor: pointer;
|
47 |
+
}
|
48 |
+
#text_link:hover{
|
49 |
+
text-decoration: underline;
|
50 |
+
}
|
51 |
+
|
52 |
+
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px; display:none;}
|
53 |
+
.loader{position:absolute; top:80%; left:50%;}
|
54 |
+
</style>
|
55 |
+
|
56 |
+
|
57 |
+
<script>
|
58 |
+
function makeDefaultPayment(defaultId, value, id) {
|
59 |
+
|
60 |
+
var loadurl = '<?php echo Mage::getUrl('ccgateway/cardmanagement/makedefaultpayment',array('_secure'=>true)); ?>';
|
61 |
+
//Element.show('loadingmask');
|
62 |
+
new Ajax.Request(loadurl, {
|
63 |
+
onCreate : startLoading,
|
64 |
+
method: 'post',
|
65 |
+
parameters: "defaultId=" + defaultId + "&value=" + value + "&id=" + id,
|
66 |
+
onComplete: function (transport) {
|
67 |
+
document.getElementById('success-msg').style.display = "block";
|
68 |
+
document.getElementById('success-msg').innerHTML = transport.responseText;
|
69 |
+
stopLoading();
|
70 |
+
window.location.reload(100000);
|
71 |
+
}
|
72 |
+
});
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
function confirm_del(delId) {
|
78 |
+
|
79 |
+
var loc = document.getElementById('cardListGrid');
|
80 |
+
var conf = confirm("Are you sure to delete this?");
|
81 |
+
if (conf == true) {
|
82 |
+
var loadurl = '<?php echo Mage::getUrl('ccgateway/cardmanagement/deletewallet',array('_secure'=>true)); ?>';
|
83 |
+
|
84 |
+
new Ajax.Request(loadurl, {
|
85 |
+
onCreate : startLoading,
|
86 |
+
method: 'post',
|
87 |
+
parameters: "cc_id=" + delId,
|
88 |
+
onComplete: function (transport) {
|
89 |
+
alert(transport.responseText); //return false;
|
90 |
+
stopLoading();
|
91 |
+
document.getElementById('success-msg').style.display = "";
|
92 |
+
$('success-msg').innerHTML = transport.responseText;
|
93 |
+
window.location.reload();
|
94 |
+
}
|
95 |
+
});
|
96 |
+
} else {
|
97 |
+
alert('You cancelled to delete.');
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
|
102 |
+
var loaded = false;
|
103 |
+
function startLoading() {
|
104 |
+
loaded = false;
|
105 |
+
window.setTimeout('showLoadingImage()', 500);
|
106 |
+
}
|
107 |
+
|
108 |
+
function showLoadingImage() {
|
109 |
+
document.getElementById('fade').style.display ="block";
|
110 |
+
var el = document.getElementById("loading_box");
|
111 |
+
if (el && !loaded) {
|
112 |
+
|
113 |
+
el.innerHTML = '<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif'); ?>" alt="Loading...">';
|
114 |
+
new Effect.Appear('loading_box');
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
function stopLoading() {
|
119 |
+
document.getElementById('fade').style.display ="none";
|
120 |
+
Element.hide('loading_box');
|
121 |
+
loaded = true;
|
122 |
+
}
|
123 |
+
|
124 |
+
|
125 |
+
|
126 |
+
</script>
|
127 |
+
|
128 |
+
<div id="fade">
|
129 |
+
<div id="loading_box" class="loader"></div>
|
130 |
+
</div>
|
131 |
+
|
132 |
+
<div id="success-msg" style="display:none;">
|
133 |
+
<ul class="messages">
|
134 |
+
<li class="success-msg">
|
135 |
+
<ul class="success-msg">
|
136 |
+
<li><strong>Wallet Profile has been updated.</strong></li>
|
137 |
+
</ul>
|
138 |
+
</li>
|
139 |
+
</ul>
|
140 |
+
|
141 |
+
</div>
|
142 |
+
|
143 |
+
<div class="page-title title-buttons">
|
144 |
+
<h1><?php echo $this->__('Card Management') ?></h1>
|
145 |
+
<button type="button" title="<?php echo $this->__('Add New Card') ?>" class="button" onclick="window.location = '<?php echo $this->getAddUrl() ?>';"><span><span><?php echo $this->__('Add New Card') ?></span></span></button>
|
146 |
+
</div>
|
147 |
+
<div id="cardManagementGrid">
|
148 |
+
<table cellpadding="2" cellspacing="1" border="1" name="cardListGrid" id="cardListGrid" width="100%">
|
149 |
+
<?php $walletProfile = $this->getCCProfileName();
|
150 |
+
if (count($walletProfile) != 0) {
|
151 |
+
?>
|
152 |
+
<tr id="t_head_row">
|
153 |
+
<td>#</td>
|
154 |
+
<td>Card Name</td>
|
155 |
+
<td>Card Number</td>
|
156 |
+
<td>Action</td>
|
157 |
+
<td>Default</td>
|
158 |
+
</tr>
|
159 |
+
<?php
|
160 |
+
$i = 1;
|
161 |
+
foreach ($walletProfile as $val => $data) {
|
162 |
+
?>
|
163 |
+
<tr id="t_content_row">
|
164 |
+
<td><?php echo $i; ?></td>
|
165 |
+
<td><?php echo ucfirst($data['CC_CARD_NAME']); ?></td>
|
166 |
+
<td><?php echo substr_replace($data['CC_MASK'], '************', 0, 12); ?></td>
|
167 |
+
<td>
|
168 |
+
<a href="<?php echo $this->getEditUrl() . "?cardid=" . $data['CC_ID'] . "&pid=" . $data['CC_PROFILEID']; ?>">Edit</a>
|
169 |
+
<span id="text_link" <?php if ($data['CC_DEFAULT_CARD'] == 'Y' && count($walletProfile) !=1) { ?> style="display:none;" <?php } ?> onclick="confirm_del(<?php echo $data['CC_ID']; ?>);">Delete</span>
|
170 |
+
|
171 |
+
</td>
|
172 |
+
<td><input type="radio" name="defaultPaymentCard" id="defaultPaymentCard_<?php echo $i; ?>" onclick="javascript:makeDefaultPayment(this.id, this.value, <?php echo $data['CC_ID']; ?>);" <?php if ($data['CC_DEFAULT_CARD'] == 'Y') { ?> checked="checked" <?php } ?>value="<?php echo $data['CC_DEFAULT_CARD']; ?>" /> <?php // echo $data['CC_PROFILEID']; ?></td>
|
173 |
+
</tr>
|
174 |
+
<?php
|
175 |
+
$i++;
|
176 |
+
}
|
177 |
+
}else{
|
178 |
+
?>
|
179 |
+
<div>
|
180 |
+
<strong>No Card Found.</strong>
|
181 |
+
</div>
|
182 |
+
|
183 |
+
<?php } ?>
|
184 |
+
</table>
|
185 |
+
</div>
|
186 |
+
|
187 |
+
|
188 |
+
|
189 |
+
|
app/design/frontend/base/default/template/ccgateway/cardmanagement/new.phtml
CHANGED
@@ -1,236 +1,237 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the html for show Credit Card Dashbord
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
* */
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
<style>
|
33 |
-
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px; display:none;}
|
34 |
-
.loader{position:absolute; top:80%; left:50%;}
|
35 |
-
</style>
|
36 |
-
|
37 |
-
<?php
|
38 |
-
$_code = "ccgateway";
|
39 |
-
|
40 |
-
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
41 |
-
|
42 |
-
$
|
43 |
-
$
|
44 |
-
$
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
$
|
49 |
-
$
|
50 |
-
$
|
51 |
-
$
|
52 |
-
$
|
53 |
-
$
|
54 |
-
$
|
55 |
-
|
56 |
-
}
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
<
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
<
|
77 |
-
<
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
<
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
<
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
<
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
<
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
<
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
<
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
<
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
<?php
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
<
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
->
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
<
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
<
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
</
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the html for show Credit Card Dashbord
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
* */
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<style>
|
33 |
+
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px; display:none;}
|
34 |
+
.loader{position:absolute; top:80%; left:50%;}
|
35 |
+
</style>
|
36 |
+
|
37 |
+
<?php
|
38 |
+
$_code = "ccgateway";
|
39 |
+
|
40 |
+
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
41 |
+
$isTestMode = $this->isTransactionModeTest();
|
42 |
+
$siteName = Mage::helper('ccgateway')->getSiteName();
|
43 |
+
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
44 |
+
$customerId = $customerData->getId();
|
45 |
+
$address = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBillingAddress();
|
46 |
+
|
47 |
+
if($address){
|
48 |
+
$customer = Mage::getModel('customer/customer')->load($customerId);
|
49 |
+
$billingAddress = $customer->getDefaultBillingAddress();
|
50 |
+
$billingStreet = $billingAddress->getData('street');
|
51 |
+
$billingCity = $billingAddress->getData('city');
|
52 |
+
$billingRegion = $billingAddress->getData('region');
|
53 |
+
$billingCountry = $billingAddress->getData('country_id');
|
54 |
+
$billingPostCode = $billingAddress->getData('postcode');
|
55 |
+
$billingTelephone = $billingAddress->getData('telephone');
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
+
?>
|
62 |
+
<div class="page-title title-buttons">
|
63 |
+
<h1><?php echo $this->__('Add New Card Form') ?></h1>
|
64 |
+
<button type="button" title="<?php echo $this->__('Go Back') ?>" class="button" onclick="window.location = '<?php echo $this->getUrl('customer/cardmanagement/') ?>';"><span><span><?php echo $this->__('Go Back') ?></span></span></button>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
<div id="fade" style="display:none;">
|
68 |
+
<div id="loading_box" class="loader"></div>
|
69 |
+
</div>
|
70 |
+
|
71 |
+
<fieldset class="form-list">
|
72 |
+
<form name="addcard" method="post" action="<?php echo Mage::getUrl('ccgateway/cardmanagement/savePayment',array('_secure'=>true)); ?>">
|
73 |
+
<ul id="add_new_card_form_<?php echo $_code ?>" style="display:block">
|
74 |
+
|
75 |
+
<li>
|
76 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
77 |
+
<label for="<?php echo $_code ?>_cc_alias" class="required"><em>*</em><?php echo $this->__('Alias') ?></label>
|
78 |
+
<div class="input-box">
|
79 |
+
<input type="text" title="<?php echo $this->__('Alias') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_profile_name" name="addcard[cc_profile_name]" value="" required/>
|
80 |
+
</div>
|
81 |
+
</li>
|
82 |
+
<li>
|
83 |
+
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
84 |
+
<div class="input-box">
|
85 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="addcard[cc_owner]" value="<?php #echo $this->escapeHtml($this->getInfoData('cc_owner')) ?>" required />
|
86 |
+
</div>
|
87 |
+
</li>
|
88 |
+
<li>
|
89 |
+
<label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
90 |
+
<div class="input-box">
|
91 |
+
|
92 |
+
<select id="ccgateway_cc_type" name="addcard[cc_type]" onchange="resetcardinfo();" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry validate-select" required>
|
93 |
+
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
94 |
+
<?php foreach ($this->getCcTypes() as $ccType): ?>
|
95 |
+
<option value="<?php echo $ccType['value']; ?>" ><?php echo $ccType['label'] ?></option>
|
96 |
+
<?php endforeach ?>
|
97 |
+
</select>
|
98 |
+
</div>
|
99 |
+
</li>
|
100 |
+
|
101 |
+
<li>
|
102 |
+
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
103 |
+
<div class="input-box">
|
104 |
+
<input type="text" onblur="valid_credit_card(value, '<?php echo $isTestMode; ?>', '<?php echo $siteName; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
|
105 |
+
blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="addcard[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="" required />
|
106 |
+
<input type="hidden" id="ccgateway_cc_number" name="addcard[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text" value="" required />
|
107 |
+
<div class="validation-advice" id="testError" style="display: none;"></div>
|
108 |
+
</div>
|
109 |
+
|
110 |
+
</li>
|
111 |
+
<li><div id="response"></div></li>
|
112 |
+
|
113 |
+
<li>
|
114 |
+
<label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
|
115 |
+
<div class="input-box">
|
116 |
+
<div class="v-fix">
|
117 |
+
<select id="<?php echo $_code ?>_expiration" name="addcard[cc_exp_month]" class="month validate-cc-exp required-entry" style="width: 150px;" required>
|
118 |
+
<?php foreach ($this->getCcMonths() as $k => $v): ?>
|
119 |
+
<option value="<?php echo $k ? $k : '' ?>" ><?php echo $v ?></option>
|
120 |
+
<?php endforeach ?>
|
121 |
+
</select>
|
122 |
+
</div>
|
123 |
+
<div class="v-fix">
|
124 |
+
<select id="<?php echo $_code ?>_expiration_yr" name="addcard[cc_exp_year]" class="year required-entry" style="width: 150px;" required>
|
125 |
+
<?php foreach ($this->getCcYears() as $k => $v): ?>
|
126 |
+
<option value="<?php echo $k ? $k : '' ?>" ><?php echo $v ?></option>
|
127 |
+
<?php endforeach ?>
|
128 |
+
</select>
|
129 |
+
</div>
|
130 |
+
|
131 |
+
</div>
|
132 |
+
</li>
|
133 |
+
|
134 |
+
|
135 |
+
<li>
|
136 |
+
<label for="<?php echo $_code ?>_cc_Billing"><strong><?php echo $this->__('Billing Information') ?></strong></label>
|
137 |
+
</li>
|
138 |
+
<?php if($address){ ?>
|
139 |
+
<li>
|
140 |
+
<div class="input-box">
|
141 |
+
<div class="v-fix">
|
142 |
+
<span style="margin-bottom: 10px;">
|
143 |
+
<input type="checkbox" title="<?php echo $this->__('Use default bill to address') ?>"
|
144 |
+
onclick="javascript:return showDefaultAddress('<?php echo $billingStreet; ?>', '<?php echo $billingCity; ?>', '<?php echo $billingRegion; ?>', '<?php echo $billingCountry; ?>', '<?php echo $billingPostCode; ?>', '<?php echo $billingTelephone; ?>')"
|
145 |
+
id="ccgateway_default_address" name="addcard[default_address]" value="" />
|
146 |
+
</span>
|
147 |
+
<label for="<?php echo $_code ?>_cc_wallet"><?php echo $this->__('Use default bill to address') ?></label>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
|
151 |
+
</li>
|
152 |
+
<?php } ?>
|
153 |
+
|
154 |
+
<div id="save_card" style="display:block;">
|
155 |
+
<li>
|
156 |
+
<label for="<?php echo $_code ?>_cc_street" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
157 |
+
<div class="input-box">
|
158 |
+
<input type="text" title="<?php echo $this->__('Street Address') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_street" name="addcard[cc_street]" value="" required />
|
159 |
+
</div>
|
160 |
+
</li>
|
161 |
+
<li>
|
162 |
+
<label for="<?php echo $_code ?>_cc_city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
163 |
+
<div class="input-box">
|
164 |
+
<input type="text" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_city" name="addcard[cc_city]" value="" required />
|
165 |
+
</div>
|
166 |
+
</li>
|
167 |
+
|
168 |
+
<li>
|
169 |
+
|
170 |
+
<label for="<?php echo $_code ?>_cc_region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
171 |
+
<div class="input-box">
|
172 |
+
<?php $regionCollection = Mage::getModel('directory/region_api')->items("US"); ?>
|
173 |
+
<select name='addcard[cc_region]' id='<?php echo $_code ?>_cc_region' class="required-entry validate-select" required>
|
174 |
+
<option>Please select region, state or province</option>
|
175 |
+
<?php
|
176 |
+
foreach ($regionCollection as $region) {
|
177 |
+
?>
|
178 |
+
<option value="<?php echo $region['name'] ?>" ><?php echo $region['name'] ?></option>
|
179 |
+
<?php
|
180 |
+
}
|
181 |
+
?>
|
182 |
+
|
183 |
+
</select>
|
184 |
+
</div>
|
185 |
+
|
186 |
+
</li>
|
187 |
+
|
188 |
+
|
189 |
+
|
190 |
+
<li>
|
191 |
+
<div class="field">
|
192 |
+
<label for="<?php echo $_code ?>_cc_country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
193 |
+
<div class="input-box">
|
194 |
+
<?php
|
195 |
+
$_countries = Mage::getResourceModel('directory/country_collection')
|
196 |
+
->loadData()
|
197 |
+
->toOptionArray(false)
|
198 |
+
?>
|
199 |
+
<?php if (count($_countries) > 0): ?>
|
200 |
+
<select name="addcard[cc_country]" id="<?php echo $_code ?>_cc_country" required>
|
201 |
+
<option value="">-- Please Select --</option>
|
202 |
+
<?php foreach ($_countries as $_country): ?>
|
203 |
+
<option value="<?php echo $_country['value'] ?>" >
|
204 |
+
<?php echo $_country['label'] ?>
|
205 |
+
</option>
|
206 |
+
<?php endforeach; ?>
|
207 |
+
</select>
|
208 |
+
<?php endif; ?>
|
209 |
+
|
210 |
+
</div>
|
211 |
+
</div>
|
212 |
+
</li>
|
213 |
+
|
214 |
+
<li>
|
215 |
+
<label for="<?php echo $_code ?>_cc_postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
216 |
+
<div class="input-box">
|
217 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_postcode" name="addcard[cc_postcode]" value="" required />
|
218 |
+
</div>
|
219 |
+
</li>
|
220 |
+
<li>
|
221 |
+
<label for="<?php echo $_code ?>_cc_telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
222 |
+
<div class="input-box">
|
223 |
+
<input type="text" title="<?php echo $this->__('telephone') ?>" class="input-text required-entry" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
|
224 |
+
blockNonNumbers(this, event, false, false)" maxlength="10" id="<?php echo $_code ?>_cc_telephone" name="addcard[cc_telephone]" value="" required />
|
225 |
+
</div>
|
226 |
+
</li>
|
227 |
+
|
228 |
+
<button id="addcardbutton" class="button" style="margin-top: 10px;" type="submit" title="<?php echo $this->__('Add') ?>" class="button" onclick="<?php echo $this->getUrl('ccgateway/cardmanagement/savecard'); ?>"><span><span><?php echo $this->__('Add') ?></span></span></button>
|
229 |
+
|
230 |
+
</div>
|
231 |
+
|
232 |
+
|
233 |
+
<?php echo $this->getChildHtml() ?>
|
234 |
+
|
235 |
+
</ul>
|
236 |
+
</form>
|
237 |
+
</fieldset>
|
app/design/frontend/base/default/template/ccgateway/form.phtml
CHANGED
@@ -1,316 +1,317 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the html for show Payment Information Block on Frontend (Tokenized Post)
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
* */
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
if(Mage::getModel('ccgateway/standard')->getConfigData('active')==1){
|
32 |
-
?>
|
33 |
-
<style>
|
34 |
-
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px; display:none;}
|
35 |
-
.loader{position:absolute; top:80%; left:50%;}
|
36 |
-
|
37 |
-
.input-text {
|
38 |
-
-moz-appearance: none;
|
39 |
-
border-radius: 2px;
|
40 |
-
border: 1px solid #C0C0C0;
|
41 |
-
background: #FFF none repeat scroll 0% 0%;
|
42 |
-
font-size: 15px;
|
43 |
-
font-weight:300;
|
44 |
-
width: 365px;
|
45 |
-
font-family: "Helvetica Neue",Verdana,Arial,sans-serif;
|
46 |
-
}
|
47 |
-
|
48 |
-
</style>
|
49 |
-
<fieldset class="form-list">
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
$
|
59 |
-
$
|
60 |
-
$
|
61 |
-
$
|
62 |
-
$
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
<
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
<?php $
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
<
|
116 |
-
<
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
<
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
<
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
<
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
<?php
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
<
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
<
|
229 |
-
<
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
<
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
<
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
<
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
<?php
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
<
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
->
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
<
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
<
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the html for show Payment Information Block on Frontend (Tokenized Post)
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
* */
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
if(Mage::getModel('ccgateway/standard')->getConfigData('active')==1){
|
32 |
+
?>
|
33 |
+
<style>
|
34 |
+
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px; display:none;}
|
35 |
+
.loader{position:absolute; top:80%; left:50%;}
|
36 |
+
|
37 |
+
.input-text {
|
38 |
+
-moz-appearance: none;
|
39 |
+
border-radius: 2px;
|
40 |
+
border: 1px solid #C0C0C0;
|
41 |
+
background: #FFF none repeat scroll 0% 0%;
|
42 |
+
font-size: 15px;
|
43 |
+
font-weight:300;
|
44 |
+
width: 365px;
|
45 |
+
font-family: "Helvetica Neue",Verdana,Arial,sans-serif;
|
46 |
+
}
|
47 |
+
|
48 |
+
</style>
|
49 |
+
<fieldset class="form-list">
|
50 |
+
<?php
|
51 |
+
$_code = $this->getMethodCode();
|
52 |
+
$isTestMode = $this->isTransactionModeTest();
|
53 |
+
$siteName = Mage::helper('ccgateway')->getSiteName();
|
54 |
+
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
55 |
+
$billingAddress = $quote->getBillingAddress();
|
56 |
+
|
57 |
+
$requestUrl = Mage::getUrl('ccgateway/payment/getprofiledata',array('_secure'=>true));
|
58 |
+
$billingStreet = $billingAddress->getStreet(1);
|
59 |
+
$billingCity = $billingAddress->getCity();
|
60 |
+
$billingRegion = $billingAddress->getRegion();
|
61 |
+
$billingCountry = $billingAddress->getCountryId();
|
62 |
+
$billingPostCode = $billingAddress->getPostcode();
|
63 |
+
$billingTelephone = $billingAddress->getTelephone();
|
64 |
+
?>
|
65 |
+
|
66 |
+
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
67 |
+
|
68 |
+
<?php if ($this->getCheckoutType() == "payment_page") { ?>
|
69 |
+
<li>
|
70 |
+
<?php echo Mage::helper('ccgateway')->__('You will be redirected to CardConnect website when you place an order.') ?>
|
71 |
+
</li>
|
72 |
+
<?php } else { ?>
|
73 |
+
|
74 |
+
|
75 |
+
<?php
|
76 |
+
if ($this->hasCCProfile() == true) {
|
77 |
+
$response = $this->getDefaultCCProfileId();
|
78 |
+
|
79 |
+
if($response !="CardConnect_Error"){
|
80 |
+
if(isset($response[0]['token'])){
|
81 |
+
$maskedToken = substr_replace($response[0]['token'], str_repeat("*", 12), 0, 12);
|
82 |
+
|
83 |
+
}else{
|
84 |
+
$maskedToken = "";
|
85 |
+
}
|
86 |
+
?>
|
87 |
+
|
88 |
+
<li class="wide">
|
89 |
+
<label for="<?php echo $_code ?>_cc_profile_name" class="required"><em>*</em><?php echo $this->__('Choose Your Card For Payment') ?></label>
|
90 |
+
<div class="input-box">
|
91 |
+
<select id="payment[profile_name]" name="payment[profile_name]" onchange="javascript:return callGetProfileWebserviceController(<?php echo '\'' . $requestUrl . '\''; ?>, this.value);" title="<?php echo $this->__('Select Your Card') ?>" class="required-entry validate-select">
|
92 |
+
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
93 |
+
<?php foreach ($this->getCCProfileName() as $data): ?>
|
94 |
+
<option value="<?php echo $data->getData('CC_PROFILEID'); ?>"
|
95 |
+
<?php $profileId = (isset($response[0]['profileid'])) ? $response[0]['profileid'] : null;
|
96 |
+
if ($data->getData('CC_PROFILEID') === $profileId) { ?>
|
97 |
+
selected="selected"
|
98 |
+
<?php } ?> >
|
99 |
+
<?php echo $data->getData('CC_CARD_NAME'); ?>
|
100 |
+
</option>
|
101 |
+
<?php endforeach ?>
|
102 |
+
<option value="<?php echo "Checkout with new card"; ?>" ><?php echo "Checkout with new card"; ?></option>
|
103 |
+
</select>
|
104 |
+
|
105 |
+
</div>
|
106 |
+
</li>
|
107 |
+
<?php }else{ ?>
|
108 |
+
<ul class="messages">
|
109 |
+
<li class="error-msg"><ul><li><span>Unable to perform requested action, please contact customer service.</span></li></ul></li>
|
110 |
+
</ul>
|
111 |
+
<?php } } ?>
|
112 |
+
|
113 |
+
<div id="payment_info" <?php if ($this->hasCCProfile() == true) { ?> style="display: none;" <?php } ?> >
|
114 |
+
<li>
|
115 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
116 |
+
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
117 |
+
<div class="input-box">
|
118 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]"
|
119 |
+
value="<?php echo $name = (isset($response[0]['name'])) ? $response[0]['name'] : null; ?>" />
|
120 |
+
</div>
|
121 |
+
</li>
|
122 |
+
<li>
|
123 |
+
<label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
124 |
+
<div class="input-box" >
|
125 |
+
|
126 |
+
<select readonly id="ccgateway_cc_type" name="payment[cc_type]" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry validate-select" onchange="resetcardinfo();">
|
127 |
+
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
128 |
+
<?php $accttype = (isset($response[0]['accttype'])) ? $response[0]['accttype'] : null;
|
129 |
+
foreach ($this->getCcTypes() as $ccType): ?>
|
130 |
+
<option value="<?php echo $ccType['value']; ?>"<?php if ($ccType['value'] == $accttype ): ?> selected="selected"<?php endif ?> ><?php echo $ccType['label']; ?></option>
|
131 |
+
<?php endforeach ?>
|
132 |
+
</select>
|
133 |
+
</div>
|
134 |
+
</li>
|
135 |
+
</div>
|
136 |
+
|
137 |
+
<li <?php if($response == "CardConnect_Error"){?> style="display: none;" <?php } ?>>
|
138 |
+
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
139 |
+
<div class="input-box">
|
140 |
+
<?php if ($this->hasCCProfile() == true) { ?>
|
141 |
+
<label id="cc_number_label" for="<?php echo $_code ?>_cc_number" class="input-text required-entry"><?php echo $maskedToken; ?></label>
|
142 |
+
|
143 |
+
<input type="text" hidden onchange="valid_credit_card(value , '<?php echo $isTestMode; ?>', '<?php echo $siteName; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org'); blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="payment[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="<?php echo $maskedToken; ?>" />
|
144 |
+
|
145 |
+
<?php } else { ?>
|
146 |
+
<input type="text" onchange="valid_credit_card(value , '<?php echo $isTestMode; ?>', '<?php echo $siteName; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org'); blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="payment[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="<?php echo $maskedToken; ?>" />
|
147 |
+
|
148 |
+
<?php } ?>
|
149 |
+
<input type="text" hidden id="ccgateway_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text"
|
150 |
+
value="<?php echo $token = (isset($response[0]['token'])) ? $response[0]['token'] : null; ?>" />
|
151 |
+
<div class="validation-advice" id="testError" style="display: none;"></div>
|
152 |
+
</div>
|
153 |
+
|
154 |
+
</li>
|
155 |
+
<li><div id="response"></div></li>
|
156 |
+
|
157 |
+
<div id="fade" style="display:none;">
|
158 |
+
<div id="loading_box" class="loader"></div>
|
159 |
+
</div>
|
160 |
+
|
161 |
+
|
162 |
+
<div id="payment_info1" <?php if ($this->hasCCProfile() == true) { ?> style="display: none;" <?php } ?> >
|
163 |
+
<li>
|
164 |
+
<label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
|
165 |
+
<div class="input-box">
|
166 |
+
<div class="v-fix">
|
167 |
+
<select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
|
168 |
+
<?php if (isset($response[0]['expiry'])){ $_ccExpMonth = substr($response[0]['expiry'], 0, 2); } else { $_ccExpMonth = ""; } ?>
|
169 |
+
<?php foreach ($this->getCcMonths() as $k => $v): ?>
|
170 |
+
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
171 |
+
<?php endforeach ?>
|
172 |
+
</select>
|
173 |
+
</div>
|
174 |
+
<div class="v-fix">
|
175 |
+
<?php if (isset($response[0]['expiry'])){ $_ccExpYear = substr($response[0]['expiry'], 2, 4); } else { $_ccExpYear = ""; } ?>
|
176 |
+
<select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
|
177 |
+
<?php foreach ($this->getCcYears() as $k => $v): ?>
|
178 |
+
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == "20" . $_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
179 |
+
<?php endforeach ?>
|
180 |
+
</select>
|
181 |
+
</div>
|
182 |
+
|
183 |
+
</div>
|
184 |
+
</li>
|
185 |
+
</div>
|
186 |
+
<li <?php if($response =="CardConnect_Error"){?> style="display: none;" <?php } ?>>
|
187 |
+
<label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
|
188 |
+
<div class="input-box">
|
189 |
+
<div class="v-fix">
|
190 |
+
<input type="text" onkeypress="javascript:return validate(event, 'ccgateway_cc_cid');
|
191 |
+
blockNonNumbers(this, event, false, false)" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry" id="ccgateway_cc_cid" name="payment[cc_cid]" value="" maxlength="4" />
|
192 |
+
</div>
|
193 |
+
<div style="font-size: 12px; margin-top: 10px; text-decoration: underline;">
|
194 |
+
<?php echo $this->__('Card Verification Number not stored.') ?>
|
195 |
+
</div>
|
196 |
+
<!-- <a href="#" class="cvv-what-is-this"><?php // echo $this->__('What is this?') ?></a> -->
|
197 |
+
</div>
|
198 |
+
</li>
|
199 |
+
|
200 |
+
<?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { ?>
|
201 |
+
<div id="save_card_4future" <?php if ($this->hasCCProfile() == true) { ?> style="display:none;" <?php } ?>>
|
202 |
+
<li>
|
203 |
+
<span style="margin-bottom: 10px;">
|
204 |
+
<input type="checkbox" title="<?php echo $this->__('Save Card details for future use') ?>" id="ccgateway_cc_wallet" name="payment[cc_wallet]" value="checked" onclick="javascript:return showAliseField()" />
|
205 |
+
</span>
|
206 |
+
<label for="<?php echo $_code ?>_cc_wallet"><?php echo $this->__('Save Card details for future use') ?></label>
|
207 |
+
</li>
|
208 |
+
</div>
|
209 |
+
<?php } ?>
|
210 |
+
|
211 |
+
|
212 |
+
<div id="save_card" style="display:none;">
|
213 |
+
|
214 |
+
<li>
|
215 |
+
<label for="<?php echo $_code ?>_cc_Billing"><strong><?php echo $this->__('Billing Information') ?></strong></label>
|
216 |
+
</li>
|
217 |
+
|
218 |
+
<li>
|
219 |
+
<span style="margin-bottom: 10px;">
|
220 |
+
<input type="checkbox" title="<?php echo $this->__('Use default bill to address') ?>" id="ccgateway_default_address" name="payment[cc_default_address]" value="checked"
|
221 |
+
onclick="javascript:return showDefaultAddress('<?php echo $billingStreet; ?>', '<?php echo $billingCity; ?>', '<?php echo $billingRegion; ?>', '<?php echo $billingCountry; ?>', '<?php echo $billingPostCode; ?>', '<?php echo $billingTelephone; ?>')" />
|
222 |
+
</span>
|
223 |
+
<label for="<?php echo $_code ?>_default_address"><?php echo $this->__('Use default bill to address') ?></label>
|
224 |
+
</li>
|
225 |
+
|
226 |
+
|
227 |
+
<li>
|
228 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
229 |
+
<label for="<?php echo $_code ?>_cc_profile_name" class="required"><em>*</em><?php echo $this->__('Card Name (Alias)') ?></label>
|
230 |
+
<div class="input-box">
|
231 |
+
<input type="text" title="<?php echo $this->__('Card Name (Alias)') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_profile_name" name="payment[cc_profile_name]" value="" />
|
232 |
+
</div>
|
233 |
+
</li>
|
234 |
+
<li>
|
235 |
+
<label for="<?php echo $_code ?>_cc_street" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
236 |
+
<div class="input-box">
|
237 |
+
<input type="text" title="<?php echo $this->__('Street Address') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_street" name="payment[cc_street]" value="" />
|
238 |
+
</div>
|
239 |
+
</li>
|
240 |
+
<li>
|
241 |
+
<label for="<?php echo $_code ?>_cc_city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
242 |
+
<div class="input-box">
|
243 |
+
<input type="text" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_city" name="payment[cc_city]" value="" />
|
244 |
+
</div>
|
245 |
+
</li>
|
246 |
+
|
247 |
+
<li>
|
248 |
+
|
249 |
+
<label for="<?php echo $_code ?>_cc_region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
250 |
+
<div class="input-box">
|
251 |
+
<?php $regionCollection = Mage::getModel('directory/region_api')->items("US"); ?>
|
252 |
+
<select name='payment[cc_region]' id='<?php echo $_code ?>_cc_region' class="validate-select" >
|
253 |
+
<option value="">Please select region, state or province</option>
|
254 |
+
<?php
|
255 |
+
foreach ($regionCollection as $region) {
|
256 |
+
?>
|
257 |
+
<option value="<?php echo $region['name'] ?>" ><?php echo $region['name'] ?></option>
|
258 |
+
<?php
|
259 |
+
}
|
260 |
+
?>
|
261 |
+
|
262 |
+
</select>
|
263 |
+
</div>
|
264 |
+
|
265 |
+
</li>
|
266 |
+
|
267 |
+
|
268 |
+
|
269 |
+
<li>
|
270 |
+
<div class="field">
|
271 |
+
<label for="<?php echo $_code ?>_cc_country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
272 |
+
<div class="input-box">
|
273 |
+
<?php
|
274 |
+
$_countries = Mage::getResourceModel('directory/country_collection')
|
275 |
+
->loadData()
|
276 |
+
->toOptionArray(false)
|
277 |
+
?>
|
278 |
+
<?php if (count($_countries) > 0): ?>
|
279 |
+
<select name="payment[cc_country]" id="<?php echo $_code ?>_cc_country">
|
280 |
+
<option value="">-- Please Select --</option>
|
281 |
+
<?php foreach ($_countries as $_country): ?>
|
282 |
+
<option value="<?php echo $_country['value'] ?>" >
|
283 |
+
<?php echo $_country['label'] ?>
|
284 |
+
</option>
|
285 |
+
<?php endforeach; ?>
|
286 |
+
</select>
|
287 |
+
<?php endif; ?>
|
288 |
+
|
289 |
+
</div>
|
290 |
+
</div>
|
291 |
+
</li>
|
292 |
+
|
293 |
+
<li>
|
294 |
+
<label for="<?php echo $_code ?>_cc_postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
295 |
+
<div class="input-box">
|
296 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_postcode" name="payment[cc_postcode]" value="" />
|
297 |
+
</div>
|
298 |
+
</li>
|
299 |
+
<li>
|
300 |
+
<label for="<?php echo $_code ?>_cc_telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
301 |
+
<div class="input-box">
|
302 |
+
<input type="text" title="<?php echo $this->__('telephone') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_telephone" name="payment[cc_telephone]" value="" />
|
303 |
+
</div>
|
304 |
+
</li>
|
305 |
+
|
306 |
+
|
307 |
+
</div>
|
308 |
+
|
309 |
+
|
310 |
+
<?php echo $this->getChildHtml() ?>
|
311 |
+
<?php } ?>
|
312 |
+
|
313 |
+
</ul>
|
314 |
+
|
315 |
+
</fieldset>
|
316 |
+
<?php } ?>
|
317 |
+
|
app/design/frontend/base/default/template/ccgateway/info.phtml
CHANGED
@@ -1,42 +1,42 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @brief Defines the html for load payment method on checkout page
|
4 |
-
* @category Magento CardConnect Payment Module
|
5 |
-
* @author CardConnect
|
6 |
-
* @copyright Portions copyright 2014 CardConnect
|
7 |
-
* @copyright Portions copyright Magento 2014
|
8 |
-
* @license GPL v2, please see LICENSE.txt
|
9 |
-
* @access public
|
10 |
-
* @version $Id: $
|
11 |
-
*
|
12 |
-
**/
|
13 |
-
|
14 |
-
/**
|
15 |
-
Magento
|
16 |
-
*
|
17 |
-
NOTICE OF LICENSE
|
18 |
-
*
|
19 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
-
that is bundled with this package in the file LICENSE.txt.
|
21 |
-
It is also available through the world-wide-web at this URL:
|
22 |
-
http://opensource.org/licenses/osl-3.0.php
|
23 |
-
If you did not receive a copy of the license and are unable to
|
24 |
-
obtain it through the world-wide-web, please send an email
|
25 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
-
*
|
27 |
-
@category Cardconnect
|
28 |
-
@package Cardconnect_Ccgateway
|
29 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
-
*/
|
32 |
-
?>
|
33 |
-
<?php
|
34 |
-
|
35 |
-
echo $this->getMethod()->getTitle() . '<br/>';
|
36 |
-
if ($this->getCheckoutType() == "payment_page") {
|
37 |
-
echo '<em>' . Mage::helper('ccgateway')->__('You will be redirected to CardConnect website when you place an order.') . '</em>';
|
38 |
-
} else {
|
39 |
-
echo Mage::helper('ccgateway')->__('Credit Card Type: %s', $this->htmlEscape($this->getInfo()->getCcType())) . '<br/>';
|
40 |
-
echo Mage::helper('ccgateway')->__('Name on Credit Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) . '<br/>';
|
41 |
-
}
|
42 |
Â
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @brief Defines the html for load payment method on checkout page
|
4 |
+
* @category Magento CardConnect Payment Module
|
5 |
+
* @author CardConnect
|
6 |
+
* @copyright Portions copyright 2014 CardConnect
|
7 |
+
* @copyright Portions copyright Magento 2014
|
8 |
+
* @license GPL v2, please see LICENSE.txt
|
9 |
+
* @access public
|
10 |
+
* @version $Id: $
|
11 |
+
*
|
12 |
+
**/
|
13 |
+
|
14 |
+
/**
|
15 |
+
Magento
|
16 |
+
*
|
17 |
+
NOTICE OF LICENSE
|
18 |
+
*
|
19 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
20 |
+
that is bundled with this package in the file LICENSE.txt.
|
21 |
+
It is also available through the world-wide-web at this URL:
|
22 |
+
http://opensource.org/licenses/osl-3.0.php
|
23 |
+
If you did not receive a copy of the license and are unable to
|
24 |
+
obtain it through the world-wide-web, please send an email
|
25 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
26 |
+
*
|
27 |
+
@category Cardconnect
|
28 |
+
@package Cardconnect_Ccgateway
|
29 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
+
*/
|
32 |
+
?>
|
33 |
+
<?php
|
34 |
+
|
35 |
+
echo $this->getMethod()->getTitle() . '<br/>';
|
36 |
+
if ($this->getCheckoutType() == "payment_page") {
|
37 |
+
echo '<em>' . Mage::helper('ccgateway')->__('You will be redirected to CardConnect website when you place an order.') . '</em>';
|
38 |
+
} else {
|
39 |
+
echo Mage::helper('ccgateway')->__('Credit Card Type: %s', $this->htmlEscape($this->getInfo()->getCcType())) . '<br/>';
|
40 |
+
echo Mage::helper('ccgateway')->__('Name on Credit Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) . '<br/>';
|
41 |
+
}
|
42 |
Â
?>
|
js/cardconnect/ccgateway.js
CHANGED
@@ -1,445 +1,446 @@
|
|
1 |
-
/**
|
2 |
-
* @brief Defines the JS representing CardConnect Tokenization
|
3 |
-
* @category Magento CardConnect Payment Module
|
4 |
-
* @author CardConnect
|
5 |
-
* @copyright Portions copyright 2014 CardConnect
|
6 |
-
* @copyright Portions copyright Magento 2014
|
7 |
-
* @license GPL v2, please see LICENSE.txt
|
8 |
-
* @access public
|
9 |
-
* @version $Id: $
|
10 |
-
*
|
11 |
-
**/
|
12 |
-
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
|
32 |
-
|
33 |
-
function tokenize(cardNum , isTestMode) {
|
34 |
-
|
35 |
-
document.getElementById("ccgateway_cc_number_org").disabled = true;
|
36 |
-
document.getElementById("response").innerHTML = "";
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
xhr.
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
xhr.open("
|
76 |
-
xhr.
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
}
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
response =
|
98 |
-
}
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
document.getElementById("
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
response =
|
138 |
-
}
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
xmlDoc.
|
159 |
-
|
160 |
-
|
161 |
-
return
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
var
|
202 |
-
var
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
document.getElementById("testError").
|
209 |
-
document.getElementById("
|
210 |
-
document.getElementById("ccgateway_cc_number_org").
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
document.getElementById("testError").
|
218 |
-
document.getElementById("
|
219 |
-
document.getElementById("ccgateway_cc_number_org").
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
var
|
276 |
-
var
|
277 |
-
var
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
var
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
document.getElementById("
|
328 |
-
document.getElementById("
|
329 |
-
document.getElementById("
|
330 |
-
document.getElementById("
|
331 |
-
document.getElementById("
|
332 |
-
document.getElementById("
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
var
|
345 |
-
var
|
346 |
-
month =
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
document.getElementById("
|
352 |
-
document.getElementById("
|
353 |
-
document.getElementById("cc_number_label").
|
354 |
-
|
355 |
-
|
356 |
-
document.getElementById("
|
357 |
-
document.getElementById("
|
358 |
-
document.getElementById("
|
359 |
-
document.getElementById("
|
360 |
-
document.getElementById("
|
361 |
-
document.getElementById("
|
362 |
-
document.getElementById("
|
363 |
-
document.getElementById("
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
document.getElementById("
|
371 |
-
document.getElementById("
|
372 |
-
document.getElementById("
|
373 |
-
document.getElementById("
|
374 |
-
document.getElementById("
|
375 |
-
document.getElementById("
|
376 |
-
document.getElementById("
|
377 |
-
document.getElementById("
|
378 |
-
document.getElementById("
|
379 |
-
|
380 |
-
|
381 |
-
document.getElementById("
|
382 |
-
document.getElementById("
|
383 |
-
document.getElementById("
|
384 |
-
document.getElementById("
|
385 |
-
document.getElementById("
|
386 |
-
document.getElementById("
|
387 |
-
document.getElementById("
|
388 |
-
document.getElementById("
|
389 |
-
document.getElementById("
|
390 |
-
|
391 |
-
|
392 |
-
}
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
document.getElementById("
|
400 |
-
document.getElementById("
|
401 |
-
document.getElementById("
|
402 |
-
document.getElementById("
|
403 |
-
document.getElementById("
|
404 |
-
|
405 |
-
|
406 |
-
document.getElementById("
|
407 |
-
document.getElementById("
|
408 |
-
document.getElementById("
|
409 |
-
document.getElementById("
|
410 |
-
document.getElementById("
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
}
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
document.getElementById("ccgateway_cc_number_org").
|
440 |
-
document.getElementById("
|
441 |
-
document.getElementById("
|
442 |
-
document.getElementById("
|
443 |
-
|
444 |
-
|
445 |
-
|
Â
|
1 |
+
/**
|
2 |
+
* @brief Defines the JS representing CardConnect Tokenization
|
3 |
+
* @category Magento CardConnect Payment Module
|
4 |
+
* @author CardConnect
|
5 |
+
* @copyright Portions copyright 2014 CardConnect
|
6 |
+
* @copyright Portions copyright Magento 2014
|
7 |
+
* @license GPL v2, please see LICENSE.txt
|
8 |
+
* @access public
|
9 |
+
* @version $Id: $
|
10 |
+
*
|
11 |
+
**/
|
12 |
+
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
|
32 |
+
|
33 |
+
function tokenize(cardNum , isTestMode, siteName) {
|
34 |
+
|
35 |
+
document.getElementById("ccgateway_cc_number_org").disabled = true;
|
36 |
+
document.getElementById("response").innerHTML = "";
|
37 |
+
|
38 |
+
testTemplateUrl = "https://[SITE].prinpay.com:6443/cardsecure/cs";
|
39 |
+
prodTemplateUrl = "https://[SITE].prinpay.com:8443/cardsecure/cs";
|
40 |
+
|
41 |
+
// construct url
|
42 |
+
if(isTestMode == "yes"){
|
43 |
+
var url = testTemplateUrl .replace("[SITE]", siteName);
|
44 |
+
}else{
|
45 |
+
var url = prodTemplateUrl.replace("[SITE]", siteName )
|
46 |
+
}
|
47 |
+
|
48 |
+
var method = "GET";
|
49 |
+
var type = "json";
|
50 |
+
var params = "action=CE";
|
51 |
+
params = params + "&type=" + type;
|
52 |
+
params = params + "&data=" + cardNum;
|
53 |
+
|
54 |
+
// send request
|
55 |
+
if (window.XMLHttpRequest) {
|
56 |
+
xhr = new XMLHttpRequest();
|
57 |
+
if (xhr.withCredentials !== undefined) {
|
58 |
+
xhr.onreadystatechange = processXMLHttpResponse;
|
59 |
+
} else {
|
60 |
+
xhr = new XDomainRequest();
|
61 |
+
xhr.onload = processXDomainResponse;
|
62 |
+
}
|
63 |
+
} else {
|
64 |
+
if (window.ActiveXObject) {
|
65 |
+
try {
|
66 |
+
xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
67 |
+
xhr.onreadystatechange = processXMLHttpResponse;
|
68 |
+
}
|
69 |
+
catch (e) {
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
if (xhr) {
|
74 |
+
if (method == "GET") {
|
75 |
+
xhr.open("GET", url + "?" + params, true);
|
76 |
+
xhr.send(null);
|
77 |
+
} else {
|
78 |
+
xhr.open("POST", url + "?action=CE", true);
|
79 |
+
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
80 |
+
xhr.send(params);
|
81 |
+
}
|
82 |
+
|
83 |
+
}
|
84 |
+
else {
|
85 |
+
document.getElementById("response").innerHTML = "Sorry, this browser does not support AJAX requests.";
|
86 |
+
}
|
87 |
+
|
88 |
+
return false;
|
89 |
+
|
90 |
+
}
|
91 |
+
|
92 |
+
function processXMLHttpResponse() {
|
93 |
+
|
94 |
+
if (xhr.readyState == 4) {
|
95 |
+
var response = "";
|
96 |
+
if (xhr.status == 200) {
|
97 |
+
response = processResponse(response);
|
98 |
+
} else {
|
99 |
+
response = "There was a problem with the request " + xhr.status;
|
100 |
+
}
|
101 |
+
document.getElementById("ccgateway_cc_number_org").disabled = false;
|
102 |
+
|
103 |
+
var regExp = "^\\d+(\\.\\d+)?$";
|
104 |
+
if (response.match(regExp)) {
|
105 |
+
document.getElementById("ccgateway_cc_number").value = response;
|
106 |
+
var preResp = "************";
|
107 |
+
var resp = response.substr(12);
|
108 |
+
document.getElementById("ccgateway_cc_number_org").value = preResp + resp;
|
109 |
+
} else {
|
110 |
+
document.getElementById("response").classList.add('validation-advice');
|
111 |
+
document.getElementById("response").innerHTML = response;
|
112 |
+
}
|
113 |
+
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
function processXDomainResponse() {
|
118 |
+
var response = processResponse(response);
|
119 |
+
document.getElementById("ccgateway_cc_number").value = response;
|
120 |
+
document.getElementById("ccgateway_cc_number_org").value = response;
|
121 |
+
}
|
122 |
+
|
123 |
+
function processResponse(response) {
|
124 |
+
|
125 |
+
var type = "json";
|
126 |
+
if (type == "xml") {
|
127 |
+
var cardsecure = xhr.responseXML;
|
128 |
+
if (cardsecure == null) {
|
129 |
+
cardsecure = parseXml(xhr.responseText);
|
130 |
+
}
|
131 |
+
var data = cardsecure.getElementsByTagName("data")[0];
|
132 |
+
response = type + " token = " + data.firstChild.data;
|
133 |
+
} else if (type == "json") {
|
134 |
+
try {
|
135 |
+
var parse = xhr.responseText.substring(14, xhr.responseText.length - 2);
|
136 |
+
var object = JSON.parse(parse);
|
137 |
+
response = object.data;
|
138 |
+
} catch (e) {
|
139 |
+
response = "JSON response is not parseable.";
|
140 |
+
}
|
141 |
+
} else {
|
142 |
+
var pos = xhr.responseText.indexOf("data=");
|
143 |
+
response = "html token = " + xhr.responseText.substring(pos + 5);
|
144 |
+
}
|
145 |
+
|
146 |
+
|
147 |
+
document.getElementById("ccgateway_cc_number_org").disabled = false;
|
148 |
+
|
149 |
+
|
150 |
+
return response;
|
151 |
+
|
152 |
+
}
|
153 |
+
|
154 |
+
function parseXml(xmlStr) {
|
155 |
+
if (window.DOMParser) {
|
156 |
+
return (new window.DOMParser()).parseFromString(xmlStr, "text/xml");
|
157 |
+
} else if (typeof window.ActiveXObject != "undefined" && new window.ActiveXObject("Microsoft.XMLDOM")) {
|
158 |
+
var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
|
159 |
+
xmlDoc.async = "false";
|
160 |
+
xmlDoc.loadXML(xmlStr);
|
161 |
+
return xmlDoc;
|
162 |
+
} else {
|
163 |
+
return null;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
|
168 |
+
|
169 |
+
|
170 |
+
function valid_credit_card(value, isTestMode, siteName)
|
171 |
+
{
|
172 |
+
startLoading();
|
173 |
+
// The Luhn Algorithm. It's so pretty.
|
174 |
+
var nCheck = 0, nDigit = 0, bEven = false;
|
175 |
+
if (value == null || value == "") {
|
176 |
+
document.getElementById("testError").style.display = "block";
|
177 |
+
document.getElementById("testError").innerHTML = "Please Fill the require field.";
|
178 |
+
stopLoading();
|
179 |
+
return false;
|
180 |
+
} else {
|
181 |
+
var cardNum = value;
|
182 |
+
value = value.replace(/\D/g, "");
|
183 |
+
document.getElementById("testError").style.display = "none";
|
184 |
+
}
|
185 |
+
|
186 |
+
for (var n = value.length - 1; n >= 0; n--)
|
187 |
+
{
|
188 |
+
var cDigit = value.charAt(n),
|
189 |
+
nDigit = parseInt(cDigit, 10);
|
190 |
+
|
191 |
+
if (bEven)
|
192 |
+
{
|
193 |
+
if ((nDigit *= 2) > 9)
|
194 |
+
nDigit -= 9;
|
195 |
+
}
|
196 |
+
nCheck += nDigit;
|
197 |
+
bEven = !bEven;
|
198 |
+
}
|
199 |
+
|
200 |
+
if ((nCheck % 10) == 0) {
|
201 |
+
var cardType = GetCardType(cardNum);
|
202 |
+
var e = document.getElementById("ccgateway_cc_type");
|
203 |
+
var selectedCardType = e.options[e.selectedIndex].value;
|
204 |
+
if (cardType == selectedCardType && selectedCardType != null && cardNum != null && cardNum.length >=12 ) {
|
205 |
+
tokenize(cardNum , isTestMode, siteName);
|
206 |
+
setTimeout(stopLoading, 1000);
|
207 |
+
} else {
|
208 |
+
document.getElementById("testError").style.display = "block";
|
209 |
+
document.getElementById("testError").innerHTML = "Entered card information mismatched. Please try again.";
|
210 |
+
document.getElementById("ccgateway_cc_number_org").value = "";
|
211 |
+
document.getElementById("ccgateway_cc_number_org").focus();
|
212 |
+
stopLoading();
|
213 |
+
}
|
214 |
+
return;
|
215 |
+
}
|
216 |
+
else {
|
217 |
+
document.getElementById("testError").style.display = "block";
|
218 |
+
document.getElementById("testError").innerHTML = "Please Enter valid card data.";
|
219 |
+
document.getElementById("ccgateway_cc_number_org").value = "";
|
220 |
+
document.getElementById("ccgateway_cc_number_org").focus();
|
221 |
+
stopLoading();
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
|
225 |
+
return false;
|
226 |
+
}
|
227 |
+
|
228 |
+
|
229 |
+
|
230 |
+
function GetCardType(number)
|
231 |
+
{
|
232 |
+
// visa
|
233 |
+
var re = new RegExp("^4");
|
234 |
+
if (number.match(re) != null)
|
235 |
+
return "VISA";
|
236 |
+
|
237 |
+
// Mastercard
|
238 |
+
re = new RegExp("^5[1-5]");
|
239 |
+
if (number.match(re) != null)
|
240 |
+
return "MC";
|
241 |
+
|
242 |
+
// AMEX
|
243 |
+
re = new RegExp("^3[47]");
|
244 |
+
if (number.match(re) != null)
|
245 |
+
return "AMEX";
|
246 |
+
|
247 |
+
// Discover
|
248 |
+
re = new RegExp("^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)");
|
249 |
+
if (number.match(re) != null)
|
250 |
+
return "DISC";
|
251 |
+
|
252 |
+
return "";
|
253 |
+
}
|
254 |
+
|
255 |
+
|
256 |
+
function validate(key , inputId) {
|
257 |
+
//getting key code of pressed key
|
258 |
+
var keycode = (key.which) ? key.which : key.keyCode;
|
259 |
+
//comparing pressed keycodes
|
260 |
+
if (keycode == 46) {
|
261 |
+
var inputVoidValue = document.getElementById(inputId).value;
|
262 |
+
if (inputVoidValue.indexOf('.') < 1) {
|
263 |
+
return false;
|
264 |
+
}
|
265 |
+
return false;
|
266 |
+
}
|
267 |
+
if (keycode != 46 && keycode > 31 && (keycode < 48 || keycode > 57)) {
|
268 |
+
return false;
|
269 |
+
}
|
270 |
+
else
|
271 |
+
return true;
|
272 |
+
}
|
273 |
+
|
274 |
+
function blockNonNumbers(obj, e, allowDecimal, allowNegative) {
|
275 |
+
var key;
|
276 |
+
var isCtrl = false;
|
277 |
+
var keychar;
|
278 |
+
var reg;
|
279 |
+
|
280 |
+
if (window.event) {
|
281 |
+
key = e.keyCode;
|
282 |
+
isCtrl = window.event.ctrlKey
|
283 |
+
}
|
284 |
+
else if (e.which) {
|
285 |
+
key = e.which;
|
286 |
+
isCtrl = e.ctrlKey;
|
287 |
+
}
|
288 |
+
|
289 |
+
if (isNaN(key))
|
290 |
+
return true;
|
291 |
+
|
292 |
+
keychar = String.fromCharCode(key);
|
293 |
+
// check for backspace or delete, or if Ctrl was pressed
|
294 |
+
|
295 |
+
if (key == 8 || isCtrl) {
|
296 |
+
return true;
|
297 |
+
}
|
298 |
+
|
299 |
+
reg = /\d/;
|
300 |
+
var isFirstN = allowNegative ? keychar == '-' && obj.value.indexOf('-') == -1 : false;
|
301 |
+
var isFirstD = allowDecimal ? keychar == '.' && obj.value.indexOf('.') == -1 : false;
|
302 |
+
|
303 |
+
return isFirstN || isFirstD || reg.test(keychar);
|
304 |
+
}
|
305 |
+
|
306 |
+
|
307 |
+
function showAliseField(){
|
308 |
+
|
309 |
+
if( document.getElementById("ccgateway_cc_wallet").checked == true){
|
310 |
+
document.getElementById("save_card").show();
|
311 |
+
}else{
|
312 |
+
document.getElementById("save_card").hide();
|
313 |
+
}
|
314 |
+
|
315 |
+
}
|
316 |
+
|
317 |
+
|
318 |
+
function callGetProfileWebserviceController( requestUrl, profile ){
|
319 |
+
|
320 |
+
|
321 |
+
|
322 |
+
if((profile != "Checkout with new card")){
|
323 |
+
|
324 |
+
startLoading();
|
325 |
+
document.getElementById("ccgateway_cc_owner").readOnly = true;
|
326 |
+
|
327 |
+
document.getElementById("ccgateway_cc_number_org").disabled= true;
|
328 |
+
document.getElementById("ccgateway_cc_number").readOnly = true;
|
329 |
+
document.getElementById("ccgateway_cc_type").readOnly = true;
|
330 |
+
document.getElementById("ccgateway_expiration").readOnly = true;
|
331 |
+
document.getElementById("ccgateway_expiration_yr").readOnly = true;
|
332 |
+
document.getElementById("ccgateway_cc_cid").readOnly = false;
|
333 |
+
document.getElementById("ccgateway_cc_wallet").disabled = true;
|
334 |
+
new Ajax.Request(requestUrl, {
|
335 |
+
|
336 |
+
method: 'Post',
|
337 |
+
parameters: {profile: profile},
|
338 |
+
requestHeaders: {Accept: 'application/json'},
|
339 |
+
onComplete: function(transport) {
|
340 |
+
|
341 |
+
respjson = transport.responseText.evalJSON();
|
342 |
+
var response = JSON.parse(respjson);
|
343 |
+
|
344 |
+
var preResp = "************";
|
345 |
+
var maskToken = response[0].token.substr(12);
|
346 |
+
var month = response[0].expiry.substr(0,2);
|
347 |
+
month = month.replace(/^0+/, '');
|
348 |
+
var year = response[0].expiry.substr(2,4);
|
349 |
+
|
350 |
+
|
351 |
+
document.getElementById("ccgateway_cc_owner").value = response[0].name;
|
352 |
+
document.getElementById("ccgateway_cc_number_org").hide();
|
353 |
+
document.getElementById("cc_number_label").show();
|
354 |
+
document.getElementById("cc_number_label").innerHTML= preResp+maskToken;
|
355 |
+
|
356 |
+
document.getElementById("ccgateway_cc_number").value = response[0].token;
|
357 |
+
document.getElementById("ccgateway_cc_type").value = response[0].accttype;
|
358 |
+
document.getElementById("ccgateway_cc_owner").value = response[0].name;
|
359 |
+
document.getElementById("ccgateway_expiration").value = month;
|
360 |
+
document.getElementById("ccgateway_expiration_yr").value = "20"+year;
|
361 |
+
document.getElementById("ccgateway_cc_cid").value = "";
|
362 |
+
document.getElementById("save_card_4future").hide();
|
363 |
+
document.getElementById("payment_info").hide();
|
364 |
+
document.getElementById("payment_info1").hide();
|
365 |
+
stopLoading();
|
366 |
+
}
|
367 |
+
});
|
368 |
+
}else{
|
369 |
+
|
370 |
+
document.getElementById("ccgateway_cc_number_org").style.display='block';
|
371 |
+
document.getElementById("cc_number_label").hide();
|
372 |
+
document.getElementById("ccgateway_cc_owner").readOnly = false;
|
373 |
+
document.getElementById("ccgateway_cc_number_org").disabled= false;
|
374 |
+
document.getElementById("ccgateway_cc_number").readOnly = false;
|
375 |
+
document.getElementById("ccgateway_cc_type").readOnly = false;
|
376 |
+
document.getElementById("ccgateway_expiration").readOnly = false;
|
377 |
+
document.getElementById("ccgateway_expiration_yr").readOnly = false;
|
378 |
+
document.getElementById("ccgateway_cc_cid").readOnly = false;
|
379 |
+
document.getElementById("ccgateway_cc_wallet").disabled = false;
|
380 |
+
|
381 |
+
document.getElementById("ccgateway_cc_owner").value = "";
|
382 |
+
document.getElementById("ccgateway_cc_number_org").value = "";
|
383 |
+
document.getElementById("ccgateway_cc_number").value = "";
|
384 |
+
document.getElementById("ccgateway_cc_type").value = "";
|
385 |
+
document.getElementById("ccgateway_expiration").value = "";
|
386 |
+
document.getElementById("ccgateway_expiration_yr").value = "";
|
387 |
+
document.getElementById("ccgateway_cc_cid").value = "";
|
388 |
+
document.getElementById("save_card_4future").show();
|
389 |
+
document.getElementById("payment_info").show();
|
390 |
+
document.getElementById("payment_info1").show();
|
391 |
+
|
392 |
+
}
|
393 |
+
}
|
394 |
+
|
395 |
+
|
396 |
+
function showDefaultAddress(billingStreet,billingCity,billingRegion,billingCountry,billingPostCode,billingTelephone){
|
397 |
+
|
398 |
+
if( document.getElementById("ccgateway_default_address").checked == true){
|
399 |
+
document.getElementById("ccgateway_cc_street").value = billingStreet;
|
400 |
+
document.getElementById("ccgateway_cc_city").value = billingCity;
|
401 |
+
document.getElementById("ccgateway_cc_region").value = billingRegion;
|
402 |
+
document.getElementById("ccgateway_cc_country").value = billingCountry;
|
403 |
+
document.getElementById("ccgateway_cc_postcode").value = billingPostCode;
|
404 |
+
document.getElementById("ccgateway_cc_telephone").value = billingTelephone;
|
405 |
+
}else{
|
406 |
+
document.getElementById("ccgateway_cc_street").value = "";
|
407 |
+
document.getElementById("ccgateway_cc_city").value = "";
|
408 |
+
document.getElementById("ccgateway_cc_region").value = "";
|
409 |
+
document.getElementById("ccgateway_cc_country").value = "";
|
410 |
+
document.getElementById("ccgateway_cc_postcode").value = "";
|
411 |
+
document.getElementById("ccgateway_cc_telephone").value = "";
|
412 |
+
}
|
413 |
+
|
414 |
+
}
|
415 |
+
|
416 |
+
|
417 |
+
var loaded = false;
|
418 |
+
function startLoading() {
|
419 |
+
loaded = false;
|
420 |
+
showLoadingImage();
|
421 |
+
}
|
422 |
+
|
423 |
+
function showLoadingImage() {
|
424 |
+
document.getElementById("fade").style.display = "block";
|
425 |
+
var el = document.getElementById("loading_box");
|
426 |
+
if (el && !loaded) {
|
427 |
+
el.innerHTML = '<img src="" alt="Loading...">';
|
428 |
+
new Effect.Appear('loading_box');
|
429 |
+
}
|
430 |
+
}
|
431 |
+
|
432 |
+
function stopLoading() {
|
433 |
+
Element.hide('fade');
|
434 |
+
loaded = true;
|
435 |
+
document.getElementById("fade").style.display = "none";
|
436 |
+
}
|
437 |
+
|
438 |
+
function resetcardinfo() {
|
439 |
+
document.getElementById("ccgateway_cc_number_org").value = "";
|
440 |
+
document.getElementById("ccgateway_cc_number_org").focus();
|
441 |
+
document.getElementById("ccgateway_cc_number").value = "";
|
442 |
+
document.getElementById("ccgateway_expiration").value = "";
|
443 |
+
document.getElementById("ccgateway_expiration_yr").value = "";
|
444 |
+
return false;
|
445 |
+
}
|
446 |
+
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
Â
<?xml version="1.0"?>
|
2 |
Â
<package>
|
3 |
Â
<name>CardconnectCcgateway</name>
|
4 |
-
<version>1.0.
|
5 |
Â
<stability>stable</stability>
|
6 |
Â
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
Â
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
Â
<description>The CardConnect solution is a powerful extension used for payment processing in eCommerce. We provide the option to process a payment through the Hosted Payment Page or Direct Post, in a safe and secure way. We also provide the ability of a wallet function which allows merchants to add/edit/delete card holder data for future payments. All Customer information is stored in a secured way; and allows Customers to make a secure payment as well. Please see the Integration Guide here for steps to install: http://cdn.cardconnect.com/docs/collateral/Magento-Integration_Guide_v1.2.pdf</description>
|
11 |
Â
<notes>Extension provides the ability for merchants to process through the CardConnect Gateway.</notes>
|
12 |
Â
<authors><author><name>AgileNova</name><user>Team</user><email>matt.wixson@agilenova.com</email></author></authors>
|
13 |
-
<date>2015-
|
14 |
-
<time>12:
|
15 |
-
<contents><target name="magecommunity"><dir name="Cardconnect"><dir name="Ccgateway"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Cardtype.php" hash="4c6fd9bc202c33e88f515349e1cd6905"/><file name="Checkouttype.php" hash="
|
16 |
Â
<compatible/>
|
17 |
Â
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
Â
</package>
|
1 |
Â
<?xml version="1.0"?>
|
2 |
Â
<package>
|
3 |
Â
<name>CardconnectCcgateway</name>
|
4 |
+
<version>1.0.7</version>
|
5 |
Â
<stability>stable</stability>
|
6 |
Â
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
Â
<channel>community</channel>
|
10 |
Â
<description>The CardConnect solution is a powerful extension used for payment processing in eCommerce. We provide the option to process a payment through the Hosted Payment Page or Direct Post, in a safe and secure way. We also provide the ability of a wallet function which allows merchants to add/edit/delete card holder data for future payments. All Customer information is stored in a secured way; and allows Customers to make a secure payment as well. Please see the Integration Guide here for steps to install: http://cdn.cardconnect.com/docs/collateral/Magento-Integration_Guide_v1.2.pdf</description>
|
11 |
Â
<notes>Extension provides the ability for merchants to process through the CardConnect Gateway.</notes>
|
12 |
Â
<authors><author><name>AgileNova</name><user>Team</user><email>matt.wixson@agilenova.com</email></author></authors>
|
13 |
+
<date>2015-09-18</date>
|
14 |
+
<time>12:18:34</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Cardconnect"><dir name="Ccgateway"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Cardtype.php" hash="4c6fd9bc202c33e88f515349e1cd6905"/><file name="Checkouttype.php" hash="5468ed4e35f5aabf77ea65308b40d3a7"/><file name="Transaction.php" hash="6ba9e99fda4b19de82278800eb964bfb"/></dir></dir></dir></dir></dir><dir name="Block"><file name="Addcard.php" hash="def801e9a6c9351ffd488253c137c855"/><dir name="Adminhtml"><dir name="Customer"><file name="Data.php" hash="e401db541686c46a1f1f2db29aad7baf"/><dir name="Edit"><dir name="Tab"><file name="Account.php" hash="5ac21e8e4749605d36c5a47db115acca"/></dir></dir></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><dir name="Create"><file name="Form.php" hash="b856fbbd63401723571efaa76553a0aa"/><file name="Items.php" hash="696a59786bcf5f164f3bce6403cfc2ff"/></dir><dir name="View"><file name="Form.php" hash="2e3b0b6fbbfa159c27961b68b8420079"/></dir></dir><dir name="Invoice"><dir name="Create"><file name="Form.php" hash="0f7c57fa076ecd33e726337501d1d95b"/><file name="Items.php" hash="9b012dfb5fdbda0c20d4e163bd9ab662"/></dir><dir name="View"><file name="Form.php" hash="f25ee3483e04963f13c5e7fb82261408"/></dir></dir><dir name="Shipment"><dir name="Create"><file name="Form.php" hash="98ab8095084b6b21cdcd5cac5774987e"/></dir><dir name="View"><file name="Form.php" hash="e60bf6d244ea31ef68467c40d35bde98"/></dir></dir><dir name="View"><dir name="Tab"><file name="Info.php" hash="6e8ad75538f75f13fd483f2774d37621"/></dir></dir></dir></dir></dir><file name="Cardmanagement.php" hash="3d6ab227b63a89c5c3a7e5ebe5eddfad"/><file name="Form.php" hash="dc8294b3d1991476de13c9b20570605d"/><file name="Info.php" hash="5a30ffdd21b8fbb470fb0e9c07e9e82c"/><dir name="Onepage"><file name="Billing.php" hash="feca88ad00382cdb623921e004ada0f4"/></dir><file name="Redirect.php" hash="cfe86bec2d699ad474ee83f7bff118bb"/></dir><dir name="Helper"><file name="Data.php" hash="6ec07fb5ccc6ab30a0948da8941cb5bd"/></dir><dir name="Model"><dir name="Cardconnect"><file name="Resp.php" hash="b84483f77f4f5878be4ef5124e1cc9b4"/><file name="Wallet.php" hash="48fae16104d290466ce68bdb0091b4cd"/></dir><file name="Observer.php" hash="7e142307517c59a3b5b07dbbc4cae6e8"/><dir name="Resource"><dir name="Cardconnect"><dir name="Resp"><file name="Collection.php" hash="f91a8a542c331d96e9e0601a526bd1a2"/></dir><file name="Resp.php" hash="1689bf45552bf47bba76c595ce38618a"/><dir name="Wallet"><file name="Collection.php" hash="0e6c64693766cfb5e2ec56d01082eebd"/></dir><file name="Wallet.php" hash="0ffd67bd73177bb2ad32041cd32e4284"/></dir></dir><file name="Standard.php" hash="b3b891d12c868c188c96c1fcf6721c8c"/><file name="cardconnect_webservice.php" hash="84671bd15da1c2566ff740024e50ac5c"/></dir><dir name="blocks"><file name="billing.phtml" hash="24674ead62565508e2739cfda86669a8"/><dir name="creditmemo"><dir name="create"><file name="form.phtml" hash="1af2e3310737f3502ba26f4d3180e565"/></dir><dir name="view"><file name="form.phtml" hash="8754184850760738a00161b25d11d2c3"/></dir></dir><file name="info.phtml" hash="5d23267579d85f77d2038065619b998c"/><dir name="invoice"><dir name="create"><file name="form.phtml" hash="a7c52f4b0430a0a8be4fab9fd8e1462b"/><file name="items.phtml" hash="bc38033a2748716ee22eb200c8f29d4f"/></dir><dir name="view"><file name="form.phtml" hash="8bdf72eda5cc2b1170aa9b5f54728da0"/></dir></dir><dir name="shipment"><dir name="create"><file name="form.phtml" hash="ef541adc6774ec54cd0fd4f58d1c4cb6"/></dir><dir name="view"><file name="form.phtml" hash="1da4fa8006abee3517f1e18d3bf7e06c"/></dir></dir></dir><dir name="cc_keys"><file name="cacert.pem" hash="060fd410fecfc10d9c229b941868090c"/><file name=".htaccess" hash="d6a6f4184696bd7c56ae76973ec3489a"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="CreateController.php" hash="b0847bee66b63d057500a06d2102d034"/></dir><file name="OrderController.php" hash="d3a947e28c7dfaab5cbc5425fe5bc573"/></dir></dir><file name="CardmanagementController.php" hash="e1e0f5ad1df7f7c9e400b6c111a86124"/><file name="PaymentController.php" hash="58c4e0717307107aa73912faed2e9b18"/></dir><dir name="etc"><file name="config.xml" hash="444be1b3a9f3846ab4c760618dde5e20"/><file name="system.xml" hash="b931b80be0fac76b5adeb481e8bd6e3d"/></dir><dir name="sql"><dir name="cardconnect_ccgateway_setup"><file name="install-1.0.0.php" hash="ca7197239cea5de0b031c727f92b181b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cardconnect_Ccgateway.xml" hash="eac8d5ee15ec6943fefc4dbbdef74671"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ccgateway.xml" hash="b84ef177b3e51da8203805b5ce094f19"/></dir><dir name="template"><dir name="ccgateway"><file name="form.phtml" hash="522f720341d93ed2b6da4c77bd94529b"/><file name="info.phtml" hash="9f608febdf1c537eb3f4c9933429c651"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ccgateway.xml" hash="55846fe0c9e2e2ec1ef96f196ae60843"/></dir><dir name="template"><dir name="ccgateway"><file name="blank.phtml" hash="d858f54e640d5b29bde38ed37ac3f8e8"/><dir name="cardmanagement"><file name="editcard.phtml" hash="4c3702b8459fb83f135efa2da6d89653"/><file name="index.phtml" hash="4917c72bd5cf1563957f2ad0c78ac84e"/><file name="new.phtml" hash="918fbb5c43137a1823ffee604570c561"/></dir><file name="form.phtml" hash="cfb468ebe4b5383a3d1d38dc4369cce1"/><file name="info.phtml" hash="de3d6b891ac68056b85db65c47a8f97f"/><file name="redirect.phtml" hash="4b3964b41e6e55bf54039f758e74560e"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="cardconnect"><file name="cardconnect.gif" hash="b0ccf9c7446efd2bb6b65eadd98a3fde"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="cardconnect.css" hash="b58f299352d1bc2bebc47e3ed1ab3490"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="cardconnect"><file name="ccgateway.js" hash="22b23a6677cf6b5c0a9c38e84accc9e1"/></dir></dir></target></contents>
|
16 |
Â
<compatible/>
|
17 |
Â
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
Â
</package>
|
skin/frontend/base/default/css/cardconnect.css
CHANGED
@@ -1,420 +1,420 @@
|
|
1 |
-
/**
|
2 |
-
* @brief Defines the css for custom payment page.
|
3 |
-
* @category Magento CardConnect Payment Module
|
4 |
-
* @author CardConnect
|
5 |
-
* @copyright Portions copyright 2014 CardConnect
|
6 |
-
* @copyright Portions copyright Magento 2014
|
7 |
-
* @license GPL v2, please see LICENSE.txt
|
8 |
-
* @access public
|
9 |
-
* @version $Id: $
|
10 |
-
*
|
11 |
-
**/
|
12 |
-
|
13 |
-
/**
|
14 |
-
Magento
|
15 |
-
*
|
16 |
-
NOTICE OF LICENSE
|
17 |
-
*
|
18 |
-
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
-
that is bundled with this package in the file LICENSE.txt.
|
20 |
-
It is also available through the world-wide-web at this URL:
|
21 |
-
http://opensource.org/licenses/osl-3.0.php
|
22 |
-
If you did not receive a copy of the license and are unable to
|
23 |
-
obtain it through the world-wide-web, please send an email
|
24 |
-
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
-
*
|
26 |
-
@category Cardconnect
|
27 |
-
@package Cardconnect_Ccgateway
|
28 |
-
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
-
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
-
*/
|
31 |
-
|
32 |
-
.ccBody {
|
33 |
-
font-family: Arial;
|
34 |
-
font-size: .8em;
|
35 |
-
}
|
36 |
-
|
37 |
-
.ccContent {
|
38 |
-
width: 1000px;
|
39 |
-
margin:0 auto;
|
40 |
-
}
|
41 |
-
|
42 |
-
/* Header */
|
43 |
-
.ccHeader {
|
44 |
-
width: 1000px;
|
45 |
-
height: 90px;
|
46 |
-
margin-bottom: 10px;
|
47 |
-
text-align: left;
|
48 |
-
background-image:url('http://ccerp.cardconnect.com/~ssajwan/magento_demo_store/skin/frontend/rwd/default/images/media/logo.png');
|
49 |
-
background-repeat: no-repeat;
|
50 |
-
border-bottom: 20px solid #5C9CCC;
|
51 |
-
background-position: left center;
|
52 |
-
}
|
53 |
-
|
54 |
-
.ccHeaderImg {
|
55 |
-
position: relative;
|
56 |
-
text-align: right;
|
57 |
-
background-repeat: no-repeat;
|
58 |
-
background-position: center;
|
59 |
-
width: 400px;
|
60 |
-
height: 53px;
|
61 |
-
float: right;
|
62 |
-
|
63 |
-
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
/* 3D Secure */
|
68 |
-
.cc3DSOverlay {
|
69 |
-
background: #000;
|
70 |
-
opacity:0.6;
|
71 |
-
position: fixed;
|
72 |
-
width: 100%;
|
73 |
-
height: 100%;
|
74 |
-
top:0;
|
75 |
-
left:0;
|
76 |
-
display:none;
|
77 |
-
z-index: 999998;
|
78 |
-
}
|
79 |
-
.cc3DSWindow {
|
80 |
-
display: none;
|
81 |
-
top: 50%;
|
82 |
-
left: 50%;
|
83 |
-
margin-left: -200px;
|
84 |
-
margin-top: -200px;
|
85 |
-
position: absolute;
|
86 |
-
background:#FFF;
|
87 |
-
border: 1px solid #555;
|
88 |
-
box-shadow: 2px 2px 40px #222;
|
89 |
-
z-index: 999999;
|
90 |
-
}
|
91 |
-
.cc3DSiFrame {
|
92 |
-
width: 400px;
|
93 |
-
height: 400px;
|
94 |
-
margin:0 auto;
|
95 |
-
z-index: 999999;
|
96 |
-
}
|
97 |
-
|
98 |
-
|
99 |
-
/* Payment form */
|
100 |
-
.ccPaymentForm {
|
101 |
-
height: 500px;
|
102 |
-
margin: 0 270px;
|
103 |
-
}
|
104 |
-
|
105 |
-
.ccPaymentFormError {
|
106 |
-
color: red;
|
107 |
-
}
|
108 |
-
|
109 |
-
/* Fieldsets */
|
110 |
-
.ccPaymentFieldset {
|
111 |
-
border: 0;
|
112 |
-
width: 450px;
|
113 |
-
}
|
114 |
-
|
115 |
-
.ccPaymentLegend {
|
116 |
-
font-weight: bold;
|
117 |
-
|
118 |
-
}
|
119 |
-
|
120 |
-
.ccBillingFieldset {
|
121 |
-
border: 0;
|
122 |
-
width: 450px;
|
123 |
-
}
|
124 |
-
|
125 |
-
.ccBillingLegend {
|
126 |
-
font-weight: bold;
|
127 |
-
}
|
128 |
-
|
129 |
-
/* General form classes */
|
130 |
-
.ccFormRow {
|
131 |
-
|
132 |
-
}
|
133 |
-
|
134 |
-
.ccFormLabel {
|
135 |
-
padding: .4em;
|
136 |
-
width: 10em;
|
137 |
-
margin: .1em;
|
138 |
-
display: inline-block;
|
139 |
-
}
|
140 |
-
|
141 |
-
.ccFormLabelError {
|
142 |
-
color:red;
|
143 |
-
}
|
144 |
-
|
145 |
-
.ccFormField {
|
146 |
-
|
147 |
-
}
|
148 |
-
|
149 |
-
.ccFormFieldError {
|
150 |
-
border: 1px solid red;
|
151 |
-
}
|
152 |
-
|
153 |
-
.ccFormError {
|
154 |
-
margin-left: .5em;
|
155 |
-
color: red;
|
156 |
-
}
|
157 |
-
|
158 |
-
.ccFormCardImage {
|
159 |
-
|
160 |
-
}
|
161 |
-
|
162 |
-
/* Name field */
|
163 |
-
.ccNameRow {
|
164 |
-
|
165 |
-
}
|
166 |
-
|
167 |
-
.ccNameLabel {
|
168 |
-
|
169 |
-
}
|
170 |
-
|
171 |
-
.ccNameLabelError {
|
172 |
-
|
173 |
-
}
|
174 |
-
|
175 |
-
.ccNameField {
|
176 |
-
|
177 |
-
}
|
178 |
-
|
179 |
-
.ccNameFieldError {
|
180 |
-
|
181 |
-
}
|
182 |
-
|
183 |
-
.ccNameError {
|
184 |
-
|
185 |
-
}
|
186 |
-
|
187 |
-
/* Card Number field */
|
188 |
-
.ccCardNumberRow {
|
189 |
-
|
190 |
-
}
|
191 |
-
|
192 |
-
.ccCardNumberLabel {
|
193 |
-
|
194 |
-
}
|
195 |
-
|
196 |
-
.ccCardNumberLabelError {
|
197 |
-
|
198 |
-
}
|
199 |
-
|
200 |
-
.ccCardNumberField {
|
201 |
-
|
202 |
-
}
|
203 |
-
|
204 |
-
.ccCardNumberFieldError {
|
205 |
-
|
206 |
-
}
|
207 |
-
|
208 |
-
.ccCardNumberError {
|
209 |
-
|
210 |
-
}
|
211 |
-
|
212 |
-
/* Credit Card images */
|
213 |
-
.ccCardImagesRow {
|
214 |
-
|
215 |
-
}
|
216 |
-
|
217 |
-
.ccCardImagesLabel {
|
218 |
-
|
219 |
-
}
|
220 |
-
|
221 |
-
.ccAmexCardImage {
|
222 |
-
|
223 |
-
}
|
224 |
-
|
225 |
-
.ccDiscoverCardImage {
|
226 |
-
|
227 |
-
}
|
228 |
-
|
229 |
-
.ccMCCardImage {
|
230 |
-
|
231 |
-
}
|
232 |
-
|
233 |
-
.ccVisaCardImage {
|
234 |
-
|
235 |
-
}
|
236 |
-
|
237 |
-
/* cvv2 field */
|
238 |
-
.ccCvv2Row {
|
239 |
-
|
240 |
-
}
|
241 |
-
|
242 |
-
.ccCvv2Label {
|
243 |
-
|
244 |
-
}
|
245 |
-
|
246 |
-
.ccCvv2LabelError {
|
247 |
-
|
248 |
-
}
|
249 |
-
|
250 |
-
.ccCvv2Field {
|
251 |
-
|
252 |
-
}
|
253 |
-
|
254 |
-
.ccCvv2FieldError {
|
255 |
-
|
256 |
-
}
|
257 |
-
|
258 |
-
.ccCvv2Error {
|
259 |
-
|
260 |
-
}
|
261 |
-
|
262 |
-
/* Country field */
|
263 |
-
.ccCountryRow {
|
264 |
-
|
265 |
-
}
|
266 |
-
|
267 |
-
.ccCountryLabel {
|
268 |
-
|
269 |
-
}
|
270 |
-
|
271 |
-
.ccCountryLabelError {
|
272 |
-
|
273 |
-
}
|
274 |
-
|
275 |
-
.ccCountryField {
|
276 |
-
|
277 |
-
}
|
278 |
-
|
279 |
-
.ccCountryFieldError {
|
280 |
-
|
281 |
-
}
|
282 |
-
|
283 |
-
.ccCountryError {
|
284 |
-
|
285 |
-
}
|
286 |
-
|
287 |
-
/* Address field */
|
288 |
-
.ccAddressRow {
|
289 |
-
|
290 |
-
}
|
291 |
-
|
292 |
-
.ccAddressLabel {
|
293 |
-
|
294 |
-
}
|
295 |
-
|
296 |
-
.ccAddressLabelError {
|
297 |
-
|
298 |
-
}
|
299 |
-
|
300 |
-
.ccAddressField {
|
301 |
-
|
302 |
-
}
|
303 |
-
|
304 |
-
.ccAddressFieldError {
|
305 |
-
|
306 |
-
}
|
307 |
-
|
308 |
-
.ccAddressError {
|
309 |
-
|
310 |
-
}
|
311 |
-
|
312 |
-
/* Address 2 field */
|
313 |
-
.ccAddress2Row {
|
314 |
-
|
315 |
-
}
|
316 |
-
|
317 |
-
.ccAddress2Label {
|
318 |
-
|
319 |
-
}
|
320 |
-
|
321 |
-
.ccAddress2LabelError {
|
322 |
-
|
323 |
-
}
|
324 |
-
|
325 |
-
.ccAddress2Field {
|
326 |
-
|
327 |
-
}
|
328 |
-
|
329 |
-
.ccAddress2FieldError {
|
330 |
-
|
331 |
-
}
|
332 |
-
|
333 |
-
.ccAddress2Error {
|
334 |
-
|
335 |
-
}
|
336 |
-
|
337 |
-
/* City field */
|
338 |
-
.ccCityRow {
|
339 |
-
|
340 |
-
}
|
341 |
-
|
342 |
-
.ccCityLabel {
|
343 |
-
|
344 |
-
}
|
345 |
-
|
346 |
-
.ccCityLabelError {
|
347 |
-
|
348 |
-
}
|
349 |
-
|
350 |
-
.ccCityField {
|
351 |
-
|
352 |
-
}
|
353 |
-
|
354 |
-
.ccCityFieldError {
|
355 |
-
|
356 |
-
}
|
357 |
-
|
358 |
-
.ccCityError {
|
359 |
-
|
360 |
-
}
|
361 |
-
|
362 |
-
/* State field */
|
363 |
-
.ccStateRow {
|
364 |
-
|
365 |
-
}
|
366 |
-
|
367 |
-
.ccStateLabel {
|
368 |
-
|
369 |
-
}
|
370 |
-
|
371 |
-
.ccStateLabelError {
|
372 |
-
|
373 |
-
}
|
374 |
-
|
375 |
-
.ccStateField {
|
376 |
-
|
377 |
-
}
|
378 |
-
|
379 |
-
.ccStateFieldError {
|
380 |
-
|
381 |
-
}
|
382 |
-
|
383 |
-
.ccStateError {
|
384 |
-
|
385 |
-
}
|
386 |
-
|
387 |
-
/* Zip field */
|
388 |
-
.ccZipRow {
|
389 |
-
|
390 |
-
}
|
391 |
-
|
392 |
-
.ccZipLabel {
|
393 |
-
|
394 |
-
}
|
395 |
-
|
396 |
-
.ccZipLabelError {
|
397 |
-
|
398 |
-
}
|
399 |
-
|
400 |
-
.ccZipField {
|
401 |
-
|
402 |
-
}
|
403 |
-
|
404 |
-
.ccZipFieldError {
|
405 |
-
|
406 |
-
}
|
407 |
-
|
408 |
-
.ccZipError {
|
409 |
-
|
410 |
-
}
|
411 |
-
|
412 |
-
/* Submit button */
|
413 |
-
.ccFormSubmit {
|
414 |
-
|
415 |
-
}
|
416 |
-
|
417 |
-
/* Cancel button */
|
418 |
-
.ccFormCancel {
|
419 |
-
|
420 |
-
}
|
1 |
+
/**
|
2 |
+
* @brief Defines the css for custom payment page.
|
3 |
+
* @category Magento CardConnect Payment Module
|
4 |
+
* @author CardConnect
|
5 |
+
* @copyright Portions copyright 2014 CardConnect
|
6 |
+
* @copyright Portions copyright Magento 2014
|
7 |
+
* @license GPL v2, please see LICENSE.txt
|
8 |
+
* @access public
|
9 |
+
* @version $Id: $
|
10 |
+
*
|
11 |
+
**/
|
12 |
+
|
13 |
+
/**
|
14 |
+
Magento
|
15 |
+
*
|
16 |
+
NOTICE OF LICENSE
|
17 |
+
*
|
18 |
+
This source file is subject to the Open Software License (OSL 3.0)
|
19 |
+
that is bundled with this package in the file LICENSE.txt.
|
20 |
+
It is also available through the world-wide-web at this URL:
|
21 |
+
http://opensource.org/licenses/osl-3.0.php
|
22 |
+
If you did not receive a copy of the license and are unable to
|
23 |
+
obtain it through the world-wide-web, please send an email
|
24 |
+
to license@magentocommerce.com so we can send you a copy immediately.
|
25 |
+
*
|
26 |
+
@category Cardconnect
|
27 |
+
@package Cardconnect_Ccgateway
|
28 |
+
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
+
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
+
*/
|
31 |
+
|
32 |
+
.ccBody {
|
33 |
+
font-family: Arial;
|
34 |
+
font-size: .8em;
|
35 |
+
}
|
36 |
+
|
37 |
+
.ccContent {
|
38 |
+
width: 1000px;
|
39 |
+
margin:0 auto;
|
40 |
+
}
|
41 |
+
|
42 |
+
/* Header */
|
43 |
+
.ccHeader {
|
44 |
+
width: 1000px;
|
45 |
+
height: 90px;
|
46 |
+
margin-bottom: 10px;
|
47 |
+
text-align: left;
|
48 |
+
background-image:url('http://ccerp.cardconnect.com/~ssajwan/magento_demo_store/skin/frontend/rwd/default/images/media/logo.png');
|
49 |
+
background-repeat: no-repeat;
|
50 |
+
border-bottom: 20px solid #5C9CCC;
|
51 |
+
background-position: left center;
|
52 |
+
}
|
53 |
+
|
54 |
+
.ccHeaderImg {
|
55 |
+
position: relative;
|
56 |
+
text-align: right;
|
57 |
+
background-repeat: no-repeat;
|
58 |
+
background-position: center;
|
59 |
+
width: 400px;
|
60 |
+
height: 53px;
|
61 |
+
float: right;
|
62 |
+
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
/* 3D Secure */
|
68 |
+
.cc3DSOverlay {
|
69 |
+
background: #000;
|
70 |
+
opacity:0.6;
|
71 |
+
position: fixed;
|
72 |
+
width: 100%;
|
73 |
+
height: 100%;
|
74 |
+
top:0;
|
75 |
+
left:0;
|
76 |
+
display:none;
|
77 |
+
z-index: 999998;
|
78 |
+
}
|
79 |
+
.cc3DSWindow {
|
80 |
+
display: none;
|
81 |
+
top: 50%;
|
82 |
+
left: 50%;
|
83 |
+
margin-left: -200px;
|
84 |
+
margin-top: -200px;
|
85 |
+
position: absolute;
|
86 |
+
background:#FFF;
|
87 |
+
border: 1px solid #555;
|
88 |
+
box-shadow: 2px 2px 40px #222;
|
89 |
+
z-index: 999999;
|
90 |
+
}
|
91 |
+
.cc3DSiFrame {
|
92 |
+
width: 400px;
|
93 |
+
height: 400px;
|
94 |
+
margin:0 auto;
|
95 |
+
z-index: 999999;
|
96 |
+
}
|
97 |
+
|
98 |
+
|
99 |
+
/* Payment form */
|
100 |
+
.ccPaymentForm {
|
101 |
+
height: 500px;
|
102 |
+
margin: 0 270px;
|
103 |
+
}
|
104 |
+
|
105 |
+
.ccPaymentFormError {
|
106 |
+
color: red;
|
107 |
+
}
|
108 |
+
|
109 |
+
/* Fieldsets */
|
110 |
+
.ccPaymentFieldset {
|
111 |
+
border: 0;
|
112 |
+
width: 450px;
|
113 |
+
}
|
114 |
+
|
115 |
+
.ccPaymentLegend {
|
116 |
+
font-weight: bold;
|
117 |
+
|
118 |
+
}
|
119 |
+
|
120 |
+
.ccBillingFieldset {
|
121 |
+
border: 0;
|
122 |
+
width: 450px;
|
123 |
+
}
|
124 |
+
|
125 |
+
.ccBillingLegend {
|
126 |
+
font-weight: bold;
|
127 |
+
}
|
128 |
+
|
129 |
+
/* General form classes */
|
130 |
+
.ccFormRow {
|
131 |
+
|
132 |
+
}
|
133 |
+
|
134 |
+
.ccFormLabel {
|
135 |
+
padding: .4em;
|
136 |
+
width: 10em;
|
137 |
+
margin: .1em;
|
138 |
+
display: inline-block;
|
139 |
+
}
|
140 |
+
|
141 |
+
.ccFormLabelError {
|
142 |
+
color:red;
|
143 |
+
}
|
144 |
+
|
145 |
+
.ccFormField {
|
146 |
+
|
147 |
+
}
|
148 |
+
|
149 |
+
.ccFormFieldError {
|
150 |
+
border: 1px solid red;
|
151 |
+
}
|
152 |
+
|
153 |
+
.ccFormError {
|
154 |
+
margin-left: .5em;
|
155 |
+
color: red;
|
156 |
+
}
|
157 |
+
|
158 |
+
.ccFormCardImage {
|
159 |
+
|
160 |
+
}
|
161 |
+
|
162 |
+
/* Name field */
|
163 |
+
.ccNameRow {
|
164 |
+
|
165 |
+
}
|
166 |
+
|
167 |
+
.ccNameLabel {
|
168 |
+
|
169 |
+
}
|
170 |
+
|
171 |
+
.ccNameLabelError {
|
172 |
+
|
173 |
+
}
|
174 |
+
|
175 |
+
.ccNameField {
|
176 |
+
|
177 |
+
}
|
178 |
+
|
179 |
+
.ccNameFieldError {
|
180 |
+
|
181 |
+
}
|
182 |
+
|
183 |
+
.ccNameError {
|
184 |
+
|
185 |
+
}
|
186 |
+
|
187 |
+
/* Card Number field */
|
188 |
+
.ccCardNumberRow {
|
189 |
+
|
190 |
+
}
|
191 |
+
|
192 |
+
.ccCardNumberLabel {
|
193 |
+
|
194 |
+
}
|
195 |
+
|
196 |
+
.ccCardNumberLabelError {
|
197 |
+
|
198 |
+
}
|
199 |
+
|
200 |
+
.ccCardNumberField {
|
201 |
+
|
202 |
+
}
|
203 |
+
|
204 |
+
.ccCardNumberFieldError {
|
205 |
+
|
206 |
+
}
|
207 |
+
|
208 |
+
.ccCardNumberError {
|
209 |
+
|
210 |
+
}
|
211 |
+
|
212 |
+
/* Credit Card images */
|
213 |
+
.ccCardImagesRow {
|
214 |
+
|
215 |
+
}
|
216 |
+
|
217 |
+
.ccCardImagesLabel {
|
218 |
+
|
219 |
+
}
|
220 |
+
|
221 |
+
.ccAmexCardImage {
|
222 |
+
|
223 |
+
}
|
224 |
+
|
225 |
+
.ccDiscoverCardImage {
|
226 |
+
|
227 |
+
}
|
228 |
+
|
229 |
+
.ccMCCardImage {
|
230 |
+
|
231 |
+
}
|
232 |
+
|
233 |
+
.ccVisaCardImage {
|
234 |
+
|
235 |
+
}
|
236 |
+
|
237 |
+
/* cvv2 field */
|
238 |
+
.ccCvv2Row {
|
239 |
+
|
240 |
+
}
|
241 |
+
|
242 |
+
.ccCvv2Label {
|
243 |
+
|
244 |
+
}
|
245 |
+
|
246 |
+
.ccCvv2LabelError {
|
247 |
+
|
248 |
+
}
|
249 |
+
|
250 |
+
.ccCvv2Field {
|
251 |
+
|
252 |
+
}
|
253 |
+
|
254 |
+
.ccCvv2FieldError {
|
255 |
+
|
256 |
+
}
|
257 |
+
|
258 |
+
.ccCvv2Error {
|
259 |
+
|
260 |
+
}
|
261 |
+
|
262 |
+
/* Country field */
|
263 |
+
.ccCountryRow {
|
264 |
+
|
265 |
+
}
|
266 |
+
|
267 |
+
.ccCountryLabel {
|
268 |
+
|
269 |
+
}
|
270 |
+
|
271 |
+
.ccCountryLabelError {
|
272 |
+
|
273 |
+
}
|
274 |
+
|
275 |
+
.ccCountryField {
|
276 |
+
|
277 |
+
}
|
278 |
+
|
279 |
+
.ccCountryFieldError {
|
280 |
+
|
281 |
+
}
|
282 |
+
|
283 |
+
.ccCountryError {
|
284 |
+
|
285 |
+
}
|
286 |
+
|
287 |
+
/* Address field */
|
288 |
+
.ccAddressRow {
|
289 |
+
|
290 |
+
}
|
291 |
+
|
292 |
+
.ccAddressLabel {
|
293 |
+
|
294 |
+
}
|
295 |
+
|
296 |
+
.ccAddressLabelError {
|
297 |
+
|
298 |
+
}
|
299 |
+
|
300 |
+
.ccAddressField {
|
301 |
+
|
302 |
+
}
|
303 |
+
|
304 |
+
.ccAddressFieldError {
|
305 |
+
|
306 |
+
}
|
307 |
+
|
308 |
+
.ccAddressError {
|
309 |
+
|
310 |
+
}
|
311 |
+
|
312 |
+
/* Address 2 field */
|
313 |
+
.ccAddress2Row {
|
314 |
+
|
315 |
+
}
|
316 |
+
|
317 |
+
.ccAddress2Label {
|
318 |
+
|
319 |
+
}
|
320 |
+
|
321 |
+
.ccAddress2LabelError {
|
322 |
+
|
323 |
+
}
|
324 |
+
|
325 |
+
.ccAddress2Field {
|
326 |
+
|
327 |
+
}
|
328 |
+
|
329 |
+
.ccAddress2FieldError {
|
330 |
+
|
331 |
+
}
|
332 |
+
|
333 |
+
.ccAddress2Error {
|
334 |
+
|
335 |
+
}
|
336 |
+
|
337 |
+
/* City field */
|
338 |
+
.ccCityRow {
|
339 |
+
|
340 |
+
}
|
341 |
+
|
342 |
+
.ccCityLabel {
|
343 |
+
|
344 |
+
}
|
345 |
+
|
346 |
+
.ccCityLabelError {
|
347 |
+
|
348 |
+
}
|
349 |
+
|
350 |
+
.ccCityField {
|
351 |
+
|
352 |
+
}
|
353 |
+
|
354 |
+
.ccCityFieldError {
|
355 |
+
|
356 |
+
}
|
357 |
+
|
358 |
+
.ccCityError {
|
359 |
+
|
360 |
+
}
|
361 |
+
|
362 |
+
/* State field */
|
363 |
+
.ccStateRow {
|
364 |
+
|
365 |
+
}
|
366 |
+
|
367 |
+
.ccStateLabel {
|
368 |
+
|
369 |
+
}
|
370 |
+
|
371 |
+
.ccStateLabelError {
|
372 |
+
|
373 |
+
}
|
374 |
+
|
375 |
+
.ccStateField {
|
376 |
+
|
377 |
+
}
|
378 |
+
|
379 |
+
.ccStateFieldError {
|
380 |
+
|
381 |
+
}
|
382 |
+
|
383 |
+
.ccStateError {
|
384 |
+
|
385 |
+
}
|
386 |
+
|
387 |
+
/* Zip field */
|
388 |
+
.ccZipRow {
|
389 |
+
|
390 |
+
}
|
391 |
+
|
392 |
+
.ccZipLabel {
|
393 |
+
|
394 |
+
}
|
395 |
+
|
396 |
+
.ccZipLabelError {
|
397 |
+
|
398 |
+
}
|
399 |
+
|
400 |
+
.ccZipField {
|
401 |
+
|
402 |
+
}
|
403 |
+
|
404 |
+
.ccZipFieldError {
|
405 |
+
|
406 |
+
}
|
407 |
+
|
408 |
+
.ccZipError {
|
409 |
+
|
410 |
+
}
|
411 |
+
|
412 |
+
/* Submit button */
|
413 |
+
.ccFormSubmit {
|
414 |
+
|
415 |
+
}
|
416 |
+
|
417 |
+
/* Cancel button */
|
418 |
+
.ccFormCancel {
|
419 |
+
|
420 |
+
}
|