CardconnectCcgateway - Version 1.0.7

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

Files changed (56) hide show
  1. app/code/community/Cardconnect/Ccgateway/Adminhtml/Model/System/Config/Source/Checkouttype.php +48 -48
  2. app/code/community/Cardconnect/Ccgateway/Adminhtml/Model/System/Config/Source/Transaction.php +48 -48
  3. app/code/community/Cardconnect/Ccgateway/Block/Addcard.php +59 -59
  4. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Customer/Data.php +118 -118
  5. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Customer/Edit/Tab/Account.php +293 -293
  6. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Creditmemo/Create/Form.php +55 -55
  7. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Creditmemo/Create/Items.php +195 -195
  8. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Creditmemo/View/Form.php +55 -55
  9. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/Create/Form.php +56 -56
  10. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/Create/Items.php +59 -59
  11. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/View/Form.php +55 -55
  12. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Shipment/Create/Form.php +55 -55
  13. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Shipment/View/Form.php +55 -55
  14. app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/View/Tab/Info.php +50 -50
  15. app/code/community/Cardconnect/Ccgateway/Block/Cardmanagement.php +199 -199
  16. app/code/community/Cardconnect/Ccgateway/Block/Form.php +240 -240
  17. app/code/community/Cardconnect/Ccgateway/Block/Info.php +94 -94
  18. app/code/community/Cardconnect/Ccgateway/Block/Onepage/Billing.php +26 -26
  19. app/code/community/Cardconnect/Ccgateway/Block/Redirect.php +77 -77
  20. app/code/community/Cardconnect/Ccgateway/Helper/Data.php +46 -0
  21. app/code/community/Cardconnect/Ccgateway/Model/Cardconnect/Resp.php +40 -40
  22. app/code/community/Cardconnect/Ccgateway/Model/Cardconnect/Wallet.php +40 -40
  23. app/code/community/Cardconnect/Ccgateway/Model/Observer.php +95 -95
  24. app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Resp.php +38 -38
  25. app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Resp/Collection.php +40 -40
  26. app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Wallet.php +38 -38
  27. app/code/community/Cardconnect/Ccgateway/Model/Resource/Cardconnect/Wallet/Collection.php +40 -40
  28. app/code/community/Cardconnect/Ccgateway/Model/Standard.php +12 -49
  29. app/code/community/Cardconnect/Ccgateway/Model/cardconnect_webservice.php +548 -496
  30. app/code/community/Cardconnect/Ccgateway/blocks/billing.phtml +217 -217
  31. app/code/community/Cardconnect/Ccgateway/blocks/creditmemo/create/form.phtml +103 -103
  32. app/code/community/Cardconnect/Ccgateway/blocks/creditmemo/view/form.phtml +104 -104
  33. app/code/community/Cardconnect/Ccgateway/blocks/info.phtml +148 -148
  34. app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/form.phtml +132 -132
  35. app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/items.phtml +209 -209
  36. app/code/community/Cardconnect/Ccgateway/blocks/invoice/view/form.phtml +101 -101
  37. app/code/community/Cardconnect/Ccgateway/blocks/shipment/create/form.phtml +120 -120
  38. app/code/community/Cardconnect/Ccgateway/blocks/shipment/view/form.phtml +123 -123
  39. app/code/community/Cardconnect/Ccgateway/controllers/Adminhtml/Sales/Order/CreateController.php +177 -177
  40. app/code/community/Cardconnect/Ccgateway/controllers/Adminhtml/Sales/OrderController.php +99 -99
  41. app/code/community/Cardconnect/Ccgateway/controllers/CardmanagementController.php +181 -180
  42. app/code/community/Cardconnect/Ccgateway/etc/config.xml +1 -1
  43. app/code/community/Cardconnect/Ccgateway/sql/cardconnect_ccgateway_setup/install-1.0.0.php +136 -136
  44. app/design/adminhtml/default/default/layout/ccgateway.xml +43 -43
  45. app/design/adminhtml/default/default/template/ccgateway/form.phtml +121 -120
  46. app/design/adminhtml/default/default/template/ccgateway/info.phtml +141 -141
  47. app/design/frontend/base/default/layout/ccgateway.xml +87 -87
  48. app/design/frontend/base/default/template/ccgateway/blank.phtml +40 -40
  49. app/design/frontend/base/default/template/ccgateway/cardmanagement/editcard.phtml +266 -268
  50. app/design/frontend/base/default/template/ccgateway/cardmanagement/index.phtml +189 -189
  51. app/design/frontend/base/default/template/ccgateway/cardmanagement/new.phtml +237 -236
  52. app/design/frontend/base/default/template/ccgateway/form.phtml +317 -316
  53. app/design/frontend/base/default/template/ccgateway/info.phtml +41 -41
  54. js/cardconnect/ccgateway.js +446 -445
  55. package.xml +4 -4
  56. 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 = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
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 = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
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 = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
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 = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
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 = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
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
- $username = $this->getConfigData('username');
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
- $username = $this->getConfigData('username');
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 = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
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 = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
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
- function CardConnectWebService($url, $username, $password, $merchantId, $keys_location)
45
- {
46
- $this->restUrl = $url;
47
- $this->userName = $username;
48
- $this->passWord = $password;
49
- $this->merchantId = $merchantId;
50
- $this->keys_location = $keys_location;
51
- }
52
-
53
- /**
54
- * Function: getLastErrorMessage
55
- * Description: Return the last curl error encountered while executing web services
56
- */
57
- public function getLastErrorMessage()
58
- {
59
- return $this->lasterror;
60
- }
61
-
62
- /**
63
- * Function: sendTransactionToGateway
64
- * Description: Send web service request to payment gateway
65
- * Parameters:
66
- * @param $service "accept service name (auth, capture, refund, void, inquire)"
67
- * @param $parameters "input of web service request data"
68
- * @return $result returns JSON encoded string to the appropriate Service
69
- */
70
- public function sendTransactionToGateway($service, $parameters)
71
- {
72
- $url = $this->restUrl;
73
- $postString = "";
74
-
75
- if ($service == 'inquire') {
76
- $method = 'GET';
77
- $url = $url . $service . "/" . $parameters;
78
- } elseif ($service == 'CP') {
79
- $method = 'GET';
80
- $url = $url . "?" . $parameters;
81
- } elseif ($service == 'getprofile') {
82
- $method = 'GET';
83
- $url = $url . "profile" . "/" . $parameters;
84
- } elseif ($service == 'deleteprofile') {
85
- $method = 'DELETE';
86
- $url = $url . "profile" . "/" . $parameters;
87
- } else {
88
- $method = 'PUT';
89
- $url = $url . $service;
90
- $postString = json_encode($parameters);
91
- }
92
-
93
- $headers = array("Content-Type: application/json", "Accept: application/json");
94
-
95
- if (function_exists('curl_init')) {
96
- $curl = curl_init();
97
- curl_setopt($curl, CURLOPT_URL, $url);
98
- curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
99
- curl_setopt($curl, CURLOPT_HEADER, 0);
100
- curl_setopt($curl, CURLOPT_USERPWD, $this->userName . ":" . $this->passWord);
101
- curl_setopt($curl, CURLOPT_CAINFO, $this->keys_location . "cacert.pem");
102
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
103
- curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
104
- curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
105
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
106
- curl_setopt($curl, CURLOPT_COOKIESESSION, 1);
107
- curl_setopt($curl, CURLOPT_POSTFIELDS, $postString);
108
-
109
- $result = curl_exec($curl);
110
- $info = curl_getinfo($curl);
111
- $curlerrno = curl_errno($curl);
112
- $curlerrdesc = curl_error($curl);
113
-
114
- curl_close($curl);
115
-
116
- if ($info['http_code'] != "200") {
117
- $this->lasterror = "ERROR ";
118
- if (!empty($info['http_code']))
119
- $this->lasterror = $this->lasterror . ":http=" . $info['http_code'];
120
- if ($curlerrno != 0)
121
- $this->lasterror = $this->lasterror . ":errno=" . $curlerrno . ":errdesc=" . $curlerrdesc;
122
- if (!empty($result))
123
- $this->lasterror = $this->lasterror . ":result=" . $result;
124
- $result = "";
125
- }
126
- return $result;
127
- }
128
- }
129
-
130
- /**
131
- * Function: authService
132
- * Description: Implementation of auth web service request
133
- * Parameters:
134
- * @param $authrequest "Accept auth request array"
135
- * @return $response "Returns JSON encoded string of auth service response"
136
- */
137
- public function authService($authrequest)
138
- {
139
- if(!empty($authrequest['profileid'])) {
140
- $param = array(
141
- 'merchid' => $this->merchantId,
142
- 'profile' => $authrequest['profileid'],
143
- 'orderid' => $authrequest['order_id'],
144
- 'amount' => $authrequest['currency_value'],
145
- 'ecomind' => $authrequest['ecomind'],
146
- 'cvv2' => $authrequest['cvv_val'],
147
- 'capture' => $authrequest['capture']);
148
- }
149
- else {
150
- $param = array(
151
- 'merchid' => $this->merchantId,
152
- 'accttype' => $authrequest['acc_type'],
153
- 'orderid' => $authrequest['order_id'],
154
- 'account' => $authrequest['acc_num'],
155
- 'expiry' => $authrequest['expirydt'],
156
- 'amount' => $authrequest['currency_value'],
157
- 'currency' => $authrequest['currency'],
158
- 'name' => $authrequest['cc_owner'],
159
- 'address' => $authrequest['billing_street_address'],
160
- 'city' => $authrequest['billing_city'],
161
- 'region' => $authrequest['billing_state'],
162
- 'country' => $authrequest['billing_country'],
163
- 'postal' => $authrequest['billing_postcode'],
164
- 'ecomind' => $authrequest['ecomind'],
165
- 'cvv2' => $authrequest['cvv_val'],
166
- 'track' => null,
167
- 'tokenize' => 'Y',
168
- 'capture' => $authrequest['capture']);
169
-
170
- }
171
-
172
- $response = $this->sendTransactionToGateway('auth', $param);
173
- return $response;
174
-
175
- }
176
-
177
- /**
178
- * Function: captureService
179
- * Description: Implementation of capture web service request
180
- * Parameters:
181
- * @param $cc_retref "Retrieval reference number"
182
- * @param $cc_authcode "Authorization number"
183
- * @param $currency_value "Amount"
184
- * @param $order_id "Order Id"
185
- * @return $response "Returns JSON encoded string of capture service response"
186
- */
187
- public function captureService($cc_retref, $cc_authcode = null, $currency_value = null, $order_id = null)
188
- {
189
- $param = array(
190
- 'retref' => $cc_retref,
191
- 'merchid' => $this->merchantId,
192
- 'authcode' => $cc_authcode,
193
- 'amount' => $currency_value,
194
- 'invoiceid' => $order_id);
195
-
196
- $response = $this->sendTransactionToGateway('capture', $param);
197
- return $response;
198
- }
199
-
200
- /**
201
- * Function: voidService
202
- * Description: Implementation of void web service request
203
- * Parameters:
204
- * @param $cc_retref "Retrieval reference number"
205
- * @param $currency_value "Amount"
206
- * @return $response "Returns JSON encoded string of void service response"
207
- */
208
- public function voidService($cc_retref, $currency_value = null)
209
- {
210
- $param = array(
211
- 'retref' => $cc_retref,
212
- 'merchid' => $this->merchantId,
213
- 'amount' => $currency_value
214
- );
215
-
216
- $response = $this->sendTransactionToGateway('void', $param);
217
- return $response;
218
- }
219
-
220
- /**
221
- * Function: refundService
222
- * Description: Implementation of refund web service request
223
- * Parameters:
224
- * @param $cc_retref "Retrieval reference number"
225
- * @param $currency_value "Amount"
226
- * @return $response "Returns JSON encoded string of refund service response"
227
- */
228
- public function refundService($cc_retref, $currency_value = null)
229
- {
230
- $param = array(
231
- 'retref' => $cc_retref,
232
- 'merchid' => $this->merchantId,
233
- 'amount' => $currency_value
234
- );
235
-
236
- $response = $this->sendTransactionToGateway('refund', $param);
237
- return $response;
238
- }
239
-
240
- /**
241
- * Function: inquireService
242
- * Description: Implementation of inquire web service request
243
- * Parameters:
244
- * @param $cc_retref "Retrieval reference number"
245
- * @return $response "Returns JSON encoded string of inquire service response"
246
- */
247
- public function inquireService($cc_retref)
248
- {
249
- $param = array(
250
- 'retref' => $cc_retref,
251
- 'merchid' => $this->merchantId
252
- );
253
-
254
- $postString = '';
255
-
256
- foreach ($param as $key => $value) {
257
- $postString .= urlencode(utf8_encode(trim($value))) . '/';
258
- }
259
-
260
- $postString = substr($postString, 0, -1);
261
- $response = $this->sendTransactionToGateway('inquire', $postString);
262
- return $response;
263
- }
264
-
265
- /**
266
- * Function: cardPurgeService
267
- * Description: Implementation of Purge web service request to delete token
268
- * Parameters:
269
- * @param $tokenNum "token number, $action, $type"
270
- * @param $action "CardSecure action"
271
- * @param $type "Type of request/response format"
272
- * @return $response "Returns XML encoded string of purge service response"
273
- */
274
- public function cardPurgeService($action, $type, $tokenNum)
275
- {
276
- $postString = "action=" . $action . "&type=" . $type . "&data=" . $tokenNum;
277
-
278
- $response = $this->sendTransactionToGateway('CP', $postString);
279
- return $response;
280
- }
281
-
282
- /**
283
- * Function: createProfileService
284
- * Description: Implementation of profile web service request
285
- * Parameters:
286
- * @param $profrequest "Accept profile request array"
287
- * @return $response "Returns JSON encoded string of create/update profile service response"
288
- */
289
- public function createProfileService($profrequest)
290
- {
291
- $param = array(
292
- 'defaultacct' => $profrequest['defaultacct'],
293
- 'profile' => $profrequest['profile'],
294
- 'profileupdate' => $profrequest['profileupdate'],
295
- 'account' => $profrequest['account'],
296
- 'accttype' => $profrequest['accttype'],
297
- 'expiry' => $profrequest['expiry'],
298
- 'name' => $profrequest['name'],
299
- 'address' => $profrequest['address'],
300
- 'city' => $profrequest['city'],
301
- 'region' => $profrequest['region'],
302
- 'country' => $profrequest['country'],
303
- 'phone' => $profrequest['phone'],
304
- 'postal' => $profrequest['postal'],
305
- 'merchid' => $this->merchantId
306
- );
307
-
308
- $response = $this->sendTransactionToGateway('profile', $param);
309
- return $response;
310
- }
311
-
312
- /**
313
- * Function: getProfileService
314
- * Description: Implementation of profile web service request
315
- * Parameters:
316
- * @param $profileid "accept profileid to display account details"
317
- * @return $response "returns JSON encoded string of get profile service response"
318
- */
319
- public function getProfileService($profileid, $acctid = "")
320
- {
321
- $param = array(
322
- 'profileid' => $profileid,
323
- 'acctid' => $acctid,
324
- 'merchid' => $this->merchantId
325
- );
326
-
327
- $postString = '';
328
- foreach ($param as $key => $value) {
329
- $postString .= urlencode(utf8_encode(trim($value))) . '/';
330
- }
331
-
332
- $postString = substr($postString, 0, -1);
333
- $response = $this->sendTransactionToGateway('getprofile', $postString);
334
- return $response;
335
-
336
- }
337
-
338
- /**
339
- * Function: deleteProfileService
340
- * Description: Implementation of profile web service request
341
- * Parameters:
342
- * @param Accept profileid
343
- * @return Returns JSON encoded string of delete profile service response
344
- */
345
- public function deleteProfileService($profileid)
346
- {
347
- $param = array(
348
- 'profileid' => $profileid,
349
- 'merchid' => $this->merchantId
350
- );
351
-
352
- $postString = '';
353
-
354
- foreach ($param as $key => $value) {
355
- $postString .= urlencode(utf8_encode(trim($value))) . '//';
356
- }
357
-
358
- $postString = substr($postString, 0, -2);
359
- $response = $this->sendTransactionToGateway('deleteprofile', $postString);
360
- return $response;
361
-
362
- }
363
-
364
-
365
- /**
366
- * Function: getCCErrorMessage
367
- * Description: Function to return proper CardConnect Error messages
368
- * Parameters:
369
- * @param $respError "response processor and response code"
370
- * @return $message "returns Error message response"
371
- */
372
- public function getCCErrorMessage($respError)
373
- {
374
- $errorList = array(
375
- "PPS11" => "Invalid card",
376
- "PPS12" => "Invalid track",
377
- "PPS13" => "Bad card check digit",
378
- "PPS14" => "Non-numeric CVV",
379
- "PPS15" => "Non-numeric expiry",
380
- "PPS16" => "Card expired",
381
- "PPS17" => "Invalid zip",
382
- "PPS19" => "CardDefense Decline",
383
- "PPS23" => "No auth queue",
384
- "PPS31" => "Invalid currency",
385
- "PPS32" => "Wrong currency for merch",
386
- "PPS33" => "Unknown card type",
387
- "PPS35" => "No postal code",
388
- "PPS37" => "CVV mismatch",
389
- "PPS41" => "Below min amount",
390
- "PPS42" => "Above max amount",
391
- "PPS43" => "Invalid amount",
392
- "PPS61" => "Line down",
393
- "PPS62" => "Timed out",
394
- "PPS91" => "No TokenSecure",
395
- "PPS92" => "No Merchant table",
396
- "PPS93" => "No Database",
397
- "FNOR05" => "Do not honor",
398
- "FNOR12" => "Invalid transaction",
399
- "FNOR13" => "Invalid amount",
400
- "FNOR14" => "Invalid card number",
401
- "FNOR28" => "Please retry",
402
- "FNOR51" => "Declined",
403
- "FNOR54" => "Wrong expiration",
404
- "FNOR61" => "Exceeds withdrawal limit",
405
- "FNOR63" => "Service not allowed",
406
- "FNOR89" => "Invalid Term ID",
407
- "FNORC2" => "CVV decline",
408
- "FNORN3" => "Invalid Account",
409
- "FNORNU" => "Insufficient funds",
410
- "MNS04" => "Pick up card",
411
- "MNS05" => "Do not honor",
412
- "MNS07" => "Suspected fraud",
413
- "MNS13" => "Invalid amount",
414
- "MNS14" => "Invalid card number",
415
- "MNS15" => "No such card issuer",
416
- "MNS19" => "Re-enter transaction",
417
- "MNS34" => "Suspected fraud",
418
- "MNS41" => "Card reported lost",
419
- "MNS43" => "Card reported stolen",
420
- "MNS51" => "Insufficient funds",
421
- "MNS54" => "Wrong expiration",
422
- "MNS65" => "Activity limit exceeded",
423
- "MNS82" => "CVV incorrect",
424
- "MNS99" => "Decline",
425
- "PMT000" => "System Down",
426
- "PMT200" => "Auth network down",
427
- "PMT201" => "Invalid CC number",
428
- "PMT202" => "Bad amount",
429
- "PMT203" => "Zero amount",
430
- "PMT233" => "Card does not match type",
431
- "PMT238" => "Invalid currency",
432
- "PMT239" => "Invalid card for merchant",
433
- "PMT243" => "Invalid Level 3 field",
434
- "PMT302" => "Insufficient funds",
435
- "PMT303" => "Processor decline",
436
- "PMT304" => "Invalid card",
437
- "PMT501" => "Pickup card",
438
- "PMT502" => "Card reported lost",
439
- "PMT503" => "Fraud",
440
- "PMT521" => "Insufficient funds",
441
- "PMT522" => "Card expired",
442
- "PMT530" => "Do not honor",
443
- "PMT531" => "CVV mismatch",
444
- "PMT591" => "Invalid card number",
445
- "PMT592" => "Bad amount",
446
- "PMT605" => "Invalid expiry date",
447
- "PMT607" => "Invalid amount",
448
- "PMT903" => "Invalid expiry",
449
- "PMT904" => "Card not active",
450
- "VPS04" => "Pick up card",
451
- "VPS05" => "Do not honor",
452
- "VPS07" => "Suspected fraud",
453
- "VPS13" => "Invalid amount",
454
- "VPS14" => "Invalid card number",
455
- "VPS19" => "Re-enter transaction",
456
- "VPS23" => "Bad fee amount",
457
- "VPS28" => "File temporarily unavailable",
458
- "VPS34" => "Suspected fraud",
459
- "VPS41" => "Card reported lost",
460
- "VPS43" => "Card reported stolen",
461
- "VPS51" => "Insufficient funds",
462
- "VPS54" => "Wrong expiration",
463
- "VPS61" => "Exceeds withdrawal limit",
464
- "VPS65" => "Activity limit exceeded",
465
- "VPS82" => "CVV incorrect",
466
- "VPS96" => "System malfunction",
467
- "VPSN7" => "CVV mismatch",
468
- "AMEX100" => "Decline",
469
- "AMEX101" => "Expired card",
470
- "AMEX103" => "CID failed",
471
- "AMEX105" => "Card cancelled",
472
- "AMEX110" => "Invalid amount",
473
- "AMEX111" => "Invalid card",
474
- "AMEX122" => "Invalid CID",
475
- "AMEX182" => "Try later",
476
- "AMEX200" => "Pick up card",
477
- "PSTR02" => "Declined",
478
- "PSTR06" => "AVS_Declined",
479
- "PSTR07" => "CCVS_Declined",
480
- "PSTR08" => "Expired"
481
-
482
- );
483
-
484
- if (array_key_exists($respError, $errorList)) {
485
- $message = $errorList[$respError];
486
- } else {
487
- $message = "Your payment is unable to process, call customer service";
488
- }
489
-
490
- return $message;
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 &amp; 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 &amp; 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">&nbsp;</td>
60
- <td colspan="3" class="a-center"><?php echo $this->getUpdateButtonHtml() ?></td>
61
- <td colspan="3">&nbsp;</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%;">&nbsp;</td>
147
- <td>&nbsp;</td>
148
- </tr>
149
- </tbody>
150
- </table>
151
- </td>
152
- <td class="document-totals section">&nbsp;</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">&nbsp;</td>
60
+ <td colspan="3" class="a-center"><?php echo $this->getUpdateButtonHtml() ?></td>
61
+ <td colspan="3">&nbsp;</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%;">&nbsp;</td>
147
+ <td>&nbsp;</td>
148
+ </tr>
149
+ </tbody>
150
+ </table>
151
+ </td>
152
+ <td class="document-totals section">&nbsp;</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
- $this->_redirect('customer/cardmanagement');
82
- }
83
- } catch (Exception $e) {
84
- Mage::logException($e);
85
- throw new Exception("Unable to perform add card. Please, retry.");
86
- }
87
- }
88
-
89
- /**
90
- * Function to make default payment from Card Management Grid
91
- */
92
- public function makedefaultpaymentAction() {
93
- $walletId = $this->getRequest()->getParam('id');
94
- $cc_card_val = $this->getRequest()->getParam('value');
95
-
96
- if (Mage::getSingleton('customer/session')->isLoggedIn()) {
97
- $customerData = Mage::getSingleton('customer/session')->getCustomer();
98
- $ccUserId = $customerData->getId();
99
- }
100
-
101
- $resource = Mage::getSingleton('core/resource');
102
- $readConnection = $resource->getConnection('core_read');
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
- $braintree = Mage::getModel('ccgateway/standard');
138
- $this->getLayout()->getBlock('customer_walletcard_management')->setTemplate('ccgateway/cardmanagement/editcard.phtml');
139
- $this->renderLayout();
140
- }
141
-
142
- /**
143
- * Save payment ajax action
144
- *
145
- * Sets either redirect or a JSON response
146
- */
147
- public function updateprofileAction() {
148
-
149
- $data = $this->getRequest()->getPost('editcard', array());
150
-
151
- $param = array(
152
- 'cc_profile_name' => $data['cc_profile_name'],
153
- 'wallet_id' => $data['wallet_id'],
154
- 'defaultacct' => 'Y',
155
- 'profile' => addslashes($data['profile'] . '/1'),
156
- 'profileupdate' => 'Y',
157
- 'cc_number' => $data['cc_number'],
158
- 'cc_type' => $data['cc_type'],
159
- 'cc_exp_month' => $data['cc_exp_month'],
160
- 'cc_exp_year' => $data['cc_exp_year'],
161
- 'cc_owner' => $data['cc_owner'],
162
- 'cc_street' => $data['cc_street'],
163
- 'cc_city' => $data['cc_city'],
164
- 'cc_region' => $data['cc_region'],
165
- 'cc_country' => $data['cc_country'],
166
- 'cc_telephone' => $data['cc_telephone'],
167
- 'cc_postcode' => $data['cc_postcode']);
168
-
169
- // Call function Create Profile webservices
170
- $response = Mage::getModel('ccgateway/standard')->updateProfileService($param);
171
- if ($response == "Profile Updated") {
172
- Mage::getSingleton('core/session')->addSuccess("Card has been updated successfully.");
173
- $this->_redirect('customer/cardmanagement');
174
- } else {
175
- $this->_redirect('customer/cardmanagement');
176
- throw new Exception("Unable to perform update. Please, retry.");
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.6.1</version>
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
- <ul id="payment_form_<?php echo $_code ?>" style="display:none">
41
- <?php if ($this->getCheckoutType() == "payment_page") { ?>
42
- <li>
43
- <?php echo Mage::helper('ccgateway')->__('You will be redirected to CardConnect website when you place an order.') ?>
44
- </li>
45
- <?php } else { ?>
46
-
47
- <li>
48
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
49
- <label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
50
- <div class="input-box">
51
- <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')) ?>" />
52
- </div>
53
- </li>
54
- <li>
55
- <label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
56
- <div class="input-box">
57
-
58
- <select id="ccgateway_cc_type" name="payment[cc_type]" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry validate-select" onchange="resetcardinfo();">
59
- <option value=""><?php echo $this->__('--Please Select--') ?></option>
60
- <?php $_ccType = $this->getInfoData('cc_type'); ?>
61
- <?php foreach ($this->getCcTypes() as $ccType): ?>
62
- <option value="<?php echo $ccType['value']; ?>"<?php if ($ccType['value'] == $_ccType): ?> selected="selected"<?php endif ?>><?php echo $ccType['label']; ?></option>
63
- <?php endforeach ?>
64
- </select>
65
- </div>
66
- </li>
67
-
68
- <li>
69
- <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
70
- <div class="input-box">
71
- <input type="text" onchange="valid_credit_card(value, '<?php echo $isTestMode; ?>')" 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); } ?>" />
72
- <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')?>" />
73
- <div class="validation-advice" id="testError" style="display: none;"></div>
74
- </div>
75
-
76
- </li>
77
- <li><div id="response"></div></li>
78
- <div id="fade" style="display:none;">
79
- <div id="loading_box" class="loader"></div>
80
- </div>
81
-
82
- <li>
83
- <label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
84
- <div class="input-box">
85
- <div class="v-fix">
86
- <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
87
- <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
88
- <?php foreach ($this->getCcMonths() as $k => $v): ?>
89
- <option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
90
- <?php endforeach ?>
91
- </select>
92
- </div>
93
- <div class="v-fix">
94
- <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
95
- <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
96
- <?php foreach ($this->getCcYears() as $k => $v): ?>
97
- <option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
98
- <?php endforeach ?>
99
- </select>
100
- </div>
101
-
102
- </div>
103
- </li>
104
- <li>
105
- <label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
106
- <div class="input-box">
107
- <div class="v-fix">
108
- <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') ?>" />
109
- </div>
110
- <!-- <a href="#" class="cvv-what-is-this"><?php // echo $this->__('What is this?') ?></a> -->
111
- </div>
112
- </li>
113
-
114
- <?php echo $this->getChildHtml() ?>
115
- <?php } ?>
116
-
117
- </ul>
118
-
119
- </fieldset>
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
- 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
- //alert("We are unable to perform the requested action, please contact customer service.");
54
- }else{
55
- document.getElementById("customCheck").style.display = "none";
56
- var preResp = "************";
57
- var maskToken = response[0].token.substr(12);
58
- var month = response[0].expiry.substr(0, 2);
59
- month = month.replace(/^0+/, '');
60
- // month = getMonthName(month);
61
- // alert(month);
62
- var year = response[0].expiry.substr(2, 4);
63
-
64
- document.getElementById("_cc_alias").value = response[1];
65
- document.getElementById("ccgateway_cc_number_org").value = preResp + maskToken;
66
- document.getElementById("ccgateway_cc_number").value = response[0].token;
67
- document.getElementById("ccgateway_cc_profile").value = profile;
68
- document.getElementById("ccgateway_cc_wallet_id").value = cid;
69
- document.getElementById("ccgateway_cc_type").value = response[0].accttype;
70
- document.getElementById("_cc_owner").value = response[0].name;
71
- document.getElementById("ccgateway_expiration").value = month;
72
- document.getElementById("ccgateway_expiration_yr").value = "20" + year;
73
- document.getElementById("_cc_street").value = response[0].address;
74
- document.getElementById("_cc_city").value = response[0].city;
75
- document.getElementById("_cc_region").value = response[0].region;
76
- document.getElementById("_cc_country").value = response[0].country;
77
- document.getElementById("_cc_postcode").value = response[0].postal;
78
- document.getElementById("_cc_telephone").value = response[0].phone;
79
- }
80
-
81
-
82
- stopLoading();
83
- }
84
- });
85
- });
86
- </script>
87
- <style>
88
- #fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px;}
89
- .loader{position:absolute; top:80%; left:50%;}
90
- </style>
91
-
92
- <div id="customCheck" style="display: none;">
93
- <ul class="message">
94
- <li class="validation-advice"><ul><li><span>We are unable to perform the requested action, please contact customer service.</span></li></ul></li>
95
- </ul>
96
- </div>
97
-
98
- <div class="page-title title-buttons">
99
- <h1 onclick="getAlert();"><?php echo $this->__('Edit Card Form') ?></h1>
100
- <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>
101
- </div>
102
- <div id="fade" style="display:none;">
103
- <div id="loading_box" class="loader"></div>
104
- </div>
105
-
106
- <fieldset class="form-list">
107
- <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);">
108
- <?php
109
- $_code = $this->getMethodCode();
110
- $isTestMode = $this->isTransactionModeTest();
111
- $quote = Mage::getSingleton('checkout/session')->getQuote();
112
- $billingAddress = $quote->getBillingAddress();
113
- ?>
114
- <ul id="add_new_card_form_<?php echo $_code ?>" style="display:block">
115
-
116
- <li>
117
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
118
- <label for="<?php echo $_code ?>_cc_alias" class="required"><em>*</em><?php echo $this->__('Alias') ?></label>
119
- <div class="input-box">
120
- <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/>
121
- </div>
122
- </li>
123
- <li>
124
- <label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
125
- <div class="input-box">
126
- <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 />
127
- </div>
128
- </li>
129
- <li>
130
- <label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
131
- <div class="input-box">
132
- <select id="<?php echo $_code ?>ccgateway_cc_type" name='editcard[cc_type]' onchange="javascript:return resetcardinfo();" title="<?php echo $this->__('Credit Card Type') ?>" required >
133
- <option value=""><?php echo $this->__('--Please Select--') ?></option>
134
- <?php $_ccType = $this->getInfoData('cc_type'); ?>
135
- <?php foreach ($this->getCcTypes() as $ccType): ?>
136
- <option value="<?php echo $ccType['value']; ?>" ><?php echo $ccType['label']; ?></option>
137
- <?php endforeach ?>
138
- </select>
139
-
140
- </div>
141
- </li>
142
-
143
- <li>
144
- <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
145
- <div class="input-box">
146
-
147
- <input type="text" onchange="valid_credit_card(value, '<?php echo $isTestMode; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
148
- 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 />
149
- <input type="hidden" id="ccgateway_cc_number" name="editcard[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text" value="" required />
150
- <input type="hidden" id="ccgateway_cc_profile" name="editcard[profile]" title="<?php echo $this->__('Customer Profile') ?>" class="input-text" value="" required />
151
- <input type="hidden" id="ccgateway_cc_wallet_id" name="editcard[wallet_id]" title="<?php echo $this->__('Card wallet id') ?>" class="input-text" value="" required />
152
- <div class="validation-advice" id="testError" style="display: none;"></div>
153
- </div>
154
-
155
- </li>
156
- <li><div id="response"></div></li>
157
-
158
- <li>
159
- <label for="ccgateway_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
160
- <div class="input-box">
161
- <div class="v-fix">
162
- <select id="ccgateway_expiration" name='editcard[cc_exp_month]' class="month validate-cc-exp required-entry" style="width: 150px;" required >
163
- <?php foreach ($this->getCcMonths() as $k => $v): ?>
164
- <option value="<?php echo $k ? $k : '' ?>"<?php #if ($k == $_ccExpMonth): ?> selected="selected"<?php #endif ?>><?php echo $v ?></option>
165
- <?php endforeach ?>
166
- </select>
167
- </div>
168
- <div class="v-fix">
169
- <select id="ccgateway_expiration_yr" name='editcard[cc_exp_year]' class="year required-entry" style="width: 150px;" required >
170
- <?php foreach ($this->getCcYears() as $k => $v): ?>
171
- <option value="<?php echo $k ? $k : '' ?>"<?php #if ($k == $_ccExpYear): ?> selected="selected"<?php #endif ?>><?php echo $v ?></option>
172
- <?php endforeach ?>
173
- </select>
174
- </div>
175
-
176
- </div>
177
- </li>
178
-
179
- <div id="save_card" style="display:block;">
180
- <li>
181
- <label for="<?php echo $_code ?>_cc_street" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
182
- <div class="input-box">
183
- <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 />
184
- </div>
185
- </li>
186
- <li>
187
- <label for="<?php echo $_code ?>_cc_city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
188
- <div class="input-box">
189
- <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 />
190
- </div>
191
- </li>
192
-
193
- <li>
194
-
195
- <label for="<?php echo $_code ?>_cc_region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
196
- <div class="input-box">
197
- <?php $regionCollection = Mage::getModel('directory/region_api')->items("US"); ?>
198
- <select name='editcard[cc_region]' id='<?php echo $_code ?>_cc_region' required>
199
- <option>Please select region, state or province</option>
200
- <?php
201
- foreach ($regionCollection as $region) {
202
- ?>
203
- <option value="<?php echo $region['name'] ?>" <?php
204
- if ($billingAddress->getRegion() == $region['name']) {
205
- echo 'selected="selected"';
206
- }
207
- ?> ><?php echo $region['name'] ?></option>
208
- <?php
209
- }
210
- ?>
211
-
212
- </select>
213
- </div>
214
-
215
- </li>
216
-
217
- <li>
218
- <div class="field">
219
- <label for="<?php echo $_code ?>_cc_country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
220
- <div class="input-box">
221
- <?php
222
- $_countries = Mage::getResourceModel('directory/country_collection')
223
- ->loadData()
224
- ->toOptionArray(false)
225
- ?>
226
- <?php if (count($_countries) > 0): ?>
227
- <select name="editcard[cc_country]" id="<?php echo $_code ?>_cc_country" required>
228
- <option value="">-- Please Select --</option>
229
- <?php foreach ($_countries as $_country): ?>
230
- <option value="<?php echo $_country['value'] ?>" <?php
231
- if ($billingAddress->getCountryId() == $_country['value']) {
232
- echo 'selected="selected"';
233
- }
234
- ?>>
235
- <?php echo $_country['label'] ?>
236
- </option>
237
- <?php endforeach; ?>
238
- </select>
239
- <?php endif; ?>
240
-
241
- </div>
242
- </div>
243
- </li>
244
-
245
- <li>
246
- <label for="<?php echo $_code ?>_cc_postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
247
- <div class="input-box">
248
- <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 />
249
- </div>
250
- </li>
251
- <li>
252
- <label for="<?php echo $_code ?>_cc_telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
253
- <div class="input-box">
254
- <input type="text" title="<?php echo $this->__('telephone') ?>" class="input-text required-entry" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
255
- blockNonNumbers(this, event, false, false)" maxlength="10" id="<?php echo $_code ?>_cc_telephone" name="editcard[cc_telephone]" value="" required />
256
- </div>
257
- </li>
258
-
259
- <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>
260
-
261
- </div>
262
-
263
-
264
- <?php echo $this->getChildHtml() ?>
265
-
266
- </ul>
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>&nbsp;&nbsp;
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>&nbsp;&nbsp;
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
- $isTestMode = $this->isTransactionModeTest();
42
- $customerData = Mage::getSingleton('customer/session')->getCustomer();
43
- $customerId = $customerData->getId();
44
- $address = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBillingAddress();
45
-
46
- if($address){
47
- $customer = Mage::getModel('customer/customer')->load($customerId);
48
- $billingAddress = $customer->getDefaultBillingAddress();
49
- $billingStreet = $billingAddress->getData('street');
50
- $billingCity = $billingAddress->getData('city');
51
- $billingRegion = $billingAddress->getData('region');
52
- $billingCountry = $billingAddress->getData('country_id');
53
- $billingPostCode = $billingAddress->getData('postcode');
54
- $billingTelephone = $billingAddress->getData('telephone');
55
- }
56
- }
57
-
58
-
59
-
60
- ?>
61
- <div class="page-title title-buttons">
62
- <h1><?php echo $this->__('Add New Card Form') ?></h1>
63
- <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>
64
- </div>
65
-
66
- <div id="fade" style="display:none;">
67
- <div id="loading_box" class="loader"></div>
68
- </div>
69
-
70
- <fieldset class="form-list">
71
- <form name="addcard" method="post" action="<?php echo Mage::getUrl('ccgateway/cardmanagement/savePayment',array('_secure'=>true)); ?>">
72
- <ul id="add_new_card_form_<?php echo $_code ?>" style="display:block">
73
-
74
- <li>
75
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
76
- <label for="<?php echo $_code ?>_cc_alias" class="required"><em>*</em><?php echo $this->__('Alias') ?></label>
77
- <div class="input-box">
78
- <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/>
79
- </div>
80
- </li>
81
- <li>
82
- <label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
83
- <div class="input-box">
84
- <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 />
85
- </div>
86
- </li>
87
- <li>
88
- <label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
89
- <div class="input-box">
90
-
91
- <select id="ccgateway_cc_type" name="addcard[cc_type]" onchange="resetcardinfo();" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry validate-select" required>
92
- <option value=""><?php echo $this->__('--Please Select--') ?></option>
93
- <?php foreach ($this->getCcTypes() as $ccType): ?>
94
- <option value="<?php echo $ccType['value']; ?>" ><?php echo $ccType['label'] ?></option>
95
- <?php endforeach ?>
96
- </select>
97
- </div>
98
- </li>
99
-
100
- <li>
101
- <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
102
- <div class="input-box">
103
- <input type="text" onblur="valid_credit_card(value, '<?php echo $isTestMode; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
104
- 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 />
105
- <input type="hidden" id="ccgateway_cc_number" name="addcard[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text" value="" required />
106
- <div class="validation-advice" id="testError" style="display: none;"></div>
107
- </div>
108
-
109
- </li>
110
- <li><div id="response"></div></li>
111
-
112
- <li>
113
- <label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
114
- <div class="input-box">
115
- <div class="v-fix">
116
- <select id="<?php echo $_code ?>_expiration" name="addcard[cc_exp_month]" class="month validate-cc-exp required-entry" style="width: 150px;" required>
117
- <?php foreach ($this->getCcMonths() as $k => $v): ?>
118
- <option value="<?php echo $k ? $k : '' ?>" ><?php echo $v ?></option>
119
- <?php endforeach ?>
120
- </select>
121
- </div>
122
- <div class="v-fix">
123
- <select id="<?php echo $_code ?>_expiration_yr" name="addcard[cc_exp_year]" class="year required-entry" style="width: 150px;" required>
124
- <?php foreach ($this->getCcYears() as $k => $v): ?>
125
- <option value="<?php echo $k ? $k : '' ?>" ><?php echo $v ?></option>
126
- <?php endforeach ?>
127
- </select>
128
- </div>
129
-
130
- </div>
131
- </li>
132
-
133
-
134
- <li>
135
- <label for="<?php echo $_code ?>_cc_Billing"><strong><?php echo $this->__('Billing Information') ?></strong></label>
136
- </li>
137
- <?php if($address){ ?>
138
- <li>
139
- <div class="input-box">
140
- <div class="v-fix">
141
- <span style="margin-bottom: 10px;">
142
- <input type="checkbox" title="<?php echo $this->__('Use default bill to address') ?>"
143
- onclick="javascript:return showDefaultAddress('<?php echo $billingStreet; ?>', '<?php echo $billingCity; ?>', '<?php echo $billingRegion; ?>', '<?php echo $billingCountry; ?>', '<?php echo $billingPostCode; ?>', '<?php echo $billingTelephone; ?>')"
144
- id="ccgateway_default_address" name="addcard[default_address]" value="" />
145
- </span>
146
- <label for="<?php echo $_code ?>_cc_wallet"><?php echo $this->__('Use default bill to address') ?></label>
147
- </div>
148
- </div>
149
-
150
- </li>
151
- <?php } ?>
152
-
153
- <div id="save_card" style="display:block;">
154
- <li>
155
- <label for="<?php echo $_code ?>_cc_street" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
156
- <div class="input-box">
157
- <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 />
158
- </div>
159
- </li>
160
- <li>
161
- <label for="<?php echo $_code ?>_cc_city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
162
- <div class="input-box">
163
- <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 />
164
- </div>
165
- </li>
166
-
167
- <li>
168
-
169
- <label for="<?php echo $_code ?>_cc_region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
170
- <div class="input-box">
171
- <?php $regionCollection = Mage::getModel('directory/region_api')->items("US"); ?>
172
- <select name='addcard[cc_region]' id='<?php echo $_code ?>_cc_region' class="required-entry validate-select" required>
173
- <option>Please select region, state or province</option>
174
- <?php
175
- foreach ($regionCollection as $region) {
176
- ?>
177
- <option value="<?php echo $region['name'] ?>" ><?php echo $region['name'] ?></option>
178
- <?php
179
- }
180
- ?>
181
-
182
- </select>
183
- </div>
184
-
185
- </li>
186
-
187
-
188
-
189
- <li>
190
- <div class="field">
191
- <label for="<?php echo $_code ?>_cc_country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
192
- <div class="input-box">
193
- <?php
194
- $_countries = Mage::getResourceModel('directory/country_collection')
195
- ->loadData()
196
- ->toOptionArray(false)
197
- ?>
198
- <?php if (count($_countries) > 0): ?>
199
- <select name="addcard[cc_country]" id="<?php echo $_code ?>_cc_country" required>
200
- <option value="">-- Please Select --</option>
201
- <?php foreach ($_countries as $_country): ?>
202
- <option value="<?php echo $_country['value'] ?>" >
203
- <?php echo $_country['label'] ?>
204
- </option>
205
- <?php endforeach; ?>
206
- </select>
207
- <?php endif; ?>
208
-
209
- </div>
210
- </div>
211
- </li>
212
-
213
- <li>
214
- <label for="<?php echo $_code ?>_cc_postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
215
- <div class="input-box">
216
- <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 />
217
- </div>
218
- </li>
219
- <li>
220
- <label for="<?php echo $_code ?>_cc_telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
221
- <div class="input-box">
222
- <input type="text" title="<?php echo $this->__('telephone') ?>" class="input-text required-entry" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
223
- blockNonNumbers(this, event, false, false)" maxlength="10" id="<?php echo $_code ?>_cc_telephone" name="addcard[cc_telephone]" value="" required />
224
- </div>
225
- </li>
226
-
227
- <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>
228
-
229
- </div>
230
-
231
-
232
- <?php echo $this->getChildHtml() ?>
233
-
234
- </ul>
235
- </form>
236
- </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
+ <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
- <?php
51
- $_code = $this->getMethodCode();
52
- $isTestMode = $this->isTransactionModeTest();
53
- $quote = Mage::getSingleton('checkout/session')->getQuote();
54
- $billingAddress = $quote->getBillingAddress();
55
-
56
- $requestUrl = Mage::getUrl('ccgateway/payment/getprofiledata',array('_secure'=>true));
57
- $billingStreet = $billingAddress->getStreet(1);
58
- $billingCity = $billingAddress->getCity();
59
- $billingRegion = $billingAddress->getRegion();
60
- $billingCountry = $billingAddress->getCountryId();
61
- $billingPostCode = $billingAddress->getPostcode();
62
- $billingTelephone = $billingAddress->getTelephone();
63
- ?>
64
-
65
- <ul id="payment_form_<?php echo $_code ?>" style="display:none">
66
-
67
- <?php if ($this->getCheckoutType() == "payment_page") { ?>
68
- <li>
69
- <?php echo Mage::helper('ccgateway')->__('You will be redirected to CardConnect website when you place an order.') ?>
70
- </li>
71
- <?php } else { ?>
72
-
73
-
74
- <?php
75
- if ($this->hasCCProfile() == true) {
76
- $response = $this->getDefaultCCProfileId();
77
-
78
- if($response !="CardConnect_Error"){
79
- if(isset($response[0]['token'])){
80
- $maskedToken = substr_replace($response[0]['token'], str_repeat("*", 12), 0, 12);
81
-
82
- }else{
83
- $maskedToken = "";
84
- }
85
- ?>
86
-
87
- <li class="wide">
88
- <label for="<?php echo $_code ?>_cc_profile_name" class="required"><em>*</em><?php echo $this->__('Choose Your Card For Payment') ?></label>
89
- <div class="input-box">
90
- <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">
91
- <option value=""><?php echo $this->__('--Please Select--') ?></option>
92
- <?php foreach ($this->getCCProfileName() as $data): ?>
93
- <option value="<?php echo $data->getData('CC_PROFILEID'); ?>"
94
- <?php $profileId = (isset($response[0]['profileid'])) ? $response[0]['profileid'] : null;
95
- if ($data->getData('CC_PROFILEID') === $profileId) { ?>
96
- selected="selected"
97
- <?php } ?> >
98
- <?php echo $data->getData('CC_CARD_NAME'); ?>
99
- </option>
100
- <?php endforeach ?>
101
- <option value="<?php echo "Checkout with new card"; ?>" ><?php echo "Checkout with new card"; ?></option>
102
- </select>
103
-
104
- </div>
105
- </li>
106
- <?php }else{ ?>
107
- <ul class="messages">
108
- <li class="error-msg"><ul><li><span>Unable to perform requested action, please contact customer service.</span></li></ul></li>
109
- </ul>
110
- <?php } } ?>
111
-
112
- <div id="payment_info" <?php if ($this->hasCCProfile() == true) { ?> style="display: none;" <?php } ?> >
113
- <li>
114
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
115
- <label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
116
- <div class="input-box">
117
- <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]"
118
- value="<?php echo $name = (isset($response[0]['name'])) ? $response[0]['name'] : null; ?>" />
119
- </div>
120
- </li>
121
- <li>
122
- <label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
123
- <div class="input-box" >
124
-
125
- <select readonly id="ccgateway_cc_type" name="payment[cc_type]" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry validate-select" onchange="resetcardinfo();">
126
- <option value=""><?php echo $this->__('--Please Select--') ?></option>
127
- <?php $accttype = (isset($response[0]['accttype'])) ? $response[0]['accttype'] : null;
128
- foreach ($this->getCcTypes() as $ccType): ?>
129
- <option value="<?php echo $ccType['value']; ?>"<?php if ($ccType['value'] == $accttype ): ?> selected="selected"<?php endif ?> ><?php echo $ccType['label']; ?></option>
130
- <?php endforeach ?>
131
- </select>
132
- </div>
133
- </li>
134
- </div>
135
-
136
- <li <?php if($response == "CardConnect_Error"){?> style="display: none;" <?php } ?>>
137
- <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
138
- <div class="input-box">
139
- <?php if ($this->hasCCProfile() == true) { ?>
140
- <label id="cc_number_label" for="<?php echo $_code ?>_cc_number" class="input-text required-entry"><?php echo $maskedToken; ?></label>
141
-
142
- <input type="text" hidden onchange="valid_credit_card(value , '<?php echo $isTestMode; ?>')" 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; ?>" />
143
-
144
- <?php } else { ?>
145
- <input type="text" onchange="valid_credit_card(value , '<?php echo $isTestMode; ?>')" 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; ?>" />
146
-
147
- <?php } ?>
148
- <input type="text" hidden id="ccgateway_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text"
149
- value="<?php echo $token = (isset($response[0]['token'])) ? $response[0]['token'] : null; ?>" />
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
- <div id="fade" style="display:none;">
157
- <div id="loading_box" class="loader"></div>
158
- </div>
159
-
160
-
161
- <div id="payment_info1" <?php if ($this->hasCCProfile() == true) { ?> style="display: none;" <?php } ?> >
162
- <li>
163
- <label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
164
- <div class="input-box">
165
- <div class="v-fix">
166
- <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
167
- <?php if (isset($response[0]['expiry'])){ $_ccExpMonth = substr($response[0]['expiry'], 0, 2); } else { $_ccExpMonth = ""; } ?>
168
- <?php foreach ($this->getCcMonths() as $k => $v): ?>
169
- <option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
170
- <?php endforeach ?>
171
- </select>
172
- </div>
173
- <div class="v-fix">
174
- <?php if (isset($response[0]['expiry'])){ $_ccExpYear = substr($response[0]['expiry'], 2, 4); } else { $_ccExpYear = ""; } ?>
175
- <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
176
- <?php foreach ($this->getCcYears() as $k => $v): ?>
177
- <option value="<?php echo $k ? $k : '' ?>"<?php if ($k == "20" . $_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
178
- <?php endforeach ?>
179
- </select>
180
- </div>
181
-
182
- </div>
183
- </li>
184
- </div>
185
- <li <?php if($response =="CardConnect_Error"){?> style="display: none;" <?php } ?>>
186
- <label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
187
- <div class="input-box">
188
- <div class="v-fix">
189
- <input type="text" onkeypress="javascript:return validate(event, 'ccgateway_cc_cid');
190
- 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" />
191
- </div>
192
- <div style="font-size: 12px; margin-top: 10px; text-decoration: underline;">
193
- <?php echo $this->__('Card Verification Number not stored.') ?>
194
- </div>
195
- <!-- <a href="#" class="cvv-what-is-this"><?php // echo $this->__('What is this?') ?></a> -->
196
- </div>
197
- </li>
198
-
199
- <?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { ?>
200
- <div id="save_card_4future" <?php if ($this->hasCCProfile() == true) { ?> style="display:none;" <?php } ?>>
201
- <li>
202
- <span style="margin-bottom: 10px;">
203
- <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()" />
204
- </span>
205
- <label for="<?php echo $_code ?>_cc_wallet"><?php echo $this->__('Save Card details for future use') ?></label>
206
- </li>
207
- </div>
208
- <?php } ?>
209
-
210
-
211
- <div id="save_card" style="display:none;">
212
-
213
- <li>
214
- <label for="<?php echo $_code ?>_cc_Billing"><strong><?php echo $this->__('Billing Information') ?></strong></label>
215
- </li>
216
-
217
- <li>
218
- <span style="margin-bottom: 10px;">
219
- <input type="checkbox" title="<?php echo $this->__('Use default bill to address') ?>" id="ccgateway_default_address" name="payment[cc_default_address]" value="checked"
220
- onclick="javascript:return showDefaultAddress('<?php echo $billingStreet; ?>', '<?php echo $billingCity; ?>', '<?php echo $billingRegion; ?>', '<?php echo $billingCountry; ?>', '<?php echo $billingPostCode; ?>', '<?php echo $billingTelephone; ?>')" />
221
- </span>
222
- <label for="<?php echo $_code ?>_default_address"><?php echo $this->__('Use default bill to address') ?></label>
223
- </li>
224
-
225
-
226
- <li>
227
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
228
- <label for="<?php echo $_code ?>_cc_profile_name" class="required"><em>*</em><?php echo $this->__('Card Name (Alias)') ?></label>
229
- <div class="input-box">
230
- <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="" />
231
- </div>
232
- </li>
233
- <li>
234
- <label for="<?php echo $_code ?>_cc_street" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
235
- <div class="input-box">
236
- <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="" />
237
- </div>
238
- </li>
239
- <li>
240
- <label for="<?php echo $_code ?>_cc_city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
241
- <div class="input-box">
242
- <input type="text" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_city" name="payment[cc_city]" value="" />
243
- </div>
244
- </li>
245
-
246
- <li>
247
-
248
- <label for="<?php echo $_code ?>_cc_region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
249
- <div class="input-box">
250
- <?php $regionCollection = Mage::getModel('directory/region_api')->items("US"); ?>
251
- <select name='payment[cc_region]' id='<?php echo $_code ?>_cc_region' class="validate-select" >
252
- <option value="">Please select region, state or province</option>
253
- <?php
254
- foreach ($regionCollection as $region) {
255
- ?>
256
- <option value="<?php echo $region['name'] ?>" ><?php echo $region['name'] ?></option>
257
- <?php
258
- }
259
- ?>
260
-
261
- </select>
262
- </div>
263
-
264
- </li>
265
-
266
-
267
-
268
- <li>
269
- <div class="field">
270
- <label for="<?php echo $_code ?>_cc_country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
271
- <div class="input-box">
272
- <?php
273
- $_countries = Mage::getResourceModel('directory/country_collection')
274
- ->loadData()
275
- ->toOptionArray(false)
276
- ?>
277
- <?php if (count($_countries) > 0): ?>
278
- <select name="payment[cc_country]" id="<?php echo $_code ?>_cc_country">
279
- <option value="">-- Please Select --</option>
280
- <?php foreach ($_countries as $_country): ?>
281
- <option value="<?php echo $_country['value'] ?>" >
282
- <?php echo $_country['label'] ?>
283
- </option>
284
- <?php endforeach; ?>
285
- </select>
286
- <?php endif; ?>
287
-
288
- </div>
289
- </div>
290
- </li>
291
-
292
- <li>
293
- <label for="<?php echo $_code ?>_cc_postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
294
- <div class="input-box">
295
- <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="" />
296
- </div>
297
- </li>
298
- <li>
299
- <label for="<?php echo $_code ?>_cc_telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
300
- <div class="input-box">
301
- <input type="text" title="<?php echo $this->__('telephone') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_telephone" name="payment[cc_telephone]" value="" />
302
- </div>
303
- </li>
304
-
305
-
306
- </div>
307
-
308
-
309
- <?php echo $this->getChildHtml() ?>
310
- <?php } ?>
311
-
312
- </ul>
313
-
314
- </fieldset>
315
- <?php } ?>
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
- // construct url
39
- if(isTestMode == "yes"){
40
- var url = "https://fts.prinpay.com:6443/cardsecure/cs";
41
- }else{
42
- var url = "https://fts.prinpay.com:8443/cardsecure/cs";
43
- }
44
-
45
- var method = "GET";
46
- var type = "json";
47
- var params = "action=CE";
48
- params = params + "&type=" + type;
49
- params = params + "&data=" + cardNum;
50
-
51
- // send request
52
- if (window.XMLHttpRequest) {
53
- xhr = new XMLHttpRequest();
54
- if (xhr.withCredentials !== undefined) {
55
- xhr.onreadystatechange = processXMLHttpResponse;
56
- } else {
57
- xhr = new XDomainRequest();
58
- xhr.onload = processXDomainResponse;
59
- }
60
- } else {
61
- if (window.ActiveXObject) {
62
- try {
63
- xhr = new ActiveXObject("Microsoft.XMLHTTP");
64
- xhr.onreadystatechange = processXMLHttpResponse;
65
- }
66
- catch (e) {
67
- }
68
- }
69
- }
70
- if (xhr) {
71
- if (method == "GET") {
72
- xhr.open("GET", url + "?" + params, true);
73
- xhr.send(null);
74
- } else {
75
- xhr.open("POST", url + "?action=CE", true);
76
- xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
77
- xhr.send(params);
78
- }
79
-
80
- }
81
- else {
82
- document.getElementById("response").innerHTML = "Sorry, this browser does not support AJAX requests.";
83
- }
84
-
85
- return false;
86
-
87
- }
88
-
89
- function processXMLHttpResponse() {
90
-
91
- if (xhr.readyState == 4) {
92
- var response = "";
93
- if (xhr.status == 200) {
94
- response = processResponse(response);
95
- // alert(response);
96
- } else {
97
- response = "There was a problem with the request " + xhr.status;
98
- }
99
- document.getElementById("ccgateway_cc_number_org").disabled = false;
100
-
101
- var regExp = "^\\d+(\\.\\d+)?$";
102
- if (response.match(regExp)) {
103
- document.getElementById("ccgateway_cc_number").value = response;
104
- var preResp = "************";
105
- var resp = response.substr(12);
106
- document.getElementById("ccgateway_cc_number_org").value = preResp + resp;
107
- } else {
108
- document.getElementById("response").classList.add('validation-advice');
109
- document.getElementById("response").innerHTML = response;
110
- }
111
-
112
- }
113
- }
114
-
115
- function processXDomainResponse() {
116
- var response = processResponse(response);
117
- document.getElementById("ccgateway_cc_number").value = response;
118
- document.getElementById("ccgateway_cc_number_org").value = response;
119
- }
120
-
121
- function processResponse(response) {
122
- // alert(response);
123
- var type = "json";
124
- if (type == "xml") {
125
- var cardsecure = xhr.responseXML;
126
- if (cardsecure == null) {
127
- cardsecure = parseXml(xhr.responseText);
128
- }
129
- var data = cardsecure.getElementsByTagName("data")[0];
130
- response = type + " token = " + data.firstChild.data;
131
- } else if (type == "json") {
132
- try {
133
- var parse = xhr.responseText.substring(14, xhr.responseText.length - 2);
134
- var object = JSON.parse(parse);
135
- response = object.data;
136
- } catch (e) {
137
- response = "JSON response is not parseable.";
138
- }
139
- } else {
140
- var pos = xhr.responseText.indexOf("data=");
141
- response = "html token = " + xhr.responseText.substring(pos + 5);
142
- }
143
-
144
-
145
- document.getElementById("ccgateway_cc_number_org").disabled = false;
146
-
147
-
148
- return response;
149
-
150
- }
151
-
152
- function parseXml(xmlStr) {
153
- if (window.DOMParser) {
154
- return (new window.DOMParser()).parseFromString(xmlStr, "text/xml");
155
- } else if (typeof window.ActiveXObject != "undefined" && new window.ActiveXObject("Microsoft.XMLDOM")) {
156
- var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
157
- xmlDoc.async = "false";
158
- xmlDoc.loadXML(xmlStr);
159
- return xmlDoc;
160
- } else {
161
- return null;
162
- }
163
- }
164
-
165
-
166
-
167
-
168
- function valid_credit_card(value, isTestMode)
169
- {
170
- startLoading();
171
- // The Luhn Algorithm. It's so pretty.
172
- var nCheck = 0, nDigit = 0, bEven = false;
173
- if (value == null || value == "") {
174
- // alert("Please Fill the require field");
175
- document.getElementById("testError").style.display = "block";
176
- document.getElementById("testError").innerHTML = "Please Fill the require field.";
177
- stopLoading();
178
- return false;
179
- } else {
180
- var cardNum = value;
181
- value = value.replace(/\D/g, "");
182
- document.getElementById("testError").style.display = "none";
183
- }
184
-
185
- for (var n = value.length - 1; n >= 0; n--)
186
- {
187
- var cDigit = value.charAt(n),
188
- nDigit = parseInt(cDigit, 10);
189
-
190
- if (bEven)
191
- {
192
- if ((nDigit *= 2) > 9)
193
- nDigit -= 9;
194
- }
195
- nCheck += nDigit;
196
- bEven = !bEven;
197
- }
198
-
199
- if ((nCheck % 10) == 0) {
200
- var cardType = GetCardType(cardNum);
201
- var e = document.getElementById("ccgateway_cc_type");
202
- var selectedCardType = e.options[e.selectedIndex].value;
203
- if (cardType == selectedCardType && selectedCardType != null && cardNum != null && cardNum.length >=12 ) {
204
- tokenize(cardNum , isTestMode);
205
- setTimeout(stopLoading, 1000);
206
- } else {
207
- document.getElementById("testError").style.display = "block";
208
- document.getElementById("testError").innerHTML = "Entered card information mismatched. Please try again.";
209
- document.getElementById("ccgateway_cc_number_org").value = "";
210
- document.getElementById("ccgateway_cc_number_org").focus();
211
- stopLoading();
212
- }
213
- return;
214
- }
215
- else {
216
- document.getElementById("testError").style.display = "block";
217
- document.getElementById("testError").innerHTML = "Please Enter valid card data.";
218
- document.getElementById("ccgateway_cc_number_org").value = "";
219
- document.getElementById("ccgateway_cc_number_org").focus();
220
- stopLoading();
221
- return false;
222
- }
223
-
224
- return false;
225
- }
226
-
227
-
228
-
229
- function GetCardType(number)
230
- {
231
- // visa
232
- var re = new RegExp("^4");
233
- if (number.match(re) != null)
234
- return "VISA";
235
-
236
- // Mastercard
237
- re = new RegExp("^5[1-5]");
238
- if (number.match(re) != null)
239
- return "MC";
240
-
241
- // AMEX
242
- re = new RegExp("^3[47]");
243
- if (number.match(re) != null)
244
- return "AMEX";
245
-
246
- // Discover
247
- 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)");
248
- if (number.match(re) != null)
249
- return "DISC";
250
-
251
- return "";
252
- }
253
-
254
-
255
- function validate(key , inputId) {
256
- //getting key code of pressed key
257
- var keycode = (key.which) ? key.which : key.keyCode;
258
- //comparing pressed keycodes
259
- if (keycode == 46) {
260
- var inputVoidValue = document.getElementById(inputId).value;
261
- if (inputVoidValue.indexOf('.') < 1) {
262
- return false;
263
- }
264
- return false;
265
- }
266
- if (keycode != 46 && keycode > 31 && (keycode < 48 || keycode > 57)) {
267
- return false;
268
- }
269
- else
270
- return true;
271
- }
272
-
273
- function blockNonNumbers(obj, e, allowDecimal, allowNegative) {
274
- var key;
275
- var isCtrl = false;
276
- var keychar;
277
- var reg;
278
-
279
- if (window.event) {
280
- key = e.keyCode;
281
- isCtrl = window.event.ctrlKey
282
- }
283
- else if (e.which) {
284
- key = e.which;
285
- isCtrl = e.ctrlKey;
286
- }
287
-
288
- if (isNaN(key))
289
- return true;
290
-
291
- keychar = String.fromCharCode(key);
292
- // check for backspace or delete, or if Ctrl was pressed
293
-
294
- if (key == 8 || isCtrl) {
295
- return true;
296
- }
297
-
298
- reg = /\d/;
299
- var isFirstN = allowNegative ? keychar == '-' && obj.value.indexOf('-') == -1 : false;
300
- var isFirstD = allowDecimal ? keychar == '.' && obj.value.indexOf('.') == -1 : false;
301
-
302
- return isFirstN || isFirstD || reg.test(keychar);
303
- }
304
-
305
-
306
- function showAliseField(){
307
-
308
- if( document.getElementById("ccgateway_cc_wallet").checked == true){
309
- document.getElementById("save_card").show();
310
- }else{
311
- document.getElementById("save_card").hide();
312
- }
313
-
314
- }
315
-
316
-
317
- function callGetProfileWebserviceController( requestUrl, profile ){
318
-
319
-
320
-
321
- if((profile != "Checkout with new card")){
322
-
323
- startLoading();
324
- document.getElementById("ccgateway_cc_owner").readOnly = true;
325
-
326
- document.getElementById("ccgateway_cc_number_org").disabled= true;
327
- document.getElementById("ccgateway_cc_number").readOnly = true;
328
- document.getElementById("ccgateway_cc_type").readOnly = true;
329
- document.getElementById("ccgateway_expiration").readOnly = true;
330
- document.getElementById("ccgateway_expiration_yr").readOnly = true;
331
- document.getElementById("ccgateway_cc_cid").readOnly = false;
332
- document.getElementById("ccgateway_cc_wallet").disabled = true;
333
- new Ajax.Request(requestUrl, {
334
-
335
- method: 'Post',
336
- parameters: {profile: profile},
337
- requestHeaders: {Accept: 'application/json'},
338
- onComplete: function(transport) {
339
-
340
- respjson = transport.responseText.evalJSON();
341
- var response = JSON.parse(respjson);
342
-
343
- var preResp = "************";
344
- var maskToken = response[0].token.substr(12);
345
- var month = response[0].expiry.substr(0,2);
346
- month = month.replace(/^0+/, '');
347
- var year = response[0].expiry.substr(2,4);
348
-
349
-
350
- document.getElementById("ccgateway_cc_owner").value = response[0].name;
351
- document.getElementById("ccgateway_cc_number_org").hide();
352
- document.getElementById("cc_number_label").show();
353
- document.getElementById("cc_number_label").innerHTML= preResp+maskToken;
354
-
355
- document.getElementById("ccgateway_cc_number").value = response[0].token;
356
- document.getElementById("ccgateway_cc_type").value = response[0].accttype;
357
- document.getElementById("ccgateway_cc_owner").value = response[0].name;
358
- document.getElementById("ccgateway_expiration").value = month;
359
- document.getElementById("ccgateway_expiration_yr").value = "20"+year;
360
- document.getElementById("ccgateway_cc_cid").value = "";
361
- document.getElementById("save_card_4future").hide();
362
- document.getElementById("payment_info").hide();
363
- document.getElementById("payment_info1").hide();
364
- stopLoading();
365
- }
366
- });
367
- }else{
368
-
369
- document.getElementById("ccgateway_cc_number_org").style.display='block';
370
- document.getElementById("cc_number_label").hide();
371
- document.getElementById("ccgateway_cc_owner").readOnly = false;
372
- document.getElementById("ccgateway_cc_number_org").disabled= false;
373
- document.getElementById("ccgateway_cc_number").readOnly = false;
374
- document.getElementById("ccgateway_cc_type").readOnly = false;
375
- document.getElementById("ccgateway_expiration").readOnly = false;
376
- document.getElementById("ccgateway_expiration_yr").readOnly = false;
377
- document.getElementById("ccgateway_cc_cid").readOnly = false;
378
- document.getElementById("ccgateway_cc_wallet").disabled = false;
379
-
380
- document.getElementById("ccgateway_cc_owner").value = "";
381
- document.getElementById("ccgateway_cc_number_org").value = "";
382
- document.getElementById("ccgateway_cc_number").value = "";
383
- document.getElementById("ccgateway_cc_type").value = "";
384
- document.getElementById("ccgateway_expiration").value = "";
385
- document.getElementById("ccgateway_expiration_yr").value = "";
386
- document.getElementById("ccgateway_cc_cid").value = "";
387
- document.getElementById("save_card_4future").show();
388
- document.getElementById("payment_info").show();
389
- document.getElementById("payment_info1").show();
390
-
391
- }
392
- }
393
-
394
-
395
- function showDefaultAddress(billingStreet,billingCity,billingRegion,billingCountry,billingPostCode,billingTelephone){
396
-
397
- if( document.getElementById("ccgateway_default_address").checked == true){
398
- document.getElementById("ccgateway_cc_street").value = billingStreet;
399
- document.getElementById("ccgateway_cc_city").value = billingCity;
400
- document.getElementById("ccgateway_cc_region").value = billingRegion;
401
- document.getElementById("ccgateway_cc_country").value = billingCountry;
402
- document.getElementById("ccgateway_cc_postcode").value = billingPostCode;
403
- document.getElementById("ccgateway_cc_telephone").value = billingTelephone;
404
- }else{
405
- document.getElementById("ccgateway_cc_street").value = "";
406
- document.getElementById("ccgateway_cc_city").value = "";
407
- document.getElementById("ccgateway_cc_region").value = "";
408
- document.getElementById("ccgateway_cc_country").value = "";
409
- document.getElementById("ccgateway_cc_postcode").value = "";
410
- document.getElementById("ccgateway_cc_telephone").value = "";
411
- }
412
-
413
- }
414
-
415
-
416
- var loaded = false;
417
- function startLoading() {
418
- loaded = false;
419
- showLoadingImage();
420
- }
421
-
422
- function showLoadingImage() {
423
- document.getElementById("fade").style.display = "block";
424
- var el = document.getElementById("loading_box");
425
- if (el && !loaded) {
426
- el.innerHTML = '<img src="" alt="Loading...">';
427
- new Effect.Appear('loading_box');
428
- }
429
- }
430
-
431
- function stopLoading() {
432
- Element.hide('fade');
433
- loaded = true;
434
- document.getElementById("fade").style.display = "none";
435
- }
436
-
437
- function resetcardinfo() {
438
- document.getElementById("ccgateway_cc_number_org").value = "";
439
- document.getElementById("ccgateway_cc_number_org").focus();
440
- document.getElementById("ccgateway_cc_number").value = "";
441
- document.getElementById("ccgateway_expiration").value = "";
442
- document.getElementById("ccgateway_expiration_yr").value = "";
443
- return false;
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.6.1</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,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-07-28</date>
14
- <time>12:37:53</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="4185650bfb5e2a872f1db890d5971fd0"/><file name="Transaction.php" hash="dc2fd1f6b45f1e2a53495017d443b1d2"/></dir></dir></dir></dir></dir><dir name="Block"><file name="Addcard.php" hash="a36241555adfc297c65baa365c627696"/><dir name="Adminhtml"><dir name="Customer"><file name="Data.php" hash="355316bbd2d959b04d26f732c64ca9a2"/><dir name="Edit"><dir name="Tab"><file name="Account.php" hash="c1b27f91036c483ae39685602f9f2633"/></dir></dir></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><dir name="Create"><file name="Form.php" hash="b1988d1db38e0f2b3d88ef6e829f9f6e"/><file name="Items.php" hash="15bf4862d806f944138e306960417050"/></dir><dir name="View"><file name="Form.php" hash="f0f8634c1f0033330eab4da031e3770c"/></dir></dir><dir name="Invoice"><dir name="Create"><file name="Form.php" hash="ad294ba34400cfe291187306e554af46"/><file name="Items.php" hash="b6424138e3ad39e2300319c02c32beae"/></dir><dir name="View"><file name="Form.php" hash="68a9a8435e67fe3e9d8f2f80e2c8d892"/></dir></dir><dir name="Shipment"><dir name="Create"><file name="Form.php" hash="f327b0f3fc5ef3dcb506dbeffd00ec8f"/></dir><dir name="View"><file name="Form.php" hash="6e56e053843082a99896cf93b2de93f3"/></dir></dir><dir name="View"><dir name="Tab"><file name="Info.php" hash="5e30f132a5180278bb13a3c20a92081a"/></dir></dir></dir></dir></dir><file name="Cardmanagement.php" hash="28867ca0604f6cd74060c4aa5de98553"/><file name="Form.php" hash="5c92b69b370998bb3b873ffb4484ec09"/><file name="Info.php" hash="3c47b946295f2cf51acd9e7e841a7f77"/><dir name="Onepage"><file name="Billing.php" hash="2bf341d653420e82e44bd15711c01abe"/></dir><file name="Redirect.php" hash="90c95f26953ee79d3d8f03f5cb664a41"/></dir><dir name="Helper"><file name="Data.php" hash="fde5ab8b9f2c54111accef0f62fcb9bf"/></dir><dir name="Model"><dir name="Cardconnect"><file name="Resp.php" hash="d96c58ed0636097348f7020d529708bb"/><file name="Wallet.php" hash="d271c1cea34fce819e2eed1b2f06b3a8"/></dir><file name="Observer.php" hash="47f4413d34a0c1c7d8e07d41c7b1f8eb"/><dir name="Resource"><dir name="Cardconnect"><dir name="Resp"><file name="Collection.php" hash="454a1ad0ebe24f3af523001fd285e8f3"/></dir><file name="Resp.php" hash="fd67df66591d46cfb8399029bf02015c"/><dir name="Wallet"><file name="Collection.php" hash="2b7040940b22f2934df94c5779c44c81"/></dir><file name="Wallet.php" hash="b7254cf020d5ac4bfdce636692be896a"/></dir></dir><file name="Standard.php" hash="9b39edf8fa02bfd639a96a41fb591c3a"/><file name="cardconnect_webservice.php" hash="693b2bf76ec0ff58ec4f7980b12ee074"/></dir><dir name="blocks"><file name="billing.phtml" hash="ad81f6b3f396ddfb9c2c2e43f3b2d3eb"/><dir name="creditmemo"><dir name="create"><file name="form.phtml" hash="f88e763be7a99551c9f54354672d4551"/></dir><dir name="view"><file name="form.phtml" hash="d4d1a1402ae9bb9c0811786aa9795e38"/></dir></dir><file name="info.phtml" hash="bf0898675acdf232a9b54ddf89c7e248"/><dir name="invoice"><dir name="create"><file name="form.phtml" hash="9203de0089224e123aa8ad7bbb0f0f23"/><file name="items.phtml" hash="393419bf1ff4555f39e37deee2c7794f"/></dir><dir name="view"><file name="form.phtml" hash="1cb3c24f93138f5871b571260f48d1bc"/></dir></dir><dir name="shipment"><dir name="create"><file name="form.phtml" hash="f227f013e1410a82c1ffbad757e0e8de"/></dir><dir name="view"><file name="form.phtml" hash="be5ea3d6fa7277cb77785e92a9275b44"/></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="d151271d5da6a24c7bd7da24022a6348"/></dir><file name="OrderController.php" hash="39546076c91c5069420a614f12f7e79f"/></dir></dir><file name="CardmanagementController.php" hash="e18bb5127241bc30200dfa201361a190"/><file name="PaymentController.php" hash="58c4e0717307107aa73912faed2e9b18"/></dir><dir name="etc"><file name="config.xml" hash="da899d25701dc39e634c8b712a6f03d7"/><file name="system.xml" hash="b931b80be0fac76b5adeb481e8bd6e3d"/></dir><dir name="sql"><dir name="cardconnect_ccgateway_setup"><file name="install-1.0.0.php" hash="53714977ae574b3ede0b3701c271a42f"/></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="354ffbd902833eaa7c7af1a847cb230f"/></dir><dir name="template"><dir name="ccgateway"><file name="form.phtml" hash="2b12652e827ba54f046d383ed9a7fbb0"/><file name="info.phtml" hash="296b8e5284fa15e1ed0d771bb5a6b644"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ccgateway.xml" hash="4752e242b9f6bd6d8e8dfa69f2e8b8c5"/></dir><dir name="template"><dir name="ccgateway"><file name="blank.phtml" hash="b11f3718962eb7574970bd346f2105aa"/><dir name="cardmanagement"><file name="editcard.phtml" hash="2aa4b7b3972908e268189a603957c3f2"/><file name="index.phtml" hash="32f863e7bd2c3c05ac6aefab63283154"/><file name="new.phtml" hash="ce08646f609cce75445a03bf9821c227"/></dir><file name="form.phtml" hash="1ade6fdd45536141701d98fc547ce9cd"/><file name="info.phtml" hash="c107ff370b915cd6cc0bf49c1a36363b"/><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="eb4c6d523d8e0b694c9231648a389a7e"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="cardconnect"><file name="ccgateway.js" hash="b3e32c34bd87cc8b377081b81714b54a"/></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>
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
+ }