TwoKChargeInc_TwoKCharge - Version 1.0.1

Version Notes

This module adds the wide range of different 2000Charge methods.

Download this release

Release Info

Developer 2000Charge Inc
Extension TwoKChargeInc_TwoKCharge
Version 1.0.1
Comparing to
See all releases


Version 1.0.1

Files changed (66) hide show
  1. app/code/community/TwoKChargeInc/TwoKCharge/Block/Form.php +35 -0
  2. app/code/community/TwoKChargeInc/TwoKCharge/Block/PaymentInfo.php +43 -0
  3. app/code/community/TwoKChargeInc/TwoKCharge/Block/Postback.php +34 -0
  4. app/code/community/TwoKChargeInc/TwoKCharge/Block/Redirect.php +34 -0
  5. app/code/community/TwoKChargeInc/TwoKCharge/Helper/Data.php +35 -0
  6. app/code/community/TwoKChargeInc/TwoKCharge/Model/Dbiban.php +36 -0
  7. app/code/community/TwoKChargeInc/TwoKCharge/Model/Dbsource.php +36 -0
  8. app/code/community/TwoKChargeInc/TwoKCharge/Model/Mysql4/Dbiban.php +34 -0
  9. app/code/community/TwoKChargeInc/TwoKCharge/Model/Mysql4/Dbiban/Collection.php +36 -0
  10. app/code/community/TwoKChargeInc/TwoKCharge/Model/Mysql4/Dbsource.php +35 -0
  11. app/code/community/TwoKChargeInc/TwoKCharge/Model/Mysql4/Dbsource/Collection.php +36 -0
  12. app/code/community/TwoKChargeInc/TwoKCharge/Model/Resource/Setup.php +31 -0
  13. app/code/community/TwoKChargeInc/TwoKCharge/Model/Session.php +33 -0
  14. app/code/community/TwoKChargeInc/TwoKCharge/Model/Standard.php +712 -0
  15. app/code/community/TwoKChargeInc/TwoKCharge/Model/System/Config/Source/Allowtypeall.php +39 -0
  16. app/code/community/TwoKChargeInc/TwoKCharge/Model/System/Config/Source/Payment/Twokchargetype.php +45 -0
  17. app/code/community/TwoKChargeInc/TwoKCharge/Model/System/Config/Source/Testmode.php +39 -0
  18. app/code/community/TwoKChargeInc/TwoKCharge/controllers/IndexController.php +91 -0
  19. app/code/community/TwoKChargeInc/TwoKCharge/controllers/PaymentController.php +39 -0
  20. app/code/community/TwoKChargeInc/TwoKCharge/etc/config.xml +146 -0
  21. app/code/community/TwoKChargeInc/TwoKCharge/etc/system.xml +297 -0
  22. app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-install-0.1.0.php +82 -0
  23. app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-0.1.0-0.1.4.php +48 -0
  24. app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-0.1.4-0.2.0.php +76 -0
  25. app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-0.2.0-0.2.2.php +114 -0
  26. app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-0.2.2-0.2.3.php +76 -0
  27. app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-0.2.3-1.0.0.php +38 -0
  28. app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-1.0.0-1.0.1.php +77 -0
  29. app/design/frontend/base/default/layout/twokcharge.xml +42 -0
  30. app/design/frontend/base/default/template/twokcharge/failure.phtml +40 -0
  31. app/design/frontend/base/default/template/twokcharge/form.phtml +153 -0
  32. app/design/frontend/base/default/template/twokcharge/form/ach.phtml +186 -0
  33. app/design/frontend/base/default/template/twokcharge/form/barpay.phtml +28 -0
  34. app/design/frontend/base/default/template/twokcharge/form/brazilpay.phtml +54 -0
  35. app/design/frontend/base/default/template/twokcharge/form/chinadebit.phtml +28 -0
  36. app/design/frontend/base/default/template/twokcharge/form/creditcard.phtml +130 -0
  37. app/design/frontend/base/default/template/twokcharge/form/directpay.phtml +30 -0
  38. app/design/frontend/base/default/template/twokcharge/form/directpaymax.phtml +75 -0
  39. app/design/frontend/base/default/template/twokcharge/form/eps.phtml +28 -0
  40. app/design/frontend/base/default/template/twokcharge/form/eurodebit.phtml +67 -0
  41. app/design/frontend/base/default/template/twokcharge/form/giropay.phtml +60 -0
  42. app/design/frontend/base/default/template/twokcharge/form/ideal.phtml +55 -0
  43. app/design/frontend/base/default/template/twokcharge/form/paysafe.phtml +28 -0
  44. app/design/frontend/base/default/template/twokcharge/form/poli.phtml +28 -0
  45. app/design/frontend/base/default/template/twokcharge/form/przelewy.phtml +28 -0
  46. app/design/frontend/base/default/template/twokcharge/form/qiwi.phtml +28 -0
  47. app/design/frontend/base/default/template/twokcharge/form/sepa.phtml +813 -0
  48. app/design/frontend/base/default/template/twokcharge/form/teleingreso.phtml +27 -0
  49. app/design/frontend/base/default/template/twokcharge/form/telepay.phtml +28 -0
  50. app/design/frontend/base/default/template/twokcharge/form/yellowpay.phtml +30 -0
  51. app/design/frontend/base/default/template/twokcharge/isapprove.phtml +42 -0
  52. app/design/frontend/base/default/template/twokcharge/postback.phtml +130 -0
  53. app/design/frontend/base/default/template/twokcharge/redirect.phtml +132 -0
  54. app/design/frontend/base/default/template/twokcharge/response.phtml +44 -0
  55. app/design/frontend/base/default/template/twokcharge/success.phtml +36 -0
  56. app/etc/modules/TwoKChargeInc_TwoKCharge.xml +9 -0
  57. app/locale/en_US/TwoKChargeInc_TwoKCharge.csv +76 -0
  58. package.xml +35 -0
  59. skin/frontend/base/default/twokcharge/css/styles.css +58 -0
  60. skin/frontend/base/default/twokcharge/images/cvv22.gif +0 -0
  61. skin/frontend/base/default/twokcharge/images/information.png +0 -0
  62. skin/frontend/base/default/twokcharge/images/phoneverf1.jpg +0 -0
  63. skin/frontend/base/default/twokcharge/images/phoneverf2.jpg +0 -0
  64. skin/frontend/base/default/twokcharge/images/phoneverf3.jpg +0 -0
  65. skin/frontend/base/default/twokcharge/images/phoneverf4.jpg +0 -0
  66. skin/frontend/base/default/twokcharge/images/qm.gif +0 -0
app/code/community/TwoKChargeInc/TwoKCharge/Block/Form.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Block_Form extends Mage_Payment_Block_Form
28
+ {
29
+ protected function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->setTemplate('twokcharge/form.phtml');
33
+
34
+ }
35
+ }
app/code/community/TwoKChargeInc/TwoKCharge/Block/PaymentInfo.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Block_PaymentInfo extends Mage_Payment_Block_Info
28
+ {
29
+ // payment info block
30
+ protected function _prepareSpecificInformation($transport = null)
31
+ {
32
+ if (null !== $this->_paymentSpecificInformation) {
33
+ return $this->_paymentSpecificInformation;
34
+ }
35
+ $info = $this->getInfo();
36
+ $transport = new Varien_Object();
37
+ $transport = parent::_prepareSpecificInformation($transport);
38
+ $transport->addData(array(
39
+ Mage::helper('payment')->__('Payment Method') => $info->getTwokchargeTypeName()
40
+ ));
41
+ return $transport;
42
+ }
43
+ }
app/code/community/TwoKChargeInc/TwoKCharge/Block/Postback.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Block_Postback extends Mage_Payment_Block_Form
28
+ {
29
+ protected function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->setTemplate('twokcharge/postback.phtml');
33
+ }
34
+ }
app/code/community/TwoKChargeInc/TwoKCharge/Block/Redirect.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Block_Redirect extends Mage_Payment_Block_Form
28
+ {
29
+ protected function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->setTemplate('twokcharge/redirect.phtml');
33
+ }
34
+ }
app/code/community/TwoKChargeInc/TwoKCharge/Helper/Data.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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
+ */
22
+
23
+ /**
24
+ * Web service AlternativePayments helper
25
+ *
26
+ * @category Payment Method
27
+ * @package TwoKChargeInc_TwoKCharge
28
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
29
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
30
+ */
31
+
32
+ class TwoKChargeInc_TwoKCharge_Helper_Data extends Mage_Core_Helper_Abstract
33
+ {
34
+
35
+ }
app/code/community/TwoKChargeInc/TwoKCharge/Model/Dbiban.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_Dbiban extends Mage_Core_Model_Abstract
28
+ {
29
+ public function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->_init('twokcharge/dbiban');
33
+ }
34
+ }
35
+
36
+ ?>
app/code/community/TwoKChargeInc/TwoKCharge/Model/Dbsource.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_Dbsource extends Mage_Core_Model_Abstract
28
+ {
29
+ public function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->_init('twokcharge/dbsource');
33
+ }
34
+ }
35
+
36
+ ?>
app/code/community/TwoKChargeInc/TwoKCharge/Model/Mysql4/Dbiban.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_Mysql4_Dbiban extends Mage_Core_Model_Mysql4_Abstract
28
+ {
29
+ public function _construct()
30
+ {
31
+
32
+ $this->_init('twokcharge/dbiban', 'country_id');
33
+ }
34
+ }
app/code/community/TwoKChargeInc/TwoKCharge/Model/Mysql4/Dbiban/Collection.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_Mysql4_Dbiban_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
28
+ {
29
+ public function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->_init('twokcharge/dbiban');
33
+ }
34
+ }
35
+
36
+ ?>
app/code/community/TwoKChargeInc/TwoKCharge/Model/Mysql4/Dbsource.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Payment Method
23
+ * @package TwoKChargeInc_TwoKCharge
24
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ class TwoKChargeInc_TwoKCharge_Model_Mysql4_Dbsource extends Mage_Core_Model_Mysql4_Abstract
29
+ {
30
+ public function _construct()
31
+ {
32
+
33
+ $this->_init('twokcharge/dbsource', 'type_name');
34
+ }
35
+ }
app/code/community/TwoKChargeInc/TwoKCharge/Model/Mysql4/Dbsource/Collection.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_Mysql4_Dbsource_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
28
+ {
29
+ public function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->_init('twokcharge/dbsource');
33
+ }
34
+ }
35
+
36
+ ?>
app/code/community/TwoKChargeInc/TwoKCharge/Model/Resource/Setup.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup {
28
+
29
+ }
30
+
31
+ ?>
app/code/community/TwoKChargeInc/TwoKCharge/Model/Session.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_Session extends Mage_Core_Model_Session_Abstract
28
+ {
29
+ public function __construct() {
30
+ $this->init('twokcharge');
31
+ }
32
+ }
33
+ ?>
app/code/community/TwoKChargeInc/TwoKCharge/Model/Standard.php ADDED
@@ -0,0 +1,712 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_Standard extends Mage_Payment_Model_Method_Abstract {
28
+
29
+ protected $_isInitializeNeeded = true;
30
+ protected $_canUseInternal = true;
31
+ protected $_canUseForMultishipping = false;
32
+
33
+ protected $_code = 'twokcharge';
34
+ protected $_formBlockType = 'twokcharge/form';
35
+ protected $_infoBlockType = 'twokcharge/paymentInfo';
36
+
37
+ protected $_redirectBlockType = 'twokcharge/redirect';
38
+ protected $_responseBlockType = 'twokcharge/response';
39
+
40
+ const RESPONSE_CODE_APPROVED = 'Y';
41
+ const RESPONSE_CODE_DECLINED = 'N';
42
+ const RESPONSE_CODE_ERROR = 'X';
43
+ const RESPONSE_CODE_PENDING = 'P';
44
+
45
+ /**
46
+ * validation for ACH fields
47
+ *
48
+ * @param String $data
49
+ * @param Magento Object $order
50
+ * @return String error message or -1 if all good
51
+ */
52
+ public function achValidation($data, $order){
53
+
54
+ $order->setAchAccounttype($data->getTwokchargeAchAccounttype());
55
+ $order->setAchAccountnumber($data->getTwokchargeAchAccountnumber());
56
+ $order->setAchRoutingnumber($data->getTwokchargeAchRoutingnumber());
57
+ $order->setAchChecknumber($data->getTwokchargeAchChecknumber());
58
+ $order->setAchPhoneVerfNum($data->getTwokchargeAchPhoneVerfNum());
59
+ $order->setAchSsn($data->getTwokchargeAchSsn());
60
+ return -1;
61
+ }
62
+ /**
63
+ * validation for CreditCard fields - not active
64
+ *
65
+ * @param String $data
66
+ * @param Magento Object $order
67
+ * @return String error message or -1 if all good
68
+ */
69
+ public function creditcardValidation($data, $order) {
70
+
71
+ if (strlen($data->getTwokchargeCreditcardCvv()) != 4 && $data->getTwokchargeCreditcardType() == 'American Express' ) {
72
+ $errorMsg = __('Please enter the 4 digits of your Card Verification Number (CVV2)');
73
+ return $errorMsg;
74
+ }
75
+ if (strlen($data->getTwokchargeCreditcardCvv()) != 3 && $data->getTwokchargeCreditcardType() != 'American Express' ) {
76
+ $errorMsg = __('Please enter the 3 digits of your Card Verification Number (CVV2)');
77
+ return $errorMsg;
78
+ }
79
+
80
+ $order->setCreditcardType($data->getTwokchargeCreditcardType());
81
+ $order->setCreditcardNumber($data->getTwokchargeCreditcardNumber());
82
+ $order->setCreditcardExpMonth($data->getTwokchargeCreditcardExpMonth());
83
+ $order->setCreditcardExpYear($data->getTwokchargeCreditcardExpYear());
84
+ $order->setCreditcardCvv($data->getTwokchargeCreditcardCvv());
85
+ return -1;
86
+ }
87
+
88
+ /**
89
+ * validation for ideal fields
90
+ *
91
+ * @param String $data
92
+ * @param Magento Object $order
93
+ * @return String error message or -1 if all good
94
+ */
95
+ public function idealValidation($data, $order){
96
+
97
+ $order->setIdealBankcode($data->getTwokchargeIdealBankcode());
98
+ return -1;
99
+ }
100
+
101
+ /**
102
+ * validation for sepa fields
103
+ *
104
+ * @param String $data
105
+ * @param Magento Object $order
106
+ * @return String error message or -1 if all good
107
+ */
108
+ public function sepaValidation($data, $order){
109
+
110
+ if ($data->getSepaIbanHidden() != 'OK' ) {
111
+
112
+ $errorMsg = $data->getTwokchargeSepaIbanHidden();
113
+ return $errorMsg;
114
+ }
115
+
116
+ $order->setSepaSignum($data->getTwokchargeSepaSignum());
117
+ $order->setSepaIban($data->getTwokchargeSepaIban());
118
+ $order->setSepaBic($data->getTwokchargeSepaBic());
119
+
120
+ $order->setSepaIbanHidden($data->getTwokchargeSepaIbanHidden());
121
+
122
+ return -1;
123
+ }
124
+
125
+ /**
126
+ * validation for brazilpay fields - not active
127
+ *
128
+ * @param String $data
129
+ * @param Magento Object $order
130
+ * @return String error message or -1 if all good
131
+ */
132
+
133
+ public function brazilpayValidation($data, $order){
134
+
135
+ $order->setBrazilpayBankcode($data->getTwokchargeBrazilpayBankcode());
136
+ return -1;
137
+ }
138
+ /**
139
+ * validation for directpaymax fields
140
+ *
141
+ * @param String $data
142
+ * @param Magento Object $order
143
+ * @return String error message or -1 if all good
144
+ */
145
+ public function directpaymaxValidation($data, $order) {
146
+
147
+ $order->setDirectpaymaxBankcode($data->getTwokchargeDirectpaymaxBankcode());
148
+ return -1;
149
+ }
150
+ /**
151
+ * validation for eurodebit fields
152
+ *
153
+ * @param String $data
154
+ * @param Magento Object $order
155
+ * @return String error message or -1 if all good
156
+ */
157
+ public function eurodebitValidation($data, $order) {
158
+
159
+ $order->setEurodebitAccountnumber($data->getTwokchargeEurodebitAccountnumber());
160
+ $order->setEurodebitRoutingnumber($data->getTwokchargeEurodebitRoutingnumber());
161
+ return -1;
162
+ }
163
+ /**
164
+ * validation for giropay fields
165
+ *
166
+ * @param String $data
167
+ * @param Magento Object $order
168
+ * @return String error message or -1 if all good
169
+ */
170
+ public function giropayValidation($data, $order) {
171
+
172
+ $order->setGiropayAccountnumber($data->getTwokchargeGiropayAccountnumber());
173
+ $order->setGiropayRoutingnumber($data->getTwokchargeGiropayRoutingnumber());
174
+ return -1;
175
+ }
176
+ /**
177
+ * Not defined fiels in form - validator
178
+ *
179
+ * @param String $data
180
+ * @param Magento Object $order
181
+ * @return String error message or -1 if all good
182
+ */
183
+ public function emptyValidation($data, $order){
184
+
185
+ return -1;
186
+ }
187
+
188
+ /**
189
+ * start validate function - integrate in Magento
190
+ *
191
+ * @param Varien_Object $data
192
+ * @return
193
+ */
194
+ public function assignData($data)
195
+ {
196
+ if (!($data instanceof Varien_Object)) {
197
+ $data = new Varien_Object($data);
198
+ }
199
+
200
+ $order = Mage::getSingleton('checkout/session')->getQuote();
201
+ $collection = Mage::getModel('twokcharge/dbsource')->getCollection()->addFieldToFilter('type_name', $data->getTwokchargeTypeName());
202
+ $extrabrand = $collection->getFirstItem()->getData();
203
+ $paymentLabel = $extrabrand['type_label'];
204
+ $paymentValidation = $extrabrand['validation'];
205
+
206
+ $paymentTypeName = $extrabrand['type_name'];
207
+ $pp = "pp_".strtolower($paymentTypeName);
208
+ $order->setPricePoint($this->getConfigData("$pp"));
209
+ $order->setMode(($this->getConfigData('payment_mode') == 'TEST') ? 'TESTAPPROVE' : 'PRODUCTION');
210
+ $order->setUrlcode($this->getConfigData('urlcode'));
211
+
212
+ // this code necessary for info in payment page (PaymentInfo.php)
213
+ $info = $this->getInfoInstance();
214
+ $info->setTwokchargeTypeName($paymentLabel);
215
+
216
+ if ($data->getTwokchargeTypeName() != '') {
217
+ $order->setTwokchargeTypeName($data->getTwokchargeTypeName());
218
+
219
+ $errorMsg = $this->$paymentValidation($data, $order);
220
+
221
+ if ($errorMsg != -1) {
222
+ Mage::throwException($errorMsg);
223
+ }
224
+ } else {
225
+ Mage::throwException(Mage::helper('paygate')->__('Please chose BankType '));
226
+ }
227
+
228
+ return $this;
229
+ }
230
+
231
+ /**
232
+ * methode for prepere and send infroramtion on service, checking and info client if all ok before place order
233
+ * only for "EPS", "IDEAL", "GIROPAY", "PAYSAFE", "POLI", "PRZELEWY", "QIWI",
234
+ * "TELEINGRESO", "YELLOWPAY", "DIRECTPAY", "DIRECTPAYMAX", "TELEPAY" - special request
235
+ *
236
+ * @param Varien_Object $data
237
+ * @return
238
+ */
239
+ public function prepare_payment_send(Varien_Object $observer) {
240
+
241
+ $order = Mage::getSingleton('checkout/session')->getQuote();
242
+ $payment = $order -> getPayment();
243
+ $incrementId = $order -> getEntityId();
244
+
245
+ // filter for payment gateway
246
+ if (in_array($order->getTwokchargeTypeName(), array("YELLOWPAY", "EPS", "IDEAL", "GIROPAY", "PAYSAFE",
247
+ "POLI", "PRZELEWY", "QIWI", "TELEINGRESO"
248
+ , "DIRECTPAY", "DIRECTPAYMAX", "TELEPAY"
249
+ ))) {
250
+ $amount = $order -> getGrandTotal();
251
+
252
+ //build request list
253
+ $cartValues = $this -> _buildRequest($order, $amount);
254
+ // post request
255
+ list($content, $response) = $this -> _postRequest($order, $cartValues);
256
+ // formated postBack result
257
+ list($isPaymentAccepted, $message) = $this->_formatPostResult($content);
258
+ // if result have error
259
+ if ($isPaymentAccepted == 'X') {
260
+
261
+ Mage::getSingleton('checkout/session')->setResponseFlagTransaction($isPaymentAccepted);
262
+ Mage::throwException(Mage::helper('paygate')->__($message));
263
+
264
+ } else {
265
+ Mage::getSingleton('checkout/session')->setResponseFlagTransaction($isPaymentAccepted);
266
+ Mage::getSingleton('checkout/session')->setResponseTestField($content);
267
+
268
+ }
269
+
270
+ return -1;
271
+ }
272
+
273
+ }
274
+
275
+ /**
276
+ * method for redirection page - integrate in magento
277
+ *
278
+ * @return automatic redirect to return url
279
+ */
280
+ public function getOrderPlaceRedirectUrl()
281
+ {
282
+
283
+ $order = Mage::getSingleton('checkout/session')->getQuote();
284
+
285
+ $payment = $order -> getPayment();
286
+ $incrementId = $order -> getEntityId();
287
+
288
+ // $order->setPricePoint($this->getConfigData('pricepoint'));
289
+
290
+
291
+ // ---- direct pay gateway method - START !!!!!! -------
292
+ if (in_array($order->getTwokchargeTypeName(), array("SEPA", "EuroDebit", "ACH", "CreditCard", "BARPAY"))) {
293
+
294
+ // Mage::log(var_export($order->debug(), TRUE), null,'$cart3.log');
295
+
296
+
297
+ $check = $this -> _getOrderDirectPay($order);
298
+ if ($check == 'N' || $check == 'X') {
299
+
300
+ return Mage::getUrl('checkout/onepage/failure', array('_secure' => true));
301
+ }
302
+
303
+ // ---- direct pay gateway method - END !!!!!! -----------------------------
304
+ // ---- redirect pay gateway method - START !!!!!! -------------------------
305
+ /* } elseif (in_array($order->getTwokchargeTypeName(), array("DIRECTPAY", "CHINADEBIT",
306
+ "BrazilPay", "DIRECTPAYMAX", "TELEPAY" ))) {
307
+
308
+ // Mage::log(var_export($order->debug(), TRUE), null,'$cart3.log');
309
+
310
+ $amount = $order -> getGrandTotal();
311
+ $cartValues = $this -> _buildRequest($order, $amount);
312
+
313
+ list($content, $response) = $this -> _postRequest($order, $cartValues);
314
+ list($isPaymentAccepted, $message) = $this->_formatPostResult($content);
315
+
316
+ $responseURL = $response['url'];
317
+
318
+ // ---- redirect pay gateway method - DIRECTPAY and DIRECTPAYMAX only !!!!!! (specific) --------
319
+ if (in_array($order->getTwokchargeTypeName(), array("DIRECTPAY", "DIRECTPAYMAX", "TELEPAY"))) {
320
+
321
+ if ($isPaymentAccepted == self::RESPONSE_CODE_DECLINED || $isPaymentAccepted == self::RESPONSE_CODE_ERROR) {
322
+
323
+ $order->setStatus(self::STATUS_ERROR);
324
+ $order->save();
325
+ $orderId = $order-> getReservedOrderId();
326
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
327
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true);
328
+ $orderOBJ->save();
329
+ Mage::throwException(Mage::helper('paygate')->__('Unexpected error: '. $message));
330
+ } else {
331
+
332
+ Mage::getSingleton('twokcharge/session')->setPostBack(serialize($content));
333
+ Mage::getSingleton('twokcharge/session')->setBackFlag(serialize('TRUE'));
334
+
335
+ return Mage::getUrl('twokcharge/', array('_secure' => true));
336
+
337
+ }
338
+ } else {
339
+
340
+ return $responseURL;
341
+
342
+ }
343
+ */
344
+ // filter for specific payment gateway
345
+ } elseif (in_array($order->getTwokchargeTypeName(), array("YELLOWPAY", "EPS", "IDEAL", "GIROPAY", "PAYSAFE",
346
+ "POLI", "PRZELEWY", "QIWI", "TELEINGRESO"
347
+ , "DIRECTPAY", "DIRECTPAYMAX", "TELEPAY"
348
+ ))) {
349
+
350
+ $responseURL = Mage::getSingleton('checkout/session')->getResponseTestField();
351
+
352
+ return $responseURL;
353
+
354
+ } else {
355
+
356
+ $order->setStatus(self::STATUS_ERROR);
357
+ $order->save();
358
+ $orderId = $order-> getReservedOrderId();
359
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
360
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Unexpected error' );
361
+ $orderOBJ->save();
362
+ Mage::throwException(Mage::helper('paygate')->__('Unexpected error'));
363
+ }
364
+
365
+ // return Mage::getUrl(Mage::getSingleton('checkout/session')->getTestField(), array('_secure' => true));
366
+
367
+ }
368
+
369
+ /**
370
+ * methode for prepere and send infroramtion on service, checking and info client
371
+ *
372
+ * @param Varien_Object $cart
373
+ * @return automatic redirect to return url
374
+ */
375
+ protected function _getOrderDirectPay(Varien_Object $cart)
376
+ {
377
+
378
+ $amount = $cart -> getGrandTotal();
379
+ if ($amount <= 0) {
380
+ Mage::throwException(Mage::helper('paygate')->__('Invalid amount for authorization.'));
381
+ }
382
+
383
+ $cartValues = $this->_buildRequest($cart, $amount);
384
+ list($content, $response) = $this->_postRequest($cart, $cartValues);
385
+ list($isPaymentAccepted, $message) = $this->_formatPostResult($content);
386
+
387
+ $this->_getStatusMessage($cart, $isPaymentAccepted, $message);
388
+
389
+ return $isPaymentAccepted;
390
+ }
391
+
392
+ /**
393
+ * methode for save place order result in database
394
+ *
395
+ * @param Varien_Object $cart
396
+ * @param var $isPaymentAccepted
397
+ * @param String $message
398
+ * @return void
399
+ */
400
+ protected function _getStatusMessage($cart, $isPaymentAccepted, $message)
401
+ {
402
+
403
+ switch ($isPaymentAccepted) {
404
+ case self::RESPONSE_CODE_APPROVED:
405
+ $cart->setStatus(self::STATUS_APPROVED);
406
+ $cart->save();
407
+ $orderId = $cart-> getReservedOrderId();
408
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
409
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_PROCESSING, "Order has been successfully paid");
410
+ $orderOBJ->setStatus('processing_paid');
411
+ $orderOBJ->save();
412
+ break;
413
+
414
+ case self::RESPONSE_CODE_PENDING:
415
+ $cart->setStatus(self::STATUS_APPROVED);
416
+ $cart->save();
417
+ $orderId = $cart-> getReservedOrderId();
418
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
419
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_NEW, true, "Order is pending");
420
+ $orderOBJ->setStatus('pending');
421
+ $orderOBJ->save();
422
+ break;
423
+
424
+ case self::RESPONSE_CODE_DECLINED:
425
+ $cart->setStatus(self::STATUS_DECLINED);
426
+ $cart->save();
427
+ $orderId = $cart-> getReservedOrderId();
428
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
429
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Order has been canceled by payment service");
430
+ $orderOBJ->setStatus('canceled');
431
+ $orderOBJ->save();
432
+ break;
433
+
434
+ case self::RESPONSE_CODE_ERROR:
435
+ $cart->setStatus(self::STATUS_ERROR);
436
+ $cart->save();
437
+ $orderId = $cart-> getReservedOrderId();
438
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
439
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Unexpected error - $message");
440
+ $orderOBJ->setStatus('canceled');
441
+ $orderOBJ->save();
442
+ break;
443
+
444
+ default:
445
+ $cart->setStatus(self::STATUS_ERROR);
446
+ $cart->save();
447
+ $orderId = $cart-> getReservedOrderId();
448
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
449
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Unexpected error - $message !" );
450
+ $orderOBJ->save();
451
+ Mage::throwException(Mage::helper('paygate')->__('Unexpected error'));
452
+ }
453
+
454
+ }
455
+
456
+
457
+ /**
458
+ * methode for arrange postResult
459
+ *
460
+ * @param String $result_dirty
461
+ * @return Array
462
+ */
463
+ protected function _formatPostResult($result_dirty)
464
+ {
465
+ $match = explode("|",$result_dirty, 2);
466
+ $flag_r = substr($match[0], 0, 1);
467
+
468
+ return array($flag_r, $match[1]);
469
+ }
470
+
471
+ /**
472
+ * methode for building request for service
473
+ *
474
+ * @param Varien_Object $cart
475
+ * @return Array - list for post
476
+ */
477
+ protected function _buildRequest(Varien_Object $cart)
478
+ {
479
+ if (!empty($cart)) {
480
+ $billing = $cart->getBillingAddress();
481
+ if (!empty($billing)) {
482
+ if (!$billing->getRegion())
483
+ $billing->setRegion('NA');
484
+
485
+ $fields = array(
486
+ "amount" => $cart->getGrandTotal(), // charge amount in specified currency
487
+ "paydesc" => "", // (optional) Description of purchase
488
+ "firstName" => $billing->getFirstname(),
489
+ "lastName" => $billing->getLastname(),
490
+ "address" => $billing->getStreet(1)." ".$billing->getStreet(2),
491
+ "city" => $billing->getCity(),
492
+ "state" => $billing->getRegion(),
493
+ "zip" => $billing->getPostcode(),
494
+ "email" => $cart->getCustomerEmail(),
495
+ //"STATUS_URL" => "mailto:" . $config["Company"]["orders_department"], /company mail/
496
+ "Fax" => $billing->getFax(),
497
+ "Phone" => $billing->getTelephone(), //required - optional for some bank (this is not global filed!!)
498
+ "IP" => $cart->getRemoteIp(),
499
+ "username" => "notused",
500
+ "userpassword" => "notused",
501
+ // "memberLen" => 30, // (optional)
502
+ "xfield" => $cart-> getReservedOrderId(), //Order Protect Code
503
+
504
+ "currencyid" => $cart->getQuoteCurrencyCode(), //order_currency_code ORDER -- 'global_currency_code' => 'EUR', 'base_currency_code' => 'EUR', 'store_currency_code' => 'EUR', 'order_currency_code' => 'EUR',
505
+ "country" => $billing->getCountry(),
506
+ "processmode" => $cart->getMode(), // TESTAPPROVE, TESTDECLINE , PRODUCTION
507
+ );
508
+
509
+ if ($cart->getTwokchargeTypeName() == 'EuroDebit') {
510
+
511
+ $fields_tmp = array(
512
+
513
+ "pricepoint" => $cart->getPricePoint(),
514
+ "paymenttype" => $cart->getTwokchargeTypeName(),
515
+ "accountnumber" => $cart->getEurodebitAccountnumber(),
516
+ "routingnumber" => $cart->getEurodebitRoutingnumber(),
517
+ );
518
+
519
+ } elseif ($cart->getTwokchargeTypeName() == 'GIROPAY') {
520
+
521
+ $fields_tmp = array(
522
+
523
+ "authredirectmode" => 'H',
524
+ "pricepoint" => $cart->getPricePoint(),
525
+ "paymenttype" => $cart->getTwokchargeTypeName(),
526
+ "accountnumber" => $cart->getGiropayAccountnumber(),
527
+ "routingnumber" => $cart->getGiropayRoutingnumber(),
528
+ "resultredirecturl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
529
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
530
+ );
531
+
532
+ } elseif ($cart->getTwokchargeTypeName() == 'SEPA') {
533
+
534
+ $fields_tmp = array(
535
+
536
+ "pricepoint" => $cart->getPricePoint(),
537
+ "paymenttype" => $cart->getTwokchargeTypeName(),
538
+ "signum" => $cart->getSepaSignum(),
539
+ "iban" => $cart->getSepaIban(),
540
+ "bic" => $cart->getSepaBic(),
541
+ );
542
+
543
+ } elseif ($cart->getTwokchargeTypeName() == 'CreditCard') {
544
+
545
+ $fields_tmp = array(
546
+
547
+ "pricepoint" => $cart->getPricePoint(),
548
+ "paymenttype" => $cart->getTwokchargeTypeName(),
549
+ "cctype" => $cart->getCreditcardType(),
550
+ "ccnum" => $cart->getCreditcardNumber(),
551
+ "cvv2" => $cart->getCreditcardCvv(),
552
+ "ccexpiremonth" => $cart->getCreditcardExpMonth(),
553
+ "ccexpireyear" => $cart->getCreditcardExpYear(),
554
+ );
555
+
556
+ } elseif (in_array($cart->getTwokchargeTypeName(), array("QIWI", "POLI", "PAYSAFE", "TELEINGRESO",
557
+ "PRZELEWY", "EPS", "YELLOWPAY", "CHINADEBIT"))) {
558
+
559
+ $fields_tmp = array(
560
+
561
+ "authredirectmode" => 'H',
562
+ "pricepoint" => $cart->getPricePoint(),
563
+ "paymenttype" => $cart->getTwokchargeTypeName(),
564
+ "resultredirecturl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
565
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
566
+
567
+
568
+ );
569
+
570
+ } elseif ($cart->getTwokchargeTypeName() == 'IDEAL') {
571
+
572
+ $fields_tmp = array(
573
+
574
+ "authredirectmode" => 'H',
575
+ "pricepoint" => $cart->getPricePoint(),
576
+ "paymenttype" => $cart->getTwokchargeTypeName(),
577
+ "bankcode" => $cart->getIdealBankcode(),
578
+ "resultredirecturl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
579
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
580
+ );
581
+
582
+ } elseif (in_array($cart->getTwokchargeTypeName(), array( "BARPAY"))) {
583
+
584
+ $fields_tmp = array(
585
+
586
+ "pricepoint" => $cart->getPricePoint(),
587
+ "paymenttype" => $cart->getTwokchargeTypeName(),
588
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
589
+ );
590
+
591
+ } elseif (in_array($cart->getTwokchargeTypeName(), array("DIRECTPAY", "TELEPAY"))) {
592
+
593
+ $fields_tmp = array(
594
+
595
+ "authredirectmode" => 'H',
596
+ "pricepoint" => $cart->getPricePoint(),
597
+ "paymenttype" => $cart->getTwokchargeTypeName(),
598
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
599
+ );
600
+
601
+ } elseif ($cart->getTwokchargeTypeName() == 'DIRECTPAYMAX') {
602
+
603
+ $fields_tmp = array(
604
+
605
+ "authredirectmode" => 'H',
606
+ "pricepoint" => $cart->getPricePoint(),
607
+ "paymenttype" => $cart->getTwokchargeTypeName(),
608
+ "bankCode" => $cart->getDirectpaymaxBankcode(),
609
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
610
+ );
611
+
612
+ } elseif ($cart->getTwokchargeTypeName() == 'BrazilPay') {
613
+
614
+ $fields_tmp = array(
615
+
616
+ "pricepoint" => $cart->getPricePoint(),
617
+ "paymenttype" => $cart->getTwokchargeTypeName(),
618
+ "gatewayid" => 2,
619
+ "deposittype" => 2, // required if gatewayid is 1
620
+ "resultredirecturl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
621
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."twokcharge/payment/redirect/",
622
+ "bankcode" => $cart->getBrazilpayBankcode(), // required if gatewayid is 1
623
+ "cpf" => "123456789", // required if gatewayid is 1
624
+ );
625
+
626
+ } elseif ($cart->getTwokchargeTypeName() == 'ACH') {
627
+
628
+ $fields_tmp = array(
629
+
630
+ "pricepoint" => $cart->getPricePoint(),
631
+ "paymenttype" => $cart->getTwokchargeTypeName(),
632
+ "accounttype" => $cart->getAchAccounttype(),
633
+ "accountnumber" => $cart->getAchAccountnumber(),
634
+ "routingnumber" => $cart->getAchRoutingnumber(),
635
+ "checknumber" => $cart->getAchChecknumber(),
636
+ "phoneverfnum" => $cart->getAchPhoneVerfNum(),
637
+
638
+ "ssn" => $cart->getAchSsn(),
639
+ );
640
+ }
641
+
642
+ $fields = $fields + $fields_tmp;
643
+ // file_put_contents(Mage::getBaseDir('base')."/var/log/fields$$$.txt", print_r($fields, true), FILE_APPEND);
644
+ return $fields;
645
+ }
646
+ }
647
+
648
+ return $cartValues;
649
+ }
650
+
651
+ /**
652
+ * post request methode
653
+ *
654
+ * @param Varien_Object $cart
655
+ * @param Array $cartValues - list for post
656
+ * @return Array
657
+ */
658
+ protected function _postRequest(Varien_Object $cart, $cartValues)
659
+ {
660
+ try {
661
+ $postData = http_build_query($cartValues);
662
+
663
+
664
+ // file_put_contents(Mage::getBaseDir('base')."/var/log/cartValues$$$.txt", print_r($cartValues, true), FILE_APPEND);
665
+
666
+ $urlToPost = $cart->getUrlcode();
667
+ // Create a curl request and send the values
668
+ $ch = curl_init();
669
+ curl_setopt($ch, CURLOPT_URL, $urlToPost);
670
+ curl_setopt($ch, CURLOPT_TIMEOUT, 180);
671
+ curl_setopt($ch, CURLOPT_HEADER, false);
672
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
673
+ curl_setopt($ch, CURLOPT_POST, true);
674
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); //Put the created string here in use
675
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
676
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
677
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
678
+ curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
679
+
680
+ $content = curl_exec($ch); //The string returned
681
+ // file_put_contents(Mage::getBaseDir('base')."/var/log/content$$$.txt", $content, FILE_APPEND);
682
+ $response = curl_getinfo($ch);
683
+ // file_put_contents(Mage::getBaseDir('base')."/var/log/response$$$.txt", print_r($response, true), FILE_APPEND);
684
+ curl_close ($ch);
685
+
686
+ if ($response['http_code'] == 301 || $response['http_code'] == 302)
687
+ {
688
+ ini_set("user_agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1");
689
+ $headers = get_headers($response['url']);
690
+
691
+ $location = "";
692
+ foreach($headers as $value)
693
+ {
694
+ if (substr(strtolower($value), 0, 9) == "location:")
695
+ return get_final_url(trim(substr($value, 9, strlen($value))));
696
+ }
697
+ }
698
+
699
+ if ($response['http_code'] && substr($response['http_code'], 0, 2) != "20") { //Unsuccessful post request...
700
+ throw new Exception("Returned HTTP CODE: " . $response['http_code'] . " for this URL: " . $urlToPost);
701
+ }
702
+
703
+ } catch (Exception $e) {
704
+
705
+ Mage::throwException($e->getMessage());
706
+ }
707
+
708
+ return array($content, $response);
709
+ }
710
+
711
+ }
712
+
app/code/community/TwoKChargeInc/TwoKCharge/Model/System/Config/Source/Allowtypeall.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_System_Config_Source_Allowtypeall
28
+ {
29
+
30
+ public function toOptionArray()
31
+ {
32
+ return array(
33
+ array('value'=>0, 'label'=>Mage::helper('adminhtml')->__('All Allowed Payment Types')),
34
+ array('value'=>1, 'label'=>Mage::helper('adminhtml')->__('Specific Payment Types')),
35
+ );
36
+ }
37
+
38
+ }
39
+
app/code/community/TwoKChargeInc/TwoKCharge/Model/System/Config/Source/Payment/Twokchargetype.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_System_Config_Source_Payment_TwoKChargeType extends TwoKChargeInc_TwoKCharge_Model_System_Config_Source_Allowtypeall
28
+ {
29
+
30
+
31
+ public function toOptionArray()
32
+ {
33
+ $dbSourceList = Mage::getModel('twokcharge/dbsource')->getCollection()->getData();
34
+ $_paymentTypesName = array();
35
+
36
+ foreach ($dbSourceList as $product=>$key) {
37
+
38
+ array_push($_paymentTypesName, array( 'value' => $key["type_name"], 'label' => $key["type_label"] ));
39
+ }
40
+
41
+ return $_paymentTypesName;
42
+ }
43
+ }
44
+
45
+
app/code/community/TwoKChargeInc/TwoKCharge/Model/System/Config/Source/Testmode.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_Model_System_Config_Source_Testmode
28
+ {
29
+
30
+ public function toOptionArray()
31
+ {
32
+
33
+ return array(
34
+ array('value' => 'TEST', 'label'=>Mage::helper('adminhtml')->__('TEST')),
35
+ array('value' => 'LIVE', 'label'=>Mage::helper('adminhtml')->__('LIVE')),
36
+ );
37
+ }
38
+
39
+ }
app/code/community/TwoKChargeInc/TwoKCharge/controllers/IndexController.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_IndexController extends Mage_Core_Controller_Front_Action {
28
+
29
+ // call response.phtml page
30
+ // need for DirectPay and DirectPayMax
31
+ public function indexAction()
32
+ {
33
+ $this->loadLayout();
34
+ $block = $this->getLayout()->createBlock(
35
+ 'Mage_Core_Block_Template',
36
+ 'twokcharge',
37
+ array('template' => 'twokcharge/response.phtml')
38
+ );
39
+ $this->getLayout()->getBlock('content')->append($block);
40
+ $this->_initLayoutMessages('core/session');
41
+ $this->renderLayout();
42
+ }
43
+
44
+ // call success.phtml page if result of transaction is success
45
+ public function successAction() {
46
+
47
+ $this->loadLayout();
48
+ $block = $this->getLayout()->createBlock(
49
+ 'Mage_Core_Block_Template',
50
+ 'twokcharge',
51
+ array('template' => 'twokcharge/success.phtml')
52
+ );
53
+ $this->getLayout()->getBlock('content')->append($block);
54
+ $this->_initLayoutMessages('core/session');
55
+ $this->renderLayout();
56
+
57
+ }
58
+
59
+ // call failure.phtml page if result of transaction is failure
60
+ public function failureAction() {
61
+
62
+ $this->loadLayout();
63
+ $block = $this->getLayout()->createBlock(
64
+ 'Mage_Core_Block_Template',
65
+ 'twokcharge',
66
+ array('template' => 'twokcharge/failure.phtml')
67
+ );
68
+ $this->getLayout()->getBlock('content')->append($block);
69
+ $this->_initLayoutMessages('core/session');
70
+ $this->renderLayout();
71
+
72
+ }
73
+
74
+ // call isapprove.phtml page if result of transaction is all ready approve
75
+ public function isapproveAction() {
76
+
77
+ $this->loadLayout();
78
+ $block = $this->getLayout()->createBlock(
79
+ 'Mage_Core_Block_Template',
80
+ 'twokcharge',
81
+ array('template' => 'twokcharge/isapprove.phtml')
82
+ );
83
+ $this->getLayout()->getBlock('content')->append($block);
84
+ $this->_initLayoutMessages('core/session');
85
+ $this->renderLayout();
86
+
87
+ }
88
+
89
+
90
+ }
91
+ ?>
app/code/community/TwoKChargeInc/TwoKCharge/controllers/PaymentController.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * 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 Payment Method
22
+ * @package TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class TwoKChargeInc_TwoKCharge_PaymentController extends Mage_Core_Controller_Front_Action {
28
+
29
+ // The redirect action is triggered when someone places an order
30
+ public function redirectAction() {
31
+
32
+ $this->loadLayout();
33
+ $block = $this->getLayout()->createBlock('Mage_Core_Block_Template','twokcharge',array('template' => 'twokcharge/redirect.phtml'));
34
+ $this->getLayout()->getBlock('content')->append($block);
35
+
36
+ $this->renderLayout();
37
+ }
38
+
39
+ }
app/code/community/TwoKChargeInc/TwoKCharge/etc/config.xml ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Payment Method
17
+ * @package TwoKChargeInc_TwoKCharge
18
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <config>
23
+ <modules>
24
+ <TwoKChargeInc_TwoKCharge>
25
+ <version>1.0.1</version>
26
+ </TwoKChargeInc_TwoKCharge>
27
+ </modules>
28
+
29
+ <global>
30
+ <fieldsets>
31
+ <sales_convert_quote_payment>
32
+ <twokcharge_type_name>
33
+ <to_order_payment>*</to_order_payment>
34
+ </twokcharge_type_name>
35
+ </sales_convert_quote_payment>
36
+ </fieldsets>
37
+ <models>
38
+ <twokcharge>
39
+ <class>TwoKChargeInc_TwoKCharge_Model</class>
40
+ <resourceModel>twokcharge_mysql4</resourceModel>
41
+ </twokcharge>
42
+ <twokcharge_mysql4>
43
+ <class>TwoKChargeInc_TwoKCharge_Model_Mysql4</class>
44
+ <entities>
45
+ <dbsource>
46
+ <table>twokcharge_resource</table>
47
+ </dbsource>
48
+ <dbiban>
49
+ <table>twokcharge_iban</table>
50
+ </dbiban>
51
+ </entities>
52
+ </twokcharge_mysql4>
53
+ </models>
54
+ <resources>
55
+ <twokcharge_setup>
56
+ <setup>
57
+ <module>TwoKChargeInc_TwoKCharge</module>
58
+ <class>TwoKChargeInc_TwoKCharge_Model_Resource_Setup</class>
59
+ </setup>
60
+ </twokcharge_setup>
61
+ <twokcharge_write>
62
+ <connection>
63
+ <use>core_write</use>
64
+ </connection>
65
+ </twokcharge_write>
66
+ <twokcharge_read>
67
+ <connection>
68
+ <use>core_read</use>
69
+ </connection>
70
+ </twokcharge_read>
71
+ </resources>
72
+ <helpers>
73
+ <twokcharge>
74
+ <class>TwoKChargeInc_TwoKCharge_Helper</class>
75
+ </twokcharge>
76
+ </helpers>
77
+ <blocks>
78
+ <twokcharge>
79
+ <class>TwoKChargeInc_TwoKCharge_Block</class>
80
+ </twokcharge>
81
+ </blocks>
82
+ </global>
83
+ <default>
84
+ <payment>
85
+ <twokcharge>
86
+ <model>twokcharge/standard</model>
87
+ <active>1</active>
88
+ <order_status>pending</order_status>
89
+ <title>2000Charge</title>
90
+ <payment_action>sale</payment_action>
91
+ <allowspecific>0</allowspecific>
92
+ <sort_order>33</sort_order>
93
+
94
+ </twokcharge>
95
+ </payment>
96
+ </default>
97
+ <frontend>
98
+ <events>
99
+ <sales_model_service_quote_submit_before>
100
+ <observers>
101
+ <twokcharge>
102
+ <type>singleton</type>
103
+ <class>TwoKChargeInc_TwoKCharge_Model_Standard</class>
104
+ <method>prepare_payment_send</method>
105
+ </twokcharge>
106
+ </observers>
107
+ </sales_model_service_quote_submit_before>
108
+ </events>
109
+ <translate>
110
+ <modules>
111
+ <TwoKChargeInc_TwoKCharge>
112
+ <files>
113
+ <default>TwoKChargeInc_TwoKCharge.csv</default>
114
+ </files>
115
+ </TwoKChargeInc_TwoKCharge>
116
+ </modules>
117
+ </translate>
118
+ <routers>
119
+ <twokcharge>
120
+ <use>standard</use>
121
+ <args>
122
+ <module>TwoKChargeInc_TwoKCharge</module>
123
+ <frontName>twokcharge</frontName>
124
+ </args>
125
+ </twokcharge>
126
+ </routers>
127
+ <layout>
128
+ <updates>
129
+ <twokcharge>
130
+ <file>twokcharge.xml</file>
131
+ </twokcharge>
132
+ </updates>
133
+ </layout>
134
+ </frontend>
135
+ <adminhtml>
136
+ <translate>
137
+ <modules>
138
+ <TwoKChargeInc_TwoKCharge>
139
+ <files>
140
+ <default>TwoKChargeInc_TwoKCharge.csv</default>
141
+ </files>
142
+ </TwoKChargeInc_TwoKCharge>
143
+ </modules>
144
+ </translate>
145
+ </adminhtml>
146
+ </config>
app/code/community/TwoKChargeInc/TwoKCharge/etc/system.xml ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Payment Method
17
+ * @package TwoKChargeInc_TwoKCharge
18
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <config>
23
+ <sections>
24
+ <payment>
25
+ <groups>
26
+ <twokcharge translate="label comment" module="paygate">
27
+ <label>2000Charge</label>
28
+ <comment>&lt;strong&gt;Please note&lt;/strong&gt;: If you have not registered yet visit the &lt;a href="http://www.2000charge.com/" target="_blank"&gt;2000Charge&lt;/a&gt; to get your account.</comment>
29
+ <frontend_type>text</frontend_type>
30
+ <sort_order>99</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>0</show_in_store>
34
+ <fields>
35
+ <active translate="label">
36
+ <label>Enabled</label>
37
+ <frontend_type>select</frontend_type>
38
+ <source_model>adminhtml/system_config_source_yesno</source_model>
39
+ <sort_order>1</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>0</show_in_store>
43
+ </active>
44
+ <title translate="label">
45
+ <label>Title</label>
46
+ <frontend_type>text</frontend_type>
47
+ <sort_order>2</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ <show_in_store>1</show_in_store>
51
+ </title>
52
+ <urlcode translate="label">
53
+ <label>URL code</label>
54
+ <comment>URL code given by 2000Charge</comment>
55
+ <frontend_type>text</frontend_type>
56
+ <sort_order>3</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>0</show_in_store>
60
+ </urlcode>
61
+
62
+ <websiteid translate="label">
63
+ <label>Website ID</label>
64
+ <comment>Website ID given by 2000Charge</comment>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>6</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>1</show_in_website>
69
+ <show_in_store>0</show_in_store>
70
+ </websiteid>
71
+ <clientaccount translate="label">
72
+ <label>Client Account</label>
73
+ <comment>Client Account given by 2000Charge</comment>
74
+ <frontend_type>text</frontend_type>
75
+ <sort_order>7</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>0</show_in_store>
79
+ </clientaccount>
80
+ <keyaccount translate="label">
81
+ <label>Account key</label>
82
+ <comment>Account key given by 2000Charge</comment>
83
+ <frontend_type>text</frontend_type>
84
+ <sort_order>8</sort_order>
85
+ <show_in_default>1</show_in_default>
86
+ <show_in_website>1</show_in_website>
87
+ <show_in_store>0</show_in_store>
88
+ </keyaccount>
89
+ <allowtypeall translate="label">
90
+ <label>Use Payment Types</label>
91
+ <frontend_type>select</frontend_type>
92
+ <sort_order>20</sort_order>
93
+ <source_model>twokcharge/system_config_source_allowtypeall</source_model>
94
+ <show_in_default>1</show_in_default>
95
+ <show_in_website>1</show_in_website>
96
+ <show_in_store>0</show_in_store>
97
+ </allowtypeall>
98
+ <allowspecifictype translate="label comment">
99
+ <label>Specific Payment Types</label>
100
+ <comment>Select the payment types your store will support</comment>
101
+ <!-- <tooltip>Field ToolTip</tooltip> -->
102
+ <frontend_type>multiselect</frontend_type>
103
+ <sort_order>21</sort_order>
104
+ <source_model>twokcharge/system_config_source_payment_twokchargetype</source_model>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>0</show_in_store>
108
+ <depends>
109
+ <allowtypeall>1</allowtypeall>
110
+ </depends>
111
+ </allowspecifictype>
112
+
113
+ <pp_ach translate="label">
114
+ <label>Price Point for "ACH"</label>
115
+ <!-- <comment>Mapping code given by Alternative Payments</comment> -->
116
+ <frontend_type>text</frontend_type>
117
+ <sort_order>31</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>1</show_in_website>
120
+ <show_in_store>0</show_in_store>
121
+ </pp_ach>
122
+ <pp_barpay translate="label">
123
+ <label>Price Point for "BARPAY"</label>
124
+ <frontend_type>text</frontend_type>
125
+ <sort_order>32</sort_order>
126
+ <show_in_default>1</show_in_default>
127
+ <show_in_website>1</show_in_website>
128
+ <show_in_store>0</show_in_store>
129
+ </pp_barpay>
130
+ <pp_directpay translate="label">
131
+ <label>Price Point for "Directpay"</label>
132
+ <frontend_type>text</frontend_type>
133
+ <sort_order>33</sort_order>
134
+ <show_in_default>1</show_in_default>
135
+ <show_in_website>1</show_in_website>
136
+ <show_in_store>0</show_in_store>
137
+ </pp_directpay>
138
+ <pp_directpaymax translate="label">
139
+ <label>Price Point for "Pay by bank"</label>
140
+ <frontend_type>text</frontend_type>
141
+ <sort_order>34</sort_order>
142
+ <show_in_default>1</show_in_default>
143
+ <show_in_website>1</show_in_website>
144
+ <show_in_store>0</show_in_store>
145
+ </pp_directpaymax>
146
+ <pp_eps translate="label">
147
+ <label>Price Point for "EPS"</label>
148
+ <frontend_type>text</frontend_type>
149
+ <sort_order>35</sort_order>
150
+ <show_in_default>1</show_in_default>
151
+ <show_in_website>1</show_in_website>
152
+ <show_in_store>0</show_in_store>
153
+ </pp_eps>
154
+ <pp_eurodebit translate="label">
155
+ <label>Price Point for "EuroDebit"</label>
156
+ <frontend_type>text</frontend_type>
157
+ <sort_order>36</sort_order>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>1</show_in_website>
160
+ <show_in_store>0</show_in_store>
161
+ </pp_eurodebit>
162
+ <pp_giropay translate="label">
163
+ <label>Price Point for "GiroPay"</label>
164
+ <frontend_type>text</frontend_type>
165
+ <sort_order>37</sort_order>
166
+ <show_in_default>1</show_in_default>
167
+ <show_in_website>1</show_in_website>
168
+ <show_in_store>0</show_in_store>
169
+ </pp_giropay>
170
+ <pp_ideal translate="label">
171
+ <label>Price Point for "iDEAL"</label>
172
+ <frontend_type>text</frontend_type>
173
+ <sort_order>38</sort_order>
174
+ <show_in_default>1</show_in_default>
175
+ <show_in_website>1</show_in_website>
176
+ <show_in_store>0</show_in_store>
177
+ </pp_ideal>
178
+ <pp_paysafe translate="label">
179
+ <label>Price Point for "Paysafecard"</label>
180
+ <frontend_type>text</frontend_type>
181
+ <sort_order>39</sort_order>
182
+ <show_in_default>1</show_in_default>
183
+ <show_in_website>1</show_in_website>
184
+ <show_in_store>0</show_in_store>
185
+ </pp_paysafe>
186
+ <pp_poli translate="label">
187
+ <label>Price Point for "POLi"</label>
188
+ <frontend_type>text</frontend_type>
189
+ <sort_order>40</sort_order>
190
+ <show_in_default>1</show_in_default>
191
+ <show_in_website>1</show_in_website>
192
+ <show_in_store>0</show_in_store>
193
+ </pp_poli>
194
+ <pp_przelewy translate="label">
195
+ <label>Price Point for "Przelewy24"</label>
196
+ <frontend_type>text</frontend_type>
197
+ <sort_order>41</sort_order>
198
+ <show_in_default>1</show_in_default>
199
+ <show_in_website>1</show_in_website>
200
+ <show_in_store>0</show_in_store>
201
+ </pp_przelewy>
202
+ <pp_qiwi translate="label">
203
+ <label>Price Point for "QIWI"</label>
204
+ <frontend_type>text</frontend_type>
205
+ <sort_order>42</sort_order>
206
+ <show_in_default>1</show_in_default>
207
+ <show_in_website>1</show_in_website>
208
+ <show_in_store>0</show_in_store>
209
+ </pp_qiwi>
210
+ <pp_sepa translate="label">
211
+ <label>Price Point for "EuroDebit SEPA"</label>
212
+ <frontend_type>text</frontend_type>
213
+ <sort_order>43</sort_order>
214
+ <show_in_default>1</show_in_default>
215
+ <show_in_website>1</show_in_website>
216
+ <show_in_store>0</show_in_store>
217
+ </pp_sepa>
218
+ <pp_teleingreso translate="label">
219
+ <label>Price Point for "Teleingreso"</label>
220
+ <frontend_type>text</frontend_type>
221
+ <sort_order>44</sort_order>
222
+ <show_in_default>1</show_in_default>
223
+ <show_in_website>1</show_in_website>
224
+ <show_in_store>0</show_in_store>
225
+ </pp_teleingreso>
226
+ <pp_telepay translate="label">
227
+ <label>Price Point for "TelePay"</label>
228
+ <frontend_type>text</frontend_type>
229
+ <sort_order>45</sort_order>
230
+ <show_in_default>1</show_in_default>
231
+ <show_in_website>1</show_in_website>
232
+ <show_in_store>0</show_in_store>
233
+ </pp_telepay>
234
+ <pp_yellowpay translate="label">
235
+ <label>Price Point for "YellowPay"</label>
236
+ <frontend_type>text</frontend_type>
237
+ <sort_order>46</sort_order>
238
+ <show_in_default>1</show_in_default>
239
+ <show_in_website>1</show_in_website>
240
+ <show_in_store>0</show_in_store>
241
+ </pp_yellowpay>
242
+ <!--
243
+ <order_status translate="label">
244
+ <label>New Order Status</label>
245
+ <frontend_type>select</frontend_type>
246
+ <source_model>adminhtml/system_config_source_order_status</source_model>
247
+ <sort_order>50</sort_order>
248
+ <show_in_default>1</show_in_default>
249
+ <show_in_website>1</show_in_website>
250
+ <show_in_store>0</show_in_store>
251
+ </order_status>
252
+ -->
253
+ <allowspecific translate="label">
254
+ <label>Payment Applicable From</label>
255
+ <frontend_type>select</frontend_type>
256
+ <sort_order>70</sort_order>
257
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
258
+ <show_in_default>1</show_in_default>
259
+ <show_in_website>1</show_in_website>
260
+ <show_in_store>0</show_in_store>
261
+ </allowspecific>
262
+
263
+ <specificcountry translate="label">
264
+ <label>Countries Payment Applicable From</label>
265
+ <frontend_type>multiselect</frontend_type>
266
+ <sort_order>71</sort_order>
267
+ <source_model>adminhtml/system_config_source_country</source_model>
268
+ <show_in_default>1</show_in_default>
269
+ <show_in_website>1</show_in_website>
270
+ <show_in_store>0</show_in_store>
271
+ <depends>
272
+ <allowspecific>1</allowspecific>
273
+ </depends>
274
+ </specificcountry>
275
+ <payment_mode translate="label">
276
+ <label>Test Mode</label>
277
+ <frontend_type>select</frontend_type>
278
+ <source_model>twokcharge/system_config_source_testmode</source_model>
279
+ <sort_order>80</sort_order>
280
+ <show_in_default>1</show_in_default>
281
+ <show_in_website>1</show_in_website>
282
+ <show_in_store>0</show_in_store>
283
+ </payment_mode>
284
+ <sort_order translate="label">
285
+ <label>Sort Order</label>
286
+ <frontend_type>text</frontend_type>
287
+ </sort_order>
288
+ <sort_order>90</sort_order>
289
+ <show_in_default>1</show_in_default>
290
+ <show_in_website>1</show_in_website>
291
+ <show_in_store>0</show_in_store>
292
+ </fields>
293
+ </twokcharge>
294
+ </groups>
295
+ </payment>
296
+ </sections>
297
+ </config>
app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Payment Method
23
+ * @package TwoKChargeInc_TwoKCharge
24
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ echo 'Running Insall script (mysql4-install-0.1.0.php) for module TwoKChargeInc_TwoKCharge <br />';
29
+
30
+ $installer = $this;
31
+
32
+ $installer->startSetup();
33
+
34
+ $conn = $installer->getConnection();
35
+ $prod = 'processing_paid';
36
+
37
+ $select = $conn
38
+ ->select()
39
+ ->from($this->getTable('sales/order_status'))
40
+ ->where('status = ?', $prod );
41
+ $data1 = $conn->fetchAll($select);
42
+
43
+ if ($data1) {
44
+ echo 'In database jet - sales/order_status';
45
+ } else {
46
+ //echo 'Insert in db - sales/order_status';
47
+
48
+ $installer->run("
49
+ INSERT INTO `{$this->getTable('sales/order_status')}` (
50
+ `status`, `label`
51
+ ) VALUES (
52
+ 'processing_paid', 'Processing (Successfully Paid)'
53
+ );
54
+ ");
55
+ }
56
+
57
+ $select = $conn
58
+ ->select()
59
+ ->from($this->getTable('sales/order_status_state'))
60
+ ->where('status = ?', $prod );
61
+ $data2 = $conn->fetchAll($select);
62
+
63
+ if ($data2) {
64
+ echo 'In database jet - sales/order_status_state';
65
+ } else {
66
+ //echo 'Insert in db - sales/order_status_state';
67
+
68
+ $installer->run("
69
+
70
+ INSERT INTO `{$this->getTable('sales/order_status_state')}` (
71
+ `status`, `state`, `is_default`
72
+ ) VALUES (
73
+ 'processing_paid', 'processing', '1'
74
+ );
75
+
76
+ ");
77
+
78
+ }
79
+
80
+ $installer->endSetup();
81
+
82
+ ?>
app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-0.1.0-0.1.4.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Payment Method
23
+ * @package TwoKChargeInc_TwoKCharge
24
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+
29
+ echo 'Running Upgrade script (mysql4-upgrade-0.1.0-0.1.4.php) for TwoKChargeInc_TwoKCharge<br />';
30
+
31
+ $installer = $this;
32
+
33
+ $installer->startSetup();
34
+
35
+
36
+ $installer->run("
37
+
38
+ ALTER TABLE `{$this->getTable('sales/quote_payment')}` ADD `twokcharge_type_name` VARCHAR( 255 );
39
+ ALTER TABLE `{$this->getTable('sales/order_payment')}` ADD `twokcharge_type_name` VARCHAR( 255 );
40
+
41
+ ");
42
+
43
+ /* SHOW COLUMNS FROM `sales_flat_quote_payment` LIKE 'alternativepayments_type_name' */
44
+
45
+ $installer->endSetup();
46
+
47
+
48
+
app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-0.1.4-0.2.0.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Payment Method
23
+ * @package TwoKChargeInc_TwoKCharge
24
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ echo 'Running Upgrade script (mysql4-upgrade-0.1.4-0.2.0.php) for TwoKChargeInc_TwoKCharge<br />';
29
+
30
+ $installer = $this;
31
+
32
+ $installer->startSetup();
33
+
34
+ $table = $this->getTable('twokcharge_resource');
35
+
36
+ $installer->run("
37
+
38
+ DROP TABLE IF EXISTS {$table};
39
+ CREATE TABLE `{$table}`
40
+ (
41
+ type_name VARCHAR(255) NOT NULL UNIQUE,
42
+ type_label VARCHAR(255) NOT NULL,
43
+ allow_country TEXT NOT NULL
44
+ ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
45
+
46
+
47
+ INSERT INTO `{$table}`
48
+ (`type_name`, `type_label`, `allow_country` )
49
+ VALUES
50
+ ( 'ACH', 'ACH - Online Check', 'US|CA' ),
51
+ ( 'BARPAY', 'BARPAY', 'DE' ),
52
+ ( 'EPS', 'EPS', 'AT' ),
53
+ ( 'IDEAL', 'iDEAL', 'NL' ),
54
+ ( 'GIROPAY', 'GiroPay', 'DE' ),
55
+ ( 'YELLOWPAY', 'YellowPay', 'CH' ),
56
+ ( 'EuroDebit', 'EuroDebit', 'DE|AT|NL' ),
57
+ ( 'DIRECTPAYMAX', 'Pay by Bank', 'DE|US' ),
58
+ ( 'DIRECTPAY', 'Directpay', 'AD|AT|BE|CH|CY|CZ|DE|DK|EE|ES|FI|FR|GB|GI|GR|HR|HU|IE|IS|IT|LT|LU|LV|MK|MT|NL|NO|PL|PT|RO|RS|SE|SI|SK|TN|TR|US' ),
59
+ ( 'PAYSAFE', 'Paysafecard', 'AR|AT|BE|CH|CS|CY|CZ|DE|DK|ES|FI|FR|GB|GR|IE|IT|LU|LV|MX|NL|NO|PL|PT|RO|SE|SI|US' ),
60
+ ( 'POLI', 'POLi', 'AU|NZ' ),
61
+ ( 'PRZELEWY', 'Przelewy24', 'PL' ),
62
+ ( 'TELEINGRESO', 'Teleingreso', 'ES' ),
63
+ ( 'SEPA', 'EuroDebit SEPA', 'BE|BG|CH|CY|CZ|DK|ES|FI|FR|GB|GR|HU|IE|IS|IT|LI|LT|LU|LV|MC|MT|NO|PL|PT|RO|SE|SI|SK' ),
64
+ ( 'QIWI', 'QIWI', 'RU' );
65
+
66
+ ");
67
+
68
+ // ( 'CreditCard', 'Credit Card', 'AD|AE|AF|AG|AI|AL|AM|AN|AO|AQ|AR|AS|AT|AU|AW|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BM|BN|BO|BR|BS|BT|BW|BY|BZ|CA|CD|CH|CI|CK|CL|CM|CN|CO|CR|RS|CU|CV|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EE|EG|ES|ET|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GH|GI|GL|GM|GN|GP|GQ|GR|GT|GU|GW|GY|HK|HN|HR|HT|HU|ID|IE|IL|IN|IQ|IR|IS|IT|JM|JO|JP|KE|KG|KH|KI|KM|KN|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MG|ML|MM|MN|MO|MR|MS|MT|MU|MV|MW|MX|MY|MZ|NA|NC|NE|NG|NI|NL|NO|NP|NR|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PR|PT|PY|QA|RO|RU|RW|SA|SB|SC|SE|SG|SH|SI|SK|SL|SM|SN|SO|SR|ST|SV|SY|SZ|TC|TD|TG|TH|TJ|TM|TN|TO|TR|TT|TW|TZ|UA|UG|US|UY|UZ|VA|VC|VE|VG|VN|VU|WF|WS|YE|YT|YU|ZA|ZM|ZR|ZW' ),
69
+ // ( 'BrazilPay', 'BrazilPay', 'BR' ),
70
+ // ( 'CHINADEBIT', 'China Debit', 'CN' ),
71
+ // ( 'FASTERPAY', 'FasterPay', 'GB' ),
72
+
73
+ $installer->endSetup();
74
+
75
+
76
+
app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-0.2.0-0.2.2.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Payment Method
23
+ * @package TwoKChargeInc_TwoKCharge
24
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ echo 'Running Upgrade script (mysql4-upgrade-0.2.0-0.2.2.php) for TwoKChargeInc_TwoKCharge<br />';
29
+
30
+ $installer = $this;
31
+
32
+ $installer->startSetup();
33
+
34
+ $table = $this->getTable('twokcharge_iban');
35
+
36
+
37
+ $installer->run("
38
+
39
+ DROP TABLE IF EXISTS {$table};
40
+ CREATE TABLE `{$table}`
41
+ (
42
+ country VARCHAR(255) NOT NULL,
43
+ country_id VARCHAR(255) NOT NULL UNIQUE,
44
+ bank_code VARCHAR(255) NOT NULL,
45
+ account_number VARCHAR(255) NOT NULL
46
+ ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
47
+
48
+ INSERT INTO `{$table}`
49
+ (`country`, `country_id`, `bank_code`, `account_number` )
50
+ VALUES
51
+ ('Andorra', 'AD', '0 4n 4n', '0 12 0 '),
52
+ ('Albania', 'AL', '0 8n 0 ', '0 16 0 '),
53
+ ('Austria', 'AT', '0 5n 0 ', '0 11n 0 '),
54
+ ('Bosnia and Herzegovina',
55
+ 'BA', '0 3n 3n', '0 8n 2n'),
56
+ ('Belgium', 'BE', '0 3n 0 ', '0 7n 2n'),
57
+ ('Bulgaria', 'BG', '0 4a 4n', '2n 8 0 '),
58
+ ('Switzerland', 'CH', '0 5n 0 ', '0 12 0 '),
59
+ ('Cyprus', 'CY', '0 3n 5n', '0 16 0 '),
60
+ ('Czech Republic', 'CZ', '0 4n 0 ', '0 16n 0 '),
61
+ ('Germany', 'DE', '0 8n 0 ', '0 10n 0 '),
62
+ ('Denmark', 'DK', '0 4n 0 ', '0 9n 1n'),
63
+ ('Estonia', 'EE', '0 2n 0 ', '2n 11n 1n'),
64
+ ('Spain', 'ES', '0 4n 4n', '2n 10n 0 '),
65
+ ('Finland', 'FI', '0 6n 0 ', '0 7n 1n'),
66
+ ('Faroe Islands', 'FO', '0 4n 0 ', '0 9n 1n'),
67
+ ('France', 'FR', '0 5n 5n', '0 11 2n'),
68
+ ('United Kingdom', 'GB', '0 4a 6n', '0 8n 0 '),
69
+ ('Georgia', 'GE', '0 2a 0 ', '0 16n 0 '),
70
+ ('Gibraltar', 'GI', '0 4a 0 ', '0 15 0 '),
71
+ ('Greenland', 'GL', '0 4n 0 ', '0 9n 1n'),
72
+ ('Greece', 'GR', '0 3n 4n', '0 16 0 '),
73
+ ('Croatia', 'HR', '0 7n 0 ', '0 10n 0 '),
74
+ ('Hungary', 'HU', '0 3n 4n', '1n 15n 1n'),
75
+ ('Ireland', 'IE', '0 4a 6n', '0 8n 0 '),
76
+ ('Israel', 'IL', '0 3n 3n', '0 13n 0 '),
77
+ ('Iceland', 'IS', '0 4n 0 ', '2n 16n 0 '),
78
+ ('Italy', 'IT', '1a 5n 5n', '0 12 0 '),
79
+ ('Kuwait', 'KW', '0 4a 0 ', '0 22 0 '),
80
+ ('Kazakhstan', 'KZ', '0 3n 0 ', '0 13 0 '),
81
+ ('Lebanon', 'LB', '0 4n 0 ', '0 20 0 '),
82
+ ('Liechtenstein', 'LI', '0 5n 0 ', '0 12 0 '),
83
+ ('Lithuania', 'LT', '0 5n 0 ', '0 11n 0 '),
84
+ ('Luxembourg', 'LU', '0 3n 0 ', '0 13 0 '),
85
+ ('Latvia', 'LV', '0 4a 0 ', '0 13 0 '),
86
+ ('Monaco', 'MC', '0 5n 5n', '0 11 2n'),
87
+ ('Montenegro', 'ME', '0 3n 0 ', '0 13n 2n'),
88
+ ('Macedonia, Former Yugoslav Republic of',
89
+ 'MK', '0 3n 0 ', '0 10 2n'),
90
+ ('Mauritania', 'MR', '0 5n 5n', '0 11n 2n'),
91
+ ('Malta', 'MT', '0 4a 5n', '0 18 0 '),
92
+ ('Mauritius', 'MU', '0 4a 4n', '0 15n 3a'),
93
+ ('Netherlands', 'NL', '0 4a 0 ', '0 10n 0 '),
94
+ ('Norway', 'NO', '0 4n 0 ', '0 6n 1n'),
95
+ ('Poland', 'PL', '0 8n 0 ', '0 16n 0 '),
96
+ ('Portugal', 'PT', '0 4n 4n', '0 11n 2n'),
97
+ ('Romania', 'RO', '0 4a 0 ', '0 16 0 '),
98
+ ('Serbia', 'RS', '0 3n 0 ', '0 13n 2n'),
99
+ ('Saudi Arabia', 'SA', '0 2n 0 ', '0 18 0 '),
100
+ ('Sweden', 'SE', '0 3n 0 ', '0 16n 1n'),
101
+ ('Slovenia', 'SI', '0 5n 0 ', '0 8n 2n'),
102
+ ('Slovak Republic',
103
+ 'SK', '0 4n 0 ', '0 16n 0 '),
104
+ ('San Marino', 'SM', '1a 5n 5n', '0 12 0 '),
105
+ ('Tunisia', 'TN', '0 2n 3n', '0 13n 2n'),
106
+ ('Turkey', 'TR', '0 5n 0 ', '1 16 0 ')
107
+
108
+ ");
109
+
110
+
111
+ $installer->endSetup();
112
+
113
+
114
+
app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-0.2.2-0.2.3.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Payment Method
23
+ * @package TwoKChargeInc_TwoKCharge
24
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ echo 'Running Upgrade script (mysql4-upgrade-0.2.2-0.2.3.php) for TwoKChargeInc_TwoKCharge<br />';
29
+
30
+ $installer = $this;
31
+
32
+ $installer->startSetup();
33
+
34
+ $table = $this->getTable('twokcharge_resource');
35
+
36
+ $installer->run("
37
+
38
+ DROP TABLE IF EXISTS {$table};
39
+ CREATE TABLE `{$table}`
40
+ (
41
+ type_name VARCHAR(255) NOT NULL UNIQUE,
42
+ type_label VARCHAR(255) NOT NULL,
43
+ allow_country TEXT NOT NULL,
44
+ validation VARCHAR(255) NOT NULL
45
+ ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
46
+
47
+ INSERT INTO `{$table}`
48
+ (`type_name`, `type_label`, `allow_country`, `validation` )
49
+ VALUES
50
+ ( 'ACH', 'ACH - Online Check', 'US|CA', 'achValidation' ),
51
+ ( 'BARPAY', 'BARPAY', 'DE', 'emptyValidation' ),
52
+ ( 'EPS', 'EPS', 'AT', 'emptyValidation' ),
53
+ ( 'IDEAL', 'iDEAL', 'NL', 'idealValidation' ),
54
+ ( 'GIROPAY', 'GiroPay', 'DE', 'giropayValidation' ),
55
+ ( 'YELLOWPAY', 'YellowPay', 'CH', 'emptyValidation' ),
56
+ ( 'EuroDebit', 'EuroDebit', 'DE|AT|NL', 'eurodebitValidation' ),
57
+ ( 'DIRECTPAYMAX', 'Pay by Bank', 'DE|US', 'directpaymaxValidation' ),
58
+ ( 'DIRECTPAY', 'Directpay', 'AD|AT|BE|CH|CY|CZ|DE|DK|EE|ES|FI|FR|GB|GI|GR|HR|HU|IE|IS|IT|LT|LU|LV|MK|MT|NL|NO|PL|PT|RO|RS|SE|SI|SK|TN|TR|US', 'emptyValidation' ),
59
+ ( 'PAYSAFE', 'Paysafecard', 'AR|AT|BE|CH|CS|CY|CZ|DE|DK|ES|FI|FR|GB|GR|IE|IT|LU|LV|MX|NL|NO|PL|PT|RO|SE|SI|US', 'emptyValidation' ),
60
+ ( 'POLI', 'POLi', 'AU|NZ', 'emptyValidation' ),
61
+ ( 'PRZELEWY', 'Przelewy24', 'PL', 'emptyValidation' ),
62
+ ( 'TELEINGRESO', 'Teleingreso', 'ES', 'emptyValidation' ),
63
+ ( 'SEPA', 'EuroDebit SEPA', 'BE|BG|CH|CY|CZ|DK|ES|FI|FR|GB|GR|HU|IE|IS|IT|LI|LT|LU|LV|MC|MT|NO|PL|PT|RO|SE|SI|SK', 'sepaValidation' ),
64
+ ( 'QIWI', 'QIWI', 'RU', 'emptyValidation' );
65
+
66
+ ");
67
+
68
+ // ( 'CreditCard', 'Credit Card', 'AD|AE|AF|AG|AI|AL|AM|AN|AO|AQ|AR|AS|AT|AU|AW|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BM|BN|BO|BR|BS|BT|BW|BY|BZ|CA|CD|CH|CI|CK|CL|CM|CN|CO|CR|RS|CU|CV|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EE|EG|ES|ET|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GH|GI|GL|GM|GN|GP|GQ|GR|GT|GU|GW|GY|HK|HN|HR|HT|HU|ID|IE|IL|IN|IQ|IR|IS|IT|JM|JO|JP|KE|KG|KH|KI|KM|KN|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MG|ML|MM|MN|MO|MR|MS|MT|MU|MV|MW|MX|MY|MZ|NA|NC|NE|NG|NI|NL|NO|NP|NR|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PR|PT|PY|QA|RO|RU|RW|SA|SB|SC|SE|SG|SH|SI|SK|SL|SM|SN|SO|SR|ST|SV|SY|SZ|TC|TD|TG|TH|TJ|TM|TN|TO|TR|TT|TW|TZ|UA|UG|US|UY|UZ|VA|VC|VE|VG|VN|VU|WF|WS|YE|YT|YU|ZA|ZM|ZR|ZW', 'creditcardValidation' ),
69
+ // ( 'BrazilPay', 'BrazilPay', 'BR', 'brazilpayValidation' ),
70
+ // ( 'CHINADEBIT', 'China Debit', 'CN', 'emptyValidation' ),
71
+ // ( 'FASTERPAY', 'FasterPay', 'GB' ),
72
+
73
+ $installer->endSetup();
74
+
75
+
76
+
app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-0.2.3-1.0.0.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Payment Method
23
+ * @package TwoKChargeInc_TwoKCharge
24
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ echo 'Running Upgrade script (mysql4-upgrade-0.2.3-1.0.0.php) for TwoKChargeInc_TwoKCharge<br />';
29
+
30
+ /*
31
+ $installer = $this;
32
+
33
+ $installer->startSetup();
34
+
35
+ $installer->endSetup();
36
+ */
37
+
38
+
app/code/community/TwoKChargeInc/TwoKCharge/sql/twokcharge_setup/mysql4-upgrade-1.0.0-1.0.1.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Payment Method
23
+ * @package TwoKChargeInc_TwoKCharge
24
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ echo 'Running Upgrade script (mysql4-upgrade-1.0.0-1.0.1.php) for TwoKChargeInc_TwoKCharge<br />';
29
+
30
+ $installer = $this;
31
+
32
+ $installer->startSetup();
33
+
34
+ $table = $this->getTable('twokcharge_resource');
35
+
36
+ $installer->run("
37
+
38
+ DROP TABLE IF EXISTS {$table};
39
+ CREATE TABLE `{$table}`
40
+ (
41
+ type_name VARCHAR(255) NOT NULL UNIQUE,
42
+ type_label VARCHAR(255) NOT NULL,
43
+ allow_country TEXT NOT NULL,
44
+ validation VARCHAR(255) NOT NULL
45
+ ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
46
+
47
+ INSERT INTO `{$table}`
48
+ (`type_name`, `type_label`, `allow_country`, `validation` )
49
+ VALUES
50
+ ( 'ACH', 'ACH - Online Check', 'US|CA', 'achValidation' ),
51
+ ( 'BARPAY', 'BARPAY', 'DE', 'emptyValidation' ),
52
+ ( 'EPS', 'EPS', 'AT', 'emptyValidation' ),
53
+ ( 'IDEAL', 'iDEAL', 'NL', 'idealValidation' ),
54
+ ( 'GIROPAY', 'GiroPay', 'DE', 'giropayValidation' ),
55
+ ( 'YELLOWPAY', 'YellowPay', 'CH', 'emptyValidation' ),
56
+ ( 'EuroDebit', 'EuroDebit', 'DE|AT|NL', 'eurodebitValidation' ),
57
+ ( 'DIRECTPAYMAX', 'Pay by Bank', 'DE|US', 'directpaymaxValidation' ),
58
+ ( 'DIRECTPAY', 'Directpay', 'AD|AT|BE|CH|CY|CZ|DE|DK|EE|ES|FI|FR|GB|GI|GR|HR|HU|IE|IS|IT|LT|LU|LV|MK|MT|NL|NO|PL|PT|RO|RS|SE|SI|SK|TN|TR|US', 'emptyValidation' ),
59
+ ( 'PAYSAFE', 'Paysafecard', 'AR|AT|BE|CH|CS|CY|CZ|DE|DK|ES|FI|FR|GB|GR|IE|IT|LU|LV|MX|NL|NO|PL|PT|RO|SE|SI|US', 'emptyValidation' ),
60
+ ( 'POLI', 'POLi', 'AU|NZ', 'emptyValidation' ),
61
+ ( 'PRZELEWY', 'Przelewy24', 'PL', 'emptyValidation' ),
62
+ ( 'TELEINGRESO', 'Teleingreso', 'ES', 'emptyValidation' ),
63
+ ( 'SEPA', 'EuroDebit SEPA', 'BE|BG|CH|CY|CZ|DK|ES|FI|FR|GB|GR|HU|IE|IS|IT|LI|LT|LU|LV|MC|MT|NO|PL|PT|RO|SE|SI|SK', 'sepaValidation' ),
64
+ ( 'TELEPAY', 'TelePay', 'MX', 'emptyValidation' ),
65
+ ( 'QIWI', 'QIWI', 'RU', 'emptyValidation' );
66
+
67
+ ");
68
+
69
+ // ( 'CreditCard', 'Credit Card', 'AD|AE|AF|AG|AI|AL|AM|AN|AO|AQ|AR|AS|AT|AU|AW|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BM|BN|BO|BR|BS|BT|BW|BY|BZ|CA|CD|CH|CI|CK|CL|CM|CN|CO|CR|RS|CU|CV|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EE|EG|ES|ET|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GH|GI|GL|GM|GN|GP|GQ|GR|GT|GU|GW|GY|HK|HN|HR|HT|HU|ID|IE|IL|IN|IQ|IR|IS|IT|JM|JO|JP|KE|KG|KH|KI|KM|KN|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MG|ML|MM|MN|MO|MR|MS|MT|MU|MV|MW|MX|MY|MZ|NA|NC|NE|NG|NI|NL|NO|NP|NR|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PR|PT|PY|QA|RO|RU|RW|SA|SB|SC|SE|SG|SH|SI|SK|SL|SM|SN|SO|SR|ST|SV|SY|SZ|TC|TD|TG|TH|TJ|TM|TN|TO|TR|TT|TW|TZ|UA|UG|US|UY|UZ|VA|VC|VE|VG|VN|VU|WF|WS|YE|YT|YU|ZA|ZM|ZR|ZW', 'creditcardValidation' ),
70
+ // ( 'BrazilPay', 'BrazilPay', 'BR', 'brazilpayValidation' ),
71
+ // ( 'CHINADEBIT', 'China Debit', 'CN', 'emptyValidation' ),
72
+ // ( 'FASTERPAY', 'FasterPay', 'GB' ),
73
+
74
+ $installer->endSetup();
75
+
76
+
77
+
app/design/frontend/base/default/layout/twokcharge.xml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category design
17
+ * @package base_default
18
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ -->
23
+ <layout version="0.1.0">
24
+
25
+ <twokcharge_processing_payment>
26
+ <reference name="head">
27
+ <!--
28
+ <action method="addItem"><type>skin_js</type><name>alternativepayments/jquery-1.8.3.min.js</name></action>
29
+ <action method="addItem"><type>skin_js</type><name>alternativepayments/jquery.easing.1.3.js</name></action>
30
+ -->
31
+ </reference>
32
+ </twokcharge_processing_payment>
33
+
34
+ <default>
35
+ <reference name="head">
36
+ <action method="addItem"><type>skin_css</type><file>twokcharge/css/styles.css</file></action>
37
+ </reference>
38
+ </default>
39
+
40
+ </layout>
41
+
42
+
app/design/frontend/base/default/template/twokcharge/failure.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the 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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ // Retrieve order
29
+
30
+ echo $this->__('Transaction has not been confirmed (FAILURE)');
31
+
32
+ //if(Mage::getSingleton('customer/session')->isLoggedIn()):
33
+ // $name = Mage::getSingleton('customer/session')->getCustomer()->getName();
34
+ // $value2 = unserialize(Mage::getSingleton('twokcharge/session')->getYYY());
35
+
36
+ //endif;
37
+ ?>
38
+
39
+ <?php // echo $value2; ?>
40
+
app/design/frontend/base/default/template/twokcharge/form.phtml ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+
29
+ $_code = $this->getMethodCode();
30
+ $_cart = Mage::getModel('checkout/cart')->getQuote();
31
+
32
+ $countryCode = $_cart->getBillingAddress()->getCountry();
33
+ $checkType = Mage::getStoreConfig('payment/twokcharge/allowtypeall',Mage::app()->getStore());
34
+ $specificType = Mage::getStoreConfig('payment/twokcharge/allowspecifictype',Mage::app()->getStore());
35
+ $specificTypeList = explode(",",$specificType);
36
+
37
+ $dbSourceList = Mage::getModel('twokcharge/dbsource')->getCollection()->getData();
38
+ foreach ($dbSourceList as $product=>$key) {
39
+ foreach ($key as $list=>$value) {
40
+ if ($list == 'allow_country') {
41
+ $value1 = explode("|",$value);
42
+ $dbSourceList[$product][$list] = $value1;
43
+ }
44
+ }
45
+ }
46
+
47
+ if ($checkType == 1) {
48
+ foreach ($dbSourceList as $product=>$key) {
49
+ if (in_array($key["type_name"], $specificTypeList)) {
50
+ $paymentTypes[$key['type_name']] = $key['allow_country'];
51
+ $paymentTypesName[$key['type_name']] = $key['type_label'];
52
+ }
53
+ }
54
+ } elseif ($checkType == 0) {
55
+ foreach ($dbSourceList as $product=>$key) {
56
+ $paymentTypes[$key['type_name']] = $key['allow_country'];
57
+ $paymentTypesName[$key['type_name']] = $key['type_label'];
58
+ }
59
+ }
60
+
61
+ ?>
62
+
63
+ <script type="text/javascript">
64
+ //<![CDATA[
65
+
66
+ var chosenCountry = '<?php echo $countryCode; ?>';
67
+
68
+ checkChosenCountryfunc();
69
+
70
+ function checkChosenCountryfunc() {
71
+
72
+ jQuery(".<?php echo $_code ?>-payment-select").hide();
73
+ jQuery("select#<?php echo $_code ?>-payment-type").empty();
74
+ jQuery("select#<?php echo $_code ?>-payment-type").append('<option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>');
75
+
76
+ <?php $js_paymentTypes = json_encode($paymentTypes);
77
+ echo "var paymentTypes = ". $js_paymentTypes . ";\n";
78
+ $js_paymentTypesName = json_encode($paymentTypesName);
79
+ echo "var paymentTypesName = ". $js_paymentTypesName . ";\n"; ?>
80
+
81
+ for (var key in paymentTypes) {
82
+ var allowedCountries = paymentTypes[key];
83
+ if (jQuery.inArray(chosenCountry, allowedCountries) > -1 ) {
84
+ jQuery("select#<?php echo $_code ?>-payment-type").append('<option value="' + key + '">' + paymentTypesName[key] + '</option>');
85
+ }
86
+ }
87
+ }
88
+
89
+ jQuery("#<?php echo $_code ?>-payment-type").change(function () {
90
+
91
+ var str = "";
92
+ jQuery("#<?php echo $_code ?>-payment-type option:selected").each(function () {
93
+ str += jQuery(this).val() + "";
94
+ jQuery(".<?php echo $_code ?>-payment-select").hide("fast");
95
+
96
+ <?php foreach($paymentTypesName as $object => $key) { ?>
97
+ if (str == "<?php echo $object ?>") {
98
+ jQuery("#<?php echo $_code ?>-payment-type-<?php echo $object; ?>").show(400, function () {
99
+ // special fields for (ACH) payment
100
+ <?php if ($object == "ACH" && $countryCode == "US") { ?>
101
+ jQuery("#<?php echo $_code ?>-<?php echo strtolower($object); ?>-ssn-field").show(400);
102
+ <?php } else { ?>
103
+ jQuery("#<?php echo $_code ?>-<?php echo strtolower($object); ?>-ssn-field").hide();
104
+ <?php }
105
+ // special fields for (EuroDebit) payment
106
+ if ($object == "EuroDebit" || ($countryCode == "DE" || $countryCode == "AT")) { ?>
107
+ jQuery("#<?php echo $_code ?>-<?php echo strtolower($object); ?>-routingnumber-field").show(400);
108
+ <?php } else { ?>
109
+ jQuery("#<?php echo $_code ?>-<?php echo strtolower($object); ?>-routingnumber-field").hide();
110
+ <?php } ?>
111
+ });
112
+ }
113
+ <?php } ?>
114
+
115
+ });
116
+ }).trigger('change');
117
+
118
+ //]]>
119
+ </script>
120
+
121
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
122
+ <li>
123
+ <ul>
124
+ <div class="<?php echo $_code ?>-container">
125
+ <li>
126
+ <label for="<?php echo $_code ?>-payment-type" class="required"><em>*</em><?php echo $this->__('Payment Method') ?></label>
127
+ <div class="input-box">
128
+ <select id="<?php echo $_code ?>-payment-type" name="payment[<?php echo $_code ?>_type_name]" class="required-entry" >
129
+ <option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>
130
+ <?php foreach($paymentTypesName as $object => $key) { ?>
131
+ <option value="<?php echo $object ?>"><?php echo $key ?></option>
132
+ <?php } ?>
133
+ </select>
134
+ </div>
135
+ </li>
136
+ <div class="<?php echo $_code ?>-payment-select" id="<?php echo $_code ?>-payment-type-notselected" style="display: none;"></div>
137
+ <?php foreach($paymentTypesName as $object => $key) { ?>
138
+ <div class="<?php echo $_code ?>-payment-select" id="<?php echo $_code ?>-payment-type-<?php echo $object ?>" style="display: none;">
139
+ <?php echo $this->getLayout()->createBlock('core/template')->setTemplate(''.$_code.'/form/'.strtolower($object).'.phtml')->toHtml(); ?>
140
+ </div>
141
+ <?php } ?>
142
+ </div>
143
+ </ul>
144
+ </li>
145
+ </ul>
146
+
147
+
148
+
149
+
150
+ <div>
151
+ <?php echo $this->getMethod()->getConfigData('message');?>
152
+ </div>
153
+
app/design/frontend/base/default/template/twokcharge/form/ach.phtml ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ $clientaccount = Mage::getStoreConfig('payment/twokcharge/clientaccount',Mage::app()->getStore());
28
+ $keyaccount = Mage::getStoreConfig('payment/twokcharge/keyaccount',Mage::app()->getStore());
29
+
30
+ $type = 'twokcharge';
31
+ $pay_options = 'ach';
32
+
33
+ ?>
34
+
35
+ <script type="text/javascript">
36
+ //<![CDATA[
37
+
38
+ // show popup window with info - Signature
39
+ function togglePhoneValToolTip(event){
40
+ if($('<?php echo $type; ?>-<?php echo $pay_options; ?>-make-tool-tip')){
41
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-make-tool-tip').setStyle({
42
+ top: (Event.pointerY(event)-800)+'px'//,
43
+ // left: (Event.pointerX(event)+100)+'px'
44
+ })
45
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-make-tool-tip').toggle();
46
+ }
47
+ Event.stop(event);
48
+ }
49
+ if($('<?php echo $type; ?>-<?php echo $pay_options; ?>-make-tool-tip-close')){
50
+ Event.observe($('<?php echo $type; ?>-<?php echo $pay_options; ?>-make-tool-tip-close'), 'click', togglePhoneValToolTip);
51
+ }
52
+
53
+ $$('.<?php echo $type; ?>-<?php echo $pay_options; ?>-phone-verf-make-tool').each(function(element){
54
+ Event.observe(element, 'click', togglePhoneValToolTip);
55
+ });
56
+
57
+
58
+
59
+ Validation.add('<?php echo $type; ?>-validate-<?php echo $pay_options; ?>-ssn', '<?php echo __('Please enter the last 4 digits of your Social Security Number') ?>', {
60
+ minLength : 4
61
+ });
62
+
63
+ Validation.add('<?php echo $type; ?>-validate-<?php echo $pay_options; ?>-phone-verf-num', "<?php echo __('Phone Verification Number should be 8 digits') ?>", {
64
+ minLength : 8
65
+ });
66
+
67
+ //]]>
68
+ </script>
69
+
70
+ <div class="tool-tip" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-make-tool-tip" style="display:none;">
71
+ <div class="btn-close"><a href="#" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-make-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
72
+ <div class="tool-tip-content <?php echo $type; ?>-<?php echo $pay_options; ?>-tool-tip-content">
73
+ <strong><?php echo $this->__('Phone Verification - Description') ?></strong>
74
+ <br><br>
75
+ <center>
76
+ <table>
77
+ <tbody>
78
+ <tr>
79
+ <td>
80
+ <img src="<?php echo $this->getSkinUrl('twokcharge/images/phoneverf1.jpg') ?>" />
81
+ </td>
82
+ <td class="last">
83
+ <?php echo $this->__('To get phone verification number, enter your phone number, choose your method, and click "Continue" button') ?>
84
+ </td>
85
+ </tr>
86
+ <tr>
87
+ <td>
88
+ <img src="<?php echo $this->getSkinUrl('twokcharge/images/phoneverf2.jpg') ?>" />
89
+ </td>
90
+ <td class="last">
91
+ <?php echo $this->__('You will receive a call or text message from our system telling you the PIN number') ?>
92
+ </td>
93
+ </tr>
94
+ <tr>
95
+ <td>
96
+ <img src="<?php echo $this->getSkinUrl('twokcharge/images/phoneverf3.jpg') ?>" />
97
+ </td>
98
+ <td class="last">
99
+ <?php echo $this->__('Phone verification number is shown after your phone number is verified') ?>
100
+ </td>
101
+ </tr>
102
+ <tr>
103
+ <td>
104
+ <img src="<?php echo $this->getSkinUrl('twokcharge/images/phoneverf4.jpg') ?>" />
105
+ </td>
106
+ <td class="last">
107
+ <?php echo $this->__('Enter the phone verification number as shown') ?>
108
+ </td>
109
+ </tr>
110
+
111
+
112
+ </tbody>
113
+ </table>
114
+ </center>
115
+ </div>
116
+ </div>
117
+
118
+ <ul class="form-list">
119
+ <li>
120
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-select" class="required"><em>*</em><?php echo $this->__('Account Type') ?></label>
121
+ <div class="input-box">
122
+ <select id="<?php echo $type; ?>-<?php echo $pay_options; ?>-select" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_accounttype]" class="required-entry">
123
+ <option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>
124
+ <option value="PC">Checking</option>
125
+ <option value="PS">Saving</option>
126
+ </select>
127
+ </div>
128
+ </li>
129
+
130
+ <li>
131
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-accountnumber" class="required">
132
+ <em>*</em><?php echo $this->__('Account Number') ?></label>
133
+ <span class="input-box">
134
+ <input type="text" class="required-entry validate-digits" maxlength="16" size="16" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_accountnumber]" />
135
+ </span><!-- required-entry validate-digits -->
136
+ </li>
137
+ <li>
138
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-routingnumber" class="required">
139
+ <em>*</em><?php echo $this->__('Routing Number') ?></label>
140
+ <span class="input-box">
141
+ <input type="text" class="required-entry validate-digits" maxlength="11" size="11" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_routingnumber]" />
142
+ </span><!-- required-entry validate-digits -->
143
+ </li>
144
+ <li>
145
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-checknumber" class="required">
146
+ <em>*</em><?php echo $this->__('Check Number') ?></label>
147
+ <span class="input-box">
148
+ <input type="text" class="required-entry validate-digits" maxlength="11" size="11" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_checknumber]" />
149
+ </span>
150
+ </li>
151
+ <li>
152
+ <div class="data-name" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-ssn-field" style="display: none;" >
153
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-ssn" class="required">
154
+ <em>*</em><?php echo $this->__('Last 4 digits of social secure number') ?></label>
155
+ <span class="input-box">
156
+ <input type="text" class="required-entry validate-digits <?php echo $type; ?>-validate-<?php echo $pay_options; ?>-ssn" maxLength="4" size="4" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_ssn]" />
157
+ </span>
158
+ </div>
159
+ </li>
160
+
161
+ <li>
162
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-verf" class="required">
163
+ <em>*</em><?php echo $this->__('Phone Verification Form') ?></label>
164
+ <span class="input-box" style="width:380px;">
165
+
166
+ <a class="<?php echo $pay_options; ?>-make-tool <?php echo $type; ?>-<?php echo $pay_options; ?>-phone-verf-make-tool" title="<?php echo $this->__('How the signature box works') ?>" href="#">
167
+ <img src="<?php echo $this->getSkinUrl('twokcharge/images/qm.gif') ?>" alt="<?php echo $this->__('How phone verfication works') ?>" title="<?php echo $this->__('How phone verfication works') ?>" />
168
+ </a>
169
+
170
+ <iframe id="<?php echo $type; ?>-phoneVerificationBox" frameborder=0 style="margin:0px;width:360px;height:155px;float:left"
171
+ src="https://secure.2000charge.com/secure/PhoneVerification/PinCapture.asp?clientaccount=<?php echo $clientaccount ?>&key=<?php echo $keyaccount ?>&bgcolor=FBFAF6&fontcolor=666666&sms=1">
172
+ </iframe>
173
+ </span>
174
+ </li>
175
+ <li>
176
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-phone-verf-num" class="required">
177
+ <em>*</em><?php echo $this->__('Phone Verification Number') ?></label>
178
+
179
+ <span class="input-box">
180
+ <input type="text" class="required-entry validate-digits <?php echo $type; ?>-validate-<?php echo $pay_options; ?>-phone-verf-num" maxlength="8" size="8" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_phone_verf_num]" />
181
+
182
+ </span>
183
+ </li>
184
+ </ul>
185
+
186
+
app/design/frontend/base/default/template/twokcharge/form/barpay.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the 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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
app/design/frontend/base/default/template/twokcharge/form/brazilpay.phtml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ $type = 'twokcharge';
28
+ $pay_options = 'ach';
29
+
30
+ ?>
31
+ <?php echo $pay_options; ?>
32
+
33
+ <ul class="form-list">
34
+ <li>
35
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-select" class="required">
36
+ <em>*</em><?php echo $this->__('BankCode') ?></label>
37
+
38
+ <div class="input-box">
39
+ <select id="<?php echo $type; ?>-<?php echo $pay_options; ?>-select" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_bankcode]" class="required-entry">
40
+ <option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>
41
+ <option value="BB">Banco do Brasil</option>
42
+ <option value="I">Itau</option>
43
+ <option value="B3">Bradesco</option>
44
+ <option value="H">HSBC</option>
45
+ </select>
46
+ </div>
47
+ </li>
48
+ </ul>
49
+
50
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
51
+
52
+
53
+
54
+
app/design/frontend/base/default/template/twokcharge/form/chinadebit.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the 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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
app/design/frontend/base/default/template/twokcharge/form/creditcard.phtml ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+
29
+ $creditCardType = array( "Visa" => "Visa",
30
+ "Mastercard" => "MasterCard",
31
+ "JCB" => "JCB",
32
+ "American Express" => "American Express",
33
+ "Discover" => "Discover",
34
+ "BCcard" => "BCcard",
35
+ "Diners" => "Diners",
36
+ "UnionPay" => "UnionPay",
37
+ "Pulse" => "Pulse"
38
+ );
39
+
40
+ ?>
41
+
42
+ <ul class="form-list">
43
+ <li>
44
+ <label for="creditcard-type-select" class="required"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
45
+ <div class="input-box">
46
+ <select id="creditcard-type-select" name="payment[creditcard_type]" class="required-entry validate-cc-type"> <!-- validate-cc-type-select -->
47
+ <option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>
48
+ <?php foreach ($creditCardType as $object => $key): ?>
49
+ <option value="<?php echo $object ?>"><?php echo $key ?></option>
50
+ <?php endforeach ?>
51
+ </select>
52
+ </div>
53
+ </li>
54
+ <li>
55
+ <label for="creditcard-number" class="required">
56
+ <em>*</em><?php echo $this->__('Credit Card Number') ?></label>
57
+ <div class="input-box">
58
+ <input type="text" class="required-entry validate-cc-number validate-cc-type" name="payment[creditcard_number]" /> <!-- validate-cc-type validate-cc-number-->
59
+ </div>
60
+ </li>
61
+
62
+ <li id="creditcard_type_exp_div">
63
+ <label for="creditcard_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
64
+ <div class="input-box">
65
+ <div class="v-fix">
66
+ <select id="creditcard_expiration" name="payment[creditcard_exp_month]" class="month validate-cc-exp required-entry "> <!-- -->
67
+ <option value="" selected="selected"><?php echo $this->__('Month') ?></option>
68
+ <?php foreach (monthsList() as $object => $key): ?>
69
+ <option value="<?php echo $object; ?>"><?php echo $key; ?></option>
70
+ <?php endforeach ?>
71
+ </select>
72
+ </div>
73
+ <div class="v-fix">
74
+ <select id="creditcard_expiration_yr" name="payment[creditcard_exp_year]" class="year validate-cc-exp required-entry">
75
+ <option value="" selected="selected"><?php echo $this->__('Year') ?></option>
76
+ <?php foreach (yearsList() as $object): ?>
77
+ <option value="<?php echo $object; ?>"><?php echo ($object); ?></option>
78
+ <?php endforeach ?>
79
+ </select>
80
+ </div>
81
+ </div>
82
+ </li>
83
+ <li id="creditcard_type_cvv_div">
84
+ <label for="creditcard_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
85
+ <div class="input-box">
86
+ <div class="v-fix">
87
+ <input type="text" title="<?php echo $this->__('Card Verification Number (CVV2)') ?>" maxlength="4" class="cvv validate-cc-cvn validate-digits required-entry" id="creditcard_cvv" name="payment[creditcard_cvv]" value="" /> <!-- -->
88
+ </div>
89
+ <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
90
+ </div>
91
+ </li>
92
+
93
+
94
+ </ul>
95
+
96
+ <?php
97
+
98
+ function monthsList()
99
+ {
100
+ $monthList = array();
101
+ for($i = 1; $i <= 12; $i++)
102
+ {
103
+ $date = new Zend_Date('Feb 31, 2007', 'MM/dd/yyyy');
104
+ $date->setMonth($i);
105
+ $monthList = $monthList + array($date->getMonth()->get('MM') => $date->getMonth()->get('MMMM'));
106
+ // print_r($monthList);
107
+ }
108
+
109
+ // file_put_contents("/home/user/dev/virenvs/magento_cart/var/log/monthList$$$.txt", print_r($monthList, true), FILE_APPEND);
110
+
111
+ return $monthList;
112
+ }
113
+
114
+ function yearsList()
115
+ {
116
+ $yearList = array();
117
+ $date = new Zend_Date();
118
+ $year = ($date->toString('yyyy'))-1;
119
+
120
+ for($i = 0; $i <= 10; $i++)
121
+ {
122
+ $year = $year + 1;
123
+ array_push($yearList, "$year");
124
+ }
125
+
126
+ return $yearList;
127
+ }
128
+ ?>
129
+
130
+
app/design/frontend/base/default/template/twokcharge/form/directpay.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
28
+
29
+
30
+
app/design/frontend/base/default/template/twokcharge/form/directpaymax.phtml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ $type = 'twokcharge';
28
+ $pay_options = 'directpaymax';
29
+
30
+
31
+ $countryBankList = array( "DE" => array( "312" => "Augusta Bank",
32
+ "268" => "Deutsche Bank",
33
+ "299" => "Postbank",
34
+ "262" => "Raiffeisen-Volksbank",
35
+ ),
36
+ "US" => array( "1" => "Bank of America",
37
+ "6" => "Chase",
38
+ "2" => "CitiBank",
39
+ "320" => "Comerica Bank",
40
+ "321" => "U.S. Bank",
41
+ "9" => "Union Bank",
42
+ "3" => "Wells Fargo",
43
+ ),
44
+ );
45
+
46
+ $_cart = Mage::getModel('checkout/cart')->getQuote();
47
+ $countryCode = $_cart->getBillingAddress()->getCountry();
48
+
49
+ ?>
50
+
51
+ <ul class="form-list">
52
+ <li style="color:red">
53
+ <div > <?php echo $this->__('Please have your online bank user id and password ready') ?> </div>
54
+ </li>
55
+ <li>
56
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-bankcode" class="required"><em>*</em><?php echo $this->__('Select Bank') ?></label>
57
+ <div class="input-box">
58
+ <select id="<?php echo $type; ?>-<?php echo $pay_options; ?>-select" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_bankcode]" class="required-entry">
59
+ <option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>
60
+ <?php foreach ($countryBankList as $countryObject => $countrykey) {
61
+ if ($countryObject == $countryCode ) {
62
+ foreach ($countrykey as $bankobject => $bankkey) { ?>
63
+ <option value="<?php echo $bankobject ?>"><?php echo $bankkey ?></option>
64
+ <?php }
65
+ }
66
+ } ?>
67
+ </select>
68
+ </div>
69
+ </li>
70
+ </ul>
71
+
72
+
73
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
74
+
75
+
app/design/frontend/base/default/template/twokcharge/form/eps.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the 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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
app/design/frontend/base/default/template/twokcharge/form/eurodebit.phtml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ $countryCode = Mage::getModel('checkout/cart')->getQuote()->getBillingAddress()->getCountry();
28
+
29
+ $type = 'twokcharge';
30
+ $pay_options = 'eurodebit';
31
+
32
+ ?>
33
+
34
+ <script type="text/javascript">
35
+
36
+ //<![CDATA[
37
+ var countryCode = '<?php echo $countryCode ?>';
38
+ if (countryCode == 'DE') {
39
+
40
+ Validation.add('<?php echo $type; ?>-validate-<?php echo $pay_options; ?>-routingnumber-de', "<?php echo __('German Routing Number should be 8 digits') ?>", function (v) {
41
+
42
+ return Validation.get('IsEmpty').test(v) || /^(\d){8}$/.test(v)
43
+ });
44
+
45
+ }
46
+
47
+ //]]>
48
+ </script>
49
+
50
+ <ul class="form-list">
51
+ <li>
52
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-accountnumber" class="required"><em>*</em><?php echo $this->__('Account Number') ?></label>
53
+ <span class="input-box">
54
+ <input type="text" class="required-entry validate-digits" maxlength="16" size="16" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_accountnumber]" />
55
+ </span>
56
+ </li>
57
+ <li>
58
+ <div class="data-name" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-routingnumber-field" style="display: none;" >
59
+ <label class="required" for="<?php echo $type; ?>-<?php echo $pay_options; ?>-routingnumber"><em>*</em><?php echo $this->__('Routing Number') ?></label>
60
+ <span class="input-box">
61
+ <input type="text" class="required-entry validate-digits <?php echo $type; ?>-<?php echo $pay_options; ?>-eurodebit-routingnumber-de" maxlength="16" size="16" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_routingnumber]" />
62
+ </span>
63
+ </div>
64
+ </li>
65
+ </ul>
66
+
67
+
app/design/frontend/base/default/template/twokcharge/form/giropay.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ $type = 'twokcharge';
28
+ $pay_options = 'giropay';
29
+
30
+ ?>
31
+
32
+ <script type="text/javascript">
33
+
34
+ //<![CDATA[
35
+ Validation.add('<?php echo $type; ?>-validate-<?php echo $pay_options; ?>-routingnumber', "<?php echo __('Routing Number should be 8 digits') ?>", {
36
+ minLength : 8
37
+ });
38
+
39
+ //]]>
40
+ </script>
41
+
42
+ <ul class="form-list">
43
+ <li>
44
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-accountnumber" class="required"><em>*</em><?php echo $this->__('Account Number') ?></label>
45
+ <span class="input-box">
46
+ <input type="text" class="required-entry validate-digits" maxlength="16" size="16" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_accountnumber]" />
47
+ </span>
48
+ </li>
49
+ <li>
50
+
51
+ <div class="data-name" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-routingnumber-field" style="display: none;" >
52
+ <label class="required" for="<?php echo $type; ?>-<?php echo $pay_options; ?>-routingnumber"><em>*</em><?php echo $this->__('Routing Number') ?></label>
53
+ <span class="input-box">
54
+ <input type="text" class="required-entry validate-digits <?php echo $type; ?>-validate-<?php echo $pay_options; ?>-routingnumber" maxlength="8" size="8" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_routingnumber]" />
55
+ </span>
56
+ </div>
57
+ </li>
58
+ </ul>
59
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
60
+
app/design/frontend/base/default/template/twokcharge/form/ideal.phtml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ $type = 'twokcharge';
28
+ $pay_options = 'ideal';
29
+ ?>
30
+
31
+ <?php echo $type; ?>
32
+ <?php echo $pay_options; ?>
33
+
34
+ <ul class="form-list">
35
+ <li>
36
+ <label for="<?php echo $type; ?>-<?php echo $pay_options; ?>-select" class="required"><em>*</em><?php echo $this->__('BankCode') ?></label>
37
+ <div class="input-box">
38
+ <select id="<?php echo $type; ?>-<?php echo $pay_options; ?>-select" name="payment[<?php echo $type; ?>_<?php echo $pay_options; ?>_bankcode]" class="required-entry">
39
+ <option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>
40
+ <option value="0031">0031 - ABN Amro Bank</option>
41
+ <option value="0761">0761 - ASN Bank</option>
42
+ <option value="0091">0091 - Friesland Bank</option>
43
+ <option value="0721">0721 - ING</option>
44
+ <option value="0021">0021 - Rabo Bank</option>
45
+ <option value="0751">0751 - SNS Bank</option>
46
+ <option value="0771">0771 - SNS Regio Bank</option>
47
+ <option value="0511">0511 - Triodos Bank</option>
48
+ </select>
49
+ </div>
50
+
51
+ </li>
52
+ </ul>
53
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
54
+
55
+
app/design/frontend/base/default/template/twokcharge/form/paysafe.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the 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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
app/design/frontend/base/default/template/twokcharge/form/poli.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the 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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
app/design/frontend/base/default/template/twokcharge/form/przelewy.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the 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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
app/design/frontend/base/default/template/twokcharge/form/qiwi.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the 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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
app/design/frontend/base/default/template/twokcharge/form/sepa.phtml ADDED
@@ -0,0 +1,813 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ $clientaccount = Mage::getStoreConfig('payment/twokcharge/clientaccount',Mage::app()->getStore());
28
+ $keyaccount = Mage::getStoreConfig('payment/twokcharge/keyaccount',Mage::app()->getStore());
29
+
30
+ $cCode = Mage::getModel('checkout/cart')->getQuote()->getBillingAddress()->getCountry();
31
+
32
+ $dbIbanList = Mage::getModel('twokcharge/dbiban')->getCollection()->getData();
33
+ $count = count($dbIbanList);
34
+
35
+ $type = 'twokcharge';
36
+ $pay_options = 'sepa';
37
+ ?>
38
+
39
+ <script type="text/javascript">
40
+
41
+ //<![CDATA[
42
+
43
+ //var test = '<?php // echo $cCode ?>';
44
+ // console.log(test);
45
+ // console.log("-------start !!-----------");
46
+
47
+
48
+ var name = '';
49
+ var code = '';
50
+ var bank = '';
51
+ var acc = '';
52
+ var bank_lng = '';
53
+ var acc_lng = '';
54
+ var total_lng = '';
55
+
56
+ var iban_data = new Array();
57
+ // create array iban_data in db
58
+ <?php for ($i = 0; $i < $count; ++$i) { ?>
59
+
60
+ iban_data.push(new Country("<?php echo $dbIbanList[$i]['country'] ?>",
61
+ "<?php echo $dbIbanList[$i]['country_id'] ?>",
62
+ "<?php echo $dbIbanList[$i]['bank_code'] ?>",
63
+ "<?php echo $dbIbanList[$i]['account_number'] ?>"
64
+ )
65
+ );
66
+ <?php } ?>
67
+ // check if iban is valid
68
+ jQuery('input[name="payment[<?php echo $type; ?>_sepa_iban]"]').change(function () {
69
+
70
+ var ibanCheckResult = CheckIBAN(jQuery('input[name="payment[<?php echo $type; ?>_sepa_iban]"]').val() );
71
+
72
+ // console.log(ibanCheckResult);
73
+
74
+ if (ibanCheckResult == "OK") {
75
+ jQuery('input[name="payment[<?php echo $type; ?>_sepa_iban_hidden]"]').val(ibanCheckResult)
76
+ } else {
77
+ jQuery('input[name="payment[<?php echo $type; ?>_sepa_iban_hidden]"]').val(ibanCheckResult)
78
+ }
79
+ });
80
+
81
+ // show popup window with info - Signature
82
+ function toggleSignatureToolTip(event){
83
+ if($('<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-make-tool-tip')){
84
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-make-tool-tip').setStyle({
85
+ top: (Event.pointerY(event)-560)+'px'//,
86
+ //left: (Event.pointerX(event)+100)+'px'
87
+ })
88
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-make-tool-tip').toggle();
89
+ }
90
+ Event.stop(event);
91
+ }
92
+ if($('<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-make-tool-tip-close')){
93
+ Event.observe($('<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-make-tool-tip-close'), 'click', toggleSignatureToolTip);
94
+ }
95
+
96
+ $$('.<?php echo $type; ?>-sepa-signature-make-tool').each(function(element){
97
+ Event.observe(element, 'click', toggleSignatureToolTip);
98
+ });
99
+
100
+ // show popup window with info - Signature Number
101
+ function toggleSignatureNumberToolTip(event){
102
+ if($('<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-number-make-tool-tip')){
103
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-number-make-tool-tip').setStyle({
104
+ top: (Event.pointerY(event)-560)+'px'//,
105
+ //left: (Event.pointerX(event)+100)+'px'
106
+ })
107
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-number-make-tool-tip').toggle();
108
+ }
109
+ Event.stop(event);
110
+ }
111
+ if($('<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-number-make-tool-tip-close')){
112
+ Event.observe($('<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-number-make-tool-tip-close'), 'click', toggleSignatureNumberToolTip);
113
+ }
114
+
115
+ $$('.<?php echo $type; ?>-sepa-signature-number-make-tool').each(function(element){
116
+ Event.observe(element, 'click', toggleSignatureNumberToolTip);
117
+ });
118
+
119
+ // show popup window with info - Bic
120
+ function toggleBicToolTip(event){
121
+ if($('<?php echo $type; ?>-<?php echo $pay_options; ?>-bic-make-tool-tip')){
122
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-bic-make-tool-tip').setStyle({
123
+ top: (Event.pointerY(event)-560)+'px'//,
124
+ //left: (Event.pointerX(event)+100)+'px'
125
+ })
126
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-bic-make-tool-tip').toggle();
127
+ }
128
+ Event.stop(event);
129
+ }
130
+ if($('<?php echo $type; ?>-<?php echo $pay_options; ?>-bic-make-tool-tip-close')){
131
+ Event.observe($('<?php echo $type; ?>-<?php echo $pay_options; ?>-bic-make-tool-tip-close'), 'click', toggleBicToolTip);
132
+ }
133
+
134
+
135
+ $$('.<?php echo $type; ?>-sepa-bic-make-tool').each(function(element){
136
+ Event.observe(element, 'click', toggleBicToolTip);
137
+ });
138
+
139
+ // show popup window with info - Iban
140
+ function toggleIbanToolTip(event){
141
+ if($('<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-make-tool-tip')){
142
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-make-tool-tip').setStyle({
143
+ top: (Event.pointerY(event)-560)+'px'//,
144
+ //left: (Event.pointerX(event)+100)+'px'
145
+ })
146
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-make-tool-tip').toggle();
147
+ }
148
+ Event.stop(event);
149
+ }
150
+ if($('<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-make-tool-tip-close')){
151
+ Event.observe($('<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-make-tool-tip-close'), 'click', toggleIbanToolTip);
152
+ }
153
+
154
+
155
+ $$('.<?php echo $type; ?>-sepa-iban-make-tool').each(function(element){
156
+ Event.observe(element, 'click', toggleIbanToolTip);
157
+ });
158
+
159
+
160
+
161
+ $$('#<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-button').each(function(element){
162
+ // console.log('attaching event handler');
163
+ Event.observe(element, 'click', submitIBAN);
164
+ });
165
+
166
+ // $$('.button').each(function(elmt) {
167
+ // elmt.observe('click', function(ev) {
168
+ // ev.target.disabled='disabled';
169
+ // });
170
+ // });
171
+
172
+ function submitIBAN() {
173
+
174
+ console.log('submitIBAN');
175
+
176
+ var xccode = '<?php echo $cCode ?>';
177
+
178
+ var xbankcode = $('<?php echo $type; ?>-<?php echo $pay_options; ?>-xbankcode').value;
179
+ var xaccountnumber = $('<?php echo $type; ?>-<?php echo $pay_options; ?>-xaccountnumber').value;
180
+
181
+ var ibanResult = false;
182
+
183
+ ibanResult = contructIBAN();
184
+ ibanCheckResult = CheckIBAN( jQuery('input[name="payment[<?php echo $type; ?>_sepa_iban]"]').val() );
185
+ // console.log(ibanResult);
186
+ if (ibanResult) {
187
+ jQuery('input[name="payment[<?php echo $type; ?>_sepa_iban_hidden]"]').val('OK')
188
+ $('<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-make-tool-tip').hide();
189
+ } else {
190
+ jQuery('input[name="payment[<?php echo $type; ?>_sepa_iban_hidden]"]').val('NOT OK')
191
+ // console.log('====NOT OK====');
192
+ }
193
+
194
+ }
195
+
196
+ Country_showFormat(iban_data);
197
+
198
+ // JavaScript Object for country specific iban data.
199
+ function Country(name, code, bank_form, acc_form)
200
+ {
201
+ // Constructor for Country objects.
202
+ //
203
+ // Arguments:
204
+ // name - Name of the country
205
+ // code - Country Code from ISO 3166
206
+ // bank_form - Format of bank/branch code part (e.g. "0 4a 0 ")
207
+ // acc_form - Format of account number part (e.g. "0 11 2n")
208
+
209
+ this.name = name;
210
+ this.code = code;
211
+ this.bank = Country_decode_format(bank_form);
212
+ this.acc = Country_decode_format(acc_form);
213
+ this.bank_lng = Country_calc_length(this.bank);
214
+ this.acc_lng = Country_calc_length(this.acc);
215
+ this.total_lng = 4 + this.bank_lng + this.acc_lng;
216
+
217
+ }
218
+
219
+ // decode iban format in db and return list of value
220
+ function Country_decode_format(form)
221
+ {
222
+ var form_list = new Array();
223
+ var parts = form.split(" ");
224
+ for (var i = 0; i < parts.length; ++i)
225
+ {
226
+ var part = parts[i];
227
+ if (part != "")
228
+ {
229
+ var typ = part.charAt(part.length - 1);
230
+ if (typ == "a" || typ == "n")
231
+ part = part.substring(0, part.length - 1);
232
+ else
233
+ typ = "c";
234
+ var lng = parseInt(part);
235
+ form_list[form_list.length] = new Array(lng, typ);
236
+ }
237
+ }
238
+
239
+ return form_list;
240
+ }
241
+
242
+ function Country_calc_length(form_list)
243
+ {
244
+ var sum = 0;
245
+ for (var i = 0; i < form_list.length; ++i)
246
+ sum += form_list[i][0];
247
+ return sum;
248
+ }
249
+
250
+ // parse country format on list and set fields length in iban window
251
+ function Country_showFormat(iban_data) {
252
+
253
+ var countryCode = CountryData('<?php echo $cCode; ?>');
254
+ var charlistbank = Array();
255
+ var charlistacc = Array();
256
+ var charflag = Array();
257
+
258
+ // console.log(countryCode);
259
+
260
+ if (countryCode != null) {
261
+ for (var i = 0; i < 3; ++i) {
262
+ if (countryCode.bank[i][0] != 0) {
263
+ charlistbank.push(countryCode.bank[i]);
264
+ if (jQuery.inArray(countryCode.bank[i][1], charflag) < 0 ) {
265
+ charflag.push(countryCode.bank[i][1]);
266
+ }
267
+ }
268
+ if (countryCode.acc[i][0] != 0) {
269
+ charlistacc.push(countryCode.acc[i]);
270
+ if (jQuery.inArray(countryCode.acc[i][1], charflag) < 0 ) {
271
+ charflag.push(countryCode.acc[i][1]);
272
+ }
273
+ }
274
+ }
275
+ }
276
+ addIbanInfoDescription(charflag);
277
+
278
+
279
+ var numcharlistbank = addCodeDescription(charlistbank, '<?php echo $type; ?>-<?php echo $pay_options; ?>-xbankcode');
280
+ var numcharlistacc = addCodeDescription(charlistacc, '<?php echo $type; ?>-<?php echo $pay_options; ?>-xaccountnumber');
281
+ var nnn = numcharlistbank + numcharlistacc;
282
+ jQuery('input[name="payment[<?php echo $type; ?>_sepa_iban]"]').attr('maxlength', numcharlistbank+numcharlistacc+4);
283
+ jQuery('input[name="payment[<?php echo $type; ?>_sepa_iban]"]').attr('size', numcharlistbank+numcharlistacc+10);
284
+
285
+ }
286
+ // add info description
287
+ function addIbanInfoDescription(charflag) {
288
+
289
+ jQuery("div#<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-info-description").empty();
290
+ for (var i = 0; i < charflag.length; ++i) {
291
+ if (charflag[i] == 'a') {
292
+ jQuery("div#<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-info-description").append(' &nbsp;&nbsp;<b>a</b>: <?php echo $this->__('letters A-Z') ?> ');
293
+ } else if (charflag[i] == 'n') {
294
+ jQuery("div#<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-info-description").append(' &nbsp;&nbsp;<b>n</b>: <?php echo $this->__('numbers 0-9') ?> ');
295
+ } else if (charflag[i] == 'c') {
296
+ jQuery("div#<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-info-description").append(' &nbsp;&nbsp;<b>c</b>: <?php echo $this->__('letters A-Z and numbers 0-9') ?> ');
297
+ }
298
+ }
299
+ }
300
+
301
+ // add description on filed Bank/Branch and account Number field (ex: (Format: 4a + 6n))
302
+ // charlist: list of characters for print
303
+ // identifier: html id, where jquery insert description
304
+ function addCodeDescription(charlist, identifier) {
305
+
306
+ jQuery("div#"+identifier+"-description").empty();
307
+ var msg = "";
308
+ var numChar = 0;
309
+ for (var i = 0; i < charlist.length; ++i) {
310
+ msg = msg + charlist[i][0] + charlist[i][1];
311
+ numChar = numChar + charlist[i][0];
312
+ if (i != (charlist.length-1) ) {
313
+ msg = msg + ' + ';
314
+ }
315
+ }
316
+ jQuery("div#"+identifier+"-description").append(' (<?php echo $this->__('Format') ?>: '+msg+')');
317
+ jQuery("input#"+identifier).attr('size', numChar+4);
318
+ jQuery("input#"+identifier).attr('maxlength', numChar);
319
+
320
+ return numChar;
321
+ }
322
+
323
+ // Search the country code in the iban_data list.
324
+ function CountryData(code)
325
+ {
326
+ for (var i = 0; i < iban_data.length; ++i)
327
+ if (iban_data[i].code == code)
328
+ return iban_data[i];
329
+ return null;
330
+ }
331
+
332
+ // Modulo 97 for huge numbers given as digit strings.
333
+ function mod97(digit_string)
334
+ {
335
+ var m = 0;
336
+ for (var i = 0; i < digit_string.length; ++i)
337
+ m = (m * 10 + parseInt(digit_string.charAt(i))) % 97;
338
+ return m;
339
+ }
340
+
341
+ // Convert a capital letter into digits: A -> 10 ... Z -> 35 (ISO 13616).
342
+ function capital2digits(ch)
343
+ {
344
+ var capitals = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
345
+ for (var i = 0; i < capitals.length; ++i)
346
+ if (ch == capitals.charAt(i))
347
+ break;
348
+ return i + 10;
349
+ }
350
+
351
+ // Fill the string with leading zeros until length is reached.
352
+ function fill0(s, l)
353
+ {
354
+ while (s.length < l)
355
+ s = "0" + s;
356
+ return s;
357
+ }
358
+
359
+ // Compare two strings respecting german umlauts.
360
+ function strcmp(s1, s2)
361
+ {
362
+ var chars = "AaÄäBbCcDdEeFfGgHhIiJjKkLlMmNnOoÖöPpQqRrSsßTtUuÜüVvWwXxYyZz";
363
+ var lng = (s1.length < s2.length) ? s1.length : s2.length;
364
+ for (var i = 0; i < lng; ++i)
365
+ {
366
+ var d = chars.indexOf(s1.charAt(i)) - chars.indexOf(s2.charAt(i));
367
+ if (d != 0)
368
+ return d;
369
+ }
370
+ return s1.length - s2.length;
371
+ }
372
+
373
+ // Create an index table of the iban_data list sorted by country names.
374
+ function CountryIndexTable()
375
+ {
376
+ var tab = new Array();
377
+ var i, j, t;
378
+ for (i = 0; i < iban_data.length; ++i)
379
+ tab[i] = i;
380
+ for (i = tab.length - 1; i > 0; --i)
381
+ for (j = 0; j < i; ++j)
382
+ if (strcmp(iban_data[tab[j]].name, iban_data[tab[j+1]].name) > 0)
383
+ t = tab[j], tab[j] = tab[j+1], tab[j+1] = t;
384
+ return tab;
385
+ }
386
+
387
+ // Calculate 2-digit checksum of an IBAN.
388
+ function ChecksumIBAN(iban)
389
+ {
390
+ var code = iban.substring(0, 2);
391
+ var checksum = iban.substring(2, 4);
392
+ var bban = iban.substring(4);
393
+
394
+ // Assemble digit string
395
+ var digits = "";
396
+ for (var i = 0; i < bban.length; ++i)
397
+ {
398
+ var ch = bban.charAt(i).toUpperCase();
399
+ if ("0" <= ch && ch <= "9")
400
+ digits += ch;
401
+ else
402
+ digits += capital2digits(ch);
403
+ }
404
+ for (var i = 0; i < code.length; ++i)
405
+ {
406
+ var ch = code.charAt(i);
407
+ digits += capital2digits(ch);
408
+ }
409
+ digits += checksum;
410
+
411
+ // Calculate checksum
412
+ checksum = 98 - mod97(digits);
413
+ return fill0("" + checksum, 2);
414
+ }
415
+
416
+ // Fill the account number part of IBAN with leading zeros.
417
+ function FillAccount(country, account)
418
+ {
419
+ return fill0(account, country.acc_lng);
420
+ }
421
+
422
+ // Check if syntax of the part of IBAN is invalid.
423
+ function InvalidPart(form_list, iban_part)
424
+ {
425
+ for (var f = 0; f < form_list.length; ++f)
426
+ {
427
+ var lng = form_list[f][0], typ = form_list[f][1];
428
+ if (lng > iban_part.length)
429
+ lng = iban_part.length;
430
+ for (var i = 0; i < lng; ++i)
431
+ {
432
+ var ch = iban_part.charAt(i);
433
+ var a = ("A" <= ch && ch <= "Z");
434
+ var n = ("0" <= ch && ch <= "9");
435
+ var c = n || a || ("a" <= ch && ch <= "z");
436
+ if ((!c && typ == "c") || (!a && typ == "a") || (!n && typ == "n"))
437
+ return true;
438
+ }
439
+ iban_part = iban_part.substring(lng);
440
+ }
441
+ return false;
442
+ }
443
+
444
+ // Check if length of the bank/branch code part of IBAN is invalid.
445
+ function InvalidBankLength(country, bank)
446
+ {
447
+ return (bank.length != country.bank_lng);
448
+ }
449
+
450
+ // Check if syntax of the bank/branch code part of IBAN is invalid.
451
+ function InvalidBank(country, bank)
452
+ {
453
+ return (InvalidBankLength(country, bank) ||
454
+ InvalidPart(country.bank, bank));
455
+ }
456
+
457
+ // Check if length of the account number part of IBAN is invalid.
458
+ function InvalidAccountLength(country, account)
459
+ {
460
+ return (account.length < 1 || account.length > country.acc_lng);
461
+ }
462
+
463
+ // Check if syntax of the account number part of IBAN is invalid.
464
+ function InvalidAccount(country, account)
465
+ {
466
+ return (InvalidAccountLength(country, account) ||
467
+ InvalidPart(country.acc, FillAccount(country, account)));
468
+ }
469
+
470
+ // Check if length of IBAN is invalid.
471
+ function InvalidIBANlength(country, iban)
472
+ {
473
+ return (iban.length != country.total_lng);
474
+ }
475
+
476
+ // Convert iban from intern value to string format (IBAN XXXX XXXX ...).
477
+ function extern(intern)
478
+ {
479
+ var s = "IBAN";
480
+ for (var i = 0; i < intern.length; ++i)
481
+ {
482
+ if (i % 4 == 0)
483
+ s += " ";
484
+ s += intern.charAt(i);
485
+ }
486
+ return s;
487
+ }
488
+
489
+ // Convert iban from string format to intern value.
490
+ function intern(extern)
491
+ {
492
+ if (extern.substring(0, 4) == "IBAN")
493
+ extern = extern.substring(4);
494
+ var s = "";
495
+ for (var i = 0; i < extern.length; ++i)
496
+ if (extern.charAt(i) != " ")
497
+ s += extern.charAt(i);
498
+ return s;
499
+ }
500
+
501
+ // Calculate the checksum and assemble the IBAN.
502
+ function CalcIBAN(country, bank, account)
503
+ {
504
+ var fill_acc = FillAccount(country, account);
505
+ var checksum = ChecksumIBAN(country.code + "00" + bank + fill_acc);
506
+ return country.code + checksum + bank + fill_acc;
507
+ }
508
+
509
+ function CalcAltIBAN(country, bank, account)
510
+ {
511
+ var fill_acc = FillAccount(country, account);
512
+ var checksum = ChecksumIBAN(country.code + "00" + bank + fill_acc);
513
+ checksum = fill0("" + mod97(checksum), 2);
514
+ return country.code + checksum + bank + fill_acc;
515
+ }
516
+
517
+ // Check the checksum of an IBAN.
518
+ function IBANokay(iban)
519
+ {
520
+ return ChecksumIBAN(iban) == "97";
521
+ }
522
+
523
+ // Check the input, calculate the checksum and assemble the IBAN.
524
+ function CreateIBAN()
525
+ {
526
+
527
+ var code = "<?php echo $cCode; ?>";
528
+ var bank = $('<?php echo $type; ?>-<?php echo $pay_options; ?>-xbankcode').value; // intern(form.bankcode.value);
529
+ var account = $('<?php echo $type; ?>-<?php echo $pay_options; ?>-xaccountnumber').value; // intern(form.accountnumber.value);
530
+ var country = CountryData(code);
531
+
532
+ var err = null, err_focus = null;
533
+ if (country == null)
534
+ {
535
+ err = "<?php echo __('Unknown Country Code') ?>: " + code;
536
+ //err_focus = form.country;
537
+
538
+ }
539
+ else if (InvalidBankLength(country, bank))
540
+ {
541
+ err = "<?php echo __('Bank/Branch Code length') ?> " + bank.length +
542
+ " <?php echo __('is not correct for') ?> " + country.name +
543
+ " (" + country.bank_lng + ")";
544
+ // err_focus = form.bank;
545
+ }
546
+ else if (InvalidBank(country, bank))
547
+ {
548
+ err = "<?php echo __('Bank/Branch Code') ?> " + bank + " <?php echo __('is not correct for') ?> " +
549
+ country.name;
550
+ // err_focus = form.bank;
551
+ }
552
+ else if (InvalidAccountLength(country, account))
553
+ {
554
+ err = "<?php echo __('Account Number length') ?> " + account.length +
555
+ " <?php echo __('is not correct for') ?> " + country.name +
556
+ " (" + country.acc_lng + ")";
557
+ // err_focus = form.account;
558
+ }
559
+ else if (InvalidAccount(country, account))
560
+ {
561
+ err = "<?php echo __('Account Number') ?> " + account + " <?php echo __('is not correct for') ?> " +
562
+ country.name;
563
+ // err_focus = form.account;
564
+ }
565
+ if (err)
566
+ {
567
+ alert(err);
568
+ return "error";
569
+ }
570
+ else
571
+ {
572
+ return CalcIBAN(country, bank, account);
573
+ }
574
+ }
575
+
576
+ // Check the syntax and the checksum of the IBAN.
577
+ function CheckIBAN(iBanNumber)
578
+ {
579
+ var iban = intern(iBanNumber);
580
+
581
+ var code = iban.substring(0, 2);
582
+ var checksum = iban.substring(2, 4);
583
+ var bban = iban.substring(4);
584
+ var country = CountryData(code);
585
+
586
+ var err = null;
587
+ if (country == null)
588
+ err = "<?php echo __('Unknown Country Code') ?>: " + code;
589
+ else if (InvalidIBANlength(country, iban))
590
+ err = "<?php echo __('IBAN length') ?> " + iban.length + " <?php echo __('is not correct for') ?> " +
591
+ country.name + " (" + country.total_lng + ")";
592
+ else
593
+ {
594
+ var bank_lng = country.bank_lng;
595
+ var bank = bban.substring(0, bank_lng);
596
+ var account = bban.substring(bank_lng);
597
+
598
+ if (InvalidBank(country, bank))
599
+ err = "<?php echo __('Bank/Branch Code') ?> " + bank + " <?php echo __('is not correct for') ?> " +
600
+ country.name;
601
+ else if (InvalidAccount(country, account))
602
+ err = "<?php echo __('Account Number') ?> " + account + " <?php echo __('is not correct for') ?> " +
603
+ country.name;
604
+ else if (!IBANokay(iban))
605
+ err = "<?php echo __('Checksum of IBAN incorrect') ?>";
606
+ }
607
+
608
+ if (err)
609
+ {
610
+ return err;
611
+ }
612
+ else
613
+ {
614
+ return "OK";
615
+ }
616
+ }
617
+
618
+ // Translation table and translation function for localized versions
619
+ var trans_tab = new Array();
620
+
621
+ function _(s)
622
+ {
623
+ var t = trans_tab[s];
624
+ if (t)
625
+ s = t;
626
+ return s;
627
+ }
628
+
629
+ function contructIBAN() {
630
+ var ibanCreateResult = CreateIBAN();
631
+ if (ibanCreateResult == "error") {
632
+ return false;
633
+ }
634
+ else {
635
+ // document.capture.ibancomp.value = ibanCreateResult;
636
+ jQuery('input[name="payment[<?php echo $type; ?>_sepa_iban]"]').val(ibanCreateResult);
637
+ return true;
638
+ }
639
+ }
640
+
641
+ Validation.add('<?php echo $type; ?>-validate-sepa-bic', '<?php echo __('BIC/SWIFT must have 8 or 11 characters') ?>', function (v) {
642
+ return Validation.get('IsEmpty').test(v) || /^([a-zA-Z0-9]{8}([a-zA-Z0-9]{3})?)?$/.test(v)
643
+ });
644
+
645
+ Validation.add('<?php echo $type; ?>-validate-sepa-signature', '<?php echo __('Signature number must have 8 digits') ?>', {
646
+ minLength : 8
647
+ });
648
+
649
+
650
+ //]]>
651
+ </script>
652
+
653
+
654
+ <div class="tool-tip" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-make-tool-tip" style="display:none;">
655
+ <div class="btn-close"><a href="#" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-make-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
656
+ <div class="tool-tip-content">
657
+ <!-- <img src="<?php echo $this->getSkinUrl('images/cvv.gif') ?>" alt="<?php echo $this->__('Card Verification Number Visual Reference') ?>" title="<?php echo $this->__('Card Verification Number Visual Reference') ?>" /> -->
658
+
659
+ <strong><?php echo __('How Signature box works') ?></strong>
660
+ <br><br>
661
+ <?php echo __('Click and hold down the left mouse button inside') ?><br>
662
+ <?php echo __('the signature pad box below and script your name.') ?><br><br>
663
+ <?php echo __('As part of your rights, you are entitled to a refund from') ?><br>
664
+ <?php echo __('your bank under the terms and conditions of your') ?><br>
665
+ <?php echo __('agreement with your bank. A refund must be claimed') ?><br>
666
+ <?php echo __('within 8 weeks starting from the date on which') ?> <br>
667
+ <?php echo __('your account was debited. Your rights are explained') ?><br>
668
+ <?php echo __('in a statement that you can obtain from your bank.') ?>
669
+ </div>
670
+ </div>
671
+
672
+ <div class="tool-tip" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-number-make-tool-tip" style="display:none;">
673
+ <div class="btn-close"><a href="#" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-signature-number-make-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
674
+ <div class="tool-tip-content">
675
+ <!-- <img src="<?php echo $this->getSkinUrl('images/cvv.gif') ?>" alt="<?php echo $this->__('Card Verification Number Visual Reference') ?>" title="<?php echo $this->__('Card Verification Number Visual Reference') ?>" /> -->
676
+
677
+ <strong><?php echo __('Signature number') ?></strong>
678
+ <br><br>
679
+ <?php echo __('Please enter signature number shown') ?> <br>
680
+ <?php echo __('when you confirm the signature above.') ?>
681
+
682
+ </div>
683
+ </div>
684
+
685
+ <div class="tool-tip" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-make-tool-tip" style="display:none;">
686
+ <div class="btn-close"><a href="#" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-make-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
687
+ <div class="tool-tip-content">
688
+ <strong><?php echo __('IBAN - International Bank Account Number') ?></strong>
689
+ <br>
690
+ <br>
691
+ <?php echo __('Please enter the following information to compose your IBAN') ?>
692
+ <br>
693
+ <br>
694
+ <table>
695
+ <tbody>
696
+ <tr>
697
+ <td align="left"><?php echo $this->__('Bank/Branch Code') ?>:</td>
698
+ <td align="left"><input maxlength="10" size="18" name="<?php echo $type; ?>-<?php echo $pay_options; ?>-xbankcode" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-xbankcode">
699
+ <div id="<?php echo $type; ?>-<?php echo $pay_options; ?>-xbankcode-description" style="display: inline;">
700
+ </div>
701
+ </td>
702
+ </tr>
703
+ <tr>
704
+ <td align="left"><?php echo $this->__('Account Number') ?>:</td>
705
+ <td align="left"><input maxlength="8" size="18" name="<?php echo $type; ?>-<?php echo $pay_options; ?>-xaccountnumber" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-xaccountnumber">
706
+ <div id="<?php echo $type; ?>-<?php echo $pay_options; ?>-xaccountnumber-description" style="display: inline;">
707
+ </div>
708
+ </td>
709
+ </tr>
710
+
711
+ <tr>
712
+ <td colspan="2"><br></td>
713
+ </tr>
714
+ <tr>
715
+ <td align="left" colspan="2">
716
+ <img src="<?php echo $this->getSkinUrl('twokcharge/images/information.png') ?>" alt="<?php echo $this->__('Information') ?>" title="<?php echo $this->__('Information') ?>" />
717
+ <div id="<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-info-description" style="display: inline;">
718
+
719
+ </div>
720
+ </td>
721
+ </tr>
722
+ <tr>
723
+ <td colspan="2"><br>
724
+ </td>
725
+ </tr>
726
+ <tr>
727
+ <td colspan="2" align="center">
728
+ <center><button type="button" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-iban-button">
729
+ <span>
730
+ <span>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $this->__('Submit') ?>&nbsp;&nbsp;&nbsp;&nbsp;</span>
731
+ </span>
732
+ </button>
733
+
734
+ </center>
735
+
736
+ </td>
737
+ </tr>
738
+ </tbody>
739
+ </table>
740
+ </div>
741
+ </div>
742
+
743
+ <div class="tool-tip" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-bic-make-tool-tip" style="display:none;">
744
+ <div class="btn-close"><a href="#" id="<?php echo $type; ?>-<?php echo $pay_options; ?>-bic-make-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
745
+ <div class="tool-tip-content">
746
+ <strong><?php echo $this->__('BIC/SWIFT Code - Business Identifier Codes') ?></strong>
747
+ <br><br>
748
+ <center>
749
+ <table>
750
+ <tbody>
751
+ <tr>
752
+ <td align="left" width="280px">
753
+ <?php echo $this->__('SWIFT codes are most commonly used for international wire transfers and are') ?>
754
+ <?php echo $this->__('comprised of 8 or 11 alphanumeric characters.') ?>
755
+ <?php echo $this->__('Please contact your bank if you do not know your BIC/SWIFT code.') ?>
756
+ </td>
757
+ </tr>
758
+ </tbody>
759
+ </table>
760
+ </center>
761
+ </div>
762
+ </div>
763
+
764
+ <ul class="form-list">
765
+ <li>
766
+ <label for="<?php echo $type; ?>-sepa-iban" class="required">
767
+ <em>*</em><?php echo $this->__('IBAN') ?></label>
768
+ <span class="input-box" style="width:310px;">
769
+ <a class="<?php echo $type; ?>-sepa-make-tool <?php echo $type; ?>-sepa-iban-make-tool" title="<?php echo $this->__('What is IBAN code') ?>" href="#">
770
+ <img src="<?php echo $this->getSkinUrl('twokcharge/images/qm.gif') ?>" alt="<?php echo $this->__('What is IBAN code') ?>" title="<?php echo $this->__('What is IBAN code') ?>" />
771
+ </a>
772
+ <input type="text" style="float:left" class="required-entry validate-alphanum" maxlength="3" size="3" name="payment[<?php echo $type; ?>_sepa_iban]" />
773
+ <input type="hidden" style="float:left" name="payment[<?php echo $type; ?>_sepa_iban_hidden]" />
774
+ </span>
775
+ </li>
776
+ <li>
777
+ <label for="<?php echo $type; ?>-sepa-bic" class="required">
778
+ <em>*</em><?php echo $this->__('BIC/SWIFT') ?></label>
779
+ <span class="input-box">
780
+ <a class="<?php echo $type; ?>-sepa-make-tool <?php echo $type; ?>-sepa-bic-make-tool" title="<?php echo $this->__('What is BIC/SWIFT code') ?>" href="#">
781
+ <img src="<?php echo $this->getSkinUrl('twokcharge/images/qm.gif') ?>" alt="<?php echo $this->__('What is BIC/SWIFT code') ?>" title="<?php echo $this->__('What is BIC/SWIFT code') ?>" />
782
+ </a>
783
+ <input type="text" style="float:left" class="required-entry validate-alphanum <?php echo $type; ?>-validate-sepa-bic" maxlength="11" size="15" name="payment[<?php echo $type; ?>_sepa_bic]" />
784
+ </span>
785
+ </li>
786
+
787
+ <li>
788
+ <label for="<?php echo $type; ?>-sepa-signature" class="required">
789
+ <em>*</em><?php echo $this->__('Signature') ?></label>
790
+ <span class="input-box" style="width:360px;">
791
+ <a class="<?php echo $type; ?>-sepa-make-tool <?php echo $type; ?>-sepa-signature-make-tool" title="<?php echo $this->__('How the signature box works') ?>" href="#">
792
+ <img src="<?php echo $this->getSkinUrl('twokcharge/images/qm.gif') ?>" alt="<?php echo $this->__('How the signature box works') ?>" title="<?php echo $this->__('How the signature box works') ?>" />
793
+ </a>
794
+ <iframe id="signaturebox" frameborder=0 style="margin:0px;width:325px;height:145px;float:left"
795
+ src="https://secure.2000charge.com/secure/signature/capturesignature.asp?clientaccount=<?php echo $clientaccount ?>&key=<?php echo $keyaccount ?>">
796
+ </iframe>
797
+ </span>
798
+ </li>
799
+ <li>
800
+ <label for="<?php echo $type; ?>-sepa-signature-number" class="required">
801
+ <em>*</em><?php echo $this->__('Signature number') ?></label>
802
+ <span class="input-box">
803
+ <!-- <input type="text" class="required-entry" maxlength="11" size="11" name="payment[sepa_bic]" /> -->
804
+ <a class="<?php echo $type; ?>-sepa-make-tool <?php echo $type; ?>-sepa-signature-number-make-tool" title="<?php echo $this->__('How you make Signature Number') ?>" href="#">
805
+ <img src="<?php echo $this->getSkinUrl('twokcharge/images/qm.gif') ?>" alt="<?php echo $this->__('How you make Signature Number') ?>" title="<?php echo $this->__('How you make Signature Number') ?>" />
806
+ </a>
807
+ <input type="text" style="float:left" class="required-entry validate-digits <?php echo $type; ?>-validate-sepa-signature" maxLength="8" size="8" name="payment[<?php echo $type; ?>_sepa_signum]">
808
+
809
+ </span>
810
+ </li>
811
+ </ul>
812
+
813
+
app/design/frontend/base/default/template/twokcharge/form/teleingreso.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the 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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
app/design/frontend/base/default/template/twokcharge/form/telepay.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the 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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
app/design/frontend/base/default/template/twokcharge/form/yellowpay.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
28
+
29
+
30
+
app/design/frontend/base/default/template/twokcharge/isapprove.phtml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ // Retrieve order
29
+
30
+ echo $this->__('Transaction has been confirmed');
31
+
32
+ //Mage::log(var_export($this->debug(), TRUE), null,'this@@@@@.log');
33
+
34
+ //if(Mage::getSingleton('customer/session')->isLoggedIn()):
35
+ // $name = Mage::getSingleton('customer/session')->getCustomer()->getName();
36
+ // $value2 = unserialize(Mage::getSingleton('twokcharge/session')->getYYY());
37
+
38
+ //endif;
39
+ ?>
40
+
41
+ <?php // echo $value2; ?>
42
+
app/design/frontend/base/default/template/twokcharge/postback.phtml ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+
29
+ // Retrieve order
30
+
31
+ /*
32
+ if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST["transactionNumber"]) ) {
33
+
34
+ $validated = $_POST['status'];
35
+
36
+ if ($_POST['account'] == $_POST['pricepoint']) {
37
+
38
+ if ($_POST['error'] == "" && $validated == "APPROVED") {
39
+
40
+ $orderId = $_POST["passthru"];
41
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
42
+
43
+ Mage::log(var_export($order->debug(), TRUE), null,'$orderOBJ_post.log');
44
+
45
+ // $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
46
+ // $order->setStatus('processing_paid');
47
+ // $order->sendNewOrderEmail();
48
+ // $order->setEmailSent(true);
49
+ // $order->save();
50
+
51
+ // Mage::getSingleton('checkout/session')->unsQuoteId();
52
+
53
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('checkout/onepage/success'));
54
+
55
+ } else if ($_POST['error'] != "" && $validated == "DECLINED") {
56
+
57
+ // $err_msg = $_POST['error'];
58
+ // $orderId = $_POST["passthru"];
59
+ // $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
60
+
61
+ // $order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Gateway has declined the payment. Error: $err_msg")->save();
62
+
63
+ // Mage::getSingleton('checkout/session')->unsQuoteId();
64
+
65
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('checkout/onepage/failure'));
66
+
67
+ }
68
+ }
69
+ else
70
+ Mage_Core_Controller_Varien_Action::_redirect('../..');
71
+
72
+ } else
73
+ */
74
+
75
+ if ($_SERVER['REQUEST_METHOD'] == "GET" && isset($_GET["transactionNumber"]) ) {
76
+
77
+ $validated = $_GET['status'];
78
+
79
+ if ($_GET['account'] == $_GET['pricepoint']) {
80
+
81
+ if ( $_GET['error'] == "" && $validated == "APPROVED")
82
+ {
83
+
84
+ $orderId = $_GET["passthru"];
85
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
86
+
87
+ Mage::log(var_export($order->debug(), TRUE), null,'$orderOBJ_get_postback.log');
88
+
89
+ if ($order->getState() == "new") {
90
+
91
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
92
+ $order->setStatus('processing_paid');
93
+ $order->sendNewOrderEmail();
94
+ $order->setEmailSent(true);
95
+ $order->save();
96
+
97
+ Mage::getSingleton('checkout/session')->unsQuoteId();
98
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('twokcharge/index/success'));
99
+
100
+ }
101
+
102
+ Mage::getSingleton('checkout/session')->unsQuoteId();
103
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('twokcharge/index/isapprove'));
104
+
105
+ } else if ($_GET['error'] != "" && $validated == "DECLINED") {
106
+
107
+ $err_msg = $_GET['error'];
108
+ $orderId = $_GET["passthru"];
109
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
110
+
111
+ $order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Gateway has declined the payment. Error: $err_msg")->save();
112
+
113
+ Mage::getSingleton('checkout/session')->unsQuoteId();
114
+
115
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('twokcharge/index/failure'));
116
+
117
+ }
118
+ }
119
+ else
120
+ Mage_Core_Controller_Varien_Action::_redirect('../..');
121
+ }
122
+
123
+ ?>
124
+
125
+ <html><body>
126
+ </body></html>
127
+
128
+
129
+
130
+
app/design/frontend/base/default/template/twokcharge/redirect.phtml ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+
29
+ // Retrieve order
30
+
31
+
32
+ if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST["transactionNumber"]) ) {
33
+
34
+ $validated = $_POST['status'];
35
+
36
+ if ($_POST['account'] == $_POST['pricepoint']) {
37
+
38
+ $orderId = $_POST["passthru"];
39
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
40
+
41
+ if ($_POST['error'] == "" && $validated == "APPROVED" && $_POST["ip"] == $order->getRemoteIp()) {
42
+
43
+ // $orderId = $_POST["passthru"];
44
+ // $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
45
+
46
+ // Mage::log(var_export($order->debug(), TRUE), null,'$orderOBJ_post.log');
47
+
48
+ // $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
49
+ // $order->setStatus('processing_paid');
50
+ // $order->sendNewOrderEmail();
51
+ // $order->setEmailSent(true);
52
+ // $order->save();
53
+
54
+ // Mage::getSingleton('checkout/session')->unsQuoteId();
55
+
56
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('checkout/onepage/success'));
57
+
58
+ } else if ($_POST['error'] != "" && $validated == "DECLINED") {
59
+
60
+ // $err_msg = $_POST['error'];
61
+ // $orderId = $_POST["passthru"];
62
+ // $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
63
+
64
+ // $order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Gateway has declined the payment. Error: $err_msg")->save();
65
+
66
+ // Mage::getSingleton('checkout/session')->unsQuoteId();
67
+
68
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('checkout/onepage/failure'));
69
+
70
+ }
71
+ }
72
+ else
73
+ Mage_Core_Controller_Varien_Action::_redirect('../..');
74
+
75
+ } elseif ($_SERVER['REQUEST_METHOD'] == "GET" && isset($_GET["transactionNumber"]) ) {
76
+
77
+ $validated = $_GET['status'];
78
+
79
+ if ($_GET['account'] == $_GET['pricepoint']) {
80
+
81
+ $orderId = $_GET["passthru"];
82
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
83
+
84
+
85
+ if ( $_GET['error'] == "" && $validated == "APPROVED" && $_GET["ip"] == $order->getRemoteIp() )
86
+ {
87
+
88
+ // $orderId = $_GET["passthru"];
89
+ // $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
90
+
91
+ // Mage::log(var_export($order->debug(), TRUE), null,'$orderOBJ_get_postback.log');
92
+
93
+ if ($order->getState() == "new") {
94
+
95
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
96
+ $order->setStatus('processing_paid');
97
+ $order->sendNewOrderEmail();
98
+ $order->setEmailSent(true);
99
+ $order->save();
100
+
101
+ Mage::getSingleton('checkout/session')->unsQuoteId();
102
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('twokcharge/index/success'));
103
+
104
+ }
105
+
106
+ Mage::getSingleton('checkout/session')->unsQuoteId();
107
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('twokcharge/index/isapprove'));
108
+
109
+ } else if ($_GET['error'] != "" && $validated == "DECLINED") {
110
+
111
+ $err_msg = $_GET['error'];
112
+ $orderId = $_GET["passthru"];
113
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
114
+
115
+ $order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Gateway has declined the payment. Error: $err_msg")->save();
116
+
117
+ Mage::getSingleton('checkout/session')->unsQuoteId();
118
+
119
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('twokcharge/index/failure'));
120
+
121
+ }
122
+ }
123
+ else
124
+ Mage_Core_Controller_Varien_Action::_redirect('../..');
125
+ }
126
+
127
+ ?>
128
+
129
+
130
+
131
+
132
+
app/design/frontend/base/default/template/twokcharge/response.phtml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ // Retrieve order
29
+ //if(Mage::getSingleton('customer/session')->isLoggedIn()):
30
+ $value1 = Mage::getSingleton('twokcharge/session')->getYYY();
31
+ $value2 = unserialize(Mage::getSingleton('twokcharge/session')->getPostBack());
32
+ $val2 = unserialize(Mage::getSingleton('twokcharge/session')->getBackFlag());
33
+ //endif;
34
+ if ($val2 == 'TRUE') {
35
+ echo $this->__('Redirect to payment service...');
36
+ $val2 = unserialize(Mage::getSingleton('twokcharge/session')->setBackFlag(serialize('FALSE')));
37
+ echo $value2;
38
+ } else {
39
+ Mage::app()->getFrontController()->getResponse()->setRedirect('../checkout/cart/');
40
+ }
41
+
42
+
43
+ ?>
44
+
app/design/frontend/base/default/template/twokcharge/success.phtml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TwoKChargeInc_TwoKCharge
23
+ * @copyright Copyright (c) 2012 2000Charge Inc (http://www.2000charge.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ // Retrieve order
29
+
30
+ echo $this->__('Transaction is successful confirmed (SUCCESS)');
31
+
32
+ //endif;
33
+ ?>
34
+
35
+ <?php // echo $value2; ?>
36
+
app/etc/modules/TwoKChargeInc_TwoKCharge.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <TwoKChargeInc_TwoKCharge>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </TwoKChargeInc_TwoKCharge>
8
+ </modules>
9
+ </config>
app/locale/en_US/TwoKChargeInc_TwoKCharge.csv ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Accepted Currency","Accepted Currency"
2
+ "My Gateway","My Gateway"
3
+ "Alternative Payments","Alternative Payments"
4
+ "Select Option","Select Option"
5
+ "Payment Method","Payment Method"
6
+ "BankCode","BankCode"
7
+ "Account Number","Account Number"
8
+ "Routing Number","Routing Number"
9
+ "IBAN","IBAN"
10
+ "BIC","BIC"
11
+ "Proceed to SUBMIT ORDER for payment instructions","Proceed to SUBMIT ORDER for payment instructions"
12
+ "Redirect to payment service...","Redirect to payment service..."
13
+ "Check Number","Check Number"
14
+ "Last 4 digits of social secure number","Last 4 digits of social secure number"
15
+ "Credit Card Type","Credit Card Type"
16
+ "Credit Card Number","Credit Card Number"
17
+ "Expiration Date","Expiration Date"
18
+ "Month","Month"
19
+ "Year","Year"
20
+ "Card Verification Number","Card Verification Number"
21
+ "Card Verification Number (CVV2)","Card Verification Number (CVV2)"
22
+ "What is this?","What is this?"
23
+ "Signature number","Signature number"
24
+ "Signature","Signature"
25
+ "Signature Number must be number","Signature Number must be number"
26
+ "BIC must have 8 or 11 characters","BIC must have 8 or 11 characters"
27
+ "German Routing Number should be 8 digits","German Routing Number should be 8 digits"
28
+ "Account and Routing Number must be number","Account and Routing Number must be number"
29
+ "Routing Number should be 8 digits","Routing Number should be 8 digits"
30
+ "Account Number must be number","Account Number must be number"
31
+ "Please chose BankType","Please chose BankType"
32
+ "letters A-Z","letters A-Z"
33
+ "numbers 0-9","numbers 0-9"
34
+ "letters A-Z and numbers 0-9","letters A-Z and numbers 0-9"
35
+ "Format","Format"
36
+ "Bank/Branch Code length","Bank/Branch Code length"
37
+ "is not correct for","is not correct for"
38
+ "Bank/Branch Code","Bank/Branch Code"
39
+ "Account Number length","Account Number length"
40
+ "Unknown Country Code","Unknown Country Code"
41
+ "IBAN length","IBAN length"
42
+ "Checksum of IBAN incorrect","Checksum of IBAN incorrect"
43
+ "How Signature box works","How Signature box works"
44
+ "Click and hold down the left mouse button inside","Click and hold down the left mouse button inside"
45
+ "the signature pad box below and script your name.","the signature pad box below and script your name."
46
+ "As part of your rights, you are entitled to a refund from","As part of your rights, you are entitled to a refund from"
47
+ "your bank under the terms and conditions of your","your bank under the terms and conditions of your"
48
+ "agreement with your bank. A refund must be claimed","agreement with your bank. A refund must be claimed"
49
+ "within 8 weeks starting from the date on which","within 8 weeks starting from the date on which"
50
+ "your account was debited. Your rights are explained","your account was debited. Your rights are explained"
51
+ "in a statement that you can obtain from your bank.","in a statement that you can obtain from your bank."
52
+ "Signature number","Signature number"
53
+ "Please enter signature number shown","Please enter signature number shown"
54
+ "when you confirm the signature above.","when you confirm the signature above."
55
+ "IBAN - International Bank Account Number","IBAN - International Bank Account Number"
56
+ "Please enter the following information to compose your IBAN","Please enter the following information to compose your IBAN"
57
+ "BIC/SWIFT Code - Business Identifier Codes","BIC/SWIFT Code - Business Identifier Codes"
58
+ "SWIFT codes are most commonly used for international wire transfers and are ","SWIFT codes are most commonly used for international wire transfers and are"
59
+ "comprised of 8 or 11 alphanumeric characters.","comprised of 8 or 11 alphanumeric characters."
60
+ "Please contact your bank if you do not know your BIC/SWIFT code.","Please contact your bank if you do not know your BIC/SWIFT code."
61
+ "Please have your online bank user id and password ready","Please have your online bank user id and password ready"
62
+ "Please enter the 4 digits of your Card Verification Number (CVV2)","Please enter the 4 digits of your Card Verification Number (CVV2)"
63
+ "Please enter the 3 digits of your Card Verification Number (CVV2)","Please enter the 3 digits of your Card Verification Number (CVV2)"
64
+ "Please enter the last 4 digits of your Social Security Number","Please enter the last 4 digits of your Social Security Number"
65
+ "BIC/SWIFT must have 8 or 11 characters","BIC/SWIFT must have 8 or 11 characters"
66
+ "Signature number must have 8 digits","Signature number must have 8 digits"
67
+ "Phone Verification Number should be 8 digits","Phone Verification Number should be 8 digits"
68
+ "Phone Verification - Description","Phone Verification - Description"
69
+ "To get phone verification number, enter your phone number, choose your method, and click "Continue" button","To get phone verification number, enter your phone number, choose your method, and click "Continue" button"
70
+ "You will receive a call or text message from our system telling you the PIN number","You will receive a call or text message from our system telling you the PIN number"
71
+ "Phone verification number is shown after your phone number is verified","Phone verification number is shown after your phone number is verified"
72
+ "Enter the phone verification number as shown","Enter the phone verification number as shown"
73
+ "How phone verfication works","How phone verfication works"
74
+
75
+
76
+
package.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>TwoKChargeInc_TwoKCharge</name>
4
+ <version>1.0.1</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>More options means more sales. Achieve more by adding alternative payment methods to your website.</summary>
10
+ <description>2000Charge offers merchants a variety of payment methods that will limit the exposure and risks involved in providing services online to consumers worldwide.&#xD;
11
+ Adding 2000Charge extension will increase your sales because you can offer consumers more options to pay:&#xD;
12
+ ACH - Online Check&#xD;
13
+ BARPAY&#xD;
14
+ EPS&#xD;
15
+ iDEAL&#xD;
16
+ GiroPay&#xD;
17
+ YellowPay&#xD;
18
+ EuroDebit&#xD;
19
+ Pay by Bank&#xD;
20
+ Directpay&#xD;
21
+ Paysafecard&#xD;
22
+ POLi&#xD;
23
+ Przelewy24&#xD;
24
+ Teleingreso&#xD;
25
+ EuroDebit SEPA&#xD;
26
+ QIWI&#xD;
27
+ TelePay</description>
28
+ <notes>This module adds the wide range of different 2000Charge methods.</notes>
29
+ <authors><author><name>2000Charge Inc</name><user>twokcharge</user><email>magento@2000charge.com</email></author></authors>
30
+ <date>2013-02-08</date>
31
+ <time>10:37:12</time>
32
+ <contents><target name="magecommunity"><dir name="TwoKChargeInc"><dir name="TwoKCharge"><dir name="Block"><file name="Form.php" hash="9fab9e6058c7c6f99c57df8ae4c622a7"/><file name="PaymentInfo.php" hash="4458e81a08f2a9e2dfae96dff41d7830"/><file name="Postback.php" hash="c4165df000bfccdba30a333f96543a6b"/><file name="Redirect.php" hash="baab3cee4a93f3280d7871abdca12df8"/></dir><dir name="Helper"><file name="Data.php" hash="09db6528a35017bec022f4871ae8b45d"/></dir><dir name="Model"><file name="Dbiban.php" hash="e2941c0a7a64082927ee50415cf121a6"/><file name="Dbsource.php" hash="9afb0805eea1b1b02950c0fc49733b8a"/><dir name="Mysql4"><dir name="Dbiban"><file name="Collection.php" hash="5584af68e309d6c5161b8374cbc66bd2"/></dir><file name="Dbiban.php" hash="425336a3109f471b20b927b45947c8c3"/><dir name="Dbsource"><file name="Collection.php" hash="d8f830429707821ce03d235030c0dc19"/></dir><file name="Dbsource.php" hash="4abc74c06176e0dcb657286b5a50f10a"/></dir><dir name="Resource"><file name="Setup.php" hash="9911bf718e8ce796aba85bb739d17657"/></dir><file name="Session.php" hash="5508051f291806efa1e03ac49d34cca6"/><file name="Standard.php" hash="d8269d2fce8da1d4db9885cf0b7c3208"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Allowtypeall.php" hash="9421a1e0d5c635a95b96650b88c2fa05"/><dir name="Payment"><file name="Twokchargetype.php" hash="045a3b5152d8b0f72afa753501b5fba8"/></dir><file name="Testmode.php" hash="287f1b5d149212a7c38977fedace7db0"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="09efa5269cde213f8ec6a54fd6476823"/><file name="PaymentController.php" hash="912ae7614275deb636839d5144bdbdaa"/></dir><dir name="etc"><file name="config.xml" hash="7e89d80213fd5c3ef76a4235a5bc5da8"/><file name="system.xml" hash="c2dc716214295ede1f0f0cdbc945d2e7"/></dir><dir name="sql"><dir name="twokcharge_setup"><file name="mysql4-install-0.1.0.php" hash="01f10887654d251ba1fa8b76dc323332"/><file name="mysql4-upgrade-0.1.0-0.1.4.php" hash="784c4b9d97eb960a1105903cb5decd08"/><file name="mysql4-upgrade-0.1.4-0.2.0.php" hash="1c4663a7e7cc26f824571cc0051758a5"/><file name="mysql4-upgrade-0.2.0-0.2.2.php" hash="0a5f21f6efb8557b96ff6a83b13bda3b"/><file name="mysql4-upgrade-0.2.2-0.2.3.php" hash="82e1e44150217a7b8a5a7887034f5098"/><file name="mysql4-upgrade-0.2.3-1.0.0.php" hash="df8e39cc5f618e053aff153b507aa72a"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="2d8cb5b7b67e66662db542f040d46140"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TwoKChargeInc_TwoKCharge.xml" hash="53f181cd30b94ffb2a8dfb693fab6d0f"/></dir></target><target name="magelocale"><dir name="en_US"><file name="TwoKChargeInc_TwoKCharge.csv" hash="8ddcaf54ac93ec7b5af8b5f9c4df350a"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="twokcharge"><file name="failure.phtml" hash="cd2f794d3259ae701e52b5f3055af4a8"/><dir name="form"><file name="ach.phtml" hash="39d6d344d155ec6a914d32148516cce4"/><file name="barpay.phtml" hash="d9b8bb18d6f28c22b60bf02cce93f3a8"/><file name="brazilpay.phtml" hash="134ba0b19fc3150c199491f962e44ced"/><file name="chinadebit.phtml" hash="aa786274e898e3d64adc8cfe2e78cff8"/><file name="creditcard.phtml" hash="c8610200b519ca61179e989df01e16f8"/><file name="directpay.phtml" hash="328b77c286ee6e27af32caad58f67002"/><file name="directpaymax.phtml" hash="6107631e0eed80e060f0298a7df2a37b"/><file name="eps.phtml" hash="d9b8bb18d6f28c22b60bf02cce93f3a8"/><file name="eurodebit.phtml" hash="164592ef92ffc299a5322be1a6bfbd04"/><file name="giropay.phtml" hash="f243ac95d565c8b33ad9db9ec1942b4d"/><file name="ideal.phtml" hash="3ec9b88080d1930d3e36dd1de919fe25"/><file name="paysafe.phtml" hash="d9b8bb18d6f28c22b60bf02cce93f3a8"/><file name="poli.phtml" hash="d9b8bb18d6f28c22b60bf02cce93f3a8"/><file name="przelewy.phtml" hash="d9b8bb18d6f28c22b60bf02cce93f3a8"/><file name="qiwi.phtml" hash="d9b8bb18d6f28c22b60bf02cce93f3a8"/><file name="sepa.phtml" hash="717dfa85230b6e1d4141819eecc6c952"/><file name="teleingreso.phtml" hash="144506852d8dacc40820f30052d46730"/><file name="telepay.phtml" hash="d9b8bb18d6f28c22b60bf02cce93f3a8"/><file name="yellowpay.phtml" hash="7d90a517b723ff2d3ce1d0b4b216903f"/></dir><file name="form.phtml" hash="6324ec4bbaba9941f8221a464a25a4db"/><file name="isapprove.phtml" hash="a6a49ecc833842f6e73823295c7e52fb"/><file name="postback.phtml" hash="817721301eb611669071b479c2bee13b"/><file name="redirect.phtml" hash="3c176a19395f8be45e00d647142f831a"/><file name="response.phtml" hash="8626c606900c46c0a0d97da6cfe6f3de"/><file name="success.phtml" hash="91c00024f5f9a67d5614e3654c7eaddb"/></dir></dir><dir name="layout"><file name="twokcharge.xml" hash="20ee7f76e52ecdfece78ffca329d5cab"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="twokcharge"><dir name="css"><file name="styles.css" hash="35c19911069f5c1ff27f0d62466fc034"/></dir><dir name="images"><file name="cvv22.gif" hash="83cdd38bf110b0f9c52fe84b56f45298"/><file name="information.png" hash="db8ec00f3807b9c6a4f83f860507473c"/><file name="phoneverf1.jpg" hash="e767327aeb2ac74f63dab481102963ab"/><file name="phoneverf2.jpg" hash="8a2b8e54fcc8ed9e9d374798b9a151df"/><file name="phoneverf3.jpg" hash="6e01da6a98e7416993974867e155350a"/><file name="phoneverf4.jpg" hash="c2d41b2e90ff26d1cd5b25c104bd14e5"/><file name="qm.gif" hash="90db9e3e88dbd76eaf7c1f902262ddc6"/></dir></dir></dir></dir></dir></target></contents>
33
+ <compatible/>
34
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mygento_JQueryLib</name><channel>community</channel><min>1.8.1.0</min><max></max></package></required></dependencies>
35
+ </package>
skin/frontend/base/default/twokcharge/css/styles.css ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magento
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magentocommerce.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
17
+ * versions in the future. If you wish to customize Magento for your
18
+ * needs please refer to http://www.magentocommerce.com for more information.
19
+ *
20
+ * @category design
21
+ * @package base_default
22
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+
26
+ .twokcharge-sepa-make-tool img{
27
+ padding-top: 2px;
28
+ }
29
+
30
+ .twokcharge-sepa-make-tool {
31
+ cursor: help;
32
+ font-size: 11px;
33
+ margin-left: 5px;
34
+ }
35
+
36
+ .twokcharge-sepa-make-tool:hover {
37
+ text-decoration: none;
38
+ }
39
+
40
+ .twokcharge-ach-tool-tip-content td{
41
+ padding: 5px 5px 5px 0px;
42
+ }
43
+
44
+ .twokcharge-ach-tool-tip-content td.last{
45
+ padding-left: 5px;
46
+ padding-right: 0;
47
+ width: 165px;
48
+ }
49
+ .twokcharge-ach-tool-tip-content td img {
50
+ -webkit-border-radius: 3px;
51
+ -moz-border-radius: 3px;
52
+ border-radius: 3px;
53
+ border: 1px solid #A5A5A5;
54
+ display: block;
55
+ margin-left: auto;
56
+ margin-right: auto;
57
+ padding: 1px;
58
+ }
skin/frontend/base/default/twokcharge/images/cvv22.gif ADDED
Binary file
skin/frontend/base/default/twokcharge/images/information.png ADDED
Binary file
skin/frontend/base/default/twokcharge/images/phoneverf1.jpg ADDED
Binary file
skin/frontend/base/default/twokcharge/images/phoneverf2.jpg ADDED
Binary file
skin/frontend/base/default/twokcharge/images/phoneverf3.jpg ADDED
Binary file
skin/frontend/base/default/twokcharge/images/phoneverf4.jpg ADDED
Binary file
skin/frontend/base/default/twokcharge/images/qm.gif ADDED
Binary file